forked from svn2github/wxPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_bookctrl.i
More file actions
191 lines (140 loc) · 6.56 KB
/
Copy path_bookctrl.i
File metadata and controls
191 lines (140 loc) · 6.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/////////////////////////////////////////////////////////////////////////////
// Name: _bookctrl.i
// Purpose: SWIG interface defs for wxBookCtrlBase
//
// Author: Robin Dunn
//
// Created: 19-Oct-2011
// RCS-ID: $Id: $
// Copyright: (c) 2011 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%newgroup
enum {
wxBK_DEFAULT,
wxBK_TOP,
wxBK_BOTTOM,
wxBK_LEFT,
wxBK_RIGHT,
wxBK_ALIGN_MASK,
wxBK_BUTTONBAR, // deprecated
wxTBK_BUTTONBAR,
wxTBK_HORZ_LAYOUT,
// hittest flags
wxBK_HITTEST_NOWHERE = 1, // not on tab
wxBK_HITTEST_ONICON = 2, // on icon
wxBK_HITTEST_ONLABEL = 4, // on label
wxBK_HITTEST_ONITEM = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL,
wxBK_HITTEST_ONPAGE = 8, // not on tab control, but over the selected page
};
MustHaveApp(wxBookCtrlBase);
// Common base class for wxList/Tree/Notebook
class wxBookCtrlBase : public wxControl, public wxWithImages
{
public:
// This is an ABC, it can't be constructed...
// wxBookCtrlBase(wxWindow *parent,
// wxWindowID id,
// const wxPoint& pos = wxDefaultPosition,
// const wxSize& size = wxDefaultSize,
// long style = 0,
// const wxString& name = wxPyEmptyString);
// %RenameCtor(PreBookCtrlBase, wxBookCtrlBase());
// bool Create(wxWindow *parent,
// wxWindowID id,
// const wxPoint& pos = wxDefaultPosition,
// const wxSize& size = wxDefaultSize,
// long style = 0,
// const wxString& name = wxPyEmptyString);
// get number of pages in the dialog
virtual size_t GetPageCount() const;
// get the panel which represents the given page
virtual wxWindow *GetPage(size_t n);
// get the current page or NULL if none
wxWindow* GetCurrentPage() const;
// get the currently selected page or wxNOT_FOUND if none
virtual int GetSelection() const/* = 0*/;
// set/get the title of a page
virtual bool SetPageText(size_t n, const wxString& strText)/* = 0*/;
virtual wxString GetPageText(size_t n) const/* = 0*/;
// sets/returns item's image index in the current image list
virtual int GetPageImage(size_t n) const/* = 0*/;
virtual bool SetPageImage(size_t n, int imageId)/* = 0*/;
// resize the notebook so that all pages will have the specified size
virtual void SetPageSize(const wxSize& size);
// calculate the size of the control from the size of its page
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const/* = 0*/;
// get/set size of area between book control area and page area
unsigned int GetInternalBorder() const;
void SetInternalBorder(unsigned int internalBorder);
// returns true if we have wxCHB_TOP or wxCHB_BOTTOM style
bool IsVertical() const;
// Sets/gets the margin around the controller
void SetControlMargin(int margin);
int GetControlMargin() const;
// set/get option to shrink to fit current page
void SetFitToCurrentPage(bool fit);
bool GetFitToCurrentPage() const;
// returns the sizer containing the control, if any
wxSizer* GetControlSizer() const;
// remove one page from the control and delete it
virtual bool DeletePage(size_t n);
// remove one page from the notebook, without deleting it
virtual bool RemovePage(size_t n);
// remove all pages and delete them
virtual bool DeleteAllPages();
// adds a new page to the control
virtual bool AddPage(wxWindow *page,
const wxString& text,
bool select = false,
int imageId = -1);
// the same as AddPage(), but adds the page at the specified position
virtual bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool select = false,
int imageId = -1)/* = 0*/;
// set the currently selected page, return the index of the previously
// selected one (or -1 on error)
//
// NB: this function will _not_ generate PAGE_CHANGING/ED events
virtual int SetSelection(size_t n)/* = 0*/;
// acts as SetSelection but does not generate events
virtual int ChangeSelection(size_t n)/* = 0*/;
// cycle thru the pages
void AdvanceSelection(bool forward = true);
DocDeclAStr(
virtual int, HitTest(const wxPoint& pt, long* OUTPUT) const,
"HitTest(Point pt) -> (tab, where)",
"Returns the page/tab which is hit, and flags indicating where using
wx.NB_HITTEST flags.", "");
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
%property(ControlMargin, GetControlMargin, SetControlMargin, doc="See `GetControlMargin` and `SetControlMargin`");
%property(ControlSizer, GetControlSizer, doc="See `GetControlSizer`");
%property(CurrentPage, GetCurrentPage, doc="See `GetCurrentPage`");
%property(FitToCurrentPage, GetFitToCurrentPage, SetFitToCurrentPage, doc="See `GetFitToCurrentPage` and `SetFitToCurrentPage`");
%property(InternalBorder, GetInternalBorder, SetInternalBorder, doc="See `GetInternalBorder` and `SetInternalBorder`");
%property(PageCount, GetPageCount, doc="See `GetPageCount`");
%property(PageImage, GetPageImage, SetPageImage, doc="See `GetPageImage` and `SetPageImage`");
%property(PageText, GetPageText, SetPageText, doc="See `GetPageText` and `SetPageText`");
%property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
};
//---------------------------------------------------------------------------
class wxBookCtrlEvent : public wxNotifyEvent
{
public:
wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
int nSel = -1, int nOldSel = -1);
// the currently selected page (-1 if none)
int GetSelection() const;
void SetSelection(int nSel);
// the page that was selected before the change (-1 if none)
int GetOldSelection() const;
void SetOldSelection(int nOldSel);
%property(OldSelection, GetOldSelection, SetOldSelection, doc="See `GetOldSelection` and `SetOldSelection`");
%property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
};
//---------------------------------------------------------------------------