author | tz |
Thu, 05 Mar 1998 23:56:53 +0100 | |
changeset 859 | 5d6a438f84d0 |
parent 858 | a36ca9158a69 |
child 869 | b1815e3116c6 |
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 |
" |
|
53 |
Standard framework for tools; provides hooks for history management, |
|
782 | 54 |
showing help texts, about menu, help menu etc. |
753 | 55 |
See concrete subclasses for examples. |
56 |
||
57 |
[author:] |
|
58 |
Thomas Zwick |
|
59 |
" |
|
60 |
! ! |
|
61 |
||
62 |
!ToolApplicationModel class methodsFor:'accessing'! |
|
63 |
||
800 | 64 |
authorLinesForAboutBox |
65 |
"extract the author(s) from the documentation method." |
|
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 |
|
99 |
||
100 |
|label| |
|
101 |
label := ''. |
|
102 |
self name do: |
|
103 |
[:c| |
|
104 |
c isUppercase ifTrue: [label := label, $ ]. |
|
105 |
label := label, c |
|
106 |
]. |
|
107 |
^label trimBlanks |
|
782 | 108 |
! |
109 |
||
850 | 110 |
settings |
111 |
||
112 |
^settings ? (settings := IdentityDictionary new) |
|
113 |
! |
|
114 |
||
782 | 115 |
showHelp |
116 |
||
117 |
^showHelp ? (showHelp := true) |
|
118 |
! |
|
119 |
||
120 |
showHelp: aBoolean |
|
121 |
||
122 |
^showHelp := aBoolean |
|
753 | 123 |
! ! |
124 |
||
756 | 125 |
!ToolApplicationModel class methodsFor:'clipboard'! |
126 |
||
127 |
clipboard |
|
128 |
||
129 |
^clipboard |
|
130 |
! |
|
131 |
||
132 |
clipboard: anEditObject |
|
133 |
||
134 |
clipboard := anEditObject |
|
135 |
! ! |
|
136 |
||
762 | 137 |
!ToolApplicationModel class methodsFor:'help specs'! |
138 |
||
139 |
helpSpec |
|
140 |
"return a dictionary filled with helpKey -> helptext associations. |
|
141 |
These are used by the activeHelp tool." |
|
142 |
||
143 |
" |
|
144 |
UIHelpTool openOnClass:ToolApplicationModel |
|
145 |
" |
|
146 |
||
147 |
^ super helpSpec addPairsFrom:#( |
|
148 |
||
823 | 149 |
#about |
834 | 150 |
'About functions.' |
823 | 151 |
|
762 | 152 |
#aboutSTX |
763 | 153 |
'Opens an InfoBox about running ST/X.' |
762 | 154 |
|
155 |
#aboutThisAppliaction |
|
763 | 156 |
'Opens an InfoBox about release and author of current application.' |
762 | 157 |
|
823 | 158 |
#add |
834 | 159 |
'Add functions.' |
823 | 160 |
|
161 |
#commitCancel |
|
851 | 162 |
'Cancels last edit action.' |
823 | 163 |
|
164 |
#commitOK |
|
851 | 165 |
'Accepts last edit action.' |
823 | 166 |
|
167 |
#edit |
|
834 | 168 |
'Edit functions.' |
823 | 169 |
|
170 |
#editCopy |
|
853 | 171 |
'Copies the selected item(s) to the clipboard.' |
762 | 172 |
|
782 | 173 |
#editCut |
853 | 174 |
'Cuts the selected item(s) and places it to the clipboard.' |
175 |
||
176 |
#editDelete |
|
177 |
'Deletes the selected item(s).' |
|
782 | 178 |
|
823 | 179 |
#editMoveDown |
834 | 180 |
'Moves the selected item one step down.' |
823 | 181 |
|
182 |
#editMoveIn |
|
834 | 183 |
'Moves the selected item into next item as child item.' |
823 | 184 |
|
185 |
#editMoveOut |
|
834 | 186 |
'Moves the selected item out of parent item.' |
823 | 187 |
|
188 |
#editMoveUp |
|
834 | 189 |
'Moves the selected item one step up.' |
782 | 190 |
|
191 |
#editPaste |
|
834 | 192 |
'Pastes the contents of the clipboard.' |
782 | 193 |
|
194 |
#editUndo |
|
195 |
'Reverses the last action.' |
|
196 |
||
823 | 197 |
#file |
834 | 198 |
'File functions.' |
805 | 199 |
|
823 | 200 |
#fileBrowseClass |
201 |
'Opens a System Browser on current class and selector.' |
|
805 | 202 |
|
823 | 203 |
#fileDefineClass |
204 |
'Opens a dialog to define current class.' |
|
805 | 205 |
|
206 |
#fileDefineClassAndSelector |
|
207 |
'Opens a dialog to define current class and selector.' |
|
208 |
||
823 | 209 |
#fileExit |
210 |
'Exits current application.' |
|
211 |
||
212 |
#help |
|
834 | 213 |
'Help functions.' |
823 | 214 |
|
215 |
#helpShowHelp |
|
216 |
'Turns on/off displaying help texts.' |
|
217 |
||
218 |
#helpTutorial |
|
846 | 219 |
'Opens a HTML-Browser on the documentation file of the current application.' |
823 | 220 |
|
221 |
#history |
|
834 | 222 |
'History functions.' |
803 | 223 |
|
224 |
#historyEmptyMenu |
|
225 |
'Deletes all items of the history.' |
|
226 |
||
823 | 227 |
#historyMenuItem |
228 |
'Evaluates the text of the menu item for loading.' |
|
762 | 229 |
|
823 | 230 |
#test |
834 | 231 |
'Test functions.' |
762 | 232 |
|
233 |
) |
|
234 |
! ! |
|
235 |
||
753 | 236 |
!ToolApplicationModel class methodsFor:'history'! |
237 |
||
238 |
getHistory |
|
239 |
||
761
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
240 |
history isNil ifTrue: [history := OrderedCollection new]. |
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
241 |
^history |
753 | 242 |
|
243 |
! |
|
244 |
||
245 |
historyMaxSize |
|
246 |
||
247 |
^10 |
|
248 |
||
249 |
! ! |
|
250 |
||
251 |
!ToolApplicationModel class methodsFor:'interface specs'! |
|
252 |
||
797 | 253 |
windowSpecForCommit |
254 |
||
255 |
<resource: #canvas> |
|
256 |
||
257 |
^ |
|
859 | 258 |
|
797 | 259 |
#(#FullSpec |
859 | 260 |
#window: |
797 | 261 |
#(#WindowSpec |
859 | 262 |
#name: 'Commit Buttons' |
263 |
#layout: #(#LayoutFrame 442 0 276 0 741 0 335 0) |
|
264 |
#label: 'Commit Buttons' |
|
265 |
#min: #(#Point 100 22) |
|
266 |
#max: #(#Point 1152 900) |
|
267 |
#bounds: #(#Rectangle 442 276 742 336) |
|
268 |
#usePreferredExtent: false |
|
797 | 269 |
) |
859 | 270 |
#component: |
797 | 271 |
#(#SpecCollection |
859 | 272 |
#collection: |
797 | 273 |
#( |
274 |
#(#ActionButtonSpec |
|
859 | 275 |
#name: 'cancelButton' |
276 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
277 |
#activeHelpKey: #commitCancel |
|
278 |
#label: 'Cancel' |
|
279 |
#tabable: true |
|
280 |
#model: #cancel |
|
281 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 282 |
) |
283 |
#(#ActionButtonSpec |
|
859 | 284 |
#name: 'okButton' |
285 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
286 |
#activeHelpKey: #commitOK |
|
287 |
#label: 'OK' |
|
288 |
#tabable: true |
|
289 |
#model: #accept |
|
290 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 291 |
) |
292 |
) |
|
293 |
) |
|
294 |
) |
|
295 |
! |
|
296 |
||
297 |
windowSpecForCommitWithoutChannels |
|
298 |
||
299 |
<resource: #canvas> |
|
300 |
||
301 |
^ |
|
859 | 302 |
|
797 | 303 |
#(#FullSpec |
859 | 304 |
#window: |
797 | 305 |
#(#WindowSpec |
859 | 306 |
#name: 'Commit Buttons Without Channels' |
307 |
#layout: #(#LayoutFrame 435 0 290 0 734 0 349 0) |
|
308 |
#label: 'Commit Buttons Without Channels' |
|
309 |
#min: #(#Point 100 22) |
|
310 |
#max: #(#Point 1152 900) |
|
311 |
#bounds: #(#Rectangle 435 290 735 350) |
|
312 |
#usePreferredExtent: false |
|
797 | 313 |
) |
859 | 314 |
#component: |
797 | 315 |
#(#SpecCollection |
859 | 316 |
#collection: |
797 | 317 |
#( |
318 |
#(#ActionButtonSpec |
|
859 | 319 |
#name: 'cancelButton' |
320 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
321 |
#activeHelpKey: #commitCancel |
|
322 |
#label: 'Cancel' |
|
323 |
#tabable: true |
|
324 |
#model: #cancel |
|
797 | 325 |
) |
326 |
#(#ActionButtonSpec |
|
859 | 327 |
#name: 'okButton' |
328 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
329 |
#activeHelpKey: #commitOK |
|
330 |
#label: 'OK' |
|
331 |
#tabable: true |
|
332 |
#model: #accept |
|
797 | 333 |
) |
334 |
) |
|
335 |
) |
|
336 |
) |
|
337 |
! |
|
338 |
||
339 |
windowSpecForInfoBar |
|
340 |
||
341 |
<resource: #canvas> |
|
342 |
||
343 |
^ |
|
859 | 344 |
|
797 | 345 |
#(#FullSpec |
859 | 346 |
#window: |
797 | 347 |
#(#WindowSpec |
859 | 348 |
#name: 'Info Bar' |
349 |
#layout: #(#LayoutFrame 445 0 300 0 944 0 645 0) |
|
350 |
#label: 'Info Bar' |
|
351 |
#min: #(#Point 400 320) |
|
352 |
#max: #(#Point 1152 900) |
|
353 |
#bounds: #(#Rectangle 445 300 945 646) |
|
354 |
#menu: #menu |
|
355 |
#usePreferredExtent: false |
|
797 | 356 |
) |
859 | 357 |
#component: |
797 | 358 |
#(#SpecCollection |
859 | 359 |
#collection: |
797 | 360 |
#( |
820 | 361 |
#(#ViewSpec |
859 | 362 |
#name: 'view' |
363 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
364 |
#component: |
|
820 | 365 |
#(#SpecCollection |
859 | 366 |
#collection: |
820 | 367 |
#( |
368 |
#(#LabelSpec |
|
859 | 369 |
#name: 'infoLabel' |
370 |
#layout: #(#LayoutFrame 2 0.0 1 0.0 -1 1.0 -1 1.0) |
|
371 |
#labelChannel: #valueOfInfoLabel |
|
372 |
#level: -1 |
|
373 |
#adjust: #left |
|
820 | 374 |
) |
375 |
) |
|
376 |
) |
|
797 | 377 |
) |
378 |
) |
|
379 |
) |
|
380 |
) |
|
381 |
! |
|
382 |
||
383 |
windowSpecForInfoBarWithClock |
|
384 |
||
385 |
<resource: #canvas> |
|
386 |
||
387 |
^ |
|
859 | 388 |
|
797 | 389 |
#(#FullSpec |
859 | 390 |
#window: |
797 | 391 |
#(#WindowSpec |
859 | 392 |
#name: 'Info Bar' |
393 |
#layout: #(#LayoutFrame 417 0 298 0 916 0 643 0) |
|
394 |
#label: 'Info Bar' |
|
395 |
#min: #(#Point 400 320) |
|
396 |
#max: #(#Point 1152 900) |
|
397 |
#bounds: #(#Rectangle 417 298 917 644) |
|
398 |
#menu: #menu |
|
399 |
#usePreferredExtent: false |
|
797 | 400 |
) |
859 | 401 |
#component: |
797 | 402 |
#(#SpecCollection |
859 | 403 |
#collection: |
797 | 404 |
#( |
820 | 405 |
#(#ViewSpec |
859 | 406 |
#name: 'view' |
407 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
408 |
#component: |
|
820 | 409 |
#(#SpecCollection |
859 | 410 |
#collection: |
820 | 411 |
#( |
412 |
#(#LabelSpec |
|
859 | 413 |
#name: 'infoLabel' |
414 |
#layout: #(#LayoutFrame 2 0 1 0.0 -81 1 -1 1.0) |
|
415 |
#labelChannel: #valueOfInfoLabel |
|
416 |
#level: -1 |
|
417 |
#adjust: #left |
|
820 | 418 |
) |
419 |
#(#LabelSpec |
|
859 | 420 |
#name: 'timeLabel' |
421 |
#layout: #(#LayoutFrame -79 1 1 0.0 -1 1.0 -1 1.0) |
|
422 |
#labelChannel: #valueOfTimeLabel |
|
423 |
#level: -1 |
|
424 |
#adjust: #right |
|
820 | 425 |
) |
426 |
) |
|
427 |
) |
|
797 | 428 |
) |
429 |
) |
|
430 |
) |
|
431 |
) |
|
432 |
! ! |
|
433 |
||
434 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
435 |
||
753 | 436 |
menuAbout |
437 |
||
438 |
<resource: #menu> |
|
439 |
||
440 |
^ |
|
859 | 441 |
|
753 | 442 |
#(#Menu |
443 |
||
444 |
#( |
|
445 |
#(#MenuItem |
|
859 | 446 |
#label: 'About Smalltalk/X...' |
447 |
#translateLabel: true |
|
448 |
#value: #openAbout |
|
449 |
#activeHelpKey: #aboutSTX |
|
753 | 450 |
) |
451 |
#(#MenuItem |
|
859 | 452 |
#label: '-' |
753 | 453 |
) |
454 |
#(#MenuItem |
|
859 | 455 |
#label: 'About This Application...' |
456 |
#translateLabel: true |
|
457 |
#value: #openAboutThisApplication |
|
458 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 459 |
) |
460 |
) nil |
|
461 |
nil |
|
462 |
) |
|
463 |
! |
|
464 |
||
465 |
menuHelp |
|
466 |
||
467 |
<resource: #menu> |
|
468 |
||
469 |
^ |
|
859 | 470 |
|
753 | 471 |
#(#Menu |
472 |
||
473 |
#( |
|
474 |
#(#MenuItem |
|
859 | 475 |
#label: 'Open Documentation' |
476 |
#translateLabel: true |
|
477 |
#value: #openDocumentation |
|
478 |
#activeHelpKey: #helpTutorial |
|
479 |
#enabled: #valueOfHavingTutorial |
|
753 | 480 |
) |
481 |
#(#MenuItem |
|
859 | 482 |
#label: '-' |
753 | 483 |
) |
484 |
#(#MenuItem |
|
859 | 485 |
#label: 'Show Help Texts' |
486 |
#translateLabel: true |
|
487 |
#activeHelpKey: #helpShowHelp |
|
488 |
#indication: #showHelp: |
|
753 | 489 |
) |
490 |
) nil |
|
491 |
nil |
|
492 |
) |
|
493 |
! ! |
|
494 |
||
495 |
!ToolApplicationModel class methodsFor:'resources'! |
|
496 |
||
853 | 497 |
copyIcon |
498 |
"Generated by the Image Editor" |
|
499 |
" |
|
500 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
501 |
" |
|
502 |
||
503 |
<resource: #image> |
|
504 |
||
505 |
^Icon |
|
506 |
constantNamed:#'ToolApplicationModel copyIcon' |
|
507 |
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]! |
|
508 |
||
509 |
cutIcon |
|
510 |
"Generated by the Image Editor" |
|
511 |
" |
|
512 |
ImageEditor openOnClass:self andSelector:#cutIcon |
|
513 |
" |
|
514 |
||
515 |
<resource: #image> |
|
516 |
||
517 |
^Icon |
|
518 |
constantNamed:#'ToolApplicationModel cutIcon' |
|
519 |
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]! |
|
520 |
||
521 |
deleteIcon |
|
522 |
"Generated by the Image Editor" |
|
523 |
" |
|
524 |
ImageEditor openOnClass:self andSelector:#deleteIcon |
|
525 |
" |
|
526 |
||
527 |
<resource: #image> |
|
528 |
||
529 |
^Icon |
|
530 |
constantNamed:#'ToolApplicationModel deleteIcon' |
|
531 |
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]! |
|
532 |
||
803 | 533 |
desktopIcon |
534 |
||
851 | 535 |
^Icon |
536 |
constantNamed:#'ToolApplicationModel desktopIcon' |
|
537 |
ifAbsentPut: |
|
538 |
[ |
|
539 |
|desktopIcon| |
|
540 |
desktopIcon := self stxIcon. |
|
541 |
desktopIcon magnifiedBy: Display preferredIconSize/desktopIcon extent |
|
542 |
] |
|
543 |
||
803 | 544 |
|
545 |
||
546 |
||
547 |
! |
|
548 |
||
753 | 549 |
downIcon |
778 | 550 |
"Generated by the Image Editor" |
551 |
" |
|
552 |
ImageEditor openOnClass:self andSelector:#downIcon |
|
553 |
" |
|
753 | 554 |
|
555 |
<resource: #image> |
|
778 | 556 |
|
557 |
^Icon |
|
558 |
constantNamed:#'ToolApplicationModel downIcon' |
|
850 | 559 |
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] |
560 |
! |
|
753 | 561 |
|
562 |
downRightIcon |
|
778 | 563 |
"Generated by the Image Editor" |
564 |
" |
|
565 |
ImageEditor openOnClass:self andSelector:#downRightIcon |
|
566 |
" |
|
753 | 567 |
|
568 |
<resource: #image> |
|
778 | 569 |
|
570 |
^Icon |
|
571 |
constantNamed:#'ToolApplicationModel downRightIcon' |
|
850 | 572 |
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] |
573 |
! |
|
753 | 574 |
|
575 |
leftDownIcon |
|
778 | 576 |
"Generated by the Image Editor" |
577 |
" |
|
578 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
579 |
" |
|
753 | 580 |
|
581 |
<resource: #image> |
|
778 | 582 |
|
583 |
^Icon |
|
584 |
constantNamed:#'ToolApplicationModel leftDownIcon' |
|
850 | 585 |
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] |
586 |
! |
|
753 | 587 |
|
778 | 588 |
leftIcon |
589 |
"Generated by the Image Editor" |
|
590 |
" |
|
591 |
ImageEditor openOnClass:self andSelector:#leftIcon |
|
592 |
" |
|
753 | 593 |
|
594 |
<resource: #image> |
|
595 |
||
778 | 596 |
^Icon |
597 |
constantNamed:#'ToolApplicationModel leftIcon' |
|
850 | 598 |
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] |
599 |
! |
|
772 | 600 |
|
778 | 601 |
loadIcon |
602 |
"Generated by the Image Editor" |
|
603 |
" |
|
604 |
ImageEditor openOnClass:self andSelector:#loadIcon |
|
605 |
" |
|
753 | 606 |
|
607 |
<resource: #image> |
|
778 | 608 |
|
609 |
^Icon |
|
610 |
constantNamed:#'ToolApplicationModel loadIcon' |
|
850 | 611 |
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] |
612 |
! |
|
753 | 613 |
|
803 | 614 |
menuIcon |
615 |
||
851 | 616 |
^Icon |
617 |
constantNamed:#'ToolApplicationModel menuIcon' |
|
618 |
ifAbsentPut: |
|
619 |
[ |
|
620 |
|menuIcon| |
|
621 |
menuIcon := self stxIcon. |
|
622 |
menuIcon magnifiedBy: MenuPanel defaultFont height/menuIcon height |
|
623 |
] |
|
803 | 624 |
! |
625 |
||
778 | 626 |
newIcon |
627 |
"Generated by the Image Editor" |
|
628 |
" |
|
629 |
ImageEditor openOnClass:self andSelector:#newIcon |
|
630 |
" |
|
756 | 631 |
|
632 |
<resource: #image> |
|
778 | 633 |
|
634 |
^Icon |
|
635 |
constantNamed:#'ToolApplicationModel newIcon' |
|
850 | 636 |
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] |
637 |
! |
|
772 | 638 |
|
853 | 639 |
pasteIcon |
640 |
"Generated by the Image Editor" |
|
641 |
" |
|
642 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
643 |
" |
|
644 |
||
645 |
<resource: #image> |
|
646 |
||
647 |
^Icon |
|
648 |
constantNamed:#'ToolApplicationModel pasteIcon' |
|
649 |
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]! |
|
650 |
||
778 | 651 |
rightIcon |
652 |
"Generated by the Image Editor" |
|
653 |
" |
|
654 |
ImageEditor openOnClass:self andSelector:#rightIcon |
|
655 |
" |
|
753 | 656 |
|
657 |
<resource: #image> |
|
778 | 658 |
|
659 |
^Icon |
|
660 |
constantNamed:#'ToolApplicationModel rightIcon' |
|
850 | 661 |
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] |
662 |
! |
|
753 | 663 |
|
778 | 664 |
saveIcon |
665 |
"Generated by the Image Editor" |
|
666 |
" |
|
667 |
ImageEditor openOnClass:self andSelector:#saveIcon |
|
668 |
" |
|
753 | 669 |
|
670 |
<resource: #image> |
|
778 | 671 |
|
672 |
^Icon |
|
673 |
constantNamed:#'ToolApplicationModel saveIcon' |
|
850 | 674 |
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] |
778 | 675 |
! |
753 | 676 |
|
782 | 677 |
startIcon |
678 |
"Generated by the Image Editor" |
|
679 |
" |
|
680 |
ImageEditor openOnClass:self andSelector:#startIcon |
|
681 |
" |
|
682 |
||
683 |
<resource: #image> |
|
684 |
||
685 |
^Icon |
|
686 |
constantNamed:#'ToolApplicationModel startIcon' |
|
850 | 687 |
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] |
688 |
! |
|
782 | 689 |
|
778 | 690 |
stxIcon |
691 |
"Generated by the Image Editor" |
|
692 |
" |
|
693 |
ImageEditor openOnClass:self andSelector:#stxIcon |
|
694 |
" |
|
772 | 695 |
|
696 |
<resource: #image> |
|
753 | 697 |
|
778 | 698 |
^Icon |
699 |
constantNamed:#'ToolApplicationModel stxIcon' |
|
858 | 700 |
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]! |
753 | 701 |
|
702 |
upIcon |
|
778 | 703 |
"Generated by the Image Editor" |
704 |
" |
|
705 |
ImageEditor openOnClass:self andSelector:#upIcon |
|
706 |
" |
|
753 | 707 |
|
708 |
<resource: #image> |
|
778 | 709 |
|
710 |
^Icon |
|
711 |
constantNamed:#'ToolApplicationModel upIcon' |
|
850 | 712 |
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] |
713 |
! ! |
|
753 | 714 |
|
782 | 715 |
!ToolApplicationModel class methodsFor:'startup / release'! |
753 | 716 |
|
782 | 717 |
preSnapshot |
753 | 718 |
|
782 | 719 |
clipboard := nil |
720 |
||
753 | 721 |
! |
722 |
||
782 | 723 |
uninitialize |
760 | 724 |
|
782 | 725 |
showHelp := history := clipboard := nil |
753 | 726 |
! ! |
727 |
||
782 | 728 |
!ToolApplicationModel methodsFor:'aspects'! |
729 |
||
822 | 730 |
valueOfCanCopy |
731 |
||
732 |
|holder| |
|
733 |
(holder := builder bindingAt:#valueOfCanCopy) isNil ifTrue:[ |
|
734 |
builder aspectAt:#valueOfCanCopy put:(holder := false asValue). |
|
735 |
]. |
|
736 |
^ holder |
|
737 |
||
738 |
! |
|
739 |
||
740 |
valueOfCanCut |
|
741 |
||
742 |
|holder| |
|
743 |
(holder := builder bindingAt:#valueOfCanCut) isNil ifTrue:[ |
|
744 |
builder aspectAt:#valueOfCanCut put:(holder := false asValue). |
|
745 |
]. |
|
746 |
^ holder |
|
747 |
||
748 |
! |
|
749 |
||
750 |
valueOfCanPaste |
|
751 |
||
752 |
|holder| |
|
753 |
(holder := builder bindingAt:#valueOfCanPaste) isNil ifTrue:[ |
|
754 |
builder aspectAt:#valueOfCanPaste put:(holder := false asValue). |
|
755 |
]. |
|
756 |
^ holder |
|
757 |
||
758 |
! |
|
759 |
||
760 |
valueOfCanUndo |
|
761 |
||
762 |
|holder| |
|
763 |
(holder := builder bindingAt:#valueOfCanUndo) isNil ifTrue:[ |
|
764 |
builder aspectAt:#valueOfCanUndo put:(holder := false asValue). |
|
765 |
]. |
|
766 |
^ holder |
|
767 |
||
768 |
! |
|
769 |
||
782 | 770 |
valueOfEnablingCommitButtons |
753 | 771 |
|
782 | 772 |
|holder| |
773 |
(holder := builder bindingAt:#valueOfEnablingCommitButtons) isNil ifTrue:[ |
|
774 |
builder aspectAt:#valueOfEnablingCommitButtons put:(holder := false asValue). |
|
775 |
]. |
|
776 |
^ holder |
|
753 | 777 |
|
782 | 778 |
! |
779 |
||
780 |
valueOfHavingClipboard |
|
753 | 781 |
|
782 | 782 |
|holder| |
783 |
(holder := builder bindingAt:#valueOfHavingClipboard) isNil ifTrue:[ |
|
784 |
builder aspectAt:#valueOfHavingClipboard put:(holder := self class clipboard notNil asValue). |
|
785 |
]. |
|
786 |
^ holder |
|
753 | 787 |
|
782 | 788 |
! |
789 |
||
858 | 790 |
valueOfHavingDocumentation |
803 | 791 |
|
792 |
|holder| |
|
858 | 793 |
(holder := builder bindingAt:#valueOfHavingDocumentation) isNil ifTrue:[ |
794 |
builder aspectAt:#valueOfHavingDocumentation put:(holder := (self class implements: #openDocumentation) asValue). |
|
803 | 795 |
]. |
796 |
^ holder |
|
797 |
||
798 |
! |
|
799 |
||
858 | 800 |
valueOfHavingExamples |
801 |
||
802 |
|holder| |
|
803 |
(holder := builder bindingAt:#valueOfHavingExamples) isNil ifTrue:[ |
|
804 |
builder aspectAt:#valueOfHavingExamples put:(holder := (self class implements: #openExamples) asValue). |
|
805 |
]. |
|
806 |
^ holder |
|
807 |
||
808 |
! |
|
809 |
||
810 |
valueOfHavingTutorial |
|
811 |
||
812 |
^self valueOfHavingDocumentation |
|
813 |
||
814 |
! |
|
815 |
||
782 | 816 |
valueOfInfoLabel |
817 |
||
818 |
|holder| |
|
819 |
(holder := builder bindingAt:#valueOfInfoLabel) isNil ifTrue:[ |
|
820 |
builder aspectAt:#valueOfInfoLabel put:(holder := ValueHolder new). |
|
821 |
]. |
|
822 |
^ holder |
|
753 | 823 |
|
782 | 824 |
! |
825 |
||
826 |
valueOfTimeLabel |
|
753 | 827 |
|
782 | 828 |
|holder| |
829 |
(holder := builder bindingAt:#valueOfTimeLabel) isNil ifTrue:[ |
|
830 |
builder aspectAt:#valueOfTimeLabel put:(holder := ValueHolder new). |
|
831 |
]. |
|
832 |
^ holder |
|
753 | 833 |
|
834 |
! ! |
|
835 |
||
782 | 836 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 837 |
|
838 | 838 |
clipboard |
839 |
||
840 |
^self class clipboard |
|
841 |
! |
|
842 |
||
782 | 843 |
clipboard: anEditObject |
753 | 844 |
|
782 | 845 |
self class clipboard: anEditObject. |
753 | 846 |
|
782 | 847 |
self valueOfHavingClipboard value: anEditObject notNil |
848 |
! ! |
|
849 |
||
850 |
!ToolApplicationModel methodsFor:'help'! |
|
753 | 851 |
|
762 | 852 |
defaultInfoLabel |
853 |
||
854 |
^'' |
|
855 |
! |
|
856 |
||
753 | 857 |
openAbout |
858 |
"show an about box" |
|
859 |
||
860 |
|box| |
|
861 |
||
862 |
box := AboutBox new. |
|
863 |
box autoHideAfter:10 with:[]. |
|
864 |
box showAtCenter |
|
865 |
||
866 |
! |
|
867 |
||
868 |
openAboutThisApplication |
|
869 |
"show an about this application box" |
|
870 |
||
871 |
|rev box| |
|
872 |
rev := ''. |
|
873 |
self class revision notNil ifTrue: [rev := ' (rev: ', self class revision printString, ')']. |
|
874 |
box := AboutBox title: |
|
800 | 875 |
'\The application\\' withCRs |
850 | 876 |
, self class name asBoldText, rev |
877 |
, '\\has been designed and implemented by: \' withCRs |
|
878 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
|
800 | 879 |
, '\\' withCRs. |
753 | 880 |
|
881 |
box label:'About This Application'. |
|
882 |
box autoHideAfter:10 with:[]. |
|
883 |
box showAtCenter. |
|
884 |
! |
|
885 |
||
858 | 886 |
openHTMLDocument: aHTMLFilename |
887 |
||
888 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
889 |
! |
|
890 |
||
803 | 891 |
openTutorial: aHTMLFilename |
753 | 892 |
|
858 | 893 |
self openHTMLDocument: aHTMLFilename |
762 | 894 |
! |
895 |
||
782 | 896 |
showHelp |
897 |
"Answer whether showing help is turned on/off" |
|
898 |
||
783 | 899 |
|currentActiveHelp| |
858 | 900 |
|
783 | 901 |
currentActiveHelp := ActiveHelp currentHelpListener. |
902 |
||
903 |
^self class showHelp |
|
858 | 904 |
and: [currentActiveHelp notNil and: [masterApplication notNil |
905 |
ifFalse: [currentActiveHelp interestedIn: self window] |
|
906 |
ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
|
782 | 907 |
! |
908 |
||
909 |
showHelp: aValue |
|
910 |
"toggle showing help" |
|
911 |
||
912 |
(self class showHelp: aValue) |
|
913 |
ifTrue: [ActiveHelp startFor: self] |
|
822 | 914 |
ifFalse: [ActiveHelp stopFor: self. self updateInfoLabel] |
782 | 915 |
! |
916 |
||
762 | 917 |
showHelp:aHelpText for:view |
918 |
"display aHelpText in the info label or if present detour to masterApplication." |
|
919 |
||
782 | 920 |
self showHelp ifFalse: [^true]. |
762 | 921 |
self masterApplication notNil |
922 |
ifTrue: |
|
923 |
[ |
|
924 |
^masterApplication showHelp: aHelpText for:view |
|
925 |
] |
|
926 |
ifFalse: |
|
927 |
[ |
|
928 |
aHelpText isNil |
|
822 | 929 |
ifTrue: [self updateInfoLabel] |
762 | 930 |
ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString upTo: Character cr)]. |
931 |
||
932 |
^true |
|
933 |
] |
|
822 | 934 |
! |
935 |
||
936 |
updateInfoLabel |
|
937 |
||
938 |
self valueOfInfoLabel value: self defaultInfoLabel |
|
762 | 939 |
! ! |
940 |
||
753 | 941 |
!ToolApplicationModel methodsFor:'history'! |
942 |
||
943 |
addToHistory: aHistoryEntry |
|
944 |
||
782 | 945 |
aHistoryEntry key size = 0 ifTrue: [^nil]. |
753 | 946 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
947 |
self history addFirst: aHistoryEntry. |
|
948 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
949 |
! |
|
950 |
||
951 |
emptyHistory |
|
952 |
||
953 |
^self history removeAll |
|
954 |
! |
|
955 |
||
956 |
history |
|
957 |
||
958 |
^self class getHistory |
|
959 |
! |
|
960 |
||
844 | 961 |
historyEntries |
962 |
||
963 |
^self history collect: [:asso| asso key] |
|
964 |
! |
|
965 |
||
753 | 966 |
menuHistory |
967 |
||
968 |
|menu a| |
|
969 |
menu := Menu new receiver: self. |
|
970 |
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do: |
|
971 |
[:historyEntryType| |
|
803 | 972 |
menu addItemGroup: ((a := self history select: [:histEntry| histEntry value = historyEntryType]) collect: [:histEntry| MenuItem new label: histEntry key printString; value: histEntry value; argument: histEntry key; activeHelpKey: #historyMenuItem]). |
753 | 973 |
]. |
803 | 974 |
menu addItem: (MenuItem new label: 'Empty History'; value: #emptyHistory; activeHelpKey: #historyEmptyMenu). |
753 | 975 |
|
976 |
^menu |
|
977 |
! |
|
978 |
||
979 |
removeFromHistory: aHistoryEntry |
|
980 |
||
981 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
982 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
983 |
! ! |
|
984 |
||
782 | 985 |
!ToolApplicationModel methodsFor:'queries'! |
986 |
||
987 |
preferredExtent |
|
988 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
989 |
will be considered" |
|
990 |
||
991 |
|window menu menuToolbarView preferredExtentOfWindow| |
|
992 |
||
993 |
window := self builder window. |
|
994 |
menu := window subViews first. |
|
995 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
996 |
||
997 |
preferredExtentOfWindow := window extent. |
|
998 |
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent]. |
|
999 |
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent]. |
|
1000 |
||
1001 |
^window minExtent max: (preferredExtentOfWindow min: window maxExtent) |
|
1002 |
! ! |
|
1003 |
||
753 | 1004 |
!ToolApplicationModel methodsFor:'startup / release'! |
1005 |
||
833 | 1006 |
allButOpenInterface:aSymbol |
1007 |
||
1008 |
super allButOpenInterface:aSymbol. |
|
1009 |
||
1010 |
builder window extent: self preferredExtent. |
|
1011 |
builder window label: self class label. |
|
1012 |
||
1013 |
^builder |
|
1014 |
! |
|
1015 |
||
753 | 1016 |
close |
1017 |
||
756 | 1018 |
self uninitialize. |
1019 |
||
753 | 1020 |
super close |
1021 |
! |
|
1022 |
||
1023 |
closeRequest |
|
1024 |
||
756 | 1025 |
self uninitialize. |
1026 |
||
753 | 1027 |
super closeRequest |
1028 |
! |
|
1029 |
||
790 | 1030 |
postOpenWith:aBuilder |
1031 |
||
1032 |
super postOpenWith:aBuilder. |
|
1033 |
||
791 | 1034 |
self class showHelp ifTrue: [ActiveHelp startFor: self]. |
822 | 1035 |
self updateInfoLabel. |
790 | 1036 |
! |
1037 |
||
753 | 1038 |
reOpen |
1039 |
||
1040 |
self close. |
|
1041 |
||
1042 |
self class open |
|
1043 |
! |
|
1044 |
||
760 | 1045 |
removeAllTemporalViews |
1046 |
||
1047 |
self builder namedComponents keys copy do: |
|
1048 |
[:comp| |
|
1049 |
(comp includesString: '_Temporal') ifTrue: [self builder namedComponents removeKey: comp] |
|
1050 |
] |
|
1051 |
! |
|
1052 |
||
853 | 1053 |
startClockOnTimedBlock: aBlock |
1054 |
||
1055 |
timeBlock := aBlock. |
|
1056 |
aBlock value. |
|
1057 |
||
1058 |
! |
|
1059 |
||
756 | 1060 |
uninitialize |
1061 |
||
782 | 1062 |
self showHelp ifTrue: [ActiveHelp stopFor: self]. |
756 | 1063 |
Processor removeTimedBlock:timeBlock. |
1064 |
timeBlock := nil. |
|
753 | 1065 |
! ! |
1066 |
||
1067 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
1068 |
||
1069 |
version |
|
859 | 1070 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.46 1998-03-05 22:56:53 tz Exp $' |
753 | 1071 |
! ! |