- // This function is rather unfortunately named.. it's really just a
- // smarter SetSize / convenience function for expanding wxDefaultSize.
- // Note that it does not influence the value returned by GetBestSize
- // at all.
- void SetBestSize(const wxSize& size)
- {
- // the size only needs to be changed if the current size is incomplete,
- // i.e. one of the components was specified as default -- so if both
- // were given, simply don't do anything
- if ( size.x == -1 || size.y == -1 )
- {
- wxSize sizeBest = DoGetBestSize();
- if ( size.x != -1 )
- sizeBest.x = size.x;
- if ( size.y != -1 )
- sizeBest.y = size.y;
-
- SetSize(sizeBest);
- }
- }
+ // 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)) {}
+
+