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