wxString curLine;
for ( const wxChar *pc = m_label; ; pc++ )
{
- if ( *pc == wxT('\n') || *pc == wxT('\0') )
+ if ( *pc == wxT('\n') || *pc == wxT('\r') || *pc == wxT('\0') )
{
if ( !curLine )
{
heightTextTotal++; // FIXME: why is this necessary?
}
- if ( *pc == wxT('\n') ) {
+ if ( *pc == wxT('\n') || *pc == wxT('\r')) {
curLine.Empty();
}
else {
SetTitle( st ) ;
m_label = st ;
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
+ {
+ // temporary fix until layout measurement and drawing are in synch again
+ Refresh() ;
SetSize( GetBestSize() ) ;
-
+ }
Refresh() ;
Update() ;
}
{
bool ret = wxControl::SetFont(font);
- // adjust the size of the window to fit to the label unless autoresizing is
- // disabled
- if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
- SetSize( GetBestSize() );
+ if ( ret )
+ {
+ // adjust the size of the window to fit to the label unless autoresizing is
+ // disabled
+ if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
+ {
+ // temporary fix until layout measurement and drawing are in synch again
+ Refresh() ;
+ SetSize( GetBestSize() );
+ }
+ }
return ret;
}