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