git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27132
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// at all.
void SetBestSize(const wxSize& size);
// 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
// ---------------------------
// more pure virtual functions
// ---------------------------
+ SetBestSize(size); // Needed because it is a wxControlWithItems
m_choice->DoAppend( choices[ i ] );
}
m_choice->DoAppend( choices[ i ] );
}
+ SetBestSize(csize); // Needed because it is a wxControlWithItems
+
+ SetBestSize(size); // Needed because it is a wxControlWithItems
+
&ref );
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
&ref );
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
SetSize( GetBestSize() ) ;
SetSize( GetBestSize() ) ;
+ SetSizeHints(GetSize());
+ }
if ( ret )
{
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
if ( ret )
{
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
SetSize( GetBestSize() );
SetSize( GetBestSize() );
+ SetSizeHints(GetSize());
+ }
wxSize new_size = size ;
if (!m_macIsUserPane)
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 ) ;
}
SetCursor( *wxSTANDARD_CURSOR ) ;