author | Stefan Vogel <sv@exept.de> |
Thu, 04 Dec 2003 12:50:44 +0100 | |
changeset 1772 | e33aee13defe |
parent 1737 | de6abd3c55d2 |
child 1775 | 695f10f213d1 |
permissions | -rw-r--r-- |
156 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
1669 | 3 |
All Rights Reserved |
156 | 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 |
||
1554
d5e4612bf7cf
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
1506
diff
changeset
|
13 |
"{ Package: 'stx:libtool2' }" |
d5e4612bf7cf
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
1506
diff
changeset
|
14 |
|
1772
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
15 |
ResourceSpecEditor subclass:#UIHelpTool |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
16 |
instanceVariableNames:'classItemList classItemModel keyItemModel helpTextView |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
17 |
modifiedHolder contentsModifiedChannel editModel' |
148 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
1669 | 23 |
HierarchicalItem subclass:#ClassItem |
24 |
instanceVariableNames:'theClass list modified' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:UIHelpTool |
|
28 |
! |
|
29 |
||
30 |
HierarchicalItem subclass:#KeyItem |
|
1681 | 31 |
instanceVariableNames:'helpKey helpText flyByText modified icon' |
1669 | 32 |
classVariableNames:'' |
33 |
poolDictionaries:'' |
|
34 |
privateIn:UIHelpTool |
|
35 |
! |
|
36 |
||
148 | 37 |
!UIHelpTool class methodsFor:'documentation'! |
38 |
||
156 | 39 |
copyright |
40 |
" |
|
41 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
1669 | 42 |
All Rights Reserved |
156 | 43 |
|
44 |
This software is furnished under a license and may be used |
|
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
" |
|
51 |
! |
|
52 |
||
148 | 53 |
documentation |
54 |
" |
|
779 | 55 |
The Help Tool allows you to define help dictionaries for the widgets in |
761
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
56 |
window applications. The tool are able to run stand alone or in other master |
740 | 57 |
applications like the GUI Painter and the Menu Editor. |
58 |
If the application responds to the selector #showHelp:aHelpText for:aView, |
|
59 |
this selector is called by the widget's view when the mouse cursor moves over. |
|
60 |
If the application does not responds to that selector, and the activeHelp mode |
|
61 |
is enabled, an active help bubble is shown at the widget's view. |
|
156 | 62 |
|
779 | 63 |
[instance variables:] |
1669 | 64 |
specClass <Symbol> class implementing the help spec |
65 |
specSelector <Symbol> selector returning the help spec |
|
66 |
classItemList the list of classItems |
|
67 |
classItemModel keeps the selected class |
|
68 |
keyItemModel keeps the selected helpKey |
|
69 |
modifiedHolder <ValueHolder> true if the editField or contents changed |
|
70 |
editModel keeps the current helpKey |
|
71 |
helpTextView the view which shows the helpText |
|
72 |
contentsModifiedChannel true if the helpText is modified |
|
779 | 73 |
|
156 | 74 |
[author:] |
1669 | 75 |
Claus Atzkern, eXept Software AG |
76 |
Thomas Zwick, eXept Software AG |
|
148 | 77 |
" |
78 |
! ! |
|
79 |
||
286 | 80 |
!UIHelpTool class methodsFor:'instance creation'! |
81 |
||
832
2c5b61b168e8
allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
82 |
open |
833 | 83 |
^ self openOnClass:nil. |
832
2c5b61b168e8
allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
84 |
! |
2c5b61b168e8
allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
85 |
|
286 | 86 |
openOnClass:aClass |
1669 | 87 |
"opens a Help Tool on aClass |
286 | 88 |
" |
1669 | 89 |
^ self openOnClass:aClass andSelector:#helpSpec |
940 | 90 |
! |
91 |
||
92 |
openOnClass:aClass andSelector: aSelector |
|
1669 | 93 |
"opens a Help Tool on aClass and aSelector |
94 |
" |
|
95 |
^ self new openOnClass:aClass andSelector:aSelector |
|
750 | 96 |
! ! |
97 |
||
286 | 98 |
!UIHelpTool class methodsFor:'constants'! |
99 |
||
100 |
label |
|
1669 | 101 |
"returns the label; used if embedded as sub canvas in the GUI Painter or Menu Editor |
102 |
" |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
103 |
^'Help' |
286 | 104 |
! ! |
105 |
||
1772
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
106 |
!UIHelpTool class methodsFor:'defaults'! |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
107 |
|
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
108 |
resourceType |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
109 |
"get the type of the resource of the method generated by the UIHelpTool" |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
110 |
|
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
111 |
^ #help |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
112 |
! ! |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
113 |
|
151 | 114 |
!UIHelpTool class methodsFor:'help specs'! |
115 |
||
116 |
helpSpec |
|
740 | 117 |
"This resource specification was automatically generated |
118 |
by the UIHelpTool of ST/X." |
|
119 |
||
120 |
"Do not manually edit this!! If it is corrupted, |
|
121 |
the UIHelpTool may not be able to read the specification." |
|
292 | 122 |
|
172 | 123 |
" |
740 | 124 |
UIHelpTool openOnClass:UIHelpTool |
292 | 125 |
" |
126 |
||
740 | 127 |
<resource: #help> |
128 |
||
1669 | 129 |
^ super helpSpec addPairsFrom:#( |
151 | 130 |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
131 |
#addHelpTextKey |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
132 |
'Adds the key to the help spec.' |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
133 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
134 |
#currentHelpTexts |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
135 |
'Selected help text key.' |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
136 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
137 |
#deleteHelpTextKey |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
138 |
'Deletes the key from the help spec.' |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
139 |
|
750 | 140 |
#fileLoad |
141 |
'Opens a dialog for selecting and loading a help spec from a class.' |
|
142 |
||
143 |
#fileSave |
|
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
144 |
'Saves the current help spec.' |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
145 |
|
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
146 |
#fileUpdate |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
147 |
'Reload the help spec.' |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
148 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
149 |
#helpTextView |
1622 | 150 |
'Shows the help text. Menu action ''Accept'' commits changes' |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
151 |
|
1646 | 152 |
#listOfClasses |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
153 |
'Classes where help specs can be/are implemented.' |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
154 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
155 |
#listOfHelpTexts |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
156 |
'List of help text keys.' |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
157 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
158 |
#removeHelpTextKey |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
159 |
'Removes the help message from the widget.' |
172 | 160 |
|
1646 | 161 |
#updateHelpTextKey |
162 |
'Refetch the help spec.' |
|
163 |
||
172 | 164 |
) |
151 | 165 |
! ! |
166 |
||
148 | 167 |
!UIHelpTool class methodsFor:'interface specs'! |
168 |
||
169 |
windowSpec |
|
740 | 170 |
"This resource specification was automatically generated |
171 |
by the UIPainter of ST/X." |
|
148 | 172 |
|
740 | 173 |
"Do not manually edit this!! If it is corrupted, |
174 |
the UIPainter may not be able to read the specification." |
|
148 | 175 |
|
176 |
" |
|
151 | 177 |
UIPainter new openOnClass:UIHelpTool andSelector:#windowSpec |
178 |
UIHelpTool new openInterface:#windowSpec |
|
740 | 179 |
UIHelpTool open |
148 | 180 |
" |
181 |
||
182 |
<resource: #canvas> |
|
183 |
||
1302 | 184 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
185 |
#(FullSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
186 |
name: windowSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
187 |
window: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
188 |
(WindowSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
189 |
label: 'UIHelpTool' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
190 |
name: 'UIHelpTool' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
191 |
min: (Point 10 10) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
192 |
bounds: (Rectangle 14 46 475 339) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
193 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
194 |
component: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
195 |
(SpecCollection |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
196 |
collection: ( |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
197 |
(VariableVerticalPanelSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
198 |
name: 'PanelVrt' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
199 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
200 |
component: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
201 |
(SpecCollection |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
202 |
collection: ( |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
203 |
(VariableHorizontalPanelSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
204 |
name: 'PanelHrz' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
205 |
component: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
206 |
(SpecCollection |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
207 |
collection: ( |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
208 |
(HierarchicalListViewSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
209 |
name: 'keyItemModel' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
210 |
model: keyItemModel |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
211 |
menu: keyItemMenu |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
212 |
hasHorizontalScrollBar: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
213 |
hasVerticalScrollBar: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
214 |
miniScrollerHorizontal: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
215 |
miniScrollerVertical: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
216 |
listModel: keyItemListHolder |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
217 |
useIndex: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
218 |
highlightMode: label |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
219 |
showLines: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
220 |
showIndicators: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
221 |
showLeftIndicators: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
222 |
useDefaultIcons: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
223 |
autoScrollHorizontal: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
224 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
225 |
(ViewSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
226 |
name: 'classItemList' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
227 |
component: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
228 |
(SpecCollection |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
229 |
collection: ( |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
230 |
(InputFieldSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
231 |
name: 'editModel' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
232 |
layout: (LayoutFrame 0 0.0 2 0 -1 1.0 25 0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
233 |
activeHelpKey: currentHelpTexts |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
234 |
model: editModel |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
235 |
immediateAccept: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
236 |
acceptOnReturn: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
237 |
acceptOnTab: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
238 |
acceptOnLostFocus: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
239 |
acceptOnPointerLeave: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
240 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
241 |
(SelectionInListModelViewSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
242 |
name: 'classItemModel' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
243 |
layout: (LayoutFrame 0 0.0 27 0.0 0 1.0 0 1.0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
244 |
model: classItemModel |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
245 |
hasHorizontalScrollBar: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
246 |
hasVerticalScrollBar: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
247 |
miniScrollerHorizontal: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
248 |
miniScrollerVertical: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
249 |
autoHideScrollBars: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
250 |
listModel: classItemListHolder |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
251 |
useIndex: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
252 |
highlightMode: label |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
253 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
254 |
) |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
255 |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
256 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
257 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
258 |
) |
1646 | 259 |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
260 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
261 |
handles: (Any 0.607375 1.0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
262 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
263 |
(ArbitraryComponentSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
264 |
name: 'helpTextView' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
265 |
hasHorizontalScrollBar: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
266 |
hasVerticalScrollBar: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
267 |
miniScrollerHorizontal: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
268 |
miniScrollerVertical: true |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
269 |
hasBorder: false |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
270 |
component: helpTextView |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
271 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
272 |
) |
1302 | 273 |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
274 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
275 |
handles: (Any 0.679181 1.0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
276 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
277 |
) |
1302 | 278 |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
279 |
) |
148 | 280 |
) |
696
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 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
283 |
windowSpecForStandAlone |
740 | 284 |
"This resource specification was automatically generated |
285 |
by the UIPainter of ST/X." |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
286 |
|
740 | 287 |
"Do not manually edit this!! If it is corrupted, |
288 |
the UIPainter may not be able to read the specification." |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
289 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
290 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
291 |
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
|
292 |
UIHelpTool new openInterface:#windowSpecForStandAlone |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
293 |
" |
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 |
<resource: #canvas> |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
296 |
|
1646 | 297 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
298 |
#(FullSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
299 |
name: windowSpecForStandAlone |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
300 |
window: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
301 |
(WindowSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
302 |
label: 'Help Tool' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
303 |
name: 'Help Tool' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
304 |
min: (Point 300 300) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
305 |
bounds: (Rectangle 14 46 512 475) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
306 |
menu: menu |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
307 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
308 |
component: |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
309 |
(SpecCollection |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
310 |
collection: ( |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
311 |
(UISubSpecification |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
312 |
name: 'windowSpec' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
313 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -50 1.0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
314 |
minorKey: windowSpec |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
315 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
316 |
(UISubSpecification |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
317 |
name: 'windowSpecForCommit' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
318 |
layout: (LayoutFrame 0 0.0 -50 1.0 0 1.0 -24 1.0) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
319 |
majorKey: ToolApplicationModel |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
320 |
minorKey: windowSpecForCommit |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
321 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
322 |
(UISubSpecification |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
323 |
name: 'windowSpecForInfoBar' |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
324 |
layout: (LayoutFrame 0 0 -24 1 0 1 0 1) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
325 |
majorKey: ToolApplicationModel |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
326 |
minorKey: windowSpecForInfoBar |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
327 |
) |
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
328 |
) |
1646 | 329 |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1735
diff
changeset
|
330 |
) |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
331 |
) |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
332 |
! ! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
333 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
334 |
!UIHelpTool class methodsFor:'menu specs'! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
335 |
|
1646 | 336 |
helpTextMenu |
337 |
"This resource specification was automatically generated |
|
338 |
by the MenuEditor of ST/X." |
|
339 |
||
340 |
"Do not manually edit this!! If it is corrupted, |
|
341 |
the MenuEditor may not be able to read the specification." |
|
342 |
||
343 |
" |
|
344 |
MenuEditor new openOnClass:UIHelpTool andSelector:#helpTextMenu |
|
345 |
(Menu new fromLiteralArrayEncoding:(UIHelpTool helpTextMenu)) startUp |
|
346 |
" |
|
347 |
||
348 |
<resource: #menu> |
|
349 |
||
350 |
^ |
|
351 |
#(#Menu |
|
1669 | 352 |
#( |
353 |
#(#MenuItem |
|
354 |
#activeHelpKey: #commitOK |
|
355 |
#enabled: #contentsModifiedChannel |
|
356 |
#label: 'Accept' |
|
357 |
#itemValue: #accept |
|
358 |
#translateLabel: true |
|
359 |
) |
|
360 |
#(#MenuItem |
|
361 |
#activeHelpKey: #commitCancel |
|
362 |
#enabled: #contentsModifiedChannel |
|
363 |
#label: 'Cancel' |
|
364 |
#itemValue: #cancel |
|
365 |
#translateLabel: true |
|
366 |
) |
|
367 |
) |
|
368 |
nil |
|
369 |
nil |
|
370 |
) |
|
371 |
! |
|
372 |
||
373 |
keyItemMenu |
|
374 |
"This resource specification was automatically generated |
|
375 |
by the MenuEditor of ST/X." |
|
376 |
||
377 |
"Do not manually edit this!! If it is corrupted, |
|
378 |
the MenuEditor may not be able to read the specification." |
|
379 |
||
380 |
" |
|
381 |
MenuEditor new openOnClass:UIHelpTool andSelector:#keyItemMenu |
|
382 |
(Menu new fromLiteralArrayEncoding:(UIHelpTool keyItemMenu)) startUp |
|
383 |
" |
|
384 |
||
385 |
<resource: #menu> |
|
386 |
||
387 |
^ |
|
388 |
#(#Menu |
|
389 |
#( |
|
390 |
#(#MenuItem |
|
391 |
#activeHelpKey: #deleteHelpTextKey |
|
392 |
#label: 'Delete' |
|
393 |
#itemValue: #doDelete |
|
394 |
#translateLabel: true |
|
395 |
) |
|
396 |
) |
|
397 |
nil |
|
398 |
nil |
|
1646 | 399 |
) |
400 |
! |
|
401 |
||
402 |
listOfKeysMenu |
|
403 |
"This resource specification was automatically generated |
|
404 |
by the MenuEditor of ST/X." |
|
405 |
||
406 |
"Do not manually edit this!! If it is corrupted, |
|
407 |
the MenuEditor may not be able to read the specification." |
|
408 |
||
409 |
" |
|
410 |
MenuEditor new openOnClass:UIHelpTool andSelector:#listOfKeysMenu |
|
411 |
(Menu new fromLiteralArrayEncoding:(UIHelpTool listOfKeysMenu)) startUp |
|
412 |
" |
|
413 |
||
414 |
<resource: #menu> |
|
415 |
||
416 |
^ |
|
417 |
#(#Menu |
|
1669 | 418 |
#( |
419 |
#(#MenuItem |
|
420 |
#activeHelpKey: #deleteHelpTextKey |
|
421 |
#label: 'Delete' |
|
422 |
#itemValue: #doDelete |
|
423 |
#translateLabel: true |
|
424 |
) |
|
425 |
) |
|
426 |
nil |
|
427 |
nil |
|
1646 | 428 |
) |
429 |
! |
|
430 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
431 |
menu |
740 | 432 |
"This resource specification was automatically generated |
433 |
by the MenuEditor of ST/X." |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
434 |
|
740 | 435 |
"Do not manually edit this!! If it is corrupted, |
436 |
the MenuEditor may not be able to read the specification." |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
437 |
|
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 |
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
|
440 |
(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
|
441 |
" |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
442 |
|
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
443 |
<resource: #menu> |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
444 |
|
1646 | 445 |
^ |
446 |
#(#Menu |
|
1669 | 447 |
#( |
448 |
#(#MenuItem |
|
449 |
#label: 'File' |
|
450 |
#translateLabel: true |
|
451 |
#submenu: |
|
452 |
#(#Menu |
|
453 |
#( |
|
454 |
#(#MenuItem |
|
455 |
#activeHelpKey: #fileLoad |
|
456 |
#label: 'Load...' |
|
457 |
#itemValue: #doLoad |
|
458 |
#translateLabel: true |
|
459 |
) |
|
460 |
#(#MenuItem |
|
461 |
#activeHelpKey: #fileSave |
|
462 |
#label: 'Save' |
|
463 |
#itemValue: #doSave |
|
464 |
#translateLabel: true |
|
465 |
) |
|
466 |
#(#MenuItem |
|
467 |
#label: 'New' |
|
468 |
#itemValue: #doNew |
|
469 |
#translateLabel: true |
|
470 |
) |
|
471 |
#(#MenuItem |
|
472 |
#label: '-' |
|
473 |
) |
|
474 |
#(#MenuItem |
|
475 |
#activeHelpKey: #fileExit |
|
476 |
#label: 'Exit' |
|
477 |
#itemValue: #closeRequest |
|
478 |
#translateLabel: true |
|
479 |
) |
|
480 |
) |
|
481 |
nil |
|
482 |
nil |
|
483 |
) |
|
484 |
) |
|
485 |
#(#MenuItem |
|
486 |
#activeHelpKey: #history |
|
487 |
#label: 'History' |
|
488 |
#translateLabel: true |
|
489 |
#submenuChannel: #menuHistory |
|
490 |
) |
|
491 |
#(#MenuItem |
|
492 |
#label: 'Edit' |
|
493 |
#translateLabel: true |
|
494 |
#submenuChannel: #keyItemMenu |
|
495 |
#keepLinkedMenu: true |
|
496 |
) |
|
497 |
#(#MenuItem |
|
498 |
#activeHelpKey: #help |
|
499 |
#label: 'Help' |
|
500 |
#translateLabel: true |
|
501 |
#startGroup: #right |
|
502 |
#submenuChannel: #menuHelp |
|
503 |
) |
|
504 |
) |
|
505 |
nil |
|
506 |
nil |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
507 |
) |
148 | 508 |
! ! |
509 |
||
510 |
!UIHelpTool methodsFor:'accessing'! |
|
511 |
||
1669 | 512 |
helpKey |
513 |
"returns the helpKey as symbol or nil |
|
514 |
" |
|
515 |
|key| |
|
710 | 516 |
|
1669 | 517 |
key := editModel value. |
151 | 518 |
|
1669 | 519 |
key size ~~ 0 ifTrue:[ |
520 |
key := key withoutSeparators. |
|
521 |
key notEmpty ifTrue:[ ^ key asSymbol ] |
|
151 | 522 |
]. |
286 | 523 |
^ nil |
524 |
! |
|
525 |
||
526 |
helpKey:aKey |
|
1669 | 527 |
"change the helpKey without any change notification (modifiedHolder). |
528 |
" |
|
286 | 529 |
|key| |
1646 | 530 |
|
1669 | 531 |
self withoutModifyDo:[ |
532 |
aKey size ~~ 0 ifTrue:[ |
|
533 |
key := aKey withoutSeparators. |
|
534 |
key isEmpty ifTrue:[ key := nil ] |
|
535 |
] ifFalse:[ |
|
536 |
key := nil |
|
537 |
]. |
|
538 |
editModel value:key. |
|
286 | 539 |
]. |
1646 | 540 |
self cancel. |
151 | 541 |
! |
542 |
||
740 | 543 |
modified |
1669 | 544 |
"true if any items are added, deleted or modified |
1646 | 545 |
" |
1669 | 546 |
classItemList do:[:aClassItem| |
547 |
aClassItem modified ifTrue:[^ true]. |
|
548 |
]. |
|
549 |
^ false |
|
700 | 550 |
! |
551 |
||
1669 | 552 |
modified:aBoolean |
553 |
"true if any items are added, deleted or modified |
|
1646 | 554 |
" |
1669 | 555 |
classItemList do:[:aClassItem| aClassItem modified:aBoolean ]. |
556 |
! |
|
557 |
||
558 |
modifiedHolder |
|
559 |
"boolean holder which is set to true if the helpKey or contents changed |
|
560 |
" |
|
561 |
^ modifiedHolder |
|
700 | 562 |
! |
563 |
||
286 | 564 |
modifiedHolder:aValueHolder |
1669 | 565 |
"boolean holder which is set to true if the helpKey or contents changed |
566 |
" |
|
286 | 567 |
modifiedHolder notNil ifTrue:[ |
1669 | 568 |
modifiedHolder removeDependent:self. |
286 | 569 |
]. |
1646 | 570 |
modifiedHolder := aValueHolder. |
459 | 571 |
|
1646 | 572 |
modifiedHolder notNil ifTrue:[ |
1669 | 573 |
modifiedHolder addDependent:self. |
574 |
]. |
|
1604 | 575 |
! |
576 |
||
715 | 577 |
specClass |
1669 | 578 |
"returns the class on which the help tool works on |
1646 | 579 |
" |
580 |
^ specClass |
|
581 |
! |
|
779 | 582 |
|
1646 | 583 |
specSelector |
1681 | 584 |
"returns the selector of the edited helpSpec method |
1646 | 585 |
" |
1681 | 586 |
^ specSelector ? #helpSpec |
354 | 587 |
! ! |
588 |
||
148 | 589 |
!UIHelpTool methodsFor:'aspects'! |
590 |
||
1669 | 591 |
classItemListHolder |
592 |
"returns the holder which keeps the class items |
|
593 |
" |
|
594 |
|holder| |
|
595 |
||
596 |
holder := builder bindingAt:#classItemListHolder. |
|
597 |
||
598 |
holder isNil ifTrue:[ |
|
599 |
holder := nil asValue. |
|
600 |
holder value:classItemList. |
|
601 |
builder aspectAt:#classItemListHolder put:holder. |
|
602 |
]. |
|
603 |
^ holder |
|
604 |
! |
|
605 |
||
606 |
classItemModel |
|
607 |
"returns the holder which keeps the current selected class |
|
608 |
" |
|
609 |
^ classItemModel |
|
610 |
! |
|
611 |
||
1646 | 612 |
contentsModifiedChannel |
1669 | 613 |
"boolean holder, which is set to true if the contents assigned to the |
614 |
helpKey changed |
|
1646 | 615 |
" |
616 |
^ contentsModifiedChannel |
|
617 |
! |
|
779 | 618 |
|
1646 | 619 |
editModel |
1669 | 620 |
"string holder, which keeps the current editing helpKey as string |
1646 | 621 |
" |
1669 | 622 |
^ editModel. |
1646 | 623 |
! |
624 |
||
1669 | 625 |
helpTextView |
626 |
"the editView which keeps the current help contents assigned to the key |
|
1646 | 627 |
" |
1669 | 628 |
^ helpTextView |
148 | 629 |
! |
630 |
||
1669 | 631 |
keyItemListHolder |
632 |
"holder, which keeps the current hierarchical list |
|
633 |
assigned to the selected class item |
|
1646 | 634 |
" |
1669 | 635 |
|holder| |
636 |
||
637 |
holder := builder bindingAt:#keyItemListHolder. |
|
638 |
||
639 |
holder isNil ifTrue:[ |
|
640 |
holder := nil asValue. |
|
641 |
holder value:(classItemList last list). |
|
642 |
builder aspectAt:#keyItemListHolder put:holder. |
|
643 |
]. |
|
644 |
^ holder |
|
696
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 |
|
1669 | 647 |
keyItemModel |
648 |
"model which keeps the current selected helpKey or nil |
|
1646 | 649 |
" |
1669 | 650 |
^ keyItemModel. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
651 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
652 |
|
1669 | 653 |
valueOfEnablingCommitButtons |
654 |
"returns the enabling of the commit of this tool as value holder |
|
1646 | 655 |
" |
1669 | 656 |
masterApplication notNil ifTrue:[ |
657 |
^ masterApplication valueOfEnablingCommitButtons |
|
658 |
]. |
|
659 |
^ contentsModifiedChannel |
|
1336
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
660 |
! |
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
661 |
|
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
662 |
valueOfInfoLabel |
1669 | 663 |
"returns the info label as value holder |
664 |
" |
|
1336
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
665 |
masterApplication notNil ifTrue:[ |
1669 | 666 |
^ masterApplication valueOfInfoLabel |
1336
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
667 |
]. |
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
668 |
^ super valueOfInfoLabel |
148 | 669 |
! ! |
670 |
||
750 | 671 |
!UIHelpTool methodsFor:'building'! |
672 |
||
1663 | 673 |
buildAndMergeFromClass:aClass |
1669 | 674 |
"setup a new specClass, merge the current items into |
675 |
" |
|
676 |
|root mergeItems| |
|
1663 | 677 |
|
1669 | 678 |
root := classItemList first. |
679 |
||
680 |
root isUnspecified ifTrue:[ mergeItems := root children ] |
|
681 |
ifFalse:[ mergeItems := nil ]. |
|
682 |
||
683 |
self buildFromClass:aClass. |
|
1663 | 684 |
|
1669 | 685 |
mergeItems size ~~ 0 ifTrue:[ |
686 |
root := classItemList first. |
|
687 |
||
688 |
mergeItems do:[:anItem| |item hkey| |
|
689 |
hkey := anItem helpKey. |
|
690 |
item := root detectItemWithKey:hkey. |
|
1663 | 691 |
|
1669 | 692 |
item isNil ifTrue:[ |
693 |
item := KeyItem helpKey:hkey helpText:(anItem helpText). |
|
694 |
root add:item sortBlock:[:a :b| a label < b label ]. |
|
695 |
] ifFalse:[ |
|
696 |
item helpText:(anItem helpText). |
|
697 |
] |
|
698 |
] |
|
1663 | 699 |
]. |
700 |
! |
|
701 |
||
750 | 702 |
buildFromClass:aClass |
779 | 703 |
"reads the help dictionary from aClass and find remaining classes |
1669 | 704 |
'between' aClass and ApplicationModel |
705 |
" |
|
1681 | 706 |
|lastContents root list resource helpSpecSelector| |
779 | 707 |
|
1681 | 708 |
helpSpecSelector := self specSelector. |
1646 | 709 |
specClass := self getHelpSpecClassFromClass:aClass. |
710 |
||
1669 | 711 |
list := OrderedCollection new. |
712 |
||
713 |
(specClass isClass and:[specClass isLoaded]) ifTrue:[ |
|
1670 | 714 |
lastContents := nil. |
1681 | 715 |
resource := specClass name, ' ', helpSpecSelector. |
1670 | 716 |
self addToHistory:(Association key:resource value:#'loadFromMessage:'). |
1669 | 717 |
|
1670 | 718 |
specClass withAllSuperclasses reverse do:[:aClass| |value name| |
719 |
lastContents isNil ifTrue:[ |
|
720 |
aClass == ApplicationModel ifTrue:[ |
|
721 |
lastContents := IdentityDictionary new |
|
722 |
]. |
|
723 |
] ifFalse:[ |
|
724 |
root := ClassItem onClass:aClass. |
|
1669 | 725 |
|
1681 | 726 |
(aClass class includesSelector:helpSpecSelector) ifTrue:[ |
727 |
value := aClass perform:helpSpecSelector. |
|
1669 | 728 |
|
1670 | 729 |
value keysAndValuesDo:[:k :v| |cval| |
730 |
cval := lastContents at:k ifAbsent:self. |
|
731 |
cval = v ifFalse:[ root add:(KeyItem helpKey:k helpText:v) ]. |
|
732 |
]. |
|
733 |
lastContents := value. |
|
734 |
]. |
|
735 |
root sort:[:a :b| a label < b label ]. |
|
736 |
root modified:false. |
|
737 |
list add:root. |
|
738 |
] |
|
739 |
] |
|
1669 | 740 |
]. |
741 |
list isEmpty ifTrue:[ |
|
1670 | 742 |
list add:(ClassItem onClass:nil) |
1646 | 743 |
]. |
744 |
||
1669 | 745 |
self withoutModifyDo:[ |
1670 | 746 |
classItemList contents:list. |
747 |
self updateIcons. |
|
748 |
classItemModel value:(list last) |
|
1646 | 749 |
]. |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
750 |
! |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
751 |
|
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
752 |
buildFromClass: aClass andSelector: aSelector |
1669 | 753 |
"sets aSelector and reads the help dictionary from aClass |
754 |
" |
|
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
755 |
specSelector := aSelector. |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
756 |
self buildFromClass:aClass |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
757 |
! |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
758 |
|
1646 | 759 |
buildFromHelpTool:aHelpTool |
1669 | 760 |
"build from another helpTool |
761 |
" |
|
762 |
specClass := aHelpTool specClass. |
|
763 |
specSelector := aHelpTool specSelector. |
|
764 |
classItemList := aHelpTool classItemListHolder value. |
|
1646 | 765 |
|
1669 | 766 |
self classItemListHolder value:classItemList. |
1646 | 767 |
|
1669 | 768 |
classItemModel triggerValue:(classItemList last). |
1646 | 769 |
! ! |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
770 |
|
1646 | 771 |
!UIHelpTool methodsFor:'change & update'! |
772 |
||
773 |
editModelChanged |
|
1669 | 774 |
"called if the editModel changed |
1646 | 775 |
" |
776 |
|key| |
|
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
777 |
|
1646 | 778 |
key := self helpKey. |
779 |
||
1669 | 780 |
modifiedHolder notNil ifTrue:[ |
781 |
modifiedHolder value:true |
|
782 |
]. |
|
963
62cdb7923a3b
care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
783 |
|
1669 | 784 |
contentsModifiedChannel value:false. |
963
62cdb7923a3b
care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
785 |
|
1646 | 786 |
key notNil ifTrue:[ |
1669 | 787 |
keyItemModel value = key ifTrue:[^ self]. |
788 |
||
789 |
classItemList reverseDo:[:root| |item| |
|
790 |
item := root detectItemWithKey:key. |
|
1646 | 791 |
|
1669 | 792 |
item notNil ifTrue:[ |
793 |
classItemModel value:root. |
|
794 |
keyItemModel value:item. |
|
795 |
^ self. |
|
796 |
]. |
|
797 |
]. |
|
798 |
||
799 |
masterApplication isNil ifTrue:[ |
|
800 |
"entered a new helpKey |
|
801 |
" |
|
802 |
self valueOfEnablingCommitButtons value:true. |
|
803 |
]. |
|
750 | 804 |
]. |
1669 | 805 |
keyItemModel value:nil. |
1646 | 806 |
! |
779 | 807 |
|
1646 | 808 |
update:something with:aParameter from:changedObject |
1669 | 809 |
"Invoked when an object that I depend upon sends a change notification. |
810 |
" |
|
811 |
|root item list| |
|
722 | 812 |
|
1669 | 813 |
changedObject == keyItemModel ifTrue:[ |
814 |
item := keyItemModel value. |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
815 |
|
1669 | 816 |
item notNil ifTrue:[ |
817 |
editModel value:(item helpKey). |
|
818 |
]. |
|
819 |
self cancel. |
|
820 |
^ self |
|
1646 | 821 |
]. |
822 |
||
1669 | 823 |
changedObject == classItemModel ifTrue:[ |
824 |
root := classItemModel value. |
|
825 |
||
826 |
root notNil ifTrue:[ |
|
827 |
item := root detectItemWithKey:(self helpKey). |
|
828 |
list := root list. |
|
829 |
] ifFalse:[ |
|
830 |
list := item := nil. |
|
831 |
]. |
|
832 |
||
833 |
item notNil ifTrue:[ |
|
834 |
keyItemModel value:nil withoutNotifying:self. |
|
835 |
]. |
|
836 |
self keyItemListHolder value:list. |
|
837 |
keyItemModel value:item. |
|
838 |
^ self |
|
740 | 839 |
]. |
1646 | 840 |
|
1669 | 841 |
changedObject == editModel ifTrue:[ |
842 |
self editModelChanged. |
|
843 |
^ self |
|
844 |
]. |
|
750 | 845 |
|
1669 | 846 |
changedObject == contentsModifiedChannel ifTrue:[ |
847 |
modifiedHolder notNil ifTrue:[ |
|
848 |
modifiedHolder value:true |
|
849 |
]. |
|
850 |
^ self |
|
851 |
]. |
|
852 |
super update:something with:aParameter from:changedObject |
|
853 |
! |
|
904 | 854 |
|
1669 | 855 |
withoutModifyDo:aBlock |
856 |
"discard modifications; trigger not the modifiedHolder during |
|
1723
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
857 |
the action is active" |
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
858 |
|
1669 | 859 |
|holder| |
860 |
||
1723
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
861 |
modifiedHolder isNil ifTrue:[ |
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
862 |
^ aBlock value |
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
863 |
]. |
1669 | 864 |
holder := modifiedHolder. |
1723
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
865 |
^ aBlock ensure:[modifiedHolder := holder] |
750 | 866 |
! ! |
867 |
||
286 | 868 |
!UIHelpTool methodsFor:'private'! |
869 |
||
1669 | 870 |
extractResourceFrom:aString |
871 |
"extracts class and selector from a resource string. On success |
|
872 |
an association with the key a class and the selector as value |
|
873 |
is returned. Otherwise nil is returned |
|
1646 | 874 |
" |
1669 | 875 |
|words newClass newSel| |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
876 |
|
1669 | 877 |
aString size ~~ 0 ifTrue:[ |
878 |
words := aString asCollectionOfWords. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
879 |
|
1669 | 880 |
words size == 2 ifTrue:[ |
881 |
newClass := self resolveName:(words first). |
|
1646 | 882 |
|
1669 | 883 |
(newClass isClass and:[newClass isLoaded]) ifTrue:[ |
884 |
newSel := words last asSymbol. |
|
1646 | 885 |
|
1669 | 886 |
(newClass class includesSelector:newSel) ifTrue:[ |
887 |
^ Association key:newClass value:newSel |
|
888 |
]. |
|
889 |
]. |
|
890 |
]. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
891 |
]. |
1669 | 892 |
^ nil |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
893 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
894 |
|
750 | 895 |
getHelpSpecClassFromClass:aClass |
1669 | 896 |
"oops |
897 |
" |
|
750 | 898 |
|cls| |
899 |
||
1669 | 900 |
aClass notNil ifTrue:[ |
901 |
cls := self resolveName:aClass. |
|
750 | 902 |
|
1669 | 903 |
cls notNil ifTrue:[ |
904 |
cls := cls perform:#helpSpecClass ifNotUnderstood:cls. |
|
750 | 905 |
|
1669 | 906 |
(cls isClass and:[cls isLoaded]) ifTrue:[ |
907 |
^ cls |
|
908 |
]. |
|
909 |
]. |
|
761
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
910 |
]. |
1669 | 911 |
^ nil |
761
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
912 |
! |
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
913 |
|
1669 | 914 |
loadFromMessage:aString |
915 |
"Set and rebuild the specClass and specSelector from a resource string. |
|
916 |
On success true is returned otherwise false. If the current spec is |
|
917 |
modified, a dialog is launched. |
|
918 |
" |
|
919 |
|association| |
|
740 | 920 |
|
1669 | 921 |
association := self extractResourceFrom:aString. |
740 | 922 |
|
1669 | 923 |
association notNil ifTrue:[ |
924 |
self askForModification ifTrue:[ |
|
925 |
self buildFromClass:(association key) andSelector:(association value). |
|
926 |
^ true |
|
927 |
]. |
|
740 | 928 |
]. |
1669 | 929 |
^ false |
740 | 930 |
! |
931 |
||
1669 | 932 |
resourceMessage:aString |
933 |
"Set the specClass and specSelector from a resource string. On |
|
934 |
success true is returned otherwise false. |
|
935 |
" |
|
936 |
|association| |
|
740 | 937 |
|
1669 | 938 |
association := self extractResourceFrom:aString. |
750 | 939 |
|
1669 | 940 |
association notNil ifTrue:[ |
941 |
specClass := association key. |
|
942 |
specSelector := association value. |
|
943 |
^ true |
|
750 | 944 |
]. |
1669 | 945 |
^ false |
1670 | 946 |
! |
947 |
||
948 |
updateIcons |
|
949 |
"update all icons (redefinitions below above or both) |
|
950 |
" |
|
951 |
|iconBelow iconAbove iconAboveAndBelow isBehind redefinedAbove redefinedBelow icon| |
|
952 |
||
953 |
"/ if only one class exists, its not possible to have redefinitions |
|
954 |
classItemList size > 1 ifFalse:[ ^ self ]. |
|
955 |
||
956 |
iconBelow := SystemBrowser medium_methodRedefinedBelowIcon. |
|
957 |
iconAbove := SystemBrowser medium_methodInheritedFromAboveIcon. |
|
958 |
iconAboveAndBelow := SystemBrowser medium_methodInheritedFromAboveAndRedefinedBelowIcon. |
|
959 |
||
960 |
classItemList do:[:runClass| |
|
961 |
runClass do:[:aKeyItem| |
|
962 |
isBehind := redefinedBelow := redefinedAbove := false. |
|
963 |
||
964 |
classItemList do:[:testClass| |
|
965 |
testClass == runClass ifTrue:[ |
|
966 |
isBehind := true |
|
967 |
] ifFalse:[ |
|
968 |
(testClass detectItemWithKey:(aKeyItem helpKey)) notNil ifTrue:[ |
|
969 |
isBehind ifTrue:[ redefinedBelow := true ] |
|
970 |
ifFalse:[ redefinedAbove := true ]. |
|
971 |
] |
|
972 |
] |
|
973 |
]. |
|
974 |
||
975 |
redefinedBelow ifTrue:[ |
|
976 |
redefinedAbove ifTrue:[ icon := iconAboveAndBelow ] |
|
977 |
ifFalse:[ icon := iconBelow ] |
|
978 |
] ifFalse:[ |
|
979 |
redefinedAbove ifTrue:[ icon := iconAbove ] |
|
980 |
ifFalse:[ icon := nil ] |
|
981 |
]. |
|
982 |
aKeyItem icon:icon. |
|
983 |
] |
|
984 |
]. |
|
286 | 985 |
! ! |
986 |
||
1669 | 987 |
!UIHelpTool methodsFor:'startup & release'! |
369 | 988 |
|
989 |
closeRequest |
|
1772
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
990 |
"asks for permission before closing" |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
991 |
|
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
992 |
masterApplication isNil ifTrue:[ |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
993 |
super closeRequest. |
1669 | 994 |
]. |
740 | 995 |
! |
996 |
||
997 |
initialize |
|
1669 | 998 |
"setup default attributes |
999 |
" |
|
1000 |
super initialize. |
|
1001 |
self createBuilder. |
|
779 | 1002 |
|
1669 | 1003 |
specSelector := #helpSpec. |
1004 |
||
1005 |
classItemList := List new. |
|
740 | 1006 |
|
1669 | 1007 |
classItemModel := nil asValue. |
1008 |
classItemModel addDependent:self. |
|
1009 |
||
1010 |
keyItemModel := nil asValue. |
|
1011 |
keyItemModel addDependent:self. |
|
1012 |
||
1013 |
contentsModifiedChannel := false asValue. |
|
1014 |
contentsModifiedChannel addDependent:self. |
|
1015 |
||
1016 |
helpTextView := EditTextView new. |
|
1017 |
helpTextView acceptAction:[:dummy| self accept ]. |
|
1018 |
helpTextView modifiedChannel:contentsModifiedChannel. |
|
1646 | 1019 |
|
1020 |
editModel := nil asValue. |
|
1021 |
editModel addDependent:self. |
|
740 | 1022 |
|
1669 | 1023 |
self buildFromClass:nil. |
750 | 1024 |
! |
1025 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
1026 |
openInterface:aSymbol |
1669 | 1027 |
"do not open as stand alone |
1028 |
" |
|
750 | 1029 |
! |
1030 |
||
1031 |
openOnClass:aClass |
|
1669 | 1032 |
"opens the UIHelpTool on aClass |
1033 |
" |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
1034 |
self openOnClass:aClass andSelector:nil |
940 | 1035 |
! |
1036 |
||
1037 |
openOnClass:aClass andSelector: aSelector |
|
1038 |
"opens the UIHelpTool on aClass and aSelector" |
|
1039 |
||
1669 | 1040 |
super openInterface:#windowSpecForStandAlone. |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
1041 |
|
940 | 1042 |
builder window label: 'Help Tool'. |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
1043 |
self buildFromClass:aClass andSelector:aSelector |
369 | 1044 |
! ! |
1045 |
||
740 | 1046 |
!UIHelpTool methodsFor:'user actions'! |
286 | 1047 |
|
722 | 1048 |
accept |
1669 | 1049 |
"accepts the help text |
1050 |
" |
|
1051 |
|helpKey helpItem root| |
|
779 | 1052 |
|
1669 | 1053 |
helpKey := self helpKey. |
1054 |
helpKey isNil ifTrue:[^ self]. |
|
1646 | 1055 |
|
1669 | 1056 |
root := classItemModel value. |
1057 |
root isNil ifTrue:[^ self]. |
|
1058 |
||
1059 |
helpItem := root detectItemWithKey:helpKey. |
|
1648
d88ec5777284
empty help string - add key anyway
Claus Gittinger <cg@exept.de>
parents:
1646
diff
changeset
|
1060 |
|
1669 | 1061 |
helpItem isNil ifTrue:[ |
1670 | 1062 |
helpItem := KeyItem helpKey:helpKey helpText:(helpTextView contents). |
1063 |
root add:helpItem sortBlock:[:a :b| a label < b label ]. |
|
1064 |
self updateIcons. |
|
1669 | 1065 |
] ifFalse:[ |
1670 | 1066 |
helpItem helpText:(helpTextView contents). |
1646 | 1067 |
]. |
722 | 1068 |
|
1669 | 1069 |
contentsModifiedChannel value:false. |
1070 |
keyItemModel triggerValue:helpItem. |
|
722 | 1071 |
! |
1072 |
||
1646 | 1073 |
cancel |
1669 | 1074 |
"cancel modifications, reload helpText |
1075 |
" |
|
1076 |
|item contents modified| |
|
1646 | 1077 |
|
1669 | 1078 |
item := keyItemModel value. |
1079 |
modified := false. |
|
779 | 1080 |
|
1669 | 1081 |
item notNil ifTrue:[ |
1082 |
contents := item helpText. |
|
1083 |
] ifFalse:[ |
|
1084 |
contents := nil. |
|
1085 |
||
1086 |
modifiedHolder isNil ifTrue:[ |
|
1087 |
modified := self helpKey notNil |
|
1088 |
] |
|
1646 | 1089 |
]. |
1669 | 1090 |
helpTextView contents:contents. |
1091 |
contentsModifiedChannel value:modified. |
|
722 | 1092 |
! |
1093 |
||
750 | 1094 |
doDelete |
1646 | 1095 |
"deletes the selected help key |
1096 |
" |
|
1669 | 1097 |
|item| |
1646 | 1098 |
|
1669 | 1099 |
item := keyItemModel value. |
1670 | 1100 |
|
1101 |
item notNil ifTrue:[ |
|
1102 |
item remove. |
|
1103 |
item icon notNil ifTrue:[ self updateIcons ]. |
|
1104 |
]. |
|
1669 | 1105 |
editModel value:nil. |
722 | 1106 |
! |
1107 |
||
750 | 1108 |
doLoad |
1669 | 1109 |
"opens a Resource Selection Browser in order to get a resource message |
1110 |
" |
|
750 | 1111 |
self loadFromMessage: |
1681 | 1112 |
(ResourceSelectionBrowser |
1113 |
request: 'Load Help Spec From Class' |
|
1114 |
onSuperclass: nil |
|
1115 |
andClass: specClass |
|
1116 |
andSelector: (self specSelector) |
|
1117 |
withResourceTypes: (Array with: #help)). |
|
779 | 1118 |
|
1119 |
self updateInfoLabel |
|
750 | 1120 |
! |
286 | 1121 |
|
750 | 1122 |
doNew |
1669 | 1123 |
"reset all to empty |
1124 |
" |
|
1125 |
contentsModifiedChannel value:false. |
|
1126 |
self helpKey:nil. |
|
1127 |
self buildFromClass:nil. |
|
750 | 1128 |
! |
1129 |
||
722 | 1130 |
doSave |
1669 | 1131 |
"save the help spec to the spec-class(es) |
1132 |
" |
|
1133 |
specClass isNil ifTrue:[ |
|
1134 |
self information:(resources string:'No class specified !!'). |
|
1135 |
^ nil |
|
1136 |
]. |
|
1137 |
(specClass isSubclassOf:ApplicationModel) ifFalse:[ |
|
1735 | 1138 |
self information:(resources string:'Cannot save help into non-Application class'). |
1669 | 1139 |
^ nil |
1140 |
]. |
|
1141 |
||
1681 | 1142 |
classItemList do:[:aClassItem| |
1143 |
aClassItem createHelpMethodNamed:(self specSelector) |
|
1144 |
]. |
|
1669 | 1145 |
! |
1146 |
||
1147 |
openDocumentation |
|
1148 |
"opens the documentation file of the Help Tool |
|
1149 |
" |
|
1150 |
self openHTMLDocument: 'tools/uipainter/HelpTool.html' |
|
1151 |
! ! |
|
1152 |
||
1153 |
!UIHelpTool::ClassItem class methodsFor:'instance creation'! |
|
1154 |
||
1155 |
onClass:aClass |
|
1156 |
|root| |
|
1157 |
||
1158 |
root := self new. |
|
1159 |
root onClass:aClass. |
|
1160 |
^ root |
|
1161 |
! ! |
|
1162 |
||
1163 |
!UIHelpTool::ClassItem methodsFor:'accessing'! |
|
1164 |
||
1165 |
list |
|
1166 |
"returns the hierarchical list assigned to the classItem; the |
|
1167 |
list contains the keyItems |
|
1168 |
" |
|
1169 |
list isNil ifTrue:[ |
|
1170 |
list := HierarchicalList new. |
|
1171 |
list showRoot:false. |
|
1172 |
list root:self. |
|
1173 |
]. |
|
1174 |
^ list |
|
1175 |
! |
|
1176 |
||
1177 |
theClass |
|
1178 |
"returns the class or nil if unspecified |
|
1179 |
" |
|
1180 |
^ theClass |
|
1181 |
! ! |
|
1182 |
||
1183 |
!UIHelpTool::ClassItem methodsFor:'change & update'! |
|
1184 |
||
1185 |
helpTextChangedFor:anItem |
|
1186 |
"called if an helpKey changed its contents |
|
1187 |
" |
|
1188 |
self model notNil ifTrue:[ |
|
1189 |
self modified:true. |
|
1190 |
anItem modified:true. |
|
1191 |
]. |
|
1192 |
! ! |
|
1193 |
||
1194 |
!UIHelpTool::ClassItem methodsFor:'code generation'! |
|
1195 |
||
1196 |
createHelpMethodNamed:aMethodName |
|
1197 |
|stream| |
|
1198 |
||
1199 |
(modified and:[theClass notNil]) ifFalse:[ |
|
1200 |
^ self |
|
1201 |
]. |
|
1202 |
stream := '' writeStream. |
|
1203 |
||
1204 |
stream nextPutAll: |
|
1205 |
aMethodName, '\' withCRs, |
|
1206 |
(ResourceSpecEditor codeGenerationCommentForClass:UIHelpTool) withCRs, |
|
1207 |
'\\' withCRs, |
|
1208 |
' "\' withCRs, |
|
1209 |
' UIHelpTool openOnClass:', theClass name asString ,' |
|
1210 |
" |
|
1211 |
||
1212 |
<resource: #help> |
|
1213 |
||
1214 |
^ super ', aMethodName, ' addPairsFrom:#( |
|
1215 |
||
1216 |
'. |
|
1217 |
||
1218 |
self do:[:aKeyItem| |helpText| |
|
1219 |
helpText := aKeyItem helpText. |
|
1220 |
helpText isNil ifTrue:[ helpText := '' ]. |
|
1221 |
||
1222 |
stream nextPutLine:(aKeyItem helpKey storeString). |
|
1223 |
stream nextPutLine:(helpText storeString); cr. |
|
1224 |
]. |
|
1225 |
stream nextPutLine:')'. |
|
1226 |
||
1227 |
Compiler |
|
1228 |
compile:(stream contents) |
|
1229 |
forClass:theClass class |
|
1230 |
inCategory:'help specs'. |
|
1231 |
||
1232 |
self modified:false. |
|
1233 |
! ! |
|
1234 |
||
1235 |
!UIHelpTool::ClassItem methodsFor:'displaying'! |
|
1236 |
||
1237 |
icon |
|
1238 |
"returns the display icon (always nil) |
|
1239 |
" |
|
1240 |
^ nil |
|
1241 |
! |
|
1242 |
||
1243 |
label |
|
1244 |
"returns the display label |
|
1245 |
" |
|
1246 |
|label| |
|
1247 |
||
1248 |
theClass notNil ifTrue:[ label := theClass name ] |
|
1249 |
ifFalse:[ label := '** not yet defined **' ]. |
|
1250 |
||
1251 |
modified ifTrue:[ |
|
1252 |
label := Text string:label color:(Color red). |
|
1253 |
]. |
|
1254 |
^ label |
|
1255 |
! ! |
|
1256 |
||
1257 |
!UIHelpTool::ClassItem methodsFor:'instance creation'! |
|
1258 |
||
1259 |
initialize |
|
1260 |
"setup defaults |
|
1261 |
" |
|
1262 |
super initialize. |
|
1263 |
||
1264 |
children := OrderedCollection new. |
|
1265 |
isExpanded := true. |
|
1266 |
modified := false. |
|
1267 |
! |
|
1268 |
||
1269 |
onClass:aClass |
|
1270 |
"the class the ys are assigned to; if the class is nil, |
|
1271 |
the class is not yet specified. |
|
1272 |
" |
|
1273 |
theClass := aClass. |
|
1274 |
! ! |
|
1275 |
||
1276 |
!UIHelpTool::ClassItem methodsFor:'private'! |
|
1277 |
||
1278 |
basicAdd:aChild sortBlock:aBlock |
|
1279 |
"catch low-level add to update the modification flag |
|
1280 |
" |
|
1281 |
self modified:true. |
|
1282 |
aChild modified:true. |
|
1283 |
||
1284 |
^ super basicAdd:aChild sortBlock:aBlock. |
|
1285 |
! |
|
1286 |
||
1287 |
basicAddAll:aList beforeIndex:anIndex |
|
1288 |
"catch low-level add to update the modification flag |
|
1289 |
" |
|
1290 |
self modified:true. |
|
1291 |
||
1292 |
aList do:[:el| el modified:true ]. |
|
1293 |
^ super basicAddAll:aList beforeIndex:anIndex. |
|
1294 |
! |
|
779 | 1295 |
|
1669 | 1296 |
basicRemoveFromIndex:startIndex toIndex:stopIndex |
1297 |
"catch low-level remove to update the modification flag |
|
1298 |
" |
|
1299 |
self isUnspecified ifFalse:[ |
|
1300 |
self modified:true. |
|
1301 |
]. |
|
1302 |
^ super basicRemoveFromIndex:startIndex toIndex:stopIndex |
|
1303 |
! ! |
|
1304 |
||
1305 |
!UIHelpTool::ClassItem methodsFor:'queries'! |
|
1306 |
||
1307 |
isUnspecified |
|
1308 |
"true if the class is unspecified |
|
1309 |
" |
|
1310 |
^ theClass isNil |
|
1311 |
! |
|
1312 |
||
1313 |
modified |
|
1314 |
"true, if any item is modified, created or deleted |
|
1315 |
" |
|
1316 |
^ modified |
|
1317 |
! |
|
1318 |
||
1319 |
modified:aBoolean |
|
1320 |
"true, if any item is modified, created or deleted |
|
1321 |
" |
|
1322 |
modified ~~ aBoolean ifTrue:[ |
|
1323 |
modified := aBoolean. |
|
1324 |
||
1325 |
modified ifFalse:[ |
|
1326 |
self do:[:el| el modified:false ]. |
|
1327 |
]. |
|
1328 |
]. |
|
1329 |
! ! |
|
1330 |
||
1331 |
!UIHelpTool::ClassItem methodsFor:'searching'! |
|
1332 |
||
1333 |
detectItemWithKey:aKey |
|
1334 |
"returns the item assigned to a helpKey or nil |
|
1335 |
" |
|
1336 |
|key| |
|
1337 |
||
1338 |
aKey size ~~ 0 ifTrue:[ |
|
1339 |
key := aKey asSymbol. |
|
1340 |
||
1341 |
self do:[:anItem| |
|
1342 |
anItem helpKey == key ifTrue:[ ^ anItem ]. |
|
1343 |
] |
|
1344 |
]. |
|
1345 |
^ nil |
|
1346 |
! ! |
|
1347 |
||
1348 |
!UIHelpTool::KeyItem class methodsFor:'instance creation'! |
|
1349 |
||
1681 | 1350 |
helpKey:aKey helpText:aText |
1669 | 1351 |
|key| |
1352 |
||
1353 |
key := self new. |
|
1354 |
key helpKey:aKey helpText:aText. |
|
1355 |
^ key |
|
1356 |
! ! |
|
1357 |
||
1358 |
!UIHelpTool::KeyItem methodsFor:'accessing'! |
|
1359 |
||
1360 |
helpKey |
|
1361 |
"returns the helpKey, a symbol |
|
1362 |
" |
|
1363 |
^ helpKey |
|
1364 |
! |
|
1365 |
||
1366 |
helpText |
|
1367 |
"returns the contents assigned to the helpKey or nil |
|
1368 |
" |
|
1369 |
^ helpText |
|
1370 |
! |
|
1371 |
||
1372 |
helpText:aText |
|
1681 | 1373 |
"set the contents assigned to the helpKey; if the contents changes, |
1669 | 1374 |
a notification is raised. |
1375 |
" |
|
1376 |
|text| |
|
1377 |
||
1378 |
text := self formatText:aText. |
|
1379 |
||
1380 |
text ~= helpText ifTrue:[ |
|
1681 | 1381 |
helpText := text. |
1669 | 1382 |
|
1681 | 1383 |
(modified or:[parent isNil]) ifFalse:[ |
1384 |
parent helpTextChangedFor:self. |
|
1385 |
] |
|
1669 | 1386 |
]. |
1387 |
! ! |
|
1388 |
||
1389 |
!UIHelpTool::KeyItem methodsFor:'displaying'! |
|
1390 |
||
1391 |
icon |
|
1392 |
"returns the display icon (always nil) |
|
1393 |
" |
|
1670 | 1394 |
^ icon |
1395 |
! |
|
1396 |
||
1397 |
icon:anIcon |
|
1398 |
||
1399 |
icon ~= anIcon ifTrue:[ |
|
1400 |
icon := anIcon. |
|
1401 |
self changed:#icon. |
|
1402 |
]. |
|
1669 | 1403 |
! |
1404 |
||
1405 |
label |
|
1406 |
"returns the display label |
|
1407 |
" |
|
1408 |
modified ifTrue:[ |
|
1409 |
^ Text string:helpKey color:(Color red) |
|
1410 |
]. |
|
1411 |
^ helpKey |
|
1412 |
! ! |
|
1413 |
||
1414 |
!UIHelpTool::KeyItem methodsFor:'instance creation'! |
|
1415 |
||
1416 |
helpKey:aKey helpText:aText |
|
1417 |
"set the key and contents without a change notification |
|
1418 |
" |
|
1419 |
helpKey := aKey asSymbol. |
|
1420 |
helpText := self formatText:aText. |
|
1421 |
! |
|
1422 |
||
1423 |
initialize |
|
1424 |
"setup defaults |
|
1425 |
" |
|
1426 |
super initialize. |
|
1427 |
children := #(). |
|
1428 |
modified := false. |
|
1429 |
! ! |
|
1430 |
||
1431 |
!UIHelpTool::KeyItem methodsFor:'private'! |
|
1432 |
||
1433 |
formatText:aText |
|
1434 |
"format the text, replace carriage return by spaces and compress spaces |
|
1435 |
" |
|
1436 |
|text result| |
|
1437 |
||
1438 |
aText size ~~ 0 ifTrue:[ |
|
1439 |
text := aText asString asCollectionOfWords. |
|
1440 |
||
1441 |
text notEmpty ifTrue:[ |
|
1442 |
result := text first. |
|
1443 |
||
1444 |
text from:2 do:[:t| result := result, ' ', t ]. |
|
1445 |
^ result |
|
1446 |
]. |
|
1447 |
]. |
|
1448 |
^ nil |
|
1449 |
! ! |
|
1450 |
||
1451 |
!UIHelpTool::KeyItem methodsFor:'queries'! |
|
1452 |
||
1453 |
modified |
|
1454 |
"returns true if the helpText is modified |
|
1455 |
" |
|
1456 |
^ modified |
|
1457 |
! |
|
1458 |
||
1459 |
modified:aBoolean |
|
1460 |
"set the modification flag |
|
1461 |
" |
|
1462 |
aBoolean == modified ifFalse:[ |
|
1463 |
modified := aBoolean. |
|
1464 |
self changed:#redraw. |
|
1465 |
]. |
|
148 | 1466 |
! ! |
1467 |
||
1468 |
!UIHelpTool class methodsFor:'documentation'! |
|
1469 |
||
1470 |
version |
|
1471 |
^ '$Header$' |
|
1472 |
! ! |