author | tz |
Thu, 05 Mar 1998 23:48:02 +0100 | |
changeset 701 | bcd65f75ade4 |
parent 700 | 2aae4f3b6526 |
child 704 | 0f2dc21e9f66 |
permissions | -rw-r--r-- |
156 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
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 |
||
148 | 15 |
ApplicationModel subclass:#UIHelpTool |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
16 |
instanceVariableNames:'isModified specClass dictionary dictionaries listSelection |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
17 |
maxCharsPerLine modifiedHolder' |
148 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
23 |
!UIHelpTool class methodsFor:'documentation'! |
|
24 |
||
156 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
||
39 |
! |
|
40 |
||
148 | 41 |
documentation |
42 |
" |
|
43 |
used by the UIPainter to add help text to any component which will be shown |
|
44 |
during runing an application with enabled activeHelp mode. |
|
156 | 45 |
|
46 |
[author:] |
|
47 |
Claus Atzkern |
|
148 | 48 |
" |
49 |
! ! |
|
50 |
||
286 | 51 |
!UIHelpTool class methodsFor:'instance creation'! |
52 |
||
53 |
openOnClass:aClass |
|
54 |
" |
|
55 |
UIHelpTool openOnClass:UIPainter |
|
56 |
" |
|
57 |
|helpTool| |
|
58 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
59 |
helpTool := UIHelpTool open. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
60 |
helpTool helpSpecFrom:aClass. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
61 |
helpTool dictionary: aClass helpSpec. |
286 | 62 |
|
63 |
! ! |
|
64 |
||
65 |
!UIHelpTool class methodsFor:'constants'! |
|
66 |
||
67 |
label |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
68 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
69 |
^'Help' |
286 | 70 |
! ! |
71 |
||
151 | 72 |
!UIHelpTool class methodsFor:'help specs'! |
73 |
||
74 |
helpSpec |
|
75 |
"return a dictionary filled with helpKey -> helptext associations. |
|
292 | 76 |
These are used by the activeHelp tool." |
77 |
||
172 | 78 |
" |
292 | 79 |
UIHelpTool openOnClass:UIHelpTool |
80 |
" |
|
81 |
||
172 | 82 |
^ super helpSpec addPairsFrom:#( |
151 | 83 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
84 |
#addHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
85 |
'Adds help text key.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
86 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
87 |
#currentHelpTexts |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
88 |
'Selected help text key.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
89 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
90 |
#deleteHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
91 |
'Deletes the help text from the help spec.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
92 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
93 |
#helpTextView |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
94 |
'Shows the help text.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
95 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
96 |
#listOfHelpSpecClasses |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
97 |
'List of the classes where help specs can be/are implemented.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
98 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
99 |
#listOfHelpTexts |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
100 |
'List of the help text keys.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
101 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
102 |
#removeHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
103 |
'Removes the help text key from the widget.' |
172 | 104 |
|
105 |
) |
|
151 | 106 |
! ! |
107 |
||
148 | 108 |
!UIHelpTool class methodsFor:'interface specs'! |
109 |
||
110 |
windowSpec |
|
111 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
112 |
||
113 |
"do not manually edit this - the painter/builder may not be able to |
|
114 |
handle the specification if its corrupted." |
|
115 |
||
116 |
" |
|
151 | 117 |
UIPainter new openOnClass:UIHelpTool andSelector:#windowSpec |
118 |
UIHelpTool new openInterface:#windowSpec |
|
148 | 119 |
" |
151 | 120 |
"UIHelpTool open" |
148 | 121 |
|
122 |
<resource: #canvas> |
|
123 |
||
124 |
^ |
|
125 |
||
126 |
#(#FullSpec |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
127 |
#window: |
148 | 128 |
#(#WindowSpec |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
129 |
#name: 'HelpTool' |
700 | 130 |
#layout: #(#LayoutFrame 90 0 295 0 375 0 565 0) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
131 |
#label: 'unnamed canvas' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
132 |
#min: #(#Point 10 10) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
133 |
#max: #(#Point 1160 870) |
700 | 134 |
#bounds: #(#Rectangle 90 295 376 566) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
135 |
#usePreferredExtent: false |
148 | 136 |
) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
137 |
#component: |
148 | 138 |
#(#SpecCollection |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
139 |
#collection: |
148 | 140 |
#( |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
141 |
#(#SequenceViewSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
142 |
#name: 'listOfHelpKeysView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
143 |
#layout: #(#LayoutFrame 3 0 2 0 -1 0.5 -1 0.5) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
144 |
#activeHelpKey: #listOfHelpTexts |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
145 |
#tabable: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
146 |
#model: #listModel |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
147 |
#hasHorizontalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
148 |
#hasVerticalScrollBar: true |
700 | 149 |
#miniScrollerHorizontal: true |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
150 |
#useIndex: false |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
151 |
#sequenceList: #listChannel |
286 | 152 |
) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
153 |
#(#HorizontalPanelViewSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
154 |
#name: 'HorizontalPanelView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
155 |
#layout: #(#LayoutFrame 1 0.5 2 0 -3 1 26 0) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
156 |
#component: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
157 |
#(#SpecCollection |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
158 |
#collection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
159 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
160 |
#(#ActionButtonSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
161 |
#name: 'AddButton' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
162 |
#activeHelpKey: #addHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
163 |
#label: 'Add' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
164 |
#model: #accept |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
165 |
#extent: #(#Point 44 24) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
166 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
167 |
#(#ActionButtonSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
168 |
#name: 'RemoveButton' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
169 |
#activeHelpKey: #removeHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
170 |
#label: 'Remove' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
171 |
#model: #remove |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
172 |
#extent: #(#Point 44 24) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
173 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
174 |
#(#ActionButtonSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
175 |
#name: 'DeleteButton' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
176 |
#activeHelpKey: #deleteHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
177 |
#label: 'Delete' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
178 |
#model: #delete |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
179 |
#extent: #(#Point 45 24) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
180 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
181 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
182 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
183 |
#horizontalLayout: #fit |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
184 |
#verticalLayout: #fit |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
185 |
#horizontalSpace: 3 |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
186 |
#verticalSpace: 3 |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
187 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
188 |
#(#InputFieldSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
189 |
#name: 'helpKeyInputField' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
190 |
#layout: #(#LayoutFrame 1 0.5 29 0 -3 1 51 0) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
191 |
#activeHelpKey: #currentHelpTexts |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
192 |
#model: #listModel |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
193 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
194 |
#(#SequenceViewSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
195 |
#name: 'listOfHelpSpecClassesView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
196 |
#layout: #(#LayoutFrame 1 0.5 53 0 -3 1 -1 0.5) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
197 |
#activeHelpKey: #listOfHelpSpecClasses |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
198 |
#model: #selectionOfHelpSpecClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
199 |
#hasHorizontalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
200 |
#hasVerticalScrollBar: true |
700 | 201 |
#miniScrollerHorizontal: true |
202 |
#miniScrollerVertical: true |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
203 |
#valueChangeSelector: #helpSpecClassSelected |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
204 |
#useIndex: false |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
205 |
#sequenceList: #listOfHelpSpecClasses |
286 | 206 |
) |
148 | 207 |
#(#TextEditorSpec |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
208 |
#name: 'helpTextView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
209 |
#layout: #(#LayoutFrame 3 0.0 1 0.5 -1 1.0 -3 1.0) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
210 |
#activeHelpKey: #helpTextView |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
211 |
#hasHorizontalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
212 |
#hasVerticalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
213 |
#miniScrollerHorizontal: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
214 |
#miniScrollerVertical: true |
148 | 215 |
) |
216 |
) |
|
217 |
) |
|
218 |
) |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
219 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
220 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
221 |
windowSpecForStandAlone |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
222 |
"this window spec was automatically generated by the ST/X UIPainter" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
223 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
224 |
"do not manually edit this - the painter/builder may not be able to |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
225 |
handle the specification if its corrupted." |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
226 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
227 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
228 |
UIPainter new openOnClass:UIHelpTool andSelector:#windowSpecForStandAlone |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
229 |
UIHelpTool new openInterface:#windowSpecForStandAlone |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
230 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
231 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
232 |
<resource: #canvas> |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
233 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
234 |
^ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
235 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
236 |
#(#FullSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
237 |
#window: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
238 |
#(#WindowSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
239 |
#name: 'Help Tool' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
240 |
#layout: #(#LayoutFrame 195 0 352 0 694 0 751 0) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
241 |
#label: 'Help Tool' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
242 |
#min: #(#Point 10 10) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
243 |
#max: #(#Point 1160 870) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
244 |
#bounds: #(#Rectangle 195 352 695 752) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
245 |
#menu: #menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
246 |
#usePreferredExtent: false |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
247 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
248 |
#component: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
249 |
#(#SpecCollection |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
250 |
#collection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
251 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
252 |
#(#UISubSpecification |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
253 |
#name: 'UISubSpecification1' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
254 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
255 |
#minorKey: #windowSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
256 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
257 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
258 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
259 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
260 |
! ! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
261 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
262 |
!UIHelpTool class methodsFor:'menu specs'! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
263 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
264 |
menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
265 |
"this window spec was automatically generated by the ST/X MenuEditor" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
266 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
267 |
"do not manually edit this - the builder may not be able to |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
268 |
handle the specification if its corrupted." |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
269 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
270 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
271 |
MenuEditor new openOnClass:UIHelpTool andSelector:#menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
272 |
(Menu new fromLiteralArrayEncoding:(UIHelpTool menu)) startUp |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
273 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
274 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
275 |
<resource: #menu> |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
276 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
277 |
^ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
278 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
279 |
#(#Menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
280 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
281 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
282 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
283 |
#label: 'File' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
284 |
#submenu: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
285 |
#(#Menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
286 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
287 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
288 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
289 |
#label: 'Reload' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
290 |
#value: #doReload |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
291 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
292 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
293 |
#label: '-' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
294 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
295 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
296 |
#label: 'Save' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
297 |
#value: #doInstallHelpSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
298 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
299 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
300 |
#label: '-' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
301 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
302 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
303 |
#label: 'Define Class...' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
304 |
#value: #doFromClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
305 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
306 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
307 |
#label: '-' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
308 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
309 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
310 |
#label: 'Exit' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
311 |
#value: #closeRequest |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
312 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
313 |
) nil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
314 |
nil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
315 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
316 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
317 |
) nil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
318 |
nil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
319 |
) |
148 | 320 |
! ! |
321 |
||
322 |
!UIHelpTool methodsFor:'accessing'! |
|
323 |
||
151 | 324 |
dictionary |
325 |
"return the value of the instance variable 'dictionary' (automatically generated)" |
|
326 |
||
327 |
^ dictionary! |
|
328 |
||
329 |
dictionary:aDictionary |
|
330 |
"set the value of the instance variable 'dictionary' (automatically generated)" |
|
331 |
||
286 | 332 |
(dictionary := aDictionary) isNil ifTrue:[ |
700 | 333 |
dictionary := Dictionary new. |
286 | 334 |
]. |
335 |
self updateList |
|
336 |
! |
|
337 |
||
338 |
helpKey |
|
339 |
listSelection size ~~ 0 ifTrue:[ |
|
340 |
^ listSelection asSymbol |
|
151 | 341 |
]. |
286 | 342 |
^ nil |
343 |
! |
|
344 |
||
345 |
helpKey:aKey |
|
346 |
|key| |
|
347 |
||
348 |
aKey size ~~ 0 ifTrue:[ |
|
349 |
key := aKey asString |
|
350 |
]. |
|
351 |
self listModel value:key |
|
459 | 352 |
|
151 | 353 |
! |
354 |
||
196 | 355 |
helpSpecFrom:aClass |
356 |
"read help text from an application associated with the class |
|
357 |
" |
|
286 | 358 |
|help| |
359 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
360 |
isModified := false. |
700 | 361 |
specClass notNil |
362 |
ifTrue: |
|
363 |
[ |
|
364 |
dictionary := Dictionary new. |
|
365 |
dictionaries := Dictionary new. |
|
366 |
]. |
|
369 | 367 |
specClass := self applicationClassAssociatedWith:aClass. |
700 | 368 |
(specClass isClass and: [specClass isLoaded]) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
369 |
ifTrue: |
700 | 370 |
[ |
371 |
(specClass class implements:#helpSpec) ifFalse:[ |
|
372 |
dictionaries at: specClass name put: dictionary |
|
373 |
]. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
374 |
self listOfHelpSpecClasses contents: (specClass withAllSuperclasses reverse collect: [:cls| cls name]). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
375 |
self listOfHelpSpecClasses removeAll: (ApplicationModel withAllSuperclasses collect: [:cls| cls name]). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
376 |
self selectionOfHelpSpecClass value: specClass name. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
377 |
(builder componentAt: #listOfHelpSpecClassesView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
378 |
(self listOfHelpSpecClasses value indexOf: specClass name). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
379 |
self helpSpecClassSelected. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
380 |
]. |
700 | 381 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
382 |
self updateList |
196 | 383 |
! |
384 |
||
700 | 385 |
isModified |
386 |
^ isModified |
|
387 |
! |
|
388 |
||
389 |
isModified: aBoolean |
|
390 |
||
391 |
isModified := aBoolean |
|
392 |
! |
|
393 |
||
286 | 394 |
modifiedHolder:aValueHolder |
395 |
"set the value holder set to true in case of modifying attributes |
|
148 | 396 |
" |
286 | 397 |
modifiedHolder notNil ifTrue:[ |
398 |
modifiedHolder removeDependent:self. |
|
399 |
]. |
|
148 | 400 |
|
286 | 401 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
402 |
modifiedHolder addDependent:self. |
|
459 | 403 |
|
404 |
self editTextView notNil ifTrue: [ |
|
405 |
self editTextView modifiedChannel onChangeSend:#value to:[ |
|
406 |
modifiedHolder notNil ifTrue:[ |
|
407 |
self editTextView modifiedChannel value ifTrue:[ |
|
408 |
modifiedHolder value:true |
|
409 |
] |
|
410 |
] |
|
411 |
] |
|
412 |
] |
|
413 |
] |
|
286 | 414 |
|
415 |
||
354 | 416 |
! ! |
417 |
||
148 | 418 |
!UIHelpTool methodsFor:'actions'! |
419 |
||
420 |
accept |
|
421 |
"accept the text |
|
422 |
" |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
423 |
|view key txt list listChgd| |
148 | 424 |
|
286 | 425 |
(listSelection size == 0 or:[(view := self editTextView) isNil]) ifFalse:[ |
393 | 426 |
txt := view contents asString. |
427 |
key := listSelection asSymbol. |
|
428 |
list := self listChannel value. |
|
148 | 429 |
|
393 | 430 |
(listChgd := (dictionary at:key ifAbsent:nil) isNil) ifTrue:[ |
148 | 431 |
list add:key. |
700 | 432 |
]. |
369 | 433 |
dictionary at:key put:txt. |
393 | 434 |
|
435 |
listChgd ifTrue:[ |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
436 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
437 |
(builder componentAt: #listOfHelpKeysView) selection: (list indexOf: key). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
438 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
439 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
440 |
isModified := true. |
479 | 441 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
148 | 442 |
] |
196 | 443 |
! |
444 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
445 |
delete |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
446 |
"delete selected help key |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
447 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
448 |
listSelection notNil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
449 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
450 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
451 |
dictionary removeKey: listSelection asSymbol ifAbsent: nil. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
452 |
self remove. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
453 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
454 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
455 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
456 |
isModified := true. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
457 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
458 |
] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
459 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
460 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
461 |
helpSpecClassSelected |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
462 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
463 |
|clsName| |
700 | 464 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
465 |
clsName := self selectionOfHelpSpecClass value. |
700 | 466 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
467 |
(dictionary := dictionaries at: clsName ifAbsent: nil) isNil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
468 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
469 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
470 |
dictionary := dictionaries at: clsName put: (self extractHelpSpecForClass: (Smalltalk at: clsName)) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
471 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
472 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
473 |
self updateList. |
700 | 474 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
475 |
listSelection notNil |
700 | 476 |
ifTrue: |
477 |
[ |
|
478 |
(dictionary keys includes: listSelection asSymbol) |
|
479 |
ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: |
|
480 |
(self listChannel value indexOf: (builder componentAt: #helpKeyInputField) contents)] |
|
481 |
ifFalse: [(builder componentAt: #listOfHelpKeysView) selection: nil]. |
|
482 |
]. |
|
483 |
listSelection notNil |
|
484 |
ifTrue: |
|
485 |
[ |
|
486 |
self editTextView contents: (dictionary at: listSelection asSymbol ifAbsent: '') |
|
487 |
] |
|
488 |
||
489 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
490 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
491 |
|
196 | 492 |
installHelpSpecInto:aClass |
493 |
"install help text |
|
494 |
" |
|
700 | 495 |
|cls src helpSpec| |
196 | 496 |
|
335 | 497 |
cls := self applicationClassAssociatedWith:aClass. |
196 | 498 |
|
499 |
cls isNil ifTrue:[ |
|
465 | 500 |
^ self information:'No application class defined!!'. |
196 | 501 |
]. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
502 |
|
700 | 503 |
aClass = cls name asString |
504 |
ifTrue: [self listOfHelpSpecClasses value do: [:c| c ~~ cls name ifTrue: [self installHelpSpecInto: (Smalltalk at: c)]. isModified := true]]. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
505 |
|
478 | 506 |
isModified not ifTrue:[ |
465 | 507 |
^nil |
196 | 508 |
]. |
456 | 509 |
|
700 | 510 |
helpSpec := dictionaries at: cls name ifAbsent: [dictionary]. |
511 |
||
512 |
(cls class implements: #helpSpec) |
|
513 |
ifTrue: |
|
514 |
[ |
|
515 |
|superclassHelpKeys implementedHelpSpec hasChanged| |
|
516 |
implementedHelpSpec := Dictionary new. |
|
517 |
superclassHelpKeys := (cls superclass respondsTo: #helpSpec) |
|
518 |
ifTrue: [cls superclass helpSpec keys] |
|
519 |
ifFalse: [Array new]. |
|
520 |
||
521 |
cls helpSpec associationsDo: [:h| (superclassHelpKeys includes: h key) |
|
522 |
ifFalse: [implementedHelpSpec at: h key put: h value]]. |
|
479 | 523 |
|
700 | 524 |
hasChanged := false. |
525 |
implementedHelpSpec associationsDo: [:h| (helpSpec includesAssociation: h) ifFalse: [hasChanged := true]]. |
|
526 |
helpSpec associationsDo: [:h| (implementedHelpSpec includesAssociation: h) ifFalse: [hasChanged := true]]. |
|
527 |
||
528 |
(implementedHelpSpec notEmpty and: [hasChanged and: |
|
529 |
[DialogBox confirm: 'Class ', cls name asBoldText, ' already implements\a menu spec!!\\Do only replace, if you have removed\help keys in an existing help spec.\' withCRs yesLabel: ' Merge ' noLabel: ' Replace ']]) |
|
530 |
ifTrue: |
|
531 |
[ |
|
532 |
implementedHelpSpec associationsDo: [:h| helpSpec at: h key put: h value]. |
|
533 |
] |
|
534 |
]. |
|
535 |
||
479 | 536 |
helpSpec isEmpty ifTrue:[ |
700 | 537 |
(cls superclass respondsTo: #helpSpec) ifTrue: [cls class removeSelector: #helpSpec]. |
478 | 538 |
^nil |
539 |
]. |
|
456 | 540 |
|
196 | 541 |
src := '' writeStream. |
542 |
||
543 |
src nextPutAll: |
|
544 |
||
545 |
'helpSpec |
|
546 |
"return a dictionary filled with helpKey -> helptext associations. |
|
292 | 547 |
These are used by the activeHelp tool." |
548 |
||
196 | 549 |
" |
292 | 550 |
UIHelpTool openOnClass:', cls name asString ,' |
551 |
" |
|
552 |
||
196 | 553 |
^ super helpSpec addPairsFrom:#( |
554 |
||
555 |
'. |
|
556 |
||
479 | 557 |
helpSpec keys asSortedCollection |
456 | 558 |
do:[:key | |
354 | 559 |
|txt t| |
560 |
||
479 | 561 |
txt := helpSpec at:key. |
196 | 562 |
src nextPutLine:key storeString. |
563 |
||
319
f16aa0e8541e
dont crash with nonexisting bitmaps
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
564 |
t := txt asString replaceAll:(Character cr) with:(Character space). |
286 | 565 |
|
566 |
(t endsWith:Character space) ifTrue:[ |
|
196 | 567 |
t := t copyWithoutLast:1 |
568 |
]. |
|
569 |
src nextPutLine:t storeString; cr. |
|
570 |
]. |
|
571 |
src nextPutLine:')'. |
|
572 |
||
573 |
Compiler compile:(src contents) |
|
574 |
forClass:cls class |
|
369 | 575 |
inCategory:'help specs'. |
196 | 576 |
|
369 | 577 |
isModified := false. |
578 |
||
700 | 579 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
580 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
581 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
582 |
remove |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
583 |
"remove selected help key |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
584 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
585 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
586 |
self listModel value: nil. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
587 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
588 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
589 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
590 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
148 | 591 |
! ! |
592 |
||
593 |
!UIHelpTool methodsFor:'aspects'! |
|
594 |
||
595 |
listChannel |
|
596 |
||
597 |
|holder| |
|
598 |
||
599 |
(holder := builder bindingAt:#listChannel) isNil ifTrue:[ |
|
354 | 600 |
builder aspectAt:#listChannel put:(holder := OrderedCollection new asValue). |
148 | 601 |
]. |
602 |
^ holder |
|
603 |
! |
|
604 |
||
286 | 605 |
listModel |
148 | 606 |
|
607 |
|holder| |
|
608 |
||
286 | 609 |
(holder := builder bindingAt:#listModel) isNil ifTrue:[ |
610 |
holder := AspectAdaptor new subject:self; forAspect:#listSelection. |
|
611 |
builder aspectAt:#listModel put:holder. |
|
148 | 612 |
]. |
613 |
^ holder |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
614 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
615 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
616 |
listOfHelpSpecClasses |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
617 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
618 |
|holder| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
619 |
(holder := builder bindingAt:#listOfHelpSpecClasses) isNil ifTrue:[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
620 |
builder aspectAt:#listOfHelpSpecClasses put: (holder := List new) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
621 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
622 |
^ holder |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
623 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
624 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
625 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
626 |
selectionOfHelpSpecClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
627 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
628 |
|holder| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
629 |
(holder := builder bindingAt:#selectionOfHelpSpecClass) isNil ifTrue:[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
630 |
builder aspectAt:#selectionOfHelpSpecClass put: (holder := ValueHolder new) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
631 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
632 |
^ holder |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
633 |
|
148 | 634 |
! ! |
635 |
||
636 |
!UIHelpTool methodsFor:'initialization'! |
|
637 |
||
638 |
initialize |
|
639 |
"setup instance attributes |
|
640 |
" |
|
641 |
super initialize. |
|
700 | 642 |
dictionary := Dictionary new. |
643 |
dictionaries := Dictionary new. |
|
369 | 644 |
isModified := false. |
645 |
||
286 | 646 |
! ! |
647 |
||
648 |
!UIHelpTool methodsFor:'private'! |
|
649 |
||
650 |
editTextView |
|
651 |
"get the editTextView or nil. |
|
652 |
" |
|
653 |
|view| |
|
654 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
655 |
(view := builder componentAt:#helpTextView) notNil ifTrue:[ |
286 | 656 |
view := view scrolledView. |
657 |
||
658 |
view acceptAction isNil ifTrue:[ |
|
659 |
view acceptAction:[:aList| self accept ]. |
|
660 |
]. |
|
661 |
||
662 |
view left ~~ 0 ifTrue:[ |
|
663 |
(maxCharsPerLine := view extent x // view font width) < 10 ifTrue:[ |
|
664 |
maxCharsPerLine := nil |
|
665 |
] |
|
666 |
]. |
|
454 | 667 |
]. |
286 | 668 |
^ view |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
669 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
670 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
671 |
extractHelpSpecForClass: aClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
672 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
673 |
|helpSpecSuperClass superHelpSpecKeys helpSpec| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
674 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
675 |
((aClass class implements: #helpSpec) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
676 |
and: [(helpSpecSuperClass := aClass allSuperclasses detect: [:cls| cls class implements: #helpSpec] ifNone: nil) notNil]) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
677 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
678 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
679 |
superHelpSpecKeys := helpSpecSuperClass helpSpec keys. |
700 | 680 |
helpSpec := Dictionary new. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
681 |
aClass helpSpec associationsDo: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
682 |
[:asso| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
683 |
(superHelpSpecKeys includes: asso key) ifFalse: [helpSpec at: asso key put: asso value] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
684 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
685 |
^dictionary := helpSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
686 |
]. |
700 | 687 |
^dictionary := Dictionary new |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
688 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
689 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
690 |
findHelpSpecForKey: aHelpKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
691 |
"update list from dictionary |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
692 |
" |
700 | 693 |
|dictTemp helpSpecClass superHelpSpecKeys helpSpec| |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
694 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
695 |
aHelpKey isNil ifTrue: [^nil]. |
700 | 696 |
dictTemp := dictionary. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
697 |
self listOfHelpSpecClasses value do: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
698 |
[:clsName| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
699 |
(dictionary := dictionaries at: clsName ifAbsent: nil) isNil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
700 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
701 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
702 |
dictionary := dictionaries at: clsName put: (self extractHelpSpecForClass: (Smalltalk at: clsName)) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
703 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
704 |
(dictionary includesKey: aHelpKey asSymbol) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
705 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
706 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
707 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
708 |
^(builder componentAt: #listOfHelpSpecClassesView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
709 |
(self listOfHelpSpecClasses value indexOf: clsName). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
710 |
] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
711 |
]. |
700 | 712 |
dictionary := dictTemp |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
713 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
714 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
715 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
716 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
717 |
updateList |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
718 |
"update list from dictionary |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
719 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
720 |
self listChannel value: dictionary keys asSortedCollection |
286 | 721 |
! ! |
722 |
||
335 | 723 |
!UIHelpTool methodsFor:'queries'! |
724 |
||
725 |
applicationClassAssociatedWith:aClass |
|
726 |
"get application class keeping the associated help text or nil |
|
727 |
" |
|
728 |
|cls| |
|
729 |
||
730 |
cls := self resolveName:aClass. |
|
731 |
||
732 |
(cls notNil and:[cls includesBehavior:UISpecification]) ifTrue:[ |
|
733 |
^ UISpecificationTool |
|
734 |
]. |
|
735 |
^ cls |
|
736 |
||
737 |
||
738 |
! ! |
|
739 |
||
286 | 740 |
!UIHelpTool methodsFor:'selection'! |
741 |
||
742 |
listSelection |
|
743 |
"returns current selection |
|
744 |
" |
|
745 |
^ listSelection |
|
746 |
! |
|
747 |
||
748 |
listSelection:aSelection |
|
749 |
"current selection changed |
|
750 |
" |
|
299 | 751 |
|txt view sel| |
286 | 752 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
753 |
aSelection isNil ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: nil]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
754 |
self findHelpSpecForKey: aSelection. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
755 |
|
286 | 756 |
aSelection isNumber ifTrue:[ |
757 |
aSelection ~~ 0 ifTrue:[ |
|
758 |
sel := self listChannel value at:aSelection |
|
759 |
] |
|
760 |
] ifFalse:[ |
|
761 |
aSelection size ~~ 0 ifTrue:[ |
|
762 |
sel := aSelection withoutSeparators. |
|
763 |
sel size == 0 ifTrue:[ |
|
764 |
sel := nil |
|
765 |
] |
|
766 |
] |
|
767 |
]. |
|
768 |
||
299 | 769 |
listSelection = sel ifFalse:[ |
770 |
listSelection := sel. |
|
286 | 771 |
|
299 | 772 |
modifiedHolder notNil ifTrue:[ |
773 |
modifiedHolder value:true. |
|
774 |
]. |
|
286 | 775 |
|
299 | 776 |
(view := self editTextView) notNil ifTrue:[ |
777 |
listSelection notNil ifTrue:[ |
|
778 |
txt := dictionary at:(listSelection asSymbol) ifAbsent:nil. |
|
286 | 779 |
|
299 | 780 |
(txt isNil or:[maxCharsPerLine isNil]) ifFalse:[ |
369 | 781 |
txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine skipLineFeed:false. |
286 | 782 |
] |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
783 |
]. |
459 | 784 |
view contents:txt. |
785 |
view modified:false. |
|
299 | 786 |
] |
787 |
] |
|
286 | 788 |
|
789 |
! ! |
|
790 |
||
369 | 791 |
!UIHelpTool methodsFor:'startup / release'! |
792 |
||
793 |
closeRequest |
|
794 |
||
795 |
(isModified and:[self masterApplication isNil]) ifTrue:[ |
|
459 | 796 |
(self confirm:'Exit without saving your modifications?') ifFalse:[ |
369 | 797 |
^ self |
798 |
] |
|
799 |
]. |
|
800 |
^ super closeRequest. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
801 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
802 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
803 |
openInterface:aSymbol |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
804 |
"open interface |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
805 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
806 |
super openInterface: #windowSpecForStandAlone |
369 | 807 |
! ! |
808 |
||
286 | 809 |
!UIHelpTool methodsFor:'user interactions'! |
810 |
||
811 |
doFromClass |
|
812 |
"setup new specification from a class accessed through to a dialog |
|
813 |
" |
|
701 | 814 |
|cls cls2 accepted| |
286 | 815 |
|
816 |
specClass notNil ifTrue:[cls := specClass name asValue] |
|
817 |
ifFalse:[cls := '' asValue]. |
|
818 |
||
819 |
[true] whileTrue:[ |
|
820 |
accepted := |
|
821 |
(DialogBox new |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
822 |
addTextLabel:'Class name:'; |
286 | 823 |
addInputFieldOn:cls; |
824 |
addAbortButton; |
|
825 |
addOkButton; |
|
826 |
open |
|
827 |
) accepted. |
|
828 |
accepted ifFalse:[^ self]. |
|
701 | 829 |
cls2 := self applicationClassAssociatedWith:cls value. |
286 | 830 |
|
701 | 831 |
(cls2 notNil and: [cls2 respondsTo: #helpSpec]) ifTrue:[ |
832 |
^ self helpSpecFrom:cls2 |
|
286 | 833 |
]. |
701 | 834 |
self warn:'No help spec found in class ', cls value asBoldText, '!!'. |
286 | 835 |
] |
836 |
! |
|
837 |
||
838 |
doInstallHelpSpec |
|
839 |
"install help spec |
|
840 |
" |
|
841 |
self installHelpSpecInto:specClass |
|
842 |
! |
|
843 |
||
844 |
doReload |
|
845 |
"reload specification |
|
846 |
" |
|
847 |
|oldSel model| |
|
848 |
||
849 |
model := self listModel. |
|
850 |
oldSel := model value. |
|
851 |
model value:nil. |
|
852 |
self helpSpecFrom:specClass. |
|
853 |
model value:oldSel. |
|
369 | 854 |
isModified := false. |
855 |
||
148 | 856 |
! ! |
857 |
||
858 |
!UIHelpTool class methodsFor:'documentation'! |
|
859 |
||
860 |
version |
|
861 |
^ '$Header$' |
|
862 |
! ! |