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