author | tz |
Mon, 02 Feb 1998 23:48:47 +0100 | |
changeset 557 | de8d8782486c |
parent 540 | cf67668c680c |
child 580 | 77cf5b8dcffc |
permissions | -rw-r--r-- |
164 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
15 |
||
16 |
ApplicationModel subclass:#UISpecificationTool |
|
172 | 17 |
instanceVariableNames:'modifiedHolder aspects specification selection specChannel' |
164 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
23 |
!UISpecificationTool class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1995 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 |
||
42 |
documentation |
|
43 |
" |
|
44 |
used by the UIPainter to manipulate the specifications of the selected component |
|
45 |
||
46 |
[author:] |
|
47 |
Claus Atzkern |
|
48 |
||
49 |
[see also:] |
|
50 |
UIPainter |
|
51 |
UILayoutTool |
|
52 |
UIHelpTool |
|
53 |
" |
|
54 |
! ! |
|
55 |
||
172 | 56 |
!UISpecificationTool class methodsFor:'help specs'! |
57 |
||
58 |
helpSpec |
|
59 |
"return a dictionary filled with helpKey -> helptext associations. |
|
294 | 60 |
These are used by the activeHelp tool." |
61 |
||
62 |
" |
|
63 |
UIHelpTool openOnClass:UISpecificationTool |
|
172 | 64 |
" |
294 | 65 |
|
172 | 66 |
^ super helpSpec addPairsFrom:#( |
67 |
||
367 | 68 |
#acceptImmediate |
69 |
'input will we sent to the model immediately (every key)' |
|
70 |
||
71 |
#acceptOnLeave |
|
72 |
'input will we sent to the model when the field is left via cursor keys' |
|
73 |
||
540 | 74 |
#acceptOnLostFocus |
75 |
'input will we sent to the model when the mouse leaves the field, or its tabbed' |
|
76 |
||
367 | 77 |
#acceptOnReturn |
78 |
'input will we sent to the model when the return key is pressed' |
|
79 |
||
80 |
#acceptOnTab |
|
81 |
'input will we sent to the model when the tab key is pressed' |
|
82 |
||
303 | 83 |
#action |
346 | 84 |
'action selector sent to the application when the button is activated. (either on-press or on-release; this depends on the setting of triggerOnDown flag). The selector may be for a one-arg message; in this case, the argument is passed (a string).' |
303 | 85 |
|
367 | 86 |
#actionArg |
87 |
'action argument passed to action method, if action selector is a one-arg selector (i.e. ends with '':''). The arg is passed as a string.' |
|
88 |
||
540 | 89 |
#appletParamText |
90 |
'Paste the complete appletTAGs HTML text here (i.e. all from <applet> up to and including the </applet>). Press parse to extract all parameters from it.' |
|
91 |
||
92 |
#appletTextParse |
|
93 |
'Parse the appletTAG and fill the parameters directory from it.' |
|
94 |
||
350 | 95 |
#arbitraryView |
96 |
'the class of the arbitrary component or an aspect selector which provides a widget class.' |
|
294 | 97 |
|
540 | 98 |
#archiveEntry |
99 |
'The name of a zip-file archive, if the class(es) are to be loaded from a zip-archive.' |
|
100 |
||
101 |
#arrowButtonDirection |
|
102 |
'the direction of the arrow.' |
|
103 |
||
350 | 104 |
#autoRepeat |
105 |
'repeat the action as long as the button is pressed; to have this behavior the ''isTriggerOnDown'' state must be enabled.' |
|
307 | 106 |
|
367 | 107 |
#backgroundChannel |
108 |
'a holder, which provides the widgets backgroundColor. Useful if the labels bg color is to be changed dynamically (alerts).' |
|
109 |
||
350 | 110 |
#backgroundColor |
111 |
'set the background color if the color-checkBox is turned on. Otherwise, the widget uses its default background color (which is specified in the styleSheet).' |
|
303 | 112 |
|
350 | 113 |
#beDefault |
114 |
'show/dont show a return-key image after the label' |
|
307 | 115 |
|
350 | 116 |
#booleanHolder |
367 | 117 |
'aspect of a boolean holder which keeps the state' |
294 | 118 |
|
350 | 119 |
#borderWidth |
120 |
'width of the border' |
|
303 | 121 |
|
307 | 122 |
#canvas |
123 |
'gets a widget placed into the notebook' |
|
294 | 124 |
|
350 | 125 |
#canvasArgument |
126 |
'the argument to the selector or none' |
|
127 |
||
128 |
#canvasSelector |
|
129 |
'after opening the application as specified by the clientKey, this message will be sent' |
|
130 |
||
131 |
#clientKey |
|
132 |
'returns an application which provides the builder. By default the application itself is used.' |
|
133 |
||
540 | 134 |
#codeBaseHolder |
135 |
'The URL of the directory, where the classFile-file resides. If the classFile is located on the local machine, use\ file:/<fullPath>\ where fullPath is an absolute pathname. If its to be accessed via http, use\ http:/<host>/<relativePath>\ where relativePath is the path relative to the http''s top diretory on that host.' |
|
136 |
||
137 |
#codeFileEntry |
|
138 |
'The name of the java classFile which contains the applets code. For example: ''ArcTest.class''' |
|
139 |
||
350 | 140 |
#defaultLabel |
141 |
'the default label (used, if nothing selected).' |
|
142 |
||
143 |
#document |
|
144 |
'a holder which keeps the document name.' |
|
145 |
||
146 |
#doubleClickSelector |
|
147 |
'double click action which is evaluated on double click in case of a non-nil selection. If the selector ends with '':'' the method is invoked with the current selection as argument.' |
|
294 | 148 |
|
350 | 149 |
#enableChannel |
367 | 150 |
'enableHolder for the view. This field specifies the name of the aspect (-method or binding) in your application, which is supposed to return a valueHolder on to the boolean enable-flag. This is convenient, if many widgets are to be enabled/disabled depending on the setting of a single flag, because the application can change them all with a single setting of the enableHolders value.' |
350 | 151 |
|
152 |
#fileSelectionTreeRoot |
|
153 |
'a holder, which keeps the pathname of the root directory (first entry in the list).' |
|
154 |
||
155 |
#fontMenu |
|
156 |
'set the font for the widget if the font-checkBox is turned on. Otherwise, the widget uses its default font (which is specified in the viewStyle).' |
|
294 | 157 |
|
367 | 158 |
#forceRecursiveBackground |
159 |
'also change all subcomponents viewBackground (recursively).' |
|
160 |
||
540 | 161 |
#foregroundChannel |
162 |
'a holder, which provides the widgets foregroundColor. Useful if the labels fg color is to be changed dynamically (alerts).' |
|
163 |
||
350 | 164 |
#foregroundColor |
165 |
'set the foreground color if the color-checkBox is turned on. Otherwise, the widget uses its default foreground color (which is specified in the styleSheet).' |
|
166 |
||
167 |
#galleryLabels |
|
168 |
'a list of tab labels' |
|
169 |
||
170 |
#galleryModel |
|
171 |
'a holder, which keeps the label of the current selected tab or nil.' |
|
294 | 172 |
|
307 | 173 |
#gallerySelection |
174 |
'a holder, which keeps the specification of the current selected widget or nil.' |
|
175 |
||
294 | 176 |
#gallerySelectors |
177 |
'the list of selectors specify which interface specification should be used dependent on the tab pressed. Each selector must return an interfaceSpec. On default the #windowSpec method is used' |
|
178 |
||
367 | 179 |
#hasBorder |
180 |
'currently ignored - kept to avoid loosing information of imported VW window specs' |
|
181 |
||
350 | 182 |
#hierarchicalList |
183 |
'gets a hierarchical list or a holder which keeps a hierarchical list entry; the value must understand the TreeItem protocol.' |
|
184 |
||
185 |
#hierarchicalListButton |
|
186 |
'opens the hierarchical list editor, which can be used to generate and install a hierarchical list.' |
|
294 | 187 |
|
350 | 188 |
#horizontalLayout |
189 |
'specifies how components are to be arranged horizontally' |
|
190 |
||
191 |
#horizontalMiniScroller |
|
192 |
'use a mini-horizontalScroller' |
|
294 | 193 |
|
350 | 194 |
#horizontalScroller |
195 |
'make the view horizontally scrollable' |
|
196 |
||
197 |
#id |
|
198 |
'the symbolic name of the component. This ID can be used by the application to access components, using #componentAt:<ID>' |
|
303 | 199 |
|
540 | 200 |
#initiallyDisabled |
201 |
'if on, the widget is initially disabled (to be enabled programatically with "(self componentAt:<ID>) enable").' |
|
202 |
||
367 | 203 |
#initiallyInvisible |
204 |
'if on, the widget is initially invisible (to be made visible programatically with "(self componentAt:<ID>) beVisible")).' |
|
205 |
||
206 |
#inputFieldGroup |
|
207 |
'symbolic ID of the input group - fields within a group can be reached via cursor up/down.' |
|
208 |
||
350 | 209 |
#isMultiSelect |
210 |
'enable/disable multiple selections.' |
|
294 | 211 |
|
350 | 212 |
#isTriggerOnDown |
213 |
'if true, the action is evaluated when the button is pressed; otherwise, when released.' |
|
303 | 214 |
|
215 |
#label |
|
346 | 216 |
'the label of the widget. If ''label is image'' is off, this is the label string. Otherwise, it specifies the applications selector, which returns the label - either a string or a bitmap image.' |
303 | 217 |
|
367 | 218 |
#labelChannel |
219 |
'a holder, which provides the widgets label. Useful if the label is to be changed dynamically.' |
|
220 |
||
221 |
#labelIsImage |
|
222 |
'if ''label is image'' is off (the default), the widgets label is the string as entered in the label aspect. Otherwise, its the name of the message sent to the application - this should return a string or bitmap image, which is used as logo in the widget.' |
|
223 |
||
540 | 224 |
#lampColor |
225 |
'set the lamp color if the color-checkBox is turned on. Otherwise, the widget uses its default lamp color (which is specified in the styleSheet).' |
|
226 |
||
350 | 227 |
#level |
228 |
'the 3D-level relative to its superView. If left blank, the components default is used.' |
|
229 |
||
230 |
#listHolder |
|
231 |
'a list or a list holders aspect' |
|
232 |
||
233 |
#majorKey |
|
234 |
'name of the class which provides the window specification. If left blank, the application itself is used.' |
|
235 |
||
236 |
#maxChars |
|
237 |
'maximum number of characters that are allowed in the editfield. If left blank, no limit is set.' |
|
238 |
||
239 |
#maxSize |
|
240 |
'Those two fields specify the windows maximum size. The user will not be allowed to resize it to a larger size.' |
|
241 |
||
242 |
#maxXField |
|
243 |
'the maximum width - the user will not be allowed to resize the topView to a larger width.' |
|
244 |
||
245 |
#maxYField |
|
246 |
'the maximum height - the user will not be allowed to resize the topView to a larger height.' |
|
247 |
||
248 |
#menuButton |
|
249 |
'open a menu editor on the specified menu selector.' |
|
250 |
||
251 |
#menuHolder |
|
252 |
'aspect selector or holder which provides the middle button menu' |
|
253 |
||
254 |
#menuId |
|
255 |
'the aspect of the menu. The application may respond to this message by returning a menu.' |
|
256 |
||
257 |
#menuPerformer |
|
258 |
'aspect providing an object which gets the menu messages. If left blank, the menu sends its menuMessages to the application.' |
|
259 |
||
260 |
#middleButtonPressed |
|
261 |
'called if the middle button is pressed; you can open a menu' |
|
262 |
||
263 |
#minSize |
|
264 |
'Those two fields specify the windows minimum size. The user will not be allowed to resize it to a smaller size.' |
|
265 |
||
266 |
#minXField |
|
267 |
'the minimum width - the user will not be allowed to resize the topView to a smaller width.' |
|
268 |
||
269 |
#minYField |
|
270 |
'the minimum height - the user will not be allowed to resize the topView to a smaller height.' |
|
271 |
||
294 | 272 |
#minorKey |
350 | 273 |
'the selector specifies which interface specification to be used. The selector must return an interfaceSpec. By default the #windowSpec method is used.' |
274 |
||
275 |
#oneTabPerLine |
|
276 |
'draw only one tab per line' |
|
277 |
||
540 | 278 |
#paramAdd |
279 |
'Adds a name-value pair to the parameters collection.' |
|
280 |
||
281 |
#paramList |
|
282 |
'Lists defined parameters.' |
|
283 |
||
284 |
#paramNameField |
|
285 |
'The name of the appletParameter.' |
|
286 |
||
287 |
#paramRemove |
|
288 |
'Removes the definition of the current name.' |
|
289 |
||
290 |
#paramValueField |
|
291 |
'The value of the appletParameter.' |
|
292 |
||
293 |
#parameNameField |
|
294 |
'' |
|
295 |
||
296 |
#radioButtonGroup |
|
297 |
'the aspect of the valueHolder which holds the selection of a radioButtonGroup. When clicked, each button writes its value into that aspect; vice versa, if the groupValue is changed to the value of one of the buttons, that button turns itself on.' |
|
298 |
||
299 |
#radioButtonValue |
|
300 |
'the value associated with that radioButton. When clicked, this will be stored into the group-model. If left empty, buttons are numbered sequentially, starting with 1.' |
|
301 |
||
302 |
#readOnly |
|
303 |
'the field is readOnly - its contents cannot be modified by the user (however, the program can)' |
|
304 |
||
305 |
#resizeForLabel |
|
306 |
'if on, the widget is allowed to resize itself to fit the labelString - if off, the size is frozen.' |
|
307 |
||
350 | 308 |
#selectionHolder |
367 | 309 |
'the aspect of the valueHolder which holds the selection or input value.' |
350 | 310 |
|
311 |
#setMaxExtent |
|
312 |
'set the maximum size from the topViews current size.' |
|
313 |
||
314 |
#setMinExtent |
|
315 |
'set the minumum size from the topViews current size.' |
|
316 |
||
317 |
#showDirectoryIndication |
|
318 |
'show or hide the open/closed indicator on nodes which contains children' |
|
294 | 319 |
|
303 | 320 |
#showFrame |
321 |
'show the frame' |
|
322 |
||
540 | 323 |
#showLamp |
324 |
'enable/disable display of the toggles lamp.' |
|
325 |
||
350 | 326 |
#showLines |
327 |
'show or hide lines' |
|
303 | 328 |
|
350 | 329 |
#showRoot |
330 |
'show or hide the first element of the hierarchical list.' |
|
294 | 331 |
|
350 | 332 |
#sizeAsDefault |
333 |
'let the widget compute its size to include space for the default (return) image. Useful for buttons which are not default buttons initially, but may become a default button dynamically.' |
|
294 | 334 |
|
335 |
#tabLabels |
|
336 |
'a list or list holder which provides the labels assigned to the tabs.' |
|
337 |
||
350 | 338 |
#tabOrientation |
339 |
'where to place the tabs' |
|
294 | 340 |
|
341 |
#tabWidget |
|
367 | 342 |
'select the tab style (windows- or mac look)' |
343 |
||
540 | 344 |
#tabable |
345 |
'if on, the widget can be reached by tabbing.' |
|
346 |
||
367 | 347 |
#translateLabel |
348 |
'if on, the labelString is translated via the resource mechanism to a national language string (if a translation for that string is present in the resource file of the application).' |
|
294 | 349 |
|
350 | 350 |
#typeConverter |
351 |
'convert the fields string value to some other object. Needed if the aspectValue is not a string (typically numbers).' |
|
352 |
||
353 |
#useIndex |
|
354 |
'set/clear the useIndex flag. If set, the index of the selection is stored into the model; otherwise the selected string.' |
|
307 | 355 |
|
367 | 356 |
#usePreferredExtent |
357 |
'Take the top components preferredExtent as extent of the topView. Only possible if there is exactly one top component (typically: a panel).' |
|
358 |
||
294 | 359 |
#valueChangeSelector |
350 | 360 |
'name of a method in the application which is invoked whenever the selection changed. If the selector ends with '':'' the method is invoked with the current selection.' |
294 | 361 |
|
350 | 362 |
#verticalLayout |
363 |
'specifies how components are to be arranged vertically' |
|
294 | 364 |
|
350 | 365 |
#verticalMiniScroller |
366 |
'use a mini-verticalScroller' |
|
303 | 367 |
|
350 | 368 |
#verticalScroller |
369 |
'make the view vertically scrollable' |
|
370 |
||
371 |
#windowIcon |
|
372 |
'aspect of the windows icon. This is supposed to provide a bitmap image, which is displayed by the windowManager if your applications gets iconified.' |
|
346 | 373 |
|
350 | 374 |
#windowIconLabel |
375 |
'the windows icon label. This will be displayed by most windowManagers in the icon if the topView is iconified.' |
|
303 | 376 |
|
350 | 377 |
#windowLabel |
378 |
'the windows label. This will be displayed by the windowManager in the windows frame.' |
|
307 | 379 |
|
172 | 380 |
) |
350 | 381 |
|
540 | 382 |
"Modified: / 1.2.1998 / 15:00:50 / cg" |
172 | 383 |
! ! |
384 |
||
164 | 385 |
!UISpecificationTool class methodsFor:'interface specs'! |
386 |
||
387 |
windowSpec |
|
388 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
389 |
||
390 |
"do not manually edit this - the painter/builder may not be able to |
|
391 |
handle the specification if its corrupted." |
|
392 |
||
393 |
" |
|
394 |
UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec |
|
395 |
UISpecificationTool new openInterface:#windowSpec |
|
396 |
" |
|
397 |
"UISpecificationTool open" |
|
398 |
||
399 |
<resource: #canvas> |
|
400 |
||
401 |
^ |
|
402 |
||
403 |
#(#FullSpec |
|
404 |
#'window:' |
|
405 |
#(#WindowSpec |
|
406 |
#'name:' 'uIPainterView' |
|
407 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
408 |
#'label:' 'unnamed canvas' |
|
409 |
#'bounds:' #(#Rectangle 0 0 300 300) |
|
410 |
) |
|
411 |
#'component:' |
|
412 |
#(#SpecCollection |
|
413 |
#'collection:' |
|
414 |
#( |
|
415 |
#(#ViewSpec |
|
416 |
#'name:' 'Frame' |
|
417 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
418 |
) |
|
419 |
) |
|
420 |
) |
|
421 |
) |
|
422 |
! ! |
|
423 |
||
424 |
!UISpecificationTool methodsFor:'accessing'! |
|
425 |
||
172 | 426 |
specification |
427 |
"gets current edit specification |
|
428 |
" |
|
429 |
^ specification |
|
430 |
||
431 |
||
432 |
! |
|
433 |
||
434 |
specification:aSpec |
|
435 |
"sets current edit specification |
|
436 |
" |
|
428 | 437 |
self releaseResources. |
438 |
||
172 | 439 |
aSpec isNil ifTrue:[ |
428 | 440 |
specChannel notNil ifTrue:[ specChannel release ]. |
441 |
aspects notNil ifTrue:[ aspects release ]. |
|
442 |
||
172 | 443 |
specChannel := nil. |
444 |
specification := nil. |
|
445 |
aspects := nil. |
|
446 |
] ifFalse:[ |
|
447 |
specification class == aSpec class ifTrue:[ |
|
448 |
specification := aSpec. |
|
449 |
^ specChannel value:specification. |
|
450 |
]. |
|
428 | 451 |
specChannel notNil ifTrue:[ specChannel release ]. |
452 |
aspects notNil ifTrue:[ aspects release ]. |
|
453 |
||
172 | 454 |
specification := aSpec. |
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
455 |
|
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
456 |
"/ some tricky specs need the builder |
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
457 |
"/ during the addBindings phase. |
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
458 |
"/ This is passed down in a special UIBindingsDictionary |
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
459 |
"/ (remain backward compatible) |
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
460 |
|
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
461 |
aspects := UISpecification newBindingsDictionary. |
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
462 |
aspects builder:builder. |
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
463 |
|
172 | 464 |
specChannel := specification asValue. |
465 |
specification class addBindingsTo:aspects for:specification channel:specChannel. |
|
466 |
aspects do:[:el| el addDependent:self ]. |
|
467 |
]. |
|
468 |
||
469 |
selection notNil ifTrue:[ |
|
470 |
(builder componentAt:#Frame) destroySubViews. |
|
471 |
selection := nil. |
|
472 |
]. |
|
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
473 |
|
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
474 |
"Modified: / 30.1.1998 / 13:50:51 / cg" |
172 | 475 |
! ! |
476 |
||
477 |
!UISpecificationTool methodsFor:'accessing channels'! |
|
478 |
||
164 | 479 |
modifiedHolder:aValueHolder |
480 |
"set the value holder set to true in case of modifying attributes |
|
481 |
" |
|
482 |
modifiedHolder notNil ifTrue:[ |
|
483 |
modifiedHolder removeDependent:self. |
|
484 |
]. |
|
485 |
||
486 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
|
487 |
modifiedHolder addDependent:self. |
|
488 |
]. |
|
489 |
||
490 |
! ! |
|
491 |
||
364 | 492 |
!UISpecificationTool methodsFor:'actions'! |
493 |
||
494 |
setMaxExtent |
|
495 |
"set the windows maxExtent from its current extent" |
|
496 |
||
497 |
|canvas currentExtent| |
|
498 |
||
499 |
canvas := self masterApplication painter topView. |
|
500 |
currentExtent := canvas extent. |
|
501 |
(self aspectFor:#maxX) value:currentExtent x. |
|
502 |
(self aspectFor:#maxY) value:currentExtent y. |
|
503 |
||
504 |
"Modified: / 29.10.1997 / 18:29:17 / cg" |
|
505 |
! |
|
506 |
||
507 |
setMinExtent |
|
508 |
"set the windows minExtent from its current extent" |
|
509 |
||
510 |
|canvas currentExtent| |
|
511 |
||
512 |
canvas := self masterApplication painter topView. |
|
513 |
currentExtent := canvas extent. |
|
514 |
(self aspectFor:#minX) value:currentExtent x. |
|
515 |
(self aspectFor:#minY) value:currentExtent y. |
|
516 |
||
517 |
"Created: / 29.10.1997 / 18:17:55 / cg" |
|
518 |
"Modified: / 29.10.1997 / 18:28:53 / cg" |
|
519 |
! ! |
|
520 |
||
164 | 521 |
!UISpecificationTool methodsFor:'bindings'! |
522 |
||
523 |
aspectFor:aKey |
|
524 |
"returns aspect for a key or nil |
|
525 |
" |
|
526 |
aspects notNil ifTrue:[ |
|
527 |
^ aspects at:aKey ifAbsent:nil |
|
528 |
]. |
|
529 |
^ super aspectFor:aKey |
|
530 |
||
428 | 531 |
! |
532 |
||
533 |
releaseResources |
|
534 |
"release resources |
|
535 |
" |
|
536 |
|frame appl| |
|
537 |
||
538 |
frame := builder componentAt:#Frame. |
|
539 |
appl := builder application. |
|
540 |
builder := UIBuilder new. |
|
541 |
builder application:appl. |
|
542 |
builder componentAt:#Frame put:frame. |
|
543 |
||
172 | 544 |
! ! |
545 |
||
546 |
!UISpecificationTool methodsFor:'change & update'! |
|
164 | 547 |
|
172 | 548 |
update |
549 |
"reload specification |
|
164 | 550 |
" |
172 | 551 |
specChannel notNil ifTrue:[ |
552 |
specChannel value:specification. |
|
553 |
] |
|
164 | 554 |
|
555 |
||
556 |
! |
|
557 |
||
558 |
update:something with:someArgument from:someone |
|
559 |
"any attribute changed its state in the current specification |
|
560 |
" |
|
561 |
someone ~~ modifiedHolder ifTrue:[ |
|
562 |
modifiedHolder value ~~ true ifTrue:[ |
|
563 |
modifiedHolder value:true |
|
564 |
] |
|
565 |
] |
|
566 |
||
567 |
||
568 |
! ! |
|
569 |
||
570 |
!UISpecificationTool methodsFor:'selection'! |
|
571 |
||
572 |
selection:something |
|
172 | 573 |
"selection changed |
574 |
" |
|
164 | 575 |
|slices idx spec frame| |
576 |
||
172 | 577 |
specification notNil ifTrue:[ |
578 |
slices := specification class slices. |
|
164 | 579 |
idx:= slices findFirst:[:aSlice| aSlice first = something ]. |
580 |
||
581 |
idx ~~ 0 ifTrue:[ |
|
172 | 582 |
spec := specification class perform:((slices at:idx) last). |
428 | 583 |
] |
164 | 584 |
]. |
585 |
||
172 | 586 |
spec ~= selection ifTrue:[ |
428 | 587 |
self releaseResources. |
164 | 588 |
frame := builder componentAt:#Frame. |
589 |
frame destroySubViews. |
|
590 |
||
591 |
spec notNil ifTrue:[ |
|
592 |
builder buildFromSpec:spec in:frame. |
|
593 |
frame allViewBackground:(frame viewBackground). |
|
594 |
frame realizeAllSubViews. |
|
595 |
] |
|
596 |
]. |
|
172 | 597 |
selection := spec. |
164 | 598 |
! ! |
599 |
||
600 |
!UISpecificationTool class methodsFor:'documentation'! |
|
601 |
||
602 |
version |
|
603 |
^ '$Header$' |
|
604 |
! ! |