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