Required change for TSAY and GradientBrush()

Required change for TSAY and GradientBrush()

Postby byte-one » Wed Mar 04, 2009 3: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: Select all  Expand view
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
Last edited by byte-one on Wed Mar 11, 2009 8:45 am, edited 1 time in total.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Change for TSAY and GradientBrush()

Postby byte-one » Mon Mar 09, 2009 4:38 pm

Antonio, have you seen this behavior?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 55 guests