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