FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with say object
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Problem with say object
Posted: Wed Sep 17, 2008 12:42 PM

Hi all,

i just found out that a redefined say does change its length depending of the content of characters :( .
I saw this when giving a different background color than the one of the dialog.

In 16 bit FW the say object did hold the size i gave it in Resource Workshop.
No matter how long the string was which had to be displayed.

Is there a way to reach this old behaviour ( constant length ) with FWxH ?

Thanks and regards,
Detlef

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problem with say object
Posted: Wed Sep 17, 2008 01:19 PM
Detlef,

Please modify Class TSay Method SetText() this way:
METHOD SetText( cText ) CLASS TSay

   local hDC, nWidth

   DEFAULT ::lTransparent := .f.

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

   #ifndef __CLIPPER__
      if ::oWnd:oBrush != nil .and. Empty( ::oWnd:oBrush:hBitmap ) .and. ( IsAppThemed() .or. ::lTransparent )
         DrawPBack( ::hWnd, hDC := GetDC( ::hWnd ) )
         ReleaseDC( ::hWnd, hDC )
      endif   
   #endif

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

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Problem with say object
Posted: Thu Sep 18, 2008 07:19 AM

Antonio,

many thanks for your advice.
Is there a link script or list of modules how to rebuild the FiveHx.lib?

Regards,
Detlef

Continue the discussion