|
Class: LinkButton
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--Label
|
+--Button
|
+--LinkButton
- Package:
- stx:libwidg2
- Category:
- Views-Layout
- Version:
- rev:
1.27
date: 2021/01/20 15:21:00
- user: cg
- file: LinkButton.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
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:]
copyrightCOPYRIGHT (c) 2009 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
defaults
-
updateStyleCache
-
extract values from the styleSheet and cache them in class variables
accessing
-
actionAt: aPoint
-
if aPoint is over a clickable (anchor-) link, return its helptext.
Otherwise, return nil
-
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
-
(comment from inherited method)
set my 3D effect level relative to superView in nr of pixels
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
-
(comment from inherited method)
must be called if redefined
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'
].
|