author | Claus Gittinger <cg@exept.de> |
Fri, 26 Feb 1999 13:52:40 +0100 | |
changeset 1113 | ac90f3c50701 |
parent 1108 | 2d57365bc340 |
child 1138 | 106a5cc7a4a8 |
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 |
" |
|
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 |
||
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
64 |
allInstances |
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 |
[ |
|
360 |
|menuIcon| |
|
990 | 361 |
menuIcon := Icon stxIcon. |
869 | 362 |
menuIcon magnifiedBy: MenuPanel defaultFont height/menuIcon height |
363 |
] |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
364 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
365 |
"Modified: / 24.8.1998 / 21:34:33 / cg" |
987 | 366 |
! ! |
869 | 367 |
|
753 | 368 |
!ToolApplicationModel class methodsFor:'interface specs'! |
369 |
||
797 | 370 |
windowSpecForCommit |
869 | 371 |
"This resource specification was automatically generated |
372 |
by the UIPainter of ST/X." |
|
373 |
||
374 |
"Do not manually edit this!! If it is corrupted, |
|
375 |
the UIPainter may not be able to read the specification." |
|
376 |
||
377 |
" |
|
378 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit |
|
379 |
ToolApplicationModel new openInterface:#windowSpecForCommit |
|
380 |
" |
|
797 | 381 |
|
382 |
<resource: #canvas> |
|
383 |
||
384 |
^ |
|
859 | 385 |
|
797 | 386 |
#(#FullSpec |
859 | 387 |
#window: |
797 | 388 |
#(#WindowSpec |
859 | 389 |
#name: 'Commit Buttons' |
869 | 390 |
#layout: #(#LayoutFrame 344 0 371 0 643 0 430 0) |
859 | 391 |
#label: 'Commit Buttons' |
392 |
#min: #(#Point 100 22) |
|
393 |
#max: #(#Point 1152 900) |
|
869 | 394 |
#bounds: #(#Rectangle 344 371 644 431) |
859 | 395 |
#usePreferredExtent: false |
797 | 396 |
) |
859 | 397 |
#component: |
797 | 398 |
#(#SpecCollection |
859 | 399 |
#collection: |
797 | 400 |
#( |
401 |
#(#ActionButtonSpec |
|
859 | 402 |
#name: 'cancelButton' |
403 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
404 |
#activeHelpKey: #commitCancel |
|
405 |
#label: 'Cancel' |
|
927 | 406 |
#translateLabel: true |
859 | 407 |
#tabable: true |
408 |
#model: #cancel |
|
409 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 410 |
) |
411 |
#(#ActionButtonSpec |
|
859 | 412 |
#name: 'okButton' |
413 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
414 |
#activeHelpKey: #commitOK |
|
415 |
#label: 'OK' |
|
927 | 416 |
#translateLabel: true |
859 | 417 |
#tabable: true |
418 |
#model: #accept |
|
419 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 420 |
) |
421 |
) |
|
422 |
) |
|
423 |
) |
|
927 | 424 |
|
425 |
"Modified: / 20.5.1998 / 03:31:54 / cg" |
|
797 | 426 |
! |
427 |
||
428 |
windowSpecForCommitWithoutChannels |
|
869 | 429 |
"This resource specification was automatically generated |
430 |
by the UIPainter of ST/X." |
|
431 |
||
432 |
"Do not manually edit this!! If it is corrupted, |
|
433 |
the UIPainter may not be able to read the specification." |
|
434 |
||
435 |
" |
|
436 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels |
|
437 |
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels |
|
438 |
" |
|
797 | 439 |
|
440 |
<resource: #canvas> |
|
441 |
||
442 |
^ |
|
859 | 443 |
|
797 | 444 |
#(#FullSpec |
859 | 445 |
#window: |
797 | 446 |
#(#WindowSpec |
859 | 447 |
#name: 'Commit Buttons Without Channels' |
869 | 448 |
#layout: #(#LayoutFrame 500 0 326 0 799 0 385 0) |
859 | 449 |
#label: 'Commit Buttons Without Channels' |
450 |
#min: #(#Point 100 22) |
|
451 |
#max: #(#Point 1152 900) |
|
869 | 452 |
#bounds: #(#Rectangle 500 326 800 386) |
859 | 453 |
#usePreferredExtent: false |
797 | 454 |
) |
859 | 455 |
#component: |
797 | 456 |
#(#SpecCollection |
859 | 457 |
#collection: |
797 | 458 |
#( |
459 |
#(#ActionButtonSpec |
|
859 | 460 |
#name: 'cancelButton' |
461 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
462 |
#activeHelpKey: #commitCancel |
|
463 |
#label: 'Cancel' |
|
927 | 464 |
#translateLabel: true |
859 | 465 |
#tabable: true |
466 |
#model: #cancel |
|
797 | 467 |
) |
468 |
#(#ActionButtonSpec |
|
859 | 469 |
#name: 'okButton' |
470 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
471 |
#activeHelpKey: #commitOK |
|
472 |
#label: 'OK' |
|
927 | 473 |
#translateLabel: true |
859 | 474 |
#tabable: true |
475 |
#model: #accept |
|
797 | 476 |
) |
477 |
) |
|
478 |
) |
|
479 |
) |
|
927 | 480 |
|
481 |
"Modified: / 20.5.1998 / 03:30:09 / cg" |
|
797 | 482 |
! |
483 |
||
484 |
windowSpecForInfoBar |
|
869 | 485 |
"This resource specification was automatically generated |
486 |
by the UIPainter of ST/X." |
|
487 |
||
488 |
"Do not manually edit this!! If it is corrupted, |
|
489 |
the UIPainter may not be able to read the specification." |
|
490 |
||
491 |
" |
|
492 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar |
|
493 |
ToolApplicationModel new openInterface:#windowSpecForInfoBar |
|
494 |
" |
|
797 | 495 |
|
496 |
<resource: #canvas> |
|
497 |
||
498 |
^ |
|
859 | 499 |
|
797 | 500 |
#(#FullSpec |
859 | 501 |
#window: |
797 | 502 |
#(#WindowSpec |
859 | 503 |
#name: 'Info Bar' |
869 | 504 |
#layout: #(#LayoutFrame 233 0 218 0 732 0 563 0) |
859 | 505 |
#label: 'Info Bar' |
506 |
#min: #(#Point 400 320) |
|
507 |
#max: #(#Point 1152 900) |
|
869 | 508 |
#bounds: #(#Rectangle 233 218 733 564) |
859 | 509 |
#menu: #menu |
510 |
#usePreferredExtent: false |
|
797 | 511 |
) |
859 | 512 |
#component: |
797 | 513 |
#(#SpecCollection |
859 | 514 |
#collection: |
797 | 515 |
#( |
820 | 516 |
#(#ViewSpec |
859 | 517 |
#name: 'view' |
518 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
519 |
#component: |
|
820 | 520 |
#(#SpecCollection |
859 | 521 |
#collection: |
820 | 522 |
#( |
523 |
#(#LabelSpec |
|
859 | 524 |
#name: 'infoLabel' |
525 |
#layout: #(#LayoutFrame 2 0.0 1 0.0 -1 1.0 -1 1.0) |
|
526 |
#labelChannel: #valueOfInfoLabel |
|
527 |
#level: -1 |
|
528 |
#adjust: #left |
|
869 | 529 |
#resizeForLabel: false |
820 | 530 |
) |
531 |
) |
|
532 |
) |
|
797 | 533 |
) |
534 |
) |
|
535 |
) |
|
536 |
) |
|
537 |
! |
|
538 |
||
539 |
windowSpecForInfoBarWithClock |
|
869 | 540 |
"This resource specification was automatically generated |
541 |
by the UIPainter of ST/X." |
|
542 |
||
543 |
"Do not manually edit this!! If it is corrupted, |
|
544 |
the UIPainter may not be able to read the specification." |
|
545 |
||
546 |
" |
|
547 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBarWithClock |
|
548 |
ToolApplicationModel new openInterface:#windowSpecForInfoBarWithClock |
|
549 |
" |
|
797 | 550 |
|
551 |
<resource: #canvas> |
|
552 |
||
553 |
^ |
|
859 | 554 |
|
797 | 555 |
#(#FullSpec |
859 | 556 |
#window: |
797 | 557 |
#(#WindowSpec |
859 | 558 |
#name: 'Info Bar' |
872 | 559 |
#layout: #(#LayoutFrame 160 0 423 0 659 0 453 0) |
859 | 560 |
#label: 'Info Bar' |
561 |
#min: #(#Point 400 320) |
|
562 |
#max: #(#Point 1152 900) |
|
872 | 563 |
#bounds: #(#Rectangle 160 423 660 454) |
859 | 564 |
#menu: #menu |
565 |
#usePreferredExtent: false |
|
797 | 566 |
) |
859 | 567 |
#component: |
797 | 568 |
#(#SpecCollection |
859 | 569 |
#collection: |
797 | 570 |
#( |
820 | 571 |
#(#ViewSpec |
859 | 572 |
#name: 'view' |
573 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
574 |
#component: |
|
820 | 575 |
#(#SpecCollection |
859 | 576 |
#collection: |
820 | 577 |
#( |
578 |
#(#LabelSpec |
|
859 | 579 |
#name: 'infoLabel' |
580 |
#layout: #(#LayoutFrame 2 0 1 0.0 -81 1 -1 1.0) |
|
581 |
#labelChannel: #valueOfInfoLabel |
|
582 |
#level: -1 |
|
583 |
#adjust: #left |
|
872 | 584 |
#resizeForLabel: false |
820 | 585 |
) |
586 |
#(#LabelSpec |
|
859 | 587 |
#name: 'timeLabel' |
588 |
#layout: #(#LayoutFrame -79 1 1 0.0 -1 1.0 -1 1.0) |
|
589 |
#labelChannel: #valueOfTimeLabel |
|
590 |
#level: -1 |
|
591 |
#adjust: #right |
|
872 | 592 |
#resizeForLabel: false |
820 | 593 |
) |
594 |
) |
|
595 |
) |
|
797 | 596 |
) |
597 |
) |
|
598 |
) |
|
599 |
) |
|
600 |
! ! |
|
601 |
||
602 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
603 |
||
753 | 604 |
menuAbout |
869 | 605 |
"This resource specification was automatically generated |
606 |
by the MenuEditor of ST/X." |
|
607 |
||
608 |
"Do not manually edit this!! If it is corrupted, |
|
609 |
the MenuEditor may not be able to read the specification." |
|
610 |
||
611 |
" |
|
612 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuAbout |
|
613 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp |
|
614 |
" |
|
753 | 615 |
|
616 |
<resource: #menu> |
|
617 |
||
618 |
^ |
|
859 | 619 |
|
753 | 620 |
#(#Menu |
621 |
||
622 |
#( |
|
623 |
#(#MenuItem |
|
859 | 624 |
#label: 'About Smalltalk/X...' |
625 |
#translateLabel: true |
|
626 |
#value: #openAbout |
|
627 |
#activeHelpKey: #aboutSTX |
|
753 | 628 |
) |
629 |
#(#MenuItem |
|
859 | 630 |
#label: '-' |
753 | 631 |
) |
632 |
#(#MenuItem |
|
922 | 633 |
#label: 'About this Application...' |
859 | 634 |
#translateLabel: true |
635 |
#value: #openAboutThisApplication |
|
636 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 637 |
) |
638 |
) nil |
|
639 |
nil |
|
640 |
) |
|
922 | 641 |
|
642 |
"Modified: / 19.5.1998 / 21:44:09 / cg" |
|
753 | 643 |
! |
644 |
||
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
645 |
menuHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
646 |
"This resource specification was automatically generated |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
647 |
by the MenuEditor of ST/X." |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
648 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
649 |
"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
|
650 |
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
|
651 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
652 |
" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
653 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
654 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
655 |
" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
656 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
657 |
<resource: #menu> |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
658 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
659 |
^ |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
660 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
661 |
#(#Menu |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
662 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
663 |
#( |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
664 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
665 |
#label: 'Documentation' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
666 |
#translateLabel: true |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
667 |
#value: #openDocumentation |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
668 |
#activeHelpKey: #helpTutorial |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
669 |
#enabled: #valueOfHavingDocumentation |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
670 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
671 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
672 |
#label: '-' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
673 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
674 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
675 |
#label: 'Show Help Texts' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
676 |
#translateLabel: true |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
677 |
#activeHelpKey: #helpShowHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
678 |
#indication: #showingHelp: |
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 |
) nil |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
681 |
nil |
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 |
"Modified: / 31.7.1998 / 18:19:42 / cg" |
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 |
xxxmenuFont |
869 | 688 |
"This resource specification was automatically generated |
689 |
by the MenuEditor of ST/X." |
|
690 |
||
691 |
"Do not manually edit this!! If it is corrupted, |
|
692 |
the MenuEditor may not be able to read the specification." |
|
693 |
||
694 |
" |
|
695 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuFont |
|
696 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuFont)) startUp |
|
697 |
" |
|
698 |
||
699 |
<resource: #menu> |
|
700 |
||
701 |
^ |
|
702 |
||
703 |
#(#Menu |
|
704 |
||
705 |
#( |
|
706 |
#(#MenuItem |
|
872 | 707 |
#label: 'Label...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
708 |
#translateLabel: true |
869 | 709 |
#value: #chooseFont: |
710 |
#argument: 'Label Font' |
|
711 |
) |
|
712 |
#(#MenuItem |
|
872 | 713 |
#label: 'Button...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
714 |
#translateLabel: true |
869 | 715 |
#value: #chooseFont: |
716 |
#argument: 'Button Font' |
|
717 |
) |
|
718 |
#(#MenuItem |
|
872 | 719 |
#label: 'Edit...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
720 |
#translateLabel: true |
869 | 721 |
#value: #chooseFont: |
722 |
#argument: 'Edit Font' |
|
723 |
) |
|
724 |
#(#MenuItem |
|
872 | 725 |
#label: 'List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
726 |
#translateLabel: true |
869 | 727 |
#value: #chooseFont: |
728 |
#argument: 'List Font' |
|
729 |
) |
|
730 |
#(#MenuItem |
|
872 | 731 |
#label: 'Tree List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
732 |
#translateLabel: true |
869 | 733 |
#value: #chooseFont: |
734 |
#argument: 'Tree List Font' |
|
735 |
) |
|
736 |
#(#MenuItem |
|
872 | 737 |
#label: 'Note Book...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
738 |
#translateLabel: true |
872 | 739 |
#value: #chooseFont: |
740 |
#argument: 'Note Book Font' |
|
741 |
) |
|
742 |
#(#MenuItem |
|
743 |
#label: 'Framed Box...' |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
744 |
#translateLabel: true |
872 | 745 |
#value: #chooseFont: |
746 |
#argument: 'Framed Box Font' |
|
747 |
) |
|
748 |
#(#MenuItem |
|
869 | 749 |
#label: '-' |
750 |
) |
|
751 |
#(#MenuItem |
|
872 | 752 |
#label: 'Reset' |
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: #resetFonts |
755 |
) |
|
756 |
) nil |
|
757 |
nil |
|
758 |
) |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
759 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
760 |
"Modified: / 31.7.1998 / 18:55:34 / cg" |
753 | 761 |
! ! |
762 |
||
907 | 763 |
!ToolApplicationModel class methodsFor:'queries'! |
764 |
||
765 |
isVisualStartable |
|
766 |
"returns whether this application class can be started via #open" |
|
767 |
||
768 |
self == ToolApplicationModel ifTrue:[^false]. |
|
769 |
^super isVisualStartable |
|
770 |
||
771 |
! ! |
|
772 |
||
782 | 773 |
!ToolApplicationModel class methodsFor:'startup / release'! |
753 | 774 |
|
782 | 775 |
preSnapshot |
907 | 776 |
"removes the clipboard before snap shoting" |
753 | 777 |
|
782 | 778 |
clipboard := nil |
753 | 779 |
! |
780 |
||
782 | 781 |
uninitialize |
907 | 782 |
"resets the class instance variables" |
760 | 783 |
|
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
784 |
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
|
785 |
|
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
786 |
" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
787 |
self withAllSubclasses do:[:c | c uninitialize] |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
788 |
" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
789 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
790 |
"Modified: / 4.2.1999 / 15:37:43 / cg" |
753 | 791 |
! ! |
792 |
||
782 | 793 |
!ToolApplicationModel methodsFor:'aspects'! |
794 |
||
822 | 795 |
valueOfCanCopy |
907 | 796 |
"returns whether can copy as value holder" |
822 | 797 |
|
936 | 798 |
^ builder booleanValueAspectFor:#valueOfCanCopy |
822 | 799 |
|
936 | 800 |
"Modified: / 21.5.1998 / 03:39:05 / cg" |
822 | 801 |
! |
802 |
||
803 |
valueOfCanCut |
|
907 | 804 |
"returns whether can paste as value holder" |
822 | 805 |
|
936 | 806 |
^ builder booleanValueAspectFor:#valueOfCanCut |
822 | 807 |
|
936 | 808 |
"Modified: / 21.5.1998 / 03:39:13 / cg" |
822 | 809 |
! |
810 |
||
811 |
valueOfCanPaste |
|
907 | 812 |
"returns whether can paste as value holder" |
822 | 813 |
|
936 | 814 |
^ builder booleanValueAspectFor:#valueOfCanPaste |
822 | 815 |
|
936 | 816 |
"Modified: / 21.5.1998 / 03:39:22 / cg" |
822 | 817 |
! |
818 |
||
819 |
valueOfCanUndo |
|
907 | 820 |
"returns whether can undo as value holder" |
822 | 821 |
|
936 | 822 |
^ builder booleanValueAspectFor:#valueOfCanUndo |
822 | 823 |
|
936 | 824 |
"Modified: / 21.5.1998 / 03:39:31 / cg" |
822 | 825 |
! |
826 |
||
782 | 827 |
valueOfEnablingCommitButtons |
907 | 828 |
"returns the enabling of the commit of this tool as value holder" |
753 | 829 |
|
936 | 830 |
^ builder booleanValueAspectFor:#valueOfEnablingCommitButtons |
753 | 831 |
|
936 | 832 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
782 | 833 |
! |
834 |
||
858 | 835 |
valueOfHavingDocumentation |
1004 | 836 |
"returns the enabling of having documentation for this tool as value holder" |
803 | 837 |
|
1108 | 838 |
^ (builder booleanValueAspectFor:#valueOfHavingDocumentation) value: (self class implements: #openDocumentation) |
803 | 839 |
! |
840 |
||
782 | 841 |
valueOfInfoLabel |
907 | 842 |
"returns the info label as value holder" |
782 | 843 |
|
936 | 844 |
^ builder nilValueAspectFor:#valueOfInfoLabel |
753 | 845 |
|
936 | 846 |
"Modified: / 21.5.1998 / 03:40:34 / cg" |
782 | 847 |
! |
848 |
||
849 |
valueOfTimeLabel |
|
907 | 850 |
"returns the time label as value holder" |
753 | 851 |
|
936 | 852 |
^ builder nilValueAspectFor:#valueOfTimeLabel |
753 | 853 |
|
936 | 854 |
"Modified: / 21.5.1998 / 03:40:42 / cg" |
753 | 855 |
! ! |
856 |
||
782 | 857 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 858 |
|
838 | 859 |
clipboard |
907 | 860 |
"returns the clipboard" |
838 | 861 |
|
862 |
^self class clipboard |
|
863 |
! |
|
864 |
||
782 | 865 |
clipboard: anEditObject |
907 | 866 |
"sets the clipboard and the value holder for can pasting" |
753 | 867 |
|
782 | 868 |
self class clipboard: anEditObject. |
753 | 869 |
|
869 | 870 |
self valueOfCanPaste value: anEditObject notNil |
782 | 871 |
! ! |
872 |
||
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
873 |
!ToolApplicationModel methodsFor:'defaults'! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
874 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
875 |
aboutImage |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
876 |
"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
|
877 |
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
|
878 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
879 |
^ nil |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
880 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
881 |
"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
|
882 |
! ! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
883 |
|
782 | 884 |
!ToolApplicationModel methodsFor:'help'! |
753 | 885 |
|
762 | 886 |
defaultInfoLabel |
907 | 887 |
"returns the default info label; here an empty string" |
762 | 888 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
889 |
^ '' |
984 | 890 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
891 |
"Modified: / 31.7.1998 / 18:44:55 / cg" |
984 | 892 |
! |
893 |
||
753 | 894 |
openAbout |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
895 |
"opens an about box (on ST/X)" |
753 | 896 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
897 |
self class openAboutSTX |
753 | 898 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
899 |
"Modified: / 14.8.1998 / 13:17:57 / cg" |
753 | 900 |
! |
901 |
||
902 |
openAboutThisApplication |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
903 |
"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
|
904 |
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
|
905 |
the classes documentation." |
753 | 906 |
|
1040 | 907 |
|rev box myClass clsRev image msg| |
936 | 908 |
|
753 | 909 |
rev := ''. |
936 | 910 |
myClass := self class. |
911 |
||
912 |
(clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
1040 | 913 |
|
914 |
msg := '\The application\\' withCRs |
|
936 | 915 |
, myClass name asBoldText, rev |
850 | 916 |
, '\\has been designed and implemented by: \' withCRs |
917 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
|
800 | 918 |
, '\\' withCRs. |
753 | 919 |
|
1040 | 920 |
AboutBox isNil ifTrue:[ |
921 |
"/ this handles bad installations of ST/X, |
|
922 |
"/ where the AboutBox is missing. |
|
923 |
"/ (May vanish in the future) |
|
924 |
^ self information:msg |
|
925 |
]. |
|
926 |
||
927 |
box := AboutBox title:msg. |
|
928 |
||
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
929 |
image := self aboutImage. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
930 |
image notNil ifTrue:[ |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
931 |
box image:image |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
932 |
]. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
933 |
box label:'About This Application'. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
934 |
box autoHideAfter:10 with:[]. |
1034
59abcada672e
show about boxes under the mouse pointer.
Claus Gittinger <cg@exept.de>
parents:
1025
diff
changeset
|
935 |
box showAtPointer. |
936 | 936 |
|
1040 | 937 |
"Modified: / 14.8.1998 / 13:04:03 / cg" |
753 | 938 |
! |
939 |
||
858 | 940 |
openHTMLDocument: aHTMLFilename |
907 | 941 |
"opens a HTML browser on aHTMLFilename" |
858 | 942 |
|
943 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
944 |
! |
|
945 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
946 |
showHelp:aHelpText for:view |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
947 |
"displays aHelpText in the info label" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
948 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
949 |
aHelpText isNil |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
950 |
ifTrue: [self updateInfoLabel] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
951 |
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
|
952 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
953 |
"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
|
954 |
"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
|
955 |
! |
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 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
958 |
"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
|
959 |
application; false otherwise" |
782 | 960 |
|
783 | 961 |
|currentActiveHelp| |
858 | 962 |
|
783 | 963 |
currentActiveHelp := ActiveHelp currentHelpListener. |
964 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
965 |
^ self class showingHelp |
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
966 |
and: [currentActiveHelp notNil and: [ |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
967 |
currentActiveHelp interestedIn: self window]] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
968 |
|
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
969 |
"/ ^ self class showingHelp |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
970 |
"/ and: [currentActiveHelp notNil and: [masterApplication notNil |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
971 |
"/ ifFalse: [currentActiveHelp interestedIn: self window] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
972 |
"/ ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
782 | 973 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
974 |
"Created: / 31.7.1998 / 17:57:03 / cg" |
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
975 |
"Modified: / 22.8.1998 / 00:06:38 / cg" |
782 | 976 |
! |
977 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
978 |
showingHelp: aValue |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
979 |
"toggles showing help for this application" |
984 | 980 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
981 |
(self class showingHelp: aValue) |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
982 |
ifTrue: [ActiveHelp startFor:self] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
983 |
ifFalse: [ActiveHelp stopFor:self. self updateInfoLabel] |
984 | 984 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
985 |
"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
|
986 |
"Modified: / 31.7.1998 / 18:44:39 / cg" |
822 | 987 |
! |
988 |
||
989 |
updateInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
990 |
"updates the info label at the bottom of this application" |
822 | 991 |
|
992 |
self valueOfInfoLabel value: self defaultInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
993 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
994 |
"Modified: / 31.7.1998 / 18:44:46 / cg" |
762 | 995 |
! ! |
996 |
||
753 | 997 |
!ToolApplicationModel methodsFor:'history'! |
998 |
||
999 |
addToHistory: aHistoryEntry |
|
907 | 1000 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
1001 |
and checks for maximum size of the history" |
|
753 | 1002 |
|
782 | 1003 |
aHistoryEntry key size = 0 ifTrue: [^nil]. |
753 | 1004 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
1005 |
self history addFirst: aHistoryEntry. |
|
1006 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1007 |
! |
|
1008 |
||
1009 |
emptyHistory |
|
907 | 1010 |
"removes all history entries" |
753 | 1011 |
|
1012 |
^self history removeAll |
|
1013 |
! |
|
1014 |
||
1015 |
history |
|
907 | 1016 |
"returns the history from tool class" |
753 | 1017 |
|
1018 |
^self class getHistory |
|
1019 |
! |
|
1020 |
||
844 | 1021 |
historyEntries |
907 | 1022 |
"returns the history entries, i.e. the evaluatable values containing the information" |
844 | 1023 |
|
1024 |
^self history collect: [:asso| asso key] |
|
1025 |
! |
|
1026 |
||
753 | 1027 |
menuHistory |
907 | 1028 |
"returns a history submenu" |
753 | 1029 |
|
893 | 1030 |
|menu| |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1031 |
|
753 | 1032 |
menu := Menu new receiver: self. |
1033 |
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do: |
|
1034 |
[:historyEntryType| |
|
1013 | 1035 |
menu addItemGroup: |
1036 |
((self history |
|
1037 |
select: [:histEntry| |
|
1038 |
histEntry value = historyEntryType]) |
|
1039 |
collect: [:histEntry| |
|
1040 |
MenuItem new |
|
1041 |
label: histEntry key printString; |
|
1042 |
value: histEntry value; |
|
1043 |
argument: histEntry key; |
|
1044 |
activeHelpKey: #historyMenuItem]). |
|
753 | 1045 |
]. |
1046 |
||
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1047 |
menu addItem: (MenuItem new |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1048 |
label: 'Empty History'; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1049 |
value: #emptyHistory; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1050 |
activeHelpKey: #historyEmptyMenu; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1051 |
translateLabel:true). |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1052 |
|
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1053 |
menu findGuiResourcesIn:self. |
753 | 1054 |
^menu |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1055 |
|
1013 | 1056 |
"Modified: / 29.7.1998 / 11:40:11 / cg" |
753 | 1057 |
! |
1058 |
||
1059 |
removeFromHistory: aHistoryEntry |
|
907 | 1060 |
"removes aHistoryEntry from the history" |
753 | 1061 |
|
1062 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
1063 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1064 |
! ! |
|
1065 |
||
982
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1066 |
!ToolApplicationModel methodsFor:'initialization'! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1067 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1068 |
initialize |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1069 |
super initialize. |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1070 |
self createBuilder |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1071 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1072 |
"Created: / 20.6.1998 / 14:51:29 / cg" |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1073 |
! ! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1074 |
|
782 | 1075 |
!ToolApplicationModel methodsFor:'queries'! |
1076 |
||
876 | 1077 |
allToolInstances |
907 | 1078 |
"returns all instances of this tool class" |
876 | 1079 |
|
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1080 |
^ self class allInstances |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1081 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1082 |
"Modified: / 4.2.1999 / 15:34:58 / cg" |
876 | 1083 |
! |
1084 |
||
782 | 1085 |
preferredExtent |
1086 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
1087 |
will be considered" |
|
1088 |
||
1089 |
|window menu menuToolbarView preferredExtentOfWindow| |
|
1090 |
||
1091 |
window := self builder window. |
|
1092 |
menu := window subViews first. |
|
1093 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
1094 |
||
1095 |
preferredExtentOfWindow := window extent. |
|
1096 |
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent]. |
|
1097 |
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent]. |
|
1098 |
||
1099 |
^window minExtent max: (preferredExtentOfWindow min: window maxExtent) |
|
1100 |
! ! |
|
1101 |
||
753 | 1102 |
!ToolApplicationModel methodsFor:'startup / release'! |
1103 |
||
1107 | 1104 |
closeDownViews |
907 | 1105 |
"uninitializes and closes this tool" |
753 | 1106 |
|
756 | 1107 |
self uninitialize. |
1107 | 1108 |
super closeDownViews |
1108 | 1109 |
! |
936 | 1110 |
|
790 | 1111 |
postOpenWith:aBuilder |
907 | 1112 |
"starts the active help for this tool (if turned on in the settings) |
1113 |
and updates the info label and the fonts (from the settings)" |
|
790 | 1114 |
|
1115 |
super postOpenWith:aBuilder. |
|
1116 |
||
822 | 1117 |
self updateInfoLabel. |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1118 |
"/ self updateFonts. |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1119 |
self showingHelp:true |
876 | 1120 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1121 |
"Modified: / 31.7.1998 / 18:17:34 / cg" |
790 | 1122 |
! |
1123 |
||
853 | 1124 |
startClockOnTimedBlock: aBlock |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1125 |
"sets and starts the (optional) time block" |
853 | 1126 |
|
1127 |
timeBlock := aBlock. |
|
1128 |
aBlock value. |
|
1129 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1130 |
"Modified: / 31.7.1998 / 18:46:28 / cg" |
853 | 1131 |
! |
1132 |
||
756 | 1133 |
uninitialize |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1134 |
"stops active help for this tool and (if defined) removes the time block" |
756 | 1135 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1136 |
self showingHelp ifTrue: [ActiveHelp stopFor: self]. |
876 | 1137 |
timeBlock notNil ifTrue: [Processor removeTimedBlock:timeBlock. timeBlock := nil]. |
1138 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1139 |
"Modified: / 31.7.1998 / 18:46:21 / cg" |
753 | 1140 |
! ! |
1141 |
||
1142 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
1143 |
||
1144 |
version |
|
1108 | 1145 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.82 1999-02-22 19:41:46 cg Exp $' |
753 | 1146 |
! ! |