741
|
1 |
ApplicationModel subclass:#ToolApplicationModel
|
|
2 |
instanceVariableNames:'activeHelp'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Interface-Framework'
|
|
6 |
!
|
|
7 |
|
|
8 |
!ToolApplicationModel class methodsFor:'documentation'!
|
|
9 |
|
|
10 |
documentation
|
|
11 |
"
|
|
12 |
standard framework for tools; provides hooks for about menu,
|
|
13 |
help menu etc.
|
|
14 |
See concrete subclasses for examples.
|
|
15 |
|
|
16 |
[see also:]
|
|
17 |
ApplicationModel
|
|
18 |
ImageEditor
|
|
19 |
|
|
20 |
[author:]
|
|
21 |
Thomas Zwick
|
|
22 |
"
|
|
23 |
! !
|
|
24 |
|
|
25 |
!ToolApplicationModel class methodsFor:'accessing'!
|
|
26 |
|
|
27 |
author
|
|
28 |
|
|
29 |
^'unknown'
|
|
30 |
!
|
|
31 |
|
|
32 |
defaultIcon
|
|
33 |
|
|
34 |
^Launcher aboutIcon
|
|
35 |
!
|
|
36 |
|
|
37 |
label
|
|
38 |
|
|
39 |
|label|
|
|
40 |
label := ''.
|
|
41 |
self name do:
|
|
42 |
[:c|
|
|
43 |
c isUppercase ifTrue: [label := label, $ ].
|
|
44 |
label := label, c
|
|
45 |
].
|
|
46 |
^label trimBlanks
|
|
47 |
! !
|
|
48 |
|
|
49 |
!ToolApplicationModel class methodsFor:'interface specs'!
|
|
50 |
|
|
51 |
menuAbout
|
|
52 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
53 |
|
|
54 |
"do not manually edit this - the builder may not be able to
|
|
55 |
handle the specification if its corrupted."
|
|
56 |
|
|
57 |
"
|
|
58 |
MenuEditor new openOnClass:MyApplicationModel andSelector:#menuAbout
|
|
59 |
(Menu new fromLiteralArrayEncoding:(MyApplicationModel menuAbout)) startUp
|
|
60 |
"
|
|
61 |
|
|
62 |
<resource: #menu>
|
|
63 |
|
|
64 |
^
|
|
65 |
|
|
66 |
#(#Menu
|
|
67 |
|
|
68 |
#(
|
|
69 |
#(#MenuItem
|
|
70 |
#'label:' 'about Smalltalk/X...'
|
|
71 |
#'value:' #openAbout
|
|
72 |
)
|
|
73 |
#(#MenuItem
|
|
74 |
#'label:' '-'
|
|
75 |
)
|
|
76 |
#(#MenuItem
|
|
77 |
#'label:' 'about this application...'
|
|
78 |
#'value:' #openAboutThisApplication
|
|
79 |
)
|
|
80 |
) nil
|
|
81 |
nil
|
|
82 |
)
|
|
83 |
!
|
|
84 |
|
|
85 |
menuHelp
|
|
86 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
87 |
|
|
88 |
"do not manually edit this - the builder may not be able to
|
|
89 |
handle the specification if its corrupted."
|
|
90 |
|
|
91 |
"
|
|
92 |
MenuEditor new openOnClass:MyApplicationModel andSelector:#menuHelp
|
|
93 |
(Menu new fromLiteralArrayEncoding:(MyApplicationModel menuHelp)) startUp
|
|
94 |
"
|
|
95 |
|
|
96 |
<resource: #menu>
|
|
97 |
|
|
98 |
^
|
|
99 |
|
|
100 |
#(#Menu
|
|
101 |
|
|
102 |
#(
|
|
103 |
#(#MenuItem
|
|
104 |
#'label:' 'tutorial'
|
|
105 |
#'value:' #openTutorial
|
|
106 |
)
|
|
107 |
#(#MenuItem
|
|
108 |
#'label:' 'programmer''s guide'
|
|
109 |
#'value:' #openProgrammersGuide
|
|
110 |
)
|
|
111 |
#(#MenuItem
|
|
112 |
#'label:' '-'
|
|
113 |
)
|
|
114 |
#(#MenuItem
|
|
115 |
#'label:' 'class documentation'
|
|
116 |
#'value:' #openClassDocumentation
|
|
117 |
)
|
|
118 |
#(#MenuItem
|
|
119 |
#'label:' '-'
|
|
120 |
)
|
|
121 |
#(#MenuItem
|
|
122 |
#'label:' 'active help'
|
|
123 |
)
|
|
124 |
) nil
|
|
125 |
nil
|
|
126 |
)
|
|
127 |
! !
|
|
128 |
|
|
129 |
!ToolApplicationModel methodsFor:'accessing menu'!
|
|
130 |
|
|
131 |
menuAbout
|
|
132 |
"this window spec was automatically generated by the UI Builder"
|
|
133 |
|
|
134 |
^ self class menuAbout
|
|
135 |
|
|
136 |
|
|
137 |
!
|
|
138 |
|
|
139 |
menuHelp
|
|
140 |
"this window spec was automatically generated by the UI Builder"
|
|
141 |
|
|
142 |
^ self class menuHelp
|
|
143 |
|
|
144 |
|
|
145 |
! !
|
|
146 |
|
|
147 |
!ToolApplicationModel methodsFor:'help'!
|
|
148 |
|
|
149 |
openAbout
|
|
150 |
"show an about box"
|
|
151 |
|
|
152 |
|box|
|
|
153 |
|
|
154 |
box := AboutBox new.
|
|
155 |
box autoHideAfter:10 with:[].
|
|
156 |
box showAtCenter
|
|
157 |
|
|
158 |
!
|
|
159 |
|
|
160 |
openAboutThisApplication
|
|
161 |
"show an about this application box"
|
|
162 |
|
|
163 |
(AboutBox title:
|
|
164 |
'The application\\' withCRs,
|
|
165 |
(Text string: self class label emphasis: #bold),
|
|
166 |
'\\has been designed and implemented by \' withCRs,self class author,', eXept Software AG, Germany. \\' withCRs)
|
|
167 |
label:'About this application...';
|
|
168 |
autoHideAfter:10 with:[];
|
|
169 |
showAtCenter.
|
|
170 |
!
|
|
171 |
|
|
172 |
openClassDocumentation
|
|
173 |
|
|
174 |
Autoload autoloadFailedSignal handle:[:ex |
|
|
175 |
self warn:'autoload failed.
|
|
176 |
|
|
177 |
Check your source directory and/or
|
|
178 |
the abbreviation file for the classes (correct) shortened name.'.
|
|
179 |
ex return.
|
|
180 |
] do:[
|
|
181 |
|text v|
|
|
182 |
|
|
183 |
text := self class htmlDocumentation.
|
|
184 |
text notNil ifTrue:[
|
|
185 |
v := HTMLDocumentView
|
|
186 |
openFullOnText:text
|
|
187 |
inDirectory:(Smalltalk getSystemFileName:'doc/online/english/classDoc').
|
|
188 |
v nameSpaceForExecution: self class nameSpace.
|
|
189 |
]
|
|
190 |
]
|
|
191 |
|
|
192 |
|
|
193 |
!
|
|
194 |
|
|
195 |
openProgrammersGuide
|
|
196 |
|
|
197 |
|dir|
|
|
198 |
((dir := Smalltalk getSystemFileName: 'doc/online/english/programming/TOP.html') asFilename exists)
|
|
199 |
ifTrue:
|
|
200 |
[
|
|
201 |
^HTMLDocumentView openFullOnFile: dir
|
|
202 |
]
|
|
203 |
!
|
|
204 |
|
|
205 |
openTutorial
|
|
206 |
|
|
207 |
|dir|
|
|
208 |
((dir := Smalltalk getSystemFileName: 'doc/online/english/getstart/tutorial.html') asFilename exists)
|
|
209 |
ifTrue:
|
|
210 |
[
|
|
211 |
^HTMLDocumentView openFullOnFile: dir
|
|
212 |
]
|
|
213 |
! !
|
|
214 |
|
|
215 |
!ToolApplicationModel class methodsFor:'documentation'!
|
|
216 |
|
|
217 |
version
|
|
218 |
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.1 1997-11-25 13:35:39 tz Exp $'
|
|
219 |
! !
|