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