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