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 %pythonPrepend wxSplitterWindow "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point']"
57 %pythonPrepend wxSplitterWindow() ""
58 %pythonAppend wxSplitterWindow "self._setOORInfo(self)"
59 %pythonAppend wxSplitterWindow() ""
61 wxSplitterWindow(wxWindow* parent, wxWindowID id,
62 const wxPoint& pos = wxDefaultPosition,
63 const wxSize& size = wxDefaultSize,
65 const wxString& name = wxPySplitterNameStr);
66 %name(PreSplitterWindow)wxSplitterWindow();
68 bool Create(wxWindow* parent, wxWindowID id,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
72 const wxString& name = wxPySplitterNameStr);
74 // Gets the only or left/top pane
75 wxWindow *GetWindow1() const;
77 // Gets the right/bottom pane
78 wxWindow *GetWindow2() const;
80 // Sets the split mode
81 void SetSplitMode(int mode);
83 // Gets the split mode
84 wxSplitMode GetSplitMode() const;
86 // Initialize with one window
87 void Initialize(wxWindow *window);
89 // Associates the given window with window 2, drawing the appropriate sash
90 // and changing the split mode.
91 // Does nothing and returns False if the window is already split.
92 // A sashPosition of 0 means choose a default sash position,
93 // negative sashPosition specifies the size of right/lower pane as it's
94 // absolute value rather than the size of left/upper pane.
95 virtual bool SplitVertically(wxWindow *window1,
97 int sashPosition = 0);
99 virtual bool SplitHorizontally(wxWindow *window1,
101 int sashPosition = 0);
103 // Removes the specified (or second) window from the view
104 // Doesn't actually delete the window.
105 bool Unsplit(wxWindow *toRemove = NULL);
107 // Replaces one of the windows with another one (neither old nor new
108 // parameter should be NULL)
109 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
111 // Is the window split?
112 bool IsSplit() const;
114 // Sets the sash size
115 void SetSashSize(int width);
117 // Sets the border size
118 void SetBorderSize(int width);
120 // Gets the sash size
121 int GetSashSize() const;
123 // Gets the border size
124 int GetBorderSize() const;
126 // Set the sash position
127 void SetSashPosition(int position, bool redraw = True);
129 // Gets the sash position
130 int GetSashPosition() const;
132 // If this is zero, we can remove panes by dragging the sash.
133 void SetMinimumPaneSize(int min);
134 int GetMinimumPaneSize() const;
137 // Tests for x, y over sash
138 virtual bool SashHitTest(int x, int y, int tolerance = 5);
140 // Resizes subwindows
141 virtual void SizeWindows();
143 void SetNeedUpdating(bool needUpdating);
144 bool GetNeedUpdating() const;
150 // we reuse the same class for all splitter event types because this is the
151 // usual wxWin convention, but the three event types have different kind of
152 // data associated with them, so the accessors can be only used if the real
153 // event type matches with the one for which the accessors make sense
154 class wxSplitterEvent : public wxNotifyEvent
157 wxSplitterEvent(wxEventType type = wxEVT_NULL,
158 wxSplitterWindow *splitter = (wxSplitterWindow *)NULL);
161 // SASH_POS_CHANGED methods
163 // setting the sash position to -1 prevents the change from taking place at
165 void SetSashPosition(int pos);
166 int GetSashPosition() const;
168 // UNSPLIT event methods
169 wxWindow *GetWindowBeingRemoved() const;
171 // DCLICK event methods
178 %constant wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED;
179 %constant wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING;
180 %constant wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED;
181 %constant wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT;
185 EVT_SPLITTER_SASH_POS_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, 1 )
186 EVT_SPLITTER_SASH_POS_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, 1 )
187 EVT_SPLITTER_DOUBLECLICKED = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, 1 )
188 EVT_SPLITTER_UNSPLIT = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_UNSPLIT, 1 )
191 //---------------------------------------------------------------------------