Maybe ( with any Color and Pen-Size ) ???
REDEFINE GET oGET1 VAR cGET1 ID 250 OF oDlg UPDATE
// TOP, LEFT, hDC, WIDTH, HEIGHT, PEN, COLOR
oGet1:bPainted := { |hDC|
DRAWBOX( 0, 0, hDC, oGet1:nWidth-5, oGet1:nHeight-5, 3, 128 ) }
// -------- DRAW Get-BOX --------------------------------' )
STATIC FUNCTION
DRAWBOX( nTOP, nLEFT, hDC, nLONG, nHIGHT, nPEN, nCOLOR )
LOCAL hPen := CREATEPEN( PS_SOLID, nPEN, nColor )
LOCAL hOldPen := SELECTOBJECT( hDC, hPen )
MOVETO( hDC, nTOP, nLEFT )
LINETO( hDC, nLong, 0 )
LINETO( hDC, nLONG, nHIGHT )
LINETO( hDC, 0, nHIGHT )
LINETO( hDC, 0, 0 )
SELECTOBJECT( hDC, hOldPen )
DELETEOBJECT( hPen )
RETURN NIL
================================
To
move a Box to the foused Get is very easy :
Instead of Focus, You can change the Logic using Valid
Use a Startflag for the 1. focused Get :
nPos := 1
REDEFINE GET oGET1 VAR cGET1 ID 250 OF oDlg UPDATE
// TOP, LEFT, hDC, WIDTH, HEIGHT, PEN, COLOR
oGet1:bPainted := { |hDC| IIF( nPos = 1, ( DRAWBOX( 0, 0, hDC, oGet1:nWidth-5, oGet1:nHeight-5, 3, 128 ), ;
DRAWBOX( 0, 0, hDC, 0, 0, 0, 0) ), NIL) }
oGet1:bGotFocus := { |hDC| nPos := 1,
oGet2:Refresh(), oGet3:Refresh() }
REDEFINE GET oGET2 VAR cGET2 ID 260 OF oDlg UPDATE
oGet2:bPainted := { |hDC| IIF( nPos = 2, ( DRAWBOX( 0, 0, hDC, oGet2:nWidth-5, oGet2:nHeight-5, 3, 128 ), ;
DRAWBOX( 0, 0, hDC, 0, 0, 0, 0) ), NIL) }
oGet2:bGotFocus := { |hDC| nPos := 2,
oGet1:Refresh(), oGet3:Refresh() }
REDEFINE GET oGET3 VAR cGET3 ID 270 OF oDlg UPDATE
oGet3:bPainted := { |hDC| IIF( nPos = 3, ( DRAWBOX( 0, 0, hDC, oGet3:nWidth-5, oGet3:nHeight-5, 3, 128 ), ;
DRAWBOX( 0, 0, hDC, 0, 0, 0, 0) ), NIL) }
oGet3:bGotFocus := { |hDC| nPos := 3,
oGet1:Refresh(), oGet2:Refresh() }
============================
Using a
Valid for the 1. get ( using Values for all Gets ) :
Shows a Red Box for the 3. Get, if the Value of the 3. Get > 100
REDEFINE GET oGET1 VAR nGET1 ID 250 OF oDlg UPDATE ;
VALID ( IIF(
nGET3 > 100, (
nPos := 3, oGet1:Refresh(), oGet2:Refresh(), oGet3:Refresh() ), NIL ), .T. )
// TOP, LEFT, hDC, WIDTH, HEIGHT, PEN, COLOR
oGet1:bPainted := { |hDC| IIF( nPos = 1, ( DRAWBOX( 0, 0, hDC, oGet1:nWidth-5, oGet1:nHeight-5, 3, 128 ), ;
DRAWBOX( 0, 0, hDC, 0, 0, 0, 0) ), NIL) }
oGet1:bGotFocus := { |hDC| nPos := 1, oGet2:Refresh(), oGet3:Refresh() }
The VALID- results :
Best Regards
Uwe