author | tz |
Thu, 05 Mar 1998 17:24:21 +0100 | |
changeset 698 | 5bf234e0e451 |
parent 696 | e91402372900 |
child 700 | 2aae4f3b6526 |
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' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
130 |
#layout: #(#LayoutFrame 59 0 376 0 344 0 646 0) |
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) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
134 |
#bounds: #(#Rectangle 59 376 345 647) |
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 |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
149 |
#useIndex: false |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
150 |
#sequenceList: #listChannel |
286 | 151 |
) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
152 |
#(#HorizontalPanelViewSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
153 |
#name: 'HorizontalPanelView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
154 |
#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
|
155 |
#component: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
156 |
#(#SpecCollection |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
157 |
#collection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
158 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
159 |
#(#ActionButtonSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
160 |
#name: 'AddButton' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
161 |
#activeHelpKey: #addHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
162 |
#label: 'Add' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
163 |
#model: #accept |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
164 |
#extent: #(#Point 44 24) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
165 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
166 |
#(#ActionButtonSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
167 |
#name: 'RemoveButton' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
168 |
#activeHelpKey: #removeHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
169 |
#label: 'Remove' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
170 |
#model: #remove |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
171 |
#extent: #(#Point 44 24) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
172 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
173 |
#(#ActionButtonSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
174 |
#name: 'DeleteButton' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
175 |
#activeHelpKey: #deleteHelpTextKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
176 |
#label: 'Delete' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
177 |
#model: #delete |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
178 |
#extent: #(#Point 45 24) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
179 |
) |
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 |
#horizontalLayout: #fit |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
183 |
#verticalLayout: #fit |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
184 |
#horizontalSpace: 3 |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
185 |
#verticalSpace: 3 |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
186 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
187 |
#(#InputFieldSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
188 |
#name: 'helpKeyInputField' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
189 |
#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
|
190 |
#activeHelpKey: #currentHelpTexts |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
191 |
#model: #listModel |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
192 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
193 |
#(#SequenceViewSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
194 |
#name: 'listOfHelpSpecClassesView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
195 |
#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
|
196 |
#activeHelpKey: #listOfHelpSpecClasses |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
197 |
#model: #selectionOfHelpSpecClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
198 |
#hasHorizontalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
199 |
#hasVerticalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
200 |
#valueChangeSelector: #helpSpecClassSelected |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
201 |
#useIndex: false |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
202 |
#sequenceList: #listOfHelpSpecClasses |
286 | 203 |
) |
148 | 204 |
#(#TextEditorSpec |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
205 |
#name: 'helpTextView' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
206 |
#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
|
207 |
#activeHelpKey: #helpTextView |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
208 |
#hasHorizontalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
209 |
#hasVerticalScrollBar: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
210 |
#miniScrollerHorizontal: true |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
211 |
#miniScrollerVertical: true |
148 | 212 |
) |
213 |
) |
|
214 |
) |
|
215 |
) |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
216 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
217 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
218 |
windowSpecForStandAlone |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
219 |
"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
|
220 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
221 |
"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
|
222 |
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
|
223 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
224 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
225 |
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
|
226 |
UIHelpTool new openInterface:#windowSpecForStandAlone |
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 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
229 |
<resource: #canvas> |
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 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
233 |
#(#FullSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
234 |
#window: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
235 |
#(#WindowSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
236 |
#name: 'Help Tool' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
237 |
#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
|
238 |
#label: 'Help Tool' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
239 |
#min: #(#Point 10 10) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
240 |
#max: #(#Point 1160 870) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
241 |
#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
|
242 |
#menu: #menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
243 |
#usePreferredExtent: false |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
244 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
245 |
#component: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
246 |
#(#SpecCollection |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
247 |
#collection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
248 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
249 |
#(#UISubSpecification |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
250 |
#name: 'UISubSpecification1' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
251 |
#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
|
252 |
#minorKey: #windowSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
253 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
254 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
255 |
) |
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 |
!UIHelpTool class methodsFor:'menu specs'! |
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 |
menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
262 |
"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
|
263 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
264 |
"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
|
265 |
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
|
266 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
267 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
268 |
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
|
269 |
(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
|
270 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
271 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
272 |
<resource: #menu> |
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 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
276 |
#(#Menu |
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 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
280 |
#label: 'File' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
281 |
#submenu: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
282 |
#(#Menu |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
283 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
284 |
#( |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
285 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
286 |
#label: 'Reload' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
287 |
#value: #doReload |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
288 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
289 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
290 |
#label: '-' |
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: 'Save' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
294 |
#value: #doInstallHelpSpec |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
295 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
296 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
297 |
#label: '-' |
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: 'Define Class...' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
301 |
#value: #doFromClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
302 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
303 |
#(#MenuItem |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
304 |
#label: '-' |
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: 'Exit' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
308 |
#value: #closeRequest |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
309 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
310 |
) nil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
311 |
nil |
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 |
) |
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 |
nil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
316 |
) |
148 | 317 |
! ! |
318 |
||
319 |
!UIHelpTool methodsFor:'accessing'! |
|
320 |
||
151 | 321 |
dictionary |
322 |
"return the value of the instance variable 'dictionary' (automatically generated)" |
|
323 |
||
324 |
^ dictionary! |
|
325 |
||
326 |
dictionary:aDictionary |
|
327 |
"set the value of the instance variable 'dictionary' (automatically generated)" |
|
328 |
||
286 | 329 |
(dictionary := aDictionary) isNil ifTrue:[ |
204 | 330 |
dictionary := IdentityDictionary new. |
286 | 331 |
]. |
332 |
self updateList |
|
333 |
! |
|
334 |
||
335 |
helpKey |
|
336 |
listSelection size ~~ 0 ifTrue:[ |
|
337 |
^ listSelection asSymbol |
|
151 | 338 |
]. |
286 | 339 |
^ nil |
340 |
! |
|
341 |
||
342 |
helpKey:aKey |
|
343 |
|key| |
|
344 |
||
345 |
aKey size ~~ 0 ifTrue:[ |
|
346 |
key := aKey asString |
|
347 |
]. |
|
348 |
self listModel value:key |
|
459 | 349 |
|
151 | 350 |
! |
351 |
||
196 | 352 |
helpSpecFrom:aClass |
353 |
"read help text from an application associated with the class |
|
354 |
" |
|
286 | 355 |
|help| |
356 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
357 |
isModified := false. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
358 |
dictionary := IdentityDictionary new. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
359 |
dictionaries := IdentityDictionary new. |
369 | 360 |
specClass := self applicationClassAssociatedWith:aClass. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
361 |
specClass isClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
362 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
363 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
364 |
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
|
365 |
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
|
366 |
self selectionOfHelpSpecClass value: specClass name. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
367 |
(builder componentAt: #listOfHelpSpecClassesView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
368 |
(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
|
369 |
self helpSpecClassSelected. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
370 |
]. |
286 | 371 |
(specClass respondsTo:#helpSpec) ifTrue:[ |
372 |
help := specClass helpSpec |
|
373 |
] ifFalse:[ |
|
374 |
specClass := nil |
|
196 | 375 |
]. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
376 |
self updateList |
196 | 377 |
! |
378 |
||
286 | 379 |
modifiedHolder:aValueHolder |
380 |
"set the value holder set to true in case of modifying attributes |
|
148 | 381 |
" |
286 | 382 |
modifiedHolder notNil ifTrue:[ |
383 |
modifiedHolder removeDependent:self. |
|
384 |
]. |
|
148 | 385 |
|
286 | 386 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
387 |
modifiedHolder addDependent:self. |
|
459 | 388 |
|
389 |
self editTextView notNil ifTrue: [ |
|
390 |
self editTextView modifiedChannel onChangeSend:#value to:[ |
|
391 |
modifiedHolder notNil ifTrue:[ |
|
392 |
self editTextView modifiedChannel value ifTrue:[ |
|
393 |
modifiedHolder value:true |
|
394 |
] |
|
395 |
] |
|
396 |
] |
|
397 |
] |
|
398 |
] |
|
286 | 399 |
|
400 |
||
354 | 401 |
! ! |
402 |
||
148 | 403 |
!UIHelpTool methodsFor:'actions'! |
404 |
||
405 |
accept |
|
406 |
"accept the text |
|
407 |
" |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
408 |
|view key txt list listChgd| |
148 | 409 |
|
286 | 410 |
(listSelection size == 0 or:[(view := self editTextView) isNil]) ifFalse:[ |
393 | 411 |
txt := view contents asString. |
412 |
key := listSelection asSymbol. |
|
413 |
list := self listChannel value. |
|
148 | 414 |
|
393 | 415 |
(listChgd := (dictionary at:key ifAbsent:nil) isNil) ifTrue:[ |
148 | 416 |
list add:key. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
417 |
]. |
369 | 418 |
dictionary at:key put:txt. |
393 | 419 |
|
420 |
listChgd ifTrue:[ |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
421 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
422 |
(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
|
423 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
424 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
425 |
isModified := true. |
479 | 426 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
148 | 427 |
] |
196 | 428 |
! |
429 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
430 |
delete |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
431 |
"delete selected help key |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
432 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
433 |
listSelection notNil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
434 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
435 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
436 |
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
|
437 |
self remove. |
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 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
440 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
441 |
isModified := true. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
442 |
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
|
443 |
] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
444 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
445 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
446 |
helpSpecClassSelected |
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 |
|clsName| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
449 |
clsName := self selectionOfHelpSpecClass value. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
450 |
(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
|
451 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
452 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
453 |
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
|
454 |
]. |
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 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
457 |
listSelection notNil |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
458 |
ifTrue: [(dictionary keys includes: listSelection asSymbol) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
459 |
ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
460 |
(self listChannel value indexOf: (builder componentAt: #helpKeyInputField) contents)] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
461 |
ifFalse: [(builder componentAt: #listOfHelpKeysView) selection: nil]]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
462 |
self editTextView contents: '' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
463 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
464 |
|
196 | 465 |
installHelpSpecInto:aClass |
466 |
"install help text |
|
467 |
" |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
468 |
|cls src superHelpSpecKeys helpSpec mayRemoveHelpSpecSelector| |
196 | 469 |
|
335 | 470 |
cls := self applicationClassAssociatedWith:aClass. |
196 | 471 |
|
472 |
cls isNil ifTrue:[ |
|
465 | 473 |
^ self information:'No application class defined!!'. |
196 | 474 |
]. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
475 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
476 |
aClass == cls name |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
477 |
ifTrue: [cls allSuperclasses value do: [:c| self installHelpSpecInto:c]. isModified := true]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
478 |
|
478 | 479 |
isModified not ifTrue:[ |
465 | 480 |
^nil |
196 | 481 |
]. |
456 | 482 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
483 |
(cls superclass respondsTo: #helpSpec) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
484 |
ifTrue: [superHelpSpecKeys := cls superclass helpSpec keys. mayRemoveHelpSpecSelector := true] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
485 |
ifFalse: [superHelpSpecKeys := IdentityDictionary new. mayRemoveHelpSpecSelector := false]. |
479 | 486 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
487 |
helpSpec := dictionaries at: cls name ifAbsent: [^nil]. |
479 | 488 |
helpSpec isEmpty ifTrue:[ |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
489 |
mayRemoveHelpSpecSelector ifTrue: [cls class removeSelector: #helpSpec]. |
478 | 490 |
^nil |
491 |
]. |
|
456 | 492 |
|
196 | 493 |
src := '' writeStream. |
494 |
||
495 |
src nextPutAll: |
|
496 |
||
497 |
'helpSpec |
|
498 |
"return a dictionary filled with helpKey -> helptext associations. |
|
292 | 499 |
These are used by the activeHelp tool." |
500 |
||
196 | 501 |
" |
292 | 502 |
UIHelpTool openOnClass:', cls name asString ,' |
503 |
" |
|
504 |
||
196 | 505 |
^ super helpSpec addPairsFrom:#( |
506 |
||
507 |
'. |
|
508 |
||
479 | 509 |
helpSpec keys asSortedCollection |
456 | 510 |
do:[:key | |
354 | 511 |
|txt t| |
512 |
||
479 | 513 |
txt := helpSpec at:key. |
196 | 514 |
src nextPutLine:key storeString. |
515 |
||
319
f16aa0e8541e
dont crash with nonexisting bitmaps
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
516 |
t := txt asString replaceAll:(Character cr) with:(Character space). |
286 | 517 |
|
518 |
(t endsWith:Character space) ifTrue:[ |
|
196 | 519 |
t := t copyWithoutLast:1 |
520 |
]. |
|
521 |
src nextPutLine:t storeString; cr. |
|
522 |
]. |
|
523 |
src nextPutLine:')'. |
|
524 |
||
525 |
Compiler compile:(src contents) |
|
526 |
forClass:cls class |
|
369 | 527 |
inCategory:'help specs'. |
196 | 528 |
|
369 | 529 |
isModified := false. |
530 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
531 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
532 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
533 |
remove |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
534 |
"remove selected help key |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
535 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
536 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
537 |
self listModel value: nil. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
538 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
539 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
540 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
541 |
modifiedHolder notNil ifTrue: [modifiedHolder value:true] |
148 | 542 |
! ! |
543 |
||
544 |
!UIHelpTool methodsFor:'aspects'! |
|
545 |
||
546 |
listChannel |
|
547 |
||
548 |
|holder| |
|
549 |
||
550 |
(holder := builder bindingAt:#listChannel) isNil ifTrue:[ |
|
354 | 551 |
builder aspectAt:#listChannel put:(holder := OrderedCollection new asValue). |
148 | 552 |
]. |
553 |
^ holder |
|
554 |
! |
|
555 |
||
286 | 556 |
listModel |
148 | 557 |
|
558 |
|holder| |
|
559 |
||
286 | 560 |
(holder := builder bindingAt:#listModel) isNil ifTrue:[ |
561 |
holder := AspectAdaptor new subject:self; forAspect:#listSelection. |
|
562 |
builder aspectAt:#listModel put:holder. |
|
148 | 563 |
]. |
564 |
^ holder |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
565 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
566 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
567 |
listOfHelpSpecClasses |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
568 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
569 |
|holder| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
570 |
(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
|
571 |
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
|
572 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
573 |
^ holder |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
574 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
575 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
576 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
577 |
selectionOfHelpSpecClass |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
578 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
579 |
|holder| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
580 |
(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
|
581 |
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
|
582 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
583 |
^ holder |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
584 |
|
148 | 585 |
! ! |
586 |
||
587 |
!UIHelpTool methodsFor:'initialization'! |
|
588 |
||
589 |
initialize |
|
590 |
"setup instance attributes |
|
591 |
" |
|
592 |
super initialize. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
593 |
dictionary := IdentityDictionary new. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
594 |
dictionaries := IdentityDictionary new. |
369 | 595 |
isModified := false. |
596 |
||
286 | 597 |
! ! |
598 |
||
599 |
!UIHelpTool methodsFor:'private'! |
|
600 |
||
601 |
editTextView |
|
602 |
"get the editTextView or nil. |
|
603 |
" |
|
604 |
|view| |
|
605 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
606 |
(view := builder componentAt:#helpTextView) notNil ifTrue:[ |
286 | 607 |
view := view scrolledView. |
608 |
||
609 |
view acceptAction isNil ifTrue:[ |
|
610 |
view acceptAction:[:aList| self accept ]. |
|
611 |
]. |
|
612 |
||
613 |
view left ~~ 0 ifTrue:[ |
|
614 |
(maxCharsPerLine := view extent x // view font width) < 10 ifTrue:[ |
|
615 |
maxCharsPerLine := nil |
|
616 |
] |
|
617 |
]. |
|
454 | 618 |
]. |
286 | 619 |
^ view |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
620 |
! |
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 |
extractHelpSpecForClass: aClass |
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 |
|helpSpecSuperClass superHelpSpecKeys helpSpec| |
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 |
((aClass class implements: #helpSpec) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
627 |
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
|
628 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
629 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
630 |
superHelpSpecKeys := helpSpecSuperClass helpSpec keys. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
631 |
helpSpec := IdentityDictionary new. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
632 |
aClass helpSpec associationsDo: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
633 |
[:asso| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
634 |
(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
|
635 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
636 |
^dictionary := helpSpec |
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 |
^dictionary := IdentityDictionary new |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
639 |
! |
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 |
findHelpSpecForKey: aHelpKey |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
642 |
"update list from dictionary |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
643 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
644 |
|helpSpecClass superHelpSpecKeys helpSpec| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
645 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
646 |
aHelpKey isNil ifTrue: [^nil]. |
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 |
self listOfHelpSpecClasses value do: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
649 |
[:clsName| |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
650 |
(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
|
651 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
652 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
653 |
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
|
654 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
655 |
(dictionary includesKey: aHelpKey asSymbol) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
656 |
ifTrue: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
657 |
[ |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
658 |
self updateList. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
659 |
^(builder componentAt: #listOfHelpSpecClassesView) selection: |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
660 |
(self listOfHelpSpecClasses value indexOf: clsName). |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
661 |
] |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
662 |
]. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
663 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
664 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
665 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
666 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
667 |
updateList |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
668 |
"update list from dictionary |
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 |
self listChannel value: dictionary keys asSortedCollection |
286 | 671 |
! ! |
672 |
||
335 | 673 |
!UIHelpTool methodsFor:'queries'! |
674 |
||
675 |
applicationClassAssociatedWith:aClass |
|
676 |
"get application class keeping the associated help text or nil |
|
677 |
" |
|
678 |
|cls| |
|
679 |
||
680 |
cls := self resolveName:aClass. |
|
681 |
||
682 |
(cls notNil and:[cls includesBehavior:UISpecification]) ifTrue:[ |
|
683 |
^ UISpecificationTool |
|
684 |
]. |
|
685 |
^ cls |
|
686 |
||
687 |
||
369 | 688 |
! |
689 |
||
690 |
isModified |
|
691 |
^ isModified |
|
335 | 692 |
! ! |
693 |
||
286 | 694 |
!UIHelpTool methodsFor:'selection'! |
695 |
||
696 |
listSelection |
|
697 |
"returns current selection |
|
698 |
" |
|
699 |
^ listSelection |
|
700 |
! |
|
701 |
||
702 |
listSelection:aSelection |
|
703 |
"current selection changed |
|
704 |
" |
|
299 | 705 |
|txt view sel| |
286 | 706 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
707 |
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
|
708 |
self findHelpSpecForKey: aSelection. |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
709 |
|
286 | 710 |
aSelection isNumber ifTrue:[ |
711 |
aSelection ~~ 0 ifTrue:[ |
|
712 |
sel := self listChannel value at:aSelection |
|
713 |
] |
|
714 |
] ifFalse:[ |
|
715 |
aSelection size ~~ 0 ifTrue:[ |
|
716 |
sel := aSelection withoutSeparators. |
|
717 |
sel size == 0 ifTrue:[ |
|
718 |
sel := nil |
|
719 |
] |
|
720 |
] |
|
721 |
]. |
|
722 |
||
299 | 723 |
listSelection = sel ifFalse:[ |
724 |
listSelection := sel. |
|
286 | 725 |
|
299 | 726 |
modifiedHolder notNil ifTrue:[ |
727 |
modifiedHolder value:true. |
|
728 |
]. |
|
286 | 729 |
|
299 | 730 |
(view := self editTextView) notNil ifTrue:[ |
731 |
listSelection notNil ifTrue:[ |
|
732 |
txt := dictionary at:(listSelection asSymbol) ifAbsent:nil. |
|
286 | 733 |
|
299 | 734 |
(txt isNil or:[maxCharsPerLine isNil]) ifFalse:[ |
369 | 735 |
txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine skipLineFeed:false. |
286 | 736 |
] |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
737 |
]. |
459 | 738 |
view contents:txt. |
739 |
view modified:false. |
|
299 | 740 |
] |
741 |
] |
|
286 | 742 |
|
743 |
! ! |
|
744 |
||
369 | 745 |
!UIHelpTool methodsFor:'startup / release'! |
746 |
||
747 |
closeRequest |
|
748 |
||
749 |
(isModified and:[self masterApplication isNil]) ifTrue:[ |
|
459 | 750 |
(self confirm:'Exit without saving your modifications?') ifFalse:[ |
369 | 751 |
^ self |
752 |
] |
|
753 |
]. |
|
754 |
^ super closeRequest. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
755 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
756 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
757 |
openInterface:aSymbol |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
758 |
"open interface |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
759 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
760 |
super openInterface: #windowSpecForStandAlone |
369 | 761 |
! ! |
762 |
||
286 | 763 |
!UIHelpTool methodsFor:'user interactions'! |
764 |
||
765 |
doFromClass |
|
766 |
"setup new specification from a class accessed through to a dialog |
|
767 |
" |
|
768 |
|cls accepted| |
|
769 |
||
770 |
specClass notNil ifTrue:[cls := specClass name asValue] |
|
771 |
ifFalse:[cls := '' asValue]. |
|
772 |
||
773 |
[true] whileTrue:[ |
|
774 |
accepted := |
|
775 |
(DialogBox new |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
776 |
addTextLabel:'Class name:'; |
286 | 777 |
addInputFieldOn:cls; |
778 |
addAbortButton; |
|
779 |
addOkButton; |
|
780 |
open |
|
781 |
) accepted. |
|
782 |
||
783 |
accepted ifFalse:[^ self]. |
|
335 | 784 |
cls := self applicationClassAssociatedWith:cls value. |
286 | 785 |
|
786 |
cls notNil ifTrue:[ |
|
787 |
^ self helpSpecFrom:cls |
|
788 |
]. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
789 |
self warn:'No such class!!'. |
286 | 790 |
] |
791 |
! |
|
792 |
||
793 |
doInstallHelpSpec |
|
794 |
"install help spec |
|
795 |
" |
|
796 |
self installHelpSpecInto:specClass |
|
797 |
! |
|
798 |
||
799 |
doReload |
|
800 |
"reload specification |
|
801 |
" |
|
802 |
|oldSel model| |
|
803 |
||
804 |
model := self listModel. |
|
805 |
oldSel := model value. |
|
806 |
model value:nil. |
|
807 |
self helpSpecFrom:specClass. |
|
808 |
model value:oldSel. |
|
369 | 809 |
isModified := false. |
810 |
||
148 | 811 |
! ! |
812 |
||
813 |
!UIHelpTool class methodsFor:'documentation'! |
|
814 |
||
815 |
version |
|
816 |
^ '$Header$' |
|
817 |
! ! |