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