author | Claus Gittinger <cg@exept.de> |
Mon, 19 Feb 2007 16:06:19 +0100 | |
changeset 7650 | 12fcca896ba0 |
parent 7475 | 54b889153fc7 |
child 7653 | 71f20b5aab8d |
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 |
|
443 |
indication: codeInfoVisible |
|
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 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
722 |
menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
723 |
|file| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
724 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
725 |
(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
|
726 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
727 |
file := Dialog |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
728 |
requestFileName:(resources string:'Load file') |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
729 |
default:(self defaultFileNameForLoad) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
730 |
pattern:(self defaultPatternLoad). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
731 |
file size ~~ 0 ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
732 |
self loadFile:file |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
733 |
] |
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 |
"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
|
736 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
737 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
738 |
menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
739 |
|ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
740 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
741 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
742 |
ws doPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
743 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
744 |
"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
|
745 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
746 |
|
5302 | 747 |
menuSaveAllAs |
748 |
self |
|
749 |
askForFile:'Save all Buffers into:' |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
750 |
default:(self defaultFilenameForSaveAll) |
5302 | 751 |
thenDo:[:file :doAppend | |
752 |
|ws append| |
|
753 |
||
754 |
append := doAppend. |
|
755 |
workspaces do:[:subView | |
|
756 |
|ws| |
|
757 |
||
758 |
ws := self workspaceViewOfView:subView. |
|
759 |
ws notNil ifTrue:[ |
|
760 |
ws saveAs:file doAppend:append. |
|
761 |
ws modified:false. |
|
762 |
]. |
|
763 |
append := true. |
|
764 |
]. |
|
765 |
] |
|
766 |
! |
|
767 |
||
768 |
menuSaveAs |
|
769 |
self |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
770 |
askForFile:'Save Buffer into:' |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
771 |
default:(self defaultFileNameForSave) |
5302 | 772 |
thenDo:[:file :doAppend | |
773 |
|ws| |
|
774 |
||
775 |
ws := self selectedWorkspacesTextView. |
|
776 |
ws saveAs:file doAppend:doAppend. |
|
777 |
ws modified:false. |
|
778 |
] |
|
779 |
! |
|
780 |
||
781 |
newWorkspace |
|
6863 | 782 |
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
|
783 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
784 |
"Modified: / 25-10-2006 / 14:39:15 / cg" |
5302 | 785 |
! |
786 |
||
787 |
removeWorkspace |
|
788 |
self removeWorkspace:(self selectedWorkspaceIndexHolder value) |
|
789 |
! |
|
790 |
||
791 |
removeWorkspace:wsIndex |
|
792 |
|tabList newWsIndex| |
|
793 |
||
794 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
6509 | 795 |
(self askIfModified:'Text was modified. Remove buffer anyway ?' yesButton:'Remove Buffer') ifFalse:[ |
5302 | 796 |
^ self |
797 |
]. |
|
798 |
]. |
|
799 |
||
800 |
tabList := self tabList. |
|
801 |
||
802 |
wsIndex == tabList size ifTrue:[ |
|
803 |
newWsIndex := wsIndex - 1. |
|
804 |
] ifFalse:[ |
|
805 |
newWsIndex := wsIndex. |
|
806 |
]. |
|
807 |
||
808 |
tabList removeIndex:wsIndex. |
|
809 |
(workspaces at:wsIndex) destroy. |
|
810 |
workspaces removeIndex:wsIndex. |
|
811 |
||
812 |
tabList size == 1 ifTrue:[ |
|
813 |
self window label:(tabList at:1). |
|
814 |
tabList removeIndex:1 |
|
815 |
]. |
|
816 |
||
817 |
workspaceHolder value:(workspaces at:newWsIndex). |
|
818 |
self selectedWorkspaceIndexHolder value:newWsIndex. |
|
819 |
"/ to force change (update workspaceHolder - even if same index) |
|
820 |
self selectedWorkspaceIndexHolder changed:#value. |
|
821 |
! |
|
822 |
||
823 |
renameWorkspace |
|
824 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
825 |
! |
|
826 |
||
827 |
renameWorkspace:wsIndex |
|
828 |
|tabList oldName newName| |
|
829 |
||
830 |
tabList := self tabList. |
|
831 |
tabList isEmpty ifTrue:[ |
|
832 |
oldName := self window label |
|
833 |
] ifFalse:[ |
|
834 |
oldName := tabList at:wsIndex. |
|
835 |
]. |
|
836 |
newName := Dialog request:(resources string:'New Name for %1:' with:oldName) initialAnswer:oldName. |
|
837 |
newName size == 0 ifTrue:[ ^ self]. |
|
838 |
||
839 |
self renameWorkspace:wsIndex to:newName. |
|
840 |
! |
|
841 |
||
842 |
renameWorkspace:wsIndex to:newName |
|
843 |
|tabList| |
|
844 |
||
845 |
tabList := self tabList. |
|
846 |
tabList notEmpty ifTrue:[ |
|
847 |
tabList at:wsIndex put:newName. |
|
848 |
]. |
|
849 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
850 |
self window label:newName. |
|
851 |
]. |
|
852 |
! ! |
|
853 |
||
854 |
!MultiViewToolApplication methodsFor:'menu-actions-editing'! |
|
855 |
||
856 |
copySelection |
|
857 |
self selectedWorkspacesTextView copySelection |
|
858 |
! |
|
859 |
||
860 |
cutSelection |
|
861 |
self selectedWorkspacesTextView cutSelection |
|
862 |
! |
|
863 |
||
864 |
paste |
|
865 |
self selectedWorkspacesTextView paste |
|
866 |
! |
|
867 |
||
868 |
paste:aString |
|
869 |
self selectedWorkspacesTextView paste:aString. |
|
870 |
! |
|
871 |
||
872 |
selectAll |
|
873 |
self selectedWorkspacesTextView selectAll. |
|
874 |
! ! |
|
875 |
||
876 |
!MultiViewToolApplication methodsFor:'private'! |
|
877 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
878 |
askForFile:question default:defaultFilename thenDo:aBlock |
5302 | 879 |
Dialog |
880 |
requestSaveFileName:(resources string:question) |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
881 |
default:defaultFilename |
5302 | 882 |
fromDirectory:nil |
883 |
action:[:fileName | aBlock value:fileName value:false] |
|
884 |
appendAction:[:fileName | aBlock value:fileName value:true] |
|
885 |
||
886 |
"/ |file doAppend| |
|
887 |
"/ |
|
888 |
"/ doAppend := false. |
|
889 |
"/ Dialog aboutToOpenBoxNotificationSignal handle:[:n | |
|
890 |
"/ |box| |
|
891 |
"/ |
|
892 |
"/ box := n parameter. |
|
893 |
"/ box addButton:(Button label:'Append' action:[doAppend := true. box okPressed]). |
|
894 |
"/ n proceed. |
|
895 |
"/ ] do:[ |
|
896 |
"/ file := Dialog requestFileName:question default:'file.wsp'. |
|
897 |
"/ ]. |
|
898 |
"/ file isEmptyOrNil ifFalse:[ |
|
899 |
"/ aBlock value:file value:doAppend |
|
900 |
"/ ]. |
|
901 |
! |
|
902 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
903 |
askForFile:question thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
904 |
^ self |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
905 |
askForFile:question default:'file.wsp' thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
906 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
907 |
|
5302 | 908 |
askIfAnyModified:arg1 yesButton:arg2 |
909 |
"raise an error: must be redefined in concrete subclass(es)" |
|
910 |
||
911 |
^ self subclassResponsibility |
|
912 |
! |
|
913 |
||
914 |
askIfModified:question yesButton:yesButtonText |
|
915 |
"tell user, that code has been modified - let her confirm" |
|
916 |
||
917 |
|textView| |
|
918 |
||
919 |
textView := self selectedWorkspace. |
|
920 |
(self isModifiedWorkspace:textView) ifFalse:[^ true]. |
|
921 |
||
922 |
(Dialog |
|
6354 | 923 |
confirm:(resources stringWithCRs:question) |
6634 | 924 |
yesLabel:(resources string:yesButtonText) |
925 |
noLabel:(resources string:'Cancel')) |
|
5302 | 926 |
ifTrue:[ |
927 |
"/ reset modified flag so question is asked only once |
|
928 |
textView modified:false. |
|
929 |
^ true |
|
930 |
]. |
|
931 |
^ false |
|
932 |
||
933 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
|
934 |
! |
|
935 |
||
936 |
createWorkspace |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
937 |
|ws| |
5302 | 938 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
939 |
ws := (HVScrollableView for:EditTextView). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
940 |
^ ws |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
941 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
942 |
"Modified: / 25-10-2006 / 14:34:19 / cg" |
5302 | 943 |
! |
944 |
||
945 |
isModifiedWorkspace:aView |
|
946 |
self subclassResponsibility |
|
947 |
! |
|
948 |
||
949 |
selectedWorkspacesTextView |
|
950 |
^ self workspaceViewOfView:(self selectedWorkspace) |
|
951 |
! |
|
952 |
||
953 |
workspaceSelectionChanged |
|
954 |
|wsIndex windowLabel v| |
|
955 |
||
956 |
"/ self selected |
|
957 |
self workspaceHolder value:(v := self selectedWorkspace). |
|
958 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
959 |
||
960 |
wsIndex ~~ 0 ifTrue:[ |
|
961 |
windowLabel := tabList at:wsIndex ifAbsent:nil. |
|
962 |
windowLabel notNil ifTrue:[self window label:windowLabel]. |
|
963 |
]. |
|
964 |
! |
|
965 |
||
966 |
workspaceViewOfView:aView |
|
967 |
|view| |
|
968 |
||
969 |
view := aView. |
|
970 |
(view isScrollWrapper) ifTrue:[ |
|
971 |
view := view scrolledView. |
|
972 |
view isNil ifTrue:[^ nil]. |
|
973 |
]. |
|
974 |
(view isTextView) ifFalse:[ |
|
975 |
(view isKindOf:InspectorView) ifFalse:[ |
|
976 |
^ nil |
|
977 |
]. |
|
978 |
view := view workspace. |
|
979 |
(view isScrollWrapper) ifTrue:[ |
|
980 |
view := view scrolledView |
|
981 |
]. |
|
982 |
]. |
|
6424 | 983 |
(view isTextView) ifFalse:[ |
984 |
^ nil |
|
985 |
]. |
|
5302 | 986 |
^ view |
987 |
! ! |
|
988 |
||
7650 | 989 |
!MultiViewToolApplication methodsFor:'user actions'! |
990 |
||
991 |
hideToolbar |
|
992 |
self toolBarVisibleHolder value:false |
|
993 |
||
994 |
"Created: / 18-02-2007 / 14:55:54 / cg" |
|
995 |
! |
|
996 |
||
997 |
infoVisibilityChanged |
|
998 |
|visible cFrame bottomOffset| |
|
999 |
||
1000 |
visible := self infoVisibleHolder value. |
|
1001 |
||
1002 |
cFrame := builder findComponentAt:#EditorNoteBook. "/ #CodeView. |
|
1003 |
cFrame notNil ifTrue:[ |
|
1004 |
visible ifFalse:[ |
|
1005 |
bottomOffset := 0. |
|
1006 |
] ifTrue:[ |
|
1007 |
bottomOffset := -25. |
|
1008 |
]. |
|
1009 |
cFrame layout bottomOffset:bottomOffset. |
|
1010 |
cFrame container notNil ifTrue:[ |
|
1011 |
cFrame containerChangedSize. |
|
1012 |
]. |
|
1013 |
]. |
|
1014 |
DefaultInfoVisible := visible |
|
1015 |
||
1016 |
"Created: / 18-02-2007 / 15:01:55 / cg" |
|
1017 |
! |
|
1018 |
||
1019 |
toolBarVisibilityChanged |
|
1020 |
|visible toolBar noteBook topOffset| |
|
1021 |
||
1022 |
toolBar := self componentAt:#ToolBar. |
|
1023 |
toolBar isNil ifTrue:[ |
|
1024 |
topOffset := 0. |
|
1025 |
] ifFalse:[ |
|
1026 |
visible := self toolBarVisibleHolder value. |
|
1027 |
DefaultToolBarVisible := visible. |
|
1028 |
visible ifTrue:[ |
|
1029 |
topOffset := toolBar height. |
|
1030 |
] |
|
1031 |
]. |
|
1032 |
||
1033 |
noteBook := self componentAt:#NoteBook. |
|
1034 |
noteBook notNil ifTrue:[ |
|
1035 |
noteBook layout topOffset:topOffset. |
|
1036 |
noteBook container notNil ifTrue:[ |
|
1037 |
noteBook containerChangedSize. |
|
1038 |
]. |
|
1039 |
]. |
|
1040 |
||
1041 |
"Created: / 18-02-2007 / 14:46:22 / cg" |
|
1042 |
! ! |
|
1043 |
||
5302 | 1044 |
!MultiViewToolApplication class methodsFor:'documentation'! |
1045 |
||
1046 |
version |
|
7650 | 1047 |
^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.13 2007-02-19 15:06:19 cg Exp $' |
5302 | 1048 |
! ! |