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