author | Claus Gittinger <cg@exept.de> |
Mon, 15 Jul 2019 18:53:35 +0200 | |
changeset 18903 | b0d007a5e683 |
parent 18633 | 63deef6d26f4 |
child 19422 | c6ca1c3e0fd7 |
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 |
18399 | 317 |
label: 'Pages' |
7475
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 |
18399 | 324 |
label: 'Add Page' |
7475
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 |
18399 | 341 |
label: 'Remove Page' |
7475
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 |
) |
18399 | 413 |
|
414 |
"Modified: / 21-09-2018 / 11:04:27 / Claus Gittinger" |
|
5302 | 415 |
! |
416 |
||
417 |
tabMenu |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
418 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
419 |
by the MenuEditor of ST/X." |
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 |
"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
|
422 |
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
|
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 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
426 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp |
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 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
429 |
<resource: #menu> |
5302 | 430 |
|
7475
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 |
#(#Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
433 |
#( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
434 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
435 |
#label: 'Add Tab' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
436 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
437 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
438 |
#value: #addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
439 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
440 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
441 |
#label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
442 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
443 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
444 |
#label: 'Remove Tab' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
445 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
446 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
447 |
#value: #removeWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
448 |
#enabled: #canRemoveWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
449 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
450 |
#(#MenuItem |
8772 | 451 |
#label: 'Remove all other Tabs' |
452 |
#translateLabel: true |
|
453 |
"/ #triggerOnDown: true |
|
454 |
#value: #removeAllWorkspacesExcept: |
|
455 |
#enabled: #canRemoveAllWorkspacesExcept: |
|
456 |
) |
|
457 |
#(#MenuItem |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
458 |
#label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
459 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
460 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
461 |
#label: 'Rename...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
462 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
463 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
464 |
#value: #renameWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
465 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
466 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
467 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
468 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
469 |
) |
7650 | 470 |
! |
471 |
||
472 |
toolBarMenu |
|
473 |
"This resource specification was automatically generated |
|
474 |
by the MenuEditor of ST/X." |
|
475 |
||
476 |
"Do not manually edit this!! If it is corrupted, |
|
477 |
the MenuEditor may not be able to read the specification." |
|
478 |
||
479 |
" |
|
480 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu |
|
481 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp |
|
482 |
" |
|
483 |
||
484 |
<resource: #menu> |
|
485 |
||
486 |
^ |
|
487 |
#(Menu |
|
488 |
( |
|
489 |
(MenuItem |
|
490 |
label: '' |
|
491 |
) |
|
492 |
(MenuItem |
|
493 |
"/ activeHelpKey: addWorkspace |
|
18399 | 494 |
label: 'Add Page' |
7650 | 495 |
itemValue: addWorkspace |
496 |
translateLabel: true |
|
497 |
isButton: true |
|
498 |
labelImage: (ResourceRetriever ToolbarIconLibrary addBufferIcon) |
|
499 |
) |
|
500 |
) |
|
501 |
nil |
|
502 |
nil |
|
503 |
) |
|
504 |
||
505 |
"Modified: / 18-02-2007 / 14:59:21 / cg" |
|
18399 | 506 |
"Modified: / 21-09-2018 / 11:04:35 / Claus Gittinger" |
7650 | 507 |
! |
508 |
||
509 |
viewMenu |
|
510 |
"This resource specification was automatically generated |
|
511 |
by the MenuEditor of ST/X." |
|
512 |
||
513 |
"Do not manually edit this!! If it is corrupted, |
|
514 |
the MenuEditor may not be able to read the specification." |
|
515 |
||
14279
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
516 |
|
7650 | 517 |
" |
9058 | 518 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#viewMenu |
519 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication viewMenu)) startUp |
|
7650 | 520 |
" |
521 |
||
522 |
<resource: #menu> |
|
523 |
||
524 |
^ |
|
525 |
#(Menu |
|
526 |
( |
|
527 |
(MenuItem |
|
528 |
label: 'Toolbar' |
|
529 |
hideMenuOnActivated: false |
|
530 |
indication: toolBarVisibleHolder |
|
531 |
) |
|
532 |
(MenuItem |
|
8497 | 533 |
label: 'Editor Toolbar' |
9058 | 534 |
isVisible: hasEditToolBar |
8497 | 535 |
hideMenuOnActivated: false |
536 |
indication: editToolBarVisibleHolder |
|
537 |
) |
|
538 |
(MenuItem |
|
7650 | 539 |
label: 'Info' |
9380 | 540 |
isVisible: hasInfoLabel |
7650 | 541 |
hideMenuOnActivated: false |
7653
71f20b5aab8d
Do not refer to non-existant aspect
Stefan Vogel <sv@exept.de>
parents:
7650
diff
changeset
|
542 |
indication: infoVisibleHolder |
7650 | 543 |
) |
9058 | 544 |
(MenuItem |
545 |
label: '-' |
|
546 |
) |
|
547 |
(MenuItem |
|
14279
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
548 |
label: 'Font...' |
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
549 |
itemValue: openFontDialog |
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
550 |
) |
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
551 |
(MenuItem |
9058 | 552 |
label: 'Settings...' |
553 |
itemValue: openSettingsDialog |
|
554 |
) |
|
7650 | 555 |
) |
556 |
nil |
|
557 |
nil |
|
558 |
) |
|
5302 | 559 |
! ! |
560 |
||
561 |
!MultiViewToolApplication class methodsFor:'queries'! |
|
562 |
||
15945 | 563 |
isAbstract |
564 |
^ self == MultiViewToolApplication |
|
565 |
! |
|
566 |
||
5302 | 567 |
isVisualStartable |
568 |
"return true, if this application can be started via #open. |
|
569 |
(to allow start of a change browser via double-click in the browser)" |
|
570 |
||
5303 | 571 |
self == MultiViewToolApplication ifTrue:[^false]. |
5302 | 572 |
^ super isVisualStartable |
573 |
! ! |
|
574 |
||
575 |
!MultiViewToolApplication methodsFor:'accessing'! |
|
576 |
||
577 |
selectedWorkspace |
|
578 |
|wsIndex| |
|
579 |
||
580 |
workspaces isNil ifTrue:[ |
|
581 |
workspaces := OrderedCollection new. |
|
582 |
]. |
|
583 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
584 |
wsIndex == 0 ifTrue:[ |
|
585 |
^ nil |
|
586 |
]. |
|
587 |
||
588 |
workspaces size < wsIndex ifTrue:[ |
|
589 |
workspaces grow:wsIndex. |
|
590 |
workspaces at:wsIndex put:(self createWorkspace). |
|
591 |
]. |
|
592 |
^ workspaces at:wsIndex |
|
593 |
! |
|
594 |
||
13858 | 595 |
selectedWorkspaceApplication |
596 |
"Return an aoplication of selected workspace or nil, |
|
597 |
is currently selected workspace is not an embedded |
|
598 |
ApplicationModel" |
|
599 |
||
600 |
| ws | |
|
601 |
ws := self selectedWorkspace. |
|
602 |
^(ws notNil and:[ws isApplicationSubView]) ifTrue:[ |
|
603 |
ws application |
|
604 |
] ifFalse:[ |
|
605 |
nil |
|
606 |
] |
|
607 |
||
608 |
"Created: / 11-05-2012 / 09:38:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
609 |
! |
|
610 |
||
5302 | 611 |
tabMenuAt:index |
6244 | 612 |
<resource: #programMenu> |
613 |
||
5302 | 614 |
|m i ws| |
615 |
||
616 |
m := self class tabMenu. |
|
617 |
m := m decodeAsLiteralArray. |
|
8772 | 618 |
|
5302 | 619 |
i := m detectItem:[:item | item value == #removeWorkspace:] ifNone:nil. |
620 |
i notNil ifTrue:[ |
|
621 |
i argument:index. |
|
622 |
index ~~ self selectedWorkspaceIndexHolder value ifTrue:[ |
|
8772 | 623 |
"/ for now: if that buffer is modified, do not allow removing. |
5302 | 624 |
"/ (must be brought to front, in order for check-for-modification to work) |
625 |
ws := workspaces at:index. |
|
11727
667a6bfb5c64
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11626
diff
changeset
|
626 |
ws isScrollWrapper ifTrue:[ |
5302 | 627 |
ws := ws scrolledView |
628 |
]. |
|
11727
667a6bfb5c64
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11626
diff
changeset
|
629 |
(ws isTextView not |
667a6bfb5c64
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11626
diff
changeset
|
630 |
or:[ ws modified ]) ifTrue:[ |
5302 | 631 |
i disable |
632 |
]. |
|
633 |
]. |
|
634 |
]. |
|
8772 | 635 |
|
636 |
i := m detectItem:[:item | item value == #removeAllWorkspacesExcept:] ifNone:nil. |
|
637 |
i notNil ifTrue:[ |
|
638 |
i argument:index. |
|
639 |
"/ for now: if any buffer is modified, do not allow removing. |
|
640 |
"/ (must be brought to front, in order for check-for-modification to work) |
|
641 |
workspaces doWithIndex:[:wsArg :idx | |
|
642 |
|ws| |
|
643 |
||
644 |
idx ~~ index ifTrue:[ |
|
645 |
ws := wsArg. |
|
11727
667a6bfb5c64
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11626
diff
changeset
|
646 |
ws isScrollWrapper ifTrue:[ |
8772 | 647 |
ws := ws scrolledView |
648 |
]. |
|
11727
667a6bfb5c64
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11626
diff
changeset
|
649 |
(ws isTextView and:[ ws modified ]) ifTrue:[ |
8772 | 650 |
i disable |
651 |
]. |
|
652 |
]. |
|
653 |
]. |
|
654 |
]. |
|
655 |
||
5302 | 656 |
i := m detectItem:[:item | item value == #renameWorkspace:] ifNone:nil. |
657 |
i notNil ifTrue:[ |
|
658 |
i argument:index. |
|
659 |
]. |
|
660 |
||
661 |
m findGuiResourcesIn:self. |
|
662 |
^ m |
|
663 |
! |
|
664 |
||
665 |
workspaceHolder |
|
666 |
workspaceHolder isNil ifTrue:[ |
|
667 |
workspaceHolder := ValueHolder with:(self selectedWorkspace). |
|
668 |
]. |
|
669 |
^ workspaceHolder |
|
7852 | 670 |
! |
671 |
||
672 |
workspaces |
|
673 |
^ workspaces |
|
5302 | 674 |
! ! |
675 |
||
676 |
!MultiViewToolApplication methodsFor:'aspects'! |
|
677 |
||
8497 | 678 |
editToolBarVisibleHolder |
679 |
|holder| |
|
680 |
||
681 |
(holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[ |
|
682 |
holder := self class defaultEditToolbarVisible asValue. |
|
683 |
builder aspectAt:#editToolBarVisibleHolder put: holder. |
|
684 |
holder addDependent:self. |
|
685 |
]. |
|
686 |
^ holder |
|
687 |
||
688 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
689 |
"Modified: / 14-07-2007 / 16:39:55 / cg" |
|
690 |
! |
|
691 |
||
692 |
hasEditToolBar |
|
693 |
^ (self menuFor:#editToolBarMenu) decodeAsLiteralArray hasItems |
|
694 |
! |
|
695 |
||
9380 | 696 |
hasInfoLabel |
697 |
^ false |
|
698 |
! |
|
699 |
||
7650 | 700 |
infoVisibleHolder |
701 |
|holder| |
|
702 |
||
703 |
(holder := builder bindingAt:#infoVisibleHolder) isNil ifTrue:[ |
|
7824 | 704 |
holder := self class defaultInfoVisible asValue. |
7650 | 705 |
builder aspectAt:#infoVisibleHolder put: holder. |
706 |
holder addDependent:self. |
|
707 |
]. |
|
708 |
^ holder |
|
709 |
||
710 |
"Created: / 18-02-2007 / 15:01:05 / cg" |
|
7824 | 711 |
"Modified: / 14-07-2007 / 16:39:20 / cg" |
7650 | 712 |
! |
713 |
||
5302 | 714 |
selectedWorkspaceIndexHolder |
715 |
selectedWorkspaceIndexHolder isNil ifTrue:[ |
|
716 |
selectedWorkspaceIndexHolder := 1 asValue. |
|
717 |
selectedWorkspaceIndexHolder onChangeSend:#workspaceSelectionChanged to:self. |
|
718 |
]. |
|
719 |
^ selectedWorkspaceIndexHolder. |
|
720 |
! |
|
721 |
||
722 |
tabList |
|
723 |
tabList isNil ifTrue:[ |
|
724 |
tabList := List new. |
|
725 |
]. |
|
726 |
^ tabList. |
|
7650 | 727 |
! |
728 |
||
729 |
toolBarVisibleHolder |
|
730 |
|holder| |
|
731 |
||
732 |
(holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[ |
|
7824 | 733 |
holder := self class defaultToolbarVisible asValue. |
7650 | 734 |
builder aspectAt:#toolBarVisibleHolder put: holder. |
735 |
holder addDependent:self. |
|
736 |
]. |
|
737 |
^ holder |
|
738 |
||
739 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
7824 | 740 |
"Modified: / 14-07-2007 / 16:39:55 / cg" |
5302 | 741 |
! ! |
742 |
||
743 |
!MultiViewToolApplication methodsFor:'aspects-queries'! |
|
744 |
||
8772 | 745 |
canRemoveAllWorkspacesExcept:idx |
15408
ff62d43d5a1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
15407
diff
changeset
|
746 |
^ [ self tabList size > 1 ] |
8772 | 747 |
! |
748 |
||
5302 | 749 |
canRemoveWorkspace |
750 |
^ self canRemoveWorkspace:(self selectedWorkspaceIndexHolder value) |
|
751 |
! |
|
752 |
||
753 |
canRemoveWorkspace:idx |
|
754 |
^ self tabList size > 1 |
|
755 |
"/ and:[ (self workspacesTextViewAt:(self selectedWorkspaceIndexHolder value)) |
|
756 |
! |
|
757 |
||
758 |
hasMultipleBuffersHolder |
|
759 |
^ [ workspaces size > 1 ] |
|
760 |
! |
|
761 |
||
762 |
hasSelectionInActiveWorkspace |
|
6424 | 763 |
|v| |
764 |
||
765 |
v := self selectedWorkspacesTextView. |
|
18633 | 766 |
^ v notNil and:[v selectionAsString size ~~ 0] |
767 |
||
768 |
"Modified: / 01-03-2019 / 16:01:25 / Claus Gittinger" |
|
8528 | 769 |
! |
770 |
||
17198 | 771 |
hasSelectionInActiveWorkspaceAndEditorIsNotReadonly |
772 |
|v| |
|
773 |
||
774 |
v := self selectedWorkspacesTextView. |
|
18633 | 775 |
^ v notNil and:[v enabled and:[v selectionAsString size ~~ 0]] |
776 |
||
777 |
"Modified: / 01-03-2019 / 16:01:29 / Claus Gittinger" |
|
17198 | 778 |
! |
779 |
||
8528 | 780 |
hasTextInActiveWorkspace |
781 |
|v| |
|
782 |
||
783 |
v := self selectedWorkspacesTextView. |
|
784 |
^ v notNil |
|
785 |
and:[v list notEmptyOrNil |
|
786 |
and:[v list contains:[:l | l notEmptyOrNil]]] |
|
5302 | 787 |
! ! |
788 |
||
7650 | 789 |
!MultiViewToolApplication methodsFor:'change & update'! |
790 |
||
8497 | 791 |
infoVisibilityChanged |
792 |
|visible cFrame bottomOffset| |
|
793 |
||
794 |
visible := self infoVisibleHolder value. |
|
795 |
||
9380 | 796 |
cFrame := builder findComponentAt:#NoteBook. "/ #CodeView. |
8497 | 797 |
cFrame notNil ifTrue:[ |
798 |
visible ifFalse:[ |
|
799 |
bottomOffset := 0. |
|
800 |
] ifTrue:[ |
|
801 |
bottomOffset := -25. |
|
802 |
]. |
|
803 |
cFrame layout bottomOffset:bottomOffset. |
|
804 |
cFrame container notNil ifTrue:[ |
|
805 |
cFrame containerChangedSize. |
|
806 |
]. |
|
807 |
]. |
|
808 |
DefaultInfoVisible := visible |
|
809 |
||
810 |
"Created: / 18-02-2007 / 15:01:55 / cg" |
|
811 |
! |
|
812 |
||
813 |
toolBarVisibilityChanged |
|
814 |
|toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset| |
|
815 |
||
816 |
topOffset := 0. |
|
817 |
||
818 |
toolBar := self componentAt:#ToolBar. |
|
819 |
toolBar notNil ifTrue:[ |
|
820 |
toolBarVisible := self toolBarVisibleHolder value. |
|
821 |
DefaultToolBarVisible := toolBarVisible. |
|
822 |
toolBarVisible ifTrue:[ |
|
823 |
topOffset := topOffset + toolBar height. |
|
824 |
] |
|
825 |
]. |
|
826 |
||
827 |
editToolBar := self componentAt:#EditToolBar. |
|
828 |
editToolBar notNil ifTrue:[ |
|
829 |
editToolBar layout |
|
830 |
topOffset:topOffset bottomOffset:(topOffset + editToolBar height). |
|
831 |
"/ force it to recompute its dimension |
|
832 |
editToolBar container notNil ifTrue:[ |
|
833 |
editToolBar containerChangedSize. |
|
834 |
]. |
|
835 |
editToolBarVisible := self editToolBarVisibleHolder value. |
|
836 |
DefaultEditToolBarVisible := editToolBarVisible. |
|
837 |
editToolBarVisible ifTrue:[ |
|
838 |
topOffset := topOffset + editToolBar height. |
|
839 |
] |
|
840 |
]. |
|
841 |
||
842 |
noteBook := self componentAt:#NoteBook. |
|
843 |
noteBook notNil ifTrue:[ |
|
844 |
noteBook layout topOffset:topOffset. |
|
845 |
"/ force it to recompute its dimension |
|
846 |
noteBook container notNil ifTrue:[ |
|
847 |
noteBook containerChangedSize. |
|
848 |
]. |
|
849 |
]. |
|
850 |
||
851 |
"Created: / 18-02-2007 / 14:46:22 / cg" |
|
852 |
! |
|
853 |
||
7650 | 854 |
update:something with:aParameter from:changedObject |
8497 | 855 |
((changedObject == self toolBarVisibleHolder) |
856 |
or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[ |
|
7650 | 857 |
self toolBarVisibilityChanged. |
858 |
^ self |
|
859 |
]. |
|
7824 | 860 |
changedObject == self infoVisibleHolder ifTrue:[ |
861 |
self infoVisibilityChanged. |
|
862 |
^ self |
|
863 |
]. |
|
7650 | 864 |
^ super update:something with:aParameter from:changedObject |
865 |
||
7824 | 866 |
"Modified: / 14-07-2007 / 16:46:14 / cg" |
14175
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
867 |
! |
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 |
windowLabelPrefix |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
870 |
|nm| |
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 |
nm := self class nameWithoutPrefix. |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
873 |
(nm endsWith:'Application') ifTrue:[ |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
874 |
nm := nm copyButLast:'Application' size |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
875 |
]. |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
876 |
^ nm |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
877 |
! |
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 |
workspaceSelectionChanged |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
880 |
|wsIndex windowLabel v prefix| |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
881 |
|
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
882 |
"/ self selected |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
883 |
self workspaceHolder value:(v := self selectedWorkspace). |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
884 |
wsIndex := self selectedWorkspaceIndexHolder value. |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
885 |
|
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
886 |
wsIndex ~~ 0 ifTrue:[ |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
887 |
prefix := self windowLabelPrefix. |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
888 |
windowLabel := tabList at:wsIndex ifAbsent:nil. |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
889 |
windowLabel notNil ifTrue:[self window label:prefix,': ',windowLabel]. |
61dceb4984c4
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
13858
diff
changeset
|
890 |
]. |
15408
ff62d43d5a1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
15407
diff
changeset
|
891 |
|
ff62d43d5a1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
15407
diff
changeset
|
892 |
v notNil ifTrue:[ v takeFocusWhenMapped:true ] |
7650 | 893 |
! ! |
894 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
895 |
!MultiViewToolApplication methodsFor:'defaults'! |
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 |
defaultFileNameForLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
898 |
^ 'file.txt' |
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 |
"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
|
901 |
! |
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 |
defaultFileNameForSave |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
904 |
^ 'file.txt' |
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 |
"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
|
907 |
! |
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 |
defaultFileNameForSaveAll |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
910 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
911 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
912 |
"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
|
913 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
914 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
915 |
defaultPatternLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
916 |
^ '*.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
917 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
918 |
"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
|
919 |
! ! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
920 |
|
7650 | 921 |
!MultiViewToolApplication methodsFor:'initialization'! |
922 |
||
923 |
hideToolBarButtonCreated:aButton |
|
924 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
925 |
"/ aButton passiveLevel:1. |
|
926 |
aButton activeLevel:-1. |
|
927 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
928 |
||
929 |
"Created: / 18-02-2007 / 14:48:28 / cg" |
|
930 |
! |
|
931 |
||
932 |
postBuildWith:aBuilder |
|
933 |
super postBuildWith:aBuilder. |
|
8497 | 934 |
|
7650 | 935 |
self infoVisibleHolder value ifTrue:[ self infoVisibilityChanged ]. |
8497 | 936 |
(self toolBarVisibleHolder value |
937 |
or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ]. |
|
7650 | 938 |
|
9694 | 939 |
self workspaceSelectionChanged. |
940 |
||
7650 | 941 |
"Created: / 18-02-2007 / 15:03:08 / cg" |
9694 | 942 |
"Modified: / 22-01-2011 / 11:46:35 / cg" |
7650 | 943 |
! ! |
944 |
||
5302 | 945 |
!MultiViewToolApplication methodsFor:'menu-actions'! |
946 |
||
947 |
addWindow:aWindow named:name |
|
948 |
^ self addWindow:aWindow named:name asFirst:false |
|
949 |
! |
|
950 |
||
951 |
addWindow:aWindow named:name asFirst:asFirst |
|
14805
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
952 |
^ self addWindow:aWindow named:name tabIcon:nil asFirst:asFirst |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
953 |
! |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
954 |
|
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
955 |
addWindow:aWindow named:name tabIcon:iconOrNil |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
956 |
^ self addWindow:aWindow named:name tabIcon:iconOrNil asFirst:false |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
957 |
! |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
958 |
|
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
959 |
addWindow:aWindow named:name tabIcon:iconOrNil asFirst:asFirst |
15407
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
960 |
|tabList tabItem wsIndex newSelectedIndex initialFocusView| |
5302 | 961 |
|
962 |
tabList := self tabList. |
|
963 |
wsIndex := tabList size + 1. |
|
964 |
wsIndex == 1 ifTrue:[ |
|
965 |
"/ first - add a name for the first tab |
|
966 |
tabList add:(self window label). "/ 'Workspace'. |
|
967 |
wsIndex := wsIndex + 1. |
|
968 |
]. |
|
969 |
||
14805
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
970 |
tabItem := name bindWith:wsIndex. |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
971 |
iconOrNil notNil ifTrue:[ |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
972 |
tabItem := LabelAndIcon icon:iconOrNil string:tabItem. |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
973 |
]. |
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
974 |
|
5302 | 975 |
workspaces grow:wsIndex. |
976 |
asFirst ifTrue:[ |
|
14805
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
977 |
tabList addFirst:tabItem. |
5302 | 978 |
workspaces replaceFrom:2 to:wsIndex with:workspaces startingAt:1. |
979 |
newSelectedIndex := 1. |
|
980 |
] ifFalse:[ |
|
14805
3e0fc4db20cf
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14557
diff
changeset
|
981 |
tabList addLast:tabItem. |
5302 | 982 |
newSelectedIndex := wsIndex. |
983 |
]. |
|
9664 | 984 |
|
15407
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
985 |
(aWindow isKeyboardConsumer) ifTrue:[ |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
986 |
initialFocusView := aWindow. |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
987 |
] ifFalse:[ |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
988 |
(aWindow scrolledView isKeyboardConsumer) ifTrue:[ |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
989 |
initialFocusView := aWindow scrolledView |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
990 |
] ifFalse:[ |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
991 |
initialFocusView := aWindow scrolledView allSubViewsDetect:[:v | v isKeyboardConsumer] ifNone:nil. |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
992 |
] |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
993 |
]. |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
994 |
(initialFocusView notNil "and:[w isKeyboardConsumer]") ifTrue:[ |
7c5e7b454c1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14805
diff
changeset
|
995 |
initialFocusView takeFocusWhenMapped:true. |
9664 | 996 |
]. |
997 |
||
5302 | 998 |
workspaces at:newSelectedIndex put:aWindow. |
9694 | 999 |
self selectedWorkspaceIndexHolder value:newSelectedIndex. |
1000 |
self workspaceSelectionChanged. |
|
1001 |
||
5302 | 1002 |
"/ workspaceHolder value:aWindow. |
9664 | 1003 |
|
9694 | 1004 |
"Modified: / 22-01-2011 / 12:02:59 / cg" |
10252 | 1005 |
"Modified: / 11-06-2011 / 00:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5302 | 1006 |
! |
1007 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1008 |
addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1009 |
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
|
1010 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1011 |
|
6458 | 1012 |
destroyTab:tabIndex |
1013 |
self removeWorkspace:tabIndex |
|
1014 |
! |
|
1015 |
||
8576 | 1016 |
doIt |
1017 |
|v| |
|
1018 |
||
1019 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1020 |
v doIt. |
|
1021 |
] |
|
1022 |
! |
|
1023 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1024 |
loadFile:aFileName |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1025 |
self loadFile:aFileName encoding:nil |
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 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1029 |
|lbl| |
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 |
lbl := aFileName asFilename withoutSuffix baseName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1032 |
self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl. |
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 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1035 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1036 |
|file ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1037 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1038 |
file := aFileName asFilename. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1039 |
ws := self selectedWorkspacesTextView. |
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 |
|contents| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1042 |
|
18351 | 1043 |
contents := file contentsOfEntireFile. |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1044 |
encodingSymbolOrNil notNil ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1045 |
contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1046 |
ws externalEncoding:encodingSymbolOrNil. |
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 |
ws contents:contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1049 |
ws defaultFileNameForFileDialog:file pathName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1050 |
] on:StreamError do:[:ex| |
8368 | 1051 |
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
|
1052 |
^ self |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1053 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1054 |
ws modified:false. |
8033 | 1055 |
self setLabel:label. |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1056 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1057 |
|
7745 | 1058 |
loadFile:aFileName label:lbl |
1059 |
|encoding| |
|
1060 |
||
1061 |
encoding := CharacterEncoder guessEncodingOfFile:aFileName. |
|
1062 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
|
1063 |
encoding := nil |
|
1064 |
]. |
|
1065 |
self loadFile:aFileName encoding:encoding label:lbl. |
|
1066 |
||
1067 |
"Created: / 15-03-2007 / 11:52:21 / cg" |
|
1068 |
! |
|
1069 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1070 |
menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1071 |
|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 |
(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
|
1074 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1075 |
file := Dialog |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1076 |
requestFileName:(resources string:'Load file') |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1077 |
default:(self defaultFileNameForLoad) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1078 |
pattern:(self defaultPatternLoad). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1079 |
file size ~~ 0 ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1080 |
self loadFile:file |
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 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1083 |
"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
|
1084 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1085 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1086 |
menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1087 |
|ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1088 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1089 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1090 |
ws doPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1091 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1092 |
"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
|
1093 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1094 |
|
5302 | 1095 |
menuSaveAllAs |
1096 |
self |
|
1097 |
askForFile:'Save all Buffers into:' |
|
8196 | 1098 |
default:(self defaultFileNameForSaveAll) |
5302 | 1099 |
thenDo:[:file :doAppend | |
1100 |
|ws append| |
|
1101 |
||
1102 |
append := doAppend. |
|
1103 |
workspaces do:[:subView | |
|
1104 |
|ws| |
|
1105 |
||
1106 |
ws := self workspaceViewOfView:subView. |
|
1107 |
ws notNil ifTrue:[ |
|
1108 |
ws saveAs:file doAppend:append. |
|
1109 |
ws modified:false. |
|
1110 |
]. |
|
1111 |
append := true. |
|
1112 |
]. |
|
1113 |
] |
|
1114 |
! |
|
1115 |
||
1116 |
menuSaveAs |
|
1117 |
self |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1118 |
askForFile:'Save Buffer into:' |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1119 |
default:(self defaultFileNameForSave) |
5302 | 1120 |
thenDo:[:file :doAppend | |
8033 | 1121 |
|ws lbl| |
5302 | 1122 |
|
1123 |
ws := self selectedWorkspacesTextView. |
|
1124 |
ws saveAs:file doAppend:doAppend. |
|
1125 |
ws modified:false. |
|
8395
3596ebae2d90
changed #defaultFileNameForSave
Claus Gittinger <cg@exept.de>
parents:
8368
diff
changeset
|
1126 |
"/ ws defaultFileNameForFileDialog:file asFilename baseName. |
8033 | 1127 |
|
1128 |
lbl := file asFilename withoutSuffix baseName. |
|
1129 |
self setLabel:lbl. |
|
5302 | 1130 |
] |
1131 |
! |
|
1132 |
||
1133 |
newWorkspace |
|
6863 | 1134 |
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
|
1135 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1136 |
"Modified: / 25-10-2006 / 14:39:15 / cg" |
5302 | 1137 |
! |
1138 |
||
14279
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
1139 |
openFontDialog |
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
1140 |
self selectedWorkspace changeFont |
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
1141 |
! |
9214ed746ffd
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14175
diff
changeset
|
1142 |
|
9058 | 1143 |
openSTXDocumentation |
1144 |
"opens the top documentation file" |
|
1145 |
||
1146 |
self openHTMLDocument: 'TOP.html' |
|
1147 |
! |
|
1148 |
||
1149 |
openSettingsDialog |
|
14557
f2fbe336969a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14279
diff
changeset
|
1150 |
|settingsList| |
9058 | 1151 |
|
1152 |
settingsList := |
|
1153 |
#( |
|
1154 |
#('Keyboard Mappings' #'AbstractSettingsApplication::KbdMappingSettingsAppl' ) |
|
1155 |
"/ #('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
1156 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
1157 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
1158 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
1159 |
). |
|
1160 |
||
14557
f2fbe336969a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14279
diff
changeset
|
1161 |
SettingsDialog |
f2fbe336969a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14279
diff
changeset
|
1162 |
openWithList:settingsList |
f2fbe336969a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
14279
diff
changeset
|
1163 |
label:(resources string:'Settings'). |
9058 | 1164 |
! |
1165 |
||
8576 | 1166 |
printIt |
1167 |
! |
|
1168 |
||
8772 | 1169 |
removeAllWorkspacesExcept:wsIndex |
1170 |
tabList size downTo:wsIndex+1 do:[:idx | |
|
1171 |
self removeWorkspace:idx. |
|
1172 |
]. |
|
1173 |
1 to:wsIndex-1 do:[:idx | |
|
1174 |
self removeWorkspace:1. |
|
1175 |
]. |
|
1176 |
! |
|
1177 |
||
5302 | 1178 |
removeWorkspace |
1179 |
self removeWorkspace:(self selectedWorkspaceIndexHolder value) |
|
1180 |
! |
|
1181 |
||
1182 |
removeWorkspace:wsIndex |
|
1183 |
|tabList newWsIndex| |
|
1184 |
||
1185 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
18405 | 1186 |
(self askIfModified:'Text was modified. Remove page anyway ?' yesButton:'Remove Buffer') ifFalse:[ |
5302 | 1187 |
^ self |
1188 |
]. |
|
1189 |
]. |
|
1190 |
||
1191 |
tabList := self tabList. |
|
1192 |
||
1193 |
wsIndex == tabList size ifTrue:[ |
|
1194 |
newWsIndex := wsIndex - 1. |
|
1195 |
] ifFalse:[ |
|
1196 |
newWsIndex := wsIndex. |
|
1197 |
]. |
|
1198 |
||
1199 |
tabList removeIndex:wsIndex. |
|
1200 |
(workspaces at:wsIndex) destroy. |
|
1201 |
workspaces removeIndex:wsIndex. |
|
1202 |
||
1203 |
tabList size == 1 ifTrue:[ |
|
1204 |
self window label:(tabList at:1). |
|
1205 |
tabList removeIndex:1 |
|
1206 |
]. |
|
1207 |
||
1208 |
workspaceHolder value:(workspaces at:newWsIndex). |
|
1209 |
self selectedWorkspaceIndexHolder value:newWsIndex. |
|
1210 |
"/ to force change (update workspaceHolder - even if same index) |
|
18405 | 1211 |
self selectedWorkspaceIndexHolder changed:#value. |
1212 |
||
1213 |
"Modified: / 21-09-2018 / 11:25:30 / Claus Gittinger" |
|
5302 | 1214 |
! |
1215 |
||
1216 |
renameWorkspace |
|
1217 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
1218 |
! |
|
1219 |
||
1220 |
renameWorkspace:wsIndex |
|
1221 |
|tabList oldName newName| |
|
1222 |
||
1223 |
tabList := self tabList. |
|
1224 |
tabList isEmpty ifTrue:[ |
|
1225 |
oldName := self window label |
|
1226 |
] ifFalse:[ |
|
1227 |
oldName := tabList at:wsIndex. |
|
1228 |
]. |
|
11626 | 1229 |
newName := Dialog request:(resources string:'New Name for "%1":' with:oldName) initialAnswer:oldName. |
5302 | 1230 |
newName size == 0 ifTrue:[ ^ self]. |
1231 |
||
1232 |
self renameWorkspace:wsIndex to:newName. |
|
11626 | 1233 |
|
1234 |
"Modified: / 20-07-2012 / 10:21:29 / cg" |
|
5302 | 1235 |
! |
1236 |
||
1237 |
renameWorkspace:wsIndex to:newName |
|
1238 |
|tabList| |
|
1239 |
||
1240 |
tabList := self tabList. |
|
1241 |
tabList notEmpty ifTrue:[ |
|
1242 |
tabList at:wsIndex put:newName. |
|
1243 |
]. |
|
1244 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
1245 |
self window label:newName. |
|
1246 |
]. |
|
1247 |
! ! |
|
1248 |
||
1249 |
!MultiViewToolApplication methodsFor:'menu-actions-editing'! |
|
1250 |
||
1251 |
copySelection |
|
8498 | 1252 |
|v| |
1253 |
||
1254 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1255 |
v copySelection |
|
1256 |
] |
|
5302 | 1257 |
! |
1258 |
||
1259 |
cutSelection |
|
8498 | 1260 |
|v| |
1261 |
||
1262 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1263 |
v cutSelection |
|
1264 |
]. |
|
5302 | 1265 |
! |
1266 |
||
1267 |
paste |
|
8498 | 1268 |
|v| |
1269 |
||
1270 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1271 |
v paste |
|
1272 |
] |
|
5302 | 1273 |
! |
1274 |
||
1275 |
paste:aString |
|
9634 | 1276 |
|v| |
9633 | 1277 |
|
9634 | 1278 |
v := (workspaceHolder value) ? (self selectedWorkspacesTextView). |
11482 | 1279 |
[ |
1280 |
v perform:#paste: with:aString. |
|
1281 |
] on:MessageNotUnderstood do:[:ex| |
|
1282 |
"special code, to catch exeception sent from a scrolled view, |
|
1283 |
which has a different receiver tha v" |
|
1284 |
(ex selector ~~ #paste:) ifTrue:[ |
|
1285 |
ex reject. |
|
1286 |
]. |
|
1287 |
"else ignore it" |
|
1288 |
]. |
|
9634 | 1289 |
|
9636 | 1290 |
"Modified: / 16-11-2010 / 15:27:39 / cg" |
5302 | 1291 |
! |
1292 |
||
8509 | 1293 |
redo |
1294 |
|v| |
|
1295 |
||
1296 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1297 |
v redo. |
|
1298 |
] |
|
1299 |
! |
|
1300 |
||
8498 | 1301 |
search |
1302 |
|v| |
|
1303 |
||
1304 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1305 |
v search. |
|
1306 |
] |
|
1307 |
! |
|
1308 |
||
5302 | 1309 |
selectAll |
8498 | 1310 |
|v| |
1311 |
||
1312 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1313 |
v selectAll. |
|
1314 |
] |
|
8509 | 1315 |
! |
1316 |
||
1317 |
undo |
|
1318 |
|v| |
|
1319 |
||
1320 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1321 |
v undo. |
|
1322 |
] |
|
5302 | 1323 |
! ! |
1324 |
||
1325 |
!MultiViewToolApplication methodsFor:'private'! |
|
1326 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1327 |
askForFile:question default:defaultFilename thenDo:aBlock |
5302 | 1328 |
Dialog |
1329 |
requestSaveFileName:(resources string:question) |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1330 |
default:defaultFilename |
5302 | 1331 |
fromDirectory:nil |
1332 |
action:[:fileName | aBlock value:fileName value:false] |
|
1333 |
appendAction:[:fileName | aBlock value:fileName value:true] |
|
1334 |
||
1335 |
"/ |file doAppend| |
|
1336 |
"/ |
|
1337 |
"/ doAppend := false. |
|
1338 |
"/ Dialog aboutToOpenBoxNotificationSignal handle:[:n | |
|
1339 |
"/ |box| |
|
1340 |
"/ |
|
1341 |
"/ box := n parameter. |
|
1342 |
"/ box addButton:(Button label:'Append' action:[doAppend := true. box okPressed]). |
|
1343 |
"/ n proceed. |
|
1344 |
"/ ] do:[ |
|
1345 |
"/ file := Dialog requestFileName:question default:'file.wsp'. |
|
1346 |
"/ ]. |
|
1347 |
"/ file isEmptyOrNil ifFalse:[ |
|
1348 |
"/ aBlock value:file value:doAppend |
|
1349 |
"/ ]. |
|
1350 |
! |
|
1351 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1352 |
askForFile:question thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1353 |
^ self |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1354 |
askForFile:question default:'file.wsp' thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1355 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1356 |
|
5302 | 1357 |
askIfAnyModified:arg1 yesButton:arg2 |
1358 |
"raise an error: must be redefined in concrete subclass(es)" |
|
1359 |
||
1360 |
^ self subclassResponsibility |
|
1361 |
! |
|
1362 |
||
1363 |
askIfModified:question yesButton:yesButtonText |
|
1364 |
"tell user, that code has been modified - let her confirm" |
|
1365 |
||
1366 |
|textView| |
|
1367 |
||
1368 |
textView := self selectedWorkspace. |
|
1369 |
(self isModifiedWorkspace:textView) ifFalse:[^ true]. |
|
1370 |
||
1371 |
(Dialog |
|
6354 | 1372 |
confirm:(resources stringWithCRs:question) |
6634 | 1373 |
yesLabel:(resources string:yesButtonText) |
1374 |
noLabel:(resources string:'Cancel')) |
|
5302 | 1375 |
ifTrue:[ |
1376 |
"/ reset modified flag so question is asked only once |
|
1377 |
textView modified:false. |
|
1378 |
^ true |
|
1379 |
]. |
|
1380 |
^ false |
|
1381 |
||
1382 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
|
1383 |
! |
|
1384 |
||
1385 |
createWorkspace |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1386 |
|ws| |
5302 | 1387 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1388 |
ws := (HVScrollableView for:EditTextView). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1389 |
^ ws |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1390 |
|
9664 | 1391 |
"Modified: / 09-12-2010 / 10:55:25 / cg" |
5302 | 1392 |
! |
1393 |
||
1394 |
isModifiedWorkspace:aView |
|
1395 |
self subclassResponsibility |
|
1396 |
! |
|
1397 |
||
1398 |
selectedWorkspacesTextView |
|
1399 |
^ self workspaceViewOfView:(self selectedWorkspace) |
|
1400 |
! |
|
1401 |
||
8033 | 1402 |
setLabel:label |
1403 |
tabList size > 1 ifTrue:[ |
|
1404 |
tabList at:self selectedWorkspaceIndexHolder value put:label |
|
1405 |
]. |
|
1406 |
self window label:label. |
|
1407 |
! |
|
1408 |
||
5302 | 1409 |
workspaceViewOfView:aView |
1410 |
|view| |
|
1411 |
||
1412 |
view := aView. |
|
7663 | 1413 |
|
5302 | 1414 |
(view isScrollWrapper) ifTrue:[ |
1415 |
view := view scrolledView. |
|
1416 |
view isNil ifTrue:[^ nil]. |
|
1417 |
]. |
|
7663 | 1418 |
|
5302 | 1419 |
(view isTextView) ifFalse:[ |
7663 | 1420 |
(view isKindOf:InspectorView) ifTrue:[ |
1421 |
view := view workspace. |
|
1422 |
(view isScrollWrapper) ifTrue:[ |
|
1423 |
view := view scrolledView |
|
1424 |
]. |
|
5302 | 1425 |
]. |
1426 |
]. |
|
7663 | 1427 |
(view isTextView) ifTrue:[^ view]. |
1428 |
^ view allSubViewsDetect:[:v| v name = #Workspace] ifNone:nil. |
|
5302 | 1429 |
! ! |
1430 |
||
7650 | 1431 |
!MultiViewToolApplication methodsFor:'user actions'! |
1432 |
||
8497 | 1433 |
hideEditToolbar |
1434 |
self editToolBarVisibleHolder value:false |
|
1435 |
! |
|
1436 |
||
7650 | 1437 |
hideToolbar |
1438 |
self toolBarVisibleHolder value:false |
|
1439 |
||
1440 |
"Created: / 18-02-2007 / 14:55:54 / cg" |
|
1441 |
! ! |
|
1442 |
||
5302 | 1443 |
!MultiViewToolApplication class methodsFor:'documentation'! |
1444 |
||
15408
ff62d43d5a1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
15407
diff
changeset
|
1445 |
version |
15945 | 1446 |
^ '$Header$' |
15408
ff62d43d5a1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
15407
diff
changeset
|
1447 |
! |
ff62d43d5a1a
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
15407
diff
changeset
|
1448 |
|
9058 | 1449 |
version_CVS |
15945 | 1450 |
^ '$Header$' |
5302 | 1451 |
! ! |
12482
e801a369d243
class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents:
11727
diff
changeset
|
1452 |