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