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