1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _core.sip
8//
9//---------------------------------------------------------------------------
10
11%ModuleHeaderCode
12#include <wx/treebook.h>
13%End
14
15
16//---------------------------------------------------------------------------
17
18wxEventType wxEVT_TREEBOOK_PAGE_CHANGED   /PyName=wxEVT_TREEBOOK_PAGE_CHANGED/;
19
20wxEventType wxEVT_TREEBOOK_PAGE_CHANGING   /PyName=wxEVT_TREEBOOK_PAGE_CHANGING/;
21
22wxEventType wxEVT_TREEBOOK_NODE_COLLAPSED   /PyName=wxEVT_TREEBOOK_NODE_COLLAPSED/;
23
24wxEventType wxEVT_TREEBOOK_NODE_EXPANDED   /PyName=wxEVT_TREEBOOK_NODE_EXPANDED/;
25
26class wxTreebook : wxBookCtrlBase
27{
28    %Docstring
29        Treebook()
30        Treebook(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=BK_DEFAULT, name=EmptyString)
31
32        This class is an extension of the wxNotebook class that allows a tree
33        structured set of pages to be shown in a control.
34    %End
35    %TypeHeaderCode
36        #include <wx/treebook.h>
37    %End
38
39public:
40    wxTreebook();
41    %PreMethodCode
42        if (!wxPyCheckForApp()) return NULL;
43    %End
44
45    wxTreebook(
46        wxWindow * parent   /TransferThis/,
47        wxWindowID id = wxID_ANY,
48        const wxPoint & pos = wxDefaultPosition,
49        const wxSize & size = wxDefaultSize,
50        long style = wxBK_DEFAULT,
51        const wxString & name = wxEmptyString
52    );
53    %PreMethodCode
54        if (!wxPyCheckForApp()) return NULL;
55    %End
56
57    ~wxTreebook();
58
59    bool AddPage(
60        wxWindow * page,
61        const wxString & text,
62        bool bSelect = false,
63        int imageId = wxNOT_FOUND
64    );
65    %Docstring
66        AddPage(page, text, bSelect=False, imageId=NOT_FOUND) -> bool
67
68        Adds a new page.
69    %End
70
71    bool AddSubPage(
72        wxWindow * page,
73        const wxString & text,
74        bool bSelect = false,
75        int imageId = wxNOT_FOUND
76    );
77    %Docstring
78        AddSubPage(page, text, bSelect=False, imageId=NOT_FOUND) -> bool
79
80        Adds a new child-page to the last top-level page.
81    %End
82
83    bool CollapseNode(
84        size_t pageId
85    );
86    %Docstring
87        CollapseNode(pageId) -> bool
88
89        Shortcut for ExpandNode( pageId, false ).
90    %End
91
92    bool Create(
93        wxWindow * parent   /TransferThis/,
94        wxWindowID id = wxID_ANY,
95        const wxPoint & pos = wxDefaultPosition,
96        const wxSize & size = wxDefaultSize,
97        long style = wxBK_DEFAULT,
98        const wxString & name = wxEmptyString
99    );
100    %Docstring
101        Create(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=BK_DEFAULT, name=EmptyString) -> bool
102
103        Creates a treebook control.
104    %End
105
106    bool DeletePage(
107        size_t pagePos
108    );
109    %Docstring
110        DeletePage(pagePos) -> bool
111
112        Deletes the page at the specified position and all its children.
113    %End
114
115    bool ExpandNode(
116        size_t pageId,
117        bool expand = true
118    );
119    %Docstring
120        ExpandNode(pageId, expand=True) -> bool
121
122        Expands (collapses) the pageId node.
123    %End
124
125    int GetPageParent(
126        size_t page
127    ) const;
128    %Docstring
129        GetPageParent(page) -> int
130
131        Returns the parent page of the given one or wxNOT_FOUND if this is a
132        top-level page.
133    %End
134
135    int GetSelection() const;
136    %Docstring
137        GetSelection() -> int
138
139        Returns the currently selected page, or wxNOT_FOUND if none was
140        selected.
141    %End
142
143    bool InsertPage(
144        size_t pagePos,
145        wxWindow * page,
146        const wxString & text,
147        bool bSelect = false,
148        int imageId = wxNOT_FOUND
149    );
150    %Docstring
151        InsertPage(pagePos, page, text, bSelect=False, imageId=NOT_FOUND) -> bool
152
153        Inserts a new page just before the page indicated by pagePos.
154    %End
155
156    bool InsertSubPage(
157        size_t pagePos,
158        wxWindow * page,
159        const wxString & text,
160        bool bSelect = false,
161        int imageId = wxNOT_FOUND
162    );
163    %Docstring
164        InsertSubPage(pagePos, page, text, bSelect=False, imageId=NOT_FOUND) -> bool
165
166        Inserts a sub page under the specified page.
167    %End
168
169    bool IsNodeExpanded(
170        size_t pageId
171    ) const;
172    %Docstring
173        IsNodeExpanded(pageId) -> bool
174
175        Returns true if the page represented by pageId is expanded.
176    %End
177
178    public:
179    virtual wxPoint GetClientAreaOrigin() const;
180    virtual bool Validate();
181    virtual bool TransferDataToWindow();
182    virtual bool TransferDataFromWindow();
183    virtual void InitDialog();
184    virtual bool AcceptsFocus() const;
185    virtual bool AcceptsFocusRecursively() const;
186    virtual bool AcceptsFocusFromKeyboard() const;
187    virtual void AddChild( wxWindowBase *child );
188    virtual void RemoveChild( wxWindowBase *child );
189    virtual void InheritAttributes();
190    virtual bool ShouldInheritColours() const;
191    virtual void OnInternalIdle();
192    virtual wxWindow *GetMainWindowOfCompositeControl();
193    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
194    virtual void SetCanFocus(bool canFocus);
195    virtual bool Destroy();
196    virtual void SetValidator( const wxValidator &validator );
197    virtual wxValidator* GetValidator();
198
199
200    protected:
201    virtual bool ProcessEvent(wxEvent & event);
202    virtual void DoEnable(bool enable);
203    virtual void DoGetPosition(int *x, int *y) const;
204    virtual void DoGetSize(int *width, int *height) const;
205    virtual void DoGetClientSize(int *width, int *height) const;
206    virtual wxSize DoGetBestSize() const;
207    virtual wxSize DoGetBestClientSize() const;
208    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
209    virtual void DoSetClientSize(int width, int height);
210    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
211    virtual wxSize DoGetBorderSize() const;
212    virtual void DoMoveWindow(int x, int y, int width, int height);
213    virtual void DoSetWindowVariant( wxWindowVariant variant);
214    virtual wxBorder GetDefaultBorder() const;
215    virtual wxBorder GetDefaultBorderForControl() const;
216    virtual void DoFreeze();
217    virtual void DoThaw();
218    virtual bool HasTransparentBackground();
219    virtual bool TryBefore(wxEvent& event);
220    virtual bool TryAfter(wxEvent& event);
221
222
223    public:
224
225
226    static
227    wxVisualAttributes GetClassDefaultAttributes(
228        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
229    );
230    %Docstring
231        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
232    %End
233    %PreMethodCode
234        if (!wxPyCheckForApp()) return NULL;
235    %End
236
237    virtual int GetPageImage(size_t nPage) const;
238
239
240    virtual bool SetPageImage(size_t page, int image);
241
242
243    virtual wxString GetPageText(size_t nPage) const;
244
245
246    virtual bool SetPageText(size_t page, const wxString& text);
247
248
249    virtual int SetSelection(size_t page);
250
251
252    virtual int ChangeSelection(size_t page);
253
254
255    virtual int HitTest(const wxPoint& pt, long* flags /Out/ = NULL) const;
256
257
258    virtual bool DeleteAllPages();
259
260
261    wxTreeCtrl* GetTreeCtrl();
262    %Docstring
263        GetTreeCtrl() -> TreeCtrl
264
265        Returns the tree control used for selecting pages.
266    %End
267    %MethodCode
268        PyErr_Clear();
269        Py_BEGIN_ALLOW_THREADS
270        sipRes = _wxTreebook_GetTreeCtrl(sipCpp);
271        Py_END_ALLOW_THREADS
272        if (PyErr_Occurred()) sipIsErr = 1;
273    %End
274    %TypeCode
275    wxTreeCtrl* _wxTreebook_GetTreeCtrl(wxTreebook* self)
276    {
277        return(self->GetTreeCtrl());
278    }
279    %End
280
281    public:
282
283
284    %Property(name=Selection, get=GetSelection)
285    %Property(name=TreeCtrl, get=GetTreeCtrl)
286};  // end of class wxTreebook
287
288
289%Extract(id=pycode_core)
290EVT_TREEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGED, 1 )
291EVT_TREEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGING, 1)
292EVT_TREEBOOK_NODE_COLLAPSED = wx.PyEventBinder( wxEVT_TREEBOOK_NODE_COLLAPSED, 1 )
293EVT_TREEBOOK_NODE_EXPANDED = wx.PyEventBinder( wxEVT_TREEBOOK_NODE_EXPANDED, 1 )
294
295# deprecated wxEVT aliases
296wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED    = wxEVT_TREEBOOK_PAGE_CHANGED
297wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING   = wxEVT_TREEBOOK_PAGE_CHANGING
298wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED  = wxEVT_TREEBOOK_NODE_COLLAPSED
299wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED   = wxEVT_TREEBOOK_NODE_EXPANDED
300
301%End
302
303
304//---------------------------------------------------------------------------
305
306