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