author | Claus Gittinger <cg@exept.de> |
Tue, 29 Aug 2017 02:19:30 +0200 | |
changeset 3994 | 8ab8729d5dec |
parent 3958 | 1f59191ed855 |
child 4007 | fee18ec30eb3 |
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 |
" |
|
1391 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
3508 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
753 | 16 |
ApplicationModel subclass:#ToolApplicationModel |
782 | 17 |
instanceVariableNames:'timeBlock' |
753 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
834 | 20 |
category:'Interface-Framework' |
753 | 21 |
! |
22 |
||
1969 | 23 |
ToolApplicationModel class instanceVariableNames:'history fileHistory clipboard settings showingHelp instances' |
753 | 24 |
|
25 |
" |
|
26 |
The following class instance variables are inherited by this class: |
|
27 |
||
28 |
ApplicationModel - ClassResources |
|
29 |
Model - |
|
30 |
Object - |
|
31 |
" |
|
32 |
! |
|
33 |
||
2098 | 34 |
Object subclass:#HistoryEntry |
35 |
instanceVariableNames:'' |
|
36 |
classVariableNames:'' |
|
37 |
poolDictionaries:'' |
|
38 |
privateIn:ToolApplicationModel |
|
39 |
! |
|
40 |
||
41 |
ToolApplicationModel::HistoryEntry subclass:#HistoryEntryForFile |
|
42 |
instanceVariableNames:'filename' |
|
43 |
classVariableNames:'' |
|
44 |
poolDictionaries:'' |
|
45 |
privateIn:ToolApplicationModel |
|
46 |
! |
|
47 |
||
48 |
ToolApplicationModel::HistoryEntry subclass:#HistoryEntryForMethod |
|
49 |
instanceVariableNames:'methodClass methodSelector' |
|
50 |
classVariableNames:'' |
|
51 |
poolDictionaries:'' |
|
52 |
privateIn:ToolApplicationModel |
|
53 |
! |
|
54 |
||
753 | 55 |
!ToolApplicationModel class methodsFor:'documentation'! |
56 |
||
756 | 57 |
copyright |
58 |
" |
|
784 | 59 |
COPYRIGHT (c) 1997 by eXept Software AG |
756 | 60 |
All Rights Reserved |
61 |
||
62 |
This software is furnished under a license and may be used |
|
63 |
only in accordance with the terms of that license and with the |
|
64 |
inclusion of the above copyright notice. This software may not |
|
65 |
be provided or otherwise made available to, or used by, any |
|
66 |
other person. No title to or ownership of the software is |
|
67 |
hereby transferred. |
|
68 |
" |
|
69 |
||
70 |
||
71 |
! |
|
72 |
||
753 | 73 |
documentation |
74 |
" |
|
1200 | 75 |
Framework class for tool applications (UIPainter, MenuEditor etc.). |
76 |
Provides hooks for modifiedChannels, history management, |
|
782 | 77 |
showing help texts, about menu, help menu etc. |
753 | 78 |
|
79 |
[author:] |
|
876 | 80 |
Thomas Zwick, eXept Software AG |
753 | 81 |
" |
82 |
! ! |
|
83 |
||
84 |
!ToolApplicationModel class methodsFor:'accessing'! |
|
85 |
||
1150
5211197a2671
NEVER - redefine allInstances
Claus Gittinger <cg@exept.de>
parents:
1148
diff
changeset
|
86 |
allToolInstances |
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
87 |
^ instances ? #() |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
88 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
89 |
"Created: / 4.2.1999 / 15:34:55 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
90 |
! |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
91 |
|
800 | 92 |
authorLinesForAboutBox |
907 | 93 |
"extracts the author(s) from the documentation method." |
800 | 94 |
|
2266 | 95 |
|firstClassWithDocumentation docMethod src s line lines| |
753 | 96 |
|
1555
ba83d682d20a
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
97 |
firstClassWithDocumentation := self class withAllSuperclasses detect:[:metacls| metacls includesSelector:#documentation]. |
800 | 98 |
firstClassWithDocumentation notNil ifTrue:[ |
99 |
(firstClassWithDocumentation inheritsFrom:ToolApplicationModel class) ifTrue:[ |
|
2266 | 100 |
docMethod := firstClassWithDocumentation compiledMethodAt:#documentation. |
101 |
docMethod notNil ifTrue:[ |
|
102 |
src := docMethod source. |
|
103 |
src notNil ifTrue:[ |
|
104 |
s := src readStream. |
|
3296 | 105 |
s upToAllExcluding:'[author:]'. |
2266 | 106 |
s nextLine. "/ skip to end |
107 |
line := s nextLine. "/ line after [author:] |
|
108 |
lines := OrderedCollection new. |
|
109 |
[line notEmptyOrNil] whileTrue:[ |
|
110 |
line := line withoutSeparators. |
|
111 |
line size > 1 ifTrue:[ |
|
112 |
lines add:line withoutSeparators. |
|
113 |
line := s nextLine. |
|
114 |
] ifFalse:[ |
|
115 |
line := nil |
|
116 |
] |
|
117 |
]. |
|
118 |
^ lines. |
|
119 |
] |
|
800 | 120 |
] |
121 |
] |
|
122 |
]. |
|
2266 | 123 |
( #('stx' 'exept') includes:self class package asPackageId module) ifTrue:[ |
124 |
^ #('eXept Software AG') |
|
125 |
]. |
|
800 | 126 |
|
2266 | 127 |
^ #('?') |
128 |
||
129 |
"Created: / 01-02-1998 / 15:41:43 / cg" |
|
130 |
"Modified: / 25-10-2006 / 17:29:35 / cg" |
|
753 | 131 |
! |
132 |
||
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
133 |
forgetInstance:anInstance |
2121 | 134 |
instances notNil ifTrue:[ |
135 |
instances remove:anInstance ifAbsent:[]. |
|
3196 | 136 |
instances := instances asNilIfEmpty. |
2121 | 137 |
]. |
1089
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 |
"Modified: / 4.2.1999 / 15:38:49 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
140 |
! |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
141 |
|
753 | 142 |
label |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
143 |
"returns the label for the tool instances of this class; |
907 | 144 |
extracted from the class name; |
145 |
can be redefined in subclasses" |
|
753 | 146 |
|
147 |
|label| |
|
148 |
label := ''. |
|
149 |
self name do: |
|
150 |
[:c| |
|
151 |
c isUppercase ifTrue: [label := label, $ ]. |
|
152 |
label := label, c |
|
153 |
]. |
|
154 |
^label trimBlanks |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
155 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
156 |
"Modified: / 31.7.1998 / 18:04:18 / cg" |
782 | 157 |
! |
158 |
||
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
159 |
rememberInstance:anInstance |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
160 |
instances isNil ifTrue:[ |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
161 |
instances := WeakIdentitySet new |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
162 |
]. |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
163 |
instances add:anInstance |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
164 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
165 |
"Created: / 4.2.1999 / 15:33:43 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
166 |
"Modified: / 4.2.1999 / 15:34:14 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
167 |
! |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
168 |
|
850 | 169 |
settings |
907 | 170 |
"returns the settings dictionary" |
850 | 171 |
|
872 | 172 |
settings isNil ifTrue: [settings := IdentityDictionary new]. |
173 |
^settings |
|
850 | 174 |
! |
175 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
176 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
177 |
"returns true if active help is turned on for instances of this class" |
782 | 178 |
|
2919 | 179 |
"/ cg: the default is now false - we use flyByHelp now, not the info-area help |
180 |
showingHelp isNil ifTrue: [showingHelp := false]. |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
181 |
^showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
182 |
|
2919 | 183 |
" |
184 |
self withAllSubclassesDo:[:cls | cls showingHelp:false] |
|
185 |
WorkspaceApplication showingHelp |
|
186 |
" |
|
187 |
||
188 |
"Created: / 31-07-1998 / 18:03:38 / cg" |
|
189 |
"Modified (comment): / 06-07-2011 / 18:01:13 / cg" |
|
782 | 190 |
! |
191 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
192 |
showingHelp: aBoolean |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
193 |
"enable/disable active help for instances of this class" |
782 | 194 |
|
3280 | 195 |
showingHelp := aBoolean |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
196 |
|
2919 | 197 |
" |
198 |
self withAllSubclassesDo:[:cls | cls showingHelp:false] |
|
199 |
" |
|
200 |
||
201 |
"Modified: / 31-07-1998 / 18:17:14 / cg" |
|
202 |
"Modified (comment): / 06-07-2011 / 17:54:13 / cg" |
|
753 | 203 |
! ! |
204 |
||
756 | 205 |
!ToolApplicationModel class methodsFor:'clipboard'! |
206 |
||
207 |
clipboard |
|
907 | 208 |
"returns the clipboard of this tool class" |
756 | 209 |
|
210 |
^clipboard |
|
211 |
! |
|
212 |
||
213 |
clipboard: anEditObject |
|
907 | 214 |
"sets the clipboard for this tool class" |
756 | 215 |
|
216 |
clipboard := anEditObject |
|
217 |
! ! |
|
218 |
||
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
219 |
!ToolApplicationModel class methodsFor:'help'! |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
220 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
221 |
openAboutSTX |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
222 |
"opens an about box (on ST/X)" |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
223 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
224 |
|box| |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
225 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
226 |
AboutBox isNil ifTrue:[ |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
227 |
"/ this handles bad installations of ST/X, |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
228 |
"/ where the AboutBox is missing. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
229 |
"/ (May vanish in the future) |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
230 |
^ self information:('Smalltalk/X rev.' , Smalltalk versionString) |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
231 |
]. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
232 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
233 |
box := AboutBox new. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
234 |
box autoHideAfter:10 with:[]. |
1091 | 235 |
box showAtCenter |
236 |
"/ box showAtPointer |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
237 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
238 |
"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
|
239 |
"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
|
240 |
! ! |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
241 |
|
762 | 242 |
!ToolApplicationModel class methodsFor:'help specs'! |
243 |
||
1538 | 244 |
flyByHelpSpec |
245 |
<resource: #help> |
|
246 |
||
1544 | 247 |
^super flyByHelpSpec addPairsFrom:#( |
248 |
||
249 |
"/#commitCancel |
|
250 |
"/'Cancels' |
|
251 |
"/ |
|
252 |
"/#commitOK |
|
253 |
"/'Commit' |
|
254 |
||
255 |
#editCopy |
|
3107 | 256 |
'Copy selection' |
1544 | 257 |
|
258 |
#editCut |
|
3107 | 259 |
'Cut selection' |
1544 | 260 |
|
261 |
#editDelete |
|
3107 | 262 |
'Delete selection' |
1544 | 263 |
|
2587 | 264 |
#editSearch |
265 |
'Search' |
|
266 |
||
1544 | 267 |
#editMoveDown |
1644 | 268 |
'Move Down' |
1544 | 269 |
|
270 |
#editMoveIn |
|
1644 | 271 |
'Move Into Next' |
1544 | 272 |
|
273 |
#editMoveInAbove |
|
1644 | 274 |
'Move Into Previous' |
1538 | 275 |
|
1544 | 276 |
#editMoveOut |
1644 | 277 |
'Move Out' |
1544 | 278 |
|
279 |
#editMoveUp |
|
1644 | 280 |
'Move Up' |
1544 | 281 |
|
282 |
#editPaste |
|
283 |
'Paste' |
|
284 |
||
285 |
#editUndo |
|
286 |
'Undo' |
|
287 |
||
288 |
#fileBrowseClass |
|
289 |
'Browse class' |
|
290 |
||
291 |
#fileDefineClass |
|
292 |
'Define class' |
|
293 |
||
294 |
#fileDefineClassAndSelector |
|
295 |
'Define class & selector' |
|
296 |
||
297 |
#fileExit |
|
298 |
'Exit' |
|
299 |
||
300 |
#helpShowHelp |
|
301 |
'Toggle help' |
|
1538 | 302 |
) |
303 |
! |
|
304 |
||
762 | 305 |
helpSpec |
869 | 306 |
"This resource specification was automatically generated |
307 |
by the UIHelpTool of ST/X." |
|
308 |
||
309 |
"Do not manually edit this!! If it is corrupted, |
|
310 |
the UIHelpTool may not be able to read the specification." |
|
762 | 311 |
|
312 |
" |
|
3822 | 313 |
UIHelpTool openOnClass:ToolApplicationModel |
762 | 314 |
" |
315 |
||
869 | 316 |
<resource: #help> |
317 |
||
3822 | 318 |
^ super helpSpec addPairsFrom:#( |
762 | 319 |
|
823 | 320 |
#about |
3107 | 321 |
'Info functions' |
823 | 322 |
|
762 | 323 |
#aboutSTX |
3107 | 324 |
'Info about the running ST/X' |
762 | 325 |
|
326 |
#aboutThisAppliaction |
|
3107 | 327 |
'Info about that applications release and author' |
762 | 328 |
|
823 | 329 |
#add |
3107 | 330 |
'Add functions' |
823 | 331 |
|
3822 | 332 |
#addTab |
333 |
'Add another page (tab)' |
|
334 |
||
823 | 335 |
#commitCancel |
3107 | 336 |
'Cancel changes' |
823 | 337 |
|
338 |
#commitOK |
|
3107 | 339 |
'Commit changes' |
823 | 340 |
|
341 |
#edit |
|
3107 | 342 |
'Edit functions' |
823 | 343 |
|
344 |
#editCopy |
|
3107 | 345 |
'Copy the selected item(s) to the clipboard' |
762 | 346 |
|
782 | 347 |
#editCut |
3107 | 348 |
'Cut the selected item(s) to the clipboard' |
853 | 349 |
|
350 |
#editDelete |
|
3107 | 351 |
'Delete the selected item(s)' |
782 | 352 |
|
823 | 353 |
#editMoveDown |
3107 | 354 |
'Move the selected item one step down (in the order list)' |
823 | 355 |
|
356 |
#editMoveIn |
|
3107 | 357 |
'Move the selected item into the next item (as child item)' |
1471 | 358 |
|
359 |
#editMoveInAbove |
|
3107 | 360 |
'Move the selected item into the previous item (as child item)' |
823 | 361 |
|
362 |
#editMoveOut |
|
3107 | 363 |
'Move the selected item out of its parent item' |
823 | 364 |
|
365 |
#editMoveUp |
|
3107 | 366 |
'Move the selected item one step up (in the order list)' |
782 | 367 |
|
368 |
#editPaste |
|
3107 | 369 |
'Paste from the clipboard' |
782 | 370 |
|
3822 | 371 |
#editRedo |
372 |
'Redo the last undone action' |
|
373 |
||
782 | 374 |
#editUndo |
3107 | 375 |
'Undo the last action' |
782 | 376 |
|
823 | 377 |
#file |
3107 | 378 |
'File functions' |
805 | 379 |
|
823 | 380 |
#fileBrowseClass |
3107 | 381 |
'Open a System Browser on the current class' |
805 | 382 |
|
823 | 383 |
#fileDefineClass |
3107 | 384 |
'Open a dialog to define the current class' |
805 | 385 |
|
386 |
#fileDefineClassAndSelector |
|
3107 | 387 |
'Open a dialog to define the current class and selector' |
805 | 388 |
|
823 | 389 |
#fileExit |
3107 | 390 |
'Exit this application' |
823 | 391 |
|
922 | 392 |
#generate |
3107 | 393 |
'Code generation' |
922 | 394 |
|
823 | 395 |
#help |
3107 | 396 |
'Help functions' |
823 | 397 |
|
876 | 398 |
#helpHelpTool |
3107 | 399 |
'Show the Help Tools documentation' |
876 | 400 |
|
823 | 401 |
#helpShowHelp |
3107 | 402 |
'Toggle display of help texts' |
823 | 403 |
|
404 |
#helpTutorial |
|
3107 | 405 |
'Show this applications documentation' |
823 | 406 |
|
407 |
#history |
|
3107 | 408 |
'History functions' |
803 | 409 |
|
410 |
#historyEmptyMenu |
|
3107 | 411 |
'Clear the history' |
803 | 412 |
|
823 | 413 |
#historyMenuItem |
3107 | 414 |
'Switch to that item' |
762 | 415 |
|
893 | 416 |
#settings |
3107 | 417 |
'Settings functions' |
893 | 418 |
|
823 | 419 |
#test |
3107 | 420 |
'Test functions' |
762 | 421 |
|
422 |
) |
|
423 |
! ! |
|
424 |
||
753 | 425 |
!ToolApplicationModel class methodsFor:'history'! |
426 |
||
1969 | 427 |
getFileHistory |
428 |
"returns the file-history for this tool class" |
|
429 |
||
430 |
fileHistory isNil ifTrue: [fileHistory := OrderedCollection new]. |
|
431 |
^ fileHistory |
|
432 |
! |
|
433 |
||
753 | 434 |
getHistory |
907 | 435 |
"returns the history for this tool class" |
753 | 436 |
|
761
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
437 |
history isNil ifTrue: [history := OrderedCollection new]. |
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
438 |
^history |
753 | 439 |
|
440 |
! |
|
441 |
||
442 |
historyMaxSize |
|
907 | 443 |
"returns the maximum size for the history of this tool class" |
753 | 444 |
|
445 |
^10 |
|
446 |
||
447 |
! ! |
|
448 |
||
869 | 449 |
!ToolApplicationModel class methodsFor:'image specs'! |
450 |
||
451 |
desktopIcon |
|
907 | 452 |
"returns the icon used for the desktop" |
869 | 453 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
454 |
<resource: #programImage> |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
455 |
|
869 | 456 |
^Icon |
457 |
constantNamed:#'ToolApplicationModel desktopIcon' |
|
458 |
ifAbsentPut: |
|
459 |
[ |
|
460 |
|desktopIcon| |
|
990 | 461 |
desktopIcon := Icon stxIcon. |
3550 | 462 |
desktopIcon magnifiedBy:Screen current preferredIconSize/desktopIcon extent |
869 | 463 |
] |
464 |
||
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
465 |
"Modified: / 24.8.1998 / 21:34:38 / cg" |
869 | 466 |
! |
467 |
||
468 |
menuIcon |
|
907 | 469 |
"returns the icon used for the menu bar" |
869 | 470 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
471 |
<resource: #programImage> |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
472 |
|
869 | 473 |
^Icon |
474 |
constantNamed:#'ToolApplicationModel menuIcon' |
|
475 |
ifAbsentPut: |
|
476 |
[ |
|
3550 | 477 |
|menuIcon| |
990 | 478 |
menuIcon := Icon stxIcon. |
3550 | 479 |
menuIcon magnifiedBy: (MenuPanel defaultFont heightOn:Screen current)/menuIcon height |
869 | 480 |
] |
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
481 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
482 |
"Modified: / 24.8.1998 / 21:34:33 / cg" |
987 | 483 |
! ! |
869 | 484 |
|
753 | 485 |
!ToolApplicationModel class methodsFor:'interface specs'! |
486 |
||
797 | 487 |
windowSpecForCommit |
869 | 488 |
"This resource specification was automatically generated |
489 |
by the UIPainter of ST/X." |
|
490 |
||
491 |
"Do not manually edit this!! If it is corrupted, |
|
492 |
the UIPainter may not be able to read the specification." |
|
493 |
||
494 |
" |
|
495 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit |
|
496 |
ToolApplicationModel new openInterface:#windowSpecForCommit |
|
497 |
" |
|
797 | 498 |
|
499 |
<resource: #canvas> |
|
500 |
||
1259
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 |
#(#FullSpec |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
503 |
#name: #windowSpecForCommit |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
504 |
#window: |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
505 |
#(#WindowSpec |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
506 |
#label: 'Commit Buttons' |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
507 |
#name: 'Commit Buttons' |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
508 |
#min: #(#Point 100 22) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
509 |
#max: #(#Point 1152 900) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
510 |
#bounds: #(#Rectangle 18 51 318 111) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
511 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
512 |
#component: |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
513 |
#(#SpecCollection |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
514 |
#collection: #( |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
515 |
#(#HorizontalPanelViewSpec |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
516 |
#name: 'HorizontalPanel1' |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
517 |
#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
|
518 |
#horizontalLayout: #fitSpace |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
519 |
#verticalLayout: #centerMax |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
520 |
#horizontalSpace: 3 |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
521 |
#verticalSpace: 3 |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
522 |
#reverseOrderIfOKAtLeft: true |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
523 |
#component: |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
524 |
#(#SpecCollection |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
525 |
#collection: #( |
797 | 526 |
#(#ActionButtonSpec |
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
527 |
#label: 'Cancel' |
859 | 528 |
#name: 'cancelButton' |
529 |
#activeHelpKey: #commitCancel |
|
927 | 530 |
#translateLabel: true |
1752
4f7f144157b2
do not resize button labels for label-text
Claus Gittinger <cg@exept.de>
parents:
1751
diff
changeset
|
531 |
"/ #resizeForLabel: true |
859 | 532 |
#tabable: true |
533 |
#model: #cancel |
|
2104 | 534 |
#enableChannel: #enablingCommitButtonsHolder |
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
535 |
#useDefaultExtent: true |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
536 |
) |
797 | 537 |
#(#ActionButtonSpec |
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
538 |
#label: 'OK' |
859 | 539 |
#name: 'okButton' |
540 |
#activeHelpKey: #commitOK |
|
927 | 541 |
#translateLabel: true |
1752
4f7f144157b2
do not resize button labels for label-text
Claus Gittinger <cg@exept.de>
parents:
1751
diff
changeset
|
542 |
"/ #resizeForLabel: true |
859 | 543 |
#tabable: true |
544 |
#model: #accept |
|
2104 | 545 |
#enableChannel: #enablingCommitButtonsHolder |
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
546 |
#useDefaultExtent: true |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
547 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
548 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
549 |
|
797 | 550 |
) |
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
551 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
552 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
553 |
|
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
554 |
) |
797 | 555 |
) |
556 |
! |
|
557 |
||
558 |
windowSpecForCommitWithoutChannels |
|
869 | 559 |
"This resource specification was automatically generated |
560 |
by the UIPainter of ST/X." |
|
561 |
||
562 |
"Do not manually edit this!! If it is corrupted, |
|
563 |
the UIPainter may not be able to read the specification." |
|
564 |
||
565 |
" |
|
566 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels |
|
567 |
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels |
|
568 |
" |
|
797 | 569 |
|
570 |
<resource: #canvas> |
|
571 |
||
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
572 |
^ |
1989 | 573 |
#(FullSpec |
574 |
name: windowSpecForCommitWithoutChannels |
|
575 |
window: |
|
576 |
(WindowSpec |
|
577 |
label: 'Commit Buttons Without Channels' |
|
578 |
name: 'Commit Buttons Without Channels' |
|
579 |
min: (Point 100 22) |
|
580 |
max: (Point 1152 900) |
|
581 |
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
|
582 |
) |
1989 | 583 |
component: |
584 |
(SpecCollection |
|
585 |
collection: ( |
|
586 |
(HorizontalPanelViewSpec |
|
587 |
name: 'HorizontalPanel1' |
|
588 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
589 |
horizontalLayout: fitSpace |
|
590 |
verticalLayout: centerMax |
|
591 |
horizontalSpace: 3 |
|
592 |
verticalSpace: 3 |
|
593 |
reverseOrderIfOKAtLeft: true |
|
594 |
component: |
|
595 |
(SpecCollection |
|
596 |
collection: ( |
|
597 |
(ActionButtonSpec |
|
598 |
label: 'Cancel' |
|
599 |
name: 'cancelButton' |
|
600 |
activeHelpKey: commitCancel |
|
601 |
translateLabel: true |
|
602 |
tabable: true |
|
603 |
model: cancel |
|
604 |
useDefaultExtent: true |
|
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
605 |
) |
1989 | 606 |
(ActionButtonSpec |
607 |
label: 'OK' |
|
608 |
name: 'okButton' |
|
609 |
activeHelpKey: commitOK |
|
610 |
translateLabel: true |
|
611 |
tabable: true |
|
612 |
model: accept |
|
613 |
isDefault: true |
|
614 |
useDefaultExtent: true |
|
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
615 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
616 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
617 |
|
797 | 618 |
) |
1259
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
619 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
620 |
) |
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
621 |
|
394ab30e07e0
OK/Cancel button spec (reverse if OK atLeft)
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
622 |
) |
797 | 623 |
) |
624 |
! |
|
625 |
||
626 |
windowSpecForInfoBar |
|
869 | 627 |
"This resource specification was automatically generated |
628 |
by the UIPainter of ST/X." |
|
629 |
||
630 |
"Do not manually edit this!! If it is corrupted, |
|
631 |
the UIPainter may not be able to read the specification." |
|
632 |
||
633 |
" |
|
634 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar |
|
635 |
ToolApplicationModel new openInterface:#windowSpecForInfoBar |
|
636 |
" |
|
797 | 637 |
|
638 |
<resource: #canvas> |
|
639 |
||
1530 | 640 |
^ |
641 |
#(#FullSpec |
|
642 |
#name: #windowSpecForInfoBar |
|
643 |
#window: |
|
644 |
#(#WindowSpec |
|
645 |
#label: 'Info Bar' |
|
646 |
#name: 'Info Bar' |
|
647 |
#min: #(#Point 400 320) |
|
648 |
#max: #(#Point 1152 900) |
|
649 |
#bounds: #(#Rectangle 13 23 513 369) |
|
650 |
) |
|
651 |
#component: |
|
652 |
#(#SpecCollection |
|
653 |
#collection: #( |
|
654 |
#(#ViewSpec |
|
2108 | 655 |
#name: 'infoView' |
1545 | 656 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1530 | 657 |
#component: |
658 |
#(#SpecCollection |
|
659 |
#collection: #( |
|
660 |
#(#LabelSpec |
|
3680 | 661 |
#name: 'InfoLabel' |
1545 | 662 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1530 | 663 |
#level: -1 |
2104 | 664 |
#labelChannel: #infoLabelHolder |
1530 | 665 |
#resizeForLabel: false |
666 |
#adjust: #left |
|
667 |
) |
|
668 |
) |
|
669 |
||
797 | 670 |
) |
1530 | 671 |
) |
672 |
) |
|
673 |
||
674 |
) |
|
797 | 675 |
) |
676 |
! |
|
677 |
||
678 |
windowSpecForInfoBarWithClock |
|
869 | 679 |
"This resource specification was automatically generated |
680 |
by the UIPainter of ST/X." |
|
681 |
||
682 |
"Do not manually edit this!! If it is corrupted, |
|
683 |
the UIPainter may not be able to read the specification." |
|
684 |
||
685 |
" |
|
686 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBarWithClock |
|
687 |
ToolApplicationModel new openInterface:#windowSpecForInfoBarWithClock |
|
688 |
" |
|
797 | 689 |
|
690 |
<resource: #canvas> |
|
691 |
||
1331 | 692 |
^ |
693 |
#(#FullSpec |
|
694 |
#name: #windowSpecForInfoBarWithClock |
|
695 |
#window: |
|
696 |
#(#WindowSpec |
|
697 |
#label: 'Info Bar' |
|
698 |
#name: 'Info Bar' |
|
699 |
#min: #(#Point 400 320) |
|
700 |
#max: #(#Point 1152 900) |
|
1530 | 701 |
#bounds: #(#Rectangle 13 23 513 343) |
1331 | 702 |
) |
703 |
#component: |
|
704 |
#(#SpecCollection |
|
705 |
#collection: #( |
|
706 |
#(#VariableHorizontalPanelSpec |
|
2108 | 707 |
#name: 'infoView' |
1545 | 708 |
#layout: #(#LayoutFrame 0 0 0 0 0 1 0 1) |
1331 | 709 |
#barWidth: 2 |
710 |
#showHandle: false |
|
711 |
#component: |
|
712 |
#(#SpecCollection |
|
713 |
#collection: #( |
|
714 |
#(#LabelSpec |
|
3680 | 715 |
#name: 'InfoLabel' |
1331 | 716 |
#level: -1 |
2104 | 717 |
#labelChannel: #infoLabelHolder |
1331 | 718 |
#resizeForLabel: false |
719 |
#adjust: #left |
|
720 |
) |
|
721 |
#(#LabelSpec |
|
722 |
#name: 'timeLabel' |
|
723 |
#level: -1 |
|
2104 | 724 |
#labelChannel: #timeLabelHolder |
1331 | 725 |
#resizeForLabel: false |
726 |
#adjust: #rightLeft |
|
727 |
) |
|
728 |
) |
|
729 |
||
797 | 730 |
) |
1331 | 731 |
#handles: #(#Any 0.854 1.0) |
732 |
) |
|
733 |
) |
|
734 |
||
735 |
) |
|
797 | 736 |
) |
737 |
! ! |
|
738 |
||
739 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
740 |
||
753 | 741 |
menuAbout |
869 | 742 |
"This resource specification was automatically generated |
743 |
by the MenuEditor of ST/X." |
|
744 |
||
745 |
"Do not manually edit this!! If it is corrupted, |
|
746 |
the MenuEditor may not be able to read the specification." |
|
747 |
||
748 |
" |
|
749 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuAbout |
|
750 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp |
|
751 |
" |
|
753 | 752 |
|
753 |
<resource: #menu> |
|
754 |
||
755 |
^ |
|
859 | 756 |
|
753 | 757 |
#(#Menu |
758 |
||
759 |
#( |
|
760 |
#(#MenuItem |
|
859 | 761 |
#label: 'About Smalltalk/X...' |
762 |
#translateLabel: true |
|
763 |
#value: #openAbout |
|
764 |
#activeHelpKey: #aboutSTX |
|
753 | 765 |
) |
766 |
#(#MenuItem |
|
859 | 767 |
#label: '-' |
753 | 768 |
) |
769 |
#(#MenuItem |
|
922 | 770 |
#label: 'About this Application...' |
859 | 771 |
#translateLabel: true |
772 |
#value: #openAboutThisApplication |
|
773 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 774 |
) |
775 |
) nil |
|
776 |
nil |
|
777 |
) |
|
922 | 778 |
|
779 |
"Modified: / 19.5.1998 / 21:44:09 / cg" |
|
753 | 780 |
! |
781 |
||
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
782 |
menuHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
783 |
"This resource specification was automatically generated |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
784 |
by the MenuEditor of ST/X." |
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 |
"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
|
787 |
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
|
788 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
789 |
" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
790 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
791 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
792 |
" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
793 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
794 |
<resource: #menu> |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
795 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
796 |
^ |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
797 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
798 |
#(#Menu |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
799 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
800 |
#( |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
801 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
802 |
#label: 'Documentation' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
803 |
#translateLabel: true |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
804 |
#value: #openDocumentation |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
805 |
#activeHelpKey: #helpTutorial |
2104 | 806 |
#enabled: #havingDocumentationHolder |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
807 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
808 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
809 |
#label: '-' |
3892 | 810 |
#isVisible: false |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
811 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
812 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
813 |
#label: 'Show Help Texts' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
814 |
#translateLabel: true |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
815 |
#activeHelpKey: #helpShowHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
816 |
#indication: #showingHelp: |
3892 | 817 |
#isVisible: false |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
818 |
) |
1516 | 819 |
#(#MenuItem |
820 |
#label: '-' |
|
821 |
) |
|
822 |
#(#MenuItem |
|
823 |
#label: 'About this Application...' |
|
824 |
#translateLabel: true |
|
825 |
#value: #openAboutThisApplication |
|
826 |
#activeHelpKey: #aboutThisAppliaction |
|
827 |
) |
|
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
828 |
) nil |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
829 |
nil |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
830 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
831 |
|
3892 | 832 |
"Modified: / 16-02-2017 / 02:04:20 / cg" |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
833 |
! |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
834 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
835 |
xxxmenuFont |
869 | 836 |
"This resource specification was automatically generated |
837 |
by the MenuEditor of ST/X." |
|
838 |
||
839 |
"Do not manually edit this!! If it is corrupted, |
|
840 |
the MenuEditor may not be able to read the specification." |
|
841 |
||
842 |
" |
|
843 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuFont |
|
844 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuFont)) startUp |
|
845 |
" |
|
846 |
||
847 |
<resource: #menu> |
|
848 |
||
849 |
^ |
|
850 |
||
851 |
#(#Menu |
|
852 |
||
853 |
#( |
|
854 |
#(#MenuItem |
|
872 | 855 |
#label: 'Label...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
856 |
#translateLabel: true |
869 | 857 |
#value: #chooseFont: |
858 |
#argument: 'Label Font' |
|
859 |
) |
|
860 |
#(#MenuItem |
|
872 | 861 |
#label: 'Button...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
862 |
#translateLabel: true |
869 | 863 |
#value: #chooseFont: |
864 |
#argument: 'Button Font' |
|
865 |
) |
|
866 |
#(#MenuItem |
|
872 | 867 |
#label: 'Edit...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
868 |
#translateLabel: true |
869 | 869 |
#value: #chooseFont: |
870 |
#argument: 'Edit Font' |
|
871 |
) |
|
872 |
#(#MenuItem |
|
872 | 873 |
#label: 'List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
874 |
#translateLabel: true |
869 | 875 |
#value: #chooseFont: |
876 |
#argument: 'List Font' |
|
877 |
) |
|
878 |
#(#MenuItem |
|
872 | 879 |
#label: 'Tree List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
880 |
#translateLabel: true |
869 | 881 |
#value: #chooseFont: |
882 |
#argument: 'Tree List Font' |
|
883 |
) |
|
884 |
#(#MenuItem |
|
872 | 885 |
#label: 'Note Book...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
886 |
#translateLabel: true |
872 | 887 |
#value: #chooseFont: |
888 |
#argument: 'Note Book Font' |
|
889 |
) |
|
890 |
#(#MenuItem |
|
891 |
#label: 'Framed Box...' |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
892 |
#translateLabel: true |
872 | 893 |
#value: #chooseFont: |
894 |
#argument: 'Framed Box Font' |
|
895 |
) |
|
896 |
#(#MenuItem |
|
869 | 897 |
#label: '-' |
898 |
) |
|
899 |
#(#MenuItem |
|
872 | 900 |
#label: 'Reset' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
901 |
#translateLabel: true |
869 | 902 |
#value: #resetFonts |
903 |
) |
|
904 |
) nil |
|
905 |
nil |
|
906 |
) |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
907 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
908 |
"Modified: / 31.7.1998 / 18:55:34 / cg" |
753 | 909 |
! ! |
910 |
||
907 | 911 |
!ToolApplicationModel class methodsFor:'queries'! |
912 |
||
3521 | 913 |
isAbstract |
914 |
^ self == ToolApplicationModel |
|
907 | 915 |
! ! |
916 |
||
2537 | 917 |
!ToolApplicationModel class methodsFor:'startup & release'! |
753 | 918 |
|
782 | 919 |
preSnapshot |
907 | 920 |
"removes the clipboard before snap shoting" |
753 | 921 |
|
782 | 922 |
clipboard := nil |
753 | 923 |
! |
924 |
||
782 | 925 |
uninitialize |
907 | 926 |
"resets the class instance variables" |
760 | 927 |
|
1969 | 928 |
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
|
929 |
|
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
930 |
" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
931 |
self withAllSubclasses do:[:c | c uninitialize] |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
932 |
" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
933 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
934 |
"Modified: / 4.2.1999 / 15:37:43 / cg" |
753 | 935 |
! ! |
936 |
||
782 | 937 |
!ToolApplicationModel methodsFor:'aspects'! |
938 |
||
1147 | 939 |
acceptChannel |
940 |
"returns a valueHolder which can be set to true to force all inputFields |
|
941 |
to accept their value." |
|
942 |
||
943 |
|holder| |
|
944 |
||
945 |
(holder := builder bindingAt:#acceptChannel) isNil ifTrue:[ |
|
1157 | 946 |
builder aspectAt:#acceptChannel put:(holder := ValueHolder with:false). |
1147 | 947 |
]. |
948 |
^ holder |
|
949 |
||
950 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
|
951 |
! |
|
952 |
||
2104 | 953 |
canCopyHolder |
954 |
"returns whether can copy as value holder" |
|
955 |
||
956 |
^ self builder booleanValueAspectFor:#valueOfCanCopy |
|
957 |
! |
|
958 |
||
959 |
canCutHolder |
|
960 |
"returns whether can cut as value holder" |
|
961 |
||
962 |
^ builder booleanValueAspectFor:#valueOfCanCut |
|
963 |
! |
|
964 |
||
965 |
canPasteHolder |
|
966 |
"returns whether can paste as value holder" |
|
967 |
||
968 |
^ builder booleanValueAspectFor:#valueOfCanPaste |
|
969 |
! |
|
970 |
||
971 |
canUndoHolder |
|
972 |
"returns whether can undo as value holder" |
|
973 |
||
974 |
^ builder booleanValueAspectFor:#valueOfCanUndo |
|
975 |
! |
|
976 |
||
977 |
enablingCommitButtonsHolder |
|
978 |
"returns the enabling of the commit of this tool as value holder" |
|
979 |
||
980 |
^ builder booleanValueAspectFor:#valueOfEnablingCommitButtons |
|
981 |
! |
|
982 |
||
983 |
havingDocumentationHolder |
|
984 |
"returns the enabling of having documentation for this tool as value holder" |
|
985 |
||
986 |
^ (builder booleanValueAspectFor:#valueOfHavingDocumentation) value: (self class includesSelector: #openDocumentation) |
|
987 |
! |
|
988 |
||
989 |
infoLabelHolder |
|
990 |
"returns the info label as value holder" |
|
991 |
||
992 |
^ builder nilValueAspectFor:#valueOfInfoLabel |
|
993 |
! |
|
994 |
||
2108 | 995 |
infoLabelHolder:aValueHolder |
996 |
builder aspectAt:#useAlienInfoLabelHolder put:true. |
|
997 |
builder aspectAt:#valueOfInfoLabel put:aValueHolder. |
|
998 |
! |
|
999 |
||
1147 | 1000 |
modifiedChannel |
1001 |
"returns a valueHolder which is set to true, whenever any of |
|
1002 |
my editfields is modified - this is hooked to |
|
2104 | 1003 |
the enablingCommitButtonsHolder channel" |
1147 | 1004 |
|
1005 |
|holder| |
|
1006 |
||
1007 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[ |
|
1157 | 1008 |
builder aspectAt:#modifiedChannel put:(holder := ValueHolder with:false). |
1147 | 1009 |
holder |
1331 | 1010 |
onChangeEvaluate:[ |
1148 | 1011 |
holder value ifTrue:[ |
2104 | 1012 |
self enablingCommitButtonsHolder value:true. |
1147 | 1013 |
] |
1014 |
] |
|
1015 |
]. |
|
1016 |
^ holder |
|
1017 |
||
1018 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
|
1019 |
! |
|
1020 |
||
2104 | 1021 |
timeLabelHolder |
1022 |
"returns the time label as value holder" |
|
1023 |
||
1024 |
^ builder nilValueAspectFor:#valueOfTimeLabel |
|
1025 |
! |
|
1026 |
||
822 | 1027 |
valueOfCanCopy |
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1028 |
<resource: #obsolete> |
907 | 1029 |
"returns whether can copy as value holder" |
822 | 1030 |
|
2104 | 1031 |
self obsoleteMethodWarning:'stupid name - use #canCopyHolder'. |
1032 |
^ self canCopyHolder |
|
822 | 1033 |
! |
1034 |
||
1035 |
valueOfCanCut |
|
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1036 |
<resource: #obsolete> |
907 | 1037 |
"returns whether can paste as value holder" |
822 | 1038 |
|
2104 | 1039 |
self obsoleteMethodWarning:'stupid name - use #canCutHolder'. |
1040 |
^ self canCutHolder |
|
822 | 1041 |
|
936 | 1042 |
"Modified: / 21.5.1998 / 03:39:13 / cg" |
822 | 1043 |
! |
1044 |
||
1045 |
valueOfCanPaste |
|
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1046 |
<resource: #obsolete> |
907 | 1047 |
"returns whether can paste as value holder" |
822 | 1048 |
|
2104 | 1049 |
self obsoleteMethodWarning:'stupid name - use #canPasteHolder'. |
1050 |
^ self canPasteHolder |
|
822 | 1051 |
! |
1052 |
||
1053 |
valueOfCanUndo |
|
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1054 |
<resource: #obsolete> |
907 | 1055 |
"returns whether can undo as value holder" |
822 | 1056 |
|
2104 | 1057 |
self obsoleteMethodWarning:'stupid name - use #canUndoHolder'. |
1058 |
^ self canUndoHolder |
|
822 | 1059 |
|
936 | 1060 |
"Modified: / 21.5.1998 / 03:39:31 / cg" |
822 | 1061 |
! |
1062 |
||
782 | 1063 |
valueOfEnablingCommitButtons |
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1064 |
<resource: #obsolete> |
907 | 1065 |
"returns the enabling of the commit of this tool as value holder" |
753 | 1066 |
|
2104 | 1067 |
self obsoleteMethodWarning:'stupid name - use #enablingCommitButtonsHolder'. |
1068 |
^ self enablingCommitButtonsHolder |
|
753 | 1069 |
|
936 | 1070 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
782 | 1071 |
! |
1072 |
||
858 | 1073 |
valueOfHavingDocumentation |
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1074 |
<resource: #obsolete> |
1004 | 1075 |
"returns the enabling of having documentation for this tool as value holder" |
803 | 1076 |
|
2104 | 1077 |
self obsoleteMethodWarning:'stupid name - use havingDocumentationHolder'. |
1078 |
^ self havingDocumentationHolder |
|
803 | 1079 |
! |
1080 |
||
782 | 1081 |
valueOfInfoLabel |
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1082 |
<resource: #obsolete> |
907 | 1083 |
"returns the info label as value holder" |
782 | 1084 |
|
2104 | 1085 |
self obsoleteMethodWarning:'stupid name - use infoLabelHolder'. |
1086 |
^ self infoLabelHolder |
|
753 | 1087 |
|
936 | 1088 |
"Modified: / 21.5.1998 / 03:40:34 / cg" |
782 | 1089 |
! |
1090 |
||
1091 |
valueOfTimeLabel |
|
2388
b0fc901b0cbe
Mark obsolte methods as obsolete
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
1092 |
<resource: #obsolete> |
907 | 1093 |
"returns the time label as value holder" |
753 | 1094 |
|
2104 | 1095 |
self obsoleteMethodWarning:'stupid name - use timeLabelHolder'. |
1096 |
^ self timeLabelHolder |
|
753 | 1097 |
|
936 | 1098 |
"Modified: / 21.5.1998 / 03:40:42 / cg" |
753 | 1099 |
! ! |
1100 |
||
782 | 1101 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 1102 |
|
838 | 1103 |
clipboard |
907 | 1104 |
"returns the clipboard" |
838 | 1105 |
|
1106 |
^self class clipboard |
|
1107 |
! |
|
1108 |
||
2104 | 1109 |
clipboard:anEditObject |
907 | 1110 |
"sets the clipboard and the value holder for can pasting" |
753 | 1111 |
|
782 | 1112 |
self class clipboard: anEditObject. |
753 | 1113 |
|
2104 | 1114 |
self canPasteHolder value: anEditObject notNil |
782 | 1115 |
! ! |
1116 |
||
1195
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1117 |
!ToolApplicationModel methodsFor:'clock handling'! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1118 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1119 |
startClock |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1120 |
"/ start the time-block |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1121 |
self startClockOnTimedBlock:[self updateTime]. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1122 |
! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1123 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1124 |
startClockOnTimedBlock: aBlock |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1125 |
"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
|
1126 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1127 |
timeBlock := aBlock. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1128 |
aBlock value. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1129 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1130 |
"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
|
1131 |
! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1132 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1133 |
stopClock |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1134 |
"/ stop the time-block |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1135 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1136 |
timeBlock notNil ifTrue:[ |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1137 |
Processor removeTimedBlock:timeBlock. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1138 |
timeBlock := nil. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1139 |
]. |
2104 | 1140 |
self timeLabelHolder value:'' |
1195
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1141 |
! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1142 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1143 |
updateTime |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1144 |
"update my time-field" |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1145 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1146 |
|now hours minutes suffix| |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1147 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1148 |
now := Time now. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1149 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1150 |
hours := now hours. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1151 |
minutes := now minutes printString. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1152 |
suffix := ' '. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1153 |
|
2121 | 1154 |
(resources string:'TIME_FORMAT' default:12) == 12 ifTrue:[ |
1195
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1155 |
suffix := ' am '. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1156 |
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
|
1157 |
]. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1158 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1159 |
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
|
1160 |
|
2104 | 1161 |
self timeLabelHolder value:(hours printString, ':', minutes, suffix). |
1195
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1162 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1163 |
timeBlock notNil ifTrue:[ |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1164 |
Processor removeTimedBlock:timeBlock. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1165 |
Processor addTimedBlock:timeBlock afterSeconds:5 |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1166 |
] |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1167 |
! ! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1168 |
|
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1169 |
!ToolApplicationModel methodsFor:'defaults'! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1170 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1171 |
aboutImage |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1172 |
"the image to be displayed in my about-box; |
3958 | 1173 |
If nil is returned, the ST/X default image is used." |
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1174 |
|
2771 | 1175 |
^ self class defaultIcon |
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1176 |
|
3958 | 1177 |
"Created: / 25-07-1998 / 20:33:50 / cg" |
1178 |
"Modified (comment): / 23-05-2017 / 16:13:50 / mawalch" |
|
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1179 |
! ! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1180 |
|
782 | 1181 |
!ToolApplicationModel methodsFor:'help'! |
753 | 1182 |
|
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1183 |
aboutThisApplicationText |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1184 |
"text for an about box for this application. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1185 |
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
|
1186 |
the classes documentation." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1187 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1188 |
|rev myClass clsRev msg| |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1189 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1190 |
rev := ''. |
2480
e42b4f10bb5c
fixed aboutThisApplicationText
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
1191 |
myClass := (self class topOwningClass) ? self class. |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1192 |
|
2271 | 1193 |
(clsRev := myClass revision) notNil ifTrue: [ |
1194 |
rev := ' (rev: ', clsRev printString, ')' |
|
1195 |
]. |
|
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1196 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1197 |
msg := '\The application\\' withCRs |
3547 | 1198 |
, myClass name allBold, rev |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1199 |
, '\\has been designed and implemented by: \' withCRs |
2451 | 1200 |
, ((self class authorLinesForAboutBox collect:[:l | ' ' , l]) asStringWith:$\) withCRs |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1201 |
, '\\' withCRs. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1202 |
msg := msg withTabsExpanded. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1203 |
^msg |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1204 |
|
2271 | 1205 |
"Created: / 13-11-2001 / 12:34:19 / cg" |
1206 |
"Modified: / 27-10-2006 / 16:13:35 / cg" |
|
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1207 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1208 |
|
762 | 1209 |
defaultInfoLabel |
907 | 1210 |
"returns the default info label; here an empty string" |
762 | 1211 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1212 |
^ '' |
984 | 1213 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1214 |
"Modified: / 31.7.1998 / 18:44:55 / cg" |
984 | 1215 |
! |
1216 |
||
753 | 1217 |
openAbout |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1218 |
"opens an about box (on ST/X)" |
753 | 1219 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
1220 |
self class openAboutSTX |
753 | 1221 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
1222 |
"Modified: / 14.8.1998 / 13:17:57 / cg" |
753 | 1223 |
! |
1224 |
||
858 | 1225 |
openHTMLDocument: aHTMLFilename |
907 | 1226 |
"opens a HTML browser on aHTMLFilename" |
858 | 1227 |
|
1228 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
1229 |
! |
|
1230 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1231 |
showHelp:aHelpText for:view |
1631 | 1232 |
"displays aHelpText in the info label. |
1233 |
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
|
1234 |
|
1343 | 1235 |
"/ masterApplication notNil ifTrue:[ |
1236 |
"/ ^ masterApplication showHelp:aHelpText for:view |
|
1237 |
"/ ]. |
|
1238 |
"/ |
|
3508 | 1239 |
|lines| |
1240 |
||
1241 |
aHelpText isNil ifTrue:[ |
|
1242 |
self updateInfoLabel |
|
1243 |
] ifFalse: [ |
|
1244 |
|text| |
|
1245 |
||
1246 |
lines := aHelpText asString asStringCollection. |
|
1247 |
self infoLabelHolder value:lines first |
|
1248 |
]. |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1249 |
! |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1250 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1251 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1252 |
"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
|
1253 |
application; false otherwise" |
782 | 1254 |
|
783 | 1255 |
|currentActiveHelp| |
858 | 1256 |
|
783 | 1257 |
currentActiveHelp := ActiveHelp currentHelpListener. |
1258 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1259 |
^ self class showingHelp |
2919 | 1260 |
and: [currentActiveHelp notNil |
1261 |
and: [ currentActiveHelp interestedIn: self window]] |
|
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1262 |
|
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1263 |
"/ ^ self class showingHelp |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1264 |
"/ and: [currentActiveHelp notNil and: [masterApplication notNil |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1265 |
"/ ifFalse: [currentActiveHelp interestedIn: self window] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1266 |
"/ ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
782 | 1267 |
|
2919 | 1268 |
"Created: / 31-07-1998 / 17:57:03 / cg" |
1269 |
"Modified: / 22-08-1998 / 00:06:38 / cg" |
|
1270 |
"Modified (format): / 06-07-2011 / 17:47:51 / cg" |
|
782 | 1271 |
! |
1272 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1273 |
showingHelp: aValue |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1274 |
"toggles showing help for this application" |
984 | 1275 |
|
2919 | 1276 |
aValue "(self class showingHelp: aValue)" |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1277 |
ifTrue: [ActiveHelp startFor:self] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1278 |
ifFalse: [ActiveHelp stopFor:self. self updateInfoLabel] |
984 | 1279 |
|
2919 | 1280 |
"Created: / 31-07-1998 / 18:20:44 / cg" |
1281 |
"Modified: / 06-07-2011 / 18:02:48 / cg" |
|
822 | 1282 |
! |
1283 |
||
1284 |
updateInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1285 |
"updates the info label at the bottom of this application" |
822 | 1286 |
|
2104 | 1287 |
self infoLabelHolder value: self defaultInfoLabel |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1288 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1289 |
"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
|
1290 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1291 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1292 |
xxopenAboutThisApplication |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1293 |
"opens an about box for this application. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1294 |
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
|
1295 |
the classes documentation." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1296 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1297 |
|rev box myClass clsRev image msg| |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1298 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1299 |
rev := ''. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1300 |
myClass := self class. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1301 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1302 |
(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
|
1303 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1304 |
msg := '\The application\\' withCRs |
3547 | 1305 |
, myClass name allBold, rev |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1306 |
, '\\has been designed and implemented by: \' withCRs |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1307 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1308 |
, '\\' withCRs. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1309 |
msg := msg withTabsExpanded. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1310 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1311 |
AboutBox isNil ifTrue:[ |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1312 |
"/ this handles bad installations of ST/X, |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1313 |
"/ where the AboutBox is missing. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1314 |
"/ (May vanish in the future) |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1315 |
^ self information:msg |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1316 |
]. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1317 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1318 |
box := AboutBox title:msg. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1319 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1320 |
image := self aboutImage. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1321 |
image notNil ifTrue:[ |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1322 |
box image:image |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1323 |
]. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1324 |
box label:(resources string:self aboutThisApplicationLabel). |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1325 |
box autoHideAfter:10 with:[]. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1326 |
box showAtPointer. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1327 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1328 |
"Modified: / 13.11.2001 / 12:31:28 / cg" |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1516
diff
changeset
|
1329 |
"Created: / 13.11.2001 / 12:34:27 / cg" |
762 | 1330 |
! ! |
1331 |
||
753 | 1332 |
!ToolApplicationModel methodsFor:'history'! |
1333 |
||
2098 | 1334 |
add:aHistoryEntry toHistory:aHistory |
1969 | 1335 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of aHistory, |
1336 |
and checks for maximum size of the history" |
|
1337 |
||
2098 | 1338 |
aHistory remove:aHistoryEntry ifAbsent:nil. |
1969 | 1339 |
aHistory addFirst: aHistoryEntry. |
1340 |
[aHistory size > self class historyMaxSize] whileTrue: [aHistory removeLast] |
|
1341 |
! |
|
1342 |
||
2098 | 1343 |
addHistoryEntryForClass:classToAdd selector:selectorToAdd |
1344 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
|
1345 |
and checks for maximum size of the history" |
|
1346 |
||
1347 |
|entry| |
|
1348 |
||
1349 |
self assert:(classToAdd isBehavior). |
|
1350 |
entry := HistoryEntryForMethod class:classToAdd selector:selectorToAdd. |
|
1351 |
self addToHistory:entry |
|
1352 |
! |
|
1353 |
||
1354 |
addHistoryEntryForFile:fileName |
|
1355 |
|entry| |
|
1356 |
||
1357 |
entry := HistoryEntryForFile filename:fileName. |
|
1358 |
self addToHistory:entry |
|
1359 |
! |
|
1360 |
||
1969 | 1361 |
addToFileHistory: aHistoryEntry |
1362 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the file-history, |
|
1363 |
and checks for maximum size of the history" |
|
1364 |
||
2098 | 1365 |
self add:aHistoryEntry toHistory:self fileHistory |
1969 | 1366 |
! |
1367 |
||
753 | 1368 |
addToHistory: aHistoryEntry |
907 | 1369 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
1370 |
and checks for maximum size of the history" |
|
753 | 1371 |
|
2098 | 1372 |
self add:aHistoryEntry toHistory:self history |
1969 | 1373 |
! |
1374 |
||
1375 |
emptyFileHistory |
|
1376 |
"removes all history entries" |
|
1377 |
||
1378 |
^ self fileHistory removeAll |
|
753 | 1379 |
! |
1380 |
||
1381 |
emptyHistory |
|
907 | 1382 |
"removes all history entries" |
753 | 1383 |
|
1384 |
^self history removeAll |
|
1385 |
! |
|
1386 |
||
1969 | 1387 |
fileHistory |
1388 |
"returns the file-history from tool class" |
|
1389 |
||
1390 |
^ self class getFileHistory |
|
1391 |
! |
|
1392 |
||
753 | 1393 |
history |
907 | 1394 |
"returns the history from tool class" |
753 | 1395 |
|
1969 | 1396 |
^ self class getHistory |
753 | 1397 |
! |
1398 |
||
1399 |
menuHistory |
|
1809 | 1400 |
"returns a dynamic history submenu" |
753 | 1401 |
|
1660 | 1402 |
<resource: #programMenu > |
1403 |
||
1809 | 1404 |
|menu anyItem clearItem| |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1405 |
|
753 | 1406 |
menu := Menu new receiver: self. |
1809 | 1407 |
anyItem := false. |
753 | 1408 |
|
2098 | 1409 |
((self history |
3019 | 1410 |
collect: [:histEntry| histEntry class] as:Set) |
1411 |
asSortedCollection:[:a :b | a name < b name]) |
|
2098 | 1412 |
do: |
1413 |
[:historyEntryType| |
|
1414 |
menu addItemGroup: |
|
1415 |
(self history |
|
1416 |
select: [:histEntry| |
|
1417 |
histEntry class = historyEntryType] |
|
1418 |
thenCollect: [:histEntry| |
|
1419 |
anyItem := true. |
|
1420 |
MenuItem new |
|
3354 | 1421 |
label: histEntry printStringInMenu |
3024 | 1422 |
itemValue: #loadFromHistoryEntry: argument: histEntry; |
2098 | 1423 |
activeHelpKey: #historyMenuItem]). |
1424 |
]. |
|
1809 | 1425 |
|
3354 | 1426 |
clearItem := MenuItem label: 'Clear History' itemValue: #emptyHistory enabled:anyItem. |
1427 |
clearItem activeHelpKey: #historyEmptyMenu. |
|
1809 | 1428 |
menu addItem: clearItem. |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1429 |
|
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1430 |
menu findGuiResourcesIn:self. |
753 | 1431 |
^menu |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1432 |
|
3024 | 1433 |
"Modified: / 09-09-2012 / 13:10:38 / cg" |
753 | 1434 |
! |
1435 |
||
1969 | 1436 |
remove:aHistoryEntry fromHistory: aHistory |
1437 |
"removes aHistoryEntry from the history" |
|
1438 |
||
1439 |
aHistory remove: (aHistory detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
1440 |
[aHistory size > self class historyMaxSize] whileTrue: [aHistory removeLast] |
|
1441 |
! |
|
1442 |
||
2098 | 1443 |
removeFromHistory:aHistoryEntry |
907 | 1444 |
"removes aHistoryEntry from the history" |
753 | 1445 |
|
1969 | 1446 |
self remove:aHistoryEntry fromHistory: self history. |
753 | 1447 |
! ! |
1448 |
||
982
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1449 |
!ToolApplicationModel methodsFor:'initialization'! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1450 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1451 |
initialize |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1452 |
super initialize. |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1453 |
self createBuilder |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1454 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1455 |
"Created: / 20.6.1998 / 14:51:29 / cg" |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1456 |
! ! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1457 |
|
1200 | 1458 |
!ToolApplicationModel methodsFor:'misc'! |
1459 |
||
1460 |
clearModifiedFlag |
|
1461 |
"clear the modifiedChannel. |
|
1462 |
That one is hooked to components in the right noteBook, |
|
1463 |
and will be set, when any value is modified. |
|
1464 |
(to enable OK and cancel buttons)" |
|
1465 |
||
1466 |
self modifiedChannel value:false |
|
1467 |
! ! |
|
1468 |
||
782 | 1469 |
!ToolApplicationModel methodsFor:'queries'! |
1470 |
||
876 | 1471 |
allToolInstances |
907 | 1472 |
"returns all instances of this tool class" |
876 | 1473 |
|
1150
5211197a2671
NEVER - redefine allInstances
Claus Gittinger <cg@exept.de>
parents:
1148
diff
changeset
|
1474 |
^ self class allToolInstances |
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1475 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1476 |
"Modified: / 4.2.1999 / 15:34:58 / cg" |
876 | 1477 |
! |
1478 |
||
782 | 1479 |
preferredExtent |
1480 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
1481 |
will be considered" |
|
1482 |
||
1998
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1483 |
|window menu menuToolbarView preferredExtentOfWindow maxExtent| |
782 | 1484 |
|
1485 |
window := self builder window. |
|
1486 |
menu := window subViews first. |
|
1487 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
1488 |
||
1998
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1489 |
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
|
1490 |
menu class == MenuPanel ifTrue:[ |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1491 |
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
|
1492 |
]. |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1493 |
menuToolbarView notNil ifTrue:[ |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1494 |
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
|
1495 |
]. |
782 | 1496 |
|
1998
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1497 |
maxExtent := window maxExtent. |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1498 |
maxExtent notNil ifTrue:[ |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1499 |
preferredExtentOfWindow := preferredExtentOfWindow min:maxExtent. |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1500 |
]. |
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1501 |
|
f1ebf439582d
Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents:
1989
diff
changeset
|
1502 |
^ preferredExtentOfWindow. |
782 | 1503 |
! ! |
1504 |
||
1767 | 1505 |
!ToolApplicationModel methodsFor:'startup & release'! |
753 | 1506 |
|
1107 | 1507 |
closeDownViews |
907 | 1508 |
"uninitializes and closes this tool" |
753 | 1509 |
|
756 | 1510 |
self uninitialize. |
1107 | 1511 |
super closeDownViews |
1108 | 1512 |
! |
936 | 1513 |
|
2098 | 1514 |
loadFromHistoryEntry:aHistoryEntry |
1515 |
aHistoryEntry forceLoadIn:self |
|
1516 |
! |
|
1517 |
||
790 | 1518 |
postOpenWith:aBuilder |
907 | 1519 |
"starts the active help for this tool (if turned on in the settings) |
3668 | 1520 |
and updates the info label and the font's (from the settings)" |
790 | 1521 |
|
1522 |
super postOpenWith:aBuilder. |
|
1523 |
||
822 | 1524 |
self updateInfoLabel. |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1525 |
"/ self updateFonts. |
2827 | 1526 |
self showingHelp:true. |
876 | 1527 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1528 |
"Modified: / 31.7.1998 / 18:17:34 / cg" |
790 | 1529 |
! |
1530 |
||
1323
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1531 |
restarted |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1532 |
"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
|
1533 |
restart timed block if defined. |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1534 |
" |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1535 |
timeBlock notNil ifTrue:[ |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1536 |
Processor removeTimedBlock:timeBlock. |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1537 |
self startClockOnTimedBlock:timeBlock. |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1538 |
]. |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1539 |
super restarted. |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1540 |
! |
045c3a6e4a88
after restart from image, restart also the timed block if defined
ca
parents:
1284
diff
changeset
|
1541 |
|
756 | 1542 |
uninitialize |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1543 |
"stops active help for this tool and (if defined) removes the time block" |
756 | 1544 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1545 |
self showingHelp ifTrue: [ActiveHelp stopFor: self]. |
876 | 1546 |
timeBlock notNil ifTrue: [Processor removeTimedBlock:timeBlock. timeBlock := nil]. |
1547 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1548 |
"Modified: / 31.7.1998 / 18:46:21 / cg" |
753 | 1549 |
! ! |
1550 |
||
3312 | 1551 |
!ToolApplicationModel::HistoryEntry class methodsFor:'documentation'! |
1552 |
||
1553 |
documentation |
|
1554 |
" |
|
1555 |
common support code for navigation history entries, |
|
1556 |
for fileBrowser (visited file history) and systemBrowser (visited method history). |
|
1557 |
" |
|
1558 |
! ! |
|
1559 |
||
2098 | 1560 |
!ToolApplicationModel::HistoryEntry methodsFor:'comparing'! |
1561 |
||
1562 |
sameAsHistoryEntryForFile:aHistoryEntryForFile |
|
1563 |
^ false |
|
1564 |
! |
|
1565 |
||
1566 |
sameAsHistoryEntryForMethod:aHistoryEntryForMethod |
|
1567 |
^ false |
|
1568 |
! ! |
|
1569 |
||
1570 |
!ToolApplicationModel::HistoryEntryForFile class methodsFor:'instance creation'! |
|
1571 |
||
1572 |
filename:arg |
|
1573 |
^ self new filename:arg |
|
1574 |
! ! |
|
1575 |
||
1576 |
!ToolApplicationModel::HistoryEntryForFile methodsFor:'accessing'! |
|
1577 |
||
1578 |
filename |
|
1579 |
^ filename |
|
1580 |
! |
|
1581 |
||
1582 |
filename:something |
|
1583 |
filename := something. |
|
1584 |
! ! |
|
1585 |
||
1586 |
!ToolApplicationModel::HistoryEntryForFile methodsFor:'comparing'! |
|
1587 |
||
1588 |
= aHistoryEntry |
|
1589 |
^ aHistoryEntry sameAsHistoryEntryForFile:self |
|
1590 |
! |
|
1591 |
||
1592 |
sameAsHistoryEntryForFile:aHistoryEntryForFile |
|
1593 |
^ aHistoryEntryForFile filename = filename |
|
1594 |
! ! |
|
1595 |
||
1596 |
!ToolApplicationModel::HistoryEntryForFile methodsFor:'loading'! |
|
1597 |
||
1598 |
forceLoadIn:anEditor |
|
1599 |
anEditor loadFromFile:filename |
|
1600 |
! ! |
|
1601 |
||
1602 |
!ToolApplicationModel::HistoryEntryForFile methodsFor:'printing'! |
|
1603 |
||
1604 |
printStringInMenu |
|
1605 |
^ filename |
|
1606 |
! ! |
|
1607 |
||
1608 |
!ToolApplicationModel::HistoryEntryForMethod class methodsFor:'instance creation'! |
|
1609 |
||
1610 |
class:classToAdd selector:selectorToAdd |
|
1611 |
^ self new class:classToAdd selector:selectorToAdd |
|
1612 |
! ! |
|
1613 |
||
1614 |
!ToolApplicationModel::HistoryEntryForMethod methodsFor:'accessing'! |
|
1615 |
||
1616 |
class:aClass selector:aSelector |
|
1617 |
methodClass := aClass. |
|
1618 |
methodSelector := aSelector |
|
1619 |
! |
|
1620 |
||
1621 |
methodClass |
|
1622 |
^ methodClass |
|
1623 |
! |
|
1624 |
||
1625 |
methodSelector |
|
1626 |
^ methodSelector |
|
1627 |
! ! |
|
1628 |
||
1629 |
!ToolApplicationModel::HistoryEntryForMethod methodsFor:'comparing'! |
|
1630 |
||
1631 |
= aHistoryEntry |
|
1632 |
^ aHistoryEntry sameAsHistoryEntryForMethod:self |
|
1633 |
! |
|
1634 |
||
1635 |
sameAsHistoryEntryForMethod:aHistoryEntryForMethod |
|
1636 |
^ aHistoryEntryForMethod methodClass = methodClass |
|
1637 |
and:[ aHistoryEntryForMethod methodSelector = methodSelector ] |
|
1638 |
! ! |
|
1639 |
||
1640 |
!ToolApplicationModel::HistoryEntryForMethod methodsFor:'loading'! |
|
1641 |
||
1642 |
forceLoadIn:anEditor |
|
1643 |
anEditor loadFromClass:methodClass andSelector:methodSelector |
|
1644 |
! ! |
|
1645 |
||
1646 |
!ToolApplicationModel::HistoryEntryForMethod methodsFor:'printing'! |
|
1647 |
||
1648 |
printStringInMenu |
|
3674 | 1649 |
^ methodClass name , ' » ' , (methodSelector?'?') |
2140 | 1650 |
|
1651 |
"Modified: / 11-07-2006 / 13:53:40 / fm" |
|
2098 | 1652 |
! ! |
1653 |
||
753 | 1654 |
!ToolApplicationModel class methodsFor:'documentation'! |
1655 |
||
2771 | 1656 |
version_CVS |
3508 | 1657 |
^ '$Header$' |
753 | 1658 |
! ! |
3107 | 1659 |