author | Claus Gittinger <cg@exept.de> |
Sun, 26 Apr 1998 00:19:44 +0200 | |
changeset 910 | 670bffab7041 |
parent 907 | f4087882555a |
child 920 | 6b72e4ce4406 |
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 |
|
227 |
#help |
|
834 | 228 |
'Help functions.' |
823 | 229 |
|
876 | 230 |
#helpHelpTool |
910 | 231 |
'Open an HTML-Browser showing the Help Tools documentation.' |
876 | 232 |
|
823 | 233 |
#helpShowHelp |
910 | 234 |
'Toggle display of help texts.' |
823 | 235 |
|
236 |
#helpTutorial |
|
910 | 237 |
'Open an HTML-Browser showing this applications documentation.' |
823 | 238 |
|
239 |
#history |
|
834 | 240 |
'History functions.' |
803 | 241 |
|
242 |
#historyEmptyMenu |
|
910 | 243 |
'Delete all items in the history.' |
803 | 244 |
|
823 | 245 |
#historyMenuItem |
910 | 246 |
'Evaluate the text of the menu item for loading.' |
762 | 247 |
|
893 | 248 |
#settings |
249 |
'Settings functions.' |
|
250 |
||
823 | 251 |
#test |
834 | 252 |
'Test functions.' |
762 | 253 |
|
254 |
) |
|
255 |
! ! |
|
256 |
||
753 | 257 |
!ToolApplicationModel class methodsFor:'history'! |
258 |
||
259 |
getHistory |
|
907 | 260 |
"returns the history for this tool class" |
753 | 261 |
|
761
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
262 |
history isNil ifTrue: [history := OrderedCollection new]. |
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
263 |
^history |
753 | 264 |
|
265 |
! |
|
266 |
||
267 |
historyMaxSize |
|
907 | 268 |
"returns the maximum size for the history of this tool class" |
753 | 269 |
|
270 |
^10 |
|
271 |
||
272 |
! ! |
|
273 |
||
869 | 274 |
!ToolApplicationModel class methodsFor:'image specs'! |
275 |
||
276 |
copyIcon |
|
277 |
"This resource specification was automatically generated |
|
278 |
by the ImageEditor of ST/X." |
|
279 |
||
280 |
"Do not manually edit this!! If it is corrupted, |
|
281 |
the ImageEditor may not be able to read the specification." |
|
282 |
||
283 |
" |
|
284 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
285 |
" |
|
286 |
||
287 |
<resource: #image> |
|
288 |
||
289 |
^Icon |
|
290 |
constantNamed:#'ToolApplicationModel copyIcon' |
|
291 |
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]! |
|
292 |
||
293 |
cutIcon |
|
294 |
"This resource specification was automatically generated |
|
295 |
by the ImageEditor of ST/X." |
|
296 |
||
297 |
"Do not manually edit this!! If it is corrupted, |
|
298 |
the ImageEditor may not be able to read the specification." |
|
299 |
||
300 |
" |
|
301 |
ImageEditor openOnClass:self andSelector:#cutIcon |
|
302 |
" |
|
303 |
||
304 |
<resource: #image> |
|
305 |
||
306 |
^Icon |
|
307 |
constantNamed:#'ToolApplicationModel cutIcon' |
|
308 |
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]! |
|
309 |
||
310 |
deleteIcon |
|
311 |
"This resource specification was automatically generated |
|
312 |
by the ImageEditor of ST/X." |
|
313 |
||
314 |
"Do not manually edit this!! If it is corrupted, |
|
315 |
the ImageEditor may not be able to read the specification." |
|
316 |
||
317 |
" |
|
318 |
ImageEditor openOnClass:self andSelector:#deleteIcon |
|
319 |
" |
|
320 |
||
321 |
<resource: #image> |
|
322 |
||
323 |
^Icon |
|
324 |
constantNamed:#'ToolApplicationModel deleteIcon' |
|
325 |
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]! |
|
326 |
||
327 |
desktopIcon |
|
907 | 328 |
"returns the icon used for the desktop" |
869 | 329 |
|
330 |
^Icon |
|
331 |
constantNamed:#'ToolApplicationModel desktopIcon' |
|
332 |
ifAbsentPut: |
|
333 |
[ |
|
334 |
|desktopIcon| |
|
335 |
desktopIcon := self stxIcon. |
|
336 |
desktopIcon magnifiedBy: Display preferredIconSize/desktopIcon extent |
|
337 |
] |
|
338 |
||
339 |
||
340 |
||
341 |
||
342 |
! |
|
343 |
||
344 |
downIcon |
|
345 |
"This resource specification was automatically generated |
|
346 |
by the ImageEditor of ST/X." |
|
347 |
||
348 |
"Do not manually edit this!! If it is corrupted, |
|
349 |
the ImageEditor may not be able to read the specification." |
|
350 |
||
351 |
" |
|
352 |
ImageEditor openOnClass:self andSelector:#downIcon |
|
353 |
" |
|
354 |
||
355 |
<resource: #image> |
|
356 |
||
357 |
^Icon |
|
358 |
constantNamed:#'ToolApplicationModel downIcon' |
|
359 |
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]! |
|
360 |
||
361 |
downRightIcon |
|
362 |
"This resource specification was automatically generated |
|
363 |
by the ImageEditor of ST/X." |
|
364 |
||
365 |
"Do not manually edit this!! If it is corrupted, |
|
366 |
the ImageEditor may not be able to read the specification." |
|
367 |
||
368 |
" |
|
369 |
ImageEditor openOnClass:self andSelector:#downRightIcon |
|
370 |
" |
|
371 |
||
372 |
<resource: #image> |
|
373 |
||
374 |
^Icon |
|
375 |
constantNamed:#'ToolApplicationModel downRightIcon' |
|
376 |
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]! |
|
377 |
||
378 |
helpIcon |
|
379 |
"This resource specification was automatically generated |
|
380 |
by the ImageEditor of ST/X." |
|
381 |
||
382 |
"Do not manually edit this!! If it is corrupted, |
|
383 |
the ImageEditor may not be able to read the specification." |
|
384 |
||
385 |
" |
|
386 |
ImageEditor openOnClass:self andSelector:#helpIcon |
|
387 |
" |
|
388 |
||
389 |
<resource: #image> |
|
390 |
||
391 |
^Icon |
|
392 |
constantNamed:#'ToolApplicationModel helpIcon' |
|
393 |
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]! |
|
394 |
||
395 |
leftDownIcon |
|
396 |
"This resource specification was automatically generated |
|
397 |
by the ImageEditor of ST/X." |
|
398 |
||
399 |
"Do not manually edit this!! If it is corrupted, |
|
400 |
the ImageEditor may not be able to read the specification." |
|
401 |
||
402 |
" |
|
403 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
404 |
" |
|
405 |
||
406 |
<resource: #image> |
|
407 |
||
408 |
^Icon |
|
409 |
constantNamed:#'ToolApplicationModel leftDownIcon' |
|
410 |
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]! |
|
411 |
||
412 |
leftIcon |
|
413 |
"This resource specification was automatically generated |
|
414 |
by the ImageEditor of ST/X." |
|
415 |
||
416 |
"Do not manually edit this!! If it is corrupted, |
|
417 |
the ImageEditor may not be able to read the specification." |
|
418 |
||
419 |
" |
|
420 |
ImageEditor openOnClass:self andSelector:#leftIcon |
|
421 |
" |
|
422 |
||
423 |
<resource: #image> |
|
424 |
||
425 |
^Icon |
|
426 |
constantNamed:#'ToolApplicationModel leftIcon' |
|
427 |
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]! |
|
428 |
||
429 |
loadIcon |
|
430 |
"This resource specification was automatically generated |
|
431 |
by the ImageEditor of ST/X." |
|
432 |
||
433 |
"Do not manually edit this!! If it is corrupted, |
|
434 |
the ImageEditor may not be able to read the specification." |
|
435 |
||
436 |
" |
|
437 |
ImageEditor openOnClass:self andSelector:#loadIcon |
|
438 |
" |
|
439 |
||
440 |
<resource: #image> |
|
441 |
||
442 |
^Icon |
|
443 |
constantNamed:#'ToolApplicationModel loadIcon' |
|
444 |
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]! |
|
445 |
||
446 |
menuIcon |
|
907 | 447 |
"returns the icon used for the menu bar" |
869 | 448 |
|
449 |
^Icon |
|
450 |
constantNamed:#'ToolApplicationModel menuIcon' |
|
451 |
ifAbsentPut: |
|
452 |
[ |
|
453 |
|menuIcon| |
|
454 |
menuIcon := self stxIcon. |
|
455 |
menuIcon magnifiedBy: MenuPanel defaultFont height/menuIcon height |
|
456 |
] |
|
457 |
! |
|
458 |
||
459 |
newIcon |
|
460 |
"This resource specification was automatically generated |
|
461 |
by the ImageEditor of ST/X." |
|
462 |
||
463 |
"Do not manually edit this!! If it is corrupted, |
|
464 |
the ImageEditor may not be able to read the specification." |
|
465 |
||
466 |
" |
|
467 |
ImageEditor openOnClass:self andSelector:#newIcon |
|
468 |
" |
|
469 |
||
470 |
<resource: #image> |
|
471 |
||
472 |
^Icon |
|
473 |
constantNamed:#'ToolApplicationModel newIcon' |
|
474 |
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]! |
|
475 |
||
476 |
pasteIcon |
|
477 |
"This resource specification was automatically generated |
|
478 |
by the ImageEditor of ST/X." |
|
479 |
||
480 |
"Do not manually edit this!! If it is corrupted, |
|
481 |
the ImageEditor may not be able to read the specification." |
|
482 |
||
483 |
" |
|
484 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
485 |
" |
|
486 |
||
487 |
<resource: #image> |
|
488 |
||
489 |
^Icon |
|
490 |
constantNamed:#'ToolApplicationModel pasteIcon' |
|
491 |
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]! |
|
492 |
||
493 |
rightIcon |
|
494 |
"This resource specification was automatically generated |
|
495 |
by the ImageEditor of ST/X." |
|
496 |
||
497 |
"Do not manually edit this!! If it is corrupted, |
|
498 |
the ImageEditor may not be able to read the specification." |
|
499 |
||
500 |
" |
|
501 |
ImageEditor openOnClass:self andSelector:#rightIcon |
|
502 |
" |
|
503 |
||
504 |
<resource: #image> |
|
505 |
||
506 |
^Icon |
|
507 |
constantNamed:#'ToolApplicationModel rightIcon' |
|
508 |
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]! |
|
509 |
||
510 |
saveIcon |
|
511 |
"This resource specification was automatically generated |
|
512 |
by the ImageEditor of ST/X." |
|
513 |
||
514 |
"Do not manually edit this!! If it is corrupted, |
|
515 |
the ImageEditor may not be able to read the specification." |
|
516 |
||
517 |
" |
|
518 |
ImageEditor openOnClass:self andSelector:#saveIcon |
|
519 |
" |
|
520 |
||
521 |
<resource: #image> |
|
522 |
||
523 |
^Icon |
|
524 |
constantNamed:#'ToolApplicationModel saveIcon' |
|
525 |
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]! |
|
526 |
||
527 |
startIcon |
|
528 |
"This resource specification was automatically generated |
|
529 |
by the ImageEditor of ST/X." |
|
530 |
||
531 |
"Do not manually edit this!! If it is corrupted, |
|
532 |
the ImageEditor may not be able to read the specification." |
|
533 |
||
534 |
" |
|
535 |
ImageEditor openOnClass:self andSelector:#startIcon |
|
536 |
" |
|
537 |
||
538 |
<resource: #image> |
|
539 |
||
540 |
^Icon |
|
541 |
constantNamed:#'ToolApplicationModel startIcon' |
|
542 |
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]! |
|
543 |
||
544 |
stxIcon |
|
545 |
"This resource specification was automatically generated |
|
546 |
by the ImageEditor of ST/X." |
|
547 |
||
548 |
"Do not manually edit this!! If it is corrupted, |
|
549 |
the ImageEditor may not be able to read the specification." |
|
550 |
||
551 |
" |
|
552 |
ImageEditor openOnClass:self andSelector:#stxIcon |
|
553 |
" |
|
554 |
||
555 |
<resource: #image> |
|
556 |
||
557 |
^Icon |
|
558 |
constantNamed:#'ToolApplicationModel stxIcon' |
|
559 |
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]! |
|
560 |
||
561 |
upIcon |
|
562 |
"This resource specification was automatically generated |
|
563 |
by the ImageEditor of ST/X." |
|
564 |
||
565 |
"Do not manually edit this!! If it is corrupted, |
|
566 |
the ImageEditor may not be able to read the specification." |
|
567 |
||
568 |
" |
|
569 |
ImageEditor openOnClass:self andSelector:#upIcon |
|
570 |
" |
|
571 |
||
572 |
<resource: #image> |
|
573 |
||
574 |
^Icon |
|
575 |
constantNamed:#'ToolApplicationModel upIcon' |
|
576 |
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]! ! |
|
577 |
||
753 | 578 |
!ToolApplicationModel class methodsFor:'interface specs'! |
579 |
||
797 | 580 |
windowSpecForCommit |
869 | 581 |
"This resource specification was automatically generated |
582 |
by the UIPainter of ST/X." |
|
583 |
||
584 |
"Do not manually edit this!! If it is corrupted, |
|
585 |
the UIPainter may not be able to read the specification." |
|
586 |
||
587 |
" |
|
588 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit |
|
589 |
ToolApplicationModel new openInterface:#windowSpecForCommit |
|
590 |
" |
|
797 | 591 |
|
592 |
<resource: #canvas> |
|
593 |
||
594 |
^ |
|
859 | 595 |
|
797 | 596 |
#(#FullSpec |
859 | 597 |
#window: |
797 | 598 |
#(#WindowSpec |
859 | 599 |
#name: 'Commit Buttons' |
869 | 600 |
#layout: #(#LayoutFrame 344 0 371 0 643 0 430 0) |
859 | 601 |
#label: 'Commit Buttons' |
602 |
#min: #(#Point 100 22) |
|
603 |
#max: #(#Point 1152 900) |
|
869 | 604 |
#bounds: #(#Rectangle 344 371 644 431) |
859 | 605 |
#usePreferredExtent: false |
797 | 606 |
) |
859 | 607 |
#component: |
797 | 608 |
#(#SpecCollection |
859 | 609 |
#collection: |
797 | 610 |
#( |
611 |
#(#ActionButtonSpec |
|
859 | 612 |
#name: 'cancelButton' |
613 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
614 |
#activeHelpKey: #commitCancel |
|
615 |
#label: 'Cancel' |
|
616 |
#tabable: true |
|
617 |
#model: #cancel |
|
618 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 619 |
) |
620 |
#(#ActionButtonSpec |
|
859 | 621 |
#name: 'okButton' |
622 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
623 |
#activeHelpKey: #commitOK |
|
624 |
#label: 'OK' |
|
625 |
#tabable: true |
|
626 |
#model: #accept |
|
627 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 628 |
) |
629 |
) |
|
630 |
) |
|
631 |
) |
|
632 |
! |
|
633 |
||
634 |
windowSpecForCommitWithoutChannels |
|
869 | 635 |
"This resource specification was automatically generated |
636 |
by the UIPainter of ST/X." |
|
637 |
||
638 |
"Do not manually edit this!! If it is corrupted, |
|
639 |
the UIPainter may not be able to read the specification." |
|
640 |
||
641 |
" |
|
642 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels |
|
643 |
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels |
|
644 |
" |
|
797 | 645 |
|
646 |
<resource: #canvas> |
|
647 |
||
648 |
^ |
|
859 | 649 |
|
797 | 650 |
#(#FullSpec |
859 | 651 |
#window: |
797 | 652 |
#(#WindowSpec |
859 | 653 |
#name: 'Commit Buttons Without Channels' |
869 | 654 |
#layout: #(#LayoutFrame 500 0 326 0 799 0 385 0) |
859 | 655 |
#label: 'Commit Buttons Without Channels' |
656 |
#min: #(#Point 100 22) |
|
657 |
#max: #(#Point 1152 900) |
|
869 | 658 |
#bounds: #(#Rectangle 500 326 800 386) |
859 | 659 |
#usePreferredExtent: false |
797 | 660 |
) |
859 | 661 |
#component: |
797 | 662 |
#(#SpecCollection |
859 | 663 |
#collection: |
797 | 664 |
#( |
665 |
#(#ActionButtonSpec |
|
859 | 666 |
#name: 'cancelButton' |
667 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
668 |
#activeHelpKey: #commitCancel |
|
669 |
#label: 'Cancel' |
|
670 |
#tabable: true |
|
671 |
#model: #cancel |
|
797 | 672 |
) |
673 |
#(#ActionButtonSpec |
|
859 | 674 |
#name: 'okButton' |
675 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
676 |
#activeHelpKey: #commitOK |
|
677 |
#label: 'OK' |
|
678 |
#tabable: true |
|
679 |
#model: #accept |
|
797 | 680 |
) |
681 |
) |
|
682 |
) |
|
683 |
) |
|
684 |
! |
|
685 |
||
686 |
windowSpecForInfoBar |
|
869 | 687 |
"This resource specification was automatically generated |
688 |
by the UIPainter of ST/X." |
|
689 |
||
690 |
"Do not manually edit this!! If it is corrupted, |
|
691 |
the UIPainter may not be able to read the specification." |
|
692 |
||
693 |
" |
|
694 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar |
|
695 |
ToolApplicationModel new openInterface:#windowSpecForInfoBar |
|
696 |
" |
|
797 | 697 |
|
698 |
<resource: #canvas> |
|
699 |
||
700 |
^ |
|
859 | 701 |
|
797 | 702 |
#(#FullSpec |
859 | 703 |
#window: |
797 | 704 |
#(#WindowSpec |
859 | 705 |
#name: 'Info Bar' |
869 | 706 |
#layout: #(#LayoutFrame 233 0 218 0 732 0 563 0) |
859 | 707 |
#label: 'Info Bar' |
708 |
#min: #(#Point 400 320) |
|
709 |
#max: #(#Point 1152 900) |
|
869 | 710 |
#bounds: #(#Rectangle 233 218 733 564) |
859 | 711 |
#menu: #menu |
712 |
#usePreferredExtent: false |
|
797 | 713 |
) |
859 | 714 |
#component: |
797 | 715 |
#(#SpecCollection |
859 | 716 |
#collection: |
797 | 717 |
#( |
820 | 718 |
#(#ViewSpec |
859 | 719 |
#name: 'view' |
720 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
721 |
#component: |
|
820 | 722 |
#(#SpecCollection |
859 | 723 |
#collection: |
820 | 724 |
#( |
725 |
#(#LabelSpec |
|
859 | 726 |
#name: 'infoLabel' |
727 |
#layout: #(#LayoutFrame 2 0.0 1 0.0 -1 1.0 -1 1.0) |
|
728 |
#labelChannel: #valueOfInfoLabel |
|
729 |
#level: -1 |
|
730 |
#adjust: #left |
|
869 | 731 |
#resizeForLabel: false |
820 | 732 |
) |
733 |
) |
|
734 |
) |
|
797 | 735 |
) |
736 |
) |
|
737 |
) |
|
738 |
) |
|
739 |
! |
|
740 |
||
741 |
windowSpecForInfoBarWithClock |
|
869 | 742 |
"This resource specification was automatically generated |
743 |
by the UIPainter of ST/X." |
|
744 |
||
745 |
"Do not manually edit this!! If it is corrupted, |
|
746 |
the UIPainter may not be able to read the specification." |
|
747 |
||
748 |
" |
|
749 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBarWithClock |
|
750 |
ToolApplicationModel new openInterface:#windowSpecForInfoBarWithClock |
|
751 |
" |
|
797 | 752 |
|
753 |
<resource: #canvas> |
|
754 |
||
755 |
^ |
|
859 | 756 |
|
797 | 757 |
#(#FullSpec |
859 | 758 |
#window: |
797 | 759 |
#(#WindowSpec |
859 | 760 |
#name: 'Info Bar' |
872 | 761 |
#layout: #(#LayoutFrame 160 0 423 0 659 0 453 0) |
859 | 762 |
#label: 'Info Bar' |
763 |
#min: #(#Point 400 320) |
|
764 |
#max: #(#Point 1152 900) |
|
872 | 765 |
#bounds: #(#Rectangle 160 423 660 454) |
859 | 766 |
#menu: #menu |
767 |
#usePreferredExtent: false |
|
797 | 768 |
) |
859 | 769 |
#component: |
797 | 770 |
#(#SpecCollection |
859 | 771 |
#collection: |
797 | 772 |
#( |
820 | 773 |
#(#ViewSpec |
859 | 774 |
#name: 'view' |
775 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
776 |
#component: |
|
820 | 777 |
#(#SpecCollection |
859 | 778 |
#collection: |
820 | 779 |
#( |
780 |
#(#LabelSpec |
|
859 | 781 |
#name: 'infoLabel' |
782 |
#layout: #(#LayoutFrame 2 0 1 0.0 -81 1 -1 1.0) |
|
783 |
#labelChannel: #valueOfInfoLabel |
|
784 |
#level: -1 |
|
785 |
#adjust: #left |
|
872 | 786 |
#resizeForLabel: false |
820 | 787 |
) |
788 |
#(#LabelSpec |
|
859 | 789 |
#name: 'timeLabel' |
790 |
#layout: #(#LayoutFrame -79 1 1 0.0 -1 1.0 -1 1.0) |
|
791 |
#labelChannel: #valueOfTimeLabel |
|
792 |
#level: -1 |
|
793 |
#adjust: #right |
|
872 | 794 |
#resizeForLabel: false |
820 | 795 |
) |
796 |
) |
|
797 |
) |
|
797 | 798 |
) |
799 |
) |
|
800 |
) |
|
801 |
) |
|
802 |
! ! |
|
803 |
||
804 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
805 |
||
753 | 806 |
menuAbout |
869 | 807 |
"This resource specification was automatically generated |
808 |
by the MenuEditor of ST/X." |
|
809 |
||
810 |
"Do not manually edit this!! If it is corrupted, |
|
811 |
the MenuEditor may not be able to read the specification." |
|
812 |
||
813 |
" |
|
814 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuAbout |
|
815 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp |
|
816 |
" |
|
753 | 817 |
|
818 |
<resource: #menu> |
|
819 |
||
820 |
^ |
|
859 | 821 |
|
753 | 822 |
#(#Menu |
823 |
||
824 |
#( |
|
825 |
#(#MenuItem |
|
859 | 826 |
#label: 'About Smalltalk/X...' |
827 |
#translateLabel: true |
|
828 |
#value: #openAbout |
|
829 |
#activeHelpKey: #aboutSTX |
|
753 | 830 |
) |
831 |
#(#MenuItem |
|
859 | 832 |
#label: '-' |
753 | 833 |
) |
834 |
#(#MenuItem |
|
859 | 835 |
#label: 'About This Application...' |
836 |
#translateLabel: true |
|
837 |
#value: #openAboutThisApplication |
|
838 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 839 |
) |
840 |
) nil |
|
841 |
nil |
|
842 |
) |
|
843 |
! |
|
844 |
||
869 | 845 |
menuFont |
846 |
"This resource specification was automatically generated |
|
847 |
by the MenuEditor of ST/X." |
|
848 |
||
849 |
"Do not manually edit this!! If it is corrupted, |
|
850 |
the MenuEditor may not be able to read the specification." |
|
851 |
||
852 |
" |
|
853 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuFont |
|
854 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuFont)) startUp |
|
855 |
" |
|
856 |
||
857 |
<resource: #menu> |
|
858 |
||
859 |
^ |
|
860 |
||
861 |
#(#Menu |
|
862 |
||
863 |
#( |
|
864 |
#(#MenuItem |
|
872 | 865 |
#label: 'Label...' |
869 | 866 |
#value: #chooseFont: |
867 |
#argument: 'Label Font' |
|
868 |
) |
|
869 |
#(#MenuItem |
|
872 | 870 |
#label: 'Button...' |
869 | 871 |
#value: #chooseFont: |
872 |
#argument: 'Button Font' |
|
873 |
) |
|
874 |
#(#MenuItem |
|
872 | 875 |
#label: 'Edit...' |
869 | 876 |
#value: #chooseFont: |
877 |
#argument: 'Edit Font' |
|
878 |
) |
|
879 |
#(#MenuItem |
|
872 | 880 |
#label: 'List...' |
869 | 881 |
#value: #chooseFont: |
882 |
#argument: 'List Font' |
|
883 |
) |
|
884 |
#(#MenuItem |
|
872 | 885 |
#label: 'Tree List...' |
869 | 886 |
#value: #chooseFont: |
887 |
#argument: 'Tree List Font' |
|
888 |
) |
|
889 |
#(#MenuItem |
|
872 | 890 |
#label: 'Note Book...' |
891 |
#value: #chooseFont: |
|
892 |
#argument: 'Note Book Font' |
|
893 |
) |
|
894 |
#(#MenuItem |
|
895 |
#label: 'Framed Box...' |
|
896 |
#value: #chooseFont: |
|
897 |
#argument: 'Framed Box Font' |
|
898 |
) |
|
899 |
#(#MenuItem |
|
869 | 900 |
#label: '-' |
901 |
) |
|
902 |
#(#MenuItem |
|
872 | 903 |
#label: 'Reset' |
869 | 904 |
#value: #resetFonts |
905 |
) |
|
906 |
) nil |
|
907 |
nil |
|
908 |
) |
|
909 |
! |
|
910 |
||
753 | 911 |
menuHelp |
869 | 912 |
"This resource specification was automatically generated |
913 |
by the MenuEditor of ST/X." |
|
914 |
||
915 |
"Do not manually edit this!! If it is corrupted, |
|
916 |
the MenuEditor may not be able to read the specification." |
|
917 |
||
918 |
" |
|
919 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp |
|
920 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp |
|
921 |
" |
|
753 | 922 |
|
923 |
<resource: #menu> |
|
924 |
||
925 |
^ |
|
859 | 926 |
|
753 | 927 |
#(#Menu |
928 |
||
929 |
#( |
|
930 |
#(#MenuItem |
|
876 | 931 |
#label: 'Documentation' |
859 | 932 |
#translateLabel: true |
933 |
#value: #openDocumentation |
|
934 |
#activeHelpKey: #helpTutorial |
|
907 | 935 |
#enabled: #valueOfHavingDocumentation |
753 | 936 |
) |
937 |
#(#MenuItem |
|
859 | 938 |
#label: '-' |
753 | 939 |
) |
940 |
#(#MenuItem |
|
859 | 941 |
#label: 'Show Help Texts' |
942 |
#translateLabel: true |
|
943 |
#activeHelpKey: #helpShowHelp |
|
944 |
#indication: #showHelp: |
|
753 | 945 |
) |
946 |
) nil |
|
947 |
nil |
|
948 |
) |
|
949 |
! ! |
|
950 |
||
907 | 951 |
!ToolApplicationModel class methodsFor:'queries'! |
952 |
||
953 |
isVisualStartable |
|
954 |
"returns whether this application class can be started via #open" |
|
955 |
||
956 |
self == ToolApplicationModel ifTrue:[^false]. |
|
957 |
^super isVisualStartable |
|
958 |
||
959 |
! ! |
|
960 |
||
782 | 961 |
!ToolApplicationModel class methodsFor:'startup / release'! |
753 | 962 |
|
782 | 963 |
preSnapshot |
907 | 964 |
"removes the clipboard before snap shoting" |
753 | 965 |
|
782 | 966 |
clipboard := nil |
753 | 967 |
! |
968 |
||
782 | 969 |
uninitialize |
907 | 970 |
"resets the class instance variables" |
760 | 971 |
|
869 | 972 |
settings := showHelp := history := clipboard := nil |
753 | 973 |
! ! |
974 |
||
782 | 975 |
!ToolApplicationModel methodsFor:'aspects'! |
976 |
||
822 | 977 |
valueOfCanCopy |
907 | 978 |
"returns whether can copy as value holder" |
822 | 979 |
|
980 |
|holder| |
|
981 |
(holder := builder bindingAt:#valueOfCanCopy) isNil ifTrue:[ |
|
982 |
builder aspectAt:#valueOfCanCopy put:(holder := false asValue). |
|
983 |
]. |
|
984 |
^ holder |
|
985 |
||
986 |
! |
|
987 |
||
988 |
valueOfCanCut |
|
907 | 989 |
"returns whether can paste as value holder" |
822 | 990 |
|
991 |
|holder| |
|
992 |
(holder := builder bindingAt:#valueOfCanCut) isNil ifTrue:[ |
|
993 |
builder aspectAt:#valueOfCanCut put:(holder := false asValue). |
|
994 |
]. |
|
995 |
^ holder |
|
996 |
||
997 |
! |
|
998 |
||
999 |
valueOfCanPaste |
|
907 | 1000 |
"returns whether can paste as value holder" |
822 | 1001 |
|
1002 |
|holder| |
|
1003 |
(holder := builder bindingAt:#valueOfCanPaste) isNil ifTrue:[ |
|
1004 |
builder aspectAt:#valueOfCanPaste put:(holder := false asValue). |
|
1005 |
]. |
|
1006 |
^ holder |
|
1007 |
||
1008 |
! |
|
1009 |
||
1010 |
valueOfCanUndo |
|
907 | 1011 |
"returns whether can undo as value holder" |
822 | 1012 |
|
1013 |
|holder| |
|
1014 |
(holder := builder bindingAt:#valueOfCanUndo) isNil ifTrue:[ |
|
1015 |
builder aspectAt:#valueOfCanUndo put:(holder := false asValue). |
|
1016 |
]. |
|
1017 |
^ holder |
|
1018 |
||
1019 |
! |
|
1020 |
||
782 | 1021 |
valueOfEnablingCommitButtons |
907 | 1022 |
"returns the enabling of the commit of this tool as value holder" |
753 | 1023 |
|
782 | 1024 |
|holder| |
1025 |
(holder := builder bindingAt:#valueOfEnablingCommitButtons) isNil ifTrue:[ |
|
1026 |
builder aspectAt:#valueOfEnablingCommitButtons put:(holder := false asValue). |
|
1027 |
]. |
|
1028 |
^ holder |
|
753 | 1029 |
|
782 | 1030 |
! |
1031 |
||
858 | 1032 |
valueOfHavingDocumentation |
907 | 1033 |
"returns whether there is a documentation method for this tool as value holder" |
803 | 1034 |
|
1035 |
|holder| |
|
858 | 1036 |
(holder := builder bindingAt:#valueOfHavingDocumentation) isNil ifTrue:[ |
1037 |
builder aspectAt:#valueOfHavingDocumentation put:(holder := (self class implements: #openDocumentation) asValue). |
|
803 | 1038 |
]. |
1039 |
^ holder |
|
1040 |
||
1041 |
! |
|
1042 |
||
782 | 1043 |
valueOfInfoLabel |
907 | 1044 |
"returns the info label as value holder" |
782 | 1045 |
|
1046 |
|holder| |
|
1047 |
(holder := builder bindingAt:#valueOfInfoLabel) isNil ifTrue:[ |
|
1048 |
builder aspectAt:#valueOfInfoLabel put:(holder := ValueHolder new). |
|
1049 |
]. |
|
1050 |
^ holder |
|
753 | 1051 |
|
782 | 1052 |
! |
1053 |
||
1054 |
valueOfTimeLabel |
|
907 | 1055 |
"returns the time label as value holder" |
753 | 1056 |
|
782 | 1057 |
|holder| |
1058 |
(holder := builder bindingAt:#valueOfTimeLabel) isNil ifTrue:[ |
|
1059 |
builder aspectAt:#valueOfTimeLabel put:(holder := ValueHolder new). |
|
1060 |
]. |
|
1061 |
^ holder |
|
753 | 1062 |
|
1063 |
! ! |
|
1064 |
||
782 | 1065 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 1066 |
|
838 | 1067 |
clipboard |
907 | 1068 |
"returns the clipboard" |
838 | 1069 |
|
1070 |
^self class clipboard |
|
1071 |
! |
|
1072 |
||
782 | 1073 |
clipboard: anEditObject |
907 | 1074 |
"sets the clipboard and the value holder for can pasting" |
753 | 1075 |
|
782 | 1076 |
self class clipboard: anEditObject. |
753 | 1077 |
|
869 | 1078 |
self valueOfCanPaste value: anEditObject notNil |
782 | 1079 |
! ! |
1080 |
||
1081 |
!ToolApplicationModel methodsFor:'help'! |
|
753 | 1082 |
|
762 | 1083 |
defaultInfoLabel |
907 | 1084 |
"returns the default info label; here an empty string" |
762 | 1085 |
|
1086 |
^'' |
|
1087 |
! |
|
1088 |
||
753 | 1089 |
openAbout |
907 | 1090 |
"opens an about box" |
753 | 1091 |
|
1092 |
|box| |
|
1093 |
||
1094 |
box := AboutBox new. |
|
1095 |
box autoHideAfter:10 with:[]. |
|
1096 |
box showAtCenter |
|
1097 |
||
1098 |
! |
|
1099 |
||
1100 |
openAboutThisApplication |
|
907 | 1101 |
"opens an about this application box" |
753 | 1102 |
|
1103 |
|rev box| |
|
1104 |
rev := ''. |
|
1105 |
self class revision notNil ifTrue: [rev := ' (rev: ', self class revision printString, ')']. |
|
1106 |
box := AboutBox title: |
|
800 | 1107 |
'\The application\\' withCRs |
850 | 1108 |
, self class name asBoldText, rev |
1109 |
, '\\has been designed and implemented by: \' withCRs |
|
1110 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
|
800 | 1111 |
, '\\' withCRs. |
753 | 1112 |
|
1113 |
box label:'About This Application'. |
|
1114 |
box autoHideAfter:10 with:[]. |
|
1115 |
box showAtCenter. |
|
1116 |
! |
|
1117 |
||
858 | 1118 |
openHTMLDocument: aHTMLFilename |
907 | 1119 |
"opens a HTML browser on aHTMLFilename" |
858 | 1120 |
|
1121 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
1122 |
! |
|
1123 |
||
782 | 1124 |
showHelp |
907 | 1125 |
"returns whether showing help is turned on/off" |
782 | 1126 |
|
783 | 1127 |
|currentActiveHelp| |
858 | 1128 |
|
783 | 1129 |
currentActiveHelp := ActiveHelp currentHelpListener. |
1130 |
||
1131 |
^self class showHelp |
|
858 | 1132 |
and: [currentActiveHelp notNil and: [masterApplication notNil |
1133 |
ifFalse: [currentActiveHelp interestedIn: self window] |
|
1134 |
ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
|
782 | 1135 |
! |
1136 |
||
1137 |
showHelp: aValue |
|
907 | 1138 |
"toggles showing help" |
782 | 1139 |
|
1140 |
(self class showHelp: aValue) |
|
1141 |
ifTrue: [ActiveHelp startFor: self] |
|
822 | 1142 |
ifFalse: [ActiveHelp stopFor: self. self updateInfoLabel] |
782 | 1143 |
! |
1144 |
||
762 | 1145 |
showHelp:aHelpText for:view |
907 | 1146 |
"displays aHelpText in the info label or if present detours it to its masterApplication" |
762 | 1147 |
|
782 | 1148 |
self showHelp ifFalse: [^true]. |
876 | 1149 |
masterApplication notNil ifTrue: [masterApplication showHelp: aHelpText for:view]. |
1150 |
aHelpText isNil |
|
1151 |
ifTrue: [self updateInfoLabel] |
|
1152 |
ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)]. |
|
1153 |
^true |
|
822 | 1154 |
! |
1155 |
||
1156 |
updateInfoLabel |
|
907 | 1157 |
"updates the info label at the bottom" |
822 | 1158 |
|
1159 |
self valueOfInfoLabel value: self defaultInfoLabel |
|
762 | 1160 |
! ! |
1161 |
||
753 | 1162 |
!ToolApplicationModel methodsFor:'history'! |
1163 |
||
1164 |
addToHistory: aHistoryEntry |
|
907 | 1165 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
1166 |
and checks for maximum size of the history" |
|
753 | 1167 |
|
782 | 1168 |
aHistoryEntry key size = 0 ifTrue: [^nil]. |
753 | 1169 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
1170 |
self history addFirst: aHistoryEntry. |
|
1171 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1172 |
! |
|
1173 |
||
1174 |
emptyHistory |
|
907 | 1175 |
"removes all history entries" |
753 | 1176 |
|
1177 |
^self history removeAll |
|
1178 |
! |
|
1179 |
||
1180 |
history |
|
907 | 1181 |
"returns the history from tool class" |
753 | 1182 |
|
1183 |
^self class getHistory |
|
1184 |
! |
|
1185 |
||
844 | 1186 |
historyEntries |
907 | 1187 |
"returns the history entries, i.e. the evaluatable values containing the information" |
844 | 1188 |
|
1189 |
^self history collect: [:asso| asso key] |
|
1190 |
! |
|
1191 |
||
753 | 1192 |
menuHistory |
907 | 1193 |
"returns a history submenu" |
753 | 1194 |
|
893 | 1195 |
|menu| |
753 | 1196 |
menu := Menu new receiver: self. |
1197 |
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do: |
|
1198 |
[:historyEntryType| |
|
893 | 1199 |
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 | 1200 |
]. |
803 | 1201 |
menu addItem: (MenuItem new label: 'Empty History'; value: #emptyHistory; activeHelpKey: #historyEmptyMenu). |
753 | 1202 |
|
1203 |
^menu |
|
1204 |
! |
|
1205 |
||
1206 |
removeFromHistory: aHistoryEntry |
|
907 | 1207 |
"removes aHistoryEntry from the history" |
753 | 1208 |
|
1209 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
1210 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1211 |
! ! |
|
1212 |
||
782 | 1213 |
!ToolApplicationModel methodsFor:'queries'! |
1214 |
||
876 | 1215 |
allToolInstances |
907 | 1216 |
"returns all instances of this tool class" |
876 | 1217 |
|
1218 |
^self class settings at: #Instances ifAbsent: [^#()] |
|
1219 |
! |
|
1220 |
||
782 | 1221 |
preferredExtent |
1222 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
1223 |
will be considered" |
|
1224 |
||
1225 |
|window menu menuToolbarView preferredExtentOfWindow| |
|
1226 |
||
1227 |
window := self builder window. |
|
1228 |
menu := window subViews first. |
|
1229 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
1230 |
||
1231 |
preferredExtentOfWindow := window extent. |
|
1232 |
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent]. |
|
1233 |
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent]. |
|
1234 |
||
1235 |
^window minExtent max: (preferredExtentOfWindow min: window maxExtent) |
|
1236 |
! ! |
|
1237 |
||
869 | 1238 |
!ToolApplicationModel methodsFor:'settings'! |
1239 |
||
872 | 1240 |
allFontViewsDo: aBlock |
892 | 1241 |
"evaluates aBlock for all views with fonts" |
872 | 1242 |
|
1243 |
|fontViews| |
|
1244 |
||
1245 |
fontViews := OrderedCollection new. |
|
1246 |
||
1247 |
self builder windowGroup views do: [:v| v class = MenuPanel ifTrue: [fontViews add: v]]. |
|
1248 |
||
1249 |
builder namedComponents do: |
|
1250 |
[:aView| |
|
1251 |
aView allSubViewsDo: |
|
1252 |
[:v| |
|
1253 |
v font notNil ifTrue: [fontViews add: v] |
|
1254 |
] |
|
1255 |
]. |
|
1256 |
fontViews do: aBlock |
|
1257 |
! |
|
1258 |
||
869 | 1259 |
chooseFont: viewFont |
892 | 1260 |
"chooses a font for viewFont and puts it into the settings dictionary; |
869 | 1261 |
finally update all my views" |
1262 |
||
1263 |
|defaultFont font| |
|
1264 |
||
872 | 1265 |
viewFont = 'Label Font' ifTrue: [defaultFont := Label defaultFont]. |
1266 |
viewFont = 'Button Font' ifTrue: [defaultFont := Button defaultFont]. |
|
1267 |
viewFont = 'Edit Font' ifTrue: [defaultFont := TextView defaultFont]. |
|
1268 |
viewFont = 'List Font' ifTrue: [defaultFont := ListView defaultFont]. |
|
1269 |
viewFont = 'Tree List Font' ifTrue: [defaultFont := SelectionInTreeView defaultFont]. |
|
892 | 1270 |
viewFont = 'Note Book Font' ifTrue: [defaultFont := NoteBookView defaultFont]. |
872 | 1271 |
viewFont = 'Framed Box Font' ifTrue: [defaultFont := FramedBox defaultFont]. |
869 | 1272 |
|
1273 |
(font := FontPanel |
|
1274 |
fontFromUserInitial: (self class settings at: viewFont asSymbol ifAbsent: nil) ? defaultFont |
|
1275 |
title: 'Choose ', viewFont) notNil |
|
1276 |
ifTrue: |
|
872 | 1277 |
[ |
869 | 1278 |
self class settings at: viewFont asSymbol put: (font on: device). |
1279 |
self updateFonts |
|
1280 |
]. |
|
1281 |
^font |
|
1282 |
! |
|
1283 |
||
1284 |
resetFonts |
|
892 | 1285 |
"sets the fonts in the settings to nil and resets the views to its default font" |
869 | 1286 |
|
872 | 1287 |
(self class settings) |
892 | 1288 |
at: #'Label Font' put: Label defaultFont; |
1289 |
at: #'Button Font' put: Button defaultFont; |
|
1290 |
at: #'Edit Font' put: TextView defaultFont; |
|
1291 |
at: #'List Font' put: ListView defaultFont; |
|
1292 |
at: #'Tree List Font' put: SelectionInTreeView defaultFont; |
|
1293 |
at: #'Note Book Font' put: NoteBookView defaultFont; |
|
1294 |
at: #'Framed Box Font' put: FramedBox defaultFont. |
|
1295 |
||
1296 |
self updateFonts. |
|
1297 |
||
1298 |
(self class settings) |
|
872 | 1299 |
removeKey: #'Label Font' ifAbsent: nil; |
1300 |
removeKey: #'Button Font' ifAbsent: nil; |
|
1301 |
removeKey: #'Edit Font' ifAbsent: nil; |
|
1302 |
removeKey: #'List Font' ifAbsent: nil; |
|
1303 |
removeKey: #'Tree List Font' ifAbsent: nil; |
|
1304 |
removeKey: #'Note Book Font' ifAbsent: nil; |
|
1305 |
removeKey: #'Framed Box Font' ifAbsent: nil. |
|
869 | 1306 |
|
1307 |
! |
|
1308 |
||
1309 |
updateFonts |
|
892 | 1310 |
"takes defined fonts from the settings and set them to the corresponding views" |
869 | 1311 |
|
892 | 1312 |
|settings labelFont buttonFont editFont listFont treeListFont noteBookFont framedBoxFont updateFontsBlock| |
871 | 1313 |
|
1314 |
settings := self class settings. |
|
869 | 1315 |
|
872 | 1316 |
labelFont := settings at: #'Label Font' ifAbsent: nil. |
1317 |
buttonFont := settings at: #'Button Font' ifAbsent: nil. |
|
1318 |
editFont := settings at: #'Edit Font' ifAbsent: nil. |
|
1319 |
listFont := settings at: #'List Font' ifAbsent: nil. |
|
1320 |
treeListFont := settings at: #'Tree List Font' ifAbsent: nil. |
|
1321 |
noteBookFont := settings at: #'Note Book Font' ifAbsent: nil. |
|
1322 |
framedBoxFont := settings at: #'Framed Box Font' ifAbsent: nil. |
|
869 | 1323 |
|
872 | 1324 |
updateFontsBlock := |
1325 |
[:v| |
|
1326 |
(labelFont notNil and: [v font ~= labelFont and: [(v class == Label) or: [v isKindOf: Toggle]]]) |
|
1327 |
ifTrue: [v font: labelFont; fixSize; sizeChanged:nil; invalidate]. |
|
1328 |
(buttonFont notNil and: [v font ~= buttonFont and: [v class == Button or: [v class == PopUpList]]]) |
|
876 | 1329 |
ifTrue: [v label isString ifTrue: [|e|e := v extent. v font: buttonFont; extent: e; invalidate]]. |
872 | 1330 |
(editFont notNil and: [v font ~= editFont and: [v isKindOf: TextView]]) |
1331 |
ifTrue: [v font: editFont; invalidate]. |
|
1332 |
(listFont notNil and: [v font ~= listFont and: [v class = SelectionInListView or: [v class = DataSetView]]]) |
|
1333 |
ifTrue: [v font: listFont. v invalidate]. |
|
1334 |
(treeListFont notNil and: [v font ~= treeListFont and: [v isKindOf: SelectionInTreeView]]) |
|
1335 |
ifTrue: [v font: treeListFont; invalidate]. |
|
1336 |
(noteBookFont notNil and: [v font ~= noteBookFont and: [v class == NoteBookView]]) |
|
1337 |
ifTrue: [v font: noteBookFont; invalidate]. |
|
1338 |
(framedBoxFont notNil and: [v font ~= framedBoxFont and: [v class == FramedBox]]) |
|
1339 |
ifTrue: [v font: framedBoxFont; invalidate] |
|
1340 |
]. |
|
1341 |
||
1342 |
self allFontViewsDo: [:v| updateFontsBlock value: v] |
|
1343 |
||
869 | 1344 |
! ! |
1345 |
||
753 | 1346 |
!ToolApplicationModel methodsFor:'startup / release'! |
1347 |
||
833 | 1348 |
allButOpenInterface:aSymbol |
907 | 1349 |
"sets the preferred extent and the label of the tool window before opening that" |
833 | 1350 |
|
1351 |
super allButOpenInterface:aSymbol. |
|
1352 |
||
1353 |
builder window extent: self preferredExtent. |
|
1354 |
builder window label: self class label. |
|
1355 |
||
1356 |
^builder |
|
1357 |
! |
|
1358 |
||
753 | 1359 |
close |
907 | 1360 |
"uninitializes and closes this tool" |
753 | 1361 |
|
756 | 1362 |
self uninitialize. |
1363 |
||
753 | 1364 |
super close |
1365 |
! |
|
1366 |
||
1367 |
closeRequest |
|
907 | 1368 |
"uninitializes this tool before requesting close" |
753 | 1369 |
|
756 | 1370 |
self uninitialize. |
1371 |
||
753 | 1372 |
super closeRequest |
1373 |
! |
|
1374 |
||
790 | 1375 |
postOpenWith:aBuilder |
907 | 1376 |
"starts the active help for this tool (if turned on in the settings) |
1377 |
and updates the info label and the fonts (from the settings)" |
|
790 | 1378 |
|
1379 |
super postOpenWith:aBuilder. |
|
1380 |
||
791 | 1381 |
self class showHelp ifTrue: [ActiveHelp startFor: self]. |
822 | 1382 |
self updateInfoLabel. |
876 | 1383 |
self updateFonts. |
1384 |
||
790 | 1385 |
! |
1386 |
||
853 | 1387 |
startClockOnTimedBlock: aBlock |
907 | 1388 |
"sets and starts the time block" |
853 | 1389 |
|
1390 |
timeBlock := aBlock. |
|
1391 |
aBlock value. |
|
1392 |
||
1393 |
! |
|
1394 |
||
756 | 1395 |
uninitialize |
907 | 1396 |
"stops the active help this tool and (if defined) removes the time block" |
756 | 1397 |
|
782 | 1398 |
self showHelp ifTrue: [ActiveHelp stopFor: self]. |
876 | 1399 |
timeBlock notNil ifTrue: [Processor removeTimedBlock:timeBlock. timeBlock := nil]. |
1400 |
||
753 | 1401 |
! ! |
1402 |
||
1403 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
1404 |
||
1405 |
version |
|
910 | 1406 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.54 1998-04-25 22:19:44 cg Exp $' |
753 | 1407 |
! ! |