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