FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Brush-adjustment (top/left) needed for TFoldex ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Brush-adjustment (top/left) needed for TFoldex ?
Posted: Thu Sep 15, 2011 01:38 PM
Hello,
using my new debuggingtool, I notice a problem
with TFoldex-brushes.
The top and left seems not to be exact adjusted in relation to the defined tabs.
( tab-bottom / brush-top and folder-left / Brush-left )
I think the problem is not the Brush, because I changed the top / left - startposition.
The painting-problem is still the same.



Zoomed


Folder - Image-Background
Code (fw): Select all Collapse
...
...
@ 10, 10 FOLDEREX oFld1 OF oDlgMain1 SIZE 200, 150 PIXEL ;
PROMPT  "Page &1", "Page &2", "Page &3", "&Exit";
BITMAPS aBitmaps;
ACTION( If( nOption == 4, oDlgMain1:End(), ;
   MsgInfo( "Action defined to " + StrTran( ::aPrompts[ nOption ], "&", "" ) ) ) );
ON PAINT TAB PaintTab( Self, nOption );
ON CHANGE ( If( nOption == 4, If( MsgYesNo( "Do you want exit??" ), ;
   oDlgMain1:End(), ( ::SetOption( nOldOption ), ::Refresh() ) ), ) );
ON PAINT TEXT( If( nOption == ::nOption .and. nOption == 2, CLR_YELLOW, CLR_BLACK ) );
TOP OPTION 2 ALIGN  AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_RIGHT

oFld1:lTransparent := .T.
oFld1:nFolderHeight := 30
oFld1:nSeparator := 5
oFld1:nRound := 10
oFld1:bClrText := {| o, n | 128 }
oFld1:oFont := oFont[1]

// brush-define
// ---------------
F_BACKGRD( oFld1, cImageD )
..
..

FUNCTION F_BACKGRD( oFld, cImage ) 
LOCAL n, oDlg, hDC

FOR n := 1 to Len( oFld:aDialogs ) 
     oDlg := oFld:aDialogs[ n ]
     oDlg:bPainted := {|hDC| F_FULL(hDC,oDlg,oDlg:nHeight(),oDlg:nWidth(),cImage)}
NEXT

RETURN( NIL )

// ---------- Folder FULL Image --------------

FUNCTION F_FULL(  hDC, oDlg, nHeight, nWidth, cImage )
LOCAL oImage

IF FILE( cImage )
     DEFINE IMAGE oImage FILENAME cImage
     aRect := GETCLIENTRECT( oDlg:hWnd )
     oBrush := TBrush():new(,,,,PalBmpDraw(hDC,0,0,oImage:hBitmap,,nWidth,nHeight,, .T.)) 
     oDlg:SetBrush( oBrush )
     RELEASE BRUSH oBrush
ELSE
     MsgAlert( "File : " + cImage + CRLF + ;
     "does not exist" + CRLF + ; 
     "to create Background !", "ATTENTION" ) 
ENDIF

RETURN( NIL )


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.

Continue the discussion