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