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