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