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