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