xBrowse < DrawTextEx > on right-mouseclick ?

xBrowse < DrawTextEx > on right-mouseclick ?

Postby ukoenig » Sun Aug 12, 2012 2:32 pm

Hello,

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 :

Image

< 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 ?

Image

Sample Screenshots :

The display at startup :

Image

Image 17, 18 and 19 are replaced / repainted, but without Text :
( multiple selections possible )

Image

Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests