author | Claus Gittinger <cg@exept.de> |
Mon, 14 Feb 2011 18:16:20 +0100 | |
changeset 9770 | b0f562b60e4b |
parent 9694 | eb3dff842677 |
child 10221 | f3fcf030f6b4 |
permissions | -rw-r--r-- |
6179 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5302 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
ToolApplicationModel subclass:#MultiViewToolApplication |
|
15 |
instanceVariableNames:'workspaces tabList selectedWorkspaceIndexHolder workspaceHolder' |
|
8615 | 16 |
classVariableNames:'DefaultInfoVisible DefaultEditToolBarVisible |
17 |
DefaultToolBarVisible' |
|
5302 | 18 |
poolDictionaries:'' |
19 |
category:'Interface-Smalltalk' |
|
20 |
! |
|
21 |
||
22 |
!MultiViewToolApplication class methodsFor:'documentation'! |
|
23 |
||
6179 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
5302 | 38 |
documentation |
39 |
" |
|
8497 | 40 |
Common code for multiView applications (Workspace, Terminal app and maybe more later) |
5302 | 41 |
|
42 |
[author:] |
|
43 |
Claus Gittinger |
|
44 |
" |
|
45 |
! ! |
|
46 |
||
7824 | 47 |
!MultiViewToolApplication class methodsFor:'defaults'! |
48 |
||
8497 | 49 |
defaultEditToolbarVisible |
50 |
^ DefaultEditToolBarVisible ? false |
|
51 |
||
52 |
"Created: / 14-07-2007 / 16:38:47 / cg" |
|
53 |
! |
|
54 |
||
7824 | 55 |
defaultInfoVisible |
56 |
^ DefaultInfoVisible ? true |
|
57 |
||
58 |
"Created: / 14-07-2007 / 16:38:32 / cg" |
|
59 |
! |
|
60 |
||
61 |
defaultToolbarVisible |
|
62 |
^ DefaultToolBarVisible ? false |
|
63 |
||
64 |
"Created: / 14-07-2007 / 16:38:47 / cg" |
|
65 |
! ! |
|
66 |
||
9143 | 67 |
!MultiViewToolApplication class methodsFor:'help specs'! |
68 |
||
69 |
flyByHelpSpec |
|
70 |
"This resource specification was automatically generated |
|
71 |
by the UIHelpTool of ST/X." |
|
72 |
||
73 |
"Do not manually edit this!! If it is corrupted, |
|
74 |
the UIHelpTool may not be able to read the specification." |
|
75 |
||
76 |
" |
|
77 |
UIHelpTool openOnClass:MultiViewToolApplication |
|
78 |
" |
|
79 |
||
80 |
<resource: #help> |
|
81 |
||
82 |
^ super flyByHelpSpec addPairsFrom:#( |
|
83 |
||
84 |
#hideToolBar |
|
85 |
'Hide Toolbar. Show again via the "View"-Menu' |
|
86 |
||
87 |
#hideEditToolBar |
|
88 |
'Hide Edit-Toolbar. Show again via the "View"-Menu' |
|
89 |
||
90 |
) |
|
91 |
! ! |
|
92 |
||
7650 | 93 |
!MultiViewToolApplication class methodsFor:'image specs'! |
94 |
||
95 |
hideToolBarIcon |
|
96 |
<resource: #programImage> |
|
97 |
||
98 |
^ ToolbarIconLibrary hideToolBarIcon |
|
99 |
||
100 |
"Created: / 18-02-2007 / 14:53:38 / cg" |
|
101 |
! ! |
|
102 |
||
5302 | 103 |
!MultiViewToolApplication class methodsFor:'interface specs'! |
104 |
||
105 |
windowSpec |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
106 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
107 |
by the UIPainter of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
108 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
109 |
"Do not manually edit this!! If it is corrupted, |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
110 |
the UIPainter may not be able to read the specification." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
111 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
112 |
" |
7650 | 113 |
UIPainter new openOnClass:MultiViewToolApplication andSelector:#windowSpec |
114 |
MultiViewToolApplication new openInterface:#windowSpec |
|
115 |
MultiViewToolApplication open |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
116 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
117 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
118 |
<resource: #canvas> |
5302 | 119 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
120 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
121 |
#(FullSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
122 |
name: windowSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
123 |
window: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
124 |
(WindowSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
125 |
label: 'Workspace' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
126 |
name: 'Workspace' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
127 |
min: (Point 10 10) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
128 |
bounds: (Rectangle 0 0 432 241) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
129 |
menu: mainMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
130 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
131 |
component: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
132 |
(SpecCollection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
133 |
collection: ( |
7650 | 134 |
(ViewSpec |
135 |
name: 'ToolBar' |
|
8231 | 136 |
layout: (LayoutFrame 0 0 0 0 0 1 32 0) |
7650 | 137 |
visibilityChannel: toolBarVisibleHolder |
138 |
component: |
|
139 |
(SpecCollection |
|
140 |
collection: ( |
|
141 |
(ActionButtonSpec |
|
142 |
label: 'hideToolBarIcon' |
|
143 |
name: 'HideToolBarButton' |
|
144 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
145 |
activeHelpKey: hideToolBar |
|
146 |
hasCharacterOrientedLabel: false |
|
147 |
translateLabel: true |
|
148 |
model: hideToolbar |
|
149 |
postBuildCallback: hideToolBarButtonCreated: |
|
150 |
) |
|
151 |
(MenuPanelSpec |
|
152 |
name: 'ToolBarMenu' |
|
153 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
154 |
visibilityChannel: toolBarVisibleHolder |
|
155 |
menu: toolBarMenu |
|
156 |
textDefault: true |
|
157 |
) |
|
158 |
) |
|
159 |
||
160 |
) |
|
161 |
) |
|
8497 | 162 |
(ViewSpec |
163 |
name: 'EditToolBar' |
|
164 |
layout: (LayoutFrame 0 0 32 0 0 1 64 0) |
|
165 |
visibilityChannel: editToolBarVisibleHolder |
|
166 |
component: |
|
167 |
(SpecCollection |
|
168 |
collection: ( |
|
169 |
(ActionButtonSpec |
|
170 |
label: 'hideToolBarIcon' |
|
171 |
name: 'HideEditToolBarButton' |
|
172 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
9143 | 173 |
activeHelpKey: hideEditToolBar |
8497 | 174 |
hasCharacterOrientedLabel: false |
175 |
translateLabel: true |
|
176 |
model: hideEditToolbar |
|
177 |
postBuildCallback: hideToolBarButtonCreated: |
|
178 |
) |
|
179 |
(MenuPanelSpec |
|
180 |
name: 'EditToolBar1' |
|
181 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
182 |
visibilityChannel: editToolBarVisibleHolder |
|
183 |
menu: editToolBarMenu |
|
184 |
textDefault: true |
|
185 |
) |
|
186 |
) |
|
187 |
||
188 |
) |
|
189 |
) |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
190 |
(NoteBookViewSpec |
7650 | 191 |
name: 'NoteBook' |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
192 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
193 |
model: selectedWorkspaceIndexHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
194 |
menu: tabList |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
195 |
useIndex: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
196 |
accessTabMenuAction: tabMenuAt: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
197 |
destroyTabAction: destroyTab: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
198 |
canvas: workspaceHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
199 |
canvasInset: 0 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
200 |
keepCanvasAlive: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
201 |
tabLevel: 1 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
202 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
203 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
204 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
205 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
206 |
) |
5302 | 207 |
! ! |
208 |
||
209 |
!MultiViewToolApplication class methodsFor:'menu specs'! |
|
210 |
||
8497 | 211 |
editToolBarMenu |
212 |
"This resource specification was automatically generated |
|
213 |
by the MenuEditor of ST/X." |
|
214 |
||
215 |
"Do not manually edit this!! If it is corrupted, |
|
216 |
the MenuEditor may not be able to read the specification." |
|
217 |
||
218 |
" |
|
219 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu |
|
220 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp |
|
221 |
" |
|
222 |
||
223 |
<resource: #menu> |
|
224 |
||
225 |
^ |
|
226 |
#(Menu |
|
227 |
( |
|
228 |
) |
|
229 |
nil |
|
230 |
nil |
|
231 |
) |
|
232 |
||
233 |
"Modified: / 18-02-2007 / 14:59:21 / cg" |
|
234 |
! |
|
235 |
||
5302 | 236 |
mainMenu |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
237 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
238 |
by the MenuEditor of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
239 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
240 |
"Do not manually edit this!! If it is corrupted, |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
241 |
the MenuEditor may not be able to read the specification." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
242 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
243 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
244 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#mainMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
245 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication mainMenu)) startUp |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
246 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
247 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
248 |
<resource: #menu> |
5302 | 249 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
250 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
251 |
#(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
252 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
253 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
254 |
label: 'File' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
255 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
256 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
257 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
258 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
259 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
260 |
label: 'New Editor' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
261 |
itemValue: newWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
262 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
263 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
264 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
265 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
266 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
267 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
268 |
label: 'Load File...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
269 |
itemValue: menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
270 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
271 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
272 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
273 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
274 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
275 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
276 |
label: 'Save As...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
277 |
itemValue: menuSaveAs |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
278 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
279 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
280 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
281 |
enabled: hasMultipleBuffersHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
282 |
label: 'Save all As...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
283 |
itemValue: menuSaveAllAs |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
284 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
285 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
286 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
287 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
288 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
289 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
290 |
label: 'Print...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
291 |
itemValue: menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
292 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
293 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
294 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
295 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
296 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
297 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
298 |
label: 'Exit' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
299 |
itemValue: closeRequest |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
300 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
301 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
302 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
303 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
304 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
305 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
306 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
307 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
308 |
label: 'Buffers' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
309 |
nameKey: Buffer |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
310 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
311 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
312 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
313 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
314 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
315 |
label: 'Add Buffer' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
316 |
itemValue: addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
317 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
318 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
319 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
320 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
321 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
322 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
323 |
label: 'Rename...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
324 |
itemValue: renameWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
325 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
326 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
327 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
328 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
329 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
330 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
331 |
enabled: canRemoveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
332 |
label: 'Remove Buffer' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
333 |
itemValue: removeWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
334 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
335 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
336 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
337 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
338 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
339 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
340 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
341 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
342 |
label: 'Edit' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
343 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
344 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
345 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
346 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
347 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
348 |
enabled: hasSelectionInActiveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
349 |
label: 'Cut' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
350 |
itemValue: cutSelection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
351 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
352 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
353 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
354 |
enabled: hasSelectionInActiveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
355 |
label: 'Copy' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
356 |
itemValue: copySelection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
357 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
358 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
359 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
360 |
label: 'Paste' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
361 |
itemValue: paste |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
362 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
363 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
364 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
365 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
366 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
367 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
368 |
label: 'Select All' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
369 |
itemValue: selectAll |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
370 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
371 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
372 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
373 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
374 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
375 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
376 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
377 |
(MenuItem |
8500 | 378 |
label: 'View' |
379 |
translateLabel: true |
|
380 |
submenuChannel: viewMenu |
|
381 |
keepLinkedMenu: true |
|
382 |
) |
|
383 |
(MenuItem |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
384 |
label: 'MENU_Help' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
385 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
386 |
startGroup: conditionalRight |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
387 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
388 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
389 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
390 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
391 |
label: 'About this Application...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
392 |
itemValue: openAboutThisApplication |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
393 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
394 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
395 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
396 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
397 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
398 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
399 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
400 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
401 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
402 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
403 |
) |
5302 | 404 |
! |
405 |
||
406 |
tabMenu |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
407 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
408 |
by the MenuEditor of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
409 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
410 |
"Do not manually edit this!! If it is corrupted, |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
411 |
the MenuEditor may not be able to read the specification." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
412 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
413 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
414 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
415 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
416 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
417 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
418 |
<resource: #menu> |
5302 | 419 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
420 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
421 |
#(#Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
422 |
#( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
423 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
424 |
#label: 'Add Tab' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
425 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
426 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
427 |
#value: #addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
428 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
429 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
430 |
#label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
431 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
432 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
433 |
#label: 'Remove Tab' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
434 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
435 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
436 |
#value: #removeWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
437 |
#enabled: #canRemoveWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
438 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
439 |
#(#MenuItem |
8772 | 440 |
#label: 'Remove all other Tabs' |
441 |
#translateLabel: true |
|
442 |
"/ #triggerOnDown: true |
|
443 |
#value: #removeAllWorkspacesExcept: |
|
444 |
#enabled: #canRemoveAllWorkspacesExcept: |
|
445 |
#isVisible: false |
|
446 |
) |
|
447 |
#(#MenuItem |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
448 |
#label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
449 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
450 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
451 |
#label: 'Rename...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
452 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
453 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
454 |
#value: #renameWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
455 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
456 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
457 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
458 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
459 |
) |
7650 | 460 |
! |
461 |
||
462 |
toolBarMenu |
|
463 |
"This resource specification was automatically generated |
|
464 |
by the MenuEditor of ST/X." |
|
465 |
||
466 |
"Do not manually edit this!! If it is corrupted, |
|
467 |
the MenuEditor may not be able to read the specification." |
|
468 |
||
469 |
" |
|
470 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu |
|
471 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp |
|
472 |
" |
|
473 |
||
474 |
<resource: #menu> |
|
475 |
||
476 |
^ |
|
477 |
#(Menu |
|
478 |
( |
|
479 |
(MenuItem |
|
480 |
label: '' |
|
481 |
) |
|
482 |
(MenuItem |
|
483 |
"/ activeHelpKey: addWorkspace |
|
484 |
label: 'Add Buffer' |
|
485 |
itemValue: addWorkspace |
|
486 |
translateLabel: true |
|
487 |
isButton: true |
|
488 |
labelImage: (ResourceRetriever ToolbarIconLibrary addBufferIcon) |
|
489 |
) |
|
490 |
) |
|
491 |
nil |
|
492 |
nil |
|
493 |
) |
|
494 |
||
495 |
"Modified: / 18-02-2007 / 14:59:21 / cg" |
|
496 |
! |
|
497 |
||
498 |
viewMenu |
|
499 |
"This resource specification was automatically generated |
|
500 |
by the MenuEditor of ST/X." |
|
501 |
||
502 |
"Do not manually edit this!! If it is corrupted, |
|
503 |
the MenuEditor may not be able to read the specification." |
|
504 |
||
505 |
" |
|
9058 | 506 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#viewMenu |
507 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication viewMenu)) startUp |
|
7650 | 508 |
" |
509 |
||
510 |
<resource: #menu> |
|
511 |
||
512 |
^ |
|
513 |
#(Menu |
|
514 |
( |
|
515 |
(MenuItem |
|
516 |
label: 'Toolbar' |
|
517 |
translateLabel: true |
|
518 |
hideMenuOnActivated: false |
|
519 |
indication: toolBarVisibleHolder |
|
520 |
) |
|
521 |
(MenuItem |
|
8497 | 522 |
label: 'Editor Toolbar' |
523 |
translateLabel: true |
|
9058 | 524 |
isVisible: hasEditToolBar |
8497 | 525 |
hideMenuOnActivated: false |
526 |
indication: editToolBarVisibleHolder |
|
527 |
) |
|
528 |
(MenuItem |
|
7650 | 529 |
label: 'Info' |
530 |
translateLabel: true |
|
9380 | 531 |
isVisible: hasInfoLabel |
7650 | 532 |
hideMenuOnActivated: false |
7653
71f20b5aab8d
Do not refer to non-existant aspect
Stefan Vogel <sv@exept.de>
parents:
7650
diff
changeset
|
533 |
indication: infoVisibleHolder |
7650 | 534 |
) |
9058 | 535 |
(MenuItem |
536 |
label: '-' |
|
537 |
) |
|
538 |
(MenuItem |
|
539 |
label: 'Settings...' |
|
540 |
itemValue: openSettingsDialog |
|
541 |
translateLabel: true |
|
542 |
) |
|
7650 | 543 |
) |
544 |
nil |
|
545 |
nil |
|
546 |
) |
|
5302 | 547 |
! ! |
548 |
||
549 |
!MultiViewToolApplication class methodsFor:'queries'! |
|
550 |
||
551 |
isVisualStartable |
|
552 |
"return true, if this application can be started via #open. |
|
553 |
(to allow start of a change browser via double-click in the browser)" |
|
554 |
||
5303 | 555 |
self == MultiViewToolApplication ifTrue:[^false]. |
5302 | 556 |
^ super isVisualStartable |
557 |
! ! |
|
558 |
||
559 |
!MultiViewToolApplication methodsFor:'accessing'! |
|
560 |
||
561 |
selectedWorkspace |
|
562 |
|wsIndex| |
|
563 |
||
564 |
workspaces isNil ifTrue:[ |
|
565 |
workspaces := OrderedCollection new. |
|
566 |
]. |
|
567 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
568 |
wsIndex == 0 ifTrue:[ |
|
569 |
^ nil |
|
570 |
]. |
|
571 |
||
572 |
workspaces size < wsIndex ifTrue:[ |
|
573 |
workspaces grow:wsIndex. |
|
574 |
workspaces at:wsIndex put:(self createWorkspace). |
|
575 |
]. |
|
576 |
^ workspaces at:wsIndex |
|
577 |
! |
|
578 |
||
579 |
tabMenuAt:index |
|
6244 | 580 |
<resource: #programMenu> |
581 |
||
5302 | 582 |
|m i ws| |
583 |
||
584 |
m := self class tabMenu. |
|
585 |
m := m decodeAsLiteralArray. |
|
8772 | 586 |
|
5302 | 587 |
i := m detectItem:[:item | item value == #removeWorkspace:] ifNone:nil. |
588 |
i notNil ifTrue:[ |
|
589 |
i argument:index. |
|
590 |
index ~~ self selectedWorkspaceIndexHolder value ifTrue:[ |
|
8772 | 591 |
"/ for now: if that buffer is modified, do not allow removing. |
5302 | 592 |
"/ (must be brought to front, in order for check-for-modification to work) |
593 |
ws := workspaces at:index. |
|
594 |
(ws isKindOf:ScrollableView) ifTrue:[ |
|
595 |
ws := ws scrolledView |
|
596 |
]. |
|
597 |
((ws isKindOf:TextView) not |
|
598 |
or:[ ws modified ]) |
|
599 |
ifTrue:[ |
|
600 |
i disable |
|
601 |
]. |
|
602 |
]. |
|
603 |
]. |
|
8772 | 604 |
|
605 |
i := m detectItem:[:item | item value == #removeAllWorkspacesExcept:] ifNone:nil. |
|
606 |
i notNil ifTrue:[ |
|
607 |
i argument:index. |
|
608 |
"/ for now: if any buffer is modified, do not allow removing. |
|
609 |
"/ (must be brought to front, in order for check-for-modification to work) |
|
610 |
workspaces doWithIndex:[:wsArg :idx | |
|
611 |
|ws| |
|
612 |
||
613 |
idx ~~ index ifTrue:[ |
|
614 |
ws := wsArg. |
|
615 |
(ws isKindOf:ScrollableView) ifTrue:[ |
|
616 |
ws := ws scrolledView |
|
617 |
]. |
|
618 |
((ws isKindOf:TextView) and:[ ws modified ]) |
|
619 |
ifTrue:[ |
|
620 |
i disable |
|
621 |
]. |
|
622 |
]. |
|
623 |
]. |
|
624 |
]. |
|
625 |
||
5302 | 626 |
i := m detectItem:[:item | item value == #renameWorkspace:] ifNone:nil. |
627 |
i notNil ifTrue:[ |
|
628 |
i argument:index. |
|
629 |
]. |
|
630 |
||
631 |
m findGuiResourcesIn:self. |
|
632 |
^ m |
|
633 |
! |
|
634 |
||
635 |
workspaceHolder |
|
636 |
workspaceHolder isNil ifTrue:[ |
|
637 |
workspaceHolder := ValueHolder with:(self selectedWorkspace). |
|
638 |
]. |
|
639 |
^ workspaceHolder |
|
7852 | 640 |
! |
641 |
||
642 |
workspaces |
|
643 |
^ workspaces |
|
5302 | 644 |
! ! |
645 |
||
646 |
!MultiViewToolApplication methodsFor:'aspects'! |
|
647 |
||
8497 | 648 |
editToolBarVisibleHolder |
649 |
|holder| |
|
650 |
||
651 |
(holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[ |
|
652 |
holder := self class defaultEditToolbarVisible asValue. |
|
653 |
builder aspectAt:#editToolBarVisibleHolder put: holder. |
|
654 |
holder addDependent:self. |
|
655 |
]. |
|
656 |
^ holder |
|
657 |
||
658 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
659 |
"Modified: / 14-07-2007 / 16:39:55 / cg" |
|
660 |
! |
|
661 |
||
662 |
hasEditToolBar |
|
663 |
^ (self menuFor:#editToolBarMenu) decodeAsLiteralArray hasItems |
|
664 |
! |
|
665 |
||
9380 | 666 |
hasInfoLabel |
667 |
^ false |
|
668 |
! |
|
669 |
||
7650 | 670 |
infoVisibleHolder |
671 |
|holder| |
|
672 |
||
673 |
(holder := builder bindingAt:#infoVisibleHolder) isNil ifTrue:[ |
|
7824 | 674 |
holder := self class defaultInfoVisible asValue. |
7650 | 675 |
builder aspectAt:#infoVisibleHolder put: holder. |
676 |
holder addDependent:self. |
|
677 |
]. |
|
678 |
^ holder |
|
679 |
||
680 |
"Created: / 18-02-2007 / 15:01:05 / cg" |
|
7824 | 681 |
"Modified: / 14-07-2007 / 16:39:20 / cg" |
7650 | 682 |
! |
683 |
||
5302 | 684 |
selectedWorkspaceIndexHolder |
685 |
selectedWorkspaceIndexHolder isNil ifTrue:[ |
|
686 |
selectedWorkspaceIndexHolder := 1 asValue. |
|
687 |
selectedWorkspaceIndexHolder onChangeSend:#workspaceSelectionChanged to:self. |
|
688 |
]. |
|
689 |
^ selectedWorkspaceIndexHolder. |
|
690 |
! |
|
691 |
||
692 |
tabList |
|
693 |
tabList isNil ifTrue:[ |
|
694 |
tabList := List new. |
|
695 |
]. |
|
696 |
^ tabList. |
|
7650 | 697 |
! |
698 |
||
699 |
toolBarVisibleHolder |
|
700 |
|holder| |
|
701 |
||
702 |
(holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[ |
|
7824 | 703 |
holder := self class defaultToolbarVisible asValue. |
7650 | 704 |
builder aspectAt:#toolBarVisibleHolder put: holder. |
705 |
holder addDependent:self. |
|
706 |
]. |
|
707 |
^ holder |
|
708 |
||
709 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
7824 | 710 |
"Modified: / 14-07-2007 / 16:39:55 / cg" |
5302 | 711 |
! ! |
712 |
||
713 |
!MultiViewToolApplication methodsFor:'aspects-queries'! |
|
714 |
||
8772 | 715 |
canRemoveAllWorkspacesExcept:idx |
716 |
^ self tabList size > 1 |
|
717 |
! |
|
718 |
||
5302 | 719 |
canRemoveWorkspace |
720 |
^ self canRemoveWorkspace:(self selectedWorkspaceIndexHolder value) |
|
721 |
! |
|
722 |
||
723 |
canRemoveWorkspace:idx |
|
724 |
^ self tabList size > 1 |
|
725 |
"/ and:[ (self workspacesTextViewAt:(self selectedWorkspaceIndexHolder value)) |
|
726 |
! |
|
727 |
||
728 |
hasMultipleBuffersHolder |
|
729 |
^ [ workspaces size > 1 ] |
|
730 |
! |
|
731 |
||
732 |
hasSelectionInActiveWorkspace |
|
6424 | 733 |
|v| |
734 |
||
735 |
v := self selectedWorkspacesTextView. |
|
736 |
^ v notNil and:[v selectionAsString size > 0] |
|
8528 | 737 |
! |
738 |
||
739 |
hasTextInActiveWorkspace |
|
740 |
|v| |
|
741 |
||
742 |
v := self selectedWorkspacesTextView. |
|
743 |
^ v notNil |
|
744 |
and:[v list notEmptyOrNil |
|
745 |
and:[v list contains:[:l | l notEmptyOrNil]]] |
|
5302 | 746 |
! ! |
747 |
||
7650 | 748 |
!MultiViewToolApplication methodsFor:'change & update'! |
749 |
||
8497 | 750 |
infoVisibilityChanged |
751 |
|visible cFrame bottomOffset| |
|
752 |
||
753 |
visible := self infoVisibleHolder value. |
|
754 |
||
9380 | 755 |
cFrame := builder findComponentAt:#NoteBook. "/ #CodeView. |
8497 | 756 |
cFrame notNil ifTrue:[ |
757 |
visible ifFalse:[ |
|
758 |
bottomOffset := 0. |
|
759 |
] ifTrue:[ |
|
760 |
bottomOffset := -25. |
|
761 |
]. |
|
762 |
cFrame layout bottomOffset:bottomOffset. |
|
763 |
cFrame container notNil ifTrue:[ |
|
764 |
cFrame containerChangedSize. |
|
765 |
]. |
|
766 |
]. |
|
767 |
DefaultInfoVisible := visible |
|
768 |
||
769 |
"Created: / 18-02-2007 / 15:01:55 / cg" |
|
770 |
! |
|
771 |
||
772 |
toolBarVisibilityChanged |
|
773 |
|toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset| |
|
774 |
||
775 |
topOffset := 0. |
|
776 |
||
777 |
toolBar := self componentAt:#ToolBar. |
|
778 |
toolBar notNil ifTrue:[ |
|
779 |
toolBarVisible := self toolBarVisibleHolder value. |
|
780 |
DefaultToolBarVisible := toolBarVisible. |
|
781 |
toolBarVisible ifTrue:[ |
|
782 |
topOffset := topOffset + toolBar height. |
|
783 |
] |
|
784 |
]. |
|
785 |
||
786 |
editToolBar := self componentAt:#EditToolBar. |
|
787 |
editToolBar notNil ifTrue:[ |
|
788 |
editToolBar layout |
|
789 |
topOffset:topOffset bottomOffset:(topOffset + editToolBar height). |
|
790 |
"/ force it to recompute its dimension |
|
791 |
editToolBar container notNil ifTrue:[ |
|
792 |
editToolBar containerChangedSize. |
|
793 |
]. |
|
794 |
editToolBarVisible := self editToolBarVisibleHolder value. |
|
795 |
DefaultEditToolBarVisible := editToolBarVisible. |
|
796 |
editToolBarVisible ifTrue:[ |
|
797 |
topOffset := topOffset + editToolBar height. |
|
798 |
] |
|
799 |
]. |
|
800 |
||
801 |
noteBook := self componentAt:#NoteBook. |
|
802 |
noteBook notNil ifTrue:[ |
|
803 |
noteBook layout topOffset:topOffset. |
|
804 |
"/ force it to recompute its dimension |
|
805 |
noteBook container notNil ifTrue:[ |
|
806 |
noteBook containerChangedSize. |
|
807 |
]. |
|
808 |
]. |
|
809 |
||
810 |
"Created: / 18-02-2007 / 14:46:22 / cg" |
|
811 |
! |
|
812 |
||
7650 | 813 |
update:something with:aParameter from:changedObject |
8497 | 814 |
((changedObject == self toolBarVisibleHolder) |
815 |
or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[ |
|
7650 | 816 |
self toolBarVisibilityChanged. |
817 |
^ self |
|
818 |
]. |
|
7824 | 819 |
changedObject == self infoVisibleHolder ifTrue:[ |
820 |
self infoVisibilityChanged. |
|
821 |
^ self |
|
822 |
]. |
|
7650 | 823 |
^ super update:something with:aParameter from:changedObject |
824 |
||
7824 | 825 |
"Modified: / 14-07-2007 / 16:46:14 / cg" |
7650 | 826 |
! ! |
827 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
828 |
!MultiViewToolApplication methodsFor:'defaults'! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
829 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
830 |
defaultFileNameForLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
831 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
832 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
833 |
"Created: / 25-10-2006 / 14:56:19 / cg" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
834 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
835 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
836 |
defaultFileNameForSave |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
837 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
838 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
839 |
"Modified: / 25-10-2006 / 14:54:13 / cg" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
840 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
841 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
842 |
defaultFileNameForSaveAll |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
843 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
844 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
845 |
"Modified: / 25-10-2006 / 14:55:50 / cg" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
846 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
847 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
848 |
defaultPatternLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
849 |
^ '*.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
850 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
851 |
"Created: / 25-10-2006 / 14:57:18 / cg" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
852 |
! ! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
853 |
|
7650 | 854 |
!MultiViewToolApplication methodsFor:'initialization'! |
855 |
||
856 |
hideToolBarButtonCreated:aButton |
|
857 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
858 |
"/ aButton passiveLevel:1. |
|
859 |
aButton activeLevel:-1. |
|
860 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
861 |
||
862 |
"Created: / 18-02-2007 / 14:48:28 / cg" |
|
863 |
! |
|
864 |
||
865 |
postBuildWith:aBuilder |
|
866 |
super postBuildWith:aBuilder. |
|
8497 | 867 |
|
7650 | 868 |
self infoVisibleHolder value ifTrue:[ self infoVisibilityChanged ]. |
8497 | 869 |
(self toolBarVisibleHolder value |
870 |
or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ]. |
|
7650 | 871 |
|
9694 | 872 |
self workspaceSelectionChanged. |
873 |
||
7650 | 874 |
"Created: / 18-02-2007 / 15:03:08 / cg" |
9694 | 875 |
"Modified: / 22-01-2011 / 11:46:35 / cg" |
7650 | 876 |
! ! |
877 |
||
5302 | 878 |
!MultiViewToolApplication methodsFor:'menu-actions'! |
879 |
||
880 |
addWindow:aWindow named:name |
|
881 |
^ self addWindow:aWindow named:name asFirst:false |
|
882 |
! |
|
883 |
||
884 |
addWindow:aWindow named:name asFirst:asFirst |
|
9664 | 885 |
|tabList wsIndex newSelectedIndex w| |
5302 | 886 |
|
887 |
tabList := self tabList. |
|
888 |
wsIndex := tabList size + 1. |
|
889 |
wsIndex == 1 ifTrue:[ |
|
890 |
"/ first - add a name for the first tab |
|
891 |
tabList add:(self window label). "/ 'Workspace'. |
|
892 |
wsIndex := wsIndex + 1. |
|
893 |
]. |
|
894 |
||
895 |
workspaces grow:wsIndex. |
|
896 |
asFirst ifTrue:[ |
|
897 |
tabList addFirst:(name bindWith:wsIndex). |
|
898 |
workspaces replaceFrom:2 to:wsIndex with:workspaces startingAt:1. |
|
899 |
newSelectedIndex := 1. |
|
900 |
] ifFalse:[ |
|
901 |
tabList addLast:(name bindWith:wsIndex). |
|
902 |
newSelectedIndex := wsIndex. |
|
903 |
]. |
|
9664 | 904 |
|
9694 | 905 |
w := aWindow scrolledView. |
9664 | 906 |
w isKeyboardConsumer ifTrue:[ |
907 |
w takeFocusWhenMapped:true. |
|
908 |
]. |
|
909 |
||
5302 | 910 |
workspaces at:newSelectedIndex put:aWindow. |
9694 | 911 |
self selectedWorkspaceIndexHolder value:newSelectedIndex. |
912 |
self workspaceSelectionChanged. |
|
913 |
||
5302 | 914 |
"/ workspaceHolder value:aWindow. |
9664 | 915 |
|
9694 | 916 |
"Modified: / 22-01-2011 / 12:02:59 / cg" |
5302 | 917 |
! |
918 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
919 |
addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
920 |
self addWindow:(self createWorkspace) named:'Workspace%1' |
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
921 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
922 |
|
6458 | 923 |
destroyTab:tabIndex |
924 |
self removeWorkspace:tabIndex |
|
925 |
! |
|
926 |
||
8576 | 927 |
doIt |
928 |
|v| |
|
929 |
||
930 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
931 |
v doIt. |
|
932 |
] |
|
933 |
! |
|
934 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
935 |
loadFile:aFileName |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
936 |
self loadFile:aFileName encoding:nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
937 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
938 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
939 |
loadFile:aFileName encoding:encodingSymbolOrNil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
940 |
|lbl| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
941 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
942 |
lbl := aFileName asFilename withoutSuffix baseName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
943 |
self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
944 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
945 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
946 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
947 |
|file ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
948 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
949 |
file := aFileName asFilename. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
950 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
951 |
[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
952 |
|contents| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
953 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
954 |
contents := file contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
955 |
encodingSymbolOrNil notNil ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
956 |
contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
957 |
ws externalEncoding:encodingSymbolOrNil. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
958 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
959 |
ws contents:contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
960 |
ws defaultFileNameForFileDialog:file pathName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
961 |
] on:StreamError do:[:ex| |
8368 | 962 |
Dialog warn:(resources stringWithCRs:'Cannot open "%1":\\%2' with:file asString with:ex description). |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
963 |
^ self |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
964 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
965 |
ws modified:false. |
8033 | 966 |
self setLabel:label. |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
967 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
968 |
|
7745 | 969 |
loadFile:aFileName label:lbl |
970 |
|encoding| |
|
971 |
||
972 |
encoding := CharacterEncoder guessEncodingOfFile:aFileName. |
|
973 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
|
974 |
encoding := nil |
|
975 |
]. |
|
976 |
self loadFile:aFileName encoding:encoding label:lbl. |
|
977 |
||
978 |
"Created: / 15-03-2007 / 11:52:21 / cg" |
|
979 |
! |
|
980 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
981 |
menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
982 |
|file| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
983 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
984 |
(self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
985 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
986 |
file := Dialog |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
987 |
requestFileName:(resources string:'Load file') |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
988 |
default:(self defaultFileNameForLoad) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
989 |
pattern:(self defaultPatternLoad). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
990 |
file size ~~ 0 ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
991 |
self loadFile:file |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
992 |
] |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
993 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
994 |
"Modified: / 25-10-2006 / 14:57:34 / cg" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
995 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
996 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
997 |
menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
998 |
|ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
999 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1000 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1001 |
ws doPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1002 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1003 |
"Created: / 25-10-2006 / 15:01:51 / cg" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1004 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1005 |
|
5302 | 1006 |
menuSaveAllAs |
1007 |
self |
|
1008 |
askForFile:'Save all Buffers into:' |
|
8196 | 1009 |
default:(self defaultFileNameForSaveAll) |
5302 | 1010 |
thenDo:[:file :doAppend | |
1011 |
|ws append| |
|
1012 |
||
1013 |
append := doAppend. |
|
1014 |
workspaces do:[:subView | |
|
1015 |
|ws| |
|
1016 |
||
1017 |
ws := self workspaceViewOfView:subView. |
|
1018 |
ws notNil ifTrue:[ |
|
1019 |
ws saveAs:file doAppend:append. |
|
1020 |
ws modified:false. |
|
1021 |
]. |
|
1022 |
append := true. |
|
1023 |
]. |
|
1024 |
] |
|
1025 |
! |
|
1026 |
||
1027 |
menuSaveAs |
|
1028 |
self |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1029 |
askForFile:'Save Buffer into:' |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1030 |
default:(self defaultFileNameForSave) |
5302 | 1031 |
thenDo:[:file :doAppend | |
8033 | 1032 |
|ws lbl| |
5302 | 1033 |
|
1034 |
ws := self selectedWorkspacesTextView. |
|
1035 |
ws saveAs:file doAppend:doAppend. |
|
1036 |
ws modified:false. |
|
8395
3596ebae2d90
changed #defaultFileNameForSave
Claus Gittinger <cg@exept.de>
parents:
8368
diff
changeset
|
1037 |
"/ ws defaultFileNameForFileDialog:file asFilename baseName. |
8033 | 1038 |
|
1039 |
lbl := file asFilename withoutSuffix baseName. |
|
1040 |
self setLabel:lbl. |
|
5302 | 1041 |
] |
1042 |
! |
|
1043 |
||
1044 |
newWorkspace |
|
6863 | 1045 |
self class new openWithExtent:(self builder window extent). |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1046 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1047 |
"Modified: / 25-10-2006 / 14:39:15 / cg" |
5302 | 1048 |
! |
1049 |
||
9058 | 1050 |
openSTXDocumentation |
1051 |
"opens the top documentation file" |
|
1052 |
||
1053 |
self openHTMLDocument: 'TOP.html' |
|
1054 |
! |
|
1055 |
||
1056 |
openSettingsDialog |
|
1057 |
|settingsList settingsApp| |
|
1058 |
||
1059 |
settingsList := |
|
1060 |
#( |
|
1061 |
#('Keyboard Mappings' #'AbstractSettingsApplication::KbdMappingSettingsAppl' ) |
|
1062 |
"/ #('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
1063 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
1064 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
1065 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
1066 |
). |
|
1067 |
||
1068 |
settingsApp := SettingsDialog new. |
|
1069 |
settingsApp installSettingsEntries:settingsList. |
|
1070 |
settingsApp allButOpen. |
|
1071 |
settingsApp window label:('Debugger Settings'). |
|
1072 |
settingsApp openWindow. |
|
1073 |
! |
|
1074 |
||
8576 | 1075 |
printIt |
1076 |
! |
|
1077 |
||
8772 | 1078 |
removeAllWorkspacesExcept:wsIndex |
1079 |
tabList size downTo:wsIndex+1 do:[:idx | |
|
1080 |
self removeWorkspace:idx. |
|
1081 |
]. |
|
1082 |
1 to:wsIndex-1 do:[:idx | |
|
1083 |
self removeWorkspace:1. |
|
1084 |
]. |
|
1085 |
! |
|
1086 |
||
5302 | 1087 |
removeWorkspace |
1088 |
self removeWorkspace:(self selectedWorkspaceIndexHolder value) |
|
1089 |
! |
|
1090 |
||
1091 |
removeWorkspace:wsIndex |
|
1092 |
|tabList newWsIndex| |
|
1093 |
||
1094 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
6509 | 1095 |
(self askIfModified:'Text was modified. Remove buffer anyway ?' yesButton:'Remove Buffer') ifFalse:[ |
5302 | 1096 |
^ self |
1097 |
]. |
|
1098 |
]. |
|
1099 |
||
1100 |
tabList := self tabList. |
|
1101 |
||
1102 |
wsIndex == tabList size ifTrue:[ |
|
1103 |
newWsIndex := wsIndex - 1. |
|
1104 |
] ifFalse:[ |
|
1105 |
newWsIndex := wsIndex. |
|
1106 |
]. |
|
1107 |
||
1108 |
tabList removeIndex:wsIndex. |
|
1109 |
(workspaces at:wsIndex) destroy. |
|
1110 |
workspaces removeIndex:wsIndex. |
|
1111 |
||
1112 |
tabList size == 1 ifTrue:[ |
|
1113 |
self window label:(tabList at:1). |
|
1114 |
tabList removeIndex:1 |
|
1115 |
]. |
|
1116 |
||
1117 |
workspaceHolder value:(workspaces at:newWsIndex). |
|
1118 |
self selectedWorkspaceIndexHolder value:newWsIndex. |
|
1119 |
"/ to force change (update workspaceHolder - even if same index) |
|
1120 |
self selectedWorkspaceIndexHolder changed:#value. |
|
1121 |
! |
|
1122 |
||
1123 |
renameWorkspace |
|
1124 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
1125 |
! |
|
1126 |
||
1127 |
renameWorkspace:wsIndex |
|
1128 |
|tabList oldName newName| |
|
1129 |
||
1130 |
tabList := self tabList. |
|
1131 |
tabList isEmpty ifTrue:[ |
|
1132 |
oldName := self window label |
|
1133 |
] ifFalse:[ |
|
1134 |
oldName := tabList at:wsIndex. |
|
1135 |
]. |
|
1136 |
newName := Dialog request:(resources string:'New Name for %1:' with:oldName) initialAnswer:oldName. |
|
1137 |
newName size == 0 ifTrue:[ ^ self]. |
|
1138 |
||
1139 |
self renameWorkspace:wsIndex to:newName. |
|
1140 |
! |
|
1141 |
||
1142 |
renameWorkspace:wsIndex to:newName |
|
1143 |
|tabList| |
|
1144 |
||
1145 |
tabList := self tabList. |
|
1146 |
tabList notEmpty ifTrue:[ |
|
1147 |
tabList at:wsIndex put:newName. |
|
1148 |
]. |
|
1149 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
1150 |
self window label:newName. |
|
1151 |
]. |
|
1152 |
! ! |
|
1153 |
||
1154 |
!MultiViewToolApplication methodsFor:'menu-actions-editing'! |
|
1155 |
||
1156 |
copySelection |
|
8498 | 1157 |
|v| |
1158 |
||
1159 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1160 |
v copySelection |
|
1161 |
] |
|
5302 | 1162 |
! |
1163 |
||
1164 |
cutSelection |
|
8498 | 1165 |
|v| |
1166 |
||
1167 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1168 |
v cutSelection |
|
1169 |
]. |
|
5302 | 1170 |
! |
1171 |
||
1172 |
paste |
|
8498 | 1173 |
|v| |
1174 |
||
1175 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1176 |
v paste |
|
1177 |
] |
|
5302 | 1178 |
! |
1179 |
||
1180 |
paste:aString |
|
9634 | 1181 |
|v| |
9633 | 1182 |
|
9634 | 1183 |
v := (workspaceHolder value) ? (self selectedWorkspacesTextView). |
1184 |
v perform:#paste: with:aString ifNotUnderstood:[]. |
|
1185 |
||
9636 | 1186 |
"Modified: / 16-11-2010 / 15:27:39 / cg" |
5302 | 1187 |
! |
1188 |
||
8509 | 1189 |
redo |
1190 |
|v| |
|
1191 |
||
1192 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1193 |
v redo. |
|
1194 |
] |
|
1195 |
! |
|
1196 |
||
8498 | 1197 |
search |
1198 |
|v| |
|
1199 |
||
1200 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1201 |
v search. |
|
1202 |
] |
|
1203 |
! |
|
1204 |
||
5302 | 1205 |
selectAll |
8498 | 1206 |
|v| |
1207 |
||
1208 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1209 |
v selectAll. |
|
1210 |
] |
|
8509 | 1211 |
! |
1212 |
||
1213 |
undo |
|
1214 |
|v| |
|
1215 |
||
1216 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1217 |
v undo. |
|
1218 |
] |
|
5302 | 1219 |
! ! |
1220 |
||
1221 |
!MultiViewToolApplication methodsFor:'private'! |
|
1222 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1223 |
askForFile:question default:defaultFilename thenDo:aBlock |
5302 | 1224 |
Dialog |
1225 |
requestSaveFileName:(resources string:question) |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1226 |
default:defaultFilename |
5302 | 1227 |
fromDirectory:nil |
1228 |
action:[:fileName | aBlock value:fileName value:false] |
|
1229 |
appendAction:[:fileName | aBlock value:fileName value:true] |
|
1230 |
||
1231 |
"/ |file doAppend| |
|
1232 |
"/ |
|
1233 |
"/ doAppend := false. |
|
1234 |
"/ Dialog aboutToOpenBoxNotificationSignal handle:[:n | |
|
1235 |
"/ |box| |
|
1236 |
"/ |
|
1237 |
"/ box := n parameter. |
|
1238 |
"/ box addButton:(Button label:'Append' action:[doAppend := true. box okPressed]). |
|
1239 |
"/ n proceed. |
|
1240 |
"/ ] do:[ |
|
1241 |
"/ file := Dialog requestFileName:question default:'file.wsp'. |
|
1242 |
"/ ]. |
|
1243 |
"/ file isEmptyOrNil ifFalse:[ |
|
1244 |
"/ aBlock value:file value:doAppend |
|
1245 |
"/ ]. |
|
1246 |
! |
|
1247 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1248 |
askForFile:question thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1249 |
^ self |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1250 |
askForFile:question default:'file.wsp' thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1251 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1252 |
|
5302 | 1253 |
askIfAnyModified:arg1 yesButton:arg2 |
1254 |
"raise an error: must be redefined in concrete subclass(es)" |
|
1255 |
||
1256 |
^ self subclassResponsibility |
|
1257 |
! |
|
1258 |
||
1259 |
askIfModified:question yesButton:yesButtonText |
|
1260 |
"tell user, that code has been modified - let her confirm" |
|
1261 |
||
1262 |
|textView| |
|
1263 |
||
1264 |
textView := self selectedWorkspace. |
|
1265 |
(self isModifiedWorkspace:textView) ifFalse:[^ true]. |
|
1266 |
||
1267 |
(Dialog |
|
6354 | 1268 |
confirm:(resources stringWithCRs:question) |
6634 | 1269 |
yesLabel:(resources string:yesButtonText) |
1270 |
noLabel:(resources string:'Cancel')) |
|
5302 | 1271 |
ifTrue:[ |
1272 |
"/ reset modified flag so question is asked only once |
|
1273 |
textView modified:false. |
|
1274 |
^ true |
|
1275 |
]. |
|
1276 |
^ false |
|
1277 |
||
1278 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
|
1279 |
! |
|
1280 |
||
1281 |
createWorkspace |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1282 |
|ws| |
5302 | 1283 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1284 |
ws := (HVScrollableView for:EditTextView). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1285 |
^ ws |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1286 |
|
9664 | 1287 |
"Modified: / 09-12-2010 / 10:55:25 / cg" |
5302 | 1288 |
! |
1289 |
||
1290 |
isModifiedWorkspace:aView |
|
1291 |
self subclassResponsibility |
|
1292 |
! |
|
1293 |
||
1294 |
selectedWorkspacesTextView |
|
1295 |
^ self workspaceViewOfView:(self selectedWorkspace) |
|
1296 |
! |
|
1297 |
||
8033 | 1298 |
setLabel:label |
1299 |
tabList size > 1 ifTrue:[ |
|
1300 |
tabList at:self selectedWorkspaceIndexHolder value put:label |
|
1301 |
]. |
|
1302 |
self window label:label. |
|
1303 |
! |
|
1304 |
||
5302 | 1305 |
workspaceSelectionChanged |
1306 |
|wsIndex windowLabel v| |
|
1307 |
||
1308 |
"/ self selected |
|
1309 |
self workspaceHolder value:(v := self selectedWorkspace). |
|
1310 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
1311 |
||
1312 |
wsIndex ~~ 0 ifTrue:[ |
|
1313 |
windowLabel := tabList at:wsIndex ifAbsent:nil. |
|
1314 |
windowLabel notNil ifTrue:[self window label:windowLabel]. |
|
1315 |
]. |
|
1316 |
! |
|
1317 |
||
1318 |
workspaceViewOfView:aView |
|
1319 |
|view| |
|
1320 |
||
1321 |
view := aView. |
|
7663 | 1322 |
|
5302 | 1323 |
(view isScrollWrapper) ifTrue:[ |
1324 |
view := view scrolledView. |
|
1325 |
view isNil ifTrue:[^ nil]. |
|
1326 |
]. |
|
7663 | 1327 |
|
5302 | 1328 |
(view isTextView) ifFalse:[ |
7663 | 1329 |
(view isKindOf:InspectorView) ifTrue:[ |
1330 |
view := view workspace. |
|
1331 |
(view isScrollWrapper) ifTrue:[ |
|
1332 |
view := view scrolledView |
|
1333 |
]. |
|
5302 | 1334 |
]. |
1335 |
]. |
|
7663 | 1336 |
(view isTextView) ifTrue:[^ view]. |
1337 |
^ view allSubViewsDetect:[:v| v name = #Workspace] ifNone:nil. |
|
5302 | 1338 |
! ! |
1339 |
||
7650 | 1340 |
!MultiViewToolApplication methodsFor:'user actions'! |
1341 |
||
8497 | 1342 |
hideEditToolbar |
1343 |
self editToolBarVisibleHolder value:false |
|
1344 |
! |
|
1345 |
||
7650 | 1346 |
hideToolbar |
1347 |
self toolBarVisibleHolder value:false |
|
1348 |
||
1349 |
"Created: / 18-02-2007 / 14:55:54 / cg" |
|
1350 |
! ! |
|
1351 |
||
5302 | 1352 |
!MultiViewToolApplication class methodsFor:'documentation'! |
1353 |
||
1354 |
version |
|
9694 | 1355 |
^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.40 2011-01-22 11:05:01 cg Exp $' |
9058 | 1356 |
! |
1357 |
||
1358 |
version_CVS |
|
9694 | 1359 |
^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.40 2011-01-22 11:05:01 cg Exp $' |
5302 | 1360 |
! ! |