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