// at all.
void SetBestSize(const wxSize& size);
+ // set the initial window size if none is given (i.e. at least one of the
+ // components of the size passed to ctor/Create() is -1)
+ //
+ // normally just calls SetBestSize() for controls, but can be overridden
+ // not to do it for the controls which have to do some additional
+ // initialization (e.g. add strings to list box) before their best size
+ // can be accurately calculated
+ virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) {}
+
+
// more pure virtual functions
// ---------------------------
{
Append(choices[i]);
}
+ SetBestSize(size); // Needed because it is a wxControlWithItems
return TRUE;
}
m_choice->DoAppend( choices[ i ] );
}
+ SetBestSize(csize); // Needed because it is a wxControlWithItems
+
return TRUE;
}
Append( choices[i] ) ;
}
+ SetBestSize(size); // Needed because it is a wxControlWithItems
+
return TRUE;
}
&ref );
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
+ {
SetSize( GetBestSize() ) ;
+ SetSizeHints(GetSize());
+ }
Update() ;
}
if ( ret )
{
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
+ {
SetSize( GetBestSize() );
+ SetSizeHints(GetSize());
+ }
}
return ret;
wxSize new_size = size ;
if (!m_macIsUserPane)
- {
- wxSize best_size( DoGetBestSize() );
-
- if (size.x == -1) {
- new_size.x = best_size.x;
- }
- if (size.y == -1) {
- new_size.y = best_size.y;
- }
- SetSize( pos.x, pos.y , new_size.x, new_size.y,wxSIZE_USE_EXISTING );
+ {
+ SetInitialBestSize(size);
}
SetCursor( *wxSTANDARD_CURSOR ) ;