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