Hi all,
I have a problem with wxStaticText. To be more precise, my problem comes when the text has a bigger width than the control.
When the text contains all "normal characters" like the "bbbbbb" line on the screenshot, the text is cut. That's what i want.
But when the text contains a "/" i lost all the right part of the text as you can see on the 2nd line of the screenshot (the full line is visible in the wxTextControl on the top).
Thanks for your help !
Little problem with wxStaticText Topic is solved
-
- Earned some good credits
- Posts: 113
- Joined: Sat Sep 24, 2011 9:32 pm
- Location: Poland
Re: Little problem with wxStaticText
Try to use:
SetLabelText ( const wxString & text )
instead of SetLabel();
Maybe it helps? Regards
SetLabelText ( const wxString & text )
instead of SetLabel();
Maybe it helps? Regards
Re: Little problem with wxStaticText
looks like a text wrapping issue
I would try setting wxStaticText::Wrap to -1 and possibly consider using the wxST_ELLIPSIZE_END style
I would try setting wxStaticText::Wrap to -1 and possibly consider using the wxST_ELLIPSIZE_END style
Re: Little problem with wxStaticText
Using wxST_ELLIPSIZE_END (even without setting wraper to -1) style solved the problem ! I'm a bit mad i saw this style in the doc and tried it but I did it on the wrong StaticText ><
Anyway i tried the SetLabelText too and it didn't work. And setting the wraper to -1 without the style didn't work neither.
The problem is solved but I don't get why it was doing this, any idea ? I'm curious.
Anyway i tried the SetLabelText too and it didn't work. And setting the wraper to -1 without the style didn't work neither.
The problem is solved but I don't get why it was doing this, any idea ? I'm curious.
Re: Little problem with wxStaticText
the text "bbbbbbbbbbbbbbbbbb" has no word boundaries to wrap on, so it does not wrapMaeglix wrote:The problem is solved but I don't get why it was doing this, any idea ? I'm curious.
the text "posting.php" contains the word boundary "/", so it wraps the posting.php to the next line which is of course not shown.
Re: Little problem with wxStaticText
Ok thank you for the explanation.