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