# HG changeset patch # User Claus Gittinger # Date 1315363647 -7200 # Node ID d056c9f9b59592aed70773743c5c1e27d20205f9 # Parent 175d50cdef4c8b8e2917382f1ea8fcaa849678ef changed: #documentation #drawStringLogo:x:y: #examples #initStyle redraw in original color diff -r 175d50cdef4c -r d056c9f9b595 LinkButton.st --- a/LinkButton.st Mon Aug 22 16:33:42 2011 +0200 +++ b/LinkButton.st Wed Sep 07 04:47:27 2011 +0200 @@ -12,7 +12,7 @@ documentation " Looks like a Label, but behaves like a button with individually clickable text components. - Can be used to create htmp-page-look-alike links in a view. + Can be used to create html-page-look-alike links in a view. [author:] cg (cg@CG-VOSTRO) @@ -28,19 +28,36 @@ examples " + [exBegin] |v l| v := StandardSystemView new. l := LinkButton in:v. l label: (('Hello' actionForAll:[ Transcript showCR:'Hello Clicked']) - , ' ' + , ' ' , ('World' actionForAll:[ Transcript showCR:'World Clicked'])). l foregroundColor:Color blue. v open + [exEnd] + [exBegin] + |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 + [exEnd] + + + [exBegin] |v l| v := StandardSystemView new. @@ -52,8 +69,10 @@ }. l foregroundColor:Color blue. v open + [exEnd] + [exBegin] |v l| v := StandardSystemView new. @@ -65,6 +84,7 @@ }. l foregroundColor:Color blue. v open + [exEnd] " ! ! @@ -110,8 +130,12 @@ DefaultLinkColor notNil ifTrue:[ foreground := DefaultLinkColor onDevice:device. ]. + enteredFgColor := nil. "/ Color blue. + "/ activeFgColor := enteredFgColor := foreground. "/ activeBgColor := enteredBgColor := viewBackground. + + "Modified: / 07-09-2011 / 04:29:29 / cg" ! initialize @@ -214,7 +238,7 @@ len notNil ifTrue:[ str := str deepCopy. str emphasisFrom:start to:start+len-1 add:#underline. - str emphasisFrom:start to:start+len-1 add:(#color -> foreground). + "/ str emphasisFrom:start to:start+len-1 add:(#color -> foreground). ]. ]. self displayString:str x:x y:y. @@ -232,6 +256,8 @@ ]. self displayString:l x:leftX y:y. ]. + + "Modified: / 07-09-2011 / 04:47:13 / cg" ! labelsAndActionsWithPositionsDo:aFourArgBlock @@ -269,5 +295,5 @@ !LinkButton class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/LinkButton.st,v 1.7 2009-03-23 07:23:06 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/LinkButton.st,v 1.8 2011-09-07 02:47:27 cg Exp $' ! !