I have a little problem using < DrawTextEx >
With a right-mouseclick I can change a Image, but the painted text is not refreshed.
How to call < DrawTextEx > on right-mouseclick, after the new Image is selected ?
oBrw:Refresh() doesn't work.
The Image-matrix :
< DrawTextEx > called inside Drawcell :
- Code: Select all Expand view
FOR nCol := 1 to nColums
WITH OBJECT oBrw:aCols[ nCol ]
:oHeaderFont := oTxtFont
:oDataFont := oImgFont
:cHeader := ALLTRIM(STR(nCol))
:bPaintText := { | oCol, hDC, cData, aRect, aColors, lHighLite | ;
DrawCell( oCol, hDC, cData, aRect, aColors, lHighLite ) }
END
NEXT
< DrawCell > paints the Text :
SetTextColor( hDC, 0 )
DrawHorz( hDC, nTop + nCellSize -1 , nLeft - 2, nRight + 3, oBrw:hRowPen )
GradientFill( hDC, nTop + nCellSize, nLeft - 2, nBottom, nRight + 3, { { 1, 16777215, nBackColor } } , .T. )
DrawTextEx( hDC, SUBSTR( cData, 1, 4 ), { nTop + nCellSize + 2, nLeft + 5, nBottom + 1, nRight }, ;
DT_CENTER + DT_VCENTER )
On right-mouseclick on a Cell inside xBrowse, I replace the Image-array :
oBrw:bRClicked := { | nRow, nCol |nRPos := oBrw:KeyNo(), nCPos := oBrw:SelectedCol():nCreationOrder, ;
nRecPos := ( ( oBrw:KeyNo() - 1 )* nColums ) + nCPos, ;
DBSELECTAREA(1), DBGOTO(nRecPos), SET_IMAGE(nRecPos, nRPos, nCPos ) }
SET_IMAGE calls :
aImg[ nRPos, nCPos ] := SPACE(4) + c_Path1 + cObjectName ( selection 1 - 5 )
Maybe the new Image ( on right Mouseclick ) deletes the Text-area ?
Sample Screenshots :
The display at startup :
Image 17, 18 and 19 are replaced / repainted, but without Text :
( multiple selections possible )
Best Regards
Uwe