]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/dynamicsash.cpp
Only call GetBestSize if one or both of the minsize components are unset.
[wxWidgets.git] / contrib / src / gizmos / dynamicsash.cpp
index 9317b5f4f09f1d10bbe3556e9d4fe3e214a3b901..1d508f2825e49bdf09a682012ca926311054f62c 100644 (file)
 #endif
 
 // for all others, include the necessary headers (this file is usually all you
 #endif
 
 // for all others, include the necessary headers (this file is usually all you
-// need because it includes almost all "standard" wxWindows headers)
+// need because it includes almost all "standard" wxWidgets headers)
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif
 
 #include "wx/gizmos/dynamicsash.h"
 
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif
 
 #include "wx/gizmos/dynamicsash.h"
 
+
+const wxChar* wxDynamicSashWindowNameStr = wxT("dynamicSashWindow");
+
+
 /*
     wxDynamicSashWindow works by internally storing a tree of Implementation
     objects (wxDynamicSsahWindowImpl) and Leaf objects
 /*
     wxDynamicSashWindow works by internally storing a tree of Implementation
     objects (wxDynamicSsahWindowImpl) and Leaf objects
@@ -309,13 +313,27 @@ bool wxDynamicSashWindowImpl::Create() {
 
     m_container->SetEventHandler(this);
 
 
     m_container->SetEventHandler(this);
 
-    Connect(-1, wxEVT_SIZE, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnSize);
-    Connect(-1, wxEVT_PAINT, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnPaint);
-    Connect(-1, wxEVT_MOTION, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
-    Connect(-1, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
-    Connect(-1, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnLeave);
-    Connect(-1, wxEVT_LEFT_DOWN, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnPress);
-    Connect(-1, wxEVT_LEFT_UP, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnRelease);
+    Connect(-1, wxEVT_SIZE, (wxObjectEventFunction)
+                            (wxEventFunction)
+                            (wxSizeEventFunction)&wxDynamicSashWindowImpl::OnSize);
+    Connect(-1, wxEVT_PAINT, (wxObjectEventFunction)
+                             (wxEventFunction)
+                             (wxPaintEventFunction)&wxDynamicSashWindowImpl::OnPaint);
+    Connect(-1, wxEVT_MOTION, (wxObjectEventFunction)
+                              (wxEventFunction)
+                              (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
+    Connect(-1, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)
+                                    (wxEventFunction)
+                                    (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
+    Connect(-1, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)
+                                    (wxEventFunction)
+                                    (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnLeave);
+    Connect(-1, wxEVT_LEFT_DOWN, (wxObjectEventFunction)
+                                 (wxEventFunction)
+                                 (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnPress);
+    Connect(-1, wxEVT_LEFT_UP, (wxObjectEventFunction)
+                               (wxEventFunction)
+                               (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnRelease);
 
     return TRUE;
 }
 
     return TRUE;
 }
@@ -898,15 +916,33 @@ bool wxDynamicSashWindowLeaf::Create() {
         m_hscroll->SetEventHandler(this);
         m_vscroll->SetEventHandler(this);
 
         m_hscroll->SetEventHandler(this);
         m_vscroll->SetEventHandler(this);
 
-        Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnFocus);
-        Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
-        Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction)
+                                     (wxEventFunction)
+                                     (wxFocusEventFunction)&wxDynamicSashWindowLeaf::OnFocus);
+        Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction)
+                                      (wxEventFunction)
+                                      (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)
+                                         (wxEventFunction)
+                                         (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)
+                                         (wxEventFunction)
+                                         (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)
+                                           (wxEventFunction)
+                                           (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)
+                                         (wxEventFunction)
+                                         (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
+                                           (wxEventFunction)
+                                           (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
+                                             (wxEventFunction)
+                                             (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+        Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
+                                               (wxEventFunction)
+                                               (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
     }
 
     wxLayoutConstraints *layout = new wxLayoutConstraints();
     }
 
     wxLayoutConstraints *layout = new wxLayoutConstraints();
@@ -1048,18 +1084,18 @@ wxScrollBar *wxDynamicSashWindowLeaf::FindScrollBar(const wxWindow *child, int v
     return NULL;
 }
 
     return NULL;
 }
 
-void wxDynamicSashWindowLeaf::OnSize(wxSizeEvent &event) {
+void wxDynamicSashWindowLeaf::OnSize(wxSizeEvent &WXUNUSED(event)) {
     m_impl->m_container->Refresh();
     ResizeChild(m_viewport->GetSize());
 }
 
     m_impl->m_container->Refresh();
     ResizeChild(m_viewport->GetSize());
 }
 
-void wxDynamicSashWindowLeaf::OnPaint(wxPaintEvent &event) {
+void wxDynamicSashWindowLeaf::OnPaint(wxPaintEvent &WXUNUSED(event)) {
     wxPaintDC dc(m_impl->m_container);
     dc.SetBackground(wxBrush(m_impl->m_container->GetBackgroundColour(), wxSOLID));
     dc.Clear();
 
     wxPaintDC dc(m_impl->m_container);
     dc.SetBackground(wxBrush(m_impl->m_container->GetBackgroundColour(), wxSOLID));
     dc.Clear();
 
-    wxPen highlight(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNHIGHLIGHT), 1, wxSOLID);
-    wxPen shadow(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNSHADOW), 1, wxSOLID);
+    wxPen highlight(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT), 1, wxSOLID);
+    wxPen shadow(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW), 1, wxSOLID);
     wxPen black(*wxBLACK, 1, wxSOLID);
 
     wxSize size = m_impl->m_container->GetSize();
     wxPen black(*wxBLACK, 1, wxSOLID);
 
     wxSize size = m_impl->m_container->GetSize();
@@ -1124,7 +1160,7 @@ void wxDynamicSashWindowLeaf::OnPaint(wxPaintEvent &event) {
     }
 }
 
     }
 }
 
-void wxDynamicSashWindowLeaf::OnScroll(wxScrollEvent &event) {
+void wxDynamicSashWindowLeaf::OnScroll(wxScrollEvent &WXUNUSED(event)) {
     int nx = -m_hscroll->GetThumbPosition();
     int ny = -m_vscroll->GetThumbPosition();
 
     int nx = -m_hscroll->GetThumbPosition();
     int ny = -m_vscroll->GetThumbPosition();
 
@@ -1171,7 +1207,7 @@ void wxDynamicSashWindowLeaf::OnMouseMove(wxMouseEvent &event) {
     m_impl->m_container->SetCursor(cursor);
 }
 
     m_impl->m_container->SetCursor(cursor);
 }
 
-void wxDynamicSashWindowLeaf::OnLeave(wxMouseEvent &event) {
+void wxDynamicSashWindowLeaf::OnLeave(wxMouseEvent &WXUNUSED(event)) {
     wxCursor cursor(wxCURSOR_ARROW);
     m_impl->m_container->SetCursor(cursor);
 }
     wxCursor cursor(wxCURSOR_ARROW);
     m_impl->m_container->SetCursor(cursor);
 }
@@ -1209,10 +1245,10 @@ void wxDynamicSashWindowLeaf::OnPress(wxMouseEvent &event) {
     }
 }
 
     }
 }
 
-void wxDynamicSashWindowLeaf::OnRelease(wxMouseEvent &event) {
+void wxDynamicSashWindowLeaf::OnRelease(wxMouseEvent &WXUNUSED(event)) {
 }
 
 }
 
-void wxDynamicSashWindowLeaf::OnReparent(wxEvent &event) {
+void wxDynamicSashWindowLeaf::OnReparent(wxEvent &WXUNUSED(event)) {
     if (m_child) {
         m_child->Reparent(m_viewport);
     }
     if (m_child) {
         m_child->Reparent(m_viewport);
     }