author | Claus Gittinger <cg@exept.de> |
Thu, 22 Oct 2009 21:50:33 +0200 | |
changeset 2662 | 75fe8cbca316 |
parent 2631 | 8d74338aa3bd |
child 2743 | a3413ff28529 |
permissions | -rw-r--r-- |
164 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
1386 | 12 |
"{ Package: 'stx:libtool2' }" |
13 |
||
164 | 14 |
ApplicationModel subclass:#UISpecificationTool |
759 | 15 |
instanceVariableNames:'modifiedHolder aspects specification selection specChannel |
1307 | 16 |
buildInView listOfSpecViews' |
164 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-UIPainter' |
|
20 |
! |
|
21 |
||
1307 | 22 |
ViewScroller subclass:#BuildInView |
1573 | 23 |
instanceVariableNames:'' |
1307 | 24 |
classVariableNames:'' |
25 |
poolDictionaries:'' |
|
26 |
privateIn:UISpecificationTool |
|
27 |
! |
|
28 |
||
164 | 29 |
!UISpecificationTool class methodsFor:'documentation'! |
30 |
||
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
34 |
All Rights Reserved |
|
35 |
||
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
||
44 |
||
45 |
||
46 |
! |
|
47 |
||
48 |
documentation |
|
49 |
" |
|
50 |
used by the UIPainter to manipulate the specifications of the selected component |
|
51 |
||
52 |
[author:] |
|
53 |
Claus Atzkern |
|
54 |
||
55 |
[see also:] |
|
56 |
UIPainter |
|
57 |
UILayoutTool |
|
58 |
UIHelpTool |
|
59 |
" |
|
60 |
! ! |
|
61 |
||
1963
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
62 |
!UISpecificationTool class methodsFor:'help specs'! |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
63 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
64 |
helpSpec |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
65 |
"This resource specification was automatically generated |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
66 |
by the UIHelpTool of ST/X." |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
67 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
68 |
"Do not manually edit this!! If it is corrupted, |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
69 |
the UIHelpTool may not be able to read the specification." |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
70 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
71 |
" |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
72 |
UIHelpTool openOnClass:UISpecificationTool |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
73 |
" |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
74 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
75 |
<resource: #help> |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
76 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
77 |
^ super helpSpec addPairsFrom:#( |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
78 |
|
2316
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
79 |
#allowSymbolicColors |
2335 | 80 |
'ColorMenu is allowed to return a symbolic color name' |
81 |
||
82 |
#allowSymbolicFonts |
|
83 |
'FontMenu is allowed to return a symbolic font name' |
|
2316
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
84 |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
85 |
#browseAction |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
86 |
'Browse/Create the Action method.' |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
87 |
|
2237
c1d95982e1c3
browse/generate aspect methods
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
88 |
#browseAspectMethod |
c1d95982e1c3
browse/generate aspect methods
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
89 |
'Browse/Create the Aspect method.' |
c1d95982e1c3
browse/generate aspect methods
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
90 |
|
2283 | 91 |
#editListSpec |
92 |
'Edit the contents of the list (inline)' |
|
93 |
||
2316
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
94 |
#labelsAreColored |
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
95 |
'Show color in ColorMenuLabels' |
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
96 |
|
2377 | 97 |
#showFrame |
98 |
'Show the frame' |
|
99 |
||
1963
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
100 |
) |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
101 |
! ! |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
102 |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
103 |
!UISpecificationTool class methodsFor:'image specs'! |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
104 |
|
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
105 |
browseActionImage |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
106 |
^ UIPainter browseActionImage |
2283 | 107 |
! |
108 |
||
109 |
editTableIcon |
|
110 |
^ UIPainter editTableIcon |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
111 |
! ! |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
112 |
|
164 | 113 |
!UISpecificationTool class methodsFor:'interface specs'! |
114 |
||
115 |
windowSpec |
|
1307 | 116 |
"This resource specification was automatically generated |
117 |
by the UIPainter of ST/X." |
|
164 | 118 |
|
1307 | 119 |
"Do not manually edit this!! If it is corrupted, |
120 |
the UIPainter may not be able to read the specification." |
|
164 | 121 |
|
122 |
" |
|
123 |
UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec |
|
124 |
UISpecificationTool new openInterface:#windowSpec |
|
1307 | 125 |
UISpecificationTool open |
164 | 126 |
" |
127 |
||
128 |
<resource: #canvas> |
|
129 |
||
1307 | 130 |
^ |
131 |
#(#FullSpec |
|
132 |
#name: #windowSpec |
|
133 |
#window: |
|
134 |
#(#WindowSpec |
|
135 |
#label: 'unnamed canvas' |
|
136 |
#name: 'unnamed canvas' |
|
1313 | 137 |
#bounds: #(#Rectangle 12 22 312 322) |
1307 | 138 |
) |
139 |
#component: |
|
140 |
#(#SpecCollection |
|
141 |
#collection: #( |
|
142 |
#(#ArbitraryComponentSpec |
|
1313 | 143 |
#name: 'BuildInView' |
1307 | 144 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1313 | 145 |
#hasVerticalScrollBar: true |
146 |
#miniScrollerVertical: true |
|
147 |
#autoHideScrollBars: true |
|
1307 | 148 |
#hasBorder: false |
1313 | 149 |
#component: #buildInView |
1307 | 150 |
) |
151 |
) |
|
152 |
||
153 |
) |
|
164 | 154 |
) |
155 |
! ! |
|
156 |
||
1781
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
157 |
!UISpecificationTool class methodsFor:'resources'! |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
158 |
|
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
159 |
classResources |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
160 |
"my translations are found in the UIPainter classes resources" |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
161 |
|
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
162 |
^ UIPainter classResources |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
163 |
! ! |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
164 |
|
1331 | 165 |
!UISpecificationTool methodsFor:'accessing-channels'! |
1315 | 166 |
|
167 |
modifiedHolder:aValueHolder |
|
168 |
"set the value holder set to true in case of modifying attributes |
|
169 |
" |
|
170 |
||
171 |
modifiedHolder removeDependent:self. |
|
164 | 172 |
|
1315 | 173 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
174 |
modifiedHolder addDependent:self. |
|
175 |
]. |
|
1063
9e710dbc7c92
inputFields use modified & acceptChannels
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
176 |
|
1315 | 177 |
! ! |
178 |
||
1331 | 179 |
!UISpecificationTool methodsFor:'accessing-specification'! |
1063
9e710dbc7c92
inputFields use modified & acceptChannels
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
180 |
|
2245 | 181 |
listOfAspects |
182 |
^ masterApplication listOfAspects |
|
183 |
||
184 |
"Created: / 12-01-2008 / 19:24:39 / cg" |
|
185 |
! |
|
186 |
||
187 |
listOfCallbacks |
|
188 |
^ masterApplication listOfCallbacks |
|
189 |
||
190 |
"Created: / 12-01-2008 / 19:25:05 / cg" |
|
191 |
! |
|
192 |
||
172 | 193 |
specification |
194 |
"gets current edit specification |
|
195 |
" |
|
196 |
^ specification |
|
197 |
||
198 |
||
199 |
! |
|
200 |
||
201 |
specification:aSpec |
|
202 |
"sets current edit specification |
|
203 |
" |
|
1315 | 204 |
aSpec notNil ifTrue:[ |
205 |
"/ same type of spec - simply change the spec; no need to setup everything |
|
206 |
specification class == aSpec class ifTrue:[ |
|
207 |
specification := aSpec. |
|
208 |
specChannel value:specification. |
|
209 |
^ self |
|
210 |
] |
|
1307 | 211 |
]. |
428 | 212 |
|
1315 | 213 |
"/ release resources |
214 |
specChannel release. |
|
215 |
aspects release. |
|
216 |
selection := listOfSpecViews := nil. |
|
1573 | 217 |
buildInView destroyAllClientViews. |
1315 | 218 |
|
219 |
(specification := aSpec) isNil ifTrue:[ |
|
220 |
aspects := specChannel := nil. |
|
221 |
^ self |
|
1307 | 222 |
]. |
223 |
||
224 |
"/ some tricky specs need the builder during the addBindings phase. |
|
225 |
"/ This is passed down in a special UIBindingsDictionary |
|
226 |
"/ (remain backward compatible) |
|
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
227 |
|
1307 | 228 |
aspects := UISpecification newBindingsDictionary. |
229 |
aspects builder:builder. |
|
230 |
aspects at:#modifiedChannel put:modifiedHolder. |
|
231 |
aspects at:#acceptChannel put:self acceptChannel. |
|
172 | 232 |
|
2245 | 233 |
aspects at:#listOfAspects put:[self listOfAspects]. |
234 |
aspects at:#listOfCallbacks put:[self listOfCallbacks]. |
|
235 |
||
1307 | 236 |
specChannel := specification asValue. |
237 |
specification class addBindingsTo:aspects for:specification channel:specChannel. |
|
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
238 |
|
1307 | 239 |
"/ arrange for being notified, if any aspect changes |
240 |
aspects do:[:el| el addDependent:self ]. |
|
2245 | 241 |
|
242 |
"Modified: / 12-01-2008 / 19:28:47 / cg" |
|
172 | 243 |
! ! |
244 |
||
364 | 245 |
!UISpecificationTool methodsFor:'actions'! |
246 |
||
247 |
setMaxExtent |
|
248 |
"set the windows maxExtent from its current extent" |
|
249 |
||
250 |
|canvas currentExtent| |
|
251 |
||
2211 | 252 |
canvas := self masterApplication canvas. |
364 | 253 |
currentExtent := canvas extent. |
254 |
(self aspectFor:#maxX) value:currentExtent x. |
|
255 |
(self aspectFor:#maxY) value:currentExtent y. |
|
256 |
||
257 |
"Modified: / 29.10.1997 / 18:29:17 / cg" |
|
258 |
! |
|
259 |
||
260 |
setMinExtent |
|
261 |
"set the windows minExtent from its current extent" |
|
262 |
||
263 |
|canvas currentExtent| |
|
264 |
||
2211 | 265 |
canvas := self masterApplication canvas. |
364 | 266 |
currentExtent := canvas extent. |
267 |
(self aspectFor:#minX) value:currentExtent x. |
|
268 |
(self aspectFor:#minY) value:currentExtent y. |
|
269 |
||
270 |
"Created: / 29.10.1997 / 18:17:55 / cg" |
|
271 |
"Modified: / 29.10.1997 / 18:28:53 / cg" |
|
272 |
! ! |
|
273 |
||
164 | 274 |
!UISpecificationTool methodsFor:'bindings'! |
275 |
||
1315 | 276 |
acceptChannel |
2245 | 277 |
^ masterApplication acceptChannel |
1315 | 278 |
|
2245 | 279 |
"Modified: / 12-01-2008 / 11:28:38 / cg" |
1315 | 280 |
! |
281 |
||
164 | 282 |
aspectFor:aKey |
2245 | 283 |
"returns the aspect for a key or nil" |
284 |
||
164 | 285 |
aspects notNil ifTrue:[ |
286 |
^ aspects at:aKey ifAbsent:nil |
|
287 |
]. |
|
288 |
^ super aspectFor:aKey |
|
289 |
||
2245 | 290 |
"Modified: / 12-01-2008 / 11:28:52 / cg" |
428 | 291 |
! |
292 |
||
1313 | 293 |
buildInView |
294 |
^ buildInView |
|
1307 | 295 |
! |
296 |
||
584
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
297 |
specificationFor:aKey |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
298 |
"this is called if our current specification contains |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
299 |
subspecifications or subcanvases. |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
300 |
Get the subspecification from the current specification" |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
301 |
|
1307 | 302 |
specification notNil ifTrue:[ |
303 |
^ specification class perform:aKey ifNotUnderstood:nil |
|
584
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
304 |
]. |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
305 |
^ nil |
172 | 306 |
! ! |
307 |
||
308 |
!UISpecificationTool methodsFor:'change & update'! |
|
164 | 309 |
|
172 | 310 |
update |
311 |
"reload specification |
|
164 | 312 |
" |
172 | 313 |
specChannel notNil ifTrue:[ |
314 |
specChannel value:specification. |
|
315 |
] |
|
164 | 316 |
|
317 |
||
318 |
! |
|
319 |
||
320 |
update:something with:someArgument from:someone |
|
321 |
"any attribute changed its state in the current specification |
|
322 |
" |
|
323 |
someone ~~ modifiedHolder ifTrue:[ |
|
893 | 324 |
"/ any in the spec has changed. |
325 |
"/ update my modified holders value |
|
326 |
||
1071 | 327 |
modifiedHolder value:true |
164 | 328 |
] |
329 |
||
893 | 330 |
"Modified: / 16.7.1998 / 19:25:59 / cg" |
164 | 331 |
! ! |
332 |
||
1956 | 333 |
!UISpecificationTool methodsFor:'help'! |
334 |
||
2524
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
335 |
basicFlyByHelpTextForKey:aKey |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
336 |
"activeHelp interface: return some help text for a key. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
337 |
Redefined to ask the current components Spec first." |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
338 |
|
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
339 |
|helpText| |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
340 |
|
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
341 |
"/ first, ask the master (a hook for expecco, to provide different help texts) |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
342 |
masterApplication notNil ifTrue:[ |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
343 |
helpText := masterApplication basicFlyByHelpTextForKey:aKey. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
344 |
helpText notNil ifTrue:[^ helpText ]. |
2545
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
345 |
|
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
346 |
"/ then, ask the master about the spec |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
347 |
helpText := masterApplication basicHelpTextFromSpecification:specification forKey:aKey. |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
348 |
] ifFalse:[ |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
349 |
"/ then, ask the spec |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
350 |
helpText := (specification helpSpec) at:aKey ifAbsent:nil. |
2524
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
351 |
]. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
352 |
helpText notNil ifTrue:[^ helpText ]. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
353 |
|
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
354 |
"/ finally, ask myself... |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
355 |
^ super basicFlyByHelpTextForKey:aKey. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
356 |
! |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
357 |
|
1956 | 358 |
basicHelpTextForKey:aKey |
359 |
"activeHelp interface: return some help text for a key. |
|
360 |
Redefined to ask the current components Spec first." |
|
361 |
||
362 |
|helpText| |
|
363 |
||
2524
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
364 |
"/ first, ask the master (a hook for expecco, to provide different help texts) |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
365 |
masterApplication notNil ifTrue:[ |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
366 |
helpText := masterApplication basicHelpTextForKey:aKey. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
367 |
helpText notNil ifTrue:[^ helpText ]. |
2545
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
368 |
|
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
369 |
"/ then, ask the master about the spec |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
370 |
helpText := masterApplication basicHelpTextFromSpecification:specification forKey:aKey. |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
371 |
] ifFalse:[ |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
372 |
"/ then, ask the spec |
cd5d45739973
more flexible flyByHelpText redefinition
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
373 |
helpText := (specification helpSpec) at:aKey ifAbsent:nil. |
2524
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
374 |
]. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
375 |
helpText notNil ifTrue:[^ helpText ]. |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
376 |
|
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
377 |
"/ finally, ask myself... |
759b4b908fcb
allow master to provide an alternative help text
Claus Gittinger <cg@exept.de>
parents:
2377
diff
changeset
|
378 |
^ super basicHelpTextForKey:aKey. |
1956 | 379 |
! ! |
380 |
||
1315 | 381 |
!UISpecificationTool methodsFor:'initialization'! |
382 |
||
383 |
initialize |
|
384 |
super initialize. |
|
385 |
buildInView := BuildInView new. |
|
1573 | 386 |
buildInView keepViews:true. |
1315 | 387 |
! ! |
388 |
||
164 | 389 |
!UISpecificationTool methodsFor:'selection'! |
390 |
||
391 |
selection:something |
|
172 | 392 |
"selection changed |
393 |
" |
|
1307 | 394 |
|slices index spec window| |
164 | 395 |
|
172 | 396 |
specification notNil ifTrue:[ |
397 |
slices := specification class slices. |
|
1307 | 398 |
index := slices findFirst:[:aSlice| aSlice first = something ]. |
164 | 399 |
|
1307 | 400 |
index ~~ 0 ifTrue:[ |
401 |
spec := specification class perform:((slices at:index) last) |
|
428 | 402 |
] |
164 | 403 |
]. |
404 |
||
172 | 405 |
spec ~= selection ifTrue:[ |
1307 | 406 |
(selection := spec) notNil ifTrue:[ |
407 |
listOfSpecViews isNil ifTrue:[ |
|
408 |
listOfSpecViews := Array new:(slices size). |
|
409 |
] ifFalse:[ |
|
410 |
window := listOfSpecViews at:index |
|
411 |
]. |
|
412 |
window isNil ifTrue:[ |
|
413 |
builder buildFromSpec:spec in:(window := SimpleView new). |
|
414 |
listOfSpecViews at:index put:window. |
|
415 |
]. |
|
416 |
]. |
|
1315 | 417 |
buildInView scrolledView:window. |
164 | 418 |
]. |
419 |
! ! |
|
420 |
||
1307 | 421 |
!UISpecificationTool::BuildInView methodsFor:'accessing'! |
759 | 422 |
|
2160 | 423 |
mapped |
424 |
super mapped. |
|
425 |
||
426 |
scrolledView notNil ifTrue:[ |
|
427 |
scrolledView beVisible. |
|
428 |
scrolledView raise. |
|
429 |
]. |
|
430 |
! |
|
431 |
||
1307 | 432 |
scrolledView:aView |
433 |
"set the view to be scrolled" |
|
1573 | 434 |
|wrapper y| |
1307 | 435 |
|
436 |
scrolledView == aView ifTrue:[^ self]. |
|
759 | 437 |
|
2160 | 438 |
scrolledView notNil ifTrue:[ |
439 |
scrolledView unmap. |
|
440 |
]. |
|
441 |
(scrolledView := aView) notNil ifTrue:[ |
|
442 |
scrolledView superView ~~ frame ifTrue:[ |
|
443 |
scrolledView borderWidth:0; level:0. |
|
1307 | 444 |
|
2160 | 445 |
frame addSubView:scrolledView. |
1573 | 446 |
|
2160 | 447 |
scrolledView subViews size == 1 ifTrue:[ |
448 |
wrapper := scrolledView subViews first. |
|
449 |
wrapper isScrollWrapper ifTrue:[ |
|
450 |
"/ give it a full-relative size, and let it do |
|
451 |
"/ the scrolling itself. |
|
452 |
y := 1.0 |
|
453 |
] |
|
454 |
]. |
|
455 |
y isNil ifTrue:[ |
|
2350 | 456 |
y := scrolledView preferredHeight |
2160 | 457 |
]. |
458 |
scrolledView origin:0@0 corner:1.0 @ y. |
|
459 |
scrolledView allViewBackground:(self viewBackground). |
|
1351
811686e8acab
no additional scrollBar, if embedded view is itself a scrollable
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
460 |
]. |
2160 | 461 |
]. |
462 |
shown ifTrue:[ |
|
463 |
scrolledView beVisible. |
|
464 |
scrolledView raise. |
|
1307 | 465 |
self sizeChanged:nil. |
466 |
]. |
|
1573 | 467 |
model value:scrolledView. |
759 | 468 |
! ! |
469 |
||
1313 | 470 |
!UISpecificationTool::BuildInView methodsFor:'initialization'! |
471 |
||
472 |
level:aLevel |
|
473 |
super level:0 |
|
474 |
! |
|
475 |
||
476 |
realize |
|
1315 | 477 |
|
1313 | 478 |
super realize. |
479 |
superView notNil ifTrue:[superView level:0]. |
|
480 |
! ! |
|
481 |
||
164 | 482 |
!UISpecificationTool class methodsFor:'documentation'! |
483 |
||
484 |
version |
|
485 |
^ '$Header$' |
|
2631 | 486 |
! |
487 |
||
488 |
version_CVS |
|
489 |
^ '$Header$' |
|
164 | 490 |
! ! |