Problem with say object

Problem with say object

Postby Detlef Hoefner » 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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Antonio Linares » Wed Sep 17, 2008 1:19 pm

Detlef,

Please modify Class TSay Method SetText() this way:
Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Detlef Hoefner » Thu Sep 18, 2008 7: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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests