Hi all,
under certain circumstances TSay cuts the last character.
I don´t use any font definitons. Does anyone ever noticed this ?
TSay cuts the last character
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
TSay cuts the last character
kind regards
Stefan
Stefan
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
I found a solution, nWidth gets a wrong value by default in this line in the method ::New() in TSay
If you replace it with
all is working fine.
In method ::SetText you have to do the same, insert this line before ::SetWindowText (...)
Now also changed text is shown correctly.
Code: Select all
DEFAULT nWidth := SAY_CHARPIX_W * Len( ::cCaption ) - 4
Code: Select all
DEFAULT nWidth := GetTextWidth( 0, ::cCaption, IIF (oFont != nil, oFont:hFont, oWnd:oFont:hFont ) )
In method ::SetText you have to do the same, insert this line before ::SetWindowText (...)
Code: Select all
::nWidth := GetTextWidth( 0, ::cCaption, ::oFont:hFont)
kind regards
Stefan
Stefan
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Stefan,
We have modified it as per your advise, many thanks
A little modifications in your code:
DEFAULT nWidth := GetTextWidth( 0, ::cCaption, If( oFont != nil, oFont:hFont,;
If( oWnd:oFont != nil, oWnd:oFont:hFont,) ) )
::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )
We have modified it as per your advise, many thanks
A little modifications in your code:
DEFAULT nWidth := GetTextWidth( 0, ::cCaption, If( oFont != nil, oFont:hFont,;
If( oWnd:oFont != nil, oWnd:oFont:hFont,) ) )
::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany