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