author | Claus Gittinger <cg@exept.de> |
Sun, 19 Jan 2020 00:44:19 +0100 | |
changeset 3838 | 403172bbe664 |
parent 3835 | 08f1102b4a82 |
permissions | -rw-r--r-- |
739 | 1 |
" |
2 |
COPYRIGHT (c) 1997 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 |
" |
|
1431 | 12 |
"{ Package: 'stx:libtool2' }" |
1373 | 13 |
|
3330 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
739 | 16 |
ResourceSpecEditor subclass:#TabListEditor |
1373 | 17 |
instanceVariableNames:'listOfTabs' |
739 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
23 |
!TabListEditor class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
||
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
The TabListEditor allows you to create, modify or just inspect |
|
44 |
tab lists for tab headers or note books. |
|
45 |
||
46 |
[start with:] |
|
47 |
TabItemEditor open |
|
48 |
||
49 |
[see also:] |
|
50 |
TabItem |
|
51 |
TabView |
|
52 |
NoteBookView |
|
53 |
UIPainter |
|
54 |
||
55 |
[author:] |
|
56 |
Claus Atzkern, eXept Software AG |
|
749 | 57 |
Thomas Zwick, eXept Software AG |
739 | 58 |
" |
59 |
||
60 |
||
61 |
! ! |
|
62 |
||
63 |
!TabListEditor class methodsFor:'instance creation'! |
|
64 |
||
65 |
openModalOnTabList: aTabList |
|
66 |
"Open a TabListEditor modal on aTabList" |
|
67 |
"self openModalOnTabList: (Array with: (TabItem label: 'Tab Item 1'))" |
|
68 |
||
69 |
^self new openModalOnTabList: aTabList |
|
70 |
||
71 |
! ! |
|
72 |
||
73 |
!TabListEditor class methodsFor:'accessing'! |
|
74 |
||
75 |
resourceType |
|
76 |
"get the type of resource of the method generated by the TabListEditor" |
|
77 |
||
78 |
^#tabList |
|
79 |
||
80 |
||
81 |
||
82 |
||
83 |
||
84 |
||
85 |
! ! |
|
86 |
||
87 |
!TabListEditor class methodsFor:'aspects'! |
|
88 |
||
89 |
aspects |
|
90 |
"get the aspects for the attributes of the tab list components" |
|
91 |
||
92 |
^#( |
|
93 |
label |
|
94 |
translateLabel |
|
95 |
labelForegroundColor |
|
96 |
enabled |
|
97 |
editAgument |
|
1325 | 98 |
accessCharacterPosition |
99 |
shortcutKey |
|
1373 | 100 |
activeHelpKey |
101 |
||
102 |
majorKey |
|
103 |
minorKey |
|
104 |
createNewBuilder |
|
105 |
||
106 |
hasHorizontalScrollBar |
|
107 |
hasVerticalScrollBar |
|
108 |
miniScrollerHorizontal |
|
109 |
miniScrollerVertical |
|
739 | 110 |
) |
111 |
||
112 |
! ! |
|
113 |
||
114 |
!TabListEditor class methodsFor:'help specs'! |
|
115 |
||
116 |
helpSpec |
|
117 |
"This resource specification was automatically generated |
|
118 |
by the UIHelpTool of ST/X." |
|
119 |
||
120 |
"Do not manually edit this!! If it is corrupted, |
|
121 |
the UIHelpTool may not be able to read the specification." |
|
122 |
||
123 |
" |
|
124 |
UIHelpTool openOnClass:TabListEditor |
|
125 |
" |
|
126 |
||
127 |
<resource: #help> |
|
128 |
||
1845 | 129 |
^ super helpSpec addPairsFrom:#( |
739 | 130 |
|
131 |
#addTabItem |
|
132 |
'Adds a new tab item.' |
|
133 |
||
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
134 |
#applicationProvidesLabel |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
135 |
'If on, the label''s string is a selector returning a string or bitmap image, which is used as logo in the tab item.' |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
136 |
|
1373 | 137 |
#autoHideScrollBars |
138 |
'ScrollBars should be made invisible dynamically, if there is nothing to scroll.' |
|
739 | 139 |
|
1845 | 140 |
#basicTab |
141 |
'Define the basic attributes.' |
|
142 |
||
739 | 143 |
#canSelect |
144 |
'Turns on/off whether the tab item is selectable.' |
|
145 |
||
1845 | 146 |
#canvasTab |
147 |
'Define an application, which is started if the tab is pressed the first time.' |
|
148 |
||
149 |
#color |
|
150 |
'Defines the foreground color of the label. The default color derives from the style sheet.' |
|
151 |
||
1373 | 152 |
#createNewBuilder |
153 |
'Create a new builder for the application; the application use its own aspects.' |
|
154 |
||
1845 | 155 |
#detailTab |
156 |
'Define the optional/specific attributes.' |
|
157 |
||
158 |
#detailsAccelerator |
|
159 |
'Key to be pressed to select the tab item from the keyboard (accelerator key).' |
|
160 |
||
161 |
#detailsAccessCharaterPosition |
|
162 |
'Index of the access character position of the textual label (optional).' |
|
163 |
||
164 |
#detailsArgument |
|
165 |
'An optional argument stored with the tab item.' |
|
739 | 166 |
|
167 |
#fileCreateAspectMethod |
|
168 |
'Creates the aspect method for the tab list.' |
|
169 |
||
170 |
#fileLoad |
|
171 |
'Opens a dialog for selecting and loading a tab list spec from a class.' |
|
172 |
||
173 |
#fileNew |
|
174 |
'Creates a new tab list.' |
|
175 |
||
176 |
#fileSave |
|
177 |
'Saves current tab list.' |
|
178 |
||
1373 | 179 |
#horizontalMiniScroller |
180 |
'Use a mini-scroller as horizontal scrollbar.' |
|
181 |
||
1845 | 182 |
#horizontalScroller |
183 |
'Enable horizontal scrollability.' |
|
1373 | 184 |
|
739 | 185 |
#label |
186 |
'Label of the tab item.' |
|
187 |
||
1845 | 188 |
#majorKey |
189 |
'Name of the class to be started (application if empty); or app-selector returning application instance.' |
|
1373 | 190 |
|
1845 | 191 |
#minorKey |
192 |
'Message sent to the class which returns the window specification (default: #windowSpec).' |
|
1373 | 193 |
|
739 | 194 |
#testPreview |
195 |
'Turns on/off preview of the tab list.' |
|
196 |
||
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
197 |
#translateLabel |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
198 |
'If on, the label is translated using the applications language resources.' |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
199 |
|
1845 | 200 |
#verticalMiniScroller |
201 |
'Use a mini-scroller as vertical scrollbar.' |
|
202 |
||
203 |
#verticalScroller |
|
204 |
'Enable vertical scrollability.' |
|
205 |
||
739 | 206 |
) |
207 |
! ! |
|
208 |
||
209 |
!TabListEditor class methodsFor:'image specs'! |
|
210 |
||
211 |
newTabItemIcon |
|
3118
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
212 |
<resource: #image> |
739 | 213 |
"This resource specification was automatically generated |
214 |
by the ImageEditor of ST/X." |
|
215 |
"Do not manually edit this!!!! If it is corrupted, |
|
216 |
the ImageEditor may not be able to read the specification." |
|
217 |
" |
|
3118
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
218 |
ImageEditor openOnClass:self andSelector:#newTabItemIcon" |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
219 |
|
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
220 |
^ Icon constantNamed:#'TabListEditor newTabItemIcon' |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
221 |
ifAbsentPut:[ |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
222 |
(Depth2Image new) |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
223 |
width:22; |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
224 |
height:22; |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
225 |
photometric:(#palette); |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
226 |
bitsPerSample:(#( 2 )); |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
227 |
samplesPerPixel:(1); |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
228 |
bits:(ByteArray |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
229 |
fromPackedString:'U@@@@EUPUEUUVEUPUF**+EUPUF**+EUPUF**+EUP@F**+@@@EV***UV@F*****+@F KNC*+NF(("H*+@F((BC +EF(("H*+@F(("C*+MF*****+@F"@ H*K@F"""(LK@F"" ("K@F"""(*K@F"" H*K@F*****+HK??????@@@@@@@@@'); |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
230 |
colorMapFromArray:#[ 0 0 0 255 255 255 170 170 170 127 127 127 ]; |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
231 |
mask:((ImageMask new) |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
232 |
width:22; |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
233 |
height:22; |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
234 |
bits:(ByteArray |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
235 |
fromPackedString:'G?<@G?<@G?<@G?<@G?<@???<???<???<???????<???<???<???<???????=???<???????<???????<???<???='); |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
236 |
yourself); |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
237 |
yourself |
d0e78fb8d796
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3093
diff
changeset
|
238 |
] |
1431 | 239 |
! ! |
739 | 240 |
|
241 |
!TabListEditor class methodsFor:'interface specs'! |
|
242 |
||
1373 | 243 |
basicSpec |
739 | 244 |
"This resource specification was automatically generated |
245 |
by the UIPainter of ST/X." |
|
246 |
||
247 |
"Do not manually edit this!! If it is corrupted, |
|
248 |
the UIPainter may not be able to read the specification." |
|
249 |
||
250 |
" |
|
1373 | 251 |
UIPainter new openOnClass:TabListEditor andSelector:#basicSpec |
252 |
TabListEditor new openInterface:#basicSpec |
|
739 | 253 |
" |
254 |
||
255 |
<resource: #canvas> |
|
256 |
||
1183 | 257 |
^ |
1876 | 258 |
#(FullSpec |
259 |
name: basicSpec |
|
260 |
window: |
|
261 |
(WindowSpec |
|
262 |
label: 'Basic' |
|
263 |
name: 'Basic' |
|
264 |
min: (Point 10 10) |
|
265 |
max: (Point 1280 1024) |
|
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
266 |
bounds: (Rectangle 0 0 429 240) |
1183 | 267 |
) |
1876 | 268 |
component: |
269 |
(SpecCollection |
|
270 |
collection: ( |
|
271 |
(LabelSpec |
|
272 |
label: 'Label:' |
|
273 |
name: 'labelLabel' |
|
274 |
layout: (AlignmentOrigin 98 0 26 0 1 0.5) |
|
275 |
translateLabel: true |
|
276 |
resizeForLabel: true |
|
1183 | 277 |
) |
1876 | 278 |
(InputFieldSpec |
279 |
name: 'label' |
|
280 |
layout: (LayoutFrame 100 0 15 0 -5 1.0 37 0) |
|
281 |
activeHelpKey: label |
|
282 |
tabable: true |
|
283 |
model: label |
|
284 |
group: inputGroup |
|
285 |
immediateAccept: true |
|
286 |
acceptOnReturn: false |
|
287 |
acceptOnTab: false |
|
288 |
acceptOnLostFocus: false |
|
289 |
acceptChannel: acceptChannel |
|
290 |
modifiedChannel: modifiedChannel |
|
291 |
acceptOnPointerLeave: false |
|
1325 | 292 |
) |
1876 | 293 |
(LabelSpec |
294 |
label: 'Accelerator:' |
|
295 |
name: 'shortcutKeyLabel' |
|
296 |
layout: (AlignmentOrigin 98 0 55 0 1 0.5) |
|
297 |
translateLabel: true |
|
298 |
resizeForLabel: true |
|
1325 | 299 |
) |
1876 | 300 |
(InputFieldSpec |
301 |
name: 'shortcutKey' |
|
302 |
layout: (LayoutFrame 100 0 44 0 -5 1.0 66 0) |
|
303 |
activeHelpKey: detailsAccelerator |
|
304 |
tabable: true |
|
305 |
model: shortcutKey |
|
306 |
group: inputGroup |
|
307 |
type: symbolOrNil |
|
308 |
immediateAccept: true |
|
309 |
acceptOnReturn: false |
|
310 |
acceptOnTab: false |
|
311 |
acceptOnLostFocus: false |
|
312 |
acceptChannel: acceptChannel |
|
313 |
modifiedChannel: modifiedChannel |
|
314 |
acceptOnPointerLeave: false |
|
1325 | 315 |
) |
1876 | 316 |
(LabelSpec |
317 |
label: 'Argument:' |
|
318 |
name: 'editAgumentLabel' |
|
319 |
layout: (AlignmentOrigin 98 0 84 0 1 0.5) |
|
320 |
translateLabel: true |
|
321 |
resizeForLabel: true |
|
1325 | 322 |
) |
1876 | 323 |
(InputFieldSpec |
324 |
name: 'editAgument' |
|
325 |
layout: (LayoutFrame 100 0 73 0 -5 1.0 95 0) |
|
326 |
activeHelpKey: detailsArgument |
|
327 |
tabable: true |
|
328 |
model: editAgument |
|
329 |
group: inputGroup |
|
330 |
immediateAccept: true |
|
331 |
acceptOnReturn: false |
|
332 |
acceptOnTab: false |
|
333 |
acceptOnLostFocus: false |
|
334 |
acceptChannel: acceptChannel |
|
335 |
modifiedChannel: modifiedChannel |
|
336 |
acceptOnPointerLeave: false |
|
1325 | 337 |
) |
1876 | 338 |
(LabelSpec |
339 |
label: 'Access Character Position:' |
|
340 |
name: 'accessCharacterPositionLabel' |
|
341 |
layout: (AlignmentOrigin 275 0 113 0 1 0.5) |
|
342 |
translateLabel: true |
|
343 |
resizeForLabel: true |
|
1325 | 344 |
) |
1876 | 345 |
(InputFieldSpec |
346 |
name: 'accessCharacterPosition' |
|
347 |
layout: (LayoutFrame 278 0 103 0 -5 1.0 125 0) |
|
348 |
activeHelpKey: detailsAccessCharaterPosition |
|
349 |
tabable: true |
|
350 |
model: accessCharacterPosition |
|
351 |
group: inputGroup |
|
352 |
type: number |
|
353 |
immediateAccept: true |
|
354 |
acceptOnReturn: false |
|
355 |
acceptOnTab: false |
|
356 |
acceptOnLostFocus: false |
|
357 |
acceptChannel: acceptChannel |
|
358 |
modifiedChannel: modifiedChannel |
|
359 |
acceptOnPointerLeave: false |
|
1183 | 360 |
) |
1876 | 361 |
(CheckBoxSpec |
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
362 |
label: 'Translate Label ' |
1876 | 363 |
name: 'translateLabel' |
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
364 |
layout: (LayoutFrame 96 0 135 0 308 0 161 0) |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
365 |
activeHelpKey: translateLabel |
1876 | 366 |
tabable: true |
367 |
model: translateLabel |
|
368 |
translateLabel: true |
|
1183 | 369 |
) |
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
370 |
(CheckBoxSpec |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
371 |
label: 'Application Provides Label ' |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
372 |
name: 'CheckBox1' |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
373 |
layout: (LayoutFrame 96 0 161 0 308 0 187 0) |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
374 |
activeHelpKey: applicationProvidesLabel |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
375 |
tabable: true |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
376 |
model: applicationProvidesLabel |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
377 |
translateLabel: true |
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
378 |
) |
1876 | 379 |
(LabelSpec |
380 |
label: 'Help Key:' |
|
381 |
name: 'activeHelp' |
|
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
382 |
layout: (AlignmentOrigin 98 0 203 0 1 0.5) |
1876 | 383 |
translateLabel: true |
384 |
resizeForLabel: true |
|
1373 | 385 |
) |
1876 | 386 |
(InputFieldSpec |
387 |
name: 'activeHelpKey' |
|
2346
d6fdeda319de
confusion between applicationProvidesLabel and translateLabel fixed.
Claus Gittinger <cg@exept.de>
parents:
2281
diff
changeset
|
388 |
layout: (LayoutFrame 100 0 192 0 -5 1.0 214 0) |
1876 | 389 |
activeHelpKey: label |
390 |
tabable: true |
|
391 |
model: activeHelpKey |
|
392 |
group: inputGroup |
|
393 |
type: symbolOrNil |
|
394 |
immediateAccept: true |
|
395 |
acceptOnReturn: false |
|
396 |
acceptOnTab: false |
|
397 |
acceptOnLostFocus: false |
|
398 |
acceptChannel: acceptChannel |
|
399 |
modifiedChannel: modifiedChannel |
|
400 |
acceptOnPointerLeave: false |
|
1373 | 401 |
) |
402 |
) |
|
403 |
||
404 |
) |
|
405 |
) |
|
406 |
! |
|
407 |
||
408 |
canvasSpec |
|
409 |
"This resource specification was automatically generated |
|
410 |
by the UIPainter of ST/X." |
|
411 |
||
412 |
"Do not manually edit this!! If it is corrupted, |
|
413 |
the UIPainter may not be able to read the specification." |
|
414 |
||
415 |
" |
|
416 |
UIPainter new openOnClass:TabListEditor andSelector:#canvasSpec |
|
417 |
TabListEditor new openInterface:#canvasSpec |
|
418 |
" |
|
419 |
||
420 |
<resource: #canvas> |
|
421 |
||
422 |
^ |
|
3663 | 423 |
#(FullSpec |
424 |
name: canvasSpec |
|
425 |
uuid: '8a7c55d6-761b-11e9-98ea-b8f6b1108e05' |
|
426 |
window: |
|
427 |
(WindowSpec |
|
428 |
label: 'Canvas' |
|
429 |
name: 'Canvas' |
|
430 |
uuid: '8a7c5964-761b-11e9-98ea-b8f6b1108e05' |
|
431 |
min: (Point 10 10) |
|
432 |
max: (Point 1280 1024) |
|
433 |
bounds: (Rectangle 0 0 383 220) |
|
434 |
) |
|
435 |
component: |
|
436 |
(SpecCollection |
|
437 |
collection: ( |
|
438 |
(LabelSpec |
|
439 |
label: 'Class / Major Key:' |
|
440 |
name: 'majorKeyLabel' |
|
441 |
layout: (AlignmentOrigin 160 0 26 0 1 0.5) |
|
442 |
activeHelpKey: majorKey |
|
443 |
uuid: '8a7cc2f0-761b-11e9-98ea-b8f6b1108e05' |
|
444 |
translateLabel: true |
|
445 |
resizeForLabel: true |
|
446 |
) |
|
447 |
(InputFieldSpec |
|
448 |
name: 'majorKeyField' |
|
449 |
layout: (LayoutFrame 161 0 15 0 -5 1.0 37 0) |
|
450 |
activeHelpKey: majorKey |
|
451 |
uuid: '8a7cc82c-761b-11e9-98ea-b8f6b1108e05' |
|
452 |
tabable: true |
|
453 |
model: majorKey |
|
454 |
group: inputGroup |
|
455 |
type: symbolOrNil |
|
456 |
immediateAccept: true |
|
457 |
acceptOnReturn: false |
|
458 |
acceptOnTab: false |
|
459 |
acceptOnLostFocus: false |
|
460 |
modifiedChannel: modifiedChannel |
|
461 |
acceptOnPointerLeave: false |
|
462 |
) |
|
463 |
(LabelSpec |
|
464 |
label: 'Selector / Minor Key:' |
|
465 |
name: 'minorKeyLabel' |
|
466 |
layout: (AlignmentOrigin 160 0 55 0 1 0.5) |
|
467 |
uuid: '8a7ccda4-761b-11e9-98ea-b8f6b1108e05' |
|
468 |
translateLabel: true |
|
469 |
resizeForLabel: true |
|
470 |
) |
|
471 |
(InputFieldSpec |
|
472 |
name: 'minorKeyField' |
|
473 |
layout: (LayoutFrame 161 0 44 0 -5 1.0 66 0) |
|
474 |
activeHelpKey: majorKey |
|
475 |
uuid: '8a7ccf7a-761b-11e9-98ea-b8f6b1108e05' |
|
476 |
tabable: true |
|
477 |
model: minorKey |
|
478 |
group: inputGroup |
|
479 |
type: symbolOrNil |
|
480 |
immediateAccept: true |
|
481 |
acceptOnReturn: false |
|
482 |
acceptOnTab: false |
|
483 |
acceptOnLostFocus: false |
|
484 |
modifiedChannel: modifiedChannel |
|
485 |
acceptOnPointerLeave: false |
|
486 |
) |
|
487 |
(FramedBoxSpec |
|
488 |
label: 'Scroll Bars' |
|
489 |
name: 'FramedBox' |
|
490 |
layout: (LayoutFrame 0 0.0 119 0.0 0 1.0 218 0) |
|
491 |
uuid: '8a7cd1be-761b-11e9-98ea-b8f6b1108e05' |
|
492 |
labelPosition: topLeft |
|
493 |
translateLabel: true |
|
494 |
component: |
|
495 |
(SpecCollection |
|
496 |
collection: ( |
|
497 |
(HorizontalPanelViewSpec |
|
498 |
name: 'HorizontalPanel1' |
|
499 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
500 |
uuid: '8a7cd42a-761b-11e9-98ea-b8f6b1108e05' |
|
501 |
horizontalLayout: fitSpace |
|
502 |
verticalLayout: fitSpace |
|
503 |
horizontalSpace: 3 |
|
504 |
verticalSpace: 3 |
|
505 |
component: |
|
506 |
(SpecCollection |
|
507 |
collection: ( |
|
508 |
(ViewSpec |
|
509 |
name: 'Box1' |
|
510 |
uuid: '8a7cd768-761b-11e9-98ea-b8f6b1108e05' |
|
511 |
component: |
|
512 |
(SpecCollection |
|
513 |
collection: ( |
|
514 |
(CheckBoxSpec |
|
515 |
label: 'Vertical' |
|
516 |
name: 'verticalScrollBarCheckBox' |
|
517 |
layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0) |
|
518 |
activeHelpKey: verticalScroller |
|
519 |
uuid: '8a7cd8ee-761b-11e9-98ea-b8f6b1108e05' |
|
520 |
tabable: true |
|
521 |
model: hasVerticalScrollBar |
|
522 |
translateLabel: true |
|
1373 | 523 |
) |
3663 | 524 |
(CheckBoxSpec |
525 |
label: 'Mini' |
|
526 |
name: 'miniScrollerVerticalCheckBox' |
|
527 |
layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0) |
|
528 |
activeHelpKey: verticalMiniScroller |
|
529 |
uuid: '8a7cdb82-761b-11e9-98ea-b8f6b1108e05' |
|
530 |
tabable: true |
|
531 |
model: miniScrollerVertical |
|
532 |
translateLabel: true |
|
533 |
) |
|
534 |
) |
|
535 |
||
536 |
) |
|
537 |
useDefaultExtent: true |
|
538 |
) |
|
539 |
(ViewSpec |
|
540 |
name: 'Box2' |
|
541 |
uuid: '8a7cdda8-761b-11e9-98ea-b8f6b1108e05' |
|
542 |
component: |
|
543 |
(SpecCollection |
|
544 |
collection: ( |
|
545 |
(CheckBoxSpec |
|
546 |
label: 'Horizontal' |
|
547 |
name: 'horizontalScrollBarCheckBox' |
|
548 |
layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0) |
|
549 |
activeHelpKey: horizontalScroller |
|
550 |
uuid: '8a7cdede-761b-11e9-98ea-b8f6b1108e05' |
|
551 |
tabable: true |
|
552 |
model: hasHorizontalScrollBar |
|
553 |
translateLabel: true |
|
554 |
) |
|
555 |
(CheckBoxSpec |
|
556 |
label: 'Mini' |
|
557 |
name: 'miniScrollerHorizontalCheckBox' |
|
558 |
layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0) |
|
559 |
activeHelpKey: horizontalMiniScroller |
|
560 |
uuid: '8a7ce064-761b-11e9-98ea-b8f6b1108e05' |
|
561 |
tabable: true |
|
562 |
model: miniScrollerHorizontal |
|
563 |
translateLabel: true |
|
1373 | 564 |
) |
3663 | 565 |
) |
566 |
||
567 |
) |
|
568 |
extent: (Point 111 53) |
|
569 |
) |
|
570 |
(ViewSpec |
|
571 |
name: 'Box3' |
|
572 |
uuid: '8a7ce1fe-761b-11e9-98ea-b8f6b1108e05' |
|
573 |
component: |
|
574 |
(SpecCollection |
|
575 |
collection: ( |
|
576 |
(LabelSpec |
|
577 |
label: 'Auto Hide:' |
|
578 |
name: 'Label1' |
|
579 |
layout: (LayoutFrame 0 0.0 6 0 0 1.0 23 0) |
|
580 |
uuid: '8a7ce334-761b-11e9-98ea-b8f6b1108e05' |
|
581 |
translateLabel: true |
|
582 |
resizeForLabel: true |
|
583 |
adjust: left |
|
1373 | 584 |
) |
3663 | 585 |
(PopUpListSpec |
586 |
label: 'Default' |
|
587 |
name: 'PopUpList1' |
|
588 |
layout: (LayoutFrame 0 0.0 32 0 0 1.0 54 0) |
|
589 |
activeHelpKey: autoHideScrollBars |
|
590 |
uuid: '8a7ce4e2-761b-11e9-98ea-b8f6b1108e05' |
|
591 |
translateLabel: true |
|
592 |
tabable: true |
|
593 |
model: autoHideScrollBars |
|
594 |
menu: |
|
595 |
(ImmutableArray |
|
596 |
Default On |
|
597 |
Off |
|
598 |
) |
|
599 |
useIndex: true |
|
600 |
) |
|
601 |
) |
|
602 |
||
603 |
) |
|
604 |
extent: (Point 112 53) |
|
1373 | 605 |
) |
3663 | 606 |
) |
607 |
||
608 |
) |
|
1373 | 609 |
) |
3663 | 610 |
) |
611 |
||
612 |
) |
|
1373 | 613 |
) |
3663 | 614 |
(CheckBoxSpec |
615 |
label: 'Create New Builder' |
|
616 |
name: 'createNewBuilder' |
|
617 |
layout: (Point 161 75) |
|
618 |
activeHelpKey: createNewBuilder |
|
619 |
uuid: '8a7ce8de-761b-11e9-98ea-b8f6b1108e05' |
|
620 |
model: createNewBuilder |
|
621 |
translateLabel: true |
|
622 |
) |
|
623 |
) |
|
624 |
||
625 |
) |
|
626 |
) |
|
1373 | 627 |
! |
628 |
||
629 |
detailSpec |
|
630 |
"This resource specification was automatically generated |
|
631 |
by the UIPainter of ST/X." |
|
632 |
||
633 |
"Do not manually edit this!! If it is corrupted, |
|
634 |
the UIPainter may not be able to read the specification." |
|
635 |
||
636 |
" |
|
637 |
UIPainter new openOnClass:TabListEditor andSelector:#detailSpec |
|
638 |
TabListEditor new openInterface:#detailSpec |
|
639 |
" |
|
640 |
||
641 |
<resource: #canvas> |
|
642 |
||
643 |
^ |
|
1876 | 644 |
#(FullSpec |
645 |
name: detailSpec |
|
646 |
window: |
|
647 |
(WindowSpec |
|
648 |
label: 'Details' |
|
649 |
name: 'Details' |
|
650 |
min: (Point 10 10) |
|
651 |
max: (Point 1280 1024) |
|
652 |
bounds: (Rectangle 0 0 358 107) |
|
1373 | 653 |
) |
1876 | 654 |
component: |
655 |
(SpecCollection |
|
656 |
collection: ( |
|
657 |
(CheckBoxSpec |
|
658 |
label: 'Can Select' |
|
659 |
name: 'enabled' |
|
660 |
layout: (Point 46 14) |
|
661 |
activeHelpKey: canSelect |
|
662 |
tabable: true |
|
663 |
model: enabled |
|
664 |
translateLabel: true |
|
1183 | 665 |
) |
1876 | 666 |
(LabelSpec |
667 |
label: 'Color:' |
|
668 |
name: 'ForegroundLabel' |
|
669 |
layout: (AlignmentOrigin 46 0 62 0 1 0.5) |
|
670 |
translateLabel: true |
|
671 |
resizeForLabel: true |
|
672 |
adjust: right |
|
1183 | 673 |
) |
1876 | 674 |
(ColorMenuSpec |
675 |
name: 'ForegroundColorMenu' |
|
676 |
layout: (LayoutFrame 48 0 50 0 -10 1.0 72 0) |
|
677 |
activeHelpKey: color |
|
678 |
model: labelForegroundColor |
|
679 |
labelsAreColored: false |
|
1183 | 680 |
) |
681 |
) |
|
682 |
||
683 |
) |
|
739 | 684 |
) |
685 |
! |
|
686 |
||
687 |
windowSpec |
|
688 |
"This resource specification was automatically generated |
|
689 |
by the UIPainter of ST/X." |
|
690 |
||
691 |
"Do not manually edit this!! If it is corrupted, |
|
692 |
the UIPainter may not be able to read the specification." |
|
693 |
||
694 |
" |
|
695 |
UIPainter new openOnClass:TabListEditor andSelector:#windowSpec |
|
696 |
TabListEditor new openInterface:#windowSpec |
|
697 |
TabListEditor open |
|
698 |
" |
|
699 |
||
700 |
<resource: #canvas> |
|
701 |
||
1183 | 702 |
^ |
3663 | 703 |
#(FullSpec |
704 |
name: windowSpec |
|
705 |
uuid: 'b2e02714-761b-11e9-98ea-b8f6b1108e05' |
|
706 |
window: |
|
707 |
(WindowSpec |
|
708 |
label: 'Tab List Editor' |
|
709 |
name: 'Tab List Editor' |
|
710 |
uuid: 'b2e02a02-761b-11e9-98ea-b8f6b1108e05' |
|
711 |
min: (Point 440 280) |
|
712 |
bounds: (Rectangle 0 0 536 369) |
|
713 |
menu: menu |
|
714 |
) |
|
715 |
component: |
|
716 |
(SpecCollection |
|
717 |
collection: ( |
|
718 |
(MenuPanelSpec |
|
719 |
name: 'menuToolbarView' |
|
720 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 34 0) |
|
721 |
uuid: 'b2e02c78-761b-11e9-98ea-b8f6b1108e05' |
|
722 |
menu: menuToolbar |
|
723 |
) |
|
724 |
(VariableHorizontalPanelSpec |
|
725 |
name: 'VariablePanel' |
|
726 |
layout: (LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0) |
|
727 |
uuid: 'b2e02f48-761b-11e9-98ea-b8f6b1108e05' |
|
728 |
component: |
|
729 |
(SpecCollection |
|
730 |
collection: ( |
|
731 |
(SelectionInListModelViewSpec |
|
732 |
name: 'ListOfLabels' |
|
733 |
uuid: 'b2e031fa-761b-11e9-98ea-b8f6b1108e05' |
|
734 |
tabable: true |
|
735 |
model: selectionHolder |
|
736 |
menu: menuEdit |
|
737 |
hasHorizontalScrollBar: true |
|
738 |
hasVerticalScrollBar: true |
|
739 |
miniScrollerHorizontal: true |
|
740 |
listModel: listOfTabs |
|
741 |
highlightMode: line |
|
742 |
selectConditionSelector: askForItemModification |
|
743 |
) |
|
744 |
(ViewSpec |
|
745 |
name: 'SpecView' |
|
746 |
uuid: 'b2e034d4-761b-11e9-98ea-b8f6b1108e05' |
|
747 |
level: -1 |
|
748 |
component: |
|
749 |
(SpecCollection |
|
750 |
collection: ( |
|
751 |
(NoteBookViewSpec |
|
752 |
name: 'NoteBook' |
|
753 |
layout: (LayoutFrame 1 0.0 0 0.0 0 1.0 -32 1.0) |
|
754 |
uuid: 'b2e03600-761b-11e9-98ea-b8f6b1108e05' |
|
755 |
enableChannel: hasSelectionHolder |
|
756 |
tabable: true |
|
757 |
model: noteBookModel |
|
758 |
menu: noteBookTabList |
|
759 |
useIndex: true |
|
760 |
translateLabel: true |
|
761 |
keepCanvasAlive: true |
|
762 |
) |
|
763 |
(UISubSpecification |
|
764 |
name: 'subSpec' |
|
765 |
layout: (LayoutFrame 2 0.0 -32 1 -2 1.0 0 1) |
|
766 |
uuid: 'b2e039ac-761b-11e9-98ea-b8f6b1108e05' |
|
767 |
majorKey: ToolApplicationModel |
|
768 |
minorKey: windowSpecForCommit |
|
769 |
) |
|
770 |
(NoteBookViewSpec |
|
771 |
name: 'TestNoteBook' |
|
772 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
773 |
uuid: 'b2e03b32-761b-11e9-98ea-b8f6b1108e05' |
|
774 |
visibilityChannel: testMode |
|
775 |
tabable: true |
|
776 |
menu: testItemList |
|
777 |
useIndex: true |
|
778 |
translateLabel: true |
|
779 |
) |
|
1373 | 780 |
) |
3663 | 781 |
|
782 |
) |
|
1183 | 783 |
) |
3663 | 784 |
) |
785 |
||
786 |
) |
|
787 |
handles: (Any 0.23999999999999999 1.0) |
|
1183 | 788 |
) |
3663 | 789 |
(UISubSpecification |
790 |
name: 'infoBarSubSpec' |
|
791 |
layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
792 |
uuid: 'b2e03d44-761b-11e9-98ea-b8f6b1108e05' |
|
793 |
majorKey: ToolApplicationModel |
|
794 |
minorKey: windowSpecForInfoBar |
|
795 |
) |
|
796 |
) |
|
797 |
||
798 |
) |
|
799 |
) |
|
739 | 800 |
! ! |
801 |
||
1373 | 802 |
!TabListEditor class methodsFor:'list specs'! |
803 |
||
804 |
noteBookTabList |
|
805 |
"This resource specification was automatically generated |
|
806 |
by the TabListEditor of ST/X." |
|
807 |
||
808 |
"Do not manually edit this!! If it is corrupted, |
|
809 |
the TabListEditor may not be able to read the specification." |
|
810 |
||
811 |
" |
|
812 |
TabListEditor new openOnClass:TabListEditor andSelector:#noteBookTabList |
|
813 |
" |
|
814 |
||
815 |
<resource: #tabList> |
|
816 |
||
817 |
^ #( |
|
818 |
#(#TabItem |
|
819 |
#label: 'Basic' |
|
820 |
#activeHelpKey: #basicTab |
|
821 |
#minorKey: #basicSpec |
|
822 |
) |
|
823 |
#(#TabItem |
|
824 |
#label: 'Details' |
|
825 |
#activeHelpKey: #detailTab |
|
826 |
#minorKey: #detailSpec |
|
827 |
) |
|
828 |
#(#TabItem |
|
829 |
#label: 'Canvas' |
|
830 |
#activeHelpKey: #canvasTab |
|
831 |
#minorKey: #canvasSpec |
|
832 |
) |
|
833 |
) |
|
834 |
||
835 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
836 |
! ! |
|
837 |
||
739 | 838 |
!TabListEditor class methodsFor:'menu specs'! |
839 |
||
840 |
menu |
|
841 |
"This resource specification was automatically generated |
|
842 |
by the MenuEditor of ST/X." |
|
843 |
||
844 |
"Do not manually edit this!! If it is corrupted, |
|
845 |
the MenuEditor may not be able to read the specification." |
|
846 |
||
3663 | 847 |
|
739 | 848 |
" |
849 |
MenuEditor new openOnClass:TabListEditor andSelector:#menu |
|
850 |
(Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp |
|
851 |
" |
|
852 |
||
853 |
<resource: #menu> |
|
854 |
||
3663 | 855 |
^ |
856 |
#(Menu |
|
857 |
( |
|
858 |
(MenuItem |
|
859 |
activeHelpKey: file |
|
860 |
label: 'File' |
|
861 |
submenu: |
|
862 |
(Menu |
|
863 |
( |
|
864 |
(MenuItem |
|
865 |
activeHelpKey: fileNew |
|
866 |
label: 'New' |
|
867 |
itemValue: doNew |
|
868 |
) |
|
869 |
(MenuItem |
|
870 |
label: '-' |
|
871 |
) |
|
872 |
(MenuItem |
|
873 |
activeHelpKey: fileLoad |
|
874 |
label: 'Load...' |
|
875 |
itemValue: doLoad |
|
876 |
) |
|
877 |
(MenuItem |
|
878 |
label: '-' |
|
739 | 879 |
) |
3663 | 880 |
(MenuItem |
881 |
activeHelpKey: fileSave |
|
882 |
label: 'Save' |
|
883 |
itemValue: doSave |
|
884 |
) |
|
885 |
(MenuItem |
|
886 |
activeHelpKey: fileSave |
|
887 |
label: 'Save As...' |
|
888 |
itemValue: doSaveAs |
|
889 |
) |
|
890 |
(MenuItem |
|
891 |
label: '-' |
|
892 |
) |
|
893 |
(MenuItem |
|
894 |
activeHelpKey: fileBrowseClass |
|
895 |
label: 'Browse Class' |
|
896 |
itemValue: doBrowseClass |
|
897 |
) |
|
898 |
(MenuItem |
|
899 |
label: '-' |
|
900 |
) |
|
901 |
(MenuItem |
|
902 |
activeHelpKey: fileExit |
|
903 |
label: 'Exit' |
|
904 |
itemValue: closeRequest |
|
905 |
) |
|
906 |
) |
|
907 |
nil |
|
908 |
nil |
|
739 | 909 |
) |
3663 | 910 |
) |
911 |
(MenuItem |
|
912 |
activeHelpKey: edit |
|
913 |
label: 'Edit' |
|
914 |
submenuChannel: menuEdit |
|
915 |
) |
|
916 |
(MenuItem |
|
917 |
activeHelpKey: add |
|
918 |
label: 'Add' |
|
919 |
submenu: |
|
920 |
(Menu |
|
921 |
( |
|
922 |
(MenuItem |
|
923 |
activeHelpKey: addTabItem |
|
924 |
label: 'Tab Item' |
|
925 |
itemValue: doCreate |
|
926 |
labelImage: (ResourceRetriever nil newTabItemIcon 'Tab Item') |
|
739 | 927 |
) |
3663 | 928 |
) |
929 |
nil |
|
930 |
nil |
|
739 | 931 |
) |
3663 | 932 |
) |
933 |
(MenuItem |
|
934 |
activeHelpKey: add |
|
935 |
label: 'Generate' |
|
936 |
submenu: |
|
937 |
(Menu |
|
938 |
( |
|
939 |
(MenuItem |
|
940 |
activeHelpKey: fileCreateAspectMethod |
|
941 |
enabled: hasClassAndSelector |
|
942 |
label: 'Aspect Method' |
|
943 |
itemValue: doGenerateAspectMethod |
|
739 | 944 |
) |
3663 | 945 |
) |
946 |
nil |
|
947 |
nil |
|
739 | 948 |
) |
3663 | 949 |
) |
950 |
(MenuItem |
|
951 |
activeHelpKey: test |
|
952 |
label: 'Test' |
|
953 |
submenu: |
|
954 |
(Menu |
|
955 |
( |
|
956 |
(MenuItem |
|
957 |
activeHelpKey: testPreview |
|
958 |
enabled: canToggleTestMode |
|
959 |
label: 'Preview' |
|
960 |
indication: testMode |
|
739 | 961 |
) |
3663 | 962 |
) |
963 |
nil |
|
964 |
nil |
|
749 | 965 |
) |
3663 | 966 |
) |
967 |
(MenuItem |
|
968 |
activeHelpKey: history |
|
969 |
label: 'History' |
|
970 |
submenuChannel: menuHistory |
|
971 |
) |
|
972 |
(MenuItem |
|
973 |
activeHelpKey: help |
|
974 |
label: 'MENU_Help' |
|
975 |
startGroup: conditionalRight |
|
976 |
submenuChannel: menuHelp |
|
977 |
) |
|
978 |
) |
|
979 |
nil |
|
980 |
nil |
|
739 | 981 |
) |
982 |
! |
|
983 |
||
984 |
menuEdit |
|
985 |
"This resource specification was automatically generated |
|
986 |
by the MenuEditor of ST/X." |
|
987 |
||
988 |
"Do not manually edit this!! If it is corrupted, |
|
989 |
the MenuEditor may not be able to read the specification." |
|
990 |
||
991 |
" |
|
992 |
MenuEditor new openOnClass:TabListEditor andSelector:#menuEdit |
|
993 |
(Menu new fromLiteralArrayEncoding:(TabListEditor menuEdit)) startUp |
|
994 |
" |
|
995 |
||
996 |
<resource: #menu> |
|
997 |
||
1374 | 998 |
^ |
999 |
#(#Menu |
|
1000 |
#( |
|
1001 |
#(#MenuItem |
|
1002 |
#label: 'Cut' |
|
1003 |
#value: #doCut |
|
1004 |
#activeHelpKey: #editCut |
|
1005 |
#enabled: #hasSelectionHolder |
|
1006 |
) |
|
1007 |
#(#MenuItem |
|
1008 |
#label: 'Copy' |
|
1009 |
#value: #doCopy |
|
1010 |
#activeHelpKey: #editCopy |
|
1011 |
#enabled: #hasSelectionHolder |
|
1012 |
) |
|
1013 |
#(#MenuItem |
|
1014 |
#label: 'Paste' |
|
1015 |
#value: #doPaste |
|
1016 |
#activeHelpKey: #editPaste |
|
2383
e76cc686a293
rename #valueOfCanbPate to #canPasteHolder
Stefan Vogel <sv@exept.de>
parents:
2346
diff
changeset
|
1017 |
#enabled: #canPasteHolder |
1374 | 1018 |
) |
1019 |
#(#MenuItem |
|
1020 |
#label: 'Delete' |
|
1021 |
#value: #doDelete |
|
1022 |
#activeHelpKey: #editPaste |
|
1023 |
#enabled: #hasSelectionHolder |
|
1024 |
) |
|
1025 |
#(#MenuItem |
|
1026 |
#label: '-' |
|
1027 |
) |
|
1028 |
#(#MenuItem |
|
1029 |
#label: 'Move Up' |
|
1030 |
#value: #doMoveTabUpOrDown: |
|
1031 |
#activeHelpKey: #editMoveUp |
|
1032 |
#enabled: #canMoveTabItemUpOrDown |
|
1033 |
#argument: #up |
|
1034 |
#labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up') |
|
1035 |
) |
|
1036 |
#(#MenuItem |
|
1037 |
#label: 'Move Down' |
|
1038 |
#value: #doMoveTabUpOrDown: |
|
1039 |
#activeHelpKey: #editMoveDown |
|
1040 |
#enabled: #canMoveTabItemUpOrDown |
|
1041 |
#argument: #down |
|
1042 |
#labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down') |
|
1043 |
) |
|
1044 |
#(#MenuItem |
|
1045 |
#label: '-' |
|
1046 |
#isVisible: #hiddenAccelerator |
|
1047 |
) |
|
1048 |
#(#MenuItem |
|
1049 |
#label: 'Accept' |
|
1050 |
#translateLabel: true |
|
1051 |
#isVisible: #hiddenAccelerator |
|
1052 |
#value: #accept |
|
2432 | 1053 |
#enabled: #enablingCommitButtonsHolder |
1374 | 1054 |
) |
1055 |
) |
|
1056 |
nil |
|
1057 |
nil |
|
739 | 1058 |
) |
1059 |
! |
|
1060 |
||
1061 |
menuToolbar |
|
1062 |
"This resource specification was automatically generated |
|
1063 |
by the MenuEditor of ST/X." |
|
1064 |
||
1065 |
"Do not manually edit this!! If it is corrupted, |
|
1066 |
the MenuEditor may not be able to read the specification." |
|
1067 |
||
1068 |
" |
|
1069 |
MenuEditor new openOnClass:TabListEditor andSelector:#menuToolbar |
|
1070 |
(Menu new fromLiteralArrayEncoding:(TabListEditor menuToolbar)) startUp |
|
1071 |
" |
|
1072 |
||
1073 |
<resource: #menu> |
|
1074 |
||
1373 | 1075 |
^ |
1909 | 1076 |
#(Menu |
1077 |
( |
|
1078 |
(MenuItem |
|
1079 |
activeHelpKey: fileNew |
|
1080 |
label: 'New' |
|
1081 |
itemValue: doNew |
|
1082 |
translateLabel: true |
|
1083 |
isButton: true |
|
1084 |
labelImage: (ResourceRetriever ToolbarIconLibrary new22x22Icon) |
|
1373 | 1085 |
) |
1909 | 1086 |
(MenuItem |
1087 |
activeHelpKey: fileLoad |
|
1088 |
label: 'Load' |
|
1089 |
itemValue: doLoad |
|
1090 |
translateLabel: true |
|
1091 |
isButton: true |
|
1092 |
labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon) |
|
1373 | 1093 |
) |
1909 | 1094 |
(MenuItem |
1095 |
activeHelpKey: fileSave |
|
1096 |
label: 'Save' |
|
1097 |
itemValue: doSave |
|
1098 |
translateLabel: true |
|
1099 |
isButton: true |
|
1100 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon) |
|
1373 | 1101 |
) |
1909 | 1102 |
(MenuItem |
1103 |
label: '-' |
|
1373 | 1104 |
) |
1909 | 1105 |
(MenuItem |
1106 |
activeHelpKey: editCut |
|
1107 |
enabled: hasSelectionHolder |
|
1108 |
label: 'Cut' |
|
1109 |
itemValue: doCut |
|
1110 |
translateLabel: true |
|
1111 |
isButton: true |
|
1112 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon) |
|
1373 | 1113 |
) |
1909 | 1114 |
(MenuItem |
1115 |
activeHelpKey: editCopy |
|
1116 |
enabled: hasSelectionHolder |
|
1117 |
label: 'Copy' |
|
1118 |
itemValue: doCopy |
|
1119 |
translateLabel: true |
|
1120 |
isButton: true |
|
1121 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon) |
|
1373 | 1122 |
) |
1909 | 1123 |
(MenuItem |
1124 |
activeHelpKey: editPaste |
|
2383
e76cc686a293
rename #valueOfCanbPate to #canPasteHolder
Stefan Vogel <sv@exept.de>
parents:
2346
diff
changeset
|
1125 |
enabled: canPasteHolder |
1909 | 1126 |
label: 'Paste' |
1127 |
itemValue: doPaste |
|
1128 |
translateLabel: true |
|
1129 |
isButton: true |
|
1130 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon) |
|
1373 | 1131 |
) |
1909 | 1132 |
(MenuItem |
1133 |
activeHelpKey: editDelete |
|
1134 |
enabled: hasSelectionHolder |
|
1135 |
label: 'Delete' |
|
1136 |
itemValue: doDelete |
|
1137 |
translateLabel: true |
|
1138 |
isButton: true |
|
1139 |
isVisible: false |
|
1140 |
labelImage: (ResourceRetriever ToolbarIconLibrary delete22x22Icon) |
|
1373 | 1141 |
) |
1909 | 1142 |
(MenuItem |
1143 |
label: '-' |
|
1373 | 1144 |
) |
1909 | 1145 |
(MenuItem |
1146 |
activeHelpKey: addTabItem |
|
1147 |
label: 'Add Tab Item' |
|
1148 |
itemValue: doCreate |
|
1149 |
translateLabel: true |
|
1150 |
isButton: true |
|
1151 |
labelImage: (ResourceRetriever nil newTabItemIcon) |
|
1373 | 1152 |
) |
1909 | 1153 |
(MenuItem |
1154 |
label: '' |
|
1373 | 1155 |
) |
1909 | 1156 |
(MenuItem |
1157 |
activeHelpKey: editMoveUp |
|
1158 |
enabled: canMoveTabItemUpOrDown |
|
1159 |
label: 'Move Tab Up' |
|
1160 |
itemValue: doMoveTabUpOrDown: |
|
1161 |
translateLabel: true |
|
1162 |
isButton: true |
|
1163 |
startGroup: right |
|
3835 | 1164 |
labelImage: (ResourceRetriever ToolbarIconLibrary up22x22Icon) |
1909 | 1165 |
argument: up |
1373 | 1166 |
) |
1909 | 1167 |
(MenuItem |
1168 |
activeHelpKey: editMoveDown |
|
1169 |
enabled: canMoveTabItemUpOrDown |
|
1170 |
label: 'Move Tab Down' |
|
1171 |
itemValue: doMoveTabUpOrDown: |
|
1172 |
translateLabel: true |
|
1173 |
isButton: true |
|
1174 |
startGroup: right |
|
3835 | 1175 |
labelImage: (ResourceRetriever ToolbarIconLibrary down22x22Icon) |
1909 | 1176 |
argument: down |
1373 | 1177 |
) |
1178 |
) |
|
1179 |
nil |
|
1180 |
nil |
|
739 | 1181 |
) |
1182 |
! ! |
|
1183 |
||
1184 |
!TabListEditor methodsFor:'aspects'! |
|
1185 |
||
1373 | 1186 |
autoHideScrollBars |
1187 |
|holder| |
|
1188 |
||
1189 |
(holder := builder bindingAt:#autoHideScrollBars) isNil ifTrue:[ |
|
1190 |
builder aspectAt:#autoHideScrollBars put:(holder := 1 asValue). |
|
1191 |
holder addDependent: self |
|
1192 |
]. |
|
1193 |
^ holder. |
|
1194 |
! |
|
1195 |
||
739 | 1196 |
canMoveTabItemUpOrDown |
1373 | 1197 |
^ builder booleanValueAspectFor:#canMoveTabItemUpOrDown |
1198 |
! |
|
1199 |
||
1374 | 1200 |
hasSelectionHolder |
1201 |
^ builder booleanValueAspectFor:#hasSelectionHolder |
|
1202 |
! |
|
1203 |
||
1204 |
hiddenAccelerator |
|
1205 |
"used to set menu entries with an accelerator not visible to the operator |
|
1206 |
" |
|
1207 |
^ false |
|
1208 |
! |
|
1209 |
||
1326 | 1210 |
inputGroup |
1211 |
||
1212 |
|holder| |
|
1213 |
||
1214 |
(holder := builder bindingAt:#inputGroup) isNil ifTrue:[ |
|
1215 |
builder aspectAt:#inputGroup put:(holder := EnterFieldGroup new) |
|
1216 |
]. |
|
1217 |
^ holder. |
|
1218 |
||
1219 |
||
1220 |
! |
|
1221 |
||
1373 | 1222 |
listOfTabs |
1223 |
^ listOfTabs |
|
1224 |
! |
|
1225 |
||
1226 |
noteBookModel |
|
1227 |
|holder| |
|
1228 |
||
1229 |
(holder := builder bindingAt:#noteBookModel) isNil ifTrue:[ |
|
1230 |
holder := 0 asValue. |
|
1231 |
builder aspectAt:#noteBookModel put:holder. |
|
1232 |
]. |
|
1233 |
^ holder. |
|
1234 |
! |
|
1235 |
||
1236 |
noteBookTabList |
|
1237 |
"Generated by the TabListEditor" |
|
1238 |
||
1239 |
|list| |
|
1240 |
||
1241 |
(list := builder bindingAt:#noteBookTabList) isNil ifTrue:[ |
|
1242 |
builder aspectAt:#noteBookTabList put:(list := self class noteBookTabList). |
|
1243 |
]. |
|
1244 |
^ list |
|
739 | 1245 |
! |
1246 |
||
1247 |
selectionHolder |
|
1248 |
"holder which keeps the current selection |
|
1249 |
" |
|
1250 |
|holder| |
|
1251 |
||
1252 |
(holder := builder bindingAt:#selectionHolder) isNil ifTrue:[ |
|
1373 | 1253 |
holder := 0 asValue. |
739 | 1254 |
builder aspectAt:#selectionHolder put:holder. |
1373 | 1255 |
holder addDependent:self. |
739 | 1256 |
]. |
1257 |
^ holder |
|
1258 |
! |
|
1259 |
||
1373 | 1260 |
testItemList |
739 | 1261 |
|holder| |
1262 |
||
1373 | 1263 |
(holder := builder bindingAt:#testItemList) isNil ifTrue:[ |
1264 |
holder := ValueHolder new. |
|
1265 |
builder aspectAt:#testItemList put:holder. |
|
739 | 1266 |
]. |
1373 | 1267 |
^ holder. |
739 | 1268 |
! |
1269 |
||
1270 |
testMode |
|
1271 |
||
1272 |
|holder| |
|
1273 |
||
1274 |
(holder := builder bindingAt:#testMode) isNil ifTrue:[ |
|
1275 |
builder aspectAt:#testMode put:(holder := false asValue). |
|
1276 |
holder addDependent: self |
|
1277 |
]. |
|
1278 |
^ holder |
|
1279 |
||
1280 |
! ! |
|
1281 |
||
1282 |
!TabListEditor methodsFor:'building'! |
|
1283 |
||
1373 | 1284 |
buildFromResourceSpec:aListSpec |
1285 |
self buildFromTabList:aListSpec |
|
739 | 1286 |
! |
1287 |
||
1288 |
buildFromTabList: aTabList |
|
1289 |
"build from a aTabList" |
|
1290 |
||
1373 | 1291 |
self selection:0. |
739 | 1292 |
listOfTabs removeAll. |
1293 |
||
2819 | 1294 |
aTabList do:[:aTabItem| |
1295 |
self assert:(aTabItem isKindOf:TabItem). |
|
1296 |
listOfTabs add: aTabItem |
|
1297 |
]. |
|
1972 | 1298 |
self clearModified. |
1374 | 1299 |
listOfTabs notEmpty ifTrue:[ self selection:1 ]. |
2819 | 1300 |
|
1301 |
"Modified: / 08-11-2010 / 13:57:27 / cg" |
|
1972 | 1302 |
! |
739 | 1303 |
|
1972 | 1304 |
loadFromClass:aClass andSelector:aSelector |
1305 |
"build from class and selector" |
|
1306 |
||
1307 |
|cls spec| |
|
1308 |
||
1309 |
self assert:(aClass isNil or:[aClass isClass]). |
|
1310 |
||
1311 |
self testMode value: false. |
|
1312 |
self selection:0. |
|
1313 |
||
1314 |
"if opened on a tab list" |
|
1315 |
(aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) ifFalse:[ |
|
1316 |
listOfTabs removeAll. |
|
1317 |
||
1318 |
cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass]. |
|
1319 |
specSelector := aSelector. |
|
1320 |
||
1321 |
cls notNil ifTrue:[ |
|
1322 |
specSelector notNil ifTrue:[ |
|
1323 |
||
1324 |
(cls respondsTo: aSelector) ifTrue:[ |
|
1325 |
spec := cls perform: aSelector. |
|
1326 |
]. |
|
1327 |
spec size ~~ 0 ifTrue:[ |
|
2819 | 1328 |
spec do:[:aTabOrArray| |
1329 |
|tab| |
|
1330 |
||
1331 |
aTabOrArray isArray ifTrue:[ |
|
1332 |
tab := aTabOrArray decodeAsLiteralArray |
|
1333 |
] ifFalse:[ |
|
1334 |
tab := aTabOrArray. |
|
1335 |
]. |
|
1336 |
self assert:(tab isKindOf:TabItem). |
|
1337 |
listOfTabs add:tab. |
|
1972 | 1338 |
]. |
1339 |
self addHistoryEntryForClass:cls selector:specSelector. |
|
1340 |
] |
|
1341 |
] |
|
1342 |
]. |
|
1343 |
||
1344 |
self clearModified. |
|
1345 |
]. |
|
1346 |
listOfTabs notEmpty ifTrue:[ self selection:1 ]. |
|
2819 | 1347 |
|
1348 |
"Modified: / 08-11-2010 / 13:59:09 / cg" |
|
739 | 1349 |
! ! |
1350 |
||
1351 |
!TabListEditor methodsFor:'change & update'! |
|
1352 |
||
1353 |
update:something with:aParameter from:someObject |
|
1354 |
"one of my aspects has changed; update modified channel |
|
1355 |
" |
|
1374 | 1356 |
|list| |
1373 | 1357 |
|
1358 |
someObject = self selectionHolder ifTrue:[ |
|
1359 |
^ self selectionChanged |
|
1360 |
]. |
|
1361 |
||
1362 |
someObject = self testMode ifFalse:[ |
|
1363 |
^ super update:something with:aParameter from:someObject. |
|
1364 |
]. |
|
1365 |
||
1366 |
someObject value ifTrue:[ |
|
1375 | 1367 |
self noteBookModel value:0. |
1368 |
||
1374 | 1369 |
listOfTabs notEmpty ifTrue:[ |
1373 | 1370 |
list := listOfTabs collect:[:aTab| |tab| |
1371 |
tab := aTab copy. |
|
1372 |
tab setAttributesFromClass:specClass. |
|
1373 |
tab |
|
1374 | 1374 |
] |
1375 |
]. |
|
1376 |
self selection:0. |
|
1373 | 1377 |
]. |
1378 |
self testItemList value:list. |
|
1379 |
self updateInfoLabel. |
|
739 | 1380 |
|
1381 |
! ! |
|
1382 |
||
1373 | 1383 |
!TabListEditor methodsFor:'queries'! |
739 | 1384 |
|
1373 | 1385 |
canToggleTestMode |
2281 | 1386 |
"checks whether testMode button is enabled" |
1387 |
||
1373 | 1388 |
self testMode value ifTrue:[ |
1389 |
^ true |
|
1390 |
]. |
|
1391 |
||
2281 | 1392 |
self enablingCommitButtonsHolder value ifFalse:[ |
1373 | 1393 |
^ listOfTabs notEmpty |
1394 |
]. |
|
1395 |
^ false |
|
739 | 1396 |
! ! |
1397 |
||
1398 |
!TabListEditor methodsFor:'selection'! |
|
1399 |
||
1373 | 1400 |
selectedElement |
1401 |
|idx tab| |
|
1402 |
||
1403 |
idx := self selection. |
|
1404 |
||
1405 |
idx ~~ 0 ifTrue:[ |
|
1406 |
(tab := listOfTabs at:idx ifAbsent:nil) notNil ifTrue:[ |
|
1407 |
^ tab |
|
1408 |
]. |
|
1409 |
self selection:0 |
|
1410 |
]. |
|
1411 |
^ nil |
|
1412 |
! |
|
1413 |
||
1414 |
selection |
|
1415 |
^ self selectionHolder value ? 0 |
|
739 | 1416 |
! |
1417 |
||
1373 | 1418 |
selection:anIndex |
1419 |
self selectionHolder value:(anIndex ? 0). |
|
1420 |
! |
|
739 | 1421 |
|
1373 | 1422 |
selectionChanged |
1423 |
|noteBookModel hasSelection| |
|
739 | 1424 |
|
1373 | 1425 |
hasSelection := self selection ~~ 0. |
1426 |
noteBookModel := self noteBookModel. |
|
1145 | 1427 |
|
1373 | 1428 |
hasSelection ifTrue:[ |
1429 |
self testMode value:false. |
|
1430 |
noteBookModel value == 0 ifTrue:[noteBookModel value:1] |
|
739 | 1431 |
] ifFalse:[ |
1373 | 1432 |
noteBookModel value:0 |
739 | 1433 |
]. |
1434 |
self cancel. |
|
1374 | 1435 |
self hasSelectionHolder value:hasSelection. |
2281 | 1436 |
self canPasteHolder. |
1373 | 1437 |
! |
739 | 1438 |
|
1373 | 1439 |
setSelection:anIndex |
1374 | 1440 |
|index| |
1441 |
||
1442 |
index := anIndex ? 0. |
|
1443 |
self selectionHolder value:index withoutNotifying:self |
|
739 | 1444 |
! ! |
1445 |
||
3036 | 1446 |
!TabListEditor methodsFor:'startup & release'! |
739 | 1447 |
|
1448 |
initialize |
|
1449 |
"setup aspects used by column description specifications |
|
1450 |
" |
|
1451 |
super initialize. |
|
1373 | 1452 |
listOfTabs := List new. |
739 | 1453 |
! |
1454 |
||
1455 |
openModalOnTabList: aTabList |
|
1456 |
"build a tab list from aTabList and open it modal" |
|
1457 |
||
1458 |
super openModalOnResourceSpec: aTabList |
|
1459 |
||
1460 |
! ! |
|
1461 |
||
1462 |
!TabListEditor methodsFor:'user actions'! |
|
1463 |
||
1464 |
accept |
|
1465 |
"accept changes |
|
1466 |
" |
|
3093 | 1467 |
|tab asb| |
1066
5096f66ba82d
new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
1468 |
|
1373 | 1469 |
(tab := self selectedElement) notNil ifTrue:[ |
1470 |
super accept. |
|
3093 | 1471 |
aspects keysAndValuesDo:[:k :m| tab perform:k asMutator with:(m value) ]. |
739 | 1472 |
|
1373 | 1473 |
asb := self autoHideScrollBars value. |
1474 |
asb := asb ~~ 1 ifTrue:[asb == 2] ifFalse:[nil]. |
|
1475 |
tab autoHideScrollBars:asb. |
|
739 | 1476 |
]. |
1477 |
self cancel. |
|
1373 | 1478 |
! |
1479 |
||
1480 |
addTab:aTab |
|
1481 |
|idx| |
|
1482 |
||
1483 |
aTab notNil ifTrue:[ |
|
2819 | 1484 |
self assert:(aTab isKindOf:TabItem). |
1373 | 1485 |
self testMode value: false. |
1486 |
||
1487 |
(idx := self selection) == 0 ifTrue:[ |
|
1488 |
listOfTabs add:aTab. |
|
1489 |
self selection:(listOfTabs size). |
|
1490 |
] ifFalse:[ |
|
1491 |
listOfTabs add:aTab afterIndex:idx |
|
1492 |
]. |
|
1972 | 1493 |
self setModified. |
1373 | 1494 |
]. |
2819 | 1495 |
|
1496 |
"Modified: / 08-11-2010 / 13:55:27 / cg" |
|
739 | 1497 |
! |
1498 |
||
1499 |
cancel |
|
2281 | 1500 |
"cancel all changes" |
1501 |
||
1373 | 1502 |
|tab idx asb| |
739 | 1503 |
|
1373 | 1504 |
( (idx := self selection) ~~ 0 |
1505 |
and:[(tab := self selectedElement) notNil] |
|
1506 |
) ifTrue:[ |
|
1507 |
aspects keysAndValuesDo:[:k :m| m value:(tab perform:k) ]. |
|
1508 |
listOfTabs at:idx put:tab. |
|
739 | 1509 |
|
1373 | 1510 |
asb := tab autoHideScrollBars. |
1511 |
asb notNil ifTrue:[asb := asb == true ifTrue:[2] ifFalse:[3]] |
|
1512 |
ifFalse:[asb := 1]. |
|
739 | 1513 |
|
1373 | 1514 |
self autoHideScrollBars value:asb. |
739 | 1515 |
]. |
1373 | 1516 |
self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]). |
2281 | 1517 |
self enablingCommitButtonsHolder value: false |
739 | 1518 |
! |
1519 |
||
1520 |
doCopy |
|
1521 |
"copy selected tab |
|
1522 |
" |
|
1373 | 1523 |
|tab| |
1524 |
||
1525 |
(tab := self selectedElement) notNil ifTrue:[ |
|
1526 |
self clipboard:tab. |
|
749 | 1527 |
self updateAllToolInstances. |
739 | 1528 |
] |
1529 |
! |
|
1530 |
||
1373 | 1531 |
doCreate |
1532 |
self addTab:(TabItem label:'TAB'). |
|
739 | 1533 |
! |
1534 |
||
1535 |
doCut |
|
1373 | 1536 |
"cut the selected tab; put to pasteBuffer |
739 | 1537 |
" |
1373 | 1538 |
|tab| |
739 | 1539 |
|
1373 | 1540 |
(tab := self selectedElement) notNil ifTrue:[ |
1541 |
self clipboard:tab. |
|
1542 |
self doDelete. |
|
739 | 1543 |
]. |
1544 |
||
1545 |
! |
|
1546 |
||
1547 |
doDelete |
|
1548 |
"delete selected tab |
|
1549 |
" |
|
1374 | 1550 |
|index size| |
739 | 1551 |
|
1373 | 1552 |
(index := self selection) ~~ 0 ifTrue:[ |
739 | 1553 |
self testMode value: false. |
1374 | 1554 |
|
1555 |
(size := listOfTabs size) == 1 ifTrue:[ |
|
1556 |
self selection:0 |
|
1557 |
] ifFalse:[ |
|
1558 |
self setSelection:0 |
|
1559 |
]. |
|
739 | 1560 |
listOfTabs removeIndex:index. |
1374 | 1561 |
index < size ifFalse:[ |
1562 |
index := index - 1 |
|
1563 |
]. |
|
1373 | 1564 |
self selection:index. |
1565 |
self updateAllToolInstances. |
|
1972 | 1566 |
self setModified. |
739 | 1567 |
]. |
1568 |
! |
|
1569 |
||
1570 |
doGenerateAspectMethod |
|
1571 |
"generate aspect method |
|
1572 |
" |
|
1573 |
|cls code| |
|
1574 |
||
3381 | 1575 |
(specClass notNil and:[specSelector notNil]) ifFalse:[ |
1576 |
^ self information:'No class and selector defined!!' |
|
739 | 1577 |
]. |
1578 |
||
1579 |
cls := self resolveName: specClass. |
|
1580 |
||
1581 |
(cls canUnderstand:specSelector) ifTrue:[ |
|
1582 |
"/ method already exists, do not overwrite the method automaticaly |
|
1583 |
||
1584 |
( YesNoBox title:'method ' |
|
1585 |
, (Text string:('#', specSelector) emphasis:#bold) |
|
1586 |
, ' already exists!!' |
|
1587 |
yesText:'overwrite' |
|
1588 |
noText:'cancel' |
|
1589 |
) confirm ifFalse:[ |
|
1590 |
^ self |
|
1591 |
] |
|
1592 |
]. |
|
1593 |
||
1594 |
code := '!!' , cls name , ' methodsFor:''aspects''!!\\' , |
|
1595 |
specSelector , '\' , |
|
1596 |
' "Generated by the TabListEditor"\' , |
|
1597 |
'\' , |
|
1598 |
' |list|\' , |
|
1599 |
'\' , |
|
1600 |
' (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' , |
|
1601 |
' builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' , |
|
1602 |
' ].\' , |
|
1603 |
' ^ list\' , |
|
1604 |
'!! !!\\'. |
|
1605 |
||
3074 | 1606 |
Class packageQuerySignal answer:cls package do:[ |
1607 |
(ReadStream on:(code withCRs)) fileIn |
|
1608 |
] |
|
739 | 1609 |
|
3074 | 1610 |
"Modified: / 28-01-2014 / 21:57:09 / cg" |
739 | 1611 |
! |
1612 |
||
1613 |
doMoveTabUpOrDown:what |
|
1614 |
"step up or down |
|
1615 |
" |
|
1373 | 1616 |
|tab idx sz| |
739 | 1617 |
|
1373 | 1618 |
(listOfTabs size > 1 and:[(idx := self selection) ~~ 0]) ifFalse:[ |
739 | 1619 |
^ self |
1620 |
]. |
|
1621 |
||
1373 | 1622 |
(tab := listOfTabs at:idx ifAbsent:nil) isNil ifTrue:[ |
1623 |
^ self selection:0 |
|
1624 |
]. |
|
739 | 1625 |
|
1373 | 1626 |
self setSelection:0. |
1627 |
listOfTabs removeIndex:idx. |
|
739 | 1628 |
|
1373 | 1629 |
sz := listOfTabs size. |
1145 | 1630 |
|
739 | 1631 |
what == #down ifTrue:[ |
1373 | 1632 |
idx := idx > sz ifTrue:[1] ifFalse:[idx + 1] |
739 | 1633 |
] ifFalse:[ |
1373 | 1634 |
idx := idx == 1 ifTrue:[sz + 1] ifFalse:[idx - 1] |
739 | 1635 |
]. |
1636 |
||
1373 | 1637 |
listOfTabs add:tab beforeIndex:idx. |
1638 |
self setSelection:idx. |
|
1972 | 1639 |
self setModified. |
739 | 1640 |
! |
1641 |
||
1642 |
doPaste |
|
1643 |
"paste a tab |
|
1644 |
" |
|
1373 | 1645 |
|tab| |
1145 | 1646 |
|
1373 | 1647 |
((tab := self class clipboard) notNil and:[tab isKindOf:TabItem]) ifTrue:[ |
1648 |
self addTab:(tab deepCopy). |
|
1649 |
] |
|
739 | 1650 |
! |
1651 |
||
1652 |
doSave |
|
1972 | 1653 |
"generate code for class and instance" |
1654 |
||
3056 | 1655 |
|cls code spec category package mthd list| |
739 | 1656 |
|
3330 | 1657 |
(specClass notNil and:[specSelector notNil]) ifFalse:[ |
1658 |
^ self doSaveAs |
|
739 | 1659 |
]. |
1660 |
||
1661 |
cls := self resolveName: specClass. |
|
1662 |
||
1663 |
listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!']. |
|
1664 |
||
3330 | 1665 |
spec := WriteStream on:''. |
1245 | 1666 |
list := Array new:(listOfTabs size). |
1667 |
listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)]. |
|
1668 |
||
1669 |
UISpecification prettyPrintSpecArray:list on:spec indent:5. |
|
739 | 1670 |
spec := spec contents. |
1671 |
||
1672 |
"/ if that method already exists, do not overwrite the category |
|
1673 |
||
1674 |
category := 'list specs'. |
|
1675 |
||
1676 |
(mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ |
|
1677 |
category := mthd category. |
|
3056 | 1678 |
package := mthd package. |
739 | 1679 |
]. |
1680 |
||
1681 |
code := Character excla asString |
|
1682 |
, cls name , ' class methodsFor:' , category storeString |
|
1683 |
, Character excla asString , '\\' |
|
1684 |
||
1685 |
, specSelector , '\' |
|
1686 |
, (self class codeGenerationComment replChar:$!! withString:'!!!!') |
|
1687 |
, '\\ "\' |
|
1855 | 1688 |
, ' TabListEditor new openOnClass: self andSelector:#' , specSelector , '\' |
739 | 1689 |
, ' "\'. |
1690 |
||
1691 |
code := code |
|
1692 |
, '\' |
|
1693 |
, ' <resource: #tabList>\\' |
|
1694 |
, ' ^' |
|
1695 |
, ' ', spec, '\' |
|
3590 | 1696 |
, ' collect:#decodeAsLiteralArray "[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]"' |
739 | 1697 |
, '\' |
1698 |
, Character excla asString |
|
1699 |
, ' ' |
|
1700 |
, Character excla asString |
|
1701 |
, '\'. |
|
1702 |
||
1703 |
code := code withCRs. |
|
3056 | 1704 |
Class packageQuerySignal |
1705 |
answer:package |
|
1706 |
do:[ |
|
3074 | 1707 |
Class packageQuerySignal answer:cls package do:[ |
1708 |
(ReadStream on:code) fileIn. |
|
1709 |
]. |
|
3056 | 1710 |
(cls canUnderstand:specSelector) ifFalse:[ |
3584 | 1711 |
(YesNoBox confirm:(resources string:'Generate aspect method (on instance side) to hold the tabList (#%1)?' with:specSelector)) ifTrue:[ |
3056 | 1712 |
self doGenerateAspectMethod |
1713 |
] |
|
1714 |
]. |
|
1715 |
]. |
|
739 | 1716 |
|
1972 | 1717 |
self addHistoryEntryForClass:cls selector:specSelector. |
1718 |
self clearModified. |
|
739 | 1719 |
hasSaved := true. |
3074 | 1720 |
|
1721 |
"Modified: / 28-01-2014 / 21:56:54 / cg" |
|
3590 | 1722 |
"Modified: / 11-08-2018 / 18:52:00 / Claus Gittinger" |
1856 | 1723 |
! |
1724 |
||
1725 |
openDocumentation |
|
3809 | 1726 |
"Called when <F1> is pressed" |
1727 |
||
1728 |
self openHTMLDocument:'tools/uipainter/TabListEditor.html'. |
|
739 | 1729 |
! ! |
1730 |
||
1731 |
!TabListEditor class methodsFor:'documentation'! |
|
1732 |
||
1733 |
version |
|
1066
5096f66ba82d
new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
1734 |
^ '$Header$' |
2667 | 1735 |
! |
1736 |
||
1737 |
version_CVS |
|
1738 |
^ '$Header$' |
|
739 | 1739 |
! ! |
3036 | 1740 |