Method SetText() Transparent
Posted: Sun Sep 21, 2008 10:13 pm
http://img179.imageshack.us/my.php?image=tela1oc3.png
Changed the METHOD SetText( cText ) not to exceeding the limit as shown in Image 1, only that he lost his transparency, lack what?
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
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