author | Claus Gittinger <cg@exept.de> |
Wed, 07 Sep 2011 04:47:27 +0200 | |
changeset 4071 | d056c9f9b595 |
parent 3671 | a43da2ee728e |
child 4508 | 5c8959e41aa6 |
permissions | -rw-r--r-- |
3650 | 1 |
"{ Package: 'stx:libwidg2' }" |
2 |
||
3 |
Button subclass:#LinkButton |
|
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
4 |
instanceVariableNames:'labelsAndActions' |
3662 | 5 |
classVariableNames:'DefaultLinkColor' |
3650 | 6 |
poolDictionaries:'' |
7 |
category:'Views-Layout' |
|
8 |
! |
|
9 |
||
10 |
!LinkButton class methodsFor:'documentation'! |
|
11 |
||
12 |
documentation |
|
13 |
" |
|
14 |
Looks like a Label, but behaves like a button with individually clickable text components. |
|
4071 | 15 |
Can be used to create html-page-look-alike links in a view. |
3650 | 16 |
|
17 |
[author:] |
|
18 |
cg (cg@CG-VOSTRO) |
|
19 |
||
20 |
[instance variables:] |
|
21 |
||
22 |
[class variables:] |
|
23 |
||
24 |
[see also:] |
|
25 |
||
26 |
" |
|
27 |
! |
|
28 |
||
29 |
examples |
|
30 |
" |
|
4071 | 31 |
[exBegin] |
3650 | 32 |
|v l| |
33 |
||
34 |
v := StandardSystemView new. |
|
35 |
l := LinkButton in:v. |
|
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
36 |
l label: |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
37 |
(('Hello' actionForAll:[ Transcript showCR:'Hello Clicked']) |
4071 | 38 |
, ' ' |
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
39 |
, ('World' actionForAll:[ Transcript showCR:'World Clicked'])). |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
40 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
41 |
l foregroundColor:Color blue. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
42 |
v open |
4071 | 43 |
[exEnd] |
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
44 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
45 |
|
4071 | 46 |
[exBegin] |
47 |
|v l| |
|
48 |
||
49 |
v := StandardSystemView new. |
|
50 |
l := LinkButton in:v. |
|
51 |
l label: |
|
52 |
((('Hello' actionForAll:[ Transcript showCR:'Hello Clicked']) colorizeAllWith:(Color blue)) |
|
53 |
, ' ' |
|
54 |
, ('World' actionForAll:[ Transcript showCR:'World Clicked'])). |
|
55 |
||
56 |
v open |
|
57 |
[exEnd] |
|
58 |
||
59 |
||
60 |
[exBegin] |
|
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
61 |
|v l| |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
62 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
63 |
v := StandardSystemView new. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
64 |
l := LinkButton in:v. |
3650 | 65 |
l labelsAndActions:{ |
3662 | 66 |
'Hello' -> [ Transcript showCR:'Hello Clicked']. |
3650 | 67 |
' ' -> nil. |
3662 | 68 |
'World' -> [ Transcript showCR:'World Clicked']. |
3650 | 69 |
}. |
70 |
l foregroundColor:Color blue. |
|
71 |
v open |
|
4071 | 72 |
[exEnd] |
3668 | 73 |
|
74 |
||
4071 | 75 |
[exBegin] |
3668 | 76 |
|v l| |
77 |
||
78 |
v := StandardSystemView new. |
|
79 |
l := LinkButton in:v. |
|
80 |
l labelsAndActions:{ |
|
81 |
'Hello' -> nil. |
|
82 |
' ' -> nil. |
|
83 |
'World' -> [ Transcript showCR:'World Clicked']. |
|
84 |
}. |
|
85 |
l foregroundColor:Color blue. |
|
86 |
v open |
|
4071 | 87 |
[exEnd] |
3650 | 88 |
" |
89 |
! ! |
|
90 |
||
3662 | 91 |
!LinkButton class methodsFor:'defaults'! |
92 |
||
93 |
updateStyleCache |
|
94 |
"extract values from the styleSheet and cache them in class variables" |
|
95 |
||
96 |
<resource: #style ( #'linkButton.linkColor' )> |
|
97 |
||
98 |
DefaultLinkColor := StyleSheet colorAt:#'linkButton.linkColor' default:Color blue. |
|
99 |
! ! |
|
100 |
||
3650 | 101 |
!LinkButton methodsFor:'accessing'! |
102 |
||
103 |
labelsAndActions |
|
104 |
"returns the collection of label->action associations. |
|
105 |
For display, the label strings are drawn as one concatenated string (add separating spaces, if you have to). |
|
106 |
When clicked on a string, the corresponding action is called" |
|
107 |
||
108 |
^ labelsAndActions |
|
109 |
! |
|
110 |
||
111 |
labelsAndActions:aCollectionOfAssociations |
|
112 |
"set the collection of label->action associations. |
|
113 |
For display, the label strings are drawn as one concatenated string (add separating spaces, if you have to). |
|
114 |
When clicked on a string, the corresponding action is called" |
|
115 |
||
116 |
labelsAndActions := aCollectionOfAssociations. |
|
117 |
self label:((aCollectionOfAssociations collect:[:assoc | assoc key]) asStringWith:'') |
|
118 |
! ! |
|
119 |
||
120 |
!LinkButton methodsFor:'initialization'! |
|
121 |
||
122 |
defaultControllerClass |
|
123 |
^ LinkButtonController |
|
3662 | 124 |
! |
125 |
||
126 |
initStyle |
|
127 |
super initStyle. |
|
128 |
||
129 |
level := enterLevel := leaveLevel := onLevel := offLevel := 0. |
|
130 |
DefaultLinkColor notNil ifTrue:[ |
|
131 |
foreground := DefaultLinkColor onDevice:device. |
|
132 |
]. |
|
4071 | 133 |
enteredFgColor := nil. "/ Color blue. |
134 |
||
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
135 |
"/ activeFgColor := enteredFgColor := foreground. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
136 |
"/ activeBgColor := enteredBgColor := viewBackground. |
4071 | 137 |
|
138 |
"Modified: / 07-09-2011 / 04:29:29 / cg" |
|
3662 | 139 |
! |
140 |
||
141 |
initialize |
|
142 |
super initialize. |
|
143 |
self enableMotionEvents |
|
144 |
! ! |
|
145 |
||
146 |
!LinkButton methodsFor:'redrawing'! |
|
147 |
||
148 |
actionAt:aPoint |
|
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
149 |
|pressAction emphasis| |
3664 | 150 |
|
151 |
pressAction := self pressAction ? self releaseAction. |
|
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
152 |
labelsAndActions isNil ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
153 |
"take action from logo, which is normally a text" |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
154 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
155 |
emphasis := logo emphasisAtPoint:aPoint on:self. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
156 |
(emphasis isNil or:[emphasis isSymbol]) ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
157 |
^ pressAction. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
158 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
159 |
emphasis isAssociation ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
160 |
emphasis key == #actionBlock ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
161 |
^ emphasis value. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
162 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
163 |
^ pressAction. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
164 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
165 |
emphasis do:[:eachElement| |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
166 |
eachElement isAssociation ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
167 |
eachElement key == #actionBlock ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
168 |
^ eachElement value. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
169 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
170 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
171 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
172 |
^ pressAction. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
173 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
174 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
175 |
|
3662 | 176 |
self labelsAndActionsWithPositionsDo:[:lbl :action :leftX :rightX | |
177 |
(aPoint x between:leftX and:rightX) ifTrue:[ |
|
3664 | 178 |
^ labelsAndActions notNil ifTrue:action ifFalse:pressAction |
3662 | 179 |
]. |
180 |
]. |
|
181 |
^ nil |
|
182 |
! |
|
183 |
||
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
184 |
actionEmphasisIn:aText atPoint:aPoint |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
185 |
"check for a actionBlock emphasis in aString at aPoint. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
186 |
Answer an Array with the whole emphasis and the actionBlock, |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
187 |
or nil" |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
188 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
189 |
|emphasis| |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
190 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
191 |
emphasis := aText emphasisAtPoint:aPoint on:self. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
192 |
(emphasis isNil or:[emphasis isSymbol]) ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
193 |
^ #(nil nil). |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
194 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
195 |
emphasis isAssociation ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
196 |
emphasis key == #actionBlock ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
197 |
^ Array with:emphasis with:emphasis value. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
198 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
199 |
^ #(nil nil). |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
200 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
201 |
emphasis detect:[:eachElement| |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
202 |
eachElement isAssociation ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
203 |
eachElement key == #actionBlock ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
204 |
^ Array with:emphasis with:eachElement value. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
205 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
206 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
207 |
] ifNone:[]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
208 |
^ #(nil nil). |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
209 |
! |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
210 |
|
3662 | 211 |
drawStringLogo:aString x:x y:y |
212 |
"redefined to draw the part under the mouse pointer with an underined emphasis" |
|
213 |
||
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
214 |
|str entered mousePoint start len emphasis| |
3662 | 215 |
|
216 |
mousePoint := controller lastMousePoint. |
|
217 |
entered := controller entered. |
|
218 |
||
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
219 |
labelsAndActions isNil ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
220 |
(entered not or:[mousePoint isNil]) ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
221 |
self displayString:aString x:x y:y. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
222 |
^ self. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
223 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
224 |
|
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
225 |
str := aString. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
226 |
emphasis := (self actionEmphasisIn:aString atPoint:mousePoint) first. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
227 |
emphasis notNil ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
228 |
start := 1. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
229 |
aString emphasisCollection runsDo:[:eachLen :eachEmphasis| |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
230 |
len isNil ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
231 |
eachEmphasis == emphasis ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
232 |
len := eachLen. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
233 |
] ifFalse:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
234 |
start := start + eachLen. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
235 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
236 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
237 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
238 |
len notNil ifTrue:[ |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
239 |
str := str deepCopy. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
240 |
str emphasisFrom:start to:start+len-1 add:#underline. |
4071 | 241 |
"/ str emphasisFrom:start to:start+len-1 add:(#color -> foreground). |
3670
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
242 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
243 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
244 |
self displayString:str x:x y:y. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
245 |
^ self. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
246 |
]. |
ccfd04be9736
Now works with Text/actionBlocks
Stefan Vogel <sv@exept.de>
parents:
3668
diff
changeset
|
247 |
|
3662 | 248 |
self labelsAndActionsWithPositionsDo:[:lbl :action :leftX :rightX | |
249 |
|l| |
|
3668 | 250 |
|
3662 | 251 |
l := lbl. |
3668 | 252 |
action notNil ifTrue:[ |
253 |
(entered and:[mousePoint notNil and:[mousePoint x between:leftX and:rightX]]) ifTrue:[ |
|
254 |
l := l allUnderlined |
|
255 |
]. |
|
3662 | 256 |
]. |
257 |
self displayString:l x:leftX y:y. |
|
258 |
]. |
|
4071 | 259 |
|
260 |
"Modified: / 07-09-2011 / 04:47:13 / cg" |
|
3662 | 261 |
! |
262 |
||
263 |
labelsAndActionsWithPositionsDo:aFourArgBlock |
|
3664 | 264 |
|leftX rightX w| |
3662 | 265 |
|
266 |
leftX := labelOriginX. |
|
3664 | 267 |
labelsAndActions isNil ifTrue:[ |
268 |
w := (self font widthOf:logo on:device). |
|
269 |
rightX := leftX + w-1. |
|
270 |
aFourArgBlock |
|
271 |
value:logo |
|
272 |
value:self pressAction |
|
273 |
value:leftX |
|
274 |
value:rightX. |
|
275 |
^ self |
|
276 |
]. |
|
277 |
||
3662 | 278 |
labelsAndActions do:[:assoc | |
279 |
|lbl wEach| |
|
280 |
||
281 |
lbl := assoc key. |
|
282 |
wEach := (self font widthOf:lbl on:device). |
|
283 |
rightX := leftX + wEach-1. |
|
284 |
aFourArgBlock |
|
285 |
value:assoc key |
|
286 |
value:assoc value |
|
287 |
value:leftX |
|
288 |
value:rightX. |
|
289 |
||
290 |
leftX := rightX+1. |
|
291 |
]. |
|
292 |
^ nil |
|
3650 | 293 |
! ! |
294 |
||
295 |
!LinkButton class methodsFor:'documentation'! |
|
296 |
||
297 |
version |
|
4071 | 298 |
^ '$Header: /cvs/stx/stx/libwidg2/LinkButton.st,v 1.8 2011-09-07 02:47:27 cg Exp $' |
3650 | 299 |
! ! |