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