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