]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
send wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED only once after end of dragging and...
[wxWidgets.git] / src / common / wincmn.cpp
index a6a6360864aa2c6d669940d5812d6c0ffb690ec0..5f9a9a9ed70c8d4b5bde59c56803375d20e66297 100644 (file)
     #include "wx/caret.h"
 #endif // wxUSE_CARET
 
     #include "wx/caret.h"
 #endif // wxUSE_CARET
 
+#if wxUSE_DISPLAY
+    #include "wx/display.h"
+#endif
+
 #if wxUSE_SYSTEM_OPTIONS
     #include "wx/sysopt.h"
 #endif
 #if wxUSE_SYSTEM_OPTIONS
     #include "wx/sysopt.h"
 #endif
@@ -431,6 +435,21 @@ void wxWindowBase::Centre(int direction)
 
     if ( direction & wxCENTRE_ON_SCREEN )
     {
 
     if ( direction & wxCENTRE_ON_SCREEN )
     {
+        //RN:  If we are using wxDisplay we get
+        //the dimensions of the monitor the window is on,
+        //otherwise we get the dimensions of the primary monitor
+        //FIXME:  wxDisplay::GetFromWindow only implemented on MSW
+#if wxUSE_DISPLAY && defined(__WXMSW__)
+        int nDisplay = wxDisplay::GetFromWindow((wxWindow*)this);
+        if(nDisplay != wxNOT_FOUND)
+        {
+            wxDisplay windowDisplay(nDisplay);
+            wxRect displayRect = windowDisplay.GetGeometry();
+            widthParent = displayRect.width;
+            heightParent = displayRect.height;
+        }
+        else
+#endif
         // centre with respect to the whole screen
         wxDisplaySize(&widthParent, &heightParent);
     }
         // centre with respect to the whole screen
         wxDisplaySize(&widthParent, &heightParent);
     }
@@ -471,6 +490,9 @@ void wxWindowBase::Centre(int direction)
     xNew += posParent.x;
     yNew += posParent.y;
 
     xNew += posParent.x;
     yNew += posParent.y;
 
+    // FIXME:  This needs to get the client display rect of the display
+    // the window is (via wxDisplay::GetFromWindow). 
+    
     // Base size of the visible dimensions of the display
     // to take into account the taskbar. And the Mac menu bar at top.
     wxRect clientrect = wxGetClientDisplayRect();
     // Base size of the visible dimensions of the display
     // to take into account the taskbar. And the Mac menu bar at top.
     wxRect clientrect = wxGetClientDisplayRect();
@@ -789,10 +811,17 @@ void wxWindowBase::DoSetVirtualSize( int x, int y )
 
 wxSize wxWindowBase::DoGetVirtualSize() const
 {
 
 wxSize wxWindowBase::DoGetVirtualSize() const
 {
-    if (m_virtualSize == wxDefaultSize)
-        return GetClientSize();
+    if ( m_virtualSize.IsFullySpecified() )
+        return m_virtualSize;
+
+    wxSize size = GetClientSize();
+    if ( m_virtualSize.x != wxDefaultCoord )
+        size.x = m_virtualSize.x;
 
 
-    return m_virtualSize;
+    if ( m_virtualSize.y != wxDefaultCoord )
+        size.y = m_virtualSize.y;
+
+    return size;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -2228,7 +2257,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
 
         wxMessageBox(wxString::Format(
                                       _T(
 
         wxMessageBox(wxString::Format(
                                       _T(
-                                        "       wxWidgets Library (%s port)\nVersion %u.%u.%u%s%s, compiled at %s %s\n   Copyright (c) 1995-2004 wxWidgets team"
+                                        "       wxWidgets Library (%s port)\nVersion %u.%u.%u%s%s, compiled at %s %s\n   Copyright (c) 1995-2005 wxWidgets team"
                                         ),
                                       port.c_str(),
                                       wxMAJOR_VERSION,
                                         ),
                                       port.c_str(),
                                       wxMAJOR_VERSION,
@@ -2288,15 +2317,22 @@ wxAccessible* wxWindowBase::CreateAccessible()
 
 #endif
 
 
 #endif
 
-#if !wxUSE_STL
 // ----------------------------------------------------------------------------
 // list classes implementation
 // ----------------------------------------------------------------------------
 
 // ----------------------------------------------------------------------------
 // list classes implementation
 // ----------------------------------------------------------------------------
 
+#if wxUSE_STL
+
+#include <wx/listimpl.cpp>
+WX_DEFINE_LIST(wxWindowList);
+
+#else
+
 void wxWindowListNode::DeleteData()
 {
     delete (wxWindow *)GetData();
 }
 void wxWindowListNode::DeleteData()
 {
     delete (wxWindow *)GetData();
 }
+
 #endif
 
 // ----------------------------------------------------------------------------
 #endif
 
 // ----------------------------------------------------------------------------