author | Claus Gittinger <cg@exept.de> |
Tue, 13 Jul 1999 17:35:31 +0200 | |
changeset 1200 | a86be4f3fd69 |
parent 1195 | 3e136baa74f9 |
child 1259 | 394ab30e07e0 |
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 |
" |
|
12 |
||
13 |
||
14 |
||
753 | 15 |
ApplicationModel subclass:#ToolApplicationModel |
782 | 16 |
instanceVariableNames:'timeBlock' |
753 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
834 | 19 |
category:'Interface-Framework' |
753 | 20 |
! |
21 |
||
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
22 |
ToolApplicationModel class instanceVariableNames:'history clipboard settings showingHelp instances' |
753 | 23 |
|
24 |
" |
|
25 |
The following class instance variables are inherited by this class: |
|
26 |
||
27 |
ApplicationModel - ClassResources |
|
28 |
Model - |
|
29 |
Object - |
|
30 |
" |
|
31 |
! |
|
32 |
||
33 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
34 |
||
756 | 35 |
copyright |
36 |
" |
|
784 | 37 |
COPYRIGHT (c) 1997 by eXept Software AG |
756 | 38 |
All Rights Reserved |
39 |
||
40 |
This software is furnished under a license and may be used |
|
41 |
only in accordance with the terms of that license and with the |
|
42 |
inclusion of the above copyright notice. This software may not |
|
43 |
be provided or otherwise made available to, or used by, any |
|
44 |
other person. No title to or ownership of the software is |
|
45 |
hereby transferred. |
|
46 |
" |
|
47 |
||
48 |
||
49 |
! |
|
50 |
||
753 | 51 |
documentation |
52 |
" |
|
1200 | 53 |
Framework class for tool applications (UIPainter, MenuEditor etc.). |
54 |
Provides hooks for modifiedChannels, history management, |
|
782 | 55 |
showing help texts, about menu, help menu etc. |
753 | 56 |
|
57 |
[author:] |
|
876 | 58 |
Thomas Zwick, eXept Software AG |
753 | 59 |
" |
60 |
! ! |
|
61 |
||
62 |
!ToolApplicationModel class methodsFor:'accessing'! |
|
63 |
||
1150
5211197a2671
NEVER - redefine allInstances
Claus Gittinger <cg@exept.de>
parents:
1148
diff
changeset
|
64 |
allToolInstances |
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
65 |
^ instances ? #() |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
66 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
67 |
"Created: / 4.2.1999 / 15:34:55 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
68 |
! |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
69 |
|
800 | 70 |
authorLinesForAboutBox |
907 | 71 |
"extracts the author(s) from the documentation method." |
800 | 72 |
|
73 |
|firstClassWithDocumentation src s line lines| |
|
753 | 74 |
|
800 | 75 |
firstClassWithDocumentation := self class withAllSuperclasses detect:[:metacls| metacls implements:#documentation]. |
76 |
firstClassWithDocumentation notNil ifTrue:[ |
|
77 |
(firstClassWithDocumentation inheritsFrom:ToolApplicationModel class) ifTrue:[ |
|
78 |
src := (firstClassWithDocumentation compiledMethodAt:#documentation) source. |
|
79 |
src notNil ifTrue:[ |
|
80 |
s := src readStream. |
|
81 |
s upToAll:'[author:]'. |
|
82 |
s nextLine. "/ skip to end |
|
83 |
line := s nextLine. "/ line after [author:] |
|
84 |
lines := OrderedCollection new. |
|
85 |
[line notNil and:[line notEmpty]] whileTrue:[ |
|
86 |
line := line trimBlanks. |
|
87 |
line size > 1 ifTrue:[ |
|
88 |
lines add:line trimBlanks. |
|
89 |
line := s nextLine. |
|
90 |
] ifFalse:[ |
|
91 |
line := nil |
|
92 |
] |
|
93 |
]. |
|
94 |
^ lines. |
|
95 |
] |
|
96 |
] |
|
97 |
]. |
|
98 |
^ #('unnown') |
|
99 |
||
100 |
"Created: / 1.2.1998 / 15:41:43 / cg" |
|
101 |
"Modified: / 1.2.1998 / 15:59:10 / cg" |
|
753 | 102 |
! |
103 |
||
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
104 |
forgetInstance:anInstance |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
105 |
instances remove:anInstance. |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
106 |
instances isEmpty ifTrue:[instances := nil]. |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
107 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
108 |
"Modified: / 4.2.1999 / 15:38:49 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
109 |
! |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
110 |
|
753 | 111 |
label |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
112 |
"returns the label for the tool instances of this class; |
907 | 113 |
extracted from the class name; |
114 |
can be redefined in subclasses" |
|
753 | 115 |
|
116 |
|label| |
|
117 |
label := ''. |
|
118 |
self name do: |
|
119 |
[:c| |
|
120 |
c isUppercase ifTrue: [label := label, $ ]. |
|
121 |
label := label, c |
|
122 |
]. |
|
123 |
^label trimBlanks |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
124 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
125 |
"Modified: / 31.7.1998 / 18:04:18 / cg" |
782 | 126 |
! |
127 |
||
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
128 |
rememberInstance:anInstance |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
129 |
instances isNil ifTrue:[ |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
130 |
instances := WeakIdentitySet new |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
131 |
]. |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
132 |
instances add:anInstance |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
133 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
134 |
"Created: / 4.2.1999 / 15:33:43 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
135 |
"Modified: / 4.2.1999 / 15:34:14 / cg" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
136 |
! |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
137 |
|
850 | 138 |
settings |
907 | 139 |
"returns the settings dictionary" |
850 | 140 |
|
872 | 141 |
settings isNil ifTrue: [settings := IdentityDictionary new]. |
142 |
^settings |
|
850 | 143 |
! |
144 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
145 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
146 |
"returns true if active help is turned on for instances of this class" |
782 | 147 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
148 |
showingHelp isNil ifTrue: [showingHelp := true]. |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
149 |
^showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
150 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
151 |
"Created: / 31.7.1998 / 18:03:38 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
152 |
"Modified: / 31.7.1998 / 18:16:55 / cg" |
782 | 153 |
! |
154 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
155 |
showingHelp: aBoolean |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
156 |
"enable/disable active help for instances of this class" |
782 | 157 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
158 |
^ showingHelp := aBoolean |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
159 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
160 |
"Modified: / 31.7.1998 / 18:17:14 / cg" |
753 | 161 |
! ! |
162 |
||
756 | 163 |
!ToolApplicationModel class methodsFor:'clipboard'! |
164 |
||
165 |
clipboard |
|
907 | 166 |
"returns the clipboard of this tool class" |
756 | 167 |
|
168 |
^clipboard |
|
169 |
! |
|
170 |
||
171 |
clipboard: anEditObject |
|
907 | 172 |
"sets the clipboard for this tool class" |
756 | 173 |
|
174 |
clipboard := anEditObject |
|
175 |
! ! |
|
176 |
||
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
177 |
!ToolApplicationModel class methodsFor:'help'! |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
178 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
179 |
openAboutSTX |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
180 |
"opens an about box (on ST/X)" |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
181 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
182 |
|box| |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
183 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
184 |
AboutBox isNil ifTrue:[ |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
185 |
"/ this handles bad installations of ST/X, |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
186 |
"/ where the AboutBox is missing. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
187 |
"/ (May vanish in the future) |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
188 |
^ self information:('Smalltalk/X rev.' , Smalltalk versionString) |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
189 |
]. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
190 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
191 |
box := AboutBox new. |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
192 |
box autoHideAfter:10 with:[]. |
1091 | 193 |
box showAtCenter |
194 |
"/ box showAtPointer |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
195 |
|
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
196 |
"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
|
197 |
"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
|
198 |
! ! |
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
199 |
|
762 | 200 |
!ToolApplicationModel class methodsFor:'help specs'! |
201 |
||
202 |
helpSpec |
|
869 | 203 |
"This resource specification was automatically generated |
204 |
by the UIHelpTool of ST/X." |
|
205 |
||
206 |
"Do not manually edit this!! If it is corrupted, |
|
207 |
the UIHelpTool may not be able to read the specification." |
|
762 | 208 |
|
209 |
" |
|
869 | 210 |
UIHelpTool openOnClass:ToolApplicationModel |
762 | 211 |
" |
212 |
||
869 | 213 |
<resource: #help> |
214 |
||
215 |
^super helpSpec addPairsFrom:#( |
|
762 | 216 |
|
823 | 217 |
#about |
834 | 218 |
'About functions.' |
823 | 219 |
|
762 | 220 |
#aboutSTX |
910 | 221 |
'Open an InfoBox showing details of the running ST/X.' |
762 | 222 |
|
223 |
#aboutThisAppliaction |
|
910 | 224 |
'Open an InfoBox about that applications release and its author.' |
762 | 225 |
|
823 | 226 |
#add |
834 | 227 |
'Add functions.' |
823 | 228 |
|
229 |
#commitCancel |
|
910 | 230 |
'Cancels changes.' |
823 | 231 |
|
232 |
#commitOK |
|
910 | 233 |
'Commit changes.' |
823 | 234 |
|
235 |
#edit |
|
834 | 236 |
'Edit functions.' |
823 | 237 |
|
238 |
#editCopy |
|
910 | 239 |
'Copy the selected item(s) to the clipboard.' |
762 | 240 |
|
782 | 241 |
#editCut |
910 | 242 |
'Move the selected item(s) to the clipboard.' |
853 | 243 |
|
244 |
#editDelete |
|
910 | 245 |
'Delete the selected item(s).' |
782 | 246 |
|
823 | 247 |
#editMoveDown |
910 | 248 |
'Moves the selected item one step down in the order list.' |
823 | 249 |
|
250 |
#editMoveIn |
|
834 | 251 |
'Moves the selected item into next item as child item.' |
823 | 252 |
|
253 |
#editMoveOut |
|
910 | 254 |
'Moves the selected item out of its parent item.' |
823 | 255 |
|
256 |
#editMoveUp |
|
910 | 257 |
'Moves the selected item one step up in the order list.' |
782 | 258 |
|
259 |
#editPaste |
|
910 | 260 |
'Paste from the clipboard.' |
782 | 261 |
|
262 |
#editUndo |
|
910 | 263 |
'Undo the last action.' |
782 | 264 |
|
823 | 265 |
#file |
834 | 266 |
'File functions.' |
805 | 267 |
|
823 | 268 |
#fileBrowseClass |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
269 |
'Open a System Browser on the current class.' |
805 | 270 |
|
823 | 271 |
#fileDefineClass |
910 | 272 |
'Open a dialog to define the current class.' |
805 | 273 |
|
274 |
#fileDefineClassAndSelector |
|
910 | 275 |
'Open a dialog to define the current class and selector.' |
805 | 276 |
|
823 | 277 |
#fileExit |
910 | 278 |
'Exit this application.' |
823 | 279 |
|
922 | 280 |
#generate |
281 |
'Code generation.' |
|
282 |
||
823 | 283 |
#help |
834 | 284 |
'Help functions.' |
823 | 285 |
|
876 | 286 |
#helpHelpTool |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
287 |
'Show the Help Tools documentation.' |
876 | 288 |
|
823 | 289 |
#helpShowHelp |
910 | 290 |
'Toggle display of help texts.' |
823 | 291 |
|
292 |
#helpTutorial |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
293 |
'Show this applications documentation.' |
823 | 294 |
|
295 |
#history |
|
834 | 296 |
'History functions.' |
803 | 297 |
|
298 |
#historyEmptyMenu |
|
1016 | 299 |
'Clear the history.' |
803 | 300 |
|
823 | 301 |
#historyMenuItem |
1016 | 302 |
'Switch to that item.' |
762 | 303 |
|
893 | 304 |
#settings |
305 |
'Settings functions.' |
|
306 |
||
823 | 307 |
#test |
834 | 308 |
'Test functions.' |
762 | 309 |
|
310 |
) |
|
1015 | 311 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
312 |
"Modified: / 31.7.1998 / 19:28:14 / cg" |
762 | 313 |
! ! |
314 |
||
753 | 315 |
!ToolApplicationModel class methodsFor:'history'! |
316 |
||
317 |
getHistory |
|
907 | 318 |
"returns the history for this tool class" |
753 | 319 |
|
761
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
320 |
history isNil ifTrue: [history := OrderedCollection new]. |
cc0404f8aec6
#getHistory changed because here #? doesn't work correctly
tz
parents:
760
diff
changeset
|
321 |
^history |
753 | 322 |
|
323 |
! |
|
324 |
||
325 |
historyMaxSize |
|
907 | 326 |
"returns the maximum size for the history of this tool class" |
753 | 327 |
|
328 |
^10 |
|
329 |
||
330 |
! ! |
|
331 |
||
869 | 332 |
!ToolApplicationModel class methodsFor:'image specs'! |
333 |
||
334 |
desktopIcon |
|
907 | 335 |
"returns the icon used for the desktop" |
869 | 336 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
337 |
<resource: #programImage> |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
338 |
|
869 | 339 |
^Icon |
340 |
constantNamed:#'ToolApplicationModel desktopIcon' |
|
341 |
ifAbsentPut: |
|
342 |
[ |
|
343 |
|desktopIcon| |
|
990 | 344 |
desktopIcon := Icon stxIcon. |
869 | 345 |
desktopIcon magnifiedBy: Display preferredIconSize/desktopIcon extent |
346 |
] |
|
347 |
||
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
348 |
"Modified: / 24.8.1998 / 21:34:38 / cg" |
869 | 349 |
! |
350 |
||
351 |
menuIcon |
|
907 | 352 |
"returns the icon used for the menu bar" |
869 | 353 |
|
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
354 |
<resource: #programImage> |
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
355 |
|
869 | 356 |
^Icon |
357 |
constantNamed:#'ToolApplicationModel menuIcon' |
|
358 |
ifAbsentPut: |
|
359 |
[ |
|
1165
70fd3edc13b4
care for device-less menuFont
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
360 |
|menuIcon myDevice| |
990 | 361 |
menuIcon := Icon stxIcon. |
1165
70fd3edc13b4
care for device-less menuFont
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
362 |
myDevice := Screen current. |
70fd3edc13b4
care for device-less menuFont
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
363 |
menuIcon magnifiedBy: (MenuPanel defaultFont heightOn:myDevice)/menuIcon height |
869 | 364 |
] |
1054
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
365 |
|
ab639131be1f
find all icons in getAllImageSelectorsFrom:(walk class hierarchy);
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
366 |
"Modified: / 24.8.1998 / 21:34:33 / cg" |
987 | 367 |
! ! |
869 | 368 |
|
753 | 369 |
!ToolApplicationModel class methodsFor:'interface specs'! |
370 |
||
797 | 371 |
windowSpecForCommit |
869 | 372 |
"This resource specification was automatically generated |
373 |
by the UIPainter of ST/X." |
|
374 |
||
375 |
"Do not manually edit this!! If it is corrupted, |
|
376 |
the UIPainter may not be able to read the specification." |
|
377 |
||
378 |
" |
|
379 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit |
|
380 |
ToolApplicationModel new openInterface:#windowSpecForCommit |
|
381 |
" |
|
797 | 382 |
|
383 |
<resource: #canvas> |
|
384 |
||
385 |
^ |
|
859 | 386 |
|
797 | 387 |
#(#FullSpec |
859 | 388 |
#window: |
797 | 389 |
#(#WindowSpec |
859 | 390 |
#name: 'Commit Buttons' |
869 | 391 |
#layout: #(#LayoutFrame 344 0 371 0 643 0 430 0) |
859 | 392 |
#label: 'Commit Buttons' |
393 |
#min: #(#Point 100 22) |
|
394 |
#max: #(#Point 1152 900) |
|
869 | 395 |
#bounds: #(#Rectangle 344 371 644 431) |
859 | 396 |
#usePreferredExtent: false |
797 | 397 |
) |
859 | 398 |
#component: |
797 | 399 |
#(#SpecCollection |
859 | 400 |
#collection: |
797 | 401 |
#( |
402 |
#(#ActionButtonSpec |
|
859 | 403 |
#name: 'cancelButton' |
404 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
405 |
#activeHelpKey: #commitCancel |
|
406 |
#label: 'Cancel' |
|
927 | 407 |
#translateLabel: true |
859 | 408 |
#tabable: true |
409 |
#model: #cancel |
|
410 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 411 |
) |
412 |
#(#ActionButtonSpec |
|
859 | 413 |
#name: 'okButton' |
414 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
415 |
#activeHelpKey: #commitOK |
|
416 |
#label: 'OK' |
|
927 | 417 |
#translateLabel: true |
859 | 418 |
#tabable: true |
419 |
#model: #accept |
|
420 |
#enableChannel: #valueOfEnablingCommitButtons |
|
797 | 421 |
) |
422 |
) |
|
423 |
) |
|
424 |
) |
|
927 | 425 |
|
426 |
"Modified: / 20.5.1998 / 03:31:54 / cg" |
|
797 | 427 |
! |
428 |
||
429 |
windowSpecForCommitWithoutChannels |
|
869 | 430 |
"This resource specification was automatically generated |
431 |
by the UIPainter of ST/X." |
|
432 |
||
433 |
"Do not manually edit this!! If it is corrupted, |
|
434 |
the UIPainter may not be able to read the specification." |
|
435 |
||
436 |
" |
|
437 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels |
|
438 |
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels |
|
439 |
" |
|
797 | 440 |
|
441 |
<resource: #canvas> |
|
442 |
||
443 |
^ |
|
859 | 444 |
|
797 | 445 |
#(#FullSpec |
859 | 446 |
#window: |
797 | 447 |
#(#WindowSpec |
859 | 448 |
#name: 'Commit Buttons Without Channels' |
869 | 449 |
#layout: #(#LayoutFrame 500 0 326 0 799 0 385 0) |
859 | 450 |
#label: 'Commit Buttons Without Channels' |
451 |
#min: #(#Point 100 22) |
|
452 |
#max: #(#Point 1152 900) |
|
869 | 453 |
#bounds: #(#Rectangle 500 326 800 386) |
859 | 454 |
#usePreferredExtent: false |
797 | 455 |
) |
859 | 456 |
#component: |
797 | 457 |
#(#SpecCollection |
859 | 458 |
#collection: |
797 | 459 |
#( |
460 |
#(#ActionButtonSpec |
|
859 | 461 |
#name: 'cancelButton' |
462 |
#layout: #(#LayoutFrame 5 0 0 0 -2 0.5 0 1) |
|
463 |
#activeHelpKey: #commitCancel |
|
464 |
#label: 'Cancel' |
|
927 | 465 |
#translateLabel: true |
859 | 466 |
#tabable: true |
467 |
#model: #cancel |
|
797 | 468 |
) |
469 |
#(#ActionButtonSpec |
|
859 | 470 |
#name: 'okButton' |
471 |
#layout: #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0) |
|
472 |
#activeHelpKey: #commitOK |
|
473 |
#label: 'OK' |
|
927 | 474 |
#translateLabel: true |
859 | 475 |
#tabable: true |
476 |
#model: #accept |
|
797 | 477 |
) |
478 |
) |
|
479 |
) |
|
480 |
) |
|
927 | 481 |
|
482 |
"Modified: / 20.5.1998 / 03:30:09 / cg" |
|
797 | 483 |
! |
484 |
||
485 |
windowSpecForInfoBar |
|
869 | 486 |
"This resource specification was automatically generated |
487 |
by the UIPainter of ST/X." |
|
488 |
||
489 |
"Do not manually edit this!! If it is corrupted, |
|
490 |
the UIPainter may not be able to read the specification." |
|
491 |
||
492 |
" |
|
493 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar |
|
494 |
ToolApplicationModel new openInterface:#windowSpecForInfoBar |
|
495 |
" |
|
797 | 496 |
|
497 |
<resource: #canvas> |
|
498 |
||
499 |
^ |
|
859 | 500 |
|
797 | 501 |
#(#FullSpec |
859 | 502 |
#window: |
797 | 503 |
#(#WindowSpec |
859 | 504 |
#name: 'Info Bar' |
869 | 505 |
#layout: #(#LayoutFrame 233 0 218 0 732 0 563 0) |
859 | 506 |
#label: 'Info Bar' |
507 |
#min: #(#Point 400 320) |
|
508 |
#max: #(#Point 1152 900) |
|
869 | 509 |
#bounds: #(#Rectangle 233 218 733 564) |
859 | 510 |
#menu: #menu |
511 |
#usePreferredExtent: false |
|
797 | 512 |
) |
859 | 513 |
#component: |
797 | 514 |
#(#SpecCollection |
859 | 515 |
#collection: |
797 | 516 |
#( |
820 | 517 |
#(#ViewSpec |
859 | 518 |
#name: 'view' |
519 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
520 |
#component: |
|
820 | 521 |
#(#SpecCollection |
859 | 522 |
#collection: |
820 | 523 |
#( |
524 |
#(#LabelSpec |
|
859 | 525 |
#name: 'infoLabel' |
526 |
#layout: #(#LayoutFrame 2 0.0 1 0.0 -1 1.0 -1 1.0) |
|
527 |
#labelChannel: #valueOfInfoLabel |
|
528 |
#level: -1 |
|
529 |
#adjust: #left |
|
869 | 530 |
#resizeForLabel: false |
820 | 531 |
) |
532 |
) |
|
533 |
) |
|
797 | 534 |
) |
535 |
) |
|
536 |
) |
|
537 |
) |
|
538 |
! |
|
539 |
||
540 |
windowSpecForInfoBarWithClock |
|
869 | 541 |
"This resource specification was automatically generated |
542 |
by the UIPainter of ST/X." |
|
543 |
||
544 |
"Do not manually edit this!! If it is corrupted, |
|
545 |
the UIPainter may not be able to read the specification." |
|
546 |
||
547 |
" |
|
548 |
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBarWithClock |
|
549 |
ToolApplicationModel new openInterface:#windowSpecForInfoBarWithClock |
|
550 |
" |
|
797 | 551 |
|
552 |
<resource: #canvas> |
|
553 |
||
554 |
^ |
|
859 | 555 |
|
797 | 556 |
#(#FullSpec |
859 | 557 |
#window: |
797 | 558 |
#(#WindowSpec |
859 | 559 |
#name: 'Info Bar' |
872 | 560 |
#layout: #(#LayoutFrame 160 0 423 0 659 0 453 0) |
859 | 561 |
#label: 'Info Bar' |
562 |
#min: #(#Point 400 320) |
|
563 |
#max: #(#Point 1152 900) |
|
872 | 564 |
#bounds: #(#Rectangle 160 423 660 454) |
859 | 565 |
#menu: #menu |
566 |
#usePreferredExtent: false |
|
797 | 567 |
) |
859 | 568 |
#component: |
797 | 569 |
#(#SpecCollection |
859 | 570 |
#collection: |
797 | 571 |
#( |
820 | 572 |
#(#ViewSpec |
859 | 573 |
#name: 'view' |
574 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
575 |
#component: |
|
820 | 576 |
#(#SpecCollection |
859 | 577 |
#collection: |
820 | 578 |
#( |
579 |
#(#LabelSpec |
|
859 | 580 |
#name: 'infoLabel' |
581 |
#layout: #(#LayoutFrame 2 0 1 0.0 -81 1 -1 1.0) |
|
582 |
#labelChannel: #valueOfInfoLabel |
|
583 |
#level: -1 |
|
584 |
#adjust: #left |
|
872 | 585 |
#resizeForLabel: false |
820 | 586 |
) |
587 |
#(#LabelSpec |
|
859 | 588 |
#name: 'timeLabel' |
589 |
#layout: #(#LayoutFrame -79 1 1 0.0 -1 1.0 -1 1.0) |
|
590 |
#labelChannel: #valueOfTimeLabel |
|
591 |
#level: -1 |
|
592 |
#adjust: #right |
|
872 | 593 |
#resizeForLabel: false |
820 | 594 |
) |
595 |
) |
|
596 |
) |
|
797 | 597 |
) |
598 |
) |
|
599 |
) |
|
600 |
) |
|
601 |
! ! |
|
602 |
||
603 |
!ToolApplicationModel class methodsFor:'menu specs'! |
|
604 |
||
753 | 605 |
menuAbout |
869 | 606 |
"This resource specification was automatically generated |
607 |
by the MenuEditor of ST/X." |
|
608 |
||
609 |
"Do not manually edit this!! If it is corrupted, |
|
610 |
the MenuEditor may not be able to read the specification." |
|
611 |
||
612 |
" |
|
613 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuAbout |
|
614 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp |
|
615 |
" |
|
753 | 616 |
|
617 |
<resource: #menu> |
|
618 |
||
619 |
^ |
|
859 | 620 |
|
753 | 621 |
#(#Menu |
622 |
||
623 |
#( |
|
624 |
#(#MenuItem |
|
859 | 625 |
#label: 'About Smalltalk/X...' |
626 |
#translateLabel: true |
|
627 |
#value: #openAbout |
|
628 |
#activeHelpKey: #aboutSTX |
|
753 | 629 |
) |
630 |
#(#MenuItem |
|
859 | 631 |
#label: '-' |
753 | 632 |
) |
633 |
#(#MenuItem |
|
922 | 634 |
#label: 'About this Application...' |
859 | 635 |
#translateLabel: true |
636 |
#value: #openAboutThisApplication |
|
637 |
#activeHelpKey: #aboutThisAppliaction |
|
753 | 638 |
) |
639 |
) nil |
|
640 |
nil |
|
641 |
) |
|
922 | 642 |
|
643 |
"Modified: / 19.5.1998 / 21:44:09 / cg" |
|
753 | 644 |
! |
645 |
||
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
646 |
menuHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
647 |
"This resource specification was automatically generated |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
648 |
by the MenuEditor of ST/X." |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
649 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
650 |
"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
|
651 |
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
|
652 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
653 |
" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
654 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
655 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
656 |
" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
657 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
658 |
<resource: #menu> |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
659 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
660 |
^ |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
661 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
662 |
#(#Menu |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
663 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
664 |
#( |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
665 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
666 |
#label: 'Documentation' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
667 |
#translateLabel: true |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
668 |
#value: #openDocumentation |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
669 |
#activeHelpKey: #helpTutorial |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
670 |
#enabled: #valueOfHavingDocumentation |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
671 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
672 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
673 |
#label: '-' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
674 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
675 |
#(#MenuItem |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
676 |
#label: 'Show Help Texts' |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
677 |
#translateLabel: true |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
678 |
#activeHelpKey: #helpShowHelp |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
679 |
#indication: #showingHelp: |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
680 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
681 |
) nil |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
682 |
nil |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
683 |
) |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
684 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
685 |
"Modified: / 31.7.1998 / 18:19:42 / cg" |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
686 |
! |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
687 |
|
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
688 |
xxxmenuFont |
869 | 689 |
"This resource specification was automatically generated |
690 |
by the MenuEditor of ST/X." |
|
691 |
||
692 |
"Do not manually edit this!! If it is corrupted, |
|
693 |
the MenuEditor may not be able to read the specification." |
|
694 |
||
695 |
" |
|
696 |
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuFont |
|
697 |
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuFont)) startUp |
|
698 |
" |
|
699 |
||
700 |
<resource: #menu> |
|
701 |
||
702 |
^ |
|
703 |
||
704 |
#(#Menu |
|
705 |
||
706 |
#( |
|
707 |
#(#MenuItem |
|
872 | 708 |
#label: 'Label...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
709 |
#translateLabel: true |
869 | 710 |
#value: #chooseFont: |
711 |
#argument: 'Label Font' |
|
712 |
) |
|
713 |
#(#MenuItem |
|
872 | 714 |
#label: 'Button...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
715 |
#translateLabel: true |
869 | 716 |
#value: #chooseFont: |
717 |
#argument: 'Button Font' |
|
718 |
) |
|
719 |
#(#MenuItem |
|
872 | 720 |
#label: 'Edit...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
721 |
#translateLabel: true |
869 | 722 |
#value: #chooseFont: |
723 |
#argument: 'Edit Font' |
|
724 |
) |
|
725 |
#(#MenuItem |
|
872 | 726 |
#label: 'List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
727 |
#translateLabel: true |
869 | 728 |
#value: #chooseFont: |
729 |
#argument: 'List Font' |
|
730 |
) |
|
731 |
#(#MenuItem |
|
872 | 732 |
#label: 'Tree List...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
733 |
#translateLabel: true |
869 | 734 |
#value: #chooseFont: |
735 |
#argument: 'Tree List Font' |
|
736 |
) |
|
737 |
#(#MenuItem |
|
872 | 738 |
#label: 'Note Book...' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
739 |
#translateLabel: true |
872 | 740 |
#value: #chooseFont: |
741 |
#argument: 'Note Book Font' |
|
742 |
) |
|
743 |
#(#MenuItem |
|
744 |
#label: 'Framed Box...' |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
745 |
#translateLabel: true |
872 | 746 |
#value: #chooseFont: |
747 |
#argument: 'Framed Box Font' |
|
748 |
) |
|
749 |
#(#MenuItem |
|
869 | 750 |
#label: '-' |
751 |
) |
|
752 |
#(#MenuItem |
|
872 | 753 |
#label: 'Reset' |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
754 |
#translateLabel: true |
869 | 755 |
#value: #resetFonts |
756 |
) |
|
757 |
) nil |
|
758 |
nil |
|
759 |
) |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
760 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
761 |
"Modified: / 31.7.1998 / 18:55:34 / cg" |
753 | 762 |
! ! |
763 |
||
907 | 764 |
!ToolApplicationModel class methodsFor:'queries'! |
765 |
||
766 |
isVisualStartable |
|
767 |
"returns whether this application class can be started via #open" |
|
768 |
||
769 |
self == ToolApplicationModel ifTrue:[^false]. |
|
770 |
^super isVisualStartable |
|
771 |
||
772 |
! ! |
|
773 |
||
782 | 774 |
!ToolApplicationModel class methodsFor:'startup / release'! |
753 | 775 |
|
782 | 776 |
preSnapshot |
907 | 777 |
"removes the clipboard before snap shoting" |
753 | 778 |
|
782 | 779 |
clipboard := nil |
753 | 780 |
! |
781 |
||
782 | 782 |
uninitialize |
907 | 783 |
"resets the class instance variables" |
760 | 784 |
|
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
785 |
settings := instances := showingHelp := history := clipboard := nil |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
786 |
|
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
787 |
" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
788 |
self withAllSubclasses do:[:c | c uninitialize] |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
789 |
" |
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
790 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
791 |
"Modified: / 4.2.1999 / 15:37:43 / cg" |
753 | 792 |
! ! |
793 |
||
782 | 794 |
!ToolApplicationModel methodsFor:'aspects'! |
795 |
||
1147 | 796 |
acceptChannel |
797 |
"returns a valueHolder which can be set to true to force all inputFields |
|
798 |
to accept their value." |
|
799 |
||
800 |
|holder| |
|
801 |
||
802 |
(holder := builder bindingAt:#acceptChannel) isNil ifTrue:[ |
|
1157 | 803 |
builder aspectAt:#acceptChannel put:(holder := ValueHolder with:false). |
1147 | 804 |
]. |
805 |
^ holder |
|
806 |
||
807 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
|
808 |
! |
|
809 |
||
810 |
modifiedChannel |
|
811 |
"returns a valueHolder which is set to true, whenever any of |
|
812 |
my editfields is modified - this is hooked to |
|
813 |
the valueOfEnablingCommitButtons channel" |
|
814 |
||
815 |
|holder| |
|
816 |
||
817 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[ |
|
1157 | 818 |
builder aspectAt:#modifiedChannel put:(holder := ValueHolder with:false). |
1147 | 819 |
holder |
820 |
onChangeSend:#value |
|
1148 | 821 |
to:[ |
822 |
holder value ifTrue:[ |
|
823 |
self valueOfEnablingCommitButtons value:true. |
|
1147 | 824 |
] |
825 |
] |
|
826 |
]. |
|
827 |
^ holder |
|
828 |
||
829 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
|
830 |
! |
|
831 |
||
822 | 832 |
valueOfCanCopy |
907 | 833 |
"returns whether can copy as value holder" |
822 | 834 |
|
936 | 835 |
^ builder booleanValueAspectFor:#valueOfCanCopy |
822 | 836 |
|
936 | 837 |
"Modified: / 21.5.1998 / 03:39:05 / cg" |
822 | 838 |
! |
839 |
||
840 |
valueOfCanCut |
|
907 | 841 |
"returns whether can paste as value holder" |
822 | 842 |
|
936 | 843 |
^ builder booleanValueAspectFor:#valueOfCanCut |
822 | 844 |
|
936 | 845 |
"Modified: / 21.5.1998 / 03:39:13 / cg" |
822 | 846 |
! |
847 |
||
848 |
valueOfCanPaste |
|
907 | 849 |
"returns whether can paste as value holder" |
822 | 850 |
|
936 | 851 |
^ builder booleanValueAspectFor:#valueOfCanPaste |
822 | 852 |
|
936 | 853 |
"Modified: / 21.5.1998 / 03:39:22 / cg" |
822 | 854 |
! |
855 |
||
856 |
valueOfCanUndo |
|
907 | 857 |
"returns whether can undo as value holder" |
822 | 858 |
|
936 | 859 |
^ builder booleanValueAspectFor:#valueOfCanUndo |
822 | 860 |
|
936 | 861 |
"Modified: / 21.5.1998 / 03:39:31 / cg" |
822 | 862 |
! |
863 |
||
782 | 864 |
valueOfEnablingCommitButtons |
907 | 865 |
"returns the enabling of the commit of this tool as value holder" |
753 | 866 |
|
936 | 867 |
^ builder booleanValueAspectFor:#valueOfEnablingCommitButtons |
753 | 868 |
|
936 | 869 |
"Modified: / 21.5.1998 / 03:39:49 / cg" |
782 | 870 |
! |
871 |
||
858 | 872 |
valueOfHavingDocumentation |
1004 | 873 |
"returns the enabling of having documentation for this tool as value holder" |
803 | 874 |
|
1108 | 875 |
^ (builder booleanValueAspectFor:#valueOfHavingDocumentation) value: (self class implements: #openDocumentation) |
803 | 876 |
! |
877 |
||
782 | 878 |
valueOfInfoLabel |
907 | 879 |
"returns the info label as value holder" |
782 | 880 |
|
936 | 881 |
^ builder nilValueAspectFor:#valueOfInfoLabel |
753 | 882 |
|
936 | 883 |
"Modified: / 21.5.1998 / 03:40:34 / cg" |
782 | 884 |
! |
885 |
||
886 |
valueOfTimeLabel |
|
907 | 887 |
"returns the time label as value holder" |
753 | 888 |
|
936 | 889 |
^ builder nilValueAspectFor:#valueOfTimeLabel |
753 | 890 |
|
936 | 891 |
"Modified: / 21.5.1998 / 03:40:42 / cg" |
753 | 892 |
! ! |
893 |
||
782 | 894 |
!ToolApplicationModel methodsFor:'clipboard'! |
753 | 895 |
|
838 | 896 |
clipboard |
907 | 897 |
"returns the clipboard" |
838 | 898 |
|
899 |
^self class clipboard |
|
900 |
! |
|
901 |
||
782 | 902 |
clipboard: anEditObject |
907 | 903 |
"sets the clipboard and the value holder for can pasting" |
753 | 904 |
|
782 | 905 |
self class clipboard: anEditObject. |
753 | 906 |
|
869 | 907 |
self valueOfCanPaste value: anEditObject notNil |
782 | 908 |
! ! |
909 |
||
1195
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
910 |
!ToolApplicationModel methodsFor:'clock handling'! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
911 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
912 |
startClock |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
913 |
"/ start the time-block |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
914 |
self startClockOnTimedBlock:[self updateTime]. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
915 |
! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
916 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
917 |
startClockOnTimedBlock: aBlock |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
918 |
"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
|
919 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
920 |
timeBlock := aBlock. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
921 |
aBlock value. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
922 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
923 |
"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
|
924 |
! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
925 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
926 |
stopClock |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
927 |
"/ stop the time-block |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
928 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
929 |
timeBlock notNil ifTrue:[ |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
930 |
Processor removeTimedBlock:timeBlock. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
931 |
timeBlock := nil. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
932 |
]. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
933 |
self valueOfTimeLabel value:'' |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
934 |
! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
935 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
936 |
updateTime |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
937 |
"update my time-field" |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
938 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
939 |
|now hours minutes suffix| |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
940 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
941 |
now := Time now. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
942 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
943 |
hours := now hours. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
944 |
minutes := now minutes printString. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
945 |
suffix := ' '. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
946 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
947 |
(resources at:'TIME_FORMAT' ifAbsent:12) == 12 ifTrue:[ |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
948 |
suffix := ' am '. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
949 |
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
|
950 |
]. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
951 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
952 |
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
|
953 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
954 |
self valueOfTimeLabel value:(hours printString, ':', minutes, suffix). |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
955 |
|
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
956 |
timeBlock notNil ifTrue:[ |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
957 |
Processor removeTimedBlock:timeBlock. |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
958 |
Processor addTimedBlock:timeBlock afterSeconds:5 |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
959 |
] |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
960 |
! ! |
3e136baa74f9
moved all clock-handling code to one place
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
961 |
|
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
962 |
!ToolApplicationModel methodsFor:'defaults'! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
963 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
964 |
aboutImage |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
965 |
"the image to be displayed in my about-box; |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
966 |
If nil is returned, thhe ST/X default image is used." |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
967 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
968 |
^ nil |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
969 |
|
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
970 |
"Created: / 25.7.1998 / 20:33:50 / cg" |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
971 |
! ! |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
972 |
|
782 | 973 |
!ToolApplicationModel methodsFor:'help'! |
753 | 974 |
|
762 | 975 |
defaultInfoLabel |
907 | 976 |
"returns the default info label; here an empty string" |
762 | 977 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
978 |
^ '' |
984 | 979 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
980 |
"Modified: / 31.7.1998 / 18:44:55 / cg" |
984 | 981 |
! |
982 |
||
753 | 983 |
openAbout |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
984 |
"opens an about box (on ST/X)" |
753 | 985 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
986 |
self class openAboutSTX |
753 | 987 |
|
1043
32cd5ccbd94f
made openAboutSTX a class method for sharability.
Claus Gittinger <cg@exept.de>
parents:
1040
diff
changeset
|
988 |
"Modified: / 14.8.1998 / 13:17:57 / cg" |
753 | 989 |
! |
990 |
||
991 |
openAboutThisApplication |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
992 |
"opens an about box for this application. |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
993 |
Extracts some common info (i.e. class revision, author etc. from |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
994 |
the classes documentation." |
753 | 995 |
|
1040 | 996 |
|rev box myClass clsRev image msg| |
936 | 997 |
|
753 | 998 |
rev := ''. |
936 | 999 |
myClass := self class. |
1000 |
||
1001 |
(clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
1040 | 1002 |
|
1003 |
msg := '\The application\\' withCRs |
|
936 | 1004 |
, myClass name asBoldText, rev |
850 | 1005 |
, '\\has been designed and implemented by: \' withCRs |
1006 |
, ((self class authorLinesForAboutBox collect:[:l | '- ' , l]) asStringWith:$\) withCRs |
|
800 | 1007 |
, '\\' withCRs. |
1138
106a5cc7a4a8
do not display tabs in a string.
Claus Gittinger <cg@exept.de>
parents:
1108
diff
changeset
|
1008 |
msg := msg withTabsExpanded. |
753 | 1009 |
|
1040 | 1010 |
AboutBox isNil ifTrue:[ |
1011 |
"/ this handles bad installations of ST/X, |
|
1012 |
"/ where the AboutBox is missing. |
|
1013 |
"/ (May vanish in the future) |
|
1014 |
^ self information:msg |
|
1015 |
]. |
|
1016 |
||
1017 |
box := AboutBox title:msg. |
|
1018 |
||
1006
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1019 |
image := self aboutImage. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1020 |
image notNil ifTrue:[ |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1021 |
box image:image |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1022 |
]. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1023 |
box label:'About This Application'. |
786de97d72f9
allow redefinition of the about-boxes image.
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1024 |
box autoHideAfter:10 with:[]. |
1034
59abcada672e
show about boxes under the mouse pointer.
Claus Gittinger <cg@exept.de>
parents:
1025
diff
changeset
|
1025 |
box showAtPointer. |
936 | 1026 |
|
1138
106a5cc7a4a8
do not display tabs in a string.
Claus Gittinger <cg@exept.de>
parents:
1108
diff
changeset
|
1027 |
"Modified: / 12.3.1999 / 00:12:13 / cg" |
753 | 1028 |
! |
1029 |
||
858 | 1030 |
openHTMLDocument: aHTMLFilename |
907 | 1031 |
"opens a HTML browser on aHTMLFilename" |
858 | 1032 |
|
1033 |
HTMLDocumentView openFullOnDocumentationFile: aHTMLFilename |
|
1034 |
! |
|
1035 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1036 |
showHelp:aHelpText for:view |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1037 |
"displays aHelpText in the info label" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1038 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1039 |
aHelpText isNil |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1040 |
ifTrue: [self updateInfoLabel] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1041 |
ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)]. |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1042 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1043 |
"Created: / 20.6.1998 / 16:37:23 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1044 |
"Modified: / 31.7.1998 / 18:40:19 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1045 |
! |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1046 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1047 |
showingHelp |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1048 |
"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
|
1049 |
application; false otherwise" |
782 | 1050 |
|
783 | 1051 |
|currentActiveHelp| |
858 | 1052 |
|
783 | 1053 |
currentActiveHelp := ActiveHelp currentHelpListener. |
1054 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1055 |
^ self class showingHelp |
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1056 |
and: [currentActiveHelp notNil and: [ |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1057 |
currentActiveHelp interestedIn: self window]] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1058 |
|
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1059 |
"/ ^ self class showingHelp |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1060 |
"/ and: [currentActiveHelp notNil and: [masterApplication notNil |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1061 |
"/ ifFalse: [currentActiveHelp interestedIn: self window] |
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1062 |
"/ ifTrue: [currentActiveHelp interestedIn: masterApplication window]]] |
782 | 1063 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1064 |
"Created: / 31.7.1998 / 17:57:03 / cg" |
1051
65dfbf6481b5
showingHelp fixed (tree-item editor)
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
1065 |
"Modified: / 22.8.1998 / 00:06:38 / cg" |
782 | 1066 |
! |
1067 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1068 |
showingHelp: aValue |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1069 |
"toggles showing help for this application" |
984 | 1070 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1071 |
(self class showingHelp: aValue) |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1072 |
ifTrue: [ActiveHelp startFor:self] |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1073 |
ifFalse: [ActiveHelp stopFor:self. self updateInfoLabel] |
984 | 1074 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1075 |
"Created: / 31.7.1998 / 18:20:44 / cg" |
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1076 |
"Modified: / 31.7.1998 / 18:44:39 / cg" |
822 | 1077 |
! |
1078 |
||
1079 |
updateInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1080 |
"updates the info label at the bottom of this application" |
822 | 1081 |
|
1082 |
self valueOfInfoLabel value: self defaultInfoLabel |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1083 |
|
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1084 |
"Modified: / 31.7.1998 / 18:44:46 / cg" |
762 | 1085 |
! ! |
1086 |
||
753 | 1087 |
!ToolApplicationModel methodsFor:'history'! |
1088 |
||
1089 |
addToHistory: aHistoryEntry |
|
907 | 1090 |
"adds aHistoryEntry (format: loadMessage -> evalString) at the top of the history, |
1091 |
and checks for maximum size of the history" |
|
753 | 1092 |
|
782 | 1093 |
aHistoryEntry key size = 0 ifTrue: [^nil]. |
753 | 1094 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
1095 |
self history addFirst: aHistoryEntry. |
|
1096 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1097 |
! |
|
1098 |
||
1099 |
emptyHistory |
|
907 | 1100 |
"removes all history entries" |
753 | 1101 |
|
1102 |
^self history removeAll |
|
1103 |
! |
|
1104 |
||
1105 |
history |
|
907 | 1106 |
"returns the history from tool class" |
753 | 1107 |
|
1108 |
^self class getHistory |
|
1109 |
! |
|
1110 |
||
844 | 1111 |
historyEntries |
907 | 1112 |
"returns the history entries, i.e. the evaluatable values containing the information" |
844 | 1113 |
|
1114 |
^self history collect: [:asso| asso key] |
|
1115 |
! |
|
1116 |
||
753 | 1117 |
menuHistory |
907 | 1118 |
"returns a history submenu" |
753 | 1119 |
|
893 | 1120 |
|menu| |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1121 |
|
753 | 1122 |
menu := Menu new receiver: self. |
1123 |
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do: |
|
1124 |
[:historyEntryType| |
|
1013 | 1125 |
menu addItemGroup: |
1126 |
((self history |
|
1127 |
select: [:histEntry| |
|
1128 |
histEntry value = historyEntryType]) |
|
1129 |
collect: [:histEntry| |
|
1130 |
MenuItem new |
|
1131 |
label: histEntry key printString; |
|
1132 |
value: histEntry value; |
|
1133 |
argument: histEntry key; |
|
1134 |
activeHelpKey: #historyMenuItem]). |
|
753 | 1135 |
]. |
1136 |
||
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1137 |
menu addItem: (MenuItem new |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1138 |
label: 'Empty History'; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1139 |
value: #emptyHistory; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1140 |
activeHelpKey: #historyEmptyMenu; |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1141 |
translateLabel:true). |
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1142 |
|
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1143 |
menu findGuiResourcesIn:self. |
753 | 1144 |
^menu |
920
6b72e4ce4406
must find gui resources (xlations in in history menu)
Claus Gittinger <cg@exept.de>
parents:
910
diff
changeset
|
1145 |
|
1013 | 1146 |
"Modified: / 29.7.1998 / 11:40:11 / cg" |
753 | 1147 |
! |
1148 |
||
1149 |
removeFromHistory: aHistoryEntry |
|
907 | 1150 |
"removes aHistoryEntry from the history" |
753 | 1151 |
|
1152 |
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil. |
|
1153 |
[self history size > self class historyMaxSize] whileTrue: [self history removeLast] |
|
1154 |
! ! |
|
1155 |
||
982
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1156 |
!ToolApplicationModel methodsFor:'initialization'! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1157 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1158 |
initialize |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1159 |
super initialize. |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1160 |
self createBuilder |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1161 |
|
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1162 |
"Created: / 20.6.1998 / 14:51:29 / cg" |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1163 |
! ! |
807f440e0df7
bw. compatibility - needs builder early.
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
1164 |
|
1200 | 1165 |
!ToolApplicationModel methodsFor:'misc'! |
1166 |
||
1167 |
clearModifiedFlag |
|
1168 |
"clear the modifiedChannel. |
|
1169 |
That one is hooked to components in the right noteBook, |
|
1170 |
and will be set, when any value is modified. |
|
1171 |
(to enable OK and cancel buttons)" |
|
1172 |
||
1173 |
self modifiedChannel value:false |
|
1174 |
! ! |
|
1175 |
||
782 | 1176 |
!ToolApplicationModel methodsFor:'queries'! |
1177 |
||
876 | 1178 |
allToolInstances |
907 | 1179 |
"returns all instances of this tool class" |
876 | 1180 |
|
1150
5211197a2671
NEVER - redefine allInstances
Claus Gittinger <cg@exept.de>
parents:
1148
diff
changeset
|
1181 |
^ self class allToolInstances |
1089
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1182 |
|
49b05d386ccc
removed Thomas's memory leak
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
1183 |
"Modified: / 4.2.1999 / 15:34:58 / cg" |
876 | 1184 |
! |
1185 |
||
782 | 1186 |
preferredExtent |
1187 |
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView') |
|
1188 |
will be considered" |
|
1189 |
||
1190 |
|window menu menuToolbarView preferredExtentOfWindow| |
|
1191 |
||
1192 |
window := self builder window. |
|
1193 |
menu := window subViews first. |
|
1194 |
menuToolbarView := builder componentAt: #menuToolbarView. |
|
1195 |
||
1196 |
preferredExtentOfWindow := window extent. |
|
1197 |
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent]. |
|
1198 |
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent]. |
|
1199 |
||
1200 |
^window minExtent max: (preferredExtentOfWindow min: window maxExtent) |
|
1201 |
! ! |
|
1202 |
||
753 | 1203 |
!ToolApplicationModel methodsFor:'startup / release'! |
1204 |
||
1107 | 1205 |
closeDownViews |
907 | 1206 |
"uninitializes and closes this tool" |
753 | 1207 |
|
756 | 1208 |
self uninitialize. |
1107 | 1209 |
super closeDownViews |
1108 | 1210 |
! |
936 | 1211 |
|
790 | 1212 |
postOpenWith:aBuilder |
907 | 1213 |
"starts the active help for this tool (if turned on in the settings) |
1214 |
and updates the info label and the fonts (from the settings)" |
|
790 | 1215 |
|
1216 |
super postOpenWith:aBuilder. |
|
1217 |
||
822 | 1218 |
self updateInfoLabel. |
1104
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1219 |
"/ self updateFonts. |
a2f59712ce7b
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1220 |
self showingHelp:true |
876 | 1221 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1222 |
"Modified: / 31.7.1998 / 18:17:34 / cg" |
790 | 1223 |
! |
1224 |
||
756 | 1225 |
uninitialize |
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1226 |
"stops active help for this tool and (if defined) removes the time block" |
756 | 1227 |
|
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1228 |
self showingHelp ifTrue: [ActiveHelp stopFor: self]. |
876 | 1229 |
timeBlock notNil ifTrue: [Processor removeTimedBlock:timeBlock. timeBlock := nil]. |
1230 |
||
1018
7222534cb3dc
part of the activeHelp framework moved to ApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
1231 |
"Modified: / 31.7.1998 / 18:46:21 / cg" |
753 | 1232 |
! ! |
1233 |
||
1234 |
!ToolApplicationModel class methodsFor:'documentation'! |
|
1235 |
||
1236 |
version |
|
1200 | 1237 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.90 1999-07-13 15:35:31 cg Exp $' |
753 | 1238 |
! ! |