author | Claus Gittinger <cg@exept.de> |
Fri, 29 Sep 2000 20:07:41 +0200 | |
changeset 1411 | 9daf7add7ea3 |
parent 1375 | bab043fa81fa |
child 1431 | cdcadf6df14d |
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) |
|
1375 | 655 |
#bounds: #(#Rectangle 596 292 1132 661) |
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 |
|
1374 | 678 |
#Array #Array |
679 |
#Array #Array |
|
1375 | 680 |
#Array #Point |
681 |
0.264414 1.0 |
|
1373 | 682 |
) |
683 |
) |
|
684 |
#name: 'ListOfLabels' |
|
685 |
#tabable: true |
|
1183 | 686 |
#model: #selectionHolder |
687 |
#menu: #menuEdit |
|
688 |
#hasHorizontalScrollBar: true |
|
689 |
#hasVerticalScrollBar: true |
|
690 |
#miniScrollerHorizontal: true |
|
1373 | 691 |
#listModel: #listOfTabs |
692 |
#highlightMode: #line |
|
693 |
#selectConditionSelector: #askForItemModification |
|
1183 | 694 |
) |
695 |
#(#ViewSpec |
|
696 |
#name: 'SpecView' |
|
697 |
#level: -1 |
|
739 | 698 |
#component: |
1183 | 699 |
#(#SpecCollection |
700 |
#collection: #( |
|
1373 | 701 |
#(#NoteBookViewSpec |
702 |
#name: 'NoteBook' |
|
1183 | 703 |
#layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0) |
1375 | 704 |
#enableChannel: #hasSelectionHolder |
1374 | 705 |
#tabable: true |
1373 | 706 |
#model: #noteBookModel |
707 |
#menu: #noteBookTabList |
|
708 |
#useIndex: true |
|
709 |
#keepCanvasAlive: true |
|
1183 | 710 |
) |
711 |
#(#UISubSpecification |
|
712 |
#name: 'subSpec' |
|
713 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1) |
|
714 |
#majorKey: #ToolApplicationModel |
|
715 |
#minorKey: #windowSpecForCommit |
|
716 |
) |
|
1373 | 717 |
#(#NoteBookViewSpec |
718 |
#name: 'TestNoteBook' |
|
719 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
720 |
#visibilityChannel: #testMode |
|
1374 | 721 |
#tabable: true |
1373 | 722 |
#menu: #testItemList |
723 |
#useIndex: true |
|
724 |
) |
|
1183 | 725 |
) |
726 |
||
739 | 727 |
) |
1183 | 728 |
) |
729 |
) |
|
730 |
||
739 | 731 |
) |
1373 | 732 |
#handles: #(#Any 0.24053 1.0) |
1183 | 733 |
) |
734 |
#(#UISubSpecification |
|
735 |
#name: 'infoBarSubSpec' |
|
736 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
737 |
#majorKey: #ToolApplicationModel |
|
738 |
#minorKey: #windowSpecForInfoBar |
|
739 |
) |
|
740 |
) |
|
741 |
||
742 |
) |
|
739 | 743 |
) |
744 |
! ! |
|
745 |
||
1373 | 746 |
!TabListEditor class methodsFor:'list specs'! |
747 |
||
748 |
noteBookTabList |
|
749 |
"This resource specification was automatically generated |
|
750 |
by the TabListEditor of ST/X." |
|
751 |
||
752 |
"Do not manually edit this!! If it is corrupted, |
|
753 |
the TabListEditor may not be able to read the specification." |
|
754 |
||
755 |
" |
|
756 |
TabListEditor new openOnClass:TabListEditor andSelector:#noteBookTabList |
|
757 |
" |
|
758 |
||
759 |
<resource: #tabList> |
|
760 |
||
761 |
^ #( |
|
762 |
#(#TabItem |
|
763 |
#label: 'Basic' |
|
764 |
#activeHelpKey: #basicTab |
|
765 |
#minorKey: #basicSpec |
|
766 |
) |
|
767 |
#(#TabItem |
|
768 |
#label: 'Details' |
|
769 |
#activeHelpKey: #detailTab |
|
770 |
#minorKey: #detailSpec |
|
771 |
) |
|
772 |
#(#TabItem |
|
773 |
#label: 'Canvas' |
|
774 |
#activeHelpKey: #canvasTab |
|
775 |
#minorKey: #canvasSpec |
|
776 |
) |
|
777 |
) |
|
778 |
||
779 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
780 |
! ! |
|
781 |
||
739 | 782 |
!TabListEditor class methodsFor:'menu specs'! |
783 |
||
784 |
menu |
|
785 |
"This resource specification was automatically generated |
|
786 |
by the MenuEditor of ST/X." |
|
787 |
||
788 |
"Do not manually edit this!! If it is corrupted, |
|
789 |
the MenuEditor may not be able to read the specification." |
|
790 |
||
791 |
" |
|
792 |
MenuEditor new openOnClass:TabListEditor andSelector:#menu |
|
793 |
(Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp |
|
794 |
" |
|
795 |
||
796 |
<resource: #menu> |
|
797 |
||
798 |
^ |
|
799 |
||
800 |
#(#Menu |
|
801 |
||
802 |
#( |
|
803 |
#(#MenuItem |
|
804 |
#label: 'About' |
|
805 |
#activeHelpKey: #about |
|
806 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
807 |
#submenuChannel: #menuAbout |
|
808 |
) |
|
809 |
#(#MenuItem |
|
810 |
#label: 'File' |
|
811 |
#activeHelpKey: #file |
|
812 |
#submenu: |
|
813 |
#(#Menu |
|
814 |
||
815 |
#( |
|
816 |
#(#MenuItem |
|
817 |
#label: 'New' |
|
818 |
#value: #doNew |
|
819 |
#activeHelpKey: #fileNew |
|
820 |
) |
|
821 |
#(#MenuItem |
|
822 |
#label: '-' |
|
823 |
) |
|
824 |
#(#MenuItem |
|
825 |
#label: 'Load...' |
|
826 |
#translateLabel: true |
|
827 |
#value: #doLoad |
|
828 |
#activeHelpKey: #fileLoad |
|
829 |
) |
|
830 |
#(#MenuItem |
|
831 |
#label: '-' |
|
832 |
) |
|
833 |
#(#MenuItem |
|
834 |
#label: 'Save' |
|
835 |
#value: #doSave |
|
836 |
#activeHelpKey: #fileSave |
|
837 |
) |
|
838 |
#(#MenuItem |
|
839 |
#label: 'Save As...' |
|
840 |
#value: #doSaveAs |
|
841 |
#activeHelpKey: #fileSave |
|
842 |
) |
|
843 |
#(#MenuItem |
|
844 |
#label: '-' |
|
845 |
) |
|
846 |
#(#MenuItem |
|
847 |
#label: 'Browse Class' |
|
848 |
#value: #doBrowseClass |
|
849 |
#activeHelpKey: #fileBrowseClass |
|
850 |
) |
|
851 |
#(#MenuItem |
|
852 |
#label: '-' |
|
853 |
) |
|
854 |
#(#MenuItem |
|
855 |
#label: 'Exit' |
|
856 |
#value: #closeRequest |
|
857 |
#activeHelpKey: #fileExit |
|
858 |
) |
|
859 |
) nil |
|
860 |
nil |
|
861 |
) |
|
862 |
) |
|
863 |
#(#MenuItem |
|
864 |
#label: 'Edit' |
|
865 |
#activeHelpKey: #edit |
|
866 |
#submenuChannel: #menuEdit |
|
867 |
) |
|
868 |
#(#MenuItem |
|
869 |
#label: 'Add' |
|
870 |
#activeHelpKey: #add |
|
871 |
#submenu: |
|
872 |
#(#Menu |
|
873 |
||
874 |
#( |
|
875 |
#(#MenuItem |
|
876 |
#label: 'Tab Item' |
|
1373 | 877 |
#value: #doCreate |
739 | 878 |
#activeHelpKey: #addTabItem |
879 |
#labelImage: #(#ResourceRetriever nil #newTabItemIcon 'Tab Item') |
|
880 |
) |
|
881 |
) nil |
|
882 |
nil |
|
883 |
) |
|
884 |
) |
|
885 |
#(#MenuItem |
|
886 |
#label: 'Generate' |
|
887 |
#activeHelpKey: #add |
|
888 |
#submenu: |
|
889 |
#(#Menu |
|
890 |
||
891 |
#( |
|
892 |
#(#MenuItem |
|
893 |
#label: 'Aspect Method' |
|
894 |
#value: #doGenerateAspectMethod |
|
895 |
#activeHelpKey: #fileCreateAspectMethod |
|
896 |
#enabled: #hasClassAndSelector |
|
897 |
) |
|
898 |
) nil |
|
899 |
nil |
|
900 |
) |
|
901 |
) |
|
902 |
#(#MenuItem |
|
903 |
#label: 'Test' |
|
904 |
#activeHelpKey: #test |
|
905 |
#submenu: |
|
906 |
#(#Menu |
|
907 |
||
908 |
#( |
|
909 |
#(#MenuItem |
|
910 |
#label: 'Preview' |
|
911 |
#activeHelpKey: #testPreview |
|
1373 | 912 |
#enabled: #canToggleTestMode |
739 | 913 |
#indication: #testMode |
914 |
) |
|
915 |
) nil |
|
916 |
nil |
|
917 |
) |
|
918 |
) |
|
919 |
#(#MenuItem |
|
749 | 920 |
#label: 'History' |
921 |
#activeHelpKey: #history |
|
922 |
#submenuChannel: #menuHistory |
|
923 |
) |
|
924 |
#(#MenuItem |
|
739 | 925 |
#label: 'Help' |
926 |
#startGroup: #right |
|
927 |
#activeHelpKey: #help |
|
928 |
#submenuChannel: #menuHelp |
|
929 |
) |
|
930 |
) nil |
|
931 |
nil |
|
932 |
) |
|
933 |
! |
|
934 |
||
935 |
menuEdit |
|
936 |
"This resource specification was automatically generated |
|
937 |
by the MenuEditor of ST/X." |
|
938 |
||
939 |
"Do not manually edit this!! If it is corrupted, |
|
940 |
the MenuEditor may not be able to read the specification." |
|
941 |
||
942 |
" |
|
943 |
MenuEditor new openOnClass:TabListEditor andSelector:#menuEdit |
|
944 |
(Menu new fromLiteralArrayEncoding:(TabListEditor menuEdit)) startUp |
|
945 |
" |
|
946 |
||
947 |
<resource: #menu> |
|
948 |
||
1374 | 949 |
^ |
950 |
#(#Menu |
|
951 |
#( |
|
952 |
#(#MenuItem |
|
953 |
#label: 'Cut' |
|
954 |
#value: #doCut |
|
955 |
#activeHelpKey: #editCut |
|
956 |
#enabled: #hasSelectionHolder |
|
957 |
#shortcutKeyCharacter: #Cut |
|
958 |
) |
|
959 |
#(#MenuItem |
|
960 |
#label: 'Copy' |
|
961 |
#value: #doCopy |
|
962 |
#activeHelpKey: #editCopy |
|
963 |
#enabled: #hasSelectionHolder |
|
964 |
#shortcutKeyCharacter: #Copy |
|
965 |
) |
|
966 |
#(#MenuItem |
|
967 |
#label: 'Paste' |
|
968 |
#value: #doPaste |
|
969 |
#activeHelpKey: #editPaste |
|
970 |
#enabled: #valueOfCanPaste |
|
971 |
#shortcutKeyCharacter: #Paste |
|
972 |
) |
|
973 |
#(#MenuItem |
|
974 |
#label: 'Delete' |
|
975 |
#value: #doDelete |
|
976 |
#activeHelpKey: #editPaste |
|
977 |
#enabled: #hasSelectionHolder |
|
978 |
#shortcutKeyCharacter: #Delete |
|
979 |
) |
|
980 |
#(#MenuItem |
|
981 |
#label: '-' |
|
982 |
) |
|
983 |
#(#MenuItem |
|
984 |
#label: 'Move Up' |
|
985 |
#value: #doMoveTabUpOrDown: |
|
986 |
#activeHelpKey: #editMoveUp |
|
987 |
#enabled: #canMoveTabItemUpOrDown |
|
988 |
#argument: #up |
|
989 |
#labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up') |
|
990 |
) |
|
991 |
#(#MenuItem |
|
992 |
#label: 'Move Down' |
|
993 |
#value: #doMoveTabUpOrDown: |
|
994 |
#activeHelpKey: #editMoveDown |
|
995 |
#enabled: #canMoveTabItemUpOrDown |
|
996 |
#argument: #down |
|
997 |
#labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down') |
|
998 |
) |
|
999 |
#(#MenuItem |
|
1000 |
#label: '-' |
|
1001 |
#isVisible: #hiddenAccelerator |
|
1002 |
) |
|
1003 |
#(#MenuItem |
|
1004 |
#label: 'Accept' |
|
1005 |
#translateLabel: true |
|
1006 |
#isVisible: #hiddenAccelerator |
|
1007 |
#value: #accept |
|
1008 |
#enabled: #valueOfEnablingCommitButtons |
|
1009 |
#shortcutKeyCharacter: #Accept |
|
1010 |
) |
|
1011 |
) |
|
1012 |
nil |
|
1013 |
nil |
|
739 | 1014 |
) |
1015 |
! |
|
1016 |
||
1017 |
menuToolbar |
|
1018 |
"This resource specification was automatically generated |
|
1019 |
by the MenuEditor of ST/X." |
|
1020 |
||
1021 |
"Do not manually edit this!! If it is corrupted, |
|
1022 |
the MenuEditor may not be able to read the specification." |
|
1023 |
||
1024 |
" |
|
1025 |
MenuEditor new openOnClass:TabListEditor andSelector:#menuToolbar |
|
1026 |
(Menu new fromLiteralArrayEncoding:(TabListEditor menuToolbar)) startUp |
|
1027 |
" |
|
1028 |
||
1029 |
<resource: #menu> |
|
1030 |
||
1373 | 1031 |
^ |
1032 |
#(#Menu |
|
1033 |
#( |
|
1034 |
#(#MenuItem |
|
1035 |
#label: 'New' |
|
1036 |
#isButton: true |
|
1037 |
#value: #doNew |
|
1038 |
#activeHelpKey: #fileNew |
|
1039 |
#labelImage: #(#ResourceRetriever #Icon #newIcon) |
|
1040 |
) |
|
1041 |
#(#MenuItem |
|
1042 |
#label: 'Load' |
|
1043 |
#isButton: true |
|
1044 |
#value: #doLoad |
|
1045 |
#activeHelpKey: #fileLoad |
|
1046 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
|
1047 |
) |
|
1048 |
#(#MenuItem |
|
1049 |
#label: 'Save' |
|
1050 |
#isButton: true |
|
1051 |
#value: #doSave |
|
1052 |
#activeHelpKey: #fileSave |
|
1053 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
|
1054 |
) |
|
1055 |
#(#MenuItem |
|
1056 |
#label: '' |
|
1057 |
) |
|
1058 |
#(#MenuItem |
|
1059 |
#label: 'Cut' |
|
1060 |
#isButton: true |
|
1061 |
#value: #doCut |
|
1062 |
#activeHelpKey: #editCut |
|
1374 | 1063 |
#enabled: #hasSelectionHolder |
1373 | 1064 |
#labelImage: #(#ResourceRetriever #Icon #cutIcon) |
1065 |
) |
|
1066 |
#(#MenuItem |
|
1067 |
#label: 'Copy' |
|
1068 |
#isButton: true |
|
1069 |
#value: #doCopy |
|
1070 |
#activeHelpKey: #editCopy |
|
1374 | 1071 |
#enabled: #hasSelectionHolder |
1373 | 1072 |
#labelImage: #(#ResourceRetriever #Icon #copyIcon) |
1073 |
) |
|
1074 |
#(#MenuItem |
|
1075 |
#label: 'Paste' |
|
1076 |
#isButton: true |
|
1077 |
#value: #doPaste |
|
1078 |
#activeHelpKey: #editPaste |
|
1079 |
#enabled: #valueOfCanPaste |
|
1080 |
#labelImage: #(#ResourceRetriever #Icon #pasteIcon) |
|
1081 |
) |
|
1082 |
#(#MenuItem |
|
1083 |
#label: 'Delete' |
|
1084 |
#isButton: true |
|
1085 |
#value: #doDelete |
|
1086 |
#activeHelpKey: #editDelete |
|
1374 | 1087 |
#enabled: #hasSelectionHolder |
1373 | 1088 |
#labelImage: #(#ResourceRetriever #Icon #deleteIcon) |
1089 |
) |
|
1090 |
#(#MenuItem |
|
1091 |
#label: '' |
|
1092 |
) |
|
1093 |
#(#MenuItem |
|
1094 |
#label: 'Add Tab Item' |
|
1095 |
#isButton: true |
|
1096 |
#value: #doCreate |
|
1097 |
#activeHelpKey: #addTabItem |
|
1098 |
#labelImage: #(#ResourceRetriever nil #newTabItemIcon) |
|
1099 |
) |
|
1100 |
#(#MenuItem |
|
1101 |
#label: '' |
|
1102 |
) |
|
1103 |
#(#MenuItem |
|
1104 |
#label: 'Move Tab Up' |
|
1105 |
#isButton: true |
|
1106 |
#value: #doMoveTabUpOrDown: |
|
1107 |
#activeHelpKey: #editMoveUp |
|
1108 |
#enabled: #canMoveTabItemUpOrDown |
|
1109 |
#argument: #up |
|
1110 |
#labelImage: #(#ResourceRetriever #Icon #upIcon) |
|
1111 |
) |
|
1112 |
#(#MenuItem |
|
1113 |
#label: 'Move Tab Down' |
|
1114 |
#isButton: true |
|
1115 |
#value: #doMoveTabUpOrDown: |
|
1116 |
#activeHelpKey: #editMoveDown |
|
1117 |
#enabled: #canMoveTabItemUpOrDown |
|
1118 |
#argument: #down |
|
1119 |
#labelImage: #(#ResourceRetriever #Icon #downIcon) |
|
1120 |
) |
|
1121 |
) |
|
1122 |
nil |
|
1123 |
nil |
|
739 | 1124 |
) |
1125 |
! ! |
|
1126 |
||
1127 |
!TabListEditor methodsFor:'aspects'! |
|
1128 |
||
1373 | 1129 |
autoHideScrollBars |
1130 |
|holder| |
|
1131 |
||
1132 |
(holder := builder bindingAt:#autoHideScrollBars) isNil ifTrue:[ |
|
1133 |
builder aspectAt:#autoHideScrollBars put:(holder := 1 asValue). |
|
1134 |
holder addDependent: self |
|
1135 |
]. |
|
1136 |
^ holder. |
|
1137 |
! |
|
1138 |
||
739 | 1139 |
canMoveTabItemUpOrDown |
1373 | 1140 |
^ builder booleanValueAspectFor:#canMoveTabItemUpOrDown |
1141 |
! |
|
1142 |
||
1374 | 1143 |
hasSelectionHolder |
1144 |
^ builder booleanValueAspectFor:#hasSelectionHolder |
|
1145 |
! |
|
1146 |
||
1147 |
hiddenAccelerator |
|
1148 |
"used to set menu entries with an accelerator not visible to the operator |
|
1149 |
" |
|
1150 |
^ false |
|
1151 |
! |
|
1152 |
||
1326 | 1153 |
inputGroup |
1154 |
||
1155 |
|holder| |
|
1156 |
||
1157 |
(holder := builder bindingAt:#inputGroup) isNil ifTrue:[ |
|
1158 |
builder aspectAt:#inputGroup put:(holder := EnterFieldGroup new) |
|
1159 |
]. |
|
1160 |
^ holder. |
|
1161 |
||
1162 |
||
1163 |
! |
|
1164 |
||
1373 | 1165 |
listOfTabs |
1166 |
^ listOfTabs |
|
1167 |
! |
|
1168 |
||
1169 |
noteBookModel |
|
1170 |
|holder| |
|
1171 |
||
1172 |
(holder := builder bindingAt:#noteBookModel) isNil ifTrue:[ |
|
1173 |
holder := 0 asValue. |
|
1174 |
builder aspectAt:#noteBookModel put:holder. |
|
1175 |
]. |
|
1176 |
^ holder. |
|
1177 |
! |
|
1178 |
||
1179 |
noteBookTabList |
|
1180 |
"Generated by the TabListEditor" |
|
1181 |
||
1182 |
|list| |
|
1183 |
||
1184 |
(list := builder bindingAt:#noteBookTabList) isNil ifTrue:[ |
|
1185 |
builder aspectAt:#noteBookTabList put:(list := self class noteBookTabList). |
|
1186 |
]. |
|
1187 |
^ list |
|
739 | 1188 |
! |
1189 |
||
1190 |
selectionHolder |
|
1191 |
"holder which keeps the current selection |
|
1192 |
" |
|
1193 |
|holder| |
|
1194 |
||
1195 |
(holder := builder bindingAt:#selectionHolder) isNil ifTrue:[ |
|
1373 | 1196 |
holder := 0 asValue. |
739 | 1197 |
builder aspectAt:#selectionHolder put:holder. |
1373 | 1198 |
holder addDependent:self. |
739 | 1199 |
]. |
1200 |
^ holder |
|
1201 |
! |
|
1202 |
||
1373 | 1203 |
testItemList |
739 | 1204 |
|holder| |
1205 |
||
1373 | 1206 |
(holder := builder bindingAt:#testItemList) isNil ifTrue:[ |
1207 |
holder := ValueHolder new. |
|
1208 |
builder aspectAt:#testItemList put:holder. |
|
739 | 1209 |
]. |
1373 | 1210 |
^ holder. |
739 | 1211 |
! |
1212 |
||
1213 |
testMode |
|
1214 |
||
1215 |
|holder| |
|
1216 |
||
1217 |
(holder := builder bindingAt:#testMode) isNil ifTrue:[ |
|
1218 |
builder aspectAt:#testMode put:(holder := false asValue). |
|
1219 |
holder addDependent: self |
|
1220 |
]. |
|
1221 |
^ holder |
|
1222 |
||
1223 |
! ! |
|
1224 |
||
1225 |
!TabListEditor methodsFor:'building'! |
|
1226 |
||
1227 |
buildFromClass:aClass andSelector:aSelector |
|
1228 |
"build from class and selector |
|
1229 |
" |
|
1373 | 1230 |
|cls spec| |
739 | 1231 |
|
1232 |
self testMode value: false. |
|
1373 | 1233 |
self selection:0. |
739 | 1234 |
|
1235 |
"if opened on a tab list" |
|
1373 | 1236 |
(aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) ifTrue:[ |
1237 |
listOfTabs notEmpty ifTrue:[self selection:1]. |
|
1238 |
^ nil |
|
739 | 1239 |
]. |
1240 |
listOfTabs removeAll. |
|
1241 |
||
1242 |
cls := self resolveName:aClass. |
|
1243 |
specSelector := aSelector. |
|
1244 |
||
1245 |
cls notNil ifTrue:[ |
|
1246 |
specSelector notNil ifTrue:[ |
|
1247 |
||
1248 |
(cls respondsTo:specSelector) ifTrue:[ |
|
1249 |
spec := cls perform:specSelector. |
|
1250 |
||
1251 |
spec size ~~ 0 ifTrue:[ |
|
1252 |
spec do:[:aTab| |
|
1253 |
listOfTabs add:aTab. |
|
1254 |
]. |
|
1255 |
self addToHistory:(cls name, ' ', specSelector) -> #loadFromMessage: |
|
1256 |
] |
|
1257 |
] |
|
1258 |
] |
|
1259 |
]. |
|
1260 |
||
1261 |
modified := false. |
|
1374 | 1262 |
listOfTabs notEmpty ifTrue:[ self selection:1 ]. |
739 | 1263 |
! |
1264 |
||
1373 | 1265 |
buildFromResourceSpec:aListSpec |
1266 |
self buildFromTabList:aListSpec |
|
739 | 1267 |
! |
1268 |
||
1269 |
buildFromTabList: aTabList |
|
1270 |
"build from a aTabList" |
|
1271 |
||
1373 | 1272 |
self selection:0. |
739 | 1273 |
listOfTabs removeAll. |
1274 |
||
1374 | 1275 |
aTabList do:[:aTabItem| listOfTabs add: aTabItem ]. |
739 | 1276 |
modified := false. |
1374 | 1277 |
listOfTabs notEmpty ifTrue:[ self selection:1 ]. |
739 | 1278 |
|
1279 |
! ! |
|
1280 |
||
1281 |
!TabListEditor methodsFor:'change & update'! |
|
1282 |
||
1283 |
update:something with:aParameter from:someObject |
|
1284 |
"one of my aspects has changed; update modified channel |
|
1285 |
" |
|
1374 | 1286 |
|list| |
1373 | 1287 |
|
1288 |
someObject = self selectionHolder ifTrue:[ |
|
1289 |
^ self selectionChanged |
|
1290 |
]. |
|
1291 |
||
1292 |
someObject = self testMode ifFalse:[ |
|
1293 |
^ super update:something with:aParameter from:someObject. |
|
1294 |
]. |
|
1295 |
||
1296 |
someObject value ifTrue:[ |
|
1375 | 1297 |
self noteBookModel value:0. |
1298 |
||
1374 | 1299 |
listOfTabs notEmpty ifTrue:[ |
1373 | 1300 |
list := listOfTabs collect:[:aTab| |tab| |
1301 |
tab := aTab copy. |
|
1302 |
tab setAttributesFromClass:specClass. |
|
1303 |
tab |
|
1374 | 1304 |
] |
1305 |
]. |
|
1306 |
self selection:0. |
|
1373 | 1307 |
]. |
1308 |
self testItemList value:list. |
|
1309 |
self updateInfoLabel. |
|
739 | 1310 |
|
1311 |
! ! |
|
1312 |
||
1373 | 1313 |
!TabListEditor methodsFor:'queries'! |
739 | 1314 |
|
1373 | 1315 |
canToggleTestMode |
1316 |
"checks whether testMode button is enabled |
|
1317 |
" |
|
1318 |
self testMode value ifTrue:[ |
|
1319 |
^ true |
|
1320 |
]. |
|
1321 |
||
1322 |
self valueOfEnablingCommitButtons value ifFalse:[ |
|
1323 |
^ listOfTabs notEmpty |
|
1324 |
]. |
|
1325 |
^ false |
|
739 | 1326 |
! ! |
1327 |
||
1328 |
!TabListEditor methodsFor:'selection'! |
|
1329 |
||
1373 | 1330 |
selectedElement |
1331 |
|idx tab| |
|
1332 |
||
1333 |
idx := self selection. |
|
1334 |
||
1335 |
idx ~~ 0 ifTrue:[ |
|
1336 |
(tab := listOfTabs at:idx ifAbsent:nil) notNil ifTrue:[ |
|
1337 |
^ tab |
|
1338 |
]. |
|
1339 |
self selection:0 |
|
1340 |
]. |
|
1341 |
^ nil |
|
1342 |
! |
|
1343 |
||
1344 |
selection |
|
1345 |
^ self selectionHolder value ? 0 |
|
739 | 1346 |
! |
1347 |
||
1373 | 1348 |
selection:anIndex |
1349 |
self selectionHolder value:(anIndex ? 0). |
|
1350 |
! |
|
739 | 1351 |
|
1373 | 1352 |
selectionChanged |
1353 |
|noteBookModel hasSelection| |
|
739 | 1354 |
|
1373 | 1355 |
hasSelection := self selection ~~ 0. |
1356 |
noteBookModel := self noteBookModel. |
|
1145 | 1357 |
|
1373 | 1358 |
hasSelection ifTrue:[ |
1359 |
self testMode value:false. |
|
1360 |
noteBookModel value == 0 ifTrue:[noteBookModel value:1] |
|
739 | 1361 |
] ifFalse:[ |
1373 | 1362 |
noteBookModel value:0 |
739 | 1363 |
]. |
1364 |
self cancel. |
|
1374 | 1365 |
self hasSelectionHolder value:hasSelection. |
1373 | 1366 |
self valueOfCanPaste. |
1367 |
! |
|
739 | 1368 |
|
1373 | 1369 |
setSelection:anIndex |
1374 | 1370 |
|index| |
1371 |
||
1372 |
index := anIndex ? 0. |
|
1373 |
self selectionHolder value:index withoutNotifying:self |
|
739 | 1374 |
! ! |
1375 |
||
1376 |
!TabListEditor methodsFor:'startup / release'! |
|
1377 |
||
1378 |
initialize |
|
1379 |
"setup aspects used by column description specifications |
|
1380 |
" |
|
1381 |
super initialize. |
|
1373 | 1382 |
listOfTabs := List new. |
739 | 1383 |
! |
1384 |
||
1385 |
openModalOnTabList: aTabList |
|
1386 |
"build a tab list from aTabList and open it modal" |
|
1387 |
||
1388 |
super openModalOnResourceSpec: aTabList |
|
1389 |
||
1390 |
! ! |
|
1391 |
||
1392 |
!TabListEditor methodsFor:'user actions'! |
|
1393 |
||
1394 |
accept |
|
1395 |
"accept changes |
|
1396 |
" |
|
1373 | 1397 |
|tab idx asb| |
1066
5096f66ba82d
new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
1398 |
|
1373 | 1399 |
(tab := self selectedElement) notNil ifTrue:[ |
1400 |
super accept. |
|
1401 |
aspects keysAndValuesDo:[:k :m| tab perform:(k , ':') asSymbol with:(m value) ]. |
|
739 | 1402 |
|
1373 | 1403 |
asb := self autoHideScrollBars value. |
1404 |
asb := asb ~~ 1 ifTrue:[asb == 2] ifFalse:[nil]. |
|
1405 |
tab autoHideScrollBars:asb. |
|
739 | 1406 |
]. |
1407 |
self cancel. |
|
1373 | 1408 |
! |
1409 |
||
1410 |
addTab:aTab |
|
1411 |
|idx| |
|
1412 |
||
1413 |
aTab notNil ifTrue:[ |
|
1414 |
self testMode value: false. |
|
1415 |
||
1416 |
(idx := self selection) == 0 ifTrue:[ |
|
1417 |
listOfTabs add:aTab. |
|
1418 |
self selection:(listOfTabs size). |
|
1419 |
] ifFalse:[ |
|
1420 |
listOfTabs add:aTab afterIndex:idx |
|
1421 |
]. |
|
1422 |
modified := true. |
|
1423 |
]. |
|
739 | 1424 |
! |
1425 |
||
1426 |
cancel |
|
1427 |
"cancel all changes |
|
1428 |
" |
|
1373 | 1429 |
|tab idx asb| |
739 | 1430 |
|
1373 | 1431 |
( (idx := self selection) ~~ 0 |
1432 |
and:[(tab := self selectedElement) notNil] |
|
1433 |
) ifTrue:[ |
|
1434 |
aspects keysAndValuesDo:[:k :m| m value:(tab perform:k) ]. |
|
1435 |
listOfTabs at:idx put:tab. |
|
739 | 1436 |
|
1373 | 1437 |
asb := tab autoHideScrollBars. |
1438 |
asb notNil ifTrue:[asb := asb == true ifTrue:[2] ifFalse:[3]] |
|
1439 |
ifFalse:[asb := 1]. |
|
739 | 1440 |
|
1373 | 1441 |
self autoHideScrollBars value:asb. |
739 | 1442 |
]. |
1373 | 1443 |
self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]). |
739 | 1444 |
self valueOfEnablingCommitButtons value: false |
1445 |
||
1446 |
||
1447 |
||
1448 |
! |
|
1449 |
||
1450 |
doCopy |
|
1451 |
"copy selected tab |
|
1452 |
" |
|
1373 | 1453 |
|tab| |
1454 |
||
1455 |
(tab := self selectedElement) notNil ifTrue:[ |
|
1456 |
self clipboard:tab. |
|
749 | 1457 |
self updateAllToolInstances. |
739 | 1458 |
] |
1459 |
! |
|
1460 |
||
1373 | 1461 |
doCreate |
1462 |
self addTab:(TabItem label:'TAB'). |
|
739 | 1463 |
! |
1464 |
||
1465 |
doCut |
|
1373 | 1466 |
"cut the selected tab; put to pasteBuffer |
739 | 1467 |
" |
1373 | 1468 |
|tab| |
739 | 1469 |
|
1373 | 1470 |
(tab := self selectedElement) notNil ifTrue:[ |
1471 |
self clipboard:tab. |
|
1472 |
self doDelete. |
|
739 | 1473 |
]. |
1474 |
||
1475 |
! |
|
1476 |
||
1477 |
doDelete |
|
1478 |
"delete selected tab |
|
1479 |
" |
|
1374 | 1480 |
|index size| |
739 | 1481 |
|
1373 | 1482 |
(index := self selection) ~~ 0 ifTrue:[ |
739 | 1483 |
self testMode value: false. |
1374 | 1484 |
|
1485 |
(size := listOfTabs size) == 1 ifTrue:[ |
|
1486 |
self selection:0 |
|
1487 |
] ifFalse:[ |
|
1488 |
self setSelection:0 |
|
1489 |
]. |
|
739 | 1490 |
listOfTabs removeIndex:index. |
1374 | 1491 |
index < size ifFalse:[ |
1492 |
index := index - 1 |
|
1493 |
]. |
|
1373 | 1494 |
self selection:index. |
1495 |
self updateAllToolInstances. |
|
739 | 1496 |
modified := true. |
1497 |
]. |
|
1373 | 1498 |
|
739 | 1499 |
! |
1500 |
||
1501 |
doGenerateAspectMethod |
|
1502 |
"generate aspect method |
|
1503 |
" |
|
1504 |
|cls code| |
|
1505 |
||
1506 |
(specClass notNil and:[specSelector notNil]) |
|
1507 |
ifFalse: |
|
1508 |
[ |
|
1509 |
^self information:'No class and selector defined!!' |
|
1510 |
]. |
|
1511 |
||
1512 |
cls := self resolveName: specClass. |
|
1513 |
||
1514 |
(cls canUnderstand:specSelector) ifTrue:[ |
|
1515 |
"/ method already exists, do not overwrite the method automaticaly |
|
1516 |
||
1517 |
( YesNoBox title:'method ' |
|
1518 |
, (Text string:('#', specSelector) emphasis:#bold) |
|
1519 |
, ' already exists!!' |
|
1520 |
yesText:'overwrite' |
|
1521 |
noText:'cancel' |
|
1522 |
) confirm ifFalse:[ |
|
1523 |
^ self |
|
1524 |
] |
|
1525 |
]. |
|
1526 |
||
1527 |
code := '!!' , cls name , ' methodsFor:''aspects''!!\\' , |
|
1528 |
specSelector , '\' , |
|
1529 |
' "Generated by the TabListEditor"\' , |
|
1530 |
'\' , |
|
1531 |
' |list|\' , |
|
1532 |
'\' , |
|
1533 |
' (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' , |
|
1534 |
' builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' , |
|
1535 |
' ].\' , |
|
1536 |
' ^ list\' , |
|
1537 |
'!! !!\\'. |
|
1538 |
||
1539 |
(ReadStream on:(code withCRs)) fileIn |
|
1540 |
||
1541 |
||
1542 |
! |
|
1543 |
||
1544 |
doMoveTabUpOrDown:what |
|
1545 |
"step up or down |
|
1546 |
" |
|
1373 | 1547 |
|tab idx sz| |
739 | 1548 |
|
1373 | 1549 |
(listOfTabs size > 1 and:[(idx := self selection) ~~ 0]) ifFalse:[ |
739 | 1550 |
^ self |
1551 |
]. |
|
1552 |
||
1373 | 1553 |
(tab := listOfTabs at:idx ifAbsent:nil) isNil ifTrue:[ |
1554 |
^ self selection:0 |
|
1555 |
]. |
|
739 | 1556 |
|
1373 | 1557 |
self setSelection:0. |
1558 |
listOfTabs removeIndex:idx. |
|
739 | 1559 |
|
1373 | 1560 |
sz := listOfTabs size. |
1145 | 1561 |
|
739 | 1562 |
what == #down ifTrue:[ |
1373 | 1563 |
idx := idx > sz ifTrue:[1] ifFalse:[idx + 1] |
739 | 1564 |
] ifFalse:[ |
1373 | 1565 |
idx := idx == 1 ifTrue:[sz + 1] ifFalse:[idx - 1] |
739 | 1566 |
]. |
1567 |
||
1373 | 1568 |
listOfTabs add:tab beforeIndex:idx. |
1569 |
self setSelection:idx. |
|
739 | 1570 |
modified := true. |
1571 |
||
1572 |
! |
|
1573 |
||
1574 |
doPaste |
|
1575 |
"paste a tab |
|
1576 |
" |
|
1373 | 1577 |
|tab| |
1145 | 1578 |
|
1373 | 1579 |
((tab := self class clipboard) notNil and:[tab isKindOf:TabItem]) ifTrue:[ |
1580 |
self addTab:(tab deepCopy). |
|
1581 |
] |
|
739 | 1582 |
! |
1583 |
||
1584 |
doSave |
|
1585 |
"generate code for class and instance |
|
1586 |
" |
|
1245 | 1587 |
|cls code spec category mthd list| |
739 | 1588 |
|
1589 |
(specClass notNil and:[specSelector notNil]) |
|
1590 |
ifFalse: |
|
1591 |
[ |
|
1592 |
^self doSaveAs |
|
1593 |
]. |
|
1594 |
||
1595 |
cls := self resolveName: specClass. |
|
1596 |
||
1597 |
listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!']. |
|
1598 |
||
1599 |
spec := WriteStream on:String new. |
|
1245 | 1600 |
list := Array new:(listOfTabs size). |
1601 |
listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)]. |
|
1602 |
||
1603 |
UISpecification prettyPrintSpecArray:list on:spec indent:5. |
|
739 | 1604 |
spec := spec contents. |
1605 |
||
1606 |
"/ if that method already exists, do not overwrite the category |
|
1607 |
||
1608 |
category := 'list specs'. |
|
1609 |
||
1610 |
(mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ |
|
1611 |
category := mthd category. |
|
1612 |
]. |
|
1613 |
||
1614 |
code := Character excla asString |
|
1615 |
, cls name , ' class methodsFor:' , category storeString |
|
1616 |
, Character excla asString , '\\' |
|
1617 |
||
1618 |
, specSelector , '\' |
|
1619 |
, (self class codeGenerationComment replChar:$!! withString:'!!!!') |
|
1620 |
, '\\ "\' |
|
1621 |
, ' TabListEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\' |
|
1622 |
, ' "\'. |
|
1623 |
||
1624 |
code := code |
|
1625 |
, '\' |
|
1626 |
, ' <resource: #tabList>\\' |
|
1627 |
, ' ^' |
|
1628 |
, ' ', spec, '\' |
|
1629 |
, ' collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]' |
|
1630 |
, '\' |
|
1631 |
, Character excla asString |
|
1632 |
, ' ' |
|
1633 |
, Character excla asString |
|
1634 |
, '\'. |
|
1635 |
||
1636 |
code := code withCRs. |
|
1637 |
(ReadStream on:code) fileIn. |
|
1638 |
||
1639 |
(cls canUnderstand:specSelector) ifFalse:[ |
|
1640 |
(YesNoBox confirm:'Generate aspect method?') ifTrue:[ |
|
1641 |
self doGenerateAspectMethod |
|
1642 |
] |
|
1643 |
]. |
|
1644 |
||
1645 |
self addToHistory:(cls name, ' ', specSelector) -> #loadFromMessage:. |
|
1646 |
modified := false. |
|
1647 |
hasSaved := true. |
|
1648 |
! ! |
|
1649 |
||
1650 |
!TabListEditor class methodsFor:'documentation'! |
|
1651 |
||
1652 |
version |
|
1066
5096f66ba82d
new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
1653 |
^ '$Header$' |
739 | 1654 |
! ! |