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