]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Moved print dialog data conversion code
[wxWidgets.git] / src / common / wincmn.cpp
index 44fdda39918ffc7baca970864cae586e8411b7c3..690233bc75012eb6020a45fb464b65f10c2f22d6 100644 (file)
@@ -530,6 +530,16 @@ static bool wxHasRealChildren(const wxWindowBase* win)
     return (realChildCount > 0);
 }
 #endif
+    
+void wxWindowBase::InvalidateBestSize()
+{
+    m_bestSizeCache = wxDefaultSize;
+
+    // parent's best size calculation may depend on its children's
+    // best sizes, so let's invalidate it as well to be safe:
+    if (m_parent)
+        m_parent->InvalidateBestSize();
+}
 
 // return the size best suited for the current window
 wxSize wxWindowBase::DoGetBestSize() const
@@ -674,9 +684,9 @@ wxPoint wxWindowBase::GetClientAreaOrigin() const
 }
 
 // set the min/max size of the window
-void wxWindowBase::SetSizeHints(int minW, int minH,
-                                int maxW, int maxH,
-                                int WXUNUSED(incW), int WXUNUSED(incH))
+void wxWindowBase::DoSetSizeHints(int minW, int minH,
+                                  int maxW, int maxH,
+                                  int WXUNUSED(incW), int WXUNUSED(incH))
 {
     // setting min width greater than max width leads to infinite loops under
     // X11 and generally doesn't make any sense, so don't allow it
@@ -2043,12 +2053,16 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
             if ( event.GetText() != control->GetLabel() )
                 control->SetLabel(event.GetText());
         }
+    }
+#endif // wxUSE_CONTROLS
+
+    if ( event.GetSetChecked() )
+    {
 #if wxUSE_CHECKBOX
         wxCheckBox *checkbox = wxDynamicCastThis(wxCheckBox);
         if ( checkbox )
         {
-            if ( event.GetSetChecked() )
-                checkbox->SetValue(event.GetChecked());
+            checkbox->SetValue(event.GetChecked());
         }
 #endif // wxUSE_CHECKBOX
 
@@ -2056,12 +2070,10 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
         wxRadioButton *radiobtn = wxDynamicCastThis(wxRadioButton);
         if ( radiobtn )
         {
-            if ( event.GetSetChecked() )
-                radiobtn->SetValue(event.GetChecked());
+            radiobtn->SetValue(event.GetChecked());
         }
 #endif // wxUSE_RADIOBTN
     }
-#endif
 }
 
 #if 0
@@ -2187,7 +2199,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
 
         wxMessageBox(wxString::Format(
                                       _T(
-                                        "       wxWidgets Library (%s port)\nVersion %u.%u.%u%s, compiled at %s %s\n   Copyright (c) 1995-2002 wxWidgets team"
+                                        "       wxWidgets Library (%s port)\nVersion %u.%u.%u%s%s, compiled at %s %s\n   Copyright (c) 1995-2004 wxWidgets team"
                                         ),
                                       port.c_str(),
                                       wxMAJOR_VERSION,
@@ -2197,6 +2209,11 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
                                       L" (Unicode)",
 #else
                                       "",
+#endif
+#ifdef __WXDEBUG__
+                                      _T(" Debug build"),
+#else
+                                      _T(""),
 #endif
                                       __TDATE__,
                                       __TTIME__
@@ -2443,6 +2460,11 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)
     wxCHECK_RET( GetParent(),
                     _T("MoveBefore/AfterInTabOrder() don't work for TLWs!") );
 
+    // detect the special case when we have nothing to do anyhow and when the
+    // code below wouldn't work
+    if ( win == this )
+        return;
+
     // find the target window in the siblings list
     wxWindowList& siblings = GetParent()->GetChildren();
     wxWindowList::compatibility_iterator i = siblings.Find(win);
@@ -2473,7 +2495,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)
 
 /*static*/ wxWindow* wxWindowBase::FindFocus()
 {
-    wxWindow *win = DoFindFocus();
+    wxWindowBase *win = DoFindFocus();
     return win ? win->GetMainWindowOfCompositeControl() : NULL;
 }