]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Reverted last wxBookCtrl change and added alignment check to notebook
[wxWidgets.git] / src / common / wincmn.cpp
index 7b458dca638c885bbfdb2fc8bdaeed5ba1bb4596..314d68ea0ebddde40d91b69cb9b1a0a8d5323a49 100644 (file)
@@ -29,7 +29,6 @@
     #include "wx/log.h"
     #include "wx/intl.h"
     #include "wx/frame.h"
-    #include "wx/defs.h"
     #include "wx/window.h"
     #include "wx/control.h"
     #include "wx/checkbox.h"
     #include "wx/statusbr.h"
     #include "wx/toolbar.h"
     #include "wx/dcclient.h"
-#endif //WX_PRECOMP
-
-#if defined(__WXMAC__) && wxUSE_SCROLLBAR
     #include "wx/scrolbar.h"
-#endif
+#endif //WX_PRECOMP
 
 #if wxUSE_CONSTRAINTS
     #include "wx/layout.h"
@@ -91,6 +87,9 @@
     extern const unsigned int gtk_micro_version;
 #endif
 
+// Windows List
+WXDLLIMPEXP_DATA_CORE(wxWindowList) wxTopLevelWindows;
+
 // ----------------------------------------------------------------------------
 // static data
 // ----------------------------------------------------------------------------
@@ -221,9 +220,6 @@ wxWindowBase::wxWindowBase()
 
     // VZ: this one shouldn't exist...
     m_isBeingDeleted = false;
-
-    // Reserved for future use
-    m_windowReserved = NULL;
 }
 
 // common part of window creation process
@@ -446,8 +442,10 @@ 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)
+    // as long as child window we are in is not top level window itself
+    // (because the TLW size is never resized automatically)
+    // so let's invalidate it as well to be safe:
+    if (m_parent && !IsTopLevel())
         m_parent->InvalidateBestSize();
 }
 
@@ -713,6 +711,18 @@ wxSize wxWindowBase::DoGetVirtualSize() const
     return size;
 }
 
+void wxWindowBase::DoGetScreenPosition(int *x, int *y) const
+{
+    // screen position is the same as (0, 0) in client coords for non TLWs (and
+    // TLWs override this method)
+    if ( x )
+        *x = 0;
+    if ( y )
+        *y = 0;
+
+    ClientToScreen(x, y);
+}
+
 // ----------------------------------------------------------------------------
 // show/hide/enable/disable the window
 // ----------------------------------------------------------------------------
@@ -1517,10 +1527,13 @@ void wxWindowBase::SetToolTip( const wxString &tip )
 
 void wxWindowBase::DoSetToolTip(wxToolTip *tooltip)
 {
-    if ( m_tooltip )
-        delete m_tooltip;
+    if ( m_tooltip != tooltip )
+    {
+        if ( m_tooltip )
+            delete m_tooltip;
 
-    m_tooltip = tooltip;
+        m_tooltip = tooltip;
+    }
 }
 
 #endif // wxUSE_TOOLTIPS