author | tz |
Mon, 09 Mar 1998 21:45:36 +0100 | |
changeset 715 | 7eebac822985 |
parent 710 | 8c968790c885 |
child 717 | fb90f37268be |
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 |
||
710 | 324 |
dictionaries |
325 |
"return dictionaries" |
|
326 |
||
327 |
^dictionaries |
|
328 |
! |
|
329 |
||
330 |
dictionaries:aDictionaryOfDictionaries |
|
331 |
"set dictionaries" |
|
332 |
||
333 |
(dictionaries := aDictionaryOfDictionaries) isNil ifTrue:[ |
|
334 |
dictionaries := Dictionary new. |
|
335 |
]. |
|
715 | 336 |
self updateList. |
710 | 337 |
! |
338 |
||
151 | 339 |
dictionary |
710 | 340 |
"return dictionary" |
151 | 341 |
|
710 | 342 |
^ dictionary |
343 |
! |
|
151 | 344 |
|
345 |
dictionary:aDictionary |
|
710 | 346 |
"set dictionary" |
151 | 347 |
|
286 | 348 |
(dictionary := aDictionary) isNil ifTrue:[ |
700 | 349 |
dictionary := Dictionary new. |
286 | 350 |
]. |
351 |
self updateList |
|
352 |
! |
|
353 |
||
354 |
helpKey |
|
355 |
listSelection size ~~ 0 ifTrue:[ |
|
356 |
^ listSelection asSymbol |
|
151 | 357 |
]. |
286 | 358 |
^ nil |
359 |
! |
|
360 |
||
361 |
helpKey:aKey |
|
362 |
|key| |
|
363 |
||
364 |
aKey size ~~ 0 ifTrue:[ |
|
365 |
key := aKey asString |
|
366 |
]. |
|
367 |
self listModel value:key |
|
459 | 368 |
|
151 | 369 |
! |
370 |
||
196 | 371 |
helpSpecFrom:aClass |
372 |
"read help text from an application associated with the class |
|
373 |
" |
|
286 | 374 |
|help| |
375 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
376 |
isModified := false. |
700 | 377 |
specClass notNil |
378 |
ifTrue: |
|
379 |
[ |
|
380 |
dictionary := Dictionary new. |
|
381 |
dictionaries := Dictionary new. |
|
382 |
]. |
|
369 | 383 |
specClass := self applicationClassAssociatedWith:aClass. |
700 | 384 |
(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
|
385 |
ifTrue: |
700 | 386 |
[ |
387 |
(specClass class implements:#helpSpec) ifFalse:[ |
|
388 |
dictionaries at: specClass name put: dictionary |
|
389 |
]. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
390 |
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
|
391 |
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
|
392 |
self selectionOfHelpSpecClass value: specClass name. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
393 |
(builder componentAt: #listOfHelpSpecClassesView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
394 |
(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
|
395 |
self helpSpecClassSelected. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
396 |
]. |
700 | 397 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
398 |
self updateList |
196 | 399 |
! |
400 |
||
700 | 401 |
isModified |
402 |
^ isModified |
|
403 |
! |
|
404 |
||
405 |
isModified: aBoolean |
|
406 |
||
407 |
isModified := aBoolean |
|
408 |
! |
|
409 |
||
286 | 410 |
modifiedHolder:aValueHolder |
411 |
"set the value holder set to true in case of modifying attributes |
|
148 | 412 |
" |
286 | 413 |
modifiedHolder notNil ifTrue:[ |
414 |
modifiedHolder removeDependent:self. |
|
415 |
]. |
|
148 | 416 |
|
286 | 417 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
418 |
modifiedHolder addDependent:self. |
|
459 | 419 |
|
420 |
self editTextView notNil ifTrue: [ |
|
421 |
self editTextView modifiedChannel onChangeSend:#value to:[ |
|
422 |
modifiedHolder notNil ifTrue:[ |
|
423 |
self editTextView modifiedChannel value ifTrue:[ |
|
424 |
modifiedHolder value:true |
|
425 |
] |
|
426 |
] |
|
427 |
] |
|
428 |
] |
|
429 |
] |
|
286 | 430 |
|
431 |
||
715 | 432 |
! |
433 |
||
434 |
specClass |
|
435 |
||
436 |
^specClass |
|
354 | 437 |
! ! |
438 |
||
148 | 439 |
!UIHelpTool methodsFor:'actions'! |
440 |
||
441 |
accept |
|
442 |
"accept the text |
|
443 |
" |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
444 |
|view key txt list listChgd| |
148 | 445 |
|
286 | 446 |
(listSelection size == 0 or:[(view := self editTextView) isNil]) ifFalse:[ |
393 | 447 |
txt := view contents asString. |
448 |
key := listSelection asSymbol. |
|
449 |
list := self listChannel value. |
|
148 | 450 |
|
393 | 451 |
(listChgd := (dictionary at:key ifAbsent:nil) isNil) ifTrue:[ |
148 | 452 |
list add:key. |
700 | 453 |
]. |
369 | 454 |
dictionary at:key put:txt. |
393 | 455 |
|
456 |
listChgd ifTrue:[ |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
457 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
458 |
(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
|
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 |
isModified := true. |
479 | 462 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
148 | 463 |
] |
196 | 464 |
! |
465 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
466 |
delete |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
467 |
"delete selected help key |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
468 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
469 |
listSelection notNil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
470 |
ifTrue: |
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 |
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
|
473 |
self remove. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
474 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
475 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
476 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
477 |
isModified := true. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
478 |
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
|
479 |
] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
480 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
481 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
482 |
helpSpecClassSelected |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
483 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
484 |
|clsName| |
700 | 485 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
486 |
clsName := self selectionOfHelpSpecClass value. |
700 | 487 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
488 |
(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
|
489 |
ifTrue: |
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 |
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
|
492 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
493 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
494 |
self updateList. |
700 | 495 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
496 |
listSelection notNil |
700 | 497 |
ifTrue: |
498 |
[ |
|
499 |
(dictionary keys includes: listSelection asSymbol) |
|
500 |
ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: |
|
501 |
(self listChannel value indexOf: (builder componentAt: #helpKeyInputField) contents)] |
|
502 |
ifFalse: [(builder componentAt: #listOfHelpKeysView) selection: nil]. |
|
503 |
]. |
|
504 |
listSelection notNil |
|
505 |
ifTrue: |
|
506 |
[ |
|
507 |
self editTextView contents: (dictionary at: listSelection asSymbol ifAbsent: '') |
|
508 |
] |
|
509 |
||
510 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
511 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
512 |
|
196 | 513 |
installHelpSpecInto:aClass |
514 |
"install help text |
|
515 |
" |
|
700 | 516 |
|cls src helpSpec| |
196 | 517 |
|
335 | 518 |
cls := self applicationClassAssociatedWith:aClass. |
196 | 519 |
|
520 |
cls isNil ifTrue:[ |
|
465 | 521 |
^ self information:'No application class defined!!'. |
196 | 522 |
]. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
523 |
|
700 | 524 |
aClass = cls name asString |
715 | 525 |
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
|
526 |
|
478 | 527 |
isModified not ifTrue:[ |
465 | 528 |
^nil |
196 | 529 |
]. |
456 | 530 |
|
704 | 531 |
helpSpec := dictionaries at: cls name |
532 |
ifAbsent: [aClass = cls name asString ifTrue: [dictionary] ifFalse: [Dictionary new]]. |
|
700 | 533 |
|
534 |
(cls class implements: #helpSpec) |
|
535 |
ifTrue: |
|
536 |
[ |
|
537 |
|superclassHelpKeys implementedHelpSpec hasChanged| |
|
538 |
implementedHelpSpec := Dictionary new. |
|
539 |
superclassHelpKeys := (cls superclass respondsTo: #helpSpec) |
|
540 |
ifTrue: [cls superclass helpSpec keys] |
|
541 |
ifFalse: [Array new]. |
|
542 |
||
543 |
cls helpSpec associationsDo: [:h| (superclassHelpKeys includes: h key) |
|
544 |
ifFalse: [implementedHelpSpec at: h key put: h value]]. |
|
479 | 545 |
|
700 | 546 |
hasChanged := false. |
547 |
implementedHelpSpec associationsDo: [:h| (helpSpec includesAssociation: h) ifFalse: [hasChanged := true]]. |
|
548 |
helpSpec associationsDo: [:h| (implementedHelpSpec includesAssociation: h) ifFalse: [hasChanged := true]]. |
|
549 |
||
550 |
(implementedHelpSpec notEmpty and: [hasChanged and: |
|
715 | 551 |
[DialogBox confirm: 'Class ', cls name asBoldText, ' already implements\a help spec!!\\Do only replace, if you have removed\help keys in an existing help spec.\' withCRs yesLabel: ' Merge ' noLabel: ' Replace ']]) |
700 | 552 |
ifTrue: |
553 |
[ |
|
710 | 554 |
implementedHelpSpec associationsDo: [:h| (helpSpec includesKey: h key) |
555 |
ifFalse: [helpSpec at: h key put: h value]]. |
|
700 | 556 |
] |
557 |
]. |
|
558 |
||
479 | 559 |
helpSpec isEmpty ifTrue:[ |
700 | 560 |
(cls superclass respondsTo: #helpSpec) ifTrue: [cls class removeSelector: #helpSpec]. |
478 | 561 |
^nil |
562 |
]. |
|
456 | 563 |
|
196 | 564 |
src := '' writeStream. |
565 |
||
566 |
src nextPutAll: |
|
567 |
||
568 |
'helpSpec |
|
569 |
"return a dictionary filled with helpKey -> helptext associations. |
|
292 | 570 |
These are used by the activeHelp tool." |
571 |
||
196 | 572 |
" |
292 | 573 |
UIHelpTool openOnClass:', cls name asString ,' |
574 |
" |
|
575 |
||
196 | 576 |
^ super helpSpec addPairsFrom:#( |
577 |
||
578 |
'. |
|
579 |
||
479 | 580 |
helpSpec keys asSortedCollection |
456 | 581 |
do:[:key | |
354 | 582 |
|txt t| |
583 |
||
479 | 584 |
txt := helpSpec at:key. |
196 | 585 |
src nextPutLine:key storeString. |
586 |
||
319
f16aa0e8541e
dont crash with nonexisting bitmaps
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
587 |
t := txt asString replaceAll:(Character cr) with:(Character space). |
286 | 588 |
|
589 |
(t endsWith:Character space) ifTrue:[ |
|
196 | 590 |
t := t copyWithoutLast:1 |
591 |
]. |
|
592 |
src nextPutLine:t storeString; cr. |
|
593 |
]. |
|
594 |
src nextPutLine:')'. |
|
595 |
||
596 |
Compiler compile:(src contents) |
|
597 |
forClass:cls class |
|
369 | 598 |
inCategory:'help specs'. |
196 | 599 |
|
369 | 600 |
isModified := false. |
601 |
||
700 | 602 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
603 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
604 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
605 |
remove |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
606 |
"remove selected help key |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
607 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
608 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
609 |
self listModel value: nil. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
610 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
611 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
612 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
613 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
148 | 614 |
! ! |
615 |
||
616 |
!UIHelpTool methodsFor:'aspects'! |
|
617 |
||
618 |
listChannel |
|
619 |
||
620 |
|holder| |
|
621 |
||
622 |
(holder := builder bindingAt:#listChannel) isNil ifTrue:[ |
|
354 | 623 |
builder aspectAt:#listChannel put:(holder := OrderedCollection new asValue). |
148 | 624 |
]. |
625 |
^ holder |
|
626 |
! |
|
627 |
||
286 | 628 |
listModel |
148 | 629 |
|
630 |
|holder| |
|
631 |
||
286 | 632 |
(holder := builder bindingAt:#listModel) isNil ifTrue:[ |
633 |
holder := AspectAdaptor new subject:self; forAspect:#listSelection. |
|
634 |
builder aspectAt:#listModel put:holder. |
|
148 | 635 |
]. |
636 |
^ holder |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
637 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
638 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
639 |
listOfHelpSpecClasses |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
640 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
641 |
|holder| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
642 |
(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
|
643 |
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
|
644 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
645 |
^ holder |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
646 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
647 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
648 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
649 |
selectionOfHelpSpecClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
650 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
651 |
|holder| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
652 |
(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
|
653 |
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
|
654 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
655 |
^ holder |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
656 |
|
148 | 657 |
! ! |
658 |
||
659 |
!UIHelpTool methodsFor:'initialization'! |
|
660 |
||
661 |
initialize |
|
662 |
"setup instance attributes |
|
663 |
" |
|
664 |
super initialize. |
|
700 | 665 |
dictionary := Dictionary new. |
666 |
dictionaries := Dictionary new. |
|
369 | 667 |
isModified := false. |
668 |
||
286 | 669 |
! ! |
670 |
||
671 |
!UIHelpTool methodsFor:'private'! |
|
672 |
||
673 |
editTextView |
|
674 |
"get the editTextView or nil. |
|
675 |
" |
|
676 |
|view| |
|
677 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
678 |
(view := builder componentAt:#helpTextView) notNil ifTrue:[ |
286 | 679 |
view := view scrolledView. |
680 |
||
681 |
view acceptAction isNil ifTrue:[ |
|
682 |
view acceptAction:[:aList| self accept ]. |
|
683 |
]. |
|
684 |
||
685 |
view left ~~ 0 ifTrue:[ |
|
686 |
(maxCharsPerLine := view extent x // view font width) < 10 ifTrue:[ |
|
687 |
maxCharsPerLine := nil |
|
688 |
] |
|
689 |
]. |
|
454 | 690 |
]. |
286 | 691 |
^ view |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
692 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
693 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
694 |
extractHelpSpecForClass: aClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
695 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
696 |
|helpSpecSuperClass superHelpSpecKeys helpSpec| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
697 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
698 |
((aClass class implements: #helpSpec) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
699 |
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
|
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 |
superHelpSpecKeys := helpSpecSuperClass helpSpec keys. |
700 | 703 |
helpSpec := Dictionary new. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
704 |
aClass helpSpec associationsDo: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
705 |
[:asso| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
706 |
(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
|
707 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
708 |
^dictionary := helpSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
709 |
]. |
700 | 710 |
^dictionary := Dictionary new |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
711 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
712 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
713 |
findHelpSpecForKey: aHelpKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
714 |
"update list from dictionary |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
715 |
" |
700 | 716 |
|dictTemp helpSpecClass superHelpSpecKeys helpSpec| |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
717 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
718 |
aHelpKey isNil ifTrue: [^nil]. |
700 | 719 |
dictTemp := dictionary. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
720 |
self listOfHelpSpecClasses value do: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
721 |
[:clsName| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
722 |
(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
|
723 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
724 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
725 |
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
|
726 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
727 |
(dictionary includesKey: aHelpKey asSymbol) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
728 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
729 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
730 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
731 |
^(builder componentAt: #listOfHelpSpecClassesView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
732 |
(self listOfHelpSpecClasses value indexOf: clsName). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
733 |
] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
734 |
]. |
700 | 735 |
dictionary := dictTemp |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
736 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
737 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
738 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
739 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
740 |
updateList |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
741 |
"update list from dictionary |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
742 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
743 |
self listChannel value: dictionary keys asSortedCollection |
286 | 744 |
! ! |
745 |
||
335 | 746 |
!UIHelpTool methodsFor:'queries'! |
747 |
||
748 |
applicationClassAssociatedWith:aClass |
|
749 |
"get application class keeping the associated help text or nil |
|
750 |
" |
|
751 |
|cls| |
|
752 |
||
753 |
cls := self resolveName:aClass. |
|
754 |
||
755 |
(cls notNil and:[cls includesBehavior:UISpecification]) ifTrue:[ |
|
756 |
^ UISpecificationTool |
|
757 |
]. |
|
758 |
^ cls |
|
759 |
||
760 |
||
761 |
! ! |
|
762 |
||
286 | 763 |
!UIHelpTool methodsFor:'selection'! |
764 |
||
765 |
listSelection |
|
766 |
"returns current selection |
|
767 |
" |
|
768 |
^ listSelection |
|
769 |
! |
|
770 |
||
771 |
listSelection:aSelection |
|
772 |
"current selection changed |
|
773 |
" |
|
299 | 774 |
|txt view sel| |
286 | 775 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
776 |
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
|
777 |
self findHelpSpecForKey: aSelection. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
778 |
|
286 | 779 |
aSelection isNumber ifTrue:[ |
780 |
aSelection ~~ 0 ifTrue:[ |
|
781 |
sel := self listChannel value at:aSelection |
|
782 |
] |
|
783 |
] ifFalse:[ |
|
784 |
aSelection size ~~ 0 ifTrue:[ |
|
785 |
sel := aSelection withoutSeparators. |
|
786 |
sel size == 0 ifTrue:[ |
|
787 |
sel := nil |
|
788 |
] |
|
789 |
] |
|
790 |
]. |
|
791 |
||
299 | 792 |
listSelection = sel ifFalse:[ |
793 |
listSelection := sel. |
|
286 | 794 |
|
299 | 795 |
modifiedHolder notNil ifTrue:[ |
796 |
modifiedHolder value:true. |
|
797 |
]. |
|
286 | 798 |
|
299 | 799 |
(view := self editTextView) notNil ifTrue:[ |
800 |
listSelection notNil ifTrue:[ |
|
801 |
txt := dictionary at:(listSelection asSymbol) ifAbsent:nil. |
|
286 | 802 |
|
299 | 803 |
(txt isNil or:[maxCharsPerLine isNil]) ifFalse:[ |
369 | 804 |
txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine skipLineFeed:false. |
286 | 805 |
] |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
806 |
]. |
459 | 807 |
view contents:txt. |
808 |
view modified:false. |
|
299 | 809 |
] |
810 |
] |
|
286 | 811 |
|
812 |
! ! |
|
813 |
||
369 | 814 |
!UIHelpTool methodsFor:'startup / release'! |
815 |
||
816 |
closeRequest |
|
817 |
||
818 |
(isModified and:[self masterApplication isNil]) ifTrue:[ |
|
459 | 819 |
(self confirm:'Exit without saving your modifications?') ifFalse:[ |
369 | 820 |
^ self |
821 |
] |
|
822 |
]. |
|
823 |
^ super closeRequest. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
824 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
825 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
826 |
openInterface:aSymbol |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
827 |
"open interface |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
828 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
829 |
super openInterface: #windowSpecForStandAlone |
369 | 830 |
! ! |
831 |
||
286 | 832 |
!UIHelpTool methodsFor:'user interactions'! |
833 |
||
834 |
doFromClass |
|
835 |
"setup new specification from a class accessed through to a dialog |
|
836 |
" |
|
701 | 837 |
|cls cls2 accepted| |
286 | 838 |
|
839 |
specClass notNil ifTrue:[cls := specClass name asValue] |
|
840 |
ifFalse:[cls := '' asValue]. |
|
841 |
||
842 |
[true] whileTrue:[ |
|
843 |
accepted := |
|
844 |
(DialogBox new |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
845 |
addTextLabel:'Class name:'; |
286 | 846 |
addInputFieldOn:cls; |
847 |
addAbortButton; |
|
848 |
addOkButton; |
|
849 |
open |
|
850 |
) accepted. |
|
851 |
accepted ifFalse:[^ self]. |
|
701 | 852 |
cls2 := self applicationClassAssociatedWith:cls value. |
286 | 853 |
|
701 | 854 |
(cls2 notNil and: [cls2 respondsTo: #helpSpec]) ifTrue:[ |
855 |
^ self helpSpecFrom:cls2 |
|
286 | 856 |
]. |
701 | 857 |
self warn:'No help spec found in class ', cls value asBoldText, '!!'. |
286 | 858 |
] |
859 |
! |
|
860 |
||
861 |
doInstallHelpSpec |
|
862 |
"install help spec |
|
863 |
" |
|
864 |
self installHelpSpecInto:specClass |
|
865 |
! |
|
866 |
||
867 |
doReload |
|
868 |
"reload specification |
|
869 |
" |
|
870 |
|oldSel model| |
|
871 |
||
872 |
model := self listModel. |
|
873 |
oldSel := model value. |
|
874 |
model value:nil. |
|
875 |
self helpSpecFrom:specClass. |
|
876 |
model value:oldSel. |
|
369 | 877 |
isModified := false. |
878 |
||
148 | 879 |
! ! |
880 |
||
881 |
!UIHelpTool class methodsFor:'documentation'! |
|
882 |
||
883 |
version |
|
884 |
^ '$Header$' |
|
885 |
! ! |