FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Required change for TSAY and GradientBrush()
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Required change for TSAY and GradientBrush()
Posted: Wed Mar 04, 2009 03:56 PM
Antonio, a little change in TSAY is required for the GradientBrush().
Says with ID and there text is changed on runtime, then the old text are also to see. Only on folders if the parent dialog is GradientBrushe()`d.
Code (fw): Select all Collapse
METHOD SetText( cText ) CLASS TSay

   local hDC, nWidth , lBrush

   DEFAULT ::lTransparent := .f.

lBrush := Empty( ::oWnd:oBrush:hBitmap ) .or. (!empty(::oWnd:oBrush:hBitmap) .and. ( empty(::oWnd:oBrush:cBmpFile) .and. empty(::oWnd:oBrush:cBmpRes) )) //change BYTE-ONE

   ::cCaption := If( ::cPicture != nil, Transform( cText, ::cPicture ),;
                     cValToChar( cText ) )

   #ifndef __CLIPPER__
      if ! Empty( ::hWnd ) .and. ::oWnd:oBrush != nil .and. lBrush .and. ( IsAppThemed() .or. ::lTransparent )  //change BYTE-ONE
         DrawPBack( ::hWnd, hDC := GetDC( ::hWnd ) )
         ReleaseDC( ::hWnd, hDC )
      endif
   #endif

   if ! Empty( ::hWnd )
      if ! lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), nOr( SS_LEFT, SS_RIGHT, SS_CENTER ) ) .AND. ::lAdjust
         nWidth = GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) + 20
         if nWidth > ::nWidth
            ::nWidth = nWidth
         endif
      endif
      SetWindowText( ::hWnd, ::cCaption )
   endif

return nil
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Change for TSAY and GradientBrush()
Posted: Mon Mar 09, 2009 04:38 PM

Antonio, have you seen this behavior?

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion