author | Claus Gittinger <cg@exept.de> |
Thu, 15 Mar 2007 11:54:57 +0100 | |
changeset 7745 | de4f256227cd |
parent 7663 | c11efe4cbcf3 |
child 7824 | 09995d9a889d |
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' |
|
7650 | 16 |
classVariableNames:'DefaultInfoVisible' |
5302 | 17 |
poolDictionaries:'' |
18 |
category:'Interface-Smalltalk' |
|
19 |
! |
|
20 |
||
21 |
!MultiViewToolApplication class methodsFor:'documentation'! |
|
22 |
||
6179 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
5302 | 37 |
documentation |
38 |
" |
|
39 |
Common code for multiView applications (Workspace and Terminal app) |
|
40 |
||
41 |
[author:] |
|
42 |
Claus Gittinger |
|
43 |
" |
|
44 |
! ! |
|
45 |
||
7650 | 46 |
!MultiViewToolApplication class methodsFor:'help specs'! |
47 |
||
48 |
helpSpec |
|
49 |
"This resource specification was automatically generated |
|
50 |
by the UIHelpTool of ST/X." |
|
51 |
||
52 |
"Do not manually edit this!! If it is corrupted, |
|
53 |
the UIHelpTool may not be able to read the specification." |
|
54 |
||
55 |
" |
|
56 |
UIHelpTool openOnClass:MultiViewToolApplication |
|
57 |
" |
|
58 |
||
59 |
<resource: #help> |
|
60 |
||
61 |
^ super helpSpec addPairsFrom:#( |
|
62 |
||
63 |
#hideToolBar |
|
64 |
'' |
|
65 |
||
66 |
) |
|
67 |
! ! |
|
68 |
||
69 |
!MultiViewToolApplication class methodsFor:'image specs'! |
|
70 |
||
71 |
hideToolBarIcon |
|
72 |
<resource: #programImage> |
|
73 |
||
74 |
^ ToolbarIconLibrary hideToolBarIcon |
|
75 |
||
76 |
"Created: / 18-02-2007 / 14:53:38 / cg" |
|
77 |
! ! |
|
78 |
||
5302 | 79 |
!MultiViewToolApplication class methodsFor:'interface specs'! |
80 |
||
81 |
windowSpec |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
82 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
83 |
by the UIPainter of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
84 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
85 |
"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
|
86 |
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
|
87 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
88 |
" |
7650 | 89 |
UIPainter new openOnClass:MultiViewToolApplication andSelector:#windowSpec |
90 |
MultiViewToolApplication new openInterface:#windowSpec |
|
91 |
MultiViewToolApplication open |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
92 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
93 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
94 |
<resource: #canvas> |
5302 | 95 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
96 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
97 |
#(FullSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
98 |
name: windowSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
99 |
window: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
100 |
(WindowSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
101 |
label: 'Workspace' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
102 |
name: 'Workspace' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
103 |
min: (Point 10 10) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
104 |
bounds: (Rectangle 0 0 432 241) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
105 |
menu: mainMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
106 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
107 |
component: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
108 |
(SpecCollection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
109 |
collection: ( |
7650 | 110 |
(ViewSpec |
111 |
name: 'ToolBar' |
|
112 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
113 |
visibilityChannel: toolBarVisibleHolder |
|
114 |
component: |
|
115 |
(SpecCollection |
|
116 |
collection: ( |
|
117 |
(ActionButtonSpec |
|
118 |
label: 'hideToolBarIcon' |
|
119 |
name: 'HideToolBarButton' |
|
120 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
121 |
activeHelpKey: hideToolBar |
|
122 |
hasCharacterOrientedLabel: false |
|
123 |
translateLabel: true |
|
124 |
model: hideToolbar |
|
125 |
postBuildCallback: hideToolBarButtonCreated: |
|
126 |
) |
|
127 |
(MenuPanelSpec |
|
128 |
name: 'ToolBarMenu' |
|
129 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
130 |
visibilityChannel: toolBarVisibleHolder |
|
131 |
menu: toolBarMenu |
|
132 |
textDefault: true |
|
133 |
) |
|
134 |
) |
|
135 |
||
136 |
) |
|
137 |
) |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
138 |
(NoteBookViewSpec |
7650 | 139 |
name: 'NoteBook' |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
140 |
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
|
141 |
model: selectedWorkspaceIndexHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
142 |
menu: tabList |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
143 |
useIndex: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
144 |
accessTabMenuAction: tabMenuAt: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
145 |
destroyTabAction: destroyTab: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
146 |
canvas: workspaceHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
147 |
canvasInset: 0 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
148 |
keepCanvasAlive: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
149 |
tabLevel: 1 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
150 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
151 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
152 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
153 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
154 |
) |
5302 | 155 |
! ! |
156 |
||
157 |
!MultiViewToolApplication class methodsFor:'menu specs'! |
|
158 |
||
159 |
mainMenu |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
160 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
161 |
by the MenuEditor of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
162 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
163 |
"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
|
164 |
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
|
165 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
166 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
167 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#mainMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
168 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication mainMenu)) startUp |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
169 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
170 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
171 |
<resource: #menu> |
5302 | 172 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
173 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
174 |
#(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
175 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
176 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
177 |
label: 'File' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
178 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
179 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
180 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
181 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
182 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
183 |
label: 'New Editor' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
184 |
itemValue: newWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
185 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
186 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
187 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
188 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
189 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
190 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
191 |
label: 'Load File...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
192 |
itemValue: menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
193 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
194 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
195 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
196 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
197 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
198 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
199 |
label: 'Save As...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
200 |
itemValue: menuSaveAs |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
201 |
translateLabel: true |
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 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
204 |
enabled: hasMultipleBuffersHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
205 |
label: 'Save all As...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
206 |
itemValue: menuSaveAllAs |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
207 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
208 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
209 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
210 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
211 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
212 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
213 |
label: 'Print...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
214 |
itemValue: menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
215 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
216 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
217 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
218 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
219 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
220 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
221 |
label: 'Exit' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
222 |
itemValue: closeRequest |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
223 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
224 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
225 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
226 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
227 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
228 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
229 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
230 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
231 |
label: 'Buffers' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
232 |
nameKey: Buffer |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
233 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
234 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
235 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
236 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
237 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
238 |
label: 'Add Buffer' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
239 |
itemValue: addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
240 |
translateLabel: true |
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 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
243 |
label: '-' |
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 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
246 |
label: 'Rename...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
247 |
itemValue: renameWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
248 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
249 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
250 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
251 |
label: '-' |
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 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
254 |
enabled: canRemoveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
255 |
label: 'Remove Buffer' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
256 |
itemValue: removeWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
257 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
258 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
259 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
260 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
261 |
nil |
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 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
264 |
(MenuItem |
7650 | 265 |
label: 'View' |
266 |
translateLabel: true |
|
267 |
submenuChannel: viewMenu |
|
268 |
keepLinkedMenu: true |
|
269 |
) |
|
270 |
(MenuItem |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
271 |
label: 'Edit' |
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 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
274 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
275 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
276 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
277 |
enabled: hasSelectionInActiveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
278 |
label: 'Cut' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
279 |
itemValue: cutSelection |
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: hasSelectionInActiveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
284 |
label: 'Copy' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
285 |
itemValue: copySelection |
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: 'Paste' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
290 |
itemValue: paste |
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: 'Select All' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
298 |
itemValue: selectAll |
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: 'MENU_Help' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
308 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
309 |
startGroup: conditionalRight |
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: 'About this Application...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
315 |
itemValue: openAboutThisApplication |
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 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
319 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
320 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
321 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
322 |
) |
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 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
325 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
326 |
) |
7650 | 327 |
|
328 |
"Modified: / 18-02-2007 / 15:18:25 / cg" |
|
5302 | 329 |
! |
330 |
||
331 |
tabMenu |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
332 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
333 |
by the MenuEditor of ST/X." |
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 |
"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
|
336 |
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
|
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 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
340 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp |
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 |
<resource: #menu> |
5302 | 344 |
|
7475
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 |
#(#Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
347 |
#( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
348 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
349 |
#label: 'Add Tab' |
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 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
352 |
#value: #addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
353 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
354 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
355 |
#label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
356 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
357 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
358 |
#label: 'Remove Tab' |
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 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
361 |
#value: #removeWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
362 |
#enabled: #canRemoveWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
363 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
364 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
365 |
#label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
366 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
367 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
368 |
#label: 'Rename...' |
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 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
371 |
#value: #renameWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
372 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
373 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
374 |
nil |
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 |
) |
7650 | 377 |
! |
378 |
||
379 |
toolBarMenu |
|
380 |
"This resource specification was automatically generated |
|
381 |
by the MenuEditor of ST/X." |
|
382 |
||
383 |
"Do not manually edit this!! If it is corrupted, |
|
384 |
the MenuEditor may not be able to read the specification." |
|
385 |
||
386 |
" |
|
387 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu |
|
388 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp |
|
389 |
" |
|
390 |
||
391 |
<resource: #menu> |
|
392 |
||
393 |
^ |
|
394 |
#(Menu |
|
395 |
( |
|
396 |
(MenuItem |
|
397 |
label: '' |
|
398 |
) |
|
399 |
(MenuItem |
|
400 |
"/ activeHelpKey: addWorkspace |
|
401 |
label: 'Add Buffer' |
|
402 |
itemValue: addWorkspace |
|
403 |
translateLabel: true |
|
404 |
isButton: true |
|
405 |
labelImage: (ResourceRetriever ToolbarIconLibrary addBufferIcon) |
|
406 |
) |
|
407 |
) |
|
408 |
nil |
|
409 |
nil |
|
410 |
) |
|
411 |
||
412 |
"Modified: / 18-02-2007 / 14:59:21 / cg" |
|
413 |
! |
|
414 |
||
415 |
viewMenu |
|
416 |
"This resource specification was automatically generated |
|
417 |
by the MenuEditor of ST/X." |
|
418 |
||
419 |
"Do not manually edit this!! If it is corrupted, |
|
420 |
the MenuEditor may not be able to read the specification." |
|
421 |
||
422 |
" |
|
423 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#viewMenu |
|
424 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication viewMenu)) startUp |
|
425 |
" |
|
426 |
||
427 |
<resource: #menu> |
|
428 |
||
429 |
^ |
|
430 |
#(Menu |
|
431 |
( |
|
432 |
(MenuItem |
|
433 |
label: 'Toolbar' |
|
434 |
translateLabel: true |
|
435 |
hideMenuOnActivated: false |
|
436 |
indication: toolBarVisibleHolder |
|
437 |
) |
|
438 |
(MenuItem |
|
439 |
label: 'Info' |
|
440 |
translateLabel: true |
|
441 |
isVisible: false |
|
442 |
hideMenuOnActivated: false |
|
7653
71f20b5aab8d
Do not refer to non-existant aspect
Stefan Vogel <sv@exept.de>
parents:
7650
diff
changeset
|
443 |
indication: infoVisibleHolder |
7650 | 444 |
) |
445 |
) |
|
446 |
nil |
|
447 |
nil |
|
448 |
) |
|
5302 | 449 |
! ! |
450 |
||
451 |
!MultiViewToolApplication class methodsFor:'queries'! |
|
452 |
||
453 |
isVisualStartable |
|
454 |
"return true, if this application can be started via #open. |
|
455 |
(to allow start of a change browser via double-click in the browser)" |
|
456 |
||
5303 | 457 |
self == MultiViewToolApplication ifTrue:[^false]. |
5302 | 458 |
^ super isVisualStartable |
459 |
! ! |
|
460 |
||
461 |
!MultiViewToolApplication methodsFor:'accessing'! |
|
462 |
||
463 |
selectedWorkspace |
|
464 |
|wsIndex| |
|
465 |
||
466 |
workspaces isNil ifTrue:[ |
|
467 |
workspaces := OrderedCollection new. |
|
468 |
]. |
|
469 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
470 |
wsIndex == 0 ifTrue:[ |
|
471 |
^ nil |
|
472 |
]. |
|
473 |
||
474 |
workspaces size < wsIndex ifTrue:[ |
|
475 |
workspaces grow:wsIndex. |
|
476 |
workspaces at:wsIndex put:(self createWorkspace). |
|
477 |
]. |
|
478 |
^ workspaces at:wsIndex |
|
479 |
! |
|
480 |
||
481 |
tabMenuAt:index |
|
6244 | 482 |
<resource: #programMenu> |
483 |
||
5302 | 484 |
|m i ws| |
485 |
||
486 |
m := self class tabMenu. |
|
487 |
m := m decodeAsLiteralArray. |
|
488 |
i := m detectItem:[:item | item value == #removeWorkspace:] ifNone:nil. |
|
489 |
i notNil ifTrue:[ |
|
490 |
i argument:index. |
|
491 |
index ~~ self selectedWorkspaceIndexHolder value ifTrue:[ |
|
492 |
"/ for now: if that buffer is modified, |
|
493 |
"/ do not allow removing. |
|
494 |
"/ (must be brought to front, in order for check-for-modification to work) |
|
495 |
ws := workspaces at:index. |
|
496 |
(ws isKindOf:ScrollableView) ifTrue:[ |
|
497 |
ws := ws scrolledView |
|
498 |
]. |
|
499 |
((ws isKindOf:TextView) not |
|
500 |
or:[ ws modified ]) |
|
501 |
ifTrue:[ |
|
502 |
i disable |
|
503 |
]. |
|
504 |
]. |
|
505 |
]. |
|
506 |
i := m detectItem:[:item | item value == #renameWorkspace:] ifNone:nil. |
|
507 |
i notNil ifTrue:[ |
|
508 |
i argument:index. |
|
509 |
]. |
|
510 |
||
511 |
m findGuiResourcesIn:self. |
|
512 |
^ m |
|
513 |
! |
|
514 |
||
515 |
workspaceHolder |
|
516 |
workspaceHolder isNil ifTrue:[ |
|
517 |
workspaceHolder := ValueHolder with:(self selectedWorkspace). |
|
518 |
]. |
|
519 |
^ workspaceHolder |
|
520 |
! ! |
|
521 |
||
522 |
!MultiViewToolApplication methodsFor:'aspects'! |
|
523 |
||
7650 | 524 |
infoVisibleHolder |
525 |
|holder| |
|
526 |
||
527 |
(holder := builder bindingAt:#infoVisibleHolder) isNil ifTrue:[ |
|
528 |
holder := (DefaultInfoVisible ? true) asValue. |
|
529 |
builder aspectAt:#infoVisibleHolder put: holder. |
|
530 |
holder addDependent:self. |
|
531 |
]. |
|
532 |
^ holder |
|
533 |
||
534 |
"Created: / 18-02-2007 / 15:01:05 / cg" |
|
535 |
! |
|
536 |
||
5302 | 537 |
selectedWorkspaceIndexHolder |
538 |
selectedWorkspaceIndexHolder isNil ifTrue:[ |
|
539 |
selectedWorkspaceIndexHolder := 1 asValue. |
|
540 |
selectedWorkspaceIndexHolder onChangeSend:#workspaceSelectionChanged to:self. |
|
541 |
]. |
|
542 |
^ selectedWorkspaceIndexHolder. |
|
543 |
! |
|
544 |
||
545 |
tabList |
|
546 |
tabList isNil ifTrue:[ |
|
547 |
tabList := List new. |
|
548 |
]. |
|
549 |
^ tabList. |
|
7650 | 550 |
! |
551 |
||
552 |
toolBarVisibleHolder |
|
553 |
|holder| |
|
554 |
||
555 |
(holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[ |
|
556 |
holder := (DefaultToolBarVisible ? false) asValue. |
|
557 |
builder aspectAt:#toolBarVisibleHolder put: holder. |
|
558 |
holder addDependent:self. |
|
559 |
]. |
|
560 |
^ holder |
|
561 |
||
562 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
5302 | 563 |
! ! |
564 |
||
565 |
!MultiViewToolApplication methodsFor:'aspects-queries'! |
|
566 |
||
567 |
canRemoveWorkspace |
|
568 |
^ self canRemoveWorkspace:(self selectedWorkspaceIndexHolder value) |
|
569 |
! |
|
570 |
||
571 |
canRemoveWorkspace:idx |
|
572 |
^ self tabList size > 1 |
|
573 |
"/ and:[ (self workspacesTextViewAt:(self selectedWorkspaceIndexHolder value)) |
|
574 |
! |
|
575 |
||
576 |
hasMultipleBuffersHolder |
|
577 |
^ [ workspaces size > 1 ] |
|
578 |
! |
|
579 |
||
580 |
hasSelectionInActiveWorkspace |
|
6424 | 581 |
|v| |
582 |
||
583 |
v := self selectedWorkspacesTextView. |
|
584 |
^ v notNil and:[v selectionAsString size > 0] |
|
5302 | 585 |
! ! |
586 |
||
7650 | 587 |
!MultiViewToolApplication methodsFor:'change & update'! |
588 |
||
589 |
update:something with:aParameter from:changedObject |
|
590 |
changedObject == self toolBarVisibleHolder ifTrue:[ |
|
591 |
self toolBarVisibilityChanged. |
|
592 |
^ self |
|
593 |
]. |
|
594 |
^ super update:something with:aParameter from:changedObject |
|
595 |
||
596 |
"Modified: / 18-02-2007 / 14:45:53 / cg" |
|
597 |
! ! |
|
598 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
599 |
!MultiViewToolApplication methodsFor:'defaults'! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
600 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
601 |
defaultFileNameForLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
602 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
603 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
604 |
"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
|
605 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
606 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
607 |
defaultFileNameForSave |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
608 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
609 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
610 |
"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
|
611 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
612 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
613 |
defaultFileNameForSaveAll |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
614 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
615 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
616 |
"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
|
617 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
618 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
619 |
defaultPatternLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
620 |
^ '*.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
621 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
622 |
"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
|
623 |
! ! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
624 |
|
7650 | 625 |
!MultiViewToolApplication methodsFor:'initialization'! |
626 |
||
627 |
hideToolBarButtonCreated:aButton |
|
628 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
629 |
"/ aButton passiveLevel:1. |
|
630 |
aButton activeLevel:-1. |
|
631 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
632 |
||
633 |
"Created: / 18-02-2007 / 14:48:28 / cg" |
|
634 |
! |
|
635 |
||
636 |
postBuildWith:aBuilder |
|
637 |
super postBuildWith:aBuilder. |
|
638 |
self infoVisibleHolder value ifTrue:[ self infoVisibilityChanged ]. |
|
639 |
self toolBarVisibleHolder value ifTrue:[ self toolBarVisibilityChanged ]. |
|
640 |
||
641 |
"Created: / 18-02-2007 / 15:03:08 / cg" |
|
642 |
! ! |
|
643 |
||
5302 | 644 |
!MultiViewToolApplication methodsFor:'menu-actions'! |
645 |
||
646 |
addWindow:aWindow named:name |
|
647 |
^ self addWindow:aWindow named:name asFirst:false |
|
648 |
! |
|
649 |
||
650 |
addWindow:aWindow named:name asFirst:asFirst |
|
651 |
|tabList wsIndex newSelectedIndex| |
|
652 |
||
653 |
tabList := self tabList. |
|
654 |
wsIndex := tabList size + 1. |
|
655 |
wsIndex == 1 ifTrue:[ |
|
656 |
"/ first - add a name for the first tab |
|
657 |
tabList add:(self window label). "/ 'Workspace'. |
|
658 |
wsIndex := wsIndex + 1. |
|
659 |
]. |
|
660 |
||
661 |
workspaces grow:wsIndex. |
|
662 |
asFirst ifTrue:[ |
|
663 |
tabList addFirst:(name bindWith:wsIndex). |
|
664 |
workspaces replaceFrom:2 to:wsIndex with:workspaces startingAt:1. |
|
665 |
newSelectedIndex := 1. |
|
666 |
] ifFalse:[ |
|
667 |
tabList addLast:(name bindWith:wsIndex). |
|
668 |
newSelectedIndex := wsIndex. |
|
669 |
]. |
|
670 |
workspaces at:newSelectedIndex put:aWindow. |
|
671 |
self selectedWorkspaceIndexHolder value:newSelectedIndex. |
|
672 |
"/ workspaceHolder value:aWindow. |
|
673 |
! |
|
674 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
675 |
addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
676 |
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
|
677 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
678 |
|
6458 | 679 |
destroyTab:tabIndex |
680 |
self removeWorkspace:tabIndex |
|
681 |
! |
|
682 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
683 |
loadFile:aFileName |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
684 |
self loadFile:aFileName encoding:nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
685 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
686 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
687 |
loadFile:aFileName encoding:encodingSymbolOrNil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
688 |
|lbl| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
689 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
690 |
lbl := aFileName asFilename withoutSuffix baseName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
691 |
self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
692 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
693 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
694 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
695 |
|file ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
696 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
697 |
file := aFileName asFilename. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
698 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
699 |
[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
700 |
|contents| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
701 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
702 |
contents := file contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
703 |
encodingSymbolOrNil notNil ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
704 |
contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
705 |
ws externalEncoding:encodingSymbolOrNil. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
706 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
707 |
ws contents:contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
708 |
ws defaultFileNameForFileDialog:file pathName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
709 |
] on:StreamError do:[:ex| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
710 |
Dialog warn:(resources string:'Cannot open %1: %2' with:file asString with:ex description). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
711 |
^ self |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
712 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
713 |
ws modified:false. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
714 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
715 |
tabList size <= 1 ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
716 |
self window label:label. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
717 |
] ifFalse:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
718 |
tabList at:self selectedWorkspaceIndexHolder value put:label |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
719 |
] |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
720 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
721 |
|
7745 | 722 |
loadFile:aFileName label:lbl |
723 |
|encoding| |
|
724 |
||
725 |
encoding := CharacterEncoder guessEncodingOfFile:aFileName. |
|
726 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
|
727 |
encoding := nil |
|
728 |
]. |
|
729 |
self loadFile:aFileName encoding:encoding label:lbl. |
|
730 |
||
731 |
"Created: / 15-03-2007 / 11:52:21 / cg" |
|
732 |
! |
|
733 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
734 |
menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
735 |
|file| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
736 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
737 |
(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
|
738 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
739 |
file := Dialog |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
740 |
requestFileName:(resources string:'Load file') |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
741 |
default:(self defaultFileNameForLoad) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
742 |
pattern:(self defaultPatternLoad). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
743 |
file size ~~ 0 ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
744 |
self loadFile:file |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
745 |
] |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
746 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
747 |
"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
|
748 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
749 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
750 |
menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
751 |
|ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
752 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
753 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
754 |
ws doPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
755 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
756 |
"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
|
757 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
758 |
|
5302 | 759 |
menuSaveAllAs |
760 |
self |
|
761 |
askForFile:'Save all Buffers into:' |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
762 |
default:(self defaultFilenameForSaveAll) |
5302 | 763 |
thenDo:[:file :doAppend | |
764 |
|ws append| |
|
765 |
||
766 |
append := doAppend. |
|
767 |
workspaces do:[:subView | |
|
768 |
|ws| |
|
769 |
||
770 |
ws := self workspaceViewOfView:subView. |
|
771 |
ws notNil ifTrue:[ |
|
772 |
ws saveAs:file doAppend:append. |
|
773 |
ws modified:false. |
|
774 |
]. |
|
775 |
append := true. |
|
776 |
]. |
|
777 |
] |
|
778 |
! |
|
779 |
||
780 |
menuSaveAs |
|
781 |
self |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
782 |
askForFile:'Save Buffer into:' |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
783 |
default:(self defaultFileNameForSave) |
5302 | 784 |
thenDo:[:file :doAppend | |
785 |
|ws| |
|
786 |
||
787 |
ws := self selectedWorkspacesTextView. |
|
788 |
ws saveAs:file doAppend:doAppend. |
|
789 |
ws modified:false. |
|
790 |
] |
|
791 |
! |
|
792 |
||
793 |
newWorkspace |
|
6863 | 794 |
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
|
795 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
796 |
"Modified: / 25-10-2006 / 14:39:15 / cg" |
5302 | 797 |
! |
798 |
||
799 |
removeWorkspace |
|
800 |
self removeWorkspace:(self selectedWorkspaceIndexHolder value) |
|
801 |
! |
|
802 |
||
803 |
removeWorkspace:wsIndex |
|
804 |
|tabList newWsIndex| |
|
805 |
||
806 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
6509 | 807 |
(self askIfModified:'Text was modified. Remove buffer anyway ?' yesButton:'Remove Buffer') ifFalse:[ |
5302 | 808 |
^ self |
809 |
]. |
|
810 |
]. |
|
811 |
||
812 |
tabList := self tabList. |
|
813 |
||
814 |
wsIndex == tabList size ifTrue:[ |
|
815 |
newWsIndex := wsIndex - 1. |
|
816 |
] ifFalse:[ |
|
817 |
newWsIndex := wsIndex. |
|
818 |
]. |
|
819 |
||
820 |
tabList removeIndex:wsIndex. |
|
821 |
(workspaces at:wsIndex) destroy. |
|
822 |
workspaces removeIndex:wsIndex. |
|
823 |
||
824 |
tabList size == 1 ifTrue:[ |
|
825 |
self window label:(tabList at:1). |
|
826 |
tabList removeIndex:1 |
|
827 |
]. |
|
828 |
||
829 |
workspaceHolder value:(workspaces at:newWsIndex). |
|
830 |
self selectedWorkspaceIndexHolder value:newWsIndex. |
|
831 |
"/ to force change (update workspaceHolder - even if same index) |
|
832 |
self selectedWorkspaceIndexHolder changed:#value. |
|
833 |
! |
|
834 |
||
835 |
renameWorkspace |
|
836 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
837 |
! |
|
838 |
||
839 |
renameWorkspace:wsIndex |
|
840 |
|tabList oldName newName| |
|
841 |
||
842 |
tabList := self tabList. |
|
843 |
tabList isEmpty ifTrue:[ |
|
844 |
oldName := self window label |
|
845 |
] ifFalse:[ |
|
846 |
oldName := tabList at:wsIndex. |
|
847 |
]. |
|
848 |
newName := Dialog request:(resources string:'New Name for %1:' with:oldName) initialAnswer:oldName. |
|
849 |
newName size == 0 ifTrue:[ ^ self]. |
|
850 |
||
851 |
self renameWorkspace:wsIndex to:newName. |
|
852 |
! |
|
853 |
||
854 |
renameWorkspace:wsIndex to:newName |
|
855 |
|tabList| |
|
856 |
||
857 |
tabList := self tabList. |
|
858 |
tabList notEmpty ifTrue:[ |
|
859 |
tabList at:wsIndex put:newName. |
|
860 |
]. |
|
861 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
862 |
self window label:newName. |
|
863 |
]. |
|
864 |
! ! |
|
865 |
||
866 |
!MultiViewToolApplication methodsFor:'menu-actions-editing'! |
|
867 |
||
868 |
copySelection |
|
869 |
self selectedWorkspacesTextView copySelection |
|
870 |
! |
|
871 |
||
872 |
cutSelection |
|
873 |
self selectedWorkspacesTextView cutSelection |
|
874 |
! |
|
875 |
||
876 |
paste |
|
877 |
self selectedWorkspacesTextView paste |
|
878 |
! |
|
879 |
||
880 |
paste:aString |
|
881 |
self selectedWorkspacesTextView paste:aString. |
|
882 |
! |
|
883 |
||
884 |
selectAll |
|
885 |
self selectedWorkspacesTextView selectAll. |
|
886 |
! ! |
|
887 |
||
888 |
!MultiViewToolApplication methodsFor:'private'! |
|
889 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
890 |
askForFile:question default:defaultFilename thenDo:aBlock |
5302 | 891 |
Dialog |
892 |
requestSaveFileName:(resources string:question) |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
893 |
default:defaultFilename |
5302 | 894 |
fromDirectory:nil |
895 |
action:[:fileName | aBlock value:fileName value:false] |
|
896 |
appendAction:[:fileName | aBlock value:fileName value:true] |
|
897 |
||
898 |
"/ |file doAppend| |
|
899 |
"/ |
|
900 |
"/ doAppend := false. |
|
901 |
"/ Dialog aboutToOpenBoxNotificationSignal handle:[:n | |
|
902 |
"/ |box| |
|
903 |
"/ |
|
904 |
"/ box := n parameter. |
|
905 |
"/ box addButton:(Button label:'Append' action:[doAppend := true. box okPressed]). |
|
906 |
"/ n proceed. |
|
907 |
"/ ] do:[ |
|
908 |
"/ file := Dialog requestFileName:question default:'file.wsp'. |
|
909 |
"/ ]. |
|
910 |
"/ file isEmptyOrNil ifFalse:[ |
|
911 |
"/ aBlock value:file value:doAppend |
|
912 |
"/ ]. |
|
913 |
! |
|
914 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
915 |
askForFile:question thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
916 |
^ self |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
917 |
askForFile:question default:'file.wsp' thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
918 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
919 |
|
5302 | 920 |
askIfAnyModified:arg1 yesButton:arg2 |
921 |
"raise an error: must be redefined in concrete subclass(es)" |
|
922 |
||
923 |
^ self subclassResponsibility |
|
924 |
! |
|
925 |
||
926 |
askIfModified:question yesButton:yesButtonText |
|
927 |
"tell user, that code has been modified - let her confirm" |
|
928 |
||
929 |
|textView| |
|
930 |
||
931 |
textView := self selectedWorkspace. |
|
932 |
(self isModifiedWorkspace:textView) ifFalse:[^ true]. |
|
933 |
||
934 |
(Dialog |
|
6354 | 935 |
confirm:(resources stringWithCRs:question) |
6634 | 936 |
yesLabel:(resources string:yesButtonText) |
937 |
noLabel:(resources string:'Cancel')) |
|
5302 | 938 |
ifTrue:[ |
939 |
"/ reset modified flag so question is asked only once |
|
940 |
textView modified:false. |
|
941 |
^ true |
|
942 |
]. |
|
943 |
^ false |
|
944 |
||
945 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
|
946 |
! |
|
947 |
||
948 |
createWorkspace |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
949 |
|ws| |
5302 | 950 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
951 |
ws := (HVScrollableView for:EditTextView). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
952 |
^ ws |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
953 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
954 |
"Modified: / 25-10-2006 / 14:34:19 / cg" |
5302 | 955 |
! |
956 |
||
957 |
isModifiedWorkspace:aView |
|
958 |
self subclassResponsibility |
|
959 |
! |
|
960 |
||
961 |
selectedWorkspacesTextView |
|
962 |
^ self workspaceViewOfView:(self selectedWorkspace) |
|
963 |
! |
|
964 |
||
965 |
workspaceSelectionChanged |
|
966 |
|wsIndex windowLabel v| |
|
967 |
||
968 |
"/ self selected |
|
969 |
self workspaceHolder value:(v := self selectedWorkspace). |
|
970 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
971 |
||
972 |
wsIndex ~~ 0 ifTrue:[ |
|
973 |
windowLabel := tabList at:wsIndex ifAbsent:nil. |
|
974 |
windowLabel notNil ifTrue:[self window label:windowLabel]. |
|
975 |
]. |
|
976 |
! |
|
977 |
||
978 |
workspaceViewOfView:aView |
|
979 |
|view| |
|
980 |
||
981 |
view := aView. |
|
7663 | 982 |
|
5302 | 983 |
(view isScrollWrapper) ifTrue:[ |
984 |
view := view scrolledView. |
|
985 |
view isNil ifTrue:[^ nil]. |
|
986 |
]. |
|
7663 | 987 |
|
5302 | 988 |
(view isTextView) ifFalse:[ |
7663 | 989 |
(view isKindOf:InspectorView) ifTrue:[ |
990 |
view := view workspace. |
|
991 |
(view isScrollWrapper) ifTrue:[ |
|
992 |
view := view scrolledView |
|
993 |
]. |
|
5302 | 994 |
]. |
995 |
]. |
|
7663 | 996 |
(view isTextView) ifTrue:[^ view]. |
997 |
^ view allSubViewsDetect:[:v| v name = #Workspace] ifNone:nil. |
|
5302 | 998 |
! ! |
999 |
||
7650 | 1000 |
!MultiViewToolApplication methodsFor:'user actions'! |
1001 |
||
1002 |
hideToolbar |
|
1003 |
self toolBarVisibleHolder value:false |
|
1004 |
||
1005 |
"Created: / 18-02-2007 / 14:55:54 / cg" |
|
1006 |
! |
|
1007 |
||
1008 |
infoVisibilityChanged |
|
1009 |
|visible cFrame bottomOffset| |
|
1010 |
||
1011 |
visible := self infoVisibleHolder value. |
|
1012 |
||
1013 |
cFrame := builder findComponentAt:#EditorNoteBook. "/ #CodeView. |
|
1014 |
cFrame notNil ifTrue:[ |
|
1015 |
visible ifFalse:[ |
|
1016 |
bottomOffset := 0. |
|
1017 |
] ifTrue:[ |
|
1018 |
bottomOffset := -25. |
|
1019 |
]. |
|
1020 |
cFrame layout bottomOffset:bottomOffset. |
|
1021 |
cFrame container notNil ifTrue:[ |
|
1022 |
cFrame containerChangedSize. |
|
1023 |
]. |
|
1024 |
]. |
|
1025 |
DefaultInfoVisible := visible |
|
1026 |
||
1027 |
"Created: / 18-02-2007 / 15:01:55 / cg" |
|
1028 |
! |
|
1029 |
||
1030 |
toolBarVisibilityChanged |
|
1031 |
|visible toolBar noteBook topOffset| |
|
1032 |
||
1033 |
toolBar := self componentAt:#ToolBar. |
|
1034 |
toolBar isNil ifTrue:[ |
|
1035 |
topOffset := 0. |
|
1036 |
] ifFalse:[ |
|
1037 |
visible := self toolBarVisibleHolder value. |
|
1038 |
DefaultToolBarVisible := visible. |
|
1039 |
visible ifTrue:[ |
|
1040 |
topOffset := toolBar height. |
|
1041 |
] |
|
1042 |
]. |
|
1043 |
||
1044 |
noteBook := self componentAt:#NoteBook. |
|
1045 |
noteBook notNil ifTrue:[ |
|
1046 |
noteBook layout topOffset:topOffset. |
|
1047 |
noteBook container notNil ifTrue:[ |
|
1048 |
noteBook containerChangedSize. |
|
1049 |
]. |
|
1050 |
]. |
|
1051 |
||
1052 |
"Created: / 18-02-2007 / 14:46:22 / cg" |
|
1053 |
! ! |
|
1054 |
||
5302 | 1055 |
!MultiViewToolApplication class methodsFor:'documentation'! |
1056 |
||
1057 |
version |
|
7745 | 1058 |
^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.16 2007-03-15 10:54:57 cg Exp $' |
5302 | 1059 |
! ! |