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