author | Claus Gittinger <cg@exept.de> |
Tue, 03 Feb 2004 16:14:01 +0100 | |
changeset 1782 | 8108839cc262 |
parent 1777 | fbf082828db6 |
child 1973 | 58e2df779faa |
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 |
^ |
1775 | 446 |
#(Menu |
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 |
label: 'History' |
|
487 |
translateLabel: true |
|
488 |
submenuChannel: menuHistory |
|
489 |
) |
|
490 |
(MenuItem |
|
491 |
label: 'Edit' |
|
492 |
translateLabel: true |
|
493 |
submenuChannel: keyItemMenu |
|
494 |
keepLinkedMenu: true |
|
495 |
) |
|
496 |
(MenuItem |
|
497 |
label: 'Help' |
|
498 |
translateLabel: true |
|
499 |
startGroup: right |
|
500 |
submenuChannel: menuHelp |
|
501 |
) |
|
502 |
) |
|
503 |
nil |
|
504 |
nil |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
505 |
) |
148 | 506 |
! ! |
507 |
||
508 |
!UIHelpTool methodsFor:'accessing'! |
|
509 |
||
1669 | 510 |
helpKey |
511 |
"returns the helpKey as symbol or nil |
|
512 |
" |
|
513 |
|key| |
|
710 | 514 |
|
1669 | 515 |
key := editModel value. |
151 | 516 |
|
1669 | 517 |
key size ~~ 0 ifTrue:[ |
518 |
key := key withoutSeparators. |
|
519 |
key notEmpty ifTrue:[ ^ key asSymbol ] |
|
151 | 520 |
]. |
286 | 521 |
^ nil |
522 |
! |
|
523 |
||
524 |
helpKey:aKey |
|
1669 | 525 |
"change the helpKey without any change notification (modifiedHolder). |
526 |
" |
|
286 | 527 |
|key| |
1646 | 528 |
|
1669 | 529 |
self withoutModifyDo:[ |
530 |
aKey size ~~ 0 ifTrue:[ |
|
531 |
key := aKey withoutSeparators. |
|
532 |
key isEmpty ifTrue:[ key := nil ] |
|
533 |
] ifFalse:[ |
|
534 |
key := nil |
|
535 |
]. |
|
536 |
editModel value:key. |
|
286 | 537 |
]. |
1646 | 538 |
self cancel. |
151 | 539 |
! |
540 |
||
740 | 541 |
modified |
1669 | 542 |
"true if any items are added, deleted or modified |
1646 | 543 |
" |
1669 | 544 |
classItemList do:[:aClassItem| |
545 |
aClassItem modified ifTrue:[^ true]. |
|
546 |
]. |
|
547 |
^ false |
|
700 | 548 |
! |
549 |
||
1669 | 550 |
modified:aBoolean |
551 |
"true if any items are added, deleted or modified |
|
1646 | 552 |
" |
1669 | 553 |
classItemList do:[:aClassItem| aClassItem modified:aBoolean ]. |
554 |
! |
|
555 |
||
556 |
modifiedHolder |
|
557 |
"boolean holder which is set to true if the helpKey or contents changed |
|
558 |
" |
|
559 |
^ modifiedHolder |
|
700 | 560 |
! |
561 |
||
286 | 562 |
modifiedHolder:aValueHolder |
1669 | 563 |
"boolean holder which is set to true if the helpKey or contents changed |
564 |
" |
|
286 | 565 |
modifiedHolder notNil ifTrue:[ |
1669 | 566 |
modifiedHolder removeDependent:self. |
286 | 567 |
]. |
1646 | 568 |
modifiedHolder := aValueHolder. |
459 | 569 |
|
1646 | 570 |
modifiedHolder notNil ifTrue:[ |
1669 | 571 |
modifiedHolder addDependent:self. |
572 |
]. |
|
1604 | 573 |
! |
574 |
||
715 | 575 |
specClass |
1669 | 576 |
"returns the class on which the help tool works on |
1646 | 577 |
" |
578 |
^ specClass |
|
579 |
! |
|
779 | 580 |
|
1646 | 581 |
specSelector |
1681 | 582 |
"returns the selector of the edited helpSpec method |
1646 | 583 |
" |
1681 | 584 |
^ specSelector ? #helpSpec |
354 | 585 |
! ! |
586 |
||
148 | 587 |
!UIHelpTool methodsFor:'aspects'! |
588 |
||
1669 | 589 |
classItemListHolder |
590 |
"returns the holder which keeps the class items |
|
591 |
" |
|
592 |
|holder| |
|
593 |
||
594 |
holder := builder bindingAt:#classItemListHolder. |
|
595 |
||
596 |
holder isNil ifTrue:[ |
|
597 |
holder := nil asValue. |
|
598 |
holder value:classItemList. |
|
599 |
builder aspectAt:#classItemListHolder put:holder. |
|
600 |
]. |
|
601 |
^ holder |
|
602 |
! |
|
603 |
||
604 |
classItemModel |
|
605 |
"returns the holder which keeps the current selected class |
|
606 |
" |
|
607 |
^ classItemModel |
|
608 |
! |
|
609 |
||
1646 | 610 |
contentsModifiedChannel |
1669 | 611 |
"boolean holder, which is set to true if the contents assigned to the |
612 |
helpKey changed |
|
1646 | 613 |
" |
614 |
^ contentsModifiedChannel |
|
615 |
! |
|
779 | 616 |
|
1646 | 617 |
editModel |
1669 | 618 |
"string holder, which keeps the current editing helpKey as string |
1646 | 619 |
" |
1669 | 620 |
^ editModel. |
1646 | 621 |
! |
622 |
||
1669 | 623 |
helpTextView |
624 |
"the editView which keeps the current help contents assigned to the key |
|
1646 | 625 |
" |
1669 | 626 |
^ helpTextView |
148 | 627 |
! |
628 |
||
1669 | 629 |
keyItemListHolder |
630 |
"holder, which keeps the current hierarchical list |
|
631 |
assigned to the selected class item |
|
1646 | 632 |
" |
1669 | 633 |
|holder| |
634 |
||
635 |
holder := builder bindingAt:#keyItemListHolder. |
|
636 |
||
637 |
holder isNil ifTrue:[ |
|
638 |
holder := nil asValue. |
|
639 |
holder value:(classItemList last list). |
|
640 |
builder aspectAt:#keyItemListHolder put:holder. |
|
641 |
]. |
|
642 |
^ holder |
|
696
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 |
|
1669 | 645 |
keyItemModel |
646 |
"model which keeps the current selected helpKey or nil |
|
1646 | 647 |
" |
1669 | 648 |
^ keyItemModel. |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
649 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
650 |
|
1669 | 651 |
valueOfEnablingCommitButtons |
652 |
"returns the enabling of the commit of this tool as value holder |
|
1646 | 653 |
" |
1669 | 654 |
masterApplication notNil ifTrue:[ |
655 |
^ masterApplication valueOfEnablingCommitButtons |
|
656 |
]. |
|
657 |
^ contentsModifiedChannel |
|
1336
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
658 |
! |
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
659 |
|
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
660 |
valueOfInfoLabel |
1669 | 661 |
"returns the info label as value holder |
662 |
" |
|
1336
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
663 |
masterApplication notNil ifTrue:[ |
1669 | 664 |
^ masterApplication valueOfInfoLabel |
1336
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
665 |
]. |
3c84dc6f8d4b
delegate valueOfInfoLabel to masterApplication if exists
ca
parents:
1329
diff
changeset
|
666 |
^ super valueOfInfoLabel |
148 | 667 |
! ! |
668 |
||
750 | 669 |
!UIHelpTool methodsFor:'building'! |
670 |
||
1663 | 671 |
buildAndMergeFromClass:aClass |
1669 | 672 |
"setup a new specClass, merge the current items into |
673 |
" |
|
674 |
|root mergeItems| |
|
1663 | 675 |
|
1669 | 676 |
root := classItemList first. |
677 |
||
678 |
root isUnspecified ifTrue:[ mergeItems := root children ] |
|
679 |
ifFalse:[ mergeItems := nil ]. |
|
680 |
||
681 |
self buildFromClass:aClass. |
|
1663 | 682 |
|
1669 | 683 |
mergeItems size ~~ 0 ifTrue:[ |
684 |
root := classItemList first. |
|
685 |
||
686 |
mergeItems do:[:anItem| |item hkey| |
|
687 |
hkey := anItem helpKey. |
|
688 |
item := root detectItemWithKey:hkey. |
|
1663 | 689 |
|
1669 | 690 |
item isNil ifTrue:[ |
691 |
item := KeyItem helpKey:hkey helpText:(anItem helpText). |
|
692 |
root add:item sortBlock:[:a :b| a label < b label ]. |
|
693 |
] ifFalse:[ |
|
694 |
item helpText:(anItem helpText). |
|
695 |
] |
|
696 |
] |
|
1663 | 697 |
]. |
698 |
! |
|
699 |
||
750 | 700 |
buildFromClass:aClass |
779 | 701 |
"reads the help dictionary from aClass and find remaining classes |
1669 | 702 |
'between' aClass and ApplicationModel |
703 |
" |
|
1681 | 704 |
|lastContents root list resource helpSpecSelector| |
779 | 705 |
|
1681 | 706 |
helpSpecSelector := self specSelector. |
1646 | 707 |
specClass := self getHelpSpecClassFromClass:aClass. |
708 |
||
1669 | 709 |
list := OrderedCollection new. |
710 |
||
711 |
(specClass isClass and:[specClass isLoaded]) ifTrue:[ |
|
1670 | 712 |
lastContents := nil. |
1681 | 713 |
resource := specClass name, ' ', helpSpecSelector. |
1670 | 714 |
self addToHistory:(Association key:resource value:#'loadFromMessage:'). |
1669 | 715 |
|
1670 | 716 |
specClass withAllSuperclasses reverse do:[:aClass| |value name| |
717 |
lastContents isNil ifTrue:[ |
|
718 |
aClass == ApplicationModel ifTrue:[ |
|
719 |
lastContents := IdentityDictionary new |
|
720 |
]. |
|
721 |
] ifFalse:[ |
|
722 |
root := ClassItem onClass:aClass. |
|
1669 | 723 |
|
1681 | 724 |
(aClass class includesSelector:helpSpecSelector) ifTrue:[ |
725 |
value := aClass perform:helpSpecSelector. |
|
1669 | 726 |
|
1670 | 727 |
value keysAndValuesDo:[:k :v| |cval| |
728 |
cval := lastContents at:k ifAbsent:self. |
|
729 |
cval = v ifFalse:[ root add:(KeyItem helpKey:k helpText:v) ]. |
|
730 |
]. |
|
731 |
lastContents := value. |
|
732 |
]. |
|
733 |
root sort:[:a :b| a label < b label ]. |
|
734 |
root modified:false. |
|
735 |
list add:root. |
|
736 |
] |
|
737 |
] |
|
1669 | 738 |
]. |
739 |
list isEmpty ifTrue:[ |
|
1670 | 740 |
list add:(ClassItem onClass:nil) |
1646 | 741 |
]. |
742 |
||
1669 | 743 |
self withoutModifyDo:[ |
1670 | 744 |
classItemList contents:list. |
745 |
self updateIcons. |
|
746 |
classItemModel value:(list last) |
|
1646 | 747 |
]. |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
748 |
! |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
749 |
|
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
750 |
buildFromClass: aClass andSelector: aSelector |
1669 | 751 |
"sets aSelector and reads the help dictionary from aClass |
752 |
" |
|
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
753 |
specSelector := aSelector. |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
754 |
self buildFromClass:aClass |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
755 |
! |
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
756 |
|
1646 | 757 |
buildFromHelpTool:aHelpTool |
1669 | 758 |
"build from another helpTool |
759 |
" |
|
760 |
specClass := aHelpTool specClass. |
|
761 |
specSelector := aHelpTool specSelector. |
|
762 |
classItemList := aHelpTool classItemListHolder value. |
|
1646 | 763 |
|
1669 | 764 |
self classItemListHolder value:classItemList. |
1646 | 765 |
|
1669 | 766 |
classItemModel triggerValue:(classItemList last). |
1646 | 767 |
! ! |
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
768 |
|
1646 | 769 |
!UIHelpTool methodsFor:'change & update'! |
770 |
||
771 |
editModelChanged |
|
1669 | 772 |
"called if the editModel changed |
1646 | 773 |
" |
774 |
|key| |
|
1340
4276358d937b
added update function; changed layout
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
775 |
|
1646 | 776 |
key := self helpKey. |
777 |
||
1669 | 778 |
modifiedHolder notNil ifTrue:[ |
779 |
modifiedHolder value:true |
|
780 |
]. |
|
963
62cdb7923a3b
care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
781 |
|
1669 | 782 |
contentsModifiedChannel value:false. |
963
62cdb7923a3b
care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
783 |
|
1646 | 784 |
key notNil ifTrue:[ |
1669 | 785 |
keyItemModel value = key ifTrue:[^ self]. |
786 |
||
787 |
classItemList reverseDo:[:root| |item| |
|
788 |
item := root detectItemWithKey:key. |
|
1646 | 789 |
|
1669 | 790 |
item notNil ifTrue:[ |
791 |
classItemModel value:root. |
|
792 |
keyItemModel value:item. |
|
793 |
^ self. |
|
794 |
]. |
|
795 |
]. |
|
796 |
||
797 |
masterApplication isNil ifTrue:[ |
|
798 |
"entered a new helpKey |
|
799 |
" |
|
800 |
self valueOfEnablingCommitButtons value:true. |
|
801 |
]. |
|
750 | 802 |
]. |
1669 | 803 |
keyItemModel value:nil. |
1646 | 804 |
! |
779 | 805 |
|
1646 | 806 |
update:something with:aParameter from:changedObject |
1669 | 807 |
"Invoked when an object that I depend upon sends a change notification. |
808 |
" |
|
809 |
|root item list| |
|
722 | 810 |
|
1669 | 811 |
changedObject == keyItemModel ifTrue:[ |
812 |
item := keyItemModel value. |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
813 |
|
1669 | 814 |
item notNil ifTrue:[ |
815 |
editModel value:(item helpKey). |
|
816 |
]. |
|
817 |
self cancel. |
|
818 |
^ self |
|
1646 | 819 |
]. |
820 |
||
1669 | 821 |
changedObject == classItemModel ifTrue:[ |
822 |
root := classItemModel value. |
|
823 |
||
824 |
root notNil ifTrue:[ |
|
825 |
item := root detectItemWithKey:(self helpKey). |
|
826 |
list := root list. |
|
827 |
] ifFalse:[ |
|
828 |
list := item := nil. |
|
829 |
]. |
|
830 |
||
831 |
item notNil ifTrue:[ |
|
832 |
keyItemModel value:nil withoutNotifying:self. |
|
833 |
]. |
|
834 |
self keyItemListHolder value:list. |
|
835 |
keyItemModel value:item. |
|
836 |
^ self |
|
740 | 837 |
]. |
1646 | 838 |
|
1669 | 839 |
changedObject == editModel ifTrue:[ |
840 |
self editModelChanged. |
|
841 |
^ self |
|
842 |
]. |
|
750 | 843 |
|
1669 | 844 |
changedObject == contentsModifiedChannel ifTrue:[ |
845 |
modifiedHolder notNil ifTrue:[ |
|
846 |
modifiedHolder value:true |
|
847 |
]. |
|
848 |
^ self |
|
849 |
]. |
|
850 |
super update:something with:aParameter from:changedObject |
|
851 |
! |
|
904 | 852 |
|
1669 | 853 |
withoutModifyDo:aBlock |
854 |
"discard modifications; trigger not the modifiedHolder during |
|
1723
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
855 |
the action is active" |
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
856 |
|
1669 | 857 |
|holder| |
858 |
||
1723
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
859 |
modifiedHolder isNil ifTrue:[ |
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
860 |
^ aBlock value |
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
861 |
]. |
1669 | 862 |
holder := modifiedHolder. |
1723
30d20151ed81
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1681
diff
changeset
|
863 |
^ aBlock ensure:[modifiedHolder := holder] |
750 | 864 |
! ! |
865 |
||
286 | 866 |
!UIHelpTool methodsFor:'private'! |
867 |
||
1669 | 868 |
extractResourceFrom:aString |
869 |
"extracts class and selector from a resource string. On success |
|
870 |
an association with the key a class and the selector as value |
|
871 |
is returned. Otherwise nil is returned |
|
1646 | 872 |
" |
1669 | 873 |
|words newClass newSel| |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
874 |
|
1669 | 875 |
aString size ~~ 0 ifTrue:[ |
876 |
words := aString asCollectionOfWords. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
877 |
|
1669 | 878 |
words size == 2 ifTrue:[ |
879 |
newClass := self resolveName:(words first). |
|
1646 | 880 |
|
1669 | 881 |
(newClass isClass and:[newClass isLoaded]) ifTrue:[ |
882 |
newSel := words last asSymbol. |
|
1646 | 883 |
|
1669 | 884 |
(newClass class includesSelector:newSel) ifTrue:[ |
885 |
^ Association key:newClass value:newSel |
|
886 |
]. |
|
887 |
]. |
|
888 |
]. |
|
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
889 |
]. |
1669 | 890 |
^ nil |
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
891 |
! |
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
892 |
|
750 | 893 |
getHelpSpecClassFromClass:aClass |
1669 | 894 |
"oops |
895 |
" |
|
750 | 896 |
|cls| |
897 |
||
1669 | 898 |
aClass notNil ifTrue:[ |
899 |
cls := self resolveName:aClass. |
|
750 | 900 |
|
1669 | 901 |
cls notNil ifTrue:[ |
902 |
cls := cls perform:#helpSpecClass ifNotUnderstood:cls. |
|
750 | 903 |
|
1669 | 904 |
(cls isClass and:[cls isLoaded]) ifTrue:[ |
905 |
^ cls |
|
906 |
]. |
|
907 |
]. |
|
761
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
908 |
]. |
1669 | 909 |
^ nil |
761
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
910 |
! |
91e524583390
do not save, if help texts have not changed (unformatting)
tz
parents:
750
diff
changeset
|
911 |
|
1669 | 912 |
loadFromMessage:aString |
913 |
"Set and rebuild the specClass and specSelector from a resource string. |
|
914 |
On success true is returned otherwise false. If the current spec is |
|
915 |
modified, a dialog is launched. |
|
916 |
" |
|
917 |
|association| |
|
740 | 918 |
|
1669 | 919 |
association := self extractResourceFrom:aString. |
740 | 920 |
|
1669 | 921 |
association notNil ifTrue:[ |
922 |
self askForModification ifTrue:[ |
|
923 |
self buildFromClass:(association key) andSelector:(association value). |
|
924 |
^ true |
|
925 |
]. |
|
740 | 926 |
]. |
1669 | 927 |
^ false |
740 | 928 |
! |
929 |
||
1669 | 930 |
resourceMessage:aString |
931 |
"Set the specClass and specSelector from a resource string. On |
|
932 |
success true is returned otherwise false. |
|
933 |
" |
|
934 |
|association| |
|
740 | 935 |
|
1669 | 936 |
association := self extractResourceFrom:aString. |
750 | 937 |
|
1669 | 938 |
association notNil ifTrue:[ |
939 |
specClass := association key. |
|
940 |
specSelector := association value. |
|
941 |
^ true |
|
750 | 942 |
]. |
1669 | 943 |
^ false |
1670 | 944 |
! |
945 |
||
946 |
updateIcons |
|
947 |
"update all icons (redefinitions below above or both) |
|
948 |
" |
|
949 |
|iconBelow iconAbove iconAboveAndBelow isBehind redefinedAbove redefinedBelow icon| |
|
950 |
||
951 |
"/ if only one class exists, its not possible to have redefinitions |
|
952 |
classItemList size > 1 ifFalse:[ ^ self ]. |
|
953 |
||
954 |
iconBelow := SystemBrowser medium_methodRedefinedBelowIcon. |
|
955 |
iconAbove := SystemBrowser medium_methodInheritedFromAboveIcon. |
|
956 |
iconAboveAndBelow := SystemBrowser medium_methodInheritedFromAboveAndRedefinedBelowIcon. |
|
957 |
||
958 |
classItemList do:[:runClass| |
|
959 |
runClass do:[:aKeyItem| |
|
960 |
isBehind := redefinedBelow := redefinedAbove := false. |
|
961 |
||
962 |
classItemList do:[:testClass| |
|
963 |
testClass == runClass ifTrue:[ |
|
964 |
isBehind := true |
|
965 |
] ifFalse:[ |
|
966 |
(testClass detectItemWithKey:(aKeyItem helpKey)) notNil ifTrue:[ |
|
967 |
isBehind ifTrue:[ redefinedBelow := true ] |
|
968 |
ifFalse:[ redefinedAbove := true ]. |
|
969 |
] |
|
970 |
] |
|
971 |
]. |
|
972 |
||
973 |
redefinedBelow ifTrue:[ |
|
974 |
redefinedAbove ifTrue:[ icon := iconAboveAndBelow ] |
|
975 |
ifFalse:[ icon := iconBelow ] |
|
976 |
] ifFalse:[ |
|
977 |
redefinedAbove ifTrue:[ icon := iconAbove ] |
|
978 |
ifFalse:[ icon := nil ] |
|
979 |
]. |
|
980 |
aKeyItem icon:icon. |
|
981 |
] |
|
982 |
]. |
|
286 | 983 |
! ! |
984 |
||
1669 | 985 |
!UIHelpTool methodsFor:'startup & release'! |
369 | 986 |
|
987 |
closeRequest |
|
1772
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
988 |
"asks for permission before closing" |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
989 |
|
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
990 |
masterApplication isNil ifTrue:[ |
e33aee13defe
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
1737
diff
changeset
|
991 |
super closeRequest. |
1669 | 992 |
]. |
740 | 993 |
! |
994 |
||
995 |
initialize |
|
1669 | 996 |
"setup default attributes |
997 |
" |
|
998 |
super initialize. |
|
999 |
self createBuilder. |
|
779 | 1000 |
|
1669 | 1001 |
specSelector := #helpSpec. |
1002 |
||
1003 |
classItemList := List new. |
|
740 | 1004 |
|
1669 | 1005 |
classItemModel := nil asValue. |
1006 |
classItemModel addDependent:self. |
|
1007 |
||
1008 |
keyItemModel := nil asValue. |
|
1009 |
keyItemModel addDependent:self. |
|
1010 |
||
1011 |
contentsModifiedChannel := false asValue. |
|
1012 |
contentsModifiedChannel addDependent:self. |
|
1013 |
||
1014 |
helpTextView := EditTextView new. |
|
1015 |
helpTextView acceptAction:[:dummy| self accept ]. |
|
1016 |
helpTextView modifiedChannel:contentsModifiedChannel. |
|
1646 | 1017 |
|
1018 |
editModel := nil asValue. |
|
1019 |
editModel addDependent:self. |
|
740 | 1020 |
|
1669 | 1021 |
self buildFromClass:nil. |
750 | 1022 |
! |
1023 |
||
696
e91402372900
popup menu replaced by a list + supporting of help specs from different classes
tz
parents:
479
diff
changeset
|
1024 |
openInterface:aSymbol |
1669 | 1025 |
"do not open as stand alone |
1026 |
" |
|
750 | 1027 |
! |
1028 |
||
1029 |
openOnClass:aClass |
|
1669 | 1030 |
"opens the UIHelpTool on aClass |
1031 |
" |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
1032 |
self openOnClass:aClass andSelector:nil |
940 | 1033 |
! |
1034 |
||
1035 |
openOnClass:aClass andSelector: aSelector |
|
1036 |
"opens the UIHelpTool on aClass and aSelector" |
|
1037 |
||
1669 | 1038 |
super openInterface:#windowSpecForStandAlone. |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
1039 |
|
940 | 1040 |
builder window label: 'Help Tool'. |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1554
diff
changeset
|
1041 |
self buildFromClass:aClass andSelector:aSelector |
369 | 1042 |
! ! |
1043 |
||
740 | 1044 |
!UIHelpTool methodsFor:'user actions'! |
286 | 1045 |
|
722 | 1046 |
accept |
1669 | 1047 |
"accepts the help text |
1048 |
" |
|
1049 |
|helpKey helpItem root| |
|
779 | 1050 |
|
1669 | 1051 |
helpKey := self helpKey. |
1052 |
helpKey isNil ifTrue:[^ self]. |
|
1646 | 1053 |
|
1669 | 1054 |
root := classItemModel value. |
1055 |
root isNil ifTrue:[^ self]. |
|
1056 |
||
1057 |
helpItem := root detectItemWithKey:helpKey. |
|
1648
d88ec5777284
empty help string - add key anyway
Claus Gittinger <cg@exept.de>
parents:
1646
diff
changeset
|
1058 |
|
1669 | 1059 |
helpItem isNil ifTrue:[ |
1670 | 1060 |
helpItem := KeyItem helpKey:helpKey helpText:(helpTextView contents). |
1061 |
root add:helpItem sortBlock:[:a :b| a label < b label ]. |
|
1062 |
self updateIcons. |
|
1669 | 1063 |
] ifFalse:[ |
1670 | 1064 |
helpItem helpText:(helpTextView contents). |
1646 | 1065 |
]. |
722 | 1066 |
|
1669 | 1067 |
contentsModifiedChannel value:false. |
1068 |
keyItemModel triggerValue:helpItem. |
|
722 | 1069 |
! |
1070 |
||
1646 | 1071 |
cancel |
1669 | 1072 |
"cancel modifications, reload helpText |
1073 |
" |
|
1074 |
|item contents modified| |
|
1646 | 1075 |
|
1669 | 1076 |
item := keyItemModel value. |
1077 |
modified := false. |
|
779 | 1078 |
|
1669 | 1079 |
item notNil ifTrue:[ |
1080 |
contents := item helpText. |
|
1081 |
] ifFalse:[ |
|
1082 |
contents := nil. |
|
1083 |
||
1084 |
modifiedHolder isNil ifTrue:[ |
|
1085 |
modified := self helpKey notNil |
|
1086 |
] |
|
1646 | 1087 |
]. |
1669 | 1088 |
helpTextView contents:contents. |
1089 |
contentsModifiedChannel value:modified. |
|
722 | 1090 |
! |
1091 |
||
750 | 1092 |
doDelete |
1646 | 1093 |
"deletes the selected help key |
1094 |
" |
|
1669 | 1095 |
|item| |
1646 | 1096 |
|
1669 | 1097 |
item := keyItemModel value. |
1670 | 1098 |
|
1099 |
item notNil ifTrue:[ |
|
1100 |
item remove. |
|
1101 |
item icon notNil ifTrue:[ self updateIcons ]. |
|
1102 |
]. |
|
1669 | 1103 |
editModel value:nil. |
722 | 1104 |
! |
1105 |
||
750 | 1106 |
doLoad |
1669 | 1107 |
"opens a Resource Selection Browser in order to get a resource message |
1108 |
" |
|
750 | 1109 |
self loadFromMessage: |
1681 | 1110 |
(ResourceSelectionBrowser |
1111 |
request: 'Load Help Spec From Class' |
|
1112 |
onSuperclass: nil |
|
1113 |
andClass: specClass |
|
1114 |
andSelector: (self specSelector) |
|
1115 |
withResourceTypes: (Array with: #help)). |
|
779 | 1116 |
|
1117 |
self updateInfoLabel |
|
750 | 1118 |
! |
286 | 1119 |
|
750 | 1120 |
doNew |
1669 | 1121 |
"reset all to empty |
1122 |
" |
|
1123 |
contentsModifiedChannel value:false. |
|
1124 |
self helpKey:nil. |
|
1125 |
self buildFromClass:nil. |
|
750 | 1126 |
! |
1127 |
||
722 | 1128 |
doSave |
1669 | 1129 |
"save the help spec to the spec-class(es) |
1130 |
" |
|
1131 |
specClass isNil ifTrue:[ |
|
1132 |
self information:(resources string:'No class specified !!'). |
|
1133 |
^ nil |
|
1134 |
]. |
|
1777
fbf082828db6
allow save into non/AppModel classes
Claus Gittinger <cg@exept.de>
parents:
1775
diff
changeset
|
1135 |
"/ cg: the following test is rubbish !! |
fbf082828db6
allow save into non/AppModel classes
Claus Gittinger <cg@exept.de>
parents:
1775
diff
changeset
|
1136 |
"/ (specClass isSubclassOf:ApplicationModel) ifFalse:[ |
fbf082828db6
allow save into non/AppModel classes
Claus Gittinger <cg@exept.de>
parents:
1775
diff
changeset
|
1137 |
"/ self information:(resources string:'Cannot save help into non-Application class'). |
fbf082828db6
allow save into non/AppModel classes
Claus Gittinger <cg@exept.de>
parents:
1775
diff
changeset
|
1138 |
"/ ^ nil |
fbf082828db6
allow save into non/AppModel classes
Claus Gittinger <cg@exept.de>
parents:
1775
diff
changeset
|
1139 |
"/ ]. |
1669 | 1140 |
|
1681 | 1141 |
classItemList do:[:aClassItem| |
1142 |
aClassItem createHelpMethodNamed:(self specSelector) |
|
1143 |
]. |
|
1669 | 1144 |
! |
1145 |
||
1146 |
openDocumentation |
|
1147 |
"opens the documentation file of the Help Tool |
|
1148 |
" |
|
1149 |
self openHTMLDocument: 'tools/uipainter/HelpTool.html' |
|
1150 |
! ! |
|
1151 |
||
1152 |
!UIHelpTool::ClassItem class methodsFor:'instance creation'! |
|
1153 |
||
1154 |
onClass:aClass |
|
1155 |
|root| |
|
1156 |
||
1157 |
root := self new. |
|
1158 |
root onClass:aClass. |
|
1159 |
^ root |
|
1160 |
! ! |
|
1161 |
||
1162 |
!UIHelpTool::ClassItem methodsFor:'accessing'! |
|
1163 |
||
1164 |
list |
|
1165 |
"returns the hierarchical list assigned to the classItem; the |
|
1166 |
list contains the keyItems |
|
1167 |
" |
|
1168 |
list isNil ifTrue:[ |
|
1169 |
list := HierarchicalList new. |
|
1170 |
list showRoot:false. |
|
1171 |
list root:self. |
|
1172 |
]. |
|
1173 |
^ list |
|
1174 |
! |
|
1175 |
||
1176 |
theClass |
|
1177 |
"returns the class or nil if unspecified |
|
1178 |
" |
|
1179 |
^ theClass |
|
1180 |
! ! |
|
1181 |
||
1182 |
!UIHelpTool::ClassItem methodsFor:'change & update'! |
|
1183 |
||
1184 |
helpTextChangedFor:anItem |
|
1185 |
"called if an helpKey changed its contents |
|
1186 |
" |
|
1187 |
self model notNil ifTrue:[ |
|
1188 |
self modified:true. |
|
1189 |
anItem modified:true. |
|
1190 |
]. |
|
1191 |
! ! |
|
1192 |
||
1193 |
!UIHelpTool::ClassItem methodsFor:'code generation'! |
|
1194 |
||
1195 |
createHelpMethodNamed:aMethodName |
|
1196 |
|stream| |
|
1197 |
||
1198 |
(modified and:[theClass notNil]) ifFalse:[ |
|
1199 |
^ self |
|
1200 |
]. |
|
1201 |
stream := '' writeStream. |
|
1202 |
||
1203 |
stream nextPutAll: |
|
1204 |
aMethodName, '\' withCRs, |
|
1205 |
(ResourceSpecEditor codeGenerationCommentForClass:UIHelpTool) withCRs, |
|
1206 |
'\\' withCRs, |
|
1207 |
' "\' withCRs, |
|
1208 |
' UIHelpTool openOnClass:', theClass name asString ,' |
|
1209 |
" |
|
1210 |
||
1211 |
<resource: #help> |
|
1212 |
||
1213 |
^ super ', aMethodName, ' addPairsFrom:#( |
|
1214 |
||
1215 |
'. |
|
1216 |
||
1217 |
self do:[:aKeyItem| |helpText| |
|
1218 |
helpText := aKeyItem helpText. |
|
1219 |
helpText isNil ifTrue:[ helpText := '' ]. |
|
1220 |
||
1221 |
stream nextPutLine:(aKeyItem helpKey storeString). |
|
1222 |
stream nextPutLine:(helpText storeString); cr. |
|
1223 |
]. |
|
1224 |
stream nextPutLine:')'. |
|
1225 |
||
1226 |
Compiler |
|
1227 |
compile:(stream contents) |
|
1228 |
forClass:theClass class |
|
1229 |
inCategory:'help specs'. |
|
1230 |
||
1231 |
self modified:false. |
|
1232 |
! ! |
|
1233 |
||
1234 |
!UIHelpTool::ClassItem methodsFor:'displaying'! |
|
1235 |
||
1236 |
icon |
|
1237 |
"returns the display icon (always nil) |
|
1238 |
" |
|
1239 |
^ nil |
|
1240 |
! |
|
1241 |
||
1242 |
label |
|
1243 |
"returns the display label |
|
1244 |
" |
|
1245 |
|label| |
|
1246 |
||
1247 |
theClass notNil ifTrue:[ label := theClass name ] |
|
1248 |
ifFalse:[ label := '** not yet defined **' ]. |
|
1249 |
||
1250 |
modified ifTrue:[ |
|
1251 |
label := Text string:label color:(Color red). |
|
1252 |
]. |
|
1253 |
^ label |
|
1254 |
! ! |
|
1255 |
||
1256 |
!UIHelpTool::ClassItem methodsFor:'instance creation'! |
|
1257 |
||
1258 |
initialize |
|
1259 |
"setup defaults |
|
1260 |
" |
|
1261 |
super initialize. |
|
1262 |
||
1263 |
children := OrderedCollection new. |
|
1264 |
isExpanded := true. |
|
1265 |
modified := false. |
|
1266 |
! |
|
1267 |
||
1268 |
onClass:aClass |
|
1269 |
"the class the ys are assigned to; if the class is nil, |
|
1270 |
the class is not yet specified. |
|
1271 |
" |
|
1272 |
theClass := aClass. |
|
1273 |
! ! |
|
1274 |
||
1275 |
!UIHelpTool::ClassItem methodsFor:'private'! |
|
1276 |
||
1277 |
basicAdd:aChild sortBlock:aBlock |
|
1278 |
"catch low-level add to update the modification flag |
|
1279 |
" |
|
1280 |
self modified:true. |
|
1281 |
aChild modified:true. |
|
1282 |
||
1283 |
^ super basicAdd:aChild sortBlock:aBlock. |
|
1284 |
! |
|
1285 |
||
1286 |
basicAddAll:aList beforeIndex:anIndex |
|
1287 |
"catch low-level add to update the modification flag |
|
1288 |
" |
|
1289 |
self modified:true. |
|
1290 |
||
1291 |
aList do:[:el| el modified:true ]. |
|
1292 |
^ super basicAddAll:aList beforeIndex:anIndex. |
|
1293 |
! |
|
779 | 1294 |
|
1669 | 1295 |
basicRemoveFromIndex:startIndex toIndex:stopIndex |
1296 |
"catch low-level remove to update the modification flag |
|
1297 |
" |
|
1298 |
self isUnspecified ifFalse:[ |
|
1299 |
self modified:true. |
|
1300 |
]. |
|
1301 |
^ super basicRemoveFromIndex:startIndex toIndex:stopIndex |
|
1302 |
! ! |
|
1303 |
||
1304 |
!UIHelpTool::ClassItem methodsFor:'queries'! |
|
1305 |
||
1306 |
isUnspecified |
|
1307 |
"true if the class is unspecified |
|
1308 |
" |
|
1309 |
^ theClass isNil |
|
1310 |
! |
|
1311 |
||
1312 |
modified |
|
1313 |
"true, if any item is modified, created or deleted |
|
1314 |
" |
|
1315 |
^ modified |
|
1316 |
! |
|
1317 |
||
1318 |
modified:aBoolean |
|
1319 |
"true, if any item is modified, created or deleted |
|
1320 |
" |
|
1321 |
modified ~~ aBoolean ifTrue:[ |
|
1322 |
modified := aBoolean. |
|
1323 |
||
1324 |
modified ifFalse:[ |
|
1325 |
self do:[:el| el modified:false ]. |
|
1326 |
]. |
|
1327 |
]. |
|
1328 |
! ! |
|
1329 |
||
1330 |
!UIHelpTool::ClassItem methodsFor:'searching'! |
|
1331 |
||
1332 |
detectItemWithKey:aKey |
|
1333 |
"returns the item assigned to a helpKey or nil |
|
1334 |
" |
|
1335 |
|key| |
|
1336 |
||
1337 |
aKey size ~~ 0 ifTrue:[ |
|
1338 |
key := aKey asSymbol. |
|
1339 |
||
1340 |
self do:[:anItem| |
|
1341 |
anItem helpKey == key ifTrue:[ ^ anItem ]. |
|
1342 |
] |
|
1343 |
]. |
|
1344 |
^ nil |
|
1345 |
! ! |
|
1346 |
||
1347 |
!UIHelpTool::KeyItem class methodsFor:'instance creation'! |
|
1348 |
||
1681 | 1349 |
helpKey:aKey helpText:aText |
1669 | 1350 |
|key| |
1351 |
||
1352 |
key := self new. |
|
1353 |
key helpKey:aKey helpText:aText. |
|
1354 |
^ key |
|
1355 |
! ! |
|
1356 |
||
1357 |
!UIHelpTool::KeyItem methodsFor:'accessing'! |
|
1358 |
||
1359 |
helpKey |
|
1360 |
"returns the helpKey, a symbol |
|
1361 |
" |
|
1362 |
^ helpKey |
|
1363 |
! |
|
1364 |
||
1365 |
helpText |
|
1366 |
"returns the contents assigned to the helpKey or nil |
|
1367 |
" |
|
1368 |
^ helpText |
|
1369 |
! |
|
1370 |
||
1371 |
helpText:aText |
|
1681 | 1372 |
"set the contents assigned to the helpKey; if the contents changes, |
1669 | 1373 |
a notification is raised. |
1374 |
" |
|
1375 |
|text| |
|
1376 |
||
1377 |
text := self formatText:aText. |
|
1378 |
||
1379 |
text ~= helpText ifTrue:[ |
|
1681 | 1380 |
helpText := text. |
1669 | 1381 |
|
1681 | 1382 |
(modified or:[parent isNil]) ifFalse:[ |
1383 |
parent helpTextChangedFor:self. |
|
1384 |
] |
|
1669 | 1385 |
]. |
1386 |
! ! |
|
1387 |
||
1388 |
!UIHelpTool::KeyItem methodsFor:'displaying'! |
|
1389 |
||
1390 |
icon |
|
1391 |
"returns the display icon (always nil) |
|
1392 |
" |
|
1670 | 1393 |
^ icon |
1394 |
! |
|
1395 |
||
1396 |
icon:anIcon |
|
1397 |
||
1398 |
icon ~= anIcon ifTrue:[ |
|
1399 |
icon := anIcon. |
|
1400 |
self changed:#icon. |
|
1401 |
]. |
|
1669 | 1402 |
! |
1403 |
||
1404 |
label |
|
1405 |
"returns the display label |
|
1406 |
" |
|
1407 |
modified ifTrue:[ |
|
1408 |
^ Text string:helpKey color:(Color red) |
|
1409 |
]. |
|
1410 |
^ helpKey |
|
1411 |
! ! |
|
1412 |
||
1413 |
!UIHelpTool::KeyItem methodsFor:'instance creation'! |
|
1414 |
||
1415 |
helpKey:aKey helpText:aText |
|
1416 |
"set the key and contents without a change notification |
|
1417 |
" |
|
1418 |
helpKey := aKey asSymbol. |
|
1419 |
helpText := self formatText:aText. |
|
1420 |
! |
|
1421 |
||
1422 |
initialize |
|
1423 |
"setup defaults |
|
1424 |
" |
|
1425 |
super initialize. |
|
1426 |
children := #(). |
|
1427 |
modified := false. |
|
1428 |
! ! |
|
1429 |
||
1430 |
!UIHelpTool::KeyItem methodsFor:'private'! |
|
1431 |
||
1432 |
formatText:aText |
|
1433 |
"format the text, replace carriage return by spaces and compress spaces |
|
1434 |
" |
|
1435 |
|text result| |
|
1436 |
||
1437 |
aText size ~~ 0 ifTrue:[ |
|
1438 |
text := aText asString asCollectionOfWords. |
|
1439 |
||
1440 |
text notEmpty ifTrue:[ |
|
1441 |
result := text first. |
|
1442 |
||
1443 |
text from:2 do:[:t| result := result, ' ', t ]. |
|
1444 |
^ result |
|
1445 |
]. |
|
1446 |
]. |
|
1447 |
^ nil |
|
1448 |
! ! |
|
1449 |
||
1450 |
!UIHelpTool::KeyItem methodsFor:'queries'! |
|
1451 |
||
1452 |
modified |
|
1453 |
"returns true if the helpText is modified |
|
1454 |
" |
|
1455 |
^ modified |
|
1456 |
! |
|
1457 |
||
1458 |
modified:aBoolean |
|
1459 |
"set the modification flag |
|
1460 |
" |
|
1461 |
aBoolean == modified ifFalse:[ |
|
1462 |
modified := aBoolean. |
|
1463 |
self changed:#redraw. |
|
1464 |
]. |
|
148 | 1465 |
! ! |
1466 |
||
1467 |
!UIHelpTool class methodsFor:'documentation'! |
|
1468 |
||
1469 |
version |
|
1470 |
^ '$Header$' |
|
1471 |
! ! |