...
oCol := oBrw:oCol( "Test2" )
oCol:nWidth := 100
oCol:nEditType := EDIT_BUTTON
oCol:bEditBlock := { | r, c, o | EditTest( r, c, o ) }
....
//----------------------------------------------------------------------------//
STATIC FUNCTION EditTest( nRow, nCol, oCol )
local oDlg, oGet
local lEdited := .f.
local cEdit := FIELD->TEST2
local aPoint
aPoint := ClientToScreen( oCol:oBrw:hWnd, { nRow, nCol } )
nRow := aPoint[ 1 ]
nCol := aPoint[ 2 ]
DEFINE DIALOG oDlg FROM nRow +2, nCol TO nRow + 90, nCol + 120 PIXEL STYLE WS_POPUP
@ 02,02 GET oGet VAR cEdit TEXT SIZE 50, 20 PIXEL OF oDlg COLOR 128
@ 28, 5 BUTTON "Ok" SIZE 20,10 PIXEL OF oDlg ;
ACTION ( lEdited := .t., oDlg:End() )
@ 28, 30 BUTTON "Cancel" SIZE 25,10 PIXEL OF oDlg ;
ACTION ( lEdited := .f., oDlg:End() )
SET_BRUSH( oDlg, 2, .T., 16443068, 128, 0.9, , 120, 90 )
ACTIVATE DIALOG oDlg
lEdited = lEdited .and. ( cEdit != FIELD->TEST2 )
RETURN IF( lEdited, cEdit, nil )
//--------- Background ------------------------
FUNCTION SET_BRUSH( oControl, nStyle, lDirect, nVColor, nBColor, nMove, ;
cBrush, nWidth, nHeight )
LOCAL hDC, oBrush, oTmp
LOCAL aRect := GETCLIENTRECT( oControl )
LOCAL aGrad := { { nMove, nVColor, nBColor }, { nMove, nBColor, nVColor } }
IF nStyle = 1
DEFINE BRUSH oBrush COLOR nVColor
SET BRUSH OF oControl TO oBrush
RELEASE BRUSH oBrush
ENDIF
IF nStyle = 2 // defined Width and Height !!!!!
hDC = CreateCompatibleDC( oControl:GetDC() )
hBmp = CreateCompatibleBitMap( oControl:hDC, nWidth, nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, nHeight, nWidth, aGrad, lDirect )
DeleteObject( oControl:oBrush:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
oControl:ReleaseDC()
oControl:SetBrush( oBrush )
RELEASE BRUSH oBrush
ENDIF
IF nStyle = 3
DEFINE BRUSH oBrush RESOURCE cBrush
SET BRUSH OF oControl TO oBrush
RELEASE BRUSH oBrush
ENDIF
RETURN NIL