author | Claus Gittinger <cg@exept.de> |
Mon, 24 Aug 1998 21:51:18 +0200 | |
changeset 1054 | ab639131be1f |
parent 1051 | 65dfbf6481b5 |
child 1055 | 96243355fda6 |
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 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
22 |
ToolApplicationModel class instanceVariableNames:'history clipboard settings showingHelp' |
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 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
99 |
"returns the label for the tool instances of this class; |
907 | 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 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
111 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
112 |
"Modified: / 31.7.1998 / 18:04:18 / cg" |
782 | 113 |
! |
114 |
||
850 | 115 |
settings |
907 | 116 |
"returns the settings dictionary" |
850 | 117 |
|
872 | 118 |
settings isNil ifTrue: [settings := IdentityDictionary new]. |
119 |
^settings |
|
850 | 120 |
! |
121 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
122 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
123 |
"returns true if active help is turned on for instances of this class" |
782 | 124 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
125 |
showingHelp isNil ifTrue: [showingHelp := true]. |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
126 |
^showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
127 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
128 |
"Created: / 31.7.1998 / 18:03:38 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
129 |
"Modified: / 31.7.1998 / 18:16:55 / cg" |
782 | 130 |
! |
131 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
132 |
showingHelp: aBoolean |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
133 |
"enable/disable active help for instances of this class" |
782 | 134 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
135 |
^ showingHelp := aBoolean |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
136 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
137 |
"Modified: / 31.7.1998 / 18:17:14 / cg" |
753 | 138 |
! ! |
139 |
||
756 | 140 |
!ToolApplicationModel class methodsFor:'clipboard'! |
141 |
||
142 |
clipboard |
|
907 | 143 |
"returns the clipboard of this tool class" |
756 | 144 |
|
145 |
^clipboard |
|
146 |
! |
|
147 |
||
148 |
clipboard: anEditObject |
|
907 | 149 |
"sets the clipboard for this tool class" |
756 | 150 |
|
151 |
clipboard := anEditObject |
|
152 |
! ! |
|
153 |
||
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
154 |
!ToolApplicationModel class methodsFor:'help'! |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
155 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
156 |
openAboutSTX |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
157 |
"opens an about box (on ST/X)" |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
158 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
159 |
|box| |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
160 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
161 |
AboutBox isNil ifTrue:[ |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
162 |
"/ this handles bad installations of ST/X, |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
163 |
"/ where the AboutBox is missing. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
164 |
"/ (May vanish in the future) |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
165 |
^ self information:('Smalltalk/X rev.' , Smalltalk versionString) |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
166 |
]. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
167 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
168 |
box := AboutBox new. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
169 |
box autoHideAfter:10 with:[]. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
170 |
box showAtPointer |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
171 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
172 |
"Modified: / 14.8.1998 / 13:03:58 / cg" |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
173 |
"Created: / 14.8.1998 / 13:17:43 / cg" |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
174 |
! ! |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
175 |
|
762 | 176 |
!ToolApplicationModel class methodsFor:'help specs'! |
177 |
||
178 |
helpSpec |
|
869 | 179 |
"This resource specification was automatically generated |
180 |
by the UIHelpTool of ST/X." |
|
181 |
||
182 |
"Do not manually edit this!! If it is corrupted, |
|
183 |
the UIHelpTool may not be able to read the specification." |
|
762 | 184 |
|
185 |
" |
|
869 | 186 |
UIHelpTool openOnClass:ToolApplicationModel |
762 | 187 |
" |
188 |
||
869 | 189 |
<resource: #help> |
190 |
||
191 |
^super helpSpec addPairsFrom:#( |
|
762 | 192 |
|
823 | 193 |
#about |
834 | 194 |
'About functions.' |
823 | 195 |
|
762 | 196 |
#aboutSTX |
910 | 197 |
'Open an InfoBox showing details of the running ST/X.' |
762 | 198 |
|
199 |
#aboutThisAppliaction |
|
910 | 200 |
'Open an InfoBox about that applications release and its author.' |
762 | 201 |
|
823 | 202 |
#add |
834 | 203 |
'Add functions.' |
823 | 204 |
|
205 |
#commitCancel |
|
910 | 206 |
'Cancels changes.' |
823 | 207 |
|
208 |
#commitOK |
|
910 | 209 |
'Commit changes.' |
823 | 210 |
|
211 |
#edit |
|
834 | 212 |
'Edit functions.' |
823 | 213 |
|
214 |
#editCopy |
|
910 | 215 |
'Copy the selected item(s) to the clipboard.' |
762 | 216 |
|
782 | 217 |
#editCut |
910 | 218 |
'Move the selected item(s) to the clipboard.' |
853 | 219 |
|
220 |
#editDelete |
|
910 | 221 |
'Delete the selected item(s).' |
782 | 222 |
|
823 | 223 |
#editMoveDown |
910 | 224 |
'Moves the selected item one step down in the order list.' |
823 | 225 |
|
226 |
#editMoveIn |
|
834 | 227 |
'Moves the selected item into next item as child item.' |
823 | 228 |
|
229 |
#editMoveOut |
|
910 | 230 |
'Moves the selected item out of its parent item.' |
823 | 231 |
|
232 |
#editMoveUp |
|
910 | 233 |
'Moves the selected item one step up in the order list.' |
782 | 234 |
|
235 |
#editPaste |
|
910 | 236 |
'Paste from the clipboard.' |
782 | 237 |
|
238 |
#editUndo |
|
910 | 239 |
'Undo the last action.' |
782 | 240 |
|
823 | 241 |
#file |
834 | 242 |
'File functions.' |
805 | 243 |
|
823 | 244 |
#fileBrowseClass |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
245 |
'Open a System Browser on the current class.' |
805 | 246 |
|
823 | 247 |
#fileDefineClass |
910 | 248 |
'Open a dialog to define the current class.' |
805 | 249 |
|
250 |
#fileDefineClassAndSelector |
|
910 | 251 |
'Open a dialog to define the current class and selector.' |
805 | 252 |
|
823 | 253 |
#fileExit |
910 | 254 |
'Exit this application.' |
823 | 255 |
|
922 | 256 |
#generate |
257 |
'Code generation.' |
|
258 |
||
823 | 259 |
#help |
834 | 260 |
'Help functions.' |
823 | 261 |
|
876 | 262 |
#helpHelpTool |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
263 |
'Show the Help Tools documentation.' |
876 | 264 |
|
823 | 265 |
#helpShowHelp |
910 | 266 |
'Toggle display of help texts.' |
823 | 267 |
|
268 |
#helpTutorial |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
269 |
'Show this applications documentation.' |
823 | 270 |
|
271 |
#history |
|
834 | 272 |
'History functions.' |
803 | 273 |
|
274 |
#historyEmptyMenu |
|
1016 | 275 |
'Clear the history.' |
803 | 276 |
|
823 | 277 |
#historyMenuItem |
1016 | 278 |
'Switch to that item.' |
762 | 279 |
|
893 | 280 |
#settings |
281 |
'Settings functions.' |
|
282 |
||
823 | 283 |
#test |
834 | 284 |
'Test functions.' |
762 | 285 |
|
286 |
) |
|
1015 | 287 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
288 |
"Modified: / 31.7.1998 / 19:28:14 / cg" |
762 | 289 |
! ! |
290 |
||
753 | 291 |
!ToolApplicationModel class methodsFor:'history'! |
292 |
||
293 |
getHistory |
|
907 | 294 |
"returns the history for this tool class" |
753 | 295 |
|
761
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
296 |
history isNil ifTrue: [history := OrderedCollection new]. |
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
297 |
^history |
753 | 298 |
|
299 |
! |
|
300 |
||
301 |
historyMaxSize |
|
907 | 302 |
"returns the maximum size for the history of this tool class" |
753 | 303 |
|
304 |
^10 |
|
305 |
||
306 |
! ! |
|
307 |
||
869 | 308 |
!ToolApplicationModel class methodsFor:'image specs'! |
309 |
||
310 |
desktopIcon |
|
907 | 311 |
"returns the icon used for the desktop" |
869 | 312 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
313 |
<resource: #programImage> |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
314 |
|
869 | 315 |
^Icon |
316 |
constantNamed:#'ToolApplicationModel desktopIcon' |
|
317 |
ifAbsentPut: |
|
318 |
[ |
|
319 |
|desktopIcon| |
|
990 | 320 |
desktopIcon := Icon stxIcon. |
869 | 321 |
desktopIcon magnifiedBy: Display preferredIconSize/desktopIcon extent |
322 |
] |
|
323 |
||
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
324 |
"Modified: / 24.8.1998 / 21:34:38 / cg" |
869 | 325 |
! |
326 |
||
327 |
menuIcon |
|
907 | 328 |
"returns the icon used for the menu bar" |
869 | 329 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
330 |
<resource: #programImage> |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
331 |
|
869 | 332 |
^Icon |
333 |
constantNamed:#'ToolApplicationModel menuIcon' |
|
334 |
ifAbsentPut: |
|
335 |
[ |
|
336 |
|menuIcon| |
|
990 | 337 |
menuIcon := Icon stxIcon. |
869 | 338 |
menuIcon magnifiedBy: MenuPanel defaultFont height/menuIcon height |
339 |
] |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
340 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
341 |
"Modified: / 24.8.1998 / 21:34:33 / cg" |
987 | 342 |
! ! |
869 | 343 |
|
753 | 344 |
!ToolApplicationModel class methodsFor:'interface specs'! |
345 |
||
797 | 346 |
windowSpecForCommit |
869 | 347 |
"This resource specification was automatically generated |
348 |
by the UIPainter of ST/X." |
|
349 |
||
350 |
"Do not manually edit this!! If it is corrupted, |
|
351 |
the UIPainter may not be able to read the specification." |
|
352 |
||
353 |
" |
|
354 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit |
|
355 |
ToolApplicationModel new openInterface:#windowSpecForCommit |
|
356 |
" |
|
797 | 357 |
|
358 |
<resource: #canvas> |
|
359 |
||
360 |
^ |
|
859 | 361 |
|
797 | 362 |
#(#FullSpec |
859 | 363 |
#window: |
797 | 364 |
#(#WindowSpec |
859 | 365 |
#name: 'Commit Buttons' |
869 | 366 |
#layout: #(#LayoutFrame 344 0 371 0 643 0 430 0) |
859 | 367 |
#label: 'Commit Buttons' |
368 |
#min: #(#Point 100 22) |
|
369 |
#max: #(#Point 1152 900) |
|
869 | 370 |
#bounds: #(#Rectangle 344 371 644 431) |
859 | 371 |
#usePreferredExtent: false |
797 | 372 |
) |
859 | 373 |
#component: |
797 | 374 |
#(#SpecCollection |
859 | 375 |
#collection: |
797 | 376 |
#( |
377 |
#(#ActionButtonSpec |
|
859 | 378 |
#name: 'cancelButton' |
379 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
380 |
#activeHelpKey: #commitCancel |
|
381 |
#label: 'Cancel' |
|
927 | 382 |
#translateLabel: true |
859 | 383 |
#tabable: true |
384 |
#model: #cancel |
|
385 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 386 |
) |
387 |
#(#ActionButtonSpec |
|
859 | 388 |
#name: 'okButton' |
389 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
390 |
#activeHelpKey: #commitOK |
|
391 |
#label: 'OK' |
|
927 | 392 |
#translateLabel: true |
859 | 393 |
#tabable: true |
394 |
#model: #accept |
|
395 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 396 |
) |
397 |
) |
|
398 |
) |
|
399 |
) |
|
927 | 400 |
|
401 |
"Modified: / 20.5.1998 / 03:31:54 / cg" |
|
797 | 402 |
! |
403 |
||
404 |
windowSpecForCommitWithoutChannels |
|
869 | 405 |
"This resource specification was automatically generated |
406 |
by the UIPainter of ST/X." |
|
407 |
||
408 |
"Do not manually edit this!! If it is corrupted, |
|
409 |
the UIPainter may not be able to read the specification." |
|
410 |
||
411 |
" |
|
412 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels |
|
413 |
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels |
|
414 |
" |
|
797 | 415 |
|
416 |
<resource: #canvas> |
|
417 |
||
418 |
^ |
|
859 | 419 |
|
797 | 420 |
#(#FullSpec |
859 | 421 |
#window: |
797 | 422 |
#(#WindowSpec |
859 | 423 |
#name: 'Commit Buttons Without Channels' |
869 | 424 |
#layout: #(#LayoutFrame 500 0 326 0 799 0 385 0) |
859 | 425 |
#label: 'Commit Buttons Without Channels' |
426 |
#min: #(#Point 100 22) |
|
427 |
#max: #(#Point 1152 900) |
|
869 | 428 |
#bounds: #(#Rectangle 500 326 800 386) |
859 | 429 |
#usePreferredExtent: false |
797 | 430 |
) |
859 | 431 |
#component: |
797 | 432 |
#(#SpecCollection |
859 | 433 |
#collection: |
797 | 434 |
#( |
435 |
#(#ActionButtonSpec |
|
859 | 436 |
#name: 'cancelButton' |
437 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
438 |
#activeHelpKey: #commitCancel |
|
439 |
#label: 'Cancel' |
|
927 | 440 |
#translateLabel: true |
859 | 441 |
#tabable: true |
442 |
#model: #cancel |
|
797 | 443 |
) |
444 |
#(#ActionButtonSpec |
|
859 | 445 |
#name: 'okButton' |
446 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
447 |
#activeHelpKey: #commitOK |
|
448 |
#label: 'OK' |
|
927 | 449 |
#translateLabel: true |
859 | 450 |
#tabable: true |
451 |
#model: #accept |
|
797 | 452 |
) |
453 |
) |
|
454 |
) |
|
455 |
) |
|
927 | 456 |
|
457 |
"Modified: / 20.5.1998 / 03:30:09 / cg" |
|
797 | 458 |
! |
459 |
||
460 |
windowSpecForInfoBar |
|
869 | 461 |
"This resource specification was automatically generated |
462 |
by the UIPainter of ST/X." |
|
463 |
||
464 |
"Do not manually edit this!! If it is corrupted, |
|
465 |
the UIPainter may not be able to read the specification." |
|
466 |
||
467 |
" |
|
468 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar |
|
469 |
ToolApplicationModel new openInterface:#windowSpecForInfoBar |
|
470 |
" |
|
797 | 471 |
|
472 |
<resource: #canvas> |
|
473 |
||
474 |
^ |
|
859 | 475 |
|
797 | 476 |
#(#FullSpec |
859 | 477 |
#window: |
797 | 478 |
#(#WindowSpec |
859 | 479 |
#name: 'Info Bar' |
869 | 480 |
#layout: #(#LayoutFrame 233 0 218 0 732 0 563 0) |
859 | 481 |
#label: 'Info Bar' |
482 |
#min: #(#Point 400 320) |
|
483 |
#max: #(#Point 1152 900) |
|
869 | 484 |
#bounds: #(#Rectangle 233 218 733 564) |
859 | 485 |
#menu: #menu |
486 |
#usePreferredExtent: false |
|
797 | 487 |
) |
859 | 488 |
#component: |
797 | 489 |
#(#SpecCollection |
859 | 490 |
#collection: |
797 | 491 |
#( |
820 | 492 |
#(#ViewSpec |
859 | 493 |
#name: 'view' |
494 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
495 |
#component: |
|
820 | 496 |
#(#SpecCollection |
859 | 497 |
#collection: |
820 | 498 |
#( |
499 |
#(#LabelSpec |
|
859 | 500 |
#name: 'infoLabel' |
501 |
#layout: #(#LayoutFrame 2 0.0 1 0.0 -1 1.0 -1 1.0) |
|
502 |
#labelChannel: #valueOfInfoLabel |
|
503 |
#level: -1 |
|
504 |
#adjust: #left |
|
869 | 505 |
#resizeForLabel: false |
820 | 506 |
) |
507 |
) |
|
508 |
) |
|
797 | 509 |
) |
510 |
) |
|
511 |
) |
|
512 |
) |
|
513 |
! |
|
514 |
||
515 |
windowSpecForInfoBarWithClock |
|
869 | 516 |
"This resource specification was automatically generated |
517 |
by the UIPainter of ST/X." |
|
518 |
||
519 |
"Do not manually edit this!! If it is corrupted, |
|
520 |
the UIPainter may not be able to read the specification." |
|
521 |
||
522 |
" |
|
523 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBarWithClock |
|
524 |
ToolApplicationModel new openInterface:#windowSpecForInfoBarWithClock |
|
525 |
" |
|
797 | 526 |
|
527 |
<resource: #canvas> |
|
528 |
||
529 |
^ |
|
859 | 530 |
|
797 | 531 |
#(#FullSpec |
859 | 532 |
#window: |
797 | 533 |
#(#WindowSpec |
859 | 534 |
#name: 'Info Bar' |
872 | 535 |
#layout: #(#LayoutFrame 160 0 423 0 659 0 453 0) |
859 | 536 |
#label: 'Info Bar' |
537 |
#min: #(#Point 400 320) |
|
538 |
#max: #(#Point 1152 900) |
|
872 | 539 |
#bounds: #(#Rectangle 160 423 660 454) |
859 | 540 |
#menu: #menu |
541 |
#usePreferredExtent: false |
|
797 | 542 |
) |
859 | 543 |
#component: |
797 | 544 |
#(#SpecCollection |
859 | 545 |
#collection: |
797 | 546 |
#( |
820 | 547 |
#(#ViewSpec |
859 | 548 |
#name: 'view' |
549 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
550 |
#component: |
|
820 | 551 |
#(#SpecCollection |
859 | 552 |
#collection: |
820 | 553 |
#( |
554 |
#(#LabelSpec |
|
859 | 555 |
#name: 'infoLabel' |
556 |
#layout: #(#LayoutFrame 2 0 1 0.0 -81 1 -1 1.0) |
|
557 |
#labelChannel: #valueOfInfoLabel |
|
558 |
#level: -1 |
|
559 |
#adjust: #left |
|
872 | 560 |
#resizeForLabel: false |
820 | 561 |
) |
562 |
#(#LabelSpec |
|
859 | 563 |
#name: 'timeLabel' |
564 |
#layout: #(#LayoutFrame -79 1 1 0.0 -1 1.0 -1 1.0) |
|
565 |
#labelChannel: #valueOfTimeLabel |
|
566 |
#level: -1 |
|
567 |
#adjust: #right |
|
872 | 568 |
#resizeForLabel: false |
820 | 569 |
) |
570 |
) |
|
571 |
) |
|
797 | 572 |
) |
573 |
) |
|
574 |
) |
|
575 |
) |
|
576 |
! ! |
|
577 |
||
578 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
579 |
||
753 | 580 |
menuAbout |
869 | 581 |
"This resource specification was automatically generated |
582 |
by the MenuEditor of ST/X." |
|
583 |
||
584 |
"Do not manually edit this!! If it is corrupted, |
|
585 |
the MenuEditor may not be able to read the specification." |
|
586 |
||
587 |
" |
|
588 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuAbout |
|
589 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp |
|
590 |
" |
|
753 | 591 |
|
592 |
<resource: #menu> |
|
593 |
||
594 |
^ |
|
859 | 595 |
|
753 | 596 |
#(#Menu |
597 |
||
598 |
#( |
|
599 |
#(#MenuItem |
|
859 | 600 |
#label: 'About Smalltalk/X...' |
601 |
#translateLabel: true |
|
602 |
#value: #openAbout |
|
603 |
#activeHelpKey: #aboutSTX |
|
753 | 604 |
) |
605 |
#(#MenuItem |
|
859 | 606 |
#label: '-' |
753 | 607 |
) |
608 |
#(#MenuItem |
|
922 | 609 |
#label: 'About this Application...' |
859 | 610 |
#translateLabel: true |
611 |
#value: #openAboutThisApplication |
|
612 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 613 |
) |
614 |
) nil |
|
615 |
nil |
|
616 |
) |
|
922 | 617 |
|
618 |
"Modified: / 19.5.1998 / 21:44:09 / cg" |
|
753 | 619 |
! |
620 |
||
869 | 621 |
menuFont |
622 |
"This resource specification was automatically generated |
|
623 |
by the MenuEditor of ST/X." |
|
624 |
||
625 |
"Do not manually edit this!! If it is corrupted, |
|
626 |
the MenuEditor may not be able to read the specification." |
|
627 |
||
628 |
" |
|
629 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuFont |
|
630 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuFont)) startUp |
|
631 |
" |
|
632 |
||
633 |
<resource: #menu> |
|
634 |
||
635 |
^ |
|
636 |
||
637 |
#(#Menu |
|
638 |
||
639 |
#( |
|
640 |
#(#MenuItem |
|
872 | 641 |
#label: 'Label...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
642 |
#translateLabel: true |
869 | 643 |
#value: #chooseFont: |
644 |
#argument: 'Label Font' |
|
645 |
) |
|
646 |
#(#MenuItem |
|
872 | 647 |
#label: 'Button...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
648 |
#translateLabel: true |
869 | 649 |
#value: #chooseFont: |
650 |
#argument: 'Button Font' |
|
651 |
) |
|
652 |
#(#MenuItem |
|
872 | 653 |
#label: 'Edit...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
654 |
#translateLabel: true |
869 | 655 |
#value: #chooseFont: |
656 |
#argument: 'Edit Font' |
|
657 |
) |
|
658 |
#(#MenuItem |
|
872 | 659 |
#label: 'List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
660 |
#translateLabel: true |
869 | 661 |
#value: #chooseFont: |
662 |
#argument: 'List Font' |
|
663 |
) |
|
664 |
#(#MenuItem |
|
872 | 665 |
#label: 'Tree List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
666 |
#translateLabel: true |
869 | 667 |
#value: #chooseFont: |
668 |
#argument: 'Tree List Font' |
|
669 |
) |
|
670 |
#(#MenuItem |
|
872 | 671 |
#label: 'Note Book...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
672 |
#translateLabel: true |
872 | 673 |
#value: #chooseFont: |
674 |
#argument: 'Note Book Font' |
|
675 |
) |
|
676 |
#(#MenuItem |
|
677 |
#label: 'Framed Box...' |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
678 |
#translateLabel: true |
872 | 679 |
#value: #chooseFont: |
680 |
#argument: 'Framed Box Font' |
|
681 |
) |
|
682 |
#(#MenuItem |
|
869 | 683 |
#label: '-' |
684 |
) |
|
685 |
#(#MenuItem |
|
872 | 686 |
#label: 'Reset' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
687 |
#translateLabel: true |
869 | 688 |
#value: #resetFonts |
689 |
) |
|
690 |
) nil |
|
691 |
nil |
|
692 |
) |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
693 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
694 |
"Modified: / 31.7.1998 / 18:55:34 / cg" |
869 | 695 |
! |
696 |
||
753 | 697 |
menuHelp |
869 | 698 |
"This resource specification was automatically generated |
699 |
by the MenuEditor of ST/X." |
|
700 |
||
701 |
"Do not manually edit this!! If it is corrupted, |
|
702 |
the MenuEditor may not be able to read the specification." |
|
703 |
||
704 |
" |
|
705 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp |
|
706 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp |
|
707 |
" |
|
753 | 708 |
|
709 |
<resource: #menu> |
|
710 |
||
711 |
^ |
|
859 | 712 |
|
753 | 713 |
#(#Menu |
714 |
||
715 |
#( |
|
716 |
#(#MenuItem |
|
876 | 717 |
#label: 'Documentation' |
859 | 718 |
#translateLabel: true |
719 |
#value: #openDocumentation |
|
720 |
#activeHelpKey: #helpTutorial |
|
907 | 721 |
#enabled: #valueOfHavingDocumentation |
753 | 722 |
) |
723 |
#(#MenuItem |
|
859 | 724 |
#label: '-' |
753 | 725 |
) |
726 |
#(#MenuItem |
|
859 | 727 |
#label: 'Show Help Texts' |
728 |
#translateLabel: true |
|
729 |
#activeHelpKey: #helpShowHelp |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
730 |
#indication: #showingHelp: |
753 | 731 |
) |
732 |
) nil |
|
733 |
nil |
|
734 |
) |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
735 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
736 |
"Modified: / 31.7.1998 / 18:19:42 / cg" |
753 | 737 |
! ! |
738 |
||
907 | 739 |
!ToolApplicationModel class methodsFor:'queries'! |
740 |
||
987 | 741 |
getAllImageSelectorsFrom: aClass |
742 |
"returns all image selectors implementing an image spec in class aClass" |
|
743 |
||
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
744 |
|iconClass imageMethodSelectors r| |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
745 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
746 |
aClass isNil ifTrue:[ |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
747 |
^ #() |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
748 |
]. |
987 | 749 |
|
750 |
aClass isSymbol |
|
751 |
ifTrue: [iconClass := Smalltalk at: aClass] |
|
752 |
ifFalse: [iconClass := aClass]. |
|
753 |
||
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
754 |
imageMethodSelectors := OrderedCollection new. |
987 | 755 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
756 |
iconClass withAllSuperclasses do:[:cls | |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
757 |
cls class methodDictionary keysAndValuesDo: [:sel :m | |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
758 |
(r := m resourceType == #image |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
759 |
or:[r == #programImage]) ifTrue:[ |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
760 |
imageMethodSelectors add:sel |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
761 |
] |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
762 |
] |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
763 |
]. |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
764 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
765 |
^ imageMethodSelectors asSortedCollection asOrderedCollection |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
766 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
767 |
"Modified: / 24.8.1998 / 21:42:34 / cg" |
987 | 768 |
! |
769 |
||
907 | 770 |
isVisualStartable |
771 |
"returns whether this application class can be started via #open" |
|
772 |
||
773 |
self == ToolApplicationModel ifTrue:[^false]. |
|
774 |
^super isVisualStartable |
|
775 |
||
776 |
! ! |
|
777 |
||
782 | 778 |
!ToolApplicationModel class methodsFor:'startup / release'! |
753 | 779 |
|
782 | 780 |
preSnapshot |
907 | 781 |
"removes the clipboard before snap shoting" |
753 | 782 |
|
782 | 783 |
clipboard := nil |
753 | 784 |
! |
785 |
||
782 | 786 |
uninitialize |
907 | 787 |
"resets the class instance variables" |
760 | 788 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
789 |
settings := showingHelp := history := clipboard := nil |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
790 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
791 |
"Modified: / 31.7.1998 / 18:19:37 / cg" |
753 | 792 |
! ! |
793 |
||
782 | 794 |
!ToolApplicationModel methodsFor:'aspects'! |
795 |
||
822 | 796 |
valueOfCanCopy |
907 | 797 |
"returns whether can copy as value holder" |
822 | 798 |
|
936 | 799 |
^ builder booleanValueAspectFor:#valueOfCanCopy |
822 | 800 |
|
936 | 801 |
"Modified: / 21.5.1998 / 03:39:05 / cg" |
822 | 802 |
! |
803 |
||
804 |
valueOfCanCut |
|
907 | 805 |
"returns whether can paste as value holder" |
822 | 806 |
|
936 | 807 |
^ builder booleanValueAspectFor:#valueOfCanCut |
822 | 808 |
|
936 | 809 |
"Modified: / 21.5.1998 / 03:39:13 / cg" |
822 | 810 |
! |
811 |
||
812 |
valueOfCanPaste |
|
907 | 813 |
"returns whether can paste as value holder" |
822 | 814 |
|
936 | 815 |
^ builder booleanValueAspectFor:#valueOfCanPaste |
822 | 816 |
|
936 | 817 |
"Modified: / 21.5.1998 / 03:39:22 / cg" |
822 | 818 |
! |
819 |
||
820 |
valueOfCanUndo |
|
907 | 821 |
"returns whether can undo as value holder" |
822 | 822 |
|
936 | 823 |
^ builder booleanValueAspectFor:#valueOfCanUndo |
822 | 824 |
|
936 | 825 |
"Modified: / 21.5.1998 / 03:39:31 / cg" |
822 | 826 |
! |
827 |
||
782 | 828 |
valueOfEnablingCommitButtons |
907 | 829 |
"returns the enabling of the commit of this tool as value holder" |
753 | 830 |
|
936 | 831 |
^ builder booleanValueAspectFor:#valueOfEnablingCommitButtons |
753 | 832 |
|
936 | 833 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
782 | 834 |
! |
835 |
||
858 | 836 |
valueOfHavingDocumentation |
1004 | 837 |
"returns the enabling of having documentation for this tool as value holder" |
803 | 838 |
|
1004 | 839 |
^ (builder booleanValueAspectFor:#valueOfEnablingCommitButtons) value: (self class implements: #openDocumentation) |
803 | 840 |
! |
841 |
||
782 | 842 |
valueOfInfoLabel |
907 | 843 |
"returns the info label as value holder" |
782 | 844 |
|
936 | 845 |
^ builder nilValueAspectFor:#valueOfInfoLabel |
753 | 846 |
|
936 | 847 |
"Modified: / 21.5.1998 / 03:40:34 / cg" |
782 | 848 |
! |
849 |
||
850 |
valueOfTimeLabel |
|
907 | 851 |
"returns the time label as value holder" |
753 | 852 |
|
936 | 853 |
^ builder nilValueAspectFor:#valueOfTimeLabel |
753 | 854 |
|
936 | 855 |
"Modified: / 21.5.1998 / 03:40:42 / cg" |
753 | 856 |
! ! |
857 |
||
782 | 858 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 859 |
|
838 | 860 |
clipboard |
907 | 861 |
"returns the clipboard" |
838 | 862 |
|
863 |
^self class clipboard |
|
864 |
! |
|
865 |
||
782 | 866 |
clipboard: anEditObject |
907 | 867 |
"sets the clipboard and the value holder for can pasting" |
753 | 868 |
|
782 | 869 |
self class clipboard: anEditObject. |
753 | 870 |
|
869 | 871 |
self valueOfCanPaste value: anEditObject notNil |
782 | 872 |
! ! |
873 |
||
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
874 |
!ToolApplicationModel methodsFor:'defaults'! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
875 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
876 |
aboutImage |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
877 |
"the image to be displayed in my about-box; |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
878 |
If nil is returned, thhe ST/X default image is used." |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
879 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
880 |
^ nil |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
881 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
882 |
"Created: / 25.7.1998 / 20:33:50 / cg" |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
883 |
! ! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
884 |
|
782 | 885 |
!ToolApplicationModel methodsFor:'help'! |
753 | 886 |
|
762 | 887 |
defaultInfoLabel |
907 | 888 |
"returns the default info label; here an empty string" |
762 | 889 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
890 |
^ '' |
984 | 891 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
892 |
"Modified: / 31.7.1998 / 18:44:55 / cg" |
984 | 893 |
! |
894 |
||
753 | 895 |
openAbout |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
896 |
"opens an about box (on ST/X)" |
753 | 897 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
898 |
self class openAboutSTX |
753 | 899 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
900 |
"Modified: / 14.8.1998 / 13:17:57 / cg" |
753 | 901 |
! |
902 |
||
903 |
openAboutThisApplication |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
904 |
"opens an about box for this application. |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
905 |
Extracts some common info (i.e. class revision, author etc. from |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
906 |
the classes documentation." |
753 | 907 |
|
1040 | 908 |
|rev box myClass clsRev image msg| |
936 | 909 |
|
753 | 910 |
rev := ''. |
936 | 911 |
myClass := self class. |
912 |
||
913 |
(clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
1040 | 914 |
|
915 |
msg := '\The application\\' withCRs |
|
936 | 916 |
, myClass name asBoldText, rev |
850 | 917 |
, '\\has been designed and implemented by: \' withCRs |
918 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
|
800 | 919 |
, '\\' withCRs. |
753 | 920 |
|
1040 | 921 |
AboutBox isNil ifTrue:[ |
922 |
"/ this handles bad installations of ST/X, |
|
923 |
"/ where the AboutBox is missing. |
|
924 |
"/ (May vanish in the future) |
|
925 |
^ self information:msg |
|
926 |
]. |
|
927 |
||
928 |
box := AboutBox title:msg. |
|
929 |
||
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
930 |
image := self aboutImage. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
931 |
image notNil ifTrue:[ |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
932 |
box image:image |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
933 |
]. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
934 |
box label:'About This Application'. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
935 |
box autoHideAfter:10 with:[]. |
1034
59abcada672e
show about boxes under the mouse pointer.
Claus Gittinger <cg@exept.de>
parents:
1025
diff
changeset
|
936 |
box showAtPointer. |
936 | 937 |
|
1040 | 938 |
"Modified: / 14.8.1998 / 13:04:03 / cg" |
753 | 939 |
! |
940 |
||
858 | 941 |
openHTMLDocument: aHTMLFilename |
907 | 942 |
"opens a HTML browser on aHTMLFilename" |
858 | 943 |
|
944 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
945 |
! |
|
946 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
947 |
showHelp:aHelpText for:view |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
948 |
"displays aHelpText in the info label" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
949 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
950 |
aHelpText isNil |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
951 |
ifTrue: [self updateInfoLabel] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
952 |
ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)]. |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
953 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
954 |
"Created: / 20.6.1998 / 16:37:23 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
955 |
"Modified: / 31.7.1998 / 18:40:19 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
956 |
! |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
957 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
958 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
959 |
"returns true, if automatic display of help is enabled for this |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
960 |
application; false otherwise" |
782 | 961 |
|
783 | 962 |
|currentActiveHelp| |
858 | 963 |
|
783 | 964 |
currentActiveHelp := ActiveHelp currentHelpListener. |
965 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
966 |
^ self class showingHelp |
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
967 |
and: [currentActiveHelp notNil and: [ |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
968 |
currentActiveHelp interestedIn: self window]] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
969 |
|
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
970 |
"/ ^ self class showingHelp |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
971 |
"/ and: [currentActiveHelp notNil and: [masterApplication notNil |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
972 |
"/ ifFalse: [currentActiveHelp interestedIn: self window] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
973 |
"/ ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
782 | 974 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
975 |
"Created: / 31.7.1998 / 17:57:03 / cg" |
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
976 |
"Modified: / 22.8.1998 / 00:06:38 / cg" |
782 | 977 |
! |
978 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
979 |
showingHelp: aValue |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
980 |
"toggles showing help for this application" |
984 | 981 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
982 |
(self class showingHelp: aValue) |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
983 |
ifTrue: [ActiveHelp startFor:self] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
984 |
ifFalse: [ActiveHelp stopFor:self. self updateInfoLabel] |
984 | 985 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
986 |
"Created: / 31.7.1998 / 18:20:44 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
987 |
"Modified: / 31.7.1998 / 18:44:39 / cg" |
822 | 988 |
! |
989 |
||
990 |
updateInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
991 |
"updates the info label at the bottom of this application" |
822 | 992 |
|
993 |
self valueOfInfoLabel value: self defaultInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
994 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
995 |
"Modified: / 31.7.1998 / 18:44:46 / cg" |
762 | 996 |
! ! |
997 |
||
753 | 998 |
!ToolApplicationModel methodsFor:'history'! |
999 |
||
1000 |
addToHistory: aHistoryEntry |
|
907 | 1001 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
1002 |
and checks for maximum size of the history" |
|
753 | 1003 |
|
782 | 1004 |
aHistoryEntry key size = 0 ifTrue: [^nil]. |
753 | 1005 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
1006 |
self history addFirst: aHistoryEntry. |
|
1007 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1008 |
! |
|
1009 |
||
1010 |
emptyHistory |
|
907 | 1011 |
"removes all history entries" |
753 | 1012 |
|
1013 |
^self history removeAll |
|
1014 |
! |
|
1015 |
||
1016 |
history |
|
907 | 1017 |
"returns the history from tool class" |
753 | 1018 |
|
1019 |
^self class getHistory |
|
1020 |
! |
|
1021 |
||
844 | 1022 |
historyEntries |
907 | 1023 |
"returns the history entries, i.e. the evaluatable values containing the information" |
844 | 1024 |
|
1025 |
^self history collect: [:asso| asso key] |
|
1026 |
! |
|
1027 |
||
753 | 1028 |
menuHistory |
907 | 1029 |
"returns a history submenu" |
753 | 1030 |
|
893 | 1031 |
|menu| |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1032 |
|
753 | 1033 |
menu := Menu new receiver: self. |
1034 |
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do: |
|
1035 |
[:historyEntryType| |
|
1013 | 1036 |
menu addItemGroup: |
1037 |
((self history |
|
1038 |
select: [:histEntry| |
|
1039 |
histEntry value = historyEntryType]) |
|
1040 |
collect: [:histEntry| |
|
1041 |
MenuItem new |
|
1042 |
label: histEntry key printString; |
|
1043 |
value: histEntry value; |
|
1044 |
argument: histEntry key; |
|
1045 |
activeHelpKey: #historyMenuItem]). |
|
753 | 1046 |
]. |
1047 |
||
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1048 |
menu addItem: (MenuItem new |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1049 |
label: 'Empty History'; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1050 |
value: #emptyHistory; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1051 |
activeHelpKey: #historyEmptyMenu; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1052 |
translateLabel:true). |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1053 |
|
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1054 |
menu findGuiResourcesIn:self. |
753 | 1055 |
^menu |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1056 |
|
1013 | 1057 |
"Modified: / 29.7.1998 / 11:40:11 / cg" |
753 | 1058 |
! |
1059 |
||
1060 |
removeFromHistory: aHistoryEntry |
|
907 | 1061 |
"removes aHistoryEntry from the history" |
753 | 1062 |
|
1063 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
1064 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1065 |
! ! |
|
1066 |
||
982
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1067 |
!ToolApplicationModel methodsFor:'initialization'! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1068 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1069 |
initialize |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1070 |
super initialize. |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1071 |
self createBuilder |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1072 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1073 |
"Created: / 20.6.1998 / 14:51:29 / cg" |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1074 |
! ! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1075 |
|
782 | 1076 |
!ToolApplicationModel methodsFor:'queries'! |
1077 |
||
876 | 1078 |
allToolInstances |
907 | 1079 |
"returns all instances of this tool class" |
876 | 1080 |
|
1081 |
^self class settings at: #Instances ifAbsent: [^#()] |
|
1082 |
! |
|
1083 |
||
782 | 1084 |
preferredExtent |
1085 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
1086 |
will be considered" |
|
1087 |
||
1088 |
|window menu menuToolbarView preferredExtentOfWindow| |
|
1089 |
||
1090 |
window := self builder window. |
|
1091 |
menu := window subViews first. |
|
1092 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
1093 |
||
1094 |
preferredExtentOfWindow := window extent. |
|
1095 |
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent]. |
|
1096 |
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent]. |
|
1097 |
||
1098 |
^window minExtent max: (preferredExtentOfWindow min: window maxExtent) |
|
1099 |
! ! |
|
1100 |
||
869 | 1101 |
!ToolApplicationModel methodsFor:'settings'! |
1102 |
||
872 | 1103 |
allFontViewsDo: aBlock |
892 | 1104 |
"evaluates aBlock for all views with fonts" |
872 | 1105 |
|
1106 |
|fontViews| |
|
1107 |
||
1108 |
fontViews := OrderedCollection new. |
|
1109 |
||
1110 |
self builder windowGroup views do: [:v| v class = MenuPanel ifTrue: [fontViews add: v]]. |
|
1111 |
||
1112 |
builder namedComponents do: |
|
1113 |
[:aView| |
|
1114 |
aView allSubViewsDo: |
|
1115 |
[:v| |
|
1116 |
v font notNil ifTrue: [fontViews add: v] |
|
1117 |
] |
|
1118 |
]. |
|
1119 |
fontViews do: aBlock |
|
1120 |
! |
|
1121 |
||
869 | 1122 |
chooseFont: viewFont |
892 | 1123 |
"chooses a font for viewFont and puts it into the settings dictionary; |
869 | 1124 |
finally update all my views" |
1125 |
||
1126 |
|defaultFont font| |
|
1127 |
||
872 | 1128 |
viewFont = 'Label Font' ifTrue: [defaultFont := Label defaultFont]. |
1129 |
viewFont = 'Button Font' ifTrue: [defaultFont := Button defaultFont]. |
|
1130 |
viewFont = 'Edit Font' ifTrue: [defaultFont := TextView defaultFont]. |
|
1131 |
viewFont = 'List Font' ifTrue: [defaultFont := ListView defaultFont]. |
|
1132 |
viewFont = 'Tree List Font' ifTrue: [defaultFont := SelectionInTreeView defaultFont]. |
|
892 | 1133 |
viewFont = 'Note Book Font' ifTrue: [defaultFont := NoteBookView defaultFont]. |
872 | 1134 |
viewFont = 'Framed Box Font' ifTrue: [defaultFont := FramedBox defaultFont]. |
869 | 1135 |
|
1136 |
(font := FontPanel |
|
1137 |
fontFromUserInitial: (self class settings at: viewFont asSymbol ifAbsent: nil) ? defaultFont |
|
1138 |
title: 'Choose ', viewFont) notNil |
|
1139 |
ifTrue: |
|
872 | 1140 |
[ |
869 | 1141 |
self class settings at: viewFont asSymbol put: (font on: device). |
1142 |
self updateFonts |
|
1143 |
]. |
|
1144 |
^font |
|
1145 |
! |
|
1146 |
||
1147 |
resetFonts |
|
892 | 1148 |
"sets the fonts in the settings to nil and resets the views to its default font" |
869 | 1149 |
|
872 | 1150 |
(self class settings) |
892 | 1151 |
at: #'Label Font' put: Label defaultFont; |
1152 |
at: #'Button Font' put: Button defaultFont; |
|
1153 |
at: #'Edit Font' put: TextView defaultFont; |
|
1154 |
at: #'List Font' put: ListView defaultFont; |
|
1155 |
at: #'Tree List Font' put: SelectionInTreeView defaultFont; |
|
1156 |
at: #'Note Book Font' put: NoteBookView defaultFont; |
|
1157 |
at: #'Framed Box Font' put: FramedBox defaultFont. |
|
1158 |
||
1159 |
self updateFonts. |
|
1160 |
||
1161 |
(self class settings) |
|
872 | 1162 |
removeKey: #'Label Font' ifAbsent: nil; |
1163 |
removeKey: #'Button Font' ifAbsent: nil; |
|
1164 |
removeKey: #'Edit Font' ifAbsent: nil; |
|
1165 |
removeKey: #'List Font' ifAbsent: nil; |
|
1166 |
removeKey: #'Tree List Font' ifAbsent: nil; |
|
1167 |
removeKey: #'Note Book Font' ifAbsent: nil; |
|
1168 |
removeKey: #'Framed Box Font' ifAbsent: nil. |
|
869 | 1169 |
|
1170 |
! |
|
1171 |
||
1172 |
updateFonts |
|
892 | 1173 |
"takes defined fonts from the settings and set them to the corresponding views" |
869 | 1174 |
|
892 | 1175 |
|settings labelFont buttonFont editFont listFont treeListFont noteBookFont framedBoxFont updateFontsBlock| |
871 | 1176 |
|
1177 |
settings := self class settings. |
|
869 | 1178 |
|
872 | 1179 |
labelFont := settings at: #'Label Font' ifAbsent: nil. |
1180 |
buttonFont := settings at: #'Button Font' ifAbsent: nil. |
|
1181 |
editFont := settings at: #'Edit Font' ifAbsent: nil. |
|
1182 |
listFont := settings at: #'List Font' ifAbsent: nil. |
|
1183 |
treeListFont := settings at: #'Tree List Font' ifAbsent: nil. |
|
1184 |
noteBookFont := settings at: #'Note Book Font' ifAbsent: nil. |
|
1185 |
framedBoxFont := settings at: #'Framed Box Font' ifAbsent: nil. |
|
869 | 1186 |
|
872 | 1187 |
updateFontsBlock := |
1188 |
[:v| |
|
1189 |
(labelFont notNil and: [v font ~= labelFont and: [(v class == Label) or: [v isKindOf: Toggle]]]) |
|
1190 |
ifTrue: [v font: labelFont; fixSize; sizeChanged:nil; invalidate]. |
|
1191 |
(buttonFont notNil and: [v font ~= buttonFont and: [v class == Button or: [v class == PopUpList]]]) |
|
876 | 1192 |
ifTrue: [v label isString ifTrue: [|e|e := v extent. v font: buttonFont; extent: e; invalidate]]. |
872 | 1193 |
(editFont notNil and: [v font ~= editFont and: [v isKindOf: TextView]]) |
1194 |
ifTrue: [v font: editFont; invalidate]. |
|
1195 |
(listFont notNil and: [v font ~= listFont and: [v class = SelectionInListView or: [v class = DataSetView]]]) |
|
1196 |
ifTrue: [v font: listFont. v invalidate]. |
|
1197 |
(treeListFont notNil and: [v font ~= treeListFont and: [v isKindOf: SelectionInTreeView]]) |
|
1198 |
ifTrue: [v font: treeListFont; invalidate]. |
|
1199 |
(noteBookFont notNil and: [v font ~= noteBookFont and: [v class == NoteBookView]]) |
|
1200 |
ifTrue: [v font: noteBookFont; invalidate]. |
|
1201 |
(framedBoxFont notNil and: [v font ~= framedBoxFont and: [v class == FramedBox]]) |
|
1202 |
ifTrue: [v font: framedBoxFont; invalidate] |
|
1203 |
]. |
|
1204 |
||
1205 |
self allFontViewsDo: [:v| updateFontsBlock value: v] |
|
1206 |
||
869 | 1207 |
! ! |
1208 |
||
753 | 1209 |
!ToolApplicationModel methodsFor:'startup / release'! |
1210 |
||
1211 |
close |
|
907 | 1212 |
"uninitializes and closes this tool" |
753 | 1213 |
|
756 | 1214 |
self uninitialize. |
1215 |
||
753 | 1216 |
super close |
1217 |
! |
|
1218 |
||
1219 |
closeRequest |
|
907 | 1220 |
"uninitializes this tool before requesting close" |
753 | 1221 |
|
756 | 1222 |
self uninitialize. |
1223 |
||
753 | 1224 |
super closeRequest |
1225 |
! |
|
1226 |
||
936 | 1227 |
postBuildWith:aBuilder |
1228 |
"sets the preferred extent and the label of the tool window before opening that" |
|
1229 |
||
971
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1230 |
|win| |
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1231 |
|
936 | 1232 |
super postBuildWith:aBuilder. |
1233 |
||
971
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1234 |
(win := aBuilder window) isTopView ifTrue:[ |
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1235 |
win |
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1236 |
extent: self preferredExtent; |
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1237 |
label: self class label. |
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1238 |
]. |
936 | 1239 |
|
1240 |
"Created: / 21.5.1998 / 02:49:09 / cg" |
|
971
a9d2fc9ebec9
handle the case of being postOpened as a subCanvas
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1241 |
"Modified: / 18.6.1998 / 20:16:25 / cg" |
936 | 1242 |
! |
1243 |
||
790 | 1244 |
postOpenWith:aBuilder |
907 | 1245 |
"starts the active help for this tool (if turned on in the settings) |
1246 |
and updates the info label and the fonts (from the settings)" |
|
790 | 1247 |
|
1248 |
super postOpenWith:aBuilder. |
|
1249 |
||
822 | 1250 |
self updateInfoLabel. |
876 | 1251 |
self updateFonts. |
1252 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1253 |
"Modified: / 31.7.1998 / 18:17:34 / cg" |
790 | 1254 |
! |
1255 |
||
853 | 1256 |
startClockOnTimedBlock: aBlock |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1257 |
"sets and starts the (optional) time block" |
853 | 1258 |
|
1259 |
timeBlock := aBlock. |
|
1260 |
aBlock value. |
|
1261 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1262 |
"Modified: / 31.7.1998 / 18:46:28 / cg" |
853 | 1263 |
! |
1264 |
||
756 | 1265 |
uninitialize |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1266 |
"stops active help for this tool and (if defined) removes the time block" |
756 | 1267 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1268 |
self showingHelp ifTrue: [ActiveHelp stopFor: self]. |
876 | 1269 |
timeBlock notNil ifTrue: [Processor removeTimedBlock:timeBlock. timeBlock := nil]. |
1270 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1271 |
"Modified: / 31.7.1998 / 18:46:21 / cg" |
753 | 1272 |
! ! |
1273 |
||
1274 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
1275 |
||
1276 |
version |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
1277 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.75 1998-08-24 19:51:18 cg Exp $' |
753 | 1278 |
! ! |