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