X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/43b5058d590c7acf58e5f75ec015e717d03830a2..a467ac36a568c8ed1c43604fd7f1f2b2d3b6efc2:/include/wx/generic/splitter.h diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 4bdd5ace6a..09fa572b01 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"); + long style = wxSP_3D, + 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, + const wxString& name = "splitter"); + // Gets the only or left/top pane wxWindow *GetWindow1() const { return m_windowOne; } @@ -164,23 +178,26 @@ public: 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); @@ -191,9 +208,13 @@ protected: void SendUnsplitEvent(wxWindow *winRemoved); +protected: + void Init(); + + int m_splitMode; bool m_permitUnsplitAlways; - bool m_needUpdating; // when in live mode, set the to TRUE to resize children in idle + 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; @@ -302,39 +323,39 @@ private: typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&); #define EVT_SPLITTER_SASH_POS_CHANGED(id, fn) \ - { \ + DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, \ id, \ -1, \ (wxObjectEventFunction)(wxEventFunction)(wxSplitterEventFunction) &fn, \ NULL \ - }, + ), #define EVT_SPLITTER_SASH_POS_CHANGING(id, fn) \ - { \ + DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, \ id, \ -1, \ (wxObjectEventFunction)(wxEventFunction)(wxSplitterEventFunction) &fn, \ NULL \ - }, + ), #define EVT_SPLITTER_DCLICK(id, fn) \ - { \ + DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, \ id, \ -1, \ (wxObjectEventFunction)(wxEventFunction)(wxSplitterEventFunction) &fn, \ NULL \ - }, + ), #define EVT_SPLITTER_UNSPLIT(id, fn) \ - { \ + DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_COMMAND_SPLITTER_UNSPLIT, \ id, \ -1, \ (wxObjectEventFunction)(wxEventFunction)(wxSplitterEventFunction) &fn, \ NULL \ - }, + ), #endif // __SPLITTERH_G__