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