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