X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37d403aa1cf182cfc01e2ce1753c2dda39ba82ea..cd378f94bec1edc0f991ee55b02bfe3084de94e0:/src/generic/splitter.cpp?ds=sidebyside diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 912c8dc8b6..6ff6aa9b62 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -34,6 +34,11 @@ #include "wx/settings.h" #include "wx/log.h" +DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_DOUBLECLICKED) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_UNSPLIT) + IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxCommandEvent) @@ -134,10 +139,12 @@ void wxSplitterWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) DrawSash(dc); } -void wxSplitterWindow::OnIdle(wxIdleEvent& WXUNUSED(event)) +void wxSplitterWindow::OnIdle(wxIdleEvent& event) { if (m_needUpdating) SizeWindows(); + + event.Skip(); } void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) @@ -307,7 +314,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) return; } } - + if (new_sash_position == m_sashPosition) return; @@ -691,7 +698,7 @@ void wxSplitterWindow::SizeWindows() if ( GetBorderSize() > 0 ) DrawBorders(dc); DrawSash(dc); - + SetNeedUpdating(FALSE); } @@ -720,7 +727,7 @@ bool wxSplitterWindow::SplitVertically(wxWindow *window1, wxWindow *window2, int if ( sashPosition > 0 ) m_sashPosition = sashPosition; else if ( sashPosition < 0 ) - m_sashPosition = w - sashPosition; + m_sashPosition = w + sashPosition; // It's negative so adding is subtracting else // default m_sashPosition = w/2; @@ -743,7 +750,7 @@ bool wxSplitterWindow::SplitHorizontally(wxWindow *window1, wxWindow *window2, i if ( sashPosition > 0 ) m_sashPosition = sashPosition; else if ( sashPosition < 0 ) - m_sashPosition = h - sashPosition; + m_sashPosition = h + sashPosition; // It's negative so adding is subtracting else // default m_sashPosition = h/2;