1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxSplitterWindow
7 // Created: 2-June-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
18 MAKE_CONST_WXSTRING2(SplitterNameStr, wxT("splitter"));
20 //---------------------------------------------------------------------------
37 wxSPLIT_HORIZONTAL = 1,
44 wxSPLIT_DRAG_DRAGGING,
45 wxSPLIT_DRAG_LEFT_DOWN
48 //---------------------------------------------------------------------------
51 // wxSplitterWindow maintains one or two panes, with an optional vertical or
52 // horizontal split which can be used with the mouse or programmatically.
53 class wxSplitterWindow: public wxWindow
56 %addtofunc wxSplitterWindow "self._setOORInfo(self)"
57 %addtofunc wxSplitterWindow() ""
59 wxSplitterWindow(wxWindow* parent, wxWindowID id,
60 const wxPoint& point = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
63 const wxString& name = wxPySplitterNameStr);
64 %name(PreSplitterWindow)wxSplitterWindow();
66 bool Create(wxWindow* parent, wxWindowID id,
67 const wxPoint& point = wxDefaultPosition,
68 const wxSize& size = wxDefaultSize,
70 const wxString& name = wxPySplitterNameStr);
72 // Gets the only or left/top pane
73 wxWindow *GetWindow1() const;
75 // Gets the right/bottom pane
76 wxWindow *GetWindow2() const;
78 // Sets the split mode
79 void SetSplitMode(int mode);
81 // Gets the split mode
82 wxSplitMode GetSplitMode() const;
84 // Initialize with one window
85 void Initialize(wxWindow *window);
87 // Associates the given window with window 2, drawing the appropriate sash
88 // and changing the split mode.
89 // Does nothing and returns False if the window is already split.
90 // A sashPosition of 0 means choose a default sash position,
91 // negative sashPosition specifies the size of right/lower pane as it's
92 // absolute value rather than the size of left/upper pane.
93 virtual bool SplitVertically(wxWindow *window1,
95 int sashPosition = 0);
97 virtual bool SplitHorizontally(wxWindow *window1,
99 int sashPosition = 0);
101 // Removes the specified (or second) window from the view
102 // Doesn't actually delete the window.
103 bool Unsplit(wxWindow *toRemove = NULL);
105 // Replaces one of the windows with another one (neither old nor new
106 // parameter should be NULL)
107 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
109 // Is the window split?
110 bool IsSplit() const;
112 // Sets the sash size
113 void SetSashSize(int width);
115 // Sets the border size
116 void SetBorderSize(int width);
118 // Gets the sash size
119 int GetSashSize() const;
121 // Gets the border size
122 int GetBorderSize() const;
124 // Set the sash position
125 void SetSashPosition(int position, bool redraw = True);
127 // Gets the sash position
128 int GetSashPosition() const;
130 // If this is zero, we can remove panes by dragging the sash.
131 void SetMinimumPaneSize(int min);
132 int GetMinimumPaneSize() const;
135 // Tests for x, y over sash
136 virtual bool SashHitTest(int x, int y, int tolerance = 5);
138 // Resizes subwindows
139 virtual void SizeWindows();
141 void SetNeedUpdating(bool needUpdating);
142 bool GetNeedUpdating() const;
148 // we reuse the same class for all splitter event types because this is the
149 // usual wxWin convention, but the three event types have different kind of
150 // data associated with them, so the accessors can be only used if the real
151 // event type matches with the one for which the accessors make sense
152 class wxSplitterEvent : public wxNotifyEvent
155 wxSplitterEvent(wxEventType type = wxEVT_NULL,
156 wxSplitterWindow *splitter = (wxSplitterWindow *)NULL);
159 // SASH_POS_CHANGED methods
161 // setting the sash position to -1 prevents the change from taking place at
163 void SetSashPosition(int pos);
164 int GetSashPosition() const;
166 // UNSPLIT event methods
167 wxWindow *GetWindowBeingRemoved() const;
169 // DCLICK event methods
176 %constant wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED;
177 %constant wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING;
178 %constant wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED;
179 %constant wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT;
183 EVT_SPLITTER_SASH_POS_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, 1 )
184 EVT_SPLITTER_SASH_POS_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, 1 )
185 EVT_SPLITTER_DOUBLECLICKED = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, 1 )
186 EVT_SPLITTER_UNSPLIT = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_UNSPLIT, 1 )
189 //---------------------------------------------------------------------------