author | Claus Gittinger <cg@exept.de> |
Wed, 20 May 1998 03:32:54 +0200 | |
changeset 927 | 2e4efdc9bc69 |
parent 922 | 94a40763e3bf |
child 936 | d3d50ac7cdd0 |
permissions | -rw-r--r-- |
756 | 1 |
" |
784 | 2 |
COPYRIGHT (c) 1997 by eXept Software AG |
756 | 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 |
||
753 | 15 |
ApplicationModel subclass:#ToolApplicationModel |
782 | 16 |
instanceVariableNames:'timeBlock' |
753 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
834 | 19 |
category:'Interface-Framework' |
753 | 20 |
! |
21 |
||
850 | 22 |
ToolApplicationModel class instanceVariableNames:'history clipboard settings showHelp' |
753 | 23 |
|
24 |
" |
|
25 |
The following class instance variables are inherited by this class: |
|
26 |
||
27 |
ApplicationModel - ClassResources |
|
28 |
Model - |
|
29 |
Object - |
|
30 |
" |
|
31 |
! |
|
32 |
||
33 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
34 |
||
756 | 35 |
copyright |
36 |
" |
|
784 | 37 |
COPYRIGHT (c) 1997 by eXept Software AG |
756 | 38 |
All Rights Reserved |
39 |
||
40 |
This software is furnished under a license and may be used |
|
41 |
only in accordance with the terms of that license and with the |
|
42 |
inclusion of the above copyright notice. This software may not |
|
43 |
be provided or otherwise made available to, or used by, any |
|
44 |
other person. No title to or ownership of the software is |
|
45 |
hereby transferred. |
|
46 |
" |
|
47 |
||
48 |
||
49 |
! |
|
50 |
||
753 | 51 |
documentation |
52 |
" |
|
869 | 53 |
Framework class for tool applications. |
54 |
Provides hooks for history management, |
|
782 | 55 |
showing help texts, about menu, help menu etc. |
753 | 56 |
|
57 |
[author:] |
|
876 | 58 |
Thomas Zwick, eXept Software AG |
753 | 59 |
" |
60 |
! ! |
|
61 |
||
62 |
!ToolApplicationModel class methodsFor:'accessing'! |
|
63 |
||
800 | 64 |
authorLinesForAboutBox |
907 | 65 |
"extracts the author(s) from the documentation method." |
800 | 66 |
|
67 |
|firstClassWithDocumentation src s line lines| |
|
753 | 68 |
|
800 | 69 |
firstClassWithDocumentation := self class withAllSuperclasses detect:[:metacls| metacls implements:#documentation]. |
70 |
firstClassWithDocumentation notNil ifTrue:[ |
|
71 |
(firstClassWithDocumentation inheritsFrom:ToolApplicationModel class) ifTrue:[ |
|
72 |
src := (firstClassWithDocumentation compiledMethodAt:#documentation) source. |
|
73 |
src notNil ifTrue:[ |
|
74 |
s := src readStream. |
|
75 |
s upToAll:'[author:]'. |
|
76 |
s nextLine. "/ skip to end |
|
77 |
line := s nextLine. "/ line after [author:] |
|
78 |
lines := OrderedCollection new. |
|
79 |
[line notNil and:[line notEmpty]] whileTrue:[ |
|
80 |
line := line trimBlanks. |
|
81 |
line size > 1 ifTrue:[ |
|
82 |
lines add:line trimBlanks. |
|
83 |
line := s nextLine. |
|
84 |
] ifFalse:[ |
|
85 |
line := nil |
|
86 |
] |
|
87 |
]. |
|
88 |
^ lines. |
|
89 |
] |
|
90 |
] |
|
91 |
]. |
|
92 |
^ #('unnown') |
|
93 |
||
94 |
"Created: / 1.2.1998 / 15:41:43 / cg" |
|
95 |
"Modified: / 1.2.1998 / 15:59:10 / cg" |
|
753 | 96 |
! |
97 |
||
98 |
label |
|
907 | 99 |
"returns the label for the tools of this class; |
100 |
extracted from the class name; |
|
101 |
can be redefined in subclasses" |
|
753 | 102 |
|
103 |
|label| |
|
104 |
label := ''. |
|
105 |
self name do: |
|
106 |
[:c| |
|
107 |
c isUppercase ifTrue: [label := label, $ ]. |
|
108 |
label := label, c |
|
109 |
]. |
|
110 |
^label trimBlanks |
|
782 | 111 |
! |
112 |
||
850 | 113 |
settings |
907 | 114 |
"returns the settings dictionary" |
850 | 115 |
|
872 | 116 |
settings isNil ifTrue: [settings := IdentityDictionary new]. |
117 |
^settings |
|
850 | 118 |
! |
119 |
||
782 | 120 |
showHelp |
907 | 121 |
"returns whether the active help is turned on" |
782 | 122 |
|
872 | 123 |
showHelp isNil ifTrue: [showHelp := true]. |
124 |
^showHelp |
|
782 | 125 |
! |
126 |
||
127 |
showHelp: aBoolean |
|
907 | 128 |
"sets the active help on aBoolean" |
782 | 129 |
|
130 |
^showHelp := aBoolean |
|
753 | 131 |
! ! |
132 |
||
756 | 133 |
!ToolApplicationModel class methodsFor:'clipboard'! |
134 |
||
135 |
clipboard |
|
907 | 136 |
"returns the clipboard of this tool class" |
756 | 137 |
|
138 |
^clipboard |
|
139 |
! |
|
140 |
||
141 |
clipboard: anEditObject |
|
907 | 142 |
"sets the clipboard for this tool class" |
756 | 143 |
|
144 |
clipboard := anEditObject |
|
145 |
! ! |
|
146 |
||
762 | 147 |
!ToolApplicationModel class methodsFor:'help specs'! |
148 |
||
149 |
helpSpec |
|
869 | 150 |
"This resource specification was automatically generated |
151 |
by the UIHelpTool of ST/X." |
|
152 |
||
153 |
"Do not manually edit this!! If it is corrupted, |
|
154 |
the UIHelpTool may not be able to read the specification." |
|
762 | 155 |
|
156 |
" |
|
869 | 157 |
UIHelpTool openOnClass:ToolApplicationModel |
762 | 158 |
" |
159 |
||
869 | 160 |
<resource: #help> |
161 |
||
162 |
^super helpSpec addPairsFrom:#( |
|
762 | 163 |
|
823 | 164 |
#about |
834 | 165 |
'About functions.' |
823 | 166 |
|
762 | 167 |
#aboutSTX |
910 | 168 |
'Open an InfoBox showing details of the running ST/X.' |
762 | 169 |
|
170 |
#aboutThisAppliaction |
|
910 | 171 |
'Open an InfoBox about that applications release and its author.' |
762 | 172 |
|
823 | 173 |
#add |
834 | 174 |
'Add functions.' |
823 | 175 |
|
176 |
#commitCancel |
|
910 | 177 |
'Cancels changes.' |
823 | 178 |
|
179 |
#commitOK |
|
910 | 180 |
'Commit changes.' |
823 | 181 |
|
182 |
#edit |
|
834 | 183 |
'Edit functions.' |
823 | 184 |
|
185 |
#editCopy |
|
910 | 186 |
'Copy the selected item(s) to the clipboard.' |
762 | 187 |
|
782 | 188 |
#editCut |
910 | 189 |
'Move the selected item(s) to the clipboard.' |
853 | 190 |
|
191 |
#editDelete |
|
910 | 192 |
'Delete the selected item(s).' |
782 | 193 |
|
823 | 194 |
#editMoveDown |
910 | 195 |
'Moves the selected item one step down in the order list.' |
823 | 196 |
|
197 |
#editMoveIn |
|
834 | 198 |
'Moves the selected item into next item as child item.' |
823 | 199 |
|
200 |
#editMoveOut |
|
910 | 201 |
'Moves the selected item out of its parent item.' |
823 | 202 |
|
203 |
#editMoveUp |
|
910 | 204 |
'Moves the selected item one step up in the order list.' |
782 | 205 |
|
206 |
#editPaste |
|
910 | 207 |
'Paste from the clipboard.' |
782 | 208 |
|
209 |
#editUndo |
|
910 | 210 |
'Undo the last action.' |
782 | 211 |
|
823 | 212 |
#file |
834 | 213 |
'File functions.' |
805 | 214 |
|
823 | 215 |
#fileBrowseClass |
910 | 216 |
'Open a System Browser on the current class and selector.' |
805 | 217 |
|
823 | 218 |
#fileDefineClass |
910 | 219 |
'Open a dialog to define the current class.' |
805 | 220 |
|
221 |
#fileDefineClassAndSelector |
|
910 | 222 |
'Open a dialog to define the current class and selector.' |
805 | 223 |
|
823 | 224 |
#fileExit |
910 | 225 |
'Exit this application.' |
823 | 226 |
|
922 | 227 |
#generate |
228 |
'Code generation.' |
|
229 |
||
823 | 230 |
#help |
834 | 231 |
'Help functions.' |
823 | 232 |
|
876 | 233 |
#helpHelpTool |
910 | 234 |
'Open an HTML-Browser showing the Help Tools documentation.' |
876 | 235 |
|
823 | 236 |
#helpShowHelp |
910 | 237 |
'Toggle display of help texts.' |
823 | 238 |
|
239 |
#helpTutorial |
|
910 | 240 |
'Open an HTML-Browser showing this applications documentation.' |
823 | 241 |
|
242 |
#history |
|
834 | 243 |
'History functions.' |
803 | 244 |
|
245 |
#historyEmptyMenu |
|
910 | 246 |
'Delete all items in the history.' |
803 | 247 |
|
823 | 248 |
#historyMenuItem |
910 | 249 |
'Evaluate the text of the menu item for loading.' |
762 | 250 |
|
893 | 251 |
#settings |
252 |
'Settings functions.' |
|
253 |
||
823 | 254 |
#test |
834 | 255 |
'Test functions.' |
762 | 256 |
|
257 |
) |
|
922 | 258 |
|
259 |
"Modified: / 19.5.1998 / 21:32:01 / cg" |
|
762 | 260 |
! ! |
261 |
||
753 | 262 |
!ToolApplicationModel class methodsFor:'history'! |
263 |
||
264 |
getHistory |
|
907 | 265 |
"returns the history for this tool class" |
753 | 266 |
|
761
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
267 |
history isNil ifTrue: [history := OrderedCollection new]. |
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
268 |
^history |
753 | 269 |
|
270 |
! |
|
271 |
||
272 |
historyMaxSize |
|
907 | 273 |
"returns the maximum size for the history of this tool class" |
753 | 274 |
|
275 |
^10 |
|
276 |
||
277 |
! ! |
|
278 |
||
869 | 279 |
!ToolApplicationModel class methodsFor:'image specs'! |
280 |
||
281 |
copyIcon |
|
282 |
"This resource specification was automatically generated |
|
283 |
by the ImageEditor of ST/X." |
|
284 |
||
285 |
"Do not manually edit this!! If it is corrupted, |
|
286 |
the ImageEditor may not be able to read the specification." |
|
287 |
||
288 |
" |
|
289 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
290 |
" |
|
291 |
||
292 |
<resource: #image> |
|
293 |
||
294 |
^Icon |
|
295 |
constantNamed:#'ToolApplicationModel copyIcon' |
|
296 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@AUUUW@@@A???>@@@A???>O@@A???>@@@A???>@@@@@@?>@EUUU\?>@G???8?>@G???8?>@G???8?>@G???8?>@G???8?>IG???8?>@G???8**MG???8@@@G???8@@KG???8@@@G???8@@@G???8@@HN***(@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@_?<@_?<@_?<@_?<@_?<@_?<???<???<???<???<???<???<???<???<???<???<??8@??8@??8@??8@??8@??8@') ; yourself); yourself]! |
|
297 |
||
298 |
cutIcon |
|
299 |
"This resource specification was automatically generated |
|
300 |
by the ImageEditor of ST/X." |
|
301 |
||
302 |
"Do not manually edit this!! If it is corrupted, |
|
303 |
the ImageEditor may not be able to read the specification." |
|
304 |
||
305 |
" |
|
306 |
ImageEditor openOnClass:self andSelector:#cutIcon |
|
307 |
" |
|
308 |
||
309 |
<resource: #image> |
|
310 |
||
311 |
^Icon |
|
312 |
constantNamed:#'ToolApplicationModel cutIcon' |
|
313 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@DQDQDP0AL@@L@@@SL3L3CBL @B0@@AL3L3LL0B@@3@@@D3L3L0KB@@KB@@@SL3L3LL0@CL@@@AL3L3L0KB@,H@@@D3L3L3LL0L0@@@@SL3L3L0K@0 @@@AL3L3L3LL3@@@@@D3L3L3L03L@@@@@SL3L3L0CL0@@@@AL3L3L3@,CB@@@@D3L3L3@L0L0@@@@2H"H H"0 KBH @@@@@@KL3@@L3LH@@@@@CBCB@@K@K@@@@@@L@LH@@,@L@@@@@@0@0 @B0@0@@@@@CBC@@@C@K@@@@@@@3@@@@@3@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?<@_=\P_=<0_=,0_=50_>5 _>; _?[@_?[@_?.@_?.@_?N@_?[@_>[@_;;8_75<@F1,@D1$@D1$@F ,@C@X@@@@') ; yourself); yourself]! |
|
314 |
||
315 |
deleteIcon |
|
316 |
"This resource specification was automatically generated |
|
317 |
by the ImageEditor of ST/X." |
|
318 |
||
319 |
"Do not manually edit this!! If it is corrupted, |
|
320 |
the ImageEditor may not be able to read the specification." |
|
321 |
||
322 |
" |
|
323 |
ImageEditor openOnClass:self andSelector:#deleteIcon |
|
324 |
" |
|
325 |
||
326 |
<resource: #image> |
|
327 |
||
328 |
^Icon |
|
329 |
constantNamed:#'ToolApplicationModel deleteIcon' |
|
330 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@DQDQDQDQL@@@@@@SL3L3L3L @@@@@AL3L3L3L2@@@@@@D3L3L3L3H@@@H@@SL3L3L3L @@H@@AL3L3L3L2@@@@@@D3L3L3L3@@@@@@@SL3L3L0@ @@@ @AL3L3L3@@@@@@@@D3L3L3L@D@@@H@@SL3L3L0@QL3H @AL3L3L3@A@3LB@@D3L3L3L@DC@0H@@2H"H"H @PLC@ @@@@@@@@@A@0LB@@@@@@@@@@DC@0H@@@@@@@@@@PLC@ @@@@@@@@@A@0LB@@@@@@@@@@DS@2H@@@@@@@@@HAL3HB@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?<@_?<@_?<P_?<P_?<X_?<X_?<H_?0H_?O<_?XL_?_<_?_<_?_<_?_<_?_<_?_<@@_<@@_<@@_<@@_<@@_<@@G0') ; yourself); yourself]! |
|
331 |
||
332 |
desktopIcon |
|
907 | 333 |
"returns the icon used for the desktop" |
869 | 334 |
|
335 |
^Icon |
|
336 |
constantNamed:#'ToolApplicationModel desktopIcon' |
|
337 |
ifAbsentPut: |
|
338 |
[ |
|
339 |
|desktopIcon| |
|
340 |
desktopIcon := self stxIcon. |
|
341 |
desktopIcon magnifiedBy: Display preferredIconSize/desktopIcon extent |
|
342 |
] |
|
343 |
||
344 |
||
345 |
||
346 |
||
347 |
! |
|
348 |
||
349 |
downIcon |
|
350 |
"This resource specification was automatically generated |
|
351 |
by the ImageEditor of ST/X." |
|
352 |
||
353 |
"Do not manually edit this!! If it is corrupted, |
|
354 |
the ImageEditor may not be able to read the specification." |
|
355 |
||
356 |
" |
|
357 |
ImageEditor openOnClass:self andSelector:#downIcon |
|
358 |
" |
|
359 |
||
360 |
<resource: #image> |
|
361 |
||
362 |
^Icon |
|
363 |
constantNamed:#'ToolApplicationModel downIcon' |
|
364 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUT@AUUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUT@*$AUPUT***%UPUU***UUPUUZ*)UUPUUV*%UUPUUU*UUUPUUUYUUUP') ; colorMapFromArray:#[255 255 255 0 0 0 0 127 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@A?>@A?>@@?<@@_8@@O0@@G @@C@@') ; yourself); yourself]! |
|
365 |
||
366 |
downRightIcon |
|
367 |
"This resource specification was automatically generated |
|
368 |
by the ImageEditor of ST/X." |
|
369 |
||
370 |
"Do not manually edit this!! If it is corrupted, |
|
371 |
the ImageEditor may not be able to read the specification." |
|
372 |
||
373 |
" |
|
374 |
ImageEditor openOnClass:self andSelector:#downRightIcon |
|
375 |
" |
|
376 |
||
377 |
<resource: #image> |
|
378 |
||
379 |
^Icon |
|
380 |
constantNamed:#'ToolApplicationModel downRightIcon' |
|
381 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPP@EUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUTEUPR*UUT!!UPR*UUT(UPR*P@@*EPR*****!!PR*****(PR*****)PR*****%PQUUUU*UPUUUUT)UPUUUUT%UPUUUUTUUP') ; colorMapFromArray:#[255 255 255 0 0 0 0 127 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ L@_ N@_ O@_?? _??0_??8_??8_??0_?? @@O@@@N@@@L@') ; yourself); yourself]! |
|
382 |
||
383 |
helpIcon |
|
384 |
"This resource specification was automatically generated |
|
385 |
by the ImageEditor of ST/X." |
|
386 |
||
387 |
"Do not manually edit this!! If it is corrupted, |
|
388 |
the ImageEditor may not be able to read the specification." |
|
389 |
||
390 |
" |
|
391 |
ImageEditor openOnClass:self andSelector:#helpIcon |
|
392 |
" |
|
393 |
||
394 |
<resource: #image> |
|
395 |
||
396 |
^Icon |
|
397 |
constantNamed:#'ToolApplicationModel helpIcon' |
|
398 |
ifAbsentPut:[(Depth1Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@O0A@_8@@?<@@8\C@8\A@@\@@@8@@A8@@C0@@G @@G@@@G@@@G@C@@@@@@@@@G@@@G@@@G@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 127 0 127]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@O0@@_8@@?<@@8\@@8\@@@\@@@8@@A8@@C0@@G @@G@@@G@@@G@@@@@@@@@@@G@@@G@@@G@@@@@@@@@@') ; yourself); yourself]! |
|
399 |
||
400 |
leftDownIcon |
|
401 |
"This resource specification was automatically generated |
|
402 |
by the ImageEditor of ST/X." |
|
403 |
||
404 |
"Do not manually edit this!! If it is corrupted, |
|
405 |
the ImageEditor may not be able to read the specification." |
|
406 |
||
407 |
" |
|
408 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
409 |
" |
|
410 |
||
411 |
<resource: #image> |
|
412 |
||
413 |
^Icon |
|
414 |
constantNamed:#'ToolApplicationModel leftDownIcon' |
|
415 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPU@@@@@@PUJ****)PUJ****)PUJ****)PUJ****)PUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUP@J*@UUUPJ**)UUUPR**%UUUPT**UUUUPUJ)UUUUPUR%UUUUPUTUUUUUPUUUUUUUP') ; colorMapFromArray:#[255 255 255 0 0 0 0 127 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@G??8G??8G??8G??8G??8G??8G8@@G8@@G8@@G8@@G8@@G8@@G8@@??@@??@@_>@@O<@@G8@@C0@@A @@@@@@') ; yourself); yourself]! |
|
416 |
||
417 |
leftIcon |
|
418 |
"This resource specification was automatically generated |
|
419 |
by the ImageEditor of ST/X." |
|
420 |
||
421 |
"Do not manually edit this!! If it is corrupted, |
|
422 |
the ImageEditor may not be able to read the specification." |
|
423 |
||
424 |
" |
|
425 |
ImageEditor openOnClass:self andSelector:#leftIcon |
|
426 |
" |
|
427 |
||
428 |
<resource: #image> |
|
429 |
||
430 |
^Icon |
|
431 |
constantNamed:#'ToolApplicationModel leftIcon' |
|
432 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUTUUUUUPURUUUUUPUJUUUUUPT*P@@@@PR******PJ******PZ******PV******PU*UUUUUPUZUUUUUPUVUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUP') ; colorMapFromArray:#[255 255 255 0 0 0 0 127 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@A @@C @@G @@O??<_??<???<???<_??<O??<G @@C @@A @@@@@@@@@@@@@@@@@@@@@@') ; yourself); yourself]! |
|
433 |
||
434 |
loadIcon |
|
435 |
"This resource specification was automatically generated |
|
436 |
by the ImageEditor of ST/X." |
|
437 |
||
438 |
"Do not manually edit this!! If it is corrupted, |
|
439 |
the ImageEditor may not be able to read the specification." |
|
440 |
||
441 |
" |
|
442 |
ImageEditor openOnClass:self andSelector:#loadIcon |
|
443 |
" |
|
444 |
||
445 |
<resource: #image> |
|
446 |
||
447 |
^Icon |
|
448 |
constantNamed:#'ToolApplicationModel loadIcon' |
|
449 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUU?UPUUUUW*5PU???>*/PU:****)PUUUUUUZPP@@@@@EPS?????&PS?????%PS?????&PS?????%PT?????9PT?????9PT?????9PT?????9PT?????9PT?????9PUO????>PUO????>PUO????>PU:*****PUUUUUUUP') ; colorMapFromArray:#[255 255 255 0 0 0 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@G@@@O G??8O??<O??<_??<???<???<???<???<???<_??<_??<_??<_??<_??<_??<O??<O??<O??<O??<O??<') ; yourself); yourself]! |
|
450 |
||
451 |
menuIcon |
|
907 | 452 |
"returns the icon used for the menu bar" |
869 | 453 |
|
454 |
^Icon |
|
455 |
constantNamed:#'ToolApplicationModel menuIcon' |
|
456 |
ifAbsentPut: |
|
457 |
[ |
|
458 |
|menuIcon| |
|
459 |
menuIcon := self stxIcon. |
|
460 |
menuIcon magnifiedBy: MenuPanel defaultFont height/menuIcon height |
|
461 |
] |
|
462 |
! |
|
463 |
||
464 |
newIcon |
|
465 |
"This resource specification was automatically generated |
|
466 |
by the ImageEditor of ST/X." |
|
467 |
||
468 |
"Do not manually edit this!! If it is corrupted, |
|
469 |
the ImageEditor may not be able to read the specification." |
|
470 |
||
471 |
" |
|
472 |
ImageEditor openOnClass:self andSelector:#newIcon |
|
473 |
" |
|
474 |
||
475 |
<resource: #image> |
|
476 |
||
477 |
^Icon |
|
478 |
constantNamed:#'ToolApplicationModel newIcon' |
|
479 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@AUUUUP@@A????2@@A????2 @A????0@@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@C*****(@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@_??@_?? _??0_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8') ; yourself); yourself]! |
|
480 |
||
481 |
pasteIcon |
|
482 |
"This resource specification was automatically generated |
|
483 |
by the ImageEditor of ST/X." |
|
484 |
||
485 |
"Do not manually edit this!! If it is corrupted, |
|
486 |
the ImageEditor may not be able to read the specification." |
|
487 |
||
488 |
" |
|
489 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
490 |
" |
|
491 |
||
492 |
<resource: #image> |
|
493 |
||
494 |
^Icon |
|
495 |
constantNamed:#'ToolApplicationModel pasteIcon' |
|
496 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@KLH@@@@@@@@@@@CL3@@@@@@@@@@@CBH"0@@@@@@@@QD,3L3BDQ@@@@@ADQDQDQDQD@@@@@DQDQDQDQDP@@@@@@@@@@DQDQ@ADQDQDQDS@QDQD@D3L3L3L3HADQDP@SL3L3L3L DQDQ@AL3L3L3L2@QDQD@D3L3L3L3HADQDP@SL3L3L3L DQDQ@AL3L3L3L2@QDQD@D3L3L3L3HADQDP@SL3L3L3L DQDQ@AL3L3L3L2@QDQD@D3L3L3L3HADQDP@SL3L3L3L DQDQ@AL3L3L3L2@@@@@@L"H"H"H"H@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@<@@@<@@??<@??<@??<@??<???<???<???<???<???<???<???<???<???<???<???<???<???<???<??8@??8@') ; yourself); yourself]! |
|
497 |
||
498 |
rightIcon |
|
499 |
"This resource specification was automatically generated |
|
500 |
by the ImageEditor of ST/X." |
|
501 |
||
502 |
"Do not manually edit this!! If it is corrupted, |
|
503 |
the ImageEditor may not be able to read the specification." |
|
504 |
||
505 |
" |
|
506 |
ImageEditor openOnClass:self andSelector:#rightIcon |
|
507 |
" |
|
508 |
||
509 |
<resource: #image> |
|
510 |
||
511 |
^Icon |
|
512 |
constantNamed:#'ToolApplicationModel rightIcon' |
|
513 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUEUPUUUUUIUPUUUUUJUP@@@@@J%PJ*****)PJ******PJ******PJ*****)PEUUUUZ%PUUUUUJUPUUUUUIUPUUUUUEUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUP') ; colorMapFromArray:#[255 255 255 0 0 0 0 127 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@F@@@G@@@G ???0???8???<???<???8???0@@G @@G@@@F@@@@@@@@@@@@@@@@@@@@@') ; yourself); yourself]! |
|
514 |
||
515 |
saveIcon |
|
516 |
"This resource specification was automatically generated |
|
517 |
by the ImageEditor of ST/X." |
|
518 |
||
519 |
"Do not manually edit this!! If it is corrupted, |
|
520 |
the ImageEditor may not be able to read the specification." |
|
521 |
||
522 |
" |
|
523 |
ImageEditor openOnClass:self andSelector:#saveIcon |
|
524 |
" |
|
525 |
||
526 |
<resource: #image> |
|
527 |
||
528 |
^Icon |
|
529 |
constantNamed:#'ToolApplicationModel saveIcon' |
|
530 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'AL3L3L@PM3L3L0?PML3L3L=PM3L3L0=PML3L3L?PM3L3L0?PML3L3L?PM3L3L0?PML3L3L?PM3L3L0?PML3L3L?PM@@@@@?PO??????PO??????PO??????PO=UUUU?PO=???[?PO=5O?Z?PO=6O?Z?PO=6O?Z?PO=0O?Z?P5U***U5P') ; colorMapFromArray:#[255 255 255 0 0 0 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???8') ; yourself); yourself]! |
|
531 |
||
532 |
startIcon |
|
533 |
"This resource specification was automatically generated |
|
534 |
by the ImageEditor of ST/X." |
|
535 |
||
536 |
"Do not manually edit this!! If it is corrupted, |
|
537 |
the ImageEditor may not be able to read the specification." |
|
538 |
||
539 |
" |
|
540 |
ImageEditor openOnClass:self andSelector:#startIcon |
|
541 |
" |
|
542 |
||
543 |
<resource: #image> |
|
544 |
||
545 |
^Icon |
|
546 |
constantNamed:#'ToolApplicationModel startIcon' |
|
547 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@N8@@@@@@@@@@@@N<^@@@@@@@@@@@@;.;.;.;.@@@@@@C/G @@@@8^@@@@@N<^@@@@@A@@@@@@;18@@@@@D@@@@@C.;.;.; @P@@@@@N<^@@@@@@@@@@@@;18@@@C!!G.@@@@C/G @@@@G>@@@@@N;.;.; @_8@@@@@;18@@@@A? @@@@C/G @@@@G>@@@@@N<^@@@@@_8@@@@@;.;.;.@A? @@@@C/G @@@@G>@@@@@N<^@@@@@_8@@@@@;18@@@@@@@@@@@C.; @@@@DQ@@@@C ; 8@@@A&X@@@C 8@8N@@@"H"@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@AC@DAG DAG?<@G N@G N@G N@G?.@G N@G _@G _@G?_@G _@G _@G _@G?_@G ? G!!?0G!!?0G!!.PKQNPT(_@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself]! |
|
548 |
||
549 |
stxIcon |
|
550 |
"This resource specification was automatically generated |
|
551 |
by the ImageEditor of ST/X." |
|
552 |
||
553 |
"Do not manually edit this!! If it is corrupted, |
|
554 |
the ImageEditor may not be able to read the specification." |
|
555 |
||
556 |
" |
|
557 |
ImageEditor openOnClass:self andSelector:#stxIcon |
|
558 |
" |
|
559 |
||
560 |
<resource: #image> |
|
561 |
||
562 |
^Icon |
|
563 |
constantNamed:#'ToolApplicationModel stxIcon' |
|
564 |
ifAbsentPut:[(Depth2Image new) width: 48; height: 48; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@U@@@@@@@AP@@@@@AUP@@@@@@E@@@@@@AUP@@@@@@T@@@@@@AUP@@@@@EP@@@@@@AUP@@@@@DP@@@@@@AUD@@@@AU@@@@@@@@UT@@@@@T@@@@@@@@UT@@@@QP@@@@@@@@EU@@@@U@@@@@@@@@AU@@@AD@@@@@@@@@ATP@@UP@@@@@@@@@AUP@@Q@@@@@@@@@@@UT@AD@@@@@@@@@@@AQ@DP@@@@@@@@@@@EU@Q@@@@@@@@@@@@ATQT@@@@@@@@@@@@AUTP@@@@@@@@@@@@@EPP@@@@@@@@@@@@@QU@@@@@@@@@@@@@@EU@@@@@@@@@@@@@@UT@@@@@@@@@@@@@AUE@@@@@@@@@@@@@EUU@@@@@@@@@@@@@UPEP@@@@@@@@@@@AUPAT@@@@@@@@@@@EE@AU@@@@@@@@@@AET@@E@@@@@@@@@@AUP@@EP@@@@@@@@@UU@@@AP@@@@@@@@AUP@@@AT@@@@@@@@EUP@@@@T@@@@@@@AUU@@@@@E@@@@@@@EUT@@@@@DP@@@@@@UUP@@@@@AP@@@@@@UUP@@@@@@T@@@@@@UU@@@@@@@E@@@@@@ET@@@@@@@A@@@@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[25 25 25 0 204 51 0 0 0 255 255 255]; yourself]! |
|
565 |
||
566 |
upIcon |
|
567 |
"This resource specification was automatically generated |
|
568 |
by the ImageEditor of ST/X." |
|
569 |
||
570 |
"Do not manually edit this!! If it is corrupted, |
|
571 |
the ImageEditor may not be able to read the specification." |
|
572 |
||
573 |
" |
|
574 |
ImageEditor openOnClass:self andSelector:#upIcon |
|
575 |
" |
|
576 |
||
577 |
<resource: #image> |
|
578 |
||
579 |
^Icon |
|
580 |
constantNamed:#'ToolApplicationModel upIcon' |
|
581 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUQUUUPUUUJUUUPUUT*%UUPUUR*)UUPUUJ**UUPUT***%UPUTV*%UUPUUT*%UUPUUT*%UUP_UT*%UUP_UT*%UUP_5T*%UUPWUT*%UUPWWT*%UUPWUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUTUUUUP') ; colorMapFromArray:#[255 255 255 0 0 0 0 127 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@C@@@G @@O0@@_8@@?<@A?>@A?>@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@') ; yourself); yourself]! ! |
|
582 |
||
753 | 583 |
!ToolApplicationModel class methodsFor:'interface specs'! |
584 |
||
797 | 585 |
windowSpecForCommit |
869 | 586 |
"This resource specification was automatically generated |
587 |
by the UIPainter of ST/X." |
|
588 |
||
589 |
"Do not manually edit this!! If it is corrupted, |
|
590 |
the UIPainter may not be able to read the specification." |
|
591 |
||
592 |
" |
|
593 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit |
|
594 |
ToolApplicationModel new openInterface:#windowSpecForCommit |
|
595 |
" |
|
797 | 596 |
|
597 |
<resource: #canvas> |
|
598 |
||
599 |
^ |
|
859 | 600 |
|
797 | 601 |
#(#FullSpec |
859 | 602 |
#window: |
797 | 603 |
#(#WindowSpec |
859 | 604 |
#name: 'Commit Buttons' |
869 | 605 |
#layout: #(#LayoutFrame 344 0 371 0 643 0 430 0) |
859 | 606 |
#label: 'Commit Buttons' |
607 |
#min: #(#Point 100 22) |
|
608 |
#max: #(#Point 1152 900) |
|
869 | 609 |
#bounds: #(#Rectangle 344 371 644 431) |
859 | 610 |
#usePreferredExtent: false |
797 | 611 |
) |
859 | 612 |
#component: |
797 | 613 |
#(#SpecCollection |
859 | 614 |
#collection: |
797 | 615 |
#( |
616 |
#(#ActionButtonSpec |
|
859 | 617 |
#name: 'cancelButton' |
618 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
619 |
#activeHelpKey: #commitCancel |
|
620 |
#label: 'Cancel' |
|
927 | 621 |
#translateLabel: true |
859 | 622 |
#tabable: true |
623 |
#model: #cancel |
|
624 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 625 |
) |
626 |
#(#ActionButtonSpec |
|
859 | 627 |
#name: 'okButton' |
628 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
629 |
#activeHelpKey: #commitOK |
|
630 |
#label: 'OK' |
|
927 | 631 |
#translateLabel: true |
859 | 632 |
#tabable: true |
633 |
#model: #accept |
|
634 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 635 |
) |
636 |
) |
|
637 |
) |
|
638 |
) |
|
927 | 639 |
|
640 |
"Modified: / 20.5.1998 / 03:31:54 / cg" |
|
797 | 641 |
! |
642 |
||
643 |
windowSpecForCommitWithoutChannels |
|
869 | 644 |
"This resource specification was automatically generated |
645 |
by the UIPainter of ST/X." |
|
646 |
||
647 |
"Do not manually edit this!! If it is corrupted, |
|
648 |
the UIPainter may not be able to read the specification." |
|
649 |
||
650 |
" |
|
651 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels |
|
652 |
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels |
|
653 |
" |
|
797 | 654 |
|
655 |
<resource: #canvas> |
|
656 |
||
657 |
^ |
|
859 | 658 |
|
797 | 659 |
#(#FullSpec |
859 | 660 |
#window: |
797 | 661 |
#(#WindowSpec |
859 | 662 |
#name: 'Commit Buttons Without Channels' |
869 | 663 |
#layout: #(#LayoutFrame 500 0 326 0 799 0 385 0) |
859 | 664 |
#label: 'Commit Buttons Without Channels' |
665 |
#min: #(#Point 100 22) |
|
666 |
#max: #(#Point 1152 900) |
|
869 | 667 |
#bounds: #(#Rectangle 500 326 800 386) |
859 | 668 |
#usePreferredExtent: false |
797 | 669 |
) |
859 | 670 |
#component: |
797 | 671 |
#(#SpecCollection |
859 | 672 |
#collection: |
797 | 673 |
#( |
674 |
#(#ActionButtonSpec |
|
859 | 675 |
#name: 'cancelButton' |
676 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
677 |
#activeHelpKey: #commitCancel |
|
678 |
#label: 'Cancel' |
|
927 | 679 |
#translateLabel: true |
859 | 680 |
#tabable: true |
681 |
#model: #cancel |
|
797 | 682 |
) |
683 |
#(#ActionButtonSpec |
|
859 | 684 |
#name: 'okButton' |
685 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
686 |
#activeHelpKey: #commitOK |
|
687 |
#label: 'OK' |
|
927 | 688 |
#translateLabel: true |
859 | 689 |
#tabable: true |
690 |
#model: #accept |
|
797 | 691 |
) |
692 |
) |
|
693 |
) |
|
694 |
) |
|
927 | 695 |
|
696 |
"Modified: / 20.5.1998 / 03:30:09 / cg" |
|
797 | 697 |
! |
698 |
||
699 |
windowSpecForInfoBar |
|
869 | 700 |
"This resource specification was automatically generated |
701 |
by the UIPainter of ST/X." |
|
702 |
||
703 |
"Do not manually edit this!! If it is corrupted, |
|
704 |
the UIPainter may not be able to read the specification." |
|
705 |
||
706 |
" |
|
707 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar |
|
708 |
ToolApplicationModel new openInterface:#windowSpecForInfoBar |
|
709 |
" |
|
797 | 710 |
|
711 |
<resource: #canvas> |
|
712 |
||
713 |
^ |
|
859 | 714 |
|
797 | 715 |
#(#FullSpec |
859 | 716 |
#window: |
797 | 717 |
#(#WindowSpec |
859 | 718 |
#name: 'Info Bar' |
869 | 719 |
#layout: #(#LayoutFrame 233 0 218 0 732 0 563 0) |
859 | 720 |
#label: 'Info Bar' |
721 |
#min: #(#Point 400 320) |
|
722 |
#max: #(#Point 1152 900) |
|
869 | 723 |
#bounds: #(#Rectangle 233 218 733 564) |
859 | 724 |
#menu: #menu |
725 |
#usePreferredExtent: false |
|
797 | 726 |
) |
859 | 727 |
#component: |
797 | 728 |
#(#SpecCollection |
859 | 729 |
#collection: |
797 | 730 |
#( |
820 | 731 |
#(#ViewSpec |
859 | 732 |
#name: 'view' |
733 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
734 |
#component: |
|
820 | 735 |
#(#SpecCollection |
859 | 736 |
#collection: |
820 | 737 |
#( |
738 |
#(#LabelSpec |
|
859 | 739 |
#name: 'infoLabel' |
740 |
#layout: #(#LayoutFrame 2 0.0 1 0.0 -1 1.0 -1 1.0) |
|
741 |
#labelChannel: #valueOfInfoLabel |
|
742 |
#level: -1 |
|
743 |
#adjust: #left |
|
869 | 744 |
#resizeForLabel: false |
820 | 745 |
) |
746 |
) |
|
747 |
) |
|
797 | 748 |
) |
749 |
) |
|
750 |
) |
|
751 |
) |
|
752 |
! |
|
753 |
||
754 |
windowSpecForInfoBarWithClock |
|
869 | 755 |
"This resource specification was automatically generated |
756 |
by the UIPainter of ST/X." |
|
757 |
||
758 |
"Do not manually edit this!! If it is corrupted, |
|
759 |
the UIPainter may not be able to read the specification." |
|
760 |
||
761 |
" |
|
762 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBarWithClock |
|
763 |
ToolApplicationModel new openInterface:#windowSpecForInfoBarWithClock |
|
764 |
" |
|
797 | 765 |
|
766 |
<resource: #canvas> |
|
767 |
||
768 |
^ |
|
859 | 769 |
|
797 | 770 |
#(#FullSpec |
859 | 771 |
#window: |
797 | 772 |
#(#WindowSpec |
859 | 773 |
#name: 'Info Bar' |
872 | 774 |
#layout: #(#LayoutFrame 160 0 423 0 659 0 453 0) |
859 | 775 |
#label: 'Info Bar' |
776 |
#min: #(#Point 400 320) |
|
777 |
#max: #(#Point 1152 900) |
|
872 | 778 |
#bounds: #(#Rectangle 160 423 660 454) |
859 | 779 |
#menu: #menu |
780 |
#usePreferredExtent: false |
|
797 | 781 |
) |
859 | 782 |
#component: |
797 | 783 |
#(#SpecCollection |
859 | 784 |
#collection: |
797 | 785 |
#( |
820 | 786 |
#(#ViewSpec |
859 | 787 |
#name: 'view' |
788 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
789 |
#component: |
|
820 | 790 |
#(#SpecCollection |
859 | 791 |
#collection: |
820 | 792 |
#( |
793 |
#(#LabelSpec |
|
859 | 794 |
#name: 'infoLabel' |
795 |
#layout: #(#LayoutFrame 2 0 1 0.0 -81 1 -1 1.0) |
|
796 |
#labelChannel: #valueOfInfoLabel |
|
797 |
#level: -1 |
|
798 |
#adjust: #left |
|
872 | 799 |
#resizeForLabel: false |
820 | 800 |
) |
801 |
#(#LabelSpec |
|
859 | 802 |
#name: 'timeLabel' |
803 |
#layout: #(#LayoutFrame -79 1 1 0.0 -1 1.0 -1 1.0) |
|
804 |
#labelChannel: #valueOfTimeLabel |
|
805 |
#level: -1 |
|
806 |
#adjust: #right |
|
872 | 807 |
#resizeForLabel: false |
820 | 808 |
) |
809 |
) |
|
810 |
) |
|
797 | 811 |
) |
812 |
) |
|
813 |
) |
|
814 |
) |
|
815 |
! ! |
|
816 |
||
817 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
818 |
||
753 | 819 |
menuAbout |
869 | 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:ToolApplicationModel andSelector:#menuAbout |
|
828 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp |
|
829 |
" |
|
753 | 830 |
|
831 |
<resource: #menu> |
|
832 |
||
833 |
^ |
|
859 | 834 |
|
753 | 835 |
#(#Menu |
836 |
||
837 |
#( |
|
838 |
#(#MenuItem |
|
859 | 839 |
#label: 'About Smalltalk/X...' |
840 |
#translateLabel: true |
|
841 |
#value: #openAbout |
|
842 |
#activeHelpKey: #aboutSTX |
|
753 | 843 |
) |
844 |
#(#MenuItem |
|
859 | 845 |
#label: '-' |
753 | 846 |
) |
847 |
#(#MenuItem |
|
922 | 848 |
#label: 'About this Application...' |
859 | 849 |
#translateLabel: true |
850 |
#value: #openAboutThisApplication |
|
851 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 852 |
) |
853 |
) nil |
|
854 |
nil |
|
855 |
) |
|
922 | 856 |
|
857 |
"Modified: / 19.5.1998 / 21:44:09 / cg" |
|
753 | 858 |
! |
859 |
||
869 | 860 |
menuFont |
861 |
"This resource specification was automatically generated |
|
862 |
by the MenuEditor of ST/X." |
|
863 |
||
864 |
"Do not manually edit this!! If it is corrupted, |
|
865 |
the MenuEditor may not be able to read the specification." |
|
866 |
||
867 |
" |
|
868 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuFont |
|
869 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuFont)) startUp |
|
870 |
" |
|
871 |
||
872 |
<resource: #menu> |
|
873 |
||
874 |
^ |
|
875 |
||
876 |
#(#Menu |
|
877 |
||
878 |
#( |
|
879 |
#(#MenuItem |
|
872 | 880 |
#label: 'Label...' |
869 | 881 |
#value: #chooseFont: |
882 |
#argument: 'Label Font' |
|
883 |
) |
|
884 |
#(#MenuItem |
|
872 | 885 |
#label: 'Button...' |
869 | 886 |
#value: #chooseFont: |
887 |
#argument: 'Button Font' |
|
888 |
) |
|
889 |
#(#MenuItem |
|
872 | 890 |
#label: 'Edit...' |
869 | 891 |
#value: #chooseFont: |
892 |
#argument: 'Edit Font' |
|
893 |
) |
|
894 |
#(#MenuItem |
|
872 | 895 |
#label: 'List...' |
869 | 896 |
#value: #chooseFont: |
897 |
#argument: 'List Font' |
|
898 |
) |
|
899 |
#(#MenuItem |
|
872 | 900 |
#label: 'Tree List...' |
869 | 901 |
#value: #chooseFont: |
902 |
#argument: 'Tree List Font' |
|
903 |
) |
|
904 |
#(#MenuItem |
|
872 | 905 |
#label: 'Note Book...' |
906 |
#value: #chooseFont: |
|
907 |
#argument: 'Note Book Font' |
|
908 |
) |
|
909 |
#(#MenuItem |
|
910 |
#label: 'Framed Box...' |
|
911 |
#value: #chooseFont: |
|
912 |
#argument: 'Framed Box Font' |
|
913 |
) |
|
914 |
#(#MenuItem |
|
869 | 915 |
#label: '-' |
916 |
) |
|
917 |
#(#MenuItem |
|
872 | 918 |
#label: 'Reset' |
869 | 919 |
#value: #resetFonts |
920 |
) |
|
921 |
) nil |
|
922 |
nil |
|
923 |
) |
|
924 |
! |
|
925 |
||
753 | 926 |
menuHelp |
869 | 927 |
"This resource specification was automatically generated |
928 |
by the MenuEditor of ST/X." |
|
929 |
||
930 |
"Do not manually edit this!! If it is corrupted, |
|
931 |
the MenuEditor may not be able to read the specification." |
|
932 |
||
933 |
" |
|
934 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp |
|
935 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp |
|
936 |
" |
|
753 | 937 |
|
938 |
<resource: #menu> |
|
939 |
||
940 |
^ |
|
859 | 941 |
|
753 | 942 |
#(#Menu |
943 |
||
944 |
#( |
|
945 |
#(#MenuItem |
|
876 | 946 |
#label: 'Documentation' |
859 | 947 |
#translateLabel: true |
948 |
#value: #openDocumentation |
|
949 |
#activeHelpKey: #helpTutorial |
|
907 | 950 |
#enabled: #valueOfHavingDocumentation |
753 | 951 |
) |
952 |
#(#MenuItem |
|
859 | 953 |
#label: '-' |
753 | 954 |
) |
955 |
#(#MenuItem |
|
859 | 956 |
#label: 'Show Help Texts' |
957 |
#translateLabel: true |
|
958 |
#activeHelpKey: #helpShowHelp |
|
959 |
#indication: #showHelp: |
|
753 | 960 |
) |
961 |
) nil |
|
962 |
nil |
|
963 |
) |
|
964 |
! ! |
|
965 |
||
907 | 966 |
!ToolApplicationModel class methodsFor:'queries'! |
967 |
||
968 |
isVisualStartable |
|
969 |
"returns whether this application class can be started via #open" |
|
970 |
||
971 |
self == ToolApplicationModel ifTrue:[^false]. |
|
972 |
^super isVisualStartable |
|
973 |
||
974 |
! ! |
|
975 |
||
782 | 976 |
!ToolApplicationModel class methodsFor:'startup / release'! |
753 | 977 |
|
782 | 978 |
preSnapshot |
907 | 979 |
"removes the clipboard before snap shoting" |
753 | 980 |
|
782 | 981 |
clipboard := nil |
753 | 982 |
! |
983 |
||
782 | 984 |
uninitialize |
907 | 985 |
"resets the class instance variables" |
760 | 986 |
|
869 | 987 |
settings := showHelp := history := clipboard := nil |
753 | 988 |
! ! |
989 |
||
782 | 990 |
!ToolApplicationModel methodsFor:'aspects'! |
991 |
||
822 | 992 |
valueOfCanCopy |
907 | 993 |
"returns whether can copy as value holder" |
822 | 994 |
|
995 |
|holder| |
|
996 |
(holder := builder bindingAt:#valueOfCanCopy) isNil ifTrue:[ |
|
997 |
builder aspectAt:#valueOfCanCopy put:(holder := false asValue). |
|
998 |
]. |
|
999 |
^ holder |
|
1000 |
||
1001 |
! |
|
1002 |
||
1003 |
valueOfCanCut |
|
907 | 1004 |
"returns whether can paste as value holder" |
822 | 1005 |
|
1006 |
|holder| |
|
1007 |
(holder := builder bindingAt:#valueOfCanCut) isNil ifTrue:[ |
|
1008 |
builder aspectAt:#valueOfCanCut put:(holder := false asValue). |
|
1009 |
]. |
|
1010 |
^ holder |
|
1011 |
||
1012 |
! |
|
1013 |
||
1014 |
valueOfCanPaste |
|
907 | 1015 |
"returns whether can paste as value holder" |
822 | 1016 |
|
1017 |
|holder| |
|
1018 |
(holder := builder bindingAt:#valueOfCanPaste) isNil ifTrue:[ |
|
1019 |
builder aspectAt:#valueOfCanPaste put:(holder := false asValue). |
|
1020 |
]. |
|
1021 |
^ holder |
|
1022 |
||
1023 |
! |
|
1024 |
||
1025 |
valueOfCanUndo |
|
907 | 1026 |
"returns whether can undo as value holder" |
822 | 1027 |
|
1028 |
|holder| |
|
1029 |
(holder := builder bindingAt:#valueOfCanUndo) isNil ifTrue:[ |
|
1030 |
builder aspectAt:#valueOfCanUndo put:(holder := false asValue). |
|
1031 |
]. |
|
1032 |
^ holder |
|
1033 |
||
1034 |
! |
|
1035 |
||
782 | 1036 |
valueOfEnablingCommitButtons |
907 | 1037 |
"returns the enabling of the commit of this tool as value holder" |
753 | 1038 |
|
782 | 1039 |
|holder| |
1040 |
(holder := builder bindingAt:#valueOfEnablingCommitButtons) isNil ifTrue:[ |
|
1041 |
builder aspectAt:#valueOfEnablingCommitButtons put:(holder := false asValue). |
|
1042 |
]. |
|
1043 |
^ holder |
|
753 | 1044 |
|
782 | 1045 |
! |
1046 |
||
858 | 1047 |
valueOfHavingDocumentation |
907 | 1048 |
"returns whether there is a documentation method for this tool as value holder" |
803 | 1049 |
|
1050 |
|holder| |
|
858 | 1051 |
(holder := builder bindingAt:#valueOfHavingDocumentation) isNil ifTrue:[ |
1052 |
builder aspectAt:#valueOfHavingDocumentation put:(holder := (self class implements: #openDocumentation) asValue). |
|
803 | 1053 |
]. |
1054 |
^ holder |
|
1055 |
||
1056 |
! |
|
1057 |
||
782 | 1058 |
valueOfInfoLabel |
907 | 1059 |
"returns the info label as value holder" |
782 | 1060 |
|
1061 |
|holder| |
|
1062 |
(holder := builder bindingAt:#valueOfInfoLabel) isNil ifTrue:[ |
|
1063 |
builder aspectAt:#valueOfInfoLabel put:(holder := ValueHolder new). |
|
1064 |
]. |
|
1065 |
^ holder |
|
753 | 1066 |
|
782 | 1067 |
! |
1068 |
||
1069 |
valueOfTimeLabel |
|
907 | 1070 |
"returns the time label as value holder" |
753 | 1071 |
|
782 | 1072 |
|holder| |
1073 |
(holder := builder bindingAt:#valueOfTimeLabel) isNil ifTrue:[ |
|
1074 |
builder aspectAt:#valueOfTimeLabel put:(holder := ValueHolder new). |
|
1075 |
]. |
|
1076 |
^ holder |
|
753 | 1077 |
|
1078 |
! ! |
|
1079 |
||
782 | 1080 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 1081 |
|
838 | 1082 |
clipboard |
907 | 1083 |
"returns the clipboard" |
838 | 1084 |
|
1085 |
^self class clipboard |
|
1086 |
! |
|
1087 |
||
782 | 1088 |
clipboard: anEditObject |
907 | 1089 |
"sets the clipboard and the value holder for can pasting" |
753 | 1090 |
|
782 | 1091 |
self class clipboard: anEditObject. |
753 | 1092 |
|
869 | 1093 |
self valueOfCanPaste value: anEditObject notNil |
782 | 1094 |
! ! |
1095 |
||
1096 |
!ToolApplicationModel methodsFor:'help'! |
|
753 | 1097 |
|
762 | 1098 |
defaultInfoLabel |
907 | 1099 |
"returns the default info label; here an empty string" |
762 | 1100 |
|
1101 |
^'' |
|
1102 |
! |
|
1103 |
||
753 | 1104 |
openAbout |
907 | 1105 |
"opens an about box" |
753 | 1106 |
|
1107 |
|box| |
|
1108 |
||
1109 |
box := AboutBox new. |
|
1110 |
box autoHideAfter:10 with:[]. |
|
1111 |
box showAtCenter |
|
1112 |
||
1113 |
! |
|
1114 |
||
1115 |
openAboutThisApplication |
|
907 | 1116 |
"opens an about this application box" |
753 | 1117 |
|
1118 |
|rev box| |
|
1119 |
rev := ''. |
|
1120 |
self class revision notNil ifTrue: [rev := ' (rev: ', self class revision printString, ')']. |
|
1121 |
box := AboutBox title: |
|
800 | 1122 |
'\The application\\' withCRs |
850 | 1123 |
, self class name asBoldText, rev |
1124 |
, '\\has been designed and implemented by: \' withCRs |
|
1125 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
|
800 | 1126 |
, '\\' withCRs. |
753 | 1127 |
|
1128 |
box label:'About This Application'. |
|
1129 |
box autoHideAfter:10 with:[]. |
|
1130 |
box showAtCenter. |
|
1131 |
! |
|
1132 |
||
858 | 1133 |
openHTMLDocument: aHTMLFilename |
907 | 1134 |
"opens a HTML browser on aHTMLFilename" |
858 | 1135 |
|
1136 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
1137 |
! |
|
1138 |
||
782 | 1139 |
showHelp |
907 | 1140 |
"returns whether showing help is turned on/off" |
782 | 1141 |
|
783 | 1142 |
|currentActiveHelp| |
858 | 1143 |
|
783 | 1144 |
currentActiveHelp := ActiveHelp currentHelpListener. |
1145 |
||
1146 |
^self class showHelp |
|
858 | 1147 |
and: [currentActiveHelp notNil and: [masterApplication notNil |
1148 |
ifFalse: [currentActiveHelp interestedIn: self window] |
|
1149 |
ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
|
782 | 1150 |
! |
1151 |
||
1152 |
showHelp: aValue |
|
907 | 1153 |
"toggles showing help" |
782 | 1154 |
|
1155 |
(self class showHelp: aValue) |
|
1156 |
ifTrue: [ActiveHelp startFor: self] |
|
822 | 1157 |
ifFalse: [ActiveHelp stopFor: self. self updateInfoLabel] |
782 | 1158 |
! |
1159 |
||
762 | 1160 |
showHelp:aHelpText for:view |
907 | 1161 |
"displays aHelpText in the info label or if present detours it to its masterApplication" |
762 | 1162 |
|
782 | 1163 |
self showHelp ifFalse: [^true]. |
876 | 1164 |
masterApplication notNil ifTrue: [masterApplication showHelp: aHelpText for:view]. |
1165 |
aHelpText isNil |
|
1166 |
ifTrue: [self updateInfoLabel] |
|
1167 |
ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)]. |
|
1168 |
^true |
|
822 | 1169 |
! |
1170 |
||
1171 |
updateInfoLabel |
|
907 | 1172 |
"updates the info label at the bottom" |
822 | 1173 |
|
1174 |
self valueOfInfoLabel value: self defaultInfoLabel |
|
762 | 1175 |
! ! |
1176 |
||
753 | 1177 |
!ToolApplicationModel methodsFor:'history'! |
1178 |
||
1179 |
addToHistory: aHistoryEntry |
|
907 | 1180 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
1181 |
and checks for maximum size of the history" |
|
753 | 1182 |
|
782 | 1183 |
aHistoryEntry key size = 0 ifTrue: [^nil]. |
753 | 1184 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
1185 |
self history addFirst: aHistoryEntry. |
|
1186 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1187 |
! |
|
1188 |
||
1189 |
emptyHistory |
|
907 | 1190 |
"removes all history entries" |
753 | 1191 |
|
1192 |
^self history removeAll |
|
1193 |
! |
|
1194 |
||
1195 |
history |
|
907 | 1196 |
"returns the history from tool class" |
753 | 1197 |
|
1198 |
^self class getHistory |
|
1199 |
! |
|
1200 |
||
844 | 1201 |
historyEntries |
907 | 1202 |
"returns the history entries, i.e. the evaluatable values containing the information" |
844 | 1203 |
|
1204 |
^self history collect: [:asso| asso key] |
|
1205 |
! |
|
1206 |
||
753 | 1207 |
menuHistory |
907 | 1208 |
"returns a history submenu" |
753 | 1209 |
|
893 | 1210 |
|menu| |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1211 |
|
753 | 1212 |
menu := Menu new receiver: self. |
1213 |
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do: |
|
1214 |
[:historyEntryType| |
|
893 | 1215 |
menu addItemGroup: ((self history select: [:histEntry| histEntry value = historyEntryType]) collect: [:histEntry| MenuItem new label: histEntry key printString; value: histEntry value; argument: histEntry key; activeHelpKey: #historyMenuItem]). |
753 | 1216 |
]. |
1217 |
||
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1218 |
menu addItem: (MenuItem new |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1219 |
label: 'Empty History'; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1220 |
value: #emptyHistory; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1221 |
activeHelpKey: #historyEmptyMenu; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1222 |
translateLabel:true). |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1223 |
|
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1224 |
menu findGuiResourcesIn:self. |
753 | 1225 |
^menu |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1226 |
|
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1227 |
"Modified: / 19.5.1998 / 19:17:34 / cg" |
753 | 1228 |
! |
1229 |
||
1230 |
removeFromHistory: aHistoryEntry |
|
907 | 1231 |
"removes aHistoryEntry from the history" |
753 | 1232 |
|
1233 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
1234 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1235 |
! ! |
|
1236 |
||
782 | 1237 |
!ToolApplicationModel methodsFor:'queries'! |
1238 |
||
876 | 1239 |
allToolInstances |
907 | 1240 |
"returns all instances of this tool class" |
876 | 1241 |
|
1242 |
^self class settings at: #Instances ifAbsent: [^#()] |
|
1243 |
! |
|
1244 |
||
782 | 1245 |
preferredExtent |
1246 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
1247 |
will be considered" |
|
1248 |
||
1249 |
|window menu menuToolbarView preferredExtentOfWindow| |
|
1250 |
||
1251 |
window := self builder window. |
|
1252 |
menu := window subViews first. |
|
1253 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
1254 |
||
1255 |
preferredExtentOfWindow := window extent. |
|
1256 |
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent]. |
|
1257 |
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent]. |
|
1258 |
||
1259 |
^window minExtent max: (preferredExtentOfWindow min: window maxExtent) |
|
1260 |
! ! |
|
1261 |
||
869 | 1262 |
!ToolApplicationModel methodsFor:'settings'! |
1263 |
||
872 | 1264 |
allFontViewsDo: aBlock |
892 | 1265 |
"evaluates aBlock for all views with fonts" |
872 | 1266 |
|
1267 |
|fontViews| |
|
1268 |
||
1269 |
fontViews := OrderedCollection new. |
|
1270 |
||
1271 |
self builder windowGroup views do: [:v| v class = MenuPanel ifTrue: [fontViews add: v]]. |
|
1272 |
||
1273 |
builder namedComponents do: |
|
1274 |
[:aView| |
|
1275 |
aView allSubViewsDo: |
|
1276 |
[:v| |
|
1277 |
v font notNil ifTrue: [fontViews add: v] |
|
1278 |
] |
|
1279 |
]. |
|
1280 |
fontViews do: aBlock |
|
1281 |
! |
|
1282 |
||
869 | 1283 |
chooseFont: viewFont |
892 | 1284 |
"chooses a font for viewFont and puts it into the settings dictionary; |
869 | 1285 |
finally update all my views" |
1286 |
||
1287 |
|defaultFont font| |
|
1288 |
||
872 | 1289 |
viewFont = 'Label Font' ifTrue: [defaultFont := Label defaultFont]. |
1290 |
viewFont = 'Button Font' ifTrue: [defaultFont := Button defaultFont]. |
|
1291 |
viewFont = 'Edit Font' ifTrue: [defaultFont := TextView defaultFont]. |
|
1292 |
viewFont = 'List Font' ifTrue: [defaultFont := ListView defaultFont]. |
|
1293 |
viewFont = 'Tree List Font' ifTrue: [defaultFont := SelectionInTreeView defaultFont]. |
|
892 | 1294 |
viewFont = 'Note Book Font' ifTrue: [defaultFont := NoteBookView defaultFont]. |
872 | 1295 |
viewFont = 'Framed Box Font' ifTrue: [defaultFont := FramedBox defaultFont]. |
869 | 1296 |
|
1297 |
(font := FontPanel |
|
1298 |
fontFromUserInitial: (self class settings at: viewFont asSymbol ifAbsent: nil) ? defaultFont |
|
1299 |
title: 'Choose ', viewFont) notNil |
|
1300 |
ifTrue: |
|
872 | 1301 |
[ |
869 | 1302 |
self class settings at: viewFont asSymbol put: (font on: device). |
1303 |
self updateFonts |
|
1304 |
]. |
|
1305 |
^font |
|
1306 |
! |
|
1307 |
||
1308 |
resetFonts |
|
892 | 1309 |
"sets the fonts in the settings to nil and resets the views to its default font" |
869 | 1310 |
|
872 | 1311 |
(self class settings) |
892 | 1312 |
at: #'Label Font' put: Label defaultFont; |
1313 |
at: #'Button Font' put: Button defaultFont; |
|
1314 |
at: #'Edit Font' put: TextView defaultFont; |
|
1315 |
at: #'List Font' put: ListView defaultFont; |
|
1316 |
at: #'Tree List Font' put: SelectionInTreeView defaultFont; |
|
1317 |
at: #'Note Book Font' put: NoteBookView defaultFont; |
|
1318 |
at: #'Framed Box Font' put: FramedBox defaultFont. |
|
1319 |
||
1320 |
self updateFonts. |
|
1321 |
||
1322 |
(self class settings) |
|
872 | 1323 |
removeKey: #'Label Font' ifAbsent: nil; |
1324 |
removeKey: #'Button Font' ifAbsent: nil; |
|
1325 |
removeKey: #'Edit Font' ifAbsent: nil; |
|
1326 |
removeKey: #'List Font' ifAbsent: nil; |
|
1327 |
removeKey: #'Tree List Font' ifAbsent: nil; |
|
1328 |
removeKey: #'Note Book Font' ifAbsent: nil; |
|
1329 |
removeKey: #'Framed Box Font' ifAbsent: nil. |
|
869 | 1330 |
|
1331 |
! |
|
1332 |
||
1333 |
updateFonts |
|
892 | 1334 |
"takes defined fonts from the settings and set them to the corresponding views" |
869 | 1335 |
|
892 | 1336 |
|settings labelFont buttonFont editFont listFont treeListFont noteBookFont framedBoxFont updateFontsBlock| |
871 | 1337 |
|
1338 |
settings := self class settings. |
|
869 | 1339 |
|
872 | 1340 |
labelFont := settings at: #'Label Font' ifAbsent: nil. |
1341 |
buttonFont := settings at: #'Button Font' ifAbsent: nil. |
|
1342 |
editFont := settings at: #'Edit Font' ifAbsent: nil. |
|
1343 |
listFont := settings at: #'List Font' ifAbsent: nil. |
|
1344 |
treeListFont := settings at: #'Tree List Font' ifAbsent: nil. |
|
1345 |
noteBookFont := settings at: #'Note Book Font' ifAbsent: nil. |
|
1346 |
framedBoxFont := settings at: #'Framed Box Font' ifAbsent: nil. |
|
869 | 1347 |
|
872 | 1348 |
updateFontsBlock := |
1349 |
[:v| |
|
1350 |
(labelFont notNil and: [v font ~= labelFont and: [(v class == Label) or: [v isKindOf: Toggle]]]) |
|
1351 |
ifTrue: [v font: labelFont; fixSize; sizeChanged:nil; invalidate]. |
|
1352 |
(buttonFont notNil and: [v font ~= buttonFont and: [v class == Button or: [v class == PopUpList]]]) |
|
876 | 1353 |
ifTrue: [v label isString ifTrue: [|e|e := v extent. v font: buttonFont; extent: e; invalidate]]. |
872 | 1354 |
(editFont notNil and: [v font ~= editFont and: [v isKindOf: TextView]]) |
1355 |
ifTrue: [v font: editFont; invalidate]. |
|
1356 |
(listFont notNil and: [v font ~= listFont and: [v class = SelectionInListView or: [v class = DataSetView]]]) |
|
1357 |
ifTrue: [v font: listFont. v invalidate]. |
|
1358 |
(treeListFont notNil and: [v font ~= treeListFont and: [v isKindOf: SelectionInTreeView]]) |
|
1359 |
ifTrue: [v font: treeListFont; invalidate]. |
|
1360 |
(noteBookFont notNil and: [v font ~= noteBookFont and: [v class == NoteBookView]]) |
|
1361 |
ifTrue: [v font: noteBookFont; invalidate]. |
|
1362 |
(framedBoxFont notNil and: [v font ~= framedBoxFont and: [v class == FramedBox]]) |
|
1363 |
ifTrue: [v font: framedBoxFont; invalidate] |
|
1364 |
]. |
|
1365 |
||
1366 |
self allFontViewsDo: [:v| updateFontsBlock value: v] |
|
1367 |
||
869 | 1368 |
! ! |
1369 |
||
753 | 1370 |
!ToolApplicationModel methodsFor:'startup / release'! |
1371 |
||
833 | 1372 |
allButOpenInterface:aSymbol |
907 | 1373 |
"sets the preferred extent and the label of the tool window before opening that" |
833 | 1374 |
|
1375 |
super allButOpenInterface:aSymbol. |
|
1376 |
||
1377 |
builder window extent: self preferredExtent. |
|
1378 |
builder window label: self class label. |
|
1379 |
||
1380 |
^builder |
|
1381 |
! |
|
1382 |
||
753 | 1383 |
close |
907 | 1384 |
"uninitializes and closes this tool" |
753 | 1385 |
|
756 | 1386 |
self uninitialize. |
1387 |
||
753 | 1388 |
super close |
1389 |
! |
|
1390 |
||
1391 |
closeRequest |
|
907 | 1392 |
"uninitializes this tool before requesting close" |
753 | 1393 |
|
756 | 1394 |
self uninitialize. |
1395 |
||
753 | 1396 |
super closeRequest |
1397 |
! |
|
1398 |
||
790 | 1399 |
postOpenWith:aBuilder |
907 | 1400 |
"starts the active help for this tool (if turned on in the settings) |
1401 |
and updates the info label and the fonts (from the settings)" |
|
790 | 1402 |
|
1403 |
super postOpenWith:aBuilder. |
|
1404 |
||
791 | 1405 |
self class showHelp ifTrue: [ActiveHelp startFor: self]. |
822 | 1406 |
self updateInfoLabel. |
876 | 1407 |
self updateFonts. |
1408 |
||
790 | 1409 |
! |
1410 |
||
853 | 1411 |
startClockOnTimedBlock: aBlock |
907 | 1412 |
"sets and starts the time block" |
853 | 1413 |
|
1414 |
timeBlock := aBlock. |
|
1415 |
aBlock value. |
|
1416 |
||
1417 |
! |
|
1418 |
||
756 | 1419 |
uninitialize |
907 | 1420 |
"stops the active help this tool and (if defined) removes the time block" |
756 | 1421 |
|
782 | 1422 |
self showHelp ifTrue: [ActiveHelp stopFor: self]. |
876 | 1423 |
timeBlock notNil ifTrue: [Processor removeTimedBlock:timeBlock. timeBlock := nil]. |
1424 |
||
753 | 1425 |
! ! |
1426 |
||
1427 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
1428 |
||
1429 |
version |
|
927 | 1430 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.57 1998-05-20 01:32:54 cg Exp $' |
753 | 1431 |
! ! |