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