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 //---------------------------------------------------------------------------
38 wxSPLIT_HORIZONTAL = 1,
45 wxSPLIT_DRAG_DRAGGING,
46 wxSPLIT_DRAG_LEFT_DOWN
49 //---------------------------------------------------------------------------
52 // wxSplitterWindow maintains one or two panes, with an optional vertical or
53 // horizontal split which can be used with the mouse or programmatically.
54 class wxSplitterWindow: public wxWindow
57 %pythonPrepend wxSplitterWindow "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point']"
58 %pythonPrepend wxSplitterWindow() ""
59 %pythonAppend wxSplitterWindow "self._setOORInfo(self)"
60 %pythonAppend wxSplitterWindow() ""
62 wxSplitterWindow(wxWindow* parent, wxWindowID id,
63 const wxPoint& pos = wxDefaultPosition,
64 const wxSize& size = wxDefaultSize,
66 const wxString& name = wxPySplitterNameStr);
67 %name(PreSplitterWindow)wxSplitterWindow();
69 bool Create(wxWindow* parent, wxWindowID id,
70 const wxPoint& pos = wxDefaultPosition,
71 const wxSize& size = wxDefaultSize,
73 const wxString& name = wxPySplitterNameStr);
75 // Gets the only or left/top pane
76 wxWindow *GetWindow1() const;
78 // Gets the right/bottom pane
79 wxWindow *GetWindow2() const;
81 // Sets the split mode
82 void SetSplitMode(int mode);
84 // Gets the split mode
85 wxSplitMode GetSplitMode() const;
87 // Initialize with one window
88 void Initialize(wxWindow *window);
90 // Associates the given window with window 2, drawing the appropriate sash
91 // and changing the split mode.
92 // Does nothing and returns False if the window is already split.
93 // A sashPosition of 0 means choose a default sash position,
94 // negative sashPosition specifies the size of right/lower pane as it's
95 // absolute value rather than the size of left/upper pane.
96 virtual bool SplitVertically(wxWindow *window1,
98 int sashPosition = 0);
100 virtual bool SplitHorizontally(wxWindow *window1,
102 int sashPosition = 0);
104 // Removes the specified (or second) window from the view
105 // Doesn't actually delete the window.
106 bool Unsplit(wxWindow *toRemove = NULL);
108 // Replaces one of the windows with another one (neither old nor new
109 // parameter should be NULL)
110 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
112 // Make sure the child window sizes are updated. This is useful
113 // for reducing flicker by updating the sizes before a
114 // window is shown, if you know the overall size is correct.
117 // Is the window split?
118 bool IsSplit() const;
120 // Sets the sash size
121 void SetSashSize(int width);
123 // Sets the border size
124 void SetBorderSize(int width);
126 // Gets the sash size
127 int GetSashSize() const;
129 // Gets the border size
130 int GetBorderSize() const;
132 // Set the sash position
133 void SetSashPosition(int position, bool redraw = True);
135 // Gets the sash position
136 int GetSashPosition() const;
138 // If this is zero, we can remove panes by dragging the sash.
139 void SetMinimumPaneSize(int min);
140 int GetMinimumPaneSize() const;
143 // Tests for x, y over sash
144 virtual bool SashHitTest(int x, int y, int tolerance = 5);
146 // Resizes subwindows
147 virtual void SizeWindows();
149 void SetNeedUpdating(bool needUpdating);
150 bool GetNeedUpdating() const;
156 // we reuse the same class for all splitter event types because this is the
157 // usual wxWin convention, but the three event types have different kind of
158 // data associated with them, so the accessors can be only used if the real
159 // event type matches with the one for which the accessors make sense
160 class wxSplitterEvent : public wxNotifyEvent
163 wxSplitterEvent(wxEventType type = wxEVT_NULL,
164 wxSplitterWindow *splitter = (wxSplitterWindow *)NULL);
167 // SASH_POS_CHANGED methods
169 // setting the sash position to -1 prevents the change from taking place at
171 void SetSashPosition(int pos);
172 int GetSashPosition() const;
174 // UNSPLIT event methods
175 wxWindow *GetWindowBeingRemoved() const;
177 // DCLICK event methods
184 %constant wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED;
185 %constant wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING;
186 %constant wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED;
187 %constant wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT;
191 EVT_SPLITTER_SASH_POS_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, 1 )
192 EVT_SPLITTER_SASH_POS_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, 1 )
193 EVT_SPLITTER_DOUBLECLICKED = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, 1 )
194 EVT_SPLITTER_UNSPLIT = wx.PyEventBinder( wxEVT_COMMAND_SPLITTER_UNSPLIT, 1 )
195 EVT_SPLITTER_DCLICK = EVT_SPLITTER_DOUBLECLICKED
198 //---------------------------------------------------------------------------