// assume the user doesn't want this window to shrink beneath its initial
// size, this worked like this in wxWidgets 2.8 and before and generally
- // often makes sense
- SetMinSize(size);
+ // often makes sense for child windows (for top level ones it definitely
+ // does not as the user should be able to resize the window)
+ //
+ // note that we can't use IsTopLevel() from ctor
+ if ( !wxTopLevelWindows.Find((wxWindow *)this) )
+ SetMinSize(size);
SetName(name);
SetParent(parent);
return min;
}
+wxSize wxWindowBase::DoGetBorderSize() const
+{
+ // there is one case in which we can implement it for all ports easily:
+ // do it as some classes used by both wxUniv and native ports (e.g.
+ // wxGenericStaticText) do override DoGetBestClientSize() and so this
+ // method must work for them and that ensures that it does, at least in
+ // the default case)
+ if ( GetBorder() == wxBORDER_NONE )
+ return wxSize(0, 0);
+
+ wxFAIL_MSG( "must be overridden if called" );
+
+ return wxDefaultSize;
+}
+
wxSize wxWindowBase::GetBestSize() const
{
if ( !m_windowSizer && m_bestSizeCache.IsFullySpecified() )
// ----------------------------------------------------------------------------
// propagate the colour change event to the subwindows
-void wxWindowBase::OnSysColourChanged(wxSysColourChangedEvent& event)
+void wxWindowBase::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
while ( node )
if ( !win->IsTopLevel() )
{
wxSysColourChangedEvent event2;
- event.SetEventObject(win);
+ event2.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event2);
}