|
Class: LinkButton
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--Label
|
+--Button
|
+--LinkButton
- Package:
- stx:libwidg2
- Category:
- Views-Layout
- Version:
- rev:
1.23
date: 2019/05/28 09:09:53
- user: cg
- file: LinkButton.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- cg (cg@CG-VOSTRO)
Looks like a Label, but behaves like a button with individually clickable text components.
Can be used to create html-page-look-alike links in a view,
especially to make label-looking action buttons (as in the browser's info view).
[instance variables:]
[class variables:]
defaults
-
updateStyleCache
-
extract values from the styleSheet and cache them in class variables
accessing
-
actionAt: aPoint
-
take action from logo, which is normally a text with an action-emphasis
-
labelsAndActions
-
returns the collection of label->action associations.
For display, the label strings are drawn as one concatenated string (add separating spaces, if you have to).
When clicked on a string, the corresponding action is called
-
labelsAndActions: aCollectionOfAssociations
-
set the collection of label->action associations.
For display, the label strings are drawn as one concatenated string (add separating spaces, if you have to).
When clicked on a string, the corresponding action is called
-
level: anInteger
-
initialization
-
allViewBackground: something if: condition
-
set the viewBackground to something, a color, image or form,
in myself and recursively in all of my subviews
-
defaultControllerClass
-
-
initStyle
-
activeFgColor := enteredFgColor := foreground.
-
initialize
-
private
-
actionEmphasisIn: aText atPoint: aPoint
-
check for an actionBlock-emphasis in aText at aPoint.
Answer an Array with the whole emphasis and the actionBlock,
or nil
-
labelsAndActionsWithPositionsDo: aFourArgBlock
-
redrawing
-
drawFocusFrame
-
intentionally ignored
-
drawStringLogo: aString x: x y: y
-
redefined to draw any anchor under the mouse pointer with an underlined emphasis
-
is3D
-
|v l|
v := StandardSystemView new.
l := LinkButton in:v.
l label:
(('Hello' actionForAll:[ Transcript showCR:'Hello Clicked'])
, ' '
, ('World' actionForAll:[ Transcript showCR:'World Clicked'])).
v open
|
|v l|
v := StandardSystemView new.
l := LinkButton in:v.
l label:
((('Hello' actionForAll:[ Transcript showCR:'Hello Clicked']) colorizeAllWith:(Color blue))
, ' '
, ('World' actionForAll:[ Transcript showCR:'World Clicked'])).
v open
|
|v l|
v := StandardSystemView new.
l := LinkButton in:v.
l labelsAndActions:{
'Hello' -> [ Transcript showCR:'Hello Clicked'].
' ' -> nil.
'World' -> [ Transcript showCR:'World Clicked'].
}.
l foregroundColor:Color blue.
v open
|
|v l|
v := StandardSystemView new.
l := LinkButton in:v.
l labelsAndActions:{
'Hello' -> nil.
' ' -> nil.
'World' -> [ Transcript showCR:'World Clicked'].
}.
l foregroundColor:Color blue.
v open
| Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
|lbl|
lbl := LinkButton label:(('XXX'
colorizeAllWith:Color blue)
actionForAll:[ Transcript showCR:'xxx' ]).
ex box verticalPanel addComponent:lbl.
] do:[
self warn:'Bla bla bla'
].
|