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