Mr. Rao,
Trying the function, there was a problem painting the buttons ( only a visible border ).
I found another possible solution with a visible focus :
Different button-styles :
1. coloed buttons
2. buttons with image and connected text like normal radios.
-- The textcolor could change on focus as well.
I wanted to use a FOR / NEXT for
oRBtn[1]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[1], aFocus[1] ) }
but all buttuns are using color 6
thats the reason there is a line for each button
Maybe possible just one line with
:cargo ?
Local aFocus[6], aBack[6], aRColor[6], oRBtn[6]
...
...
aRColor[1] := 0
aRColor[2] := 16777215
aRColor[3] := 54121
aRColor[4] := 16711680
aRColor[5] := 255
aRColor[6] := 65535
I := 1
nTop := 58
FOR I := 1 to 6 // 6 buttons
@ nTop, 325 BTNBMP oRBtn[I] OF oDlg ;
SIZE 15, 15 NOBORDER TRANSPARENT 2007 UPDATE ;
ACTION ( nBtnPos := ::Cargo, ;
nTxtColor := BMPPAINT( oDlg, oRBtn, nBtnPos, aRColor ) ) // value saved to INI
oRBtn[ I ]:lEllipse = .T.
oRBtn[ I ]:Cargo := I
// can be different !!!
aFocus[I] := { { 0.1, aRColor[I], aRColor[I] }, { 0.1, aRColor[I], aRColor[I] } }
aBack[I] := { { 0.1, aRColor[I], aRColor[I] }, { 0.1, aRColor[I], aRColor[I] } }
nTop := nTop + 18
NEXT
// possible to include in FOR / NEXT ???
oRBtn[1]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[1], aFocus[1] ) }
oRBtn[2]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[2], aFocus[2] ) }
oRBtn[3]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[3], aFocus[3] ) }
oRBtn[4]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[4], aFocus[4] ) }
oRBtn[5]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[5], aFocus[5] ) }
oRBtn[6]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[6], aFocus[6] ) }
// loaded from INI
nTxtColor := BMPPAINT( oDlg, oRBtn, nBtnPos, aRColor )
...
...
// ------------------
FUNCTION BMPPAINT( oDlg, oRBtn, nBtnPos, aRColor )
LOCAL I := 1, nRColor := 0
FOR I := 1 TO LEN( oRBtn )
IF nBtnPos = I
nRColor := aRColor[I]
ENDIF
oRBtn[I]:SetFile( NIL, NIL )
IF I = nBtnPos
oRBtn[I]:SetFile( c_path1 + "Yes.Bmp", c_path1 + "Yes.Bmp" )
ENDIF
NEXT
AEVAL( oDlg:aControls, { | oCtl | IIF( oCtl:ClassName() == "TSAY", ; // only SAY is used
( oCtl:Setcolor( nRColor, ), oCtl:Refresh() ), NIL ) } )
RETURN nRColor
best regards
Uwe
