Changed the METHOD SetText( cText ) not to exceeding the limit as shown in Image 1, only that he lost his transparency, lack what?
- Code: Select all Expand view
METHOD SetText( cText ) CLASS TSSay
local hDC , nWidth
DEFAULT ::lTransparent := .f.
::cCaption := If( ::cPicture != nil,;
Transform( cText, ::cPicture ),;
cValToChar( cText ) )
if ! lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), nOr( SS_LEFT, SS_RIGHT, SS_CENTER ) )
nWidth = GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )
IF nWidth > ::nWidth
nWidth = GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) -(GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) - ::nWidth)
ENDIF
if nWidth > ::nWidth
::nWidth = nWidth
endif
endif
SetWindowText( ::hWnd, ::cCaption )
return nil