1 #ifndef FILEZILLA_INTERFACE_SPLITTER_HEADER 2 #define FILEZILLA_INTERFACE_SPLITTER_HEADER 3 4 class CSplitterWindowEx final : public wxSplitterWindow 5 { 6 public: 7 CSplitterWindowEx(); 8 CSplitterWindowEx(wxWindow* parent, wxWindowID id, wxPoint const& point = wxDefaultPosition, wxSize const& size = wxDefaultSize, long style = wxSP_3D, wxString const& name = _T("splitterWindow")); 9 10 bool Create(wxWindow* parent, wxWindowID id, wxPoint const& point = wxDefaultPosition, wxSize const& size = wxDefaultSize, long style = wxSP_3D, wxString const& name = _T("splitterWindow")); 11 12 void SetSashGravity(double gravity); 13 14 // If pane size goes below paneSize_soft, make sure both panes are equally large 15 void SetMinimumPaneSize(int paneSize, int paneSize_soft = -1); 16 17 int GetSashPosition() const; 18 void SetSashPosition(int sash_position); 19 void SetRelativeSashPosition(double relative_sash_position); GetRelativeSashPosition()20 double GetRelativeSashPosition() const { return m_relative_sash_position; } 21 22 void Initialize(wxWindow *window); 23 24 bool SplitHorizontally(wxWindow* window1, wxWindow* window2, int sashPosition = 0); 25 bool SplitVertically(wxWindow* window1, wxWindow* window2, int sashPosition = 0); 26 27 bool Unsplit(wxWindow* toRemove = NULL); 28 29 protected: 30 void PrepareSplit(wxWindow* window1, wxWindow* window2, int & sashPosition, bool horizontal); 31 32 virtual int OnSashPositionChanging(int newSashPosition); 33 34 int CalcSoftLimit(int newSashPosition); 35 36 DECLARE_EVENT_TABLE() 37 void OnSize(wxSizeEvent& event); 38 39 double m_relative_sash_position{0.5}; 40 41 int m_soft_min_pane_size{-1}; 42 43 int m_lastSashPosition{-1}; 44 }; 45 46 #endif 47