X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/370938d99c9de739c84c1d3e3cc9ef9a7b72efe5..bd3e41f6003fa1d589c1477a327931c3f57516f2:/include/wx/generic/splitter.h diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index aa70baae1d..3f4f31b1cd 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -60,16 +60,30 @@ public: // Public API // Default constructor - wxSplitterWindow(); + wxSplitterWindow() + { + Init(); + } // Normal constructor wxSplitterWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_3D|wxCLIP_CHILDREN, - const wxString& name = "splitter"); + const wxString& name = "splitter") + { + Init(); + Create(parent, id, pos, size, style, name); + } + ~wxSplitterWindow(); + bool Create(wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxSP_3D|wxCLIP_CHILDREN, + const wxString& name = "splitter"); + // Gets the only or left/top pane wxWindow *GetWindow1() const { return m_windowOne; } @@ -160,35 +174,47 @@ public: // Adjusts the panes void OnSize(wxSizeEvent& event); + // In live mode, resize child windows in idle time + void OnIdle(wxIdleEvent& event); + // Draws borders - void DrawBorders(wxDC& dc); + virtual void DrawBorders(wxDC& dc); // Draws the sash - void DrawSash(wxDC& dc); + virtual void DrawSash(wxDC& dc); // Draws the sash tracker (for whilst moving the sash) - void DrawSashTracker(int x, int y); + virtual void DrawSashTracker(int x, int y); // Tests for x, y over sash - bool SashHitTest(int x, int y, int tolerance = 2); + virtual bool SashHitTest(int x, int y, int tolerance = 2); // Resizes subwindows - void SizeWindows(); + virtual void SizeWindows(); // Initialize colours void InitColours(); + void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; } + bool GetNeedUpdating() const { return m_needUpdating ; } + protected: // our event handlers void OnSashPosChanged(wxSplitterEvent& event); void OnSashPosChanging(wxSplitterEvent& event); void OnDoubleClick(wxSplitterEvent& event); void OnUnsplitEvent(wxSplitterEvent& event); + void OnSetCursor(wxSetCursorEvent& event); void SendUnsplitEvent(wxWindow *winRemoved); +protected: + void Init(); + + int m_splitMode; bool m_permitUnsplitAlways; + bool m_needUpdating; // when in live mode, set this to TRUE to resize children in idle wxWindow* m_windowOne; wxWindow* m_windowTwo; int m_dragMode; @@ -231,6 +257,7 @@ public: : wxCommandEvent(type) { SetEventObject(splitter); + if (splitter) m_id = splitter->GetId(); } // SASH_POS_CHANGED methods @@ -277,7 +304,7 @@ public: } private: - friend wxSplitterWindow; + friend class WXDLLEXPORT wxSplitterWindow; // data for the different types of event union