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