1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of MORE window classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/notebook.h>
19 #include <wx/splitter.h>
21 #include <wx/msw/taskbar.h>
25 //----------------------------------------------------------------------
28 %include my_typemaps.i
30 // Import some definitions of other classes, etc.
38 %pragma(python) code = "import wx"
40 //---------------------------------------------------------------------------
54 wxString& GetTextValue();
55 void SetTextValue(const wxString& str);
57 void SetFont(wxFont& f);
58 wxColour& GetTextColour();
59 void SetTextColour(const wxColour& colour);
60 wxColour& GetBackgroundColour();
61 void SetBackgroundColour(const wxColour& colour);
62 wxBrush& GetBackgroundBrush();
64 void SetAlignment(int align);
65 wxBitmap* GetCellBitmap();
66 void SetCellBitmap(wxBitmap* bitmap);
72 class wxGrid : public wxPanel {
74 wxGrid(wxWindow* parent, wxWindowID id,
75 const wxPoint& pos=wxPyDefaultPosition,
76 const wxSize& size=wxPyDefaultSize,
80 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
81 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)"
82 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)"
83 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)"
84 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)"
85 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)"
86 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)"
87 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)"
88 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)"
89 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)"
92 void AdjustScrollbars();
93 bool AppendCols(int n=1, bool updateLabels=TRUE);
94 bool AppendRows(int n=1, bool updateLabels=TRUE);
96 bool CellHitTest(int x, int y, int *OUTPUT, int *OUTPUT);
99 // TODO: For now we are just ignoring the initial cellValues
100 // and widths. Add support for loading them from
101 // Python sequence objects.
102 bool CreateGrid(int rows, int cols,
103 //PyObject* cellValues = NULL,
104 //PyObject* widths = NULL,
105 short defaultWidth = wxGRID_DEFAULT_CELL_WIDTH,
106 short defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT) {
107 return self->CreateGrid(rows, cols, NULL, NULL,
108 defaultWidth, defaultHeight);
112 bool CurrentCellVisible();
113 bool DeleteCols(int pos=0, int n=1, bool updateLabels=TRUE);
114 bool DeleteRows(int pos=0, int n=1, bool updateLabels=TRUE);
118 wxGridCell* GetCell(int row, int col);
119 int GetCellAlignment(int row, int col);
120 %name(GetDefCellAlignment)int GetCellAlignment();
121 wxColour& GetCellBackgroundColour(int row, int col);
122 %name(GetDefCellBackgroundColour) wxColour& GetCellBackgroundColour();
123 //wxGridCell *** GetCells();
124 wxColour& GetCellTextColour(int row, int col);
125 %name(GetDefCellTextColour)wxColour& GetCellTextColour();
126 wxFont& GetCellTextFont(int row, int col);
127 %name(GetDefCellTextFont)wxFont& GetCellTextFont();
128 wxString& GetCellValue(int row, int col);
130 int GetColumnWidth(int col);
131 wxRect GetCurrentRect();
132 int GetCursorColumn();
135 wxScrollBar * GetHorizScrollBar();
136 int GetLabelAlignment(int orientation);
137 wxColour& GetLabelBackgroundColour();
138 int GetLabelSize(int orientation);
139 wxColour& GetLabelTextColour();
140 wxFont& GetLabelTextFont();
141 wxString& GetLabelValue(int orientation, int pos);
142 int GetRowHeight(int row);
146 wxTextCtrl* GetTextItem();
147 wxScrollBar* GetVertScrollBar();
149 bool InsertCols(int pos=0, int n=1, bool updateLabels=TRUE);
150 bool InsertRows(int pos=0, int n=1, bool updateLabels=TRUE);
152 void OnActivate(bool active);
154 void SetCellAlignment(int alignment, int row, int col);
155 %name(SetDefCellAlignment)void SetCellAlignment(int alignment);
156 void SetCellBackgroundColour(const wxColour& colour, int row, int col);
157 %name(SetDefCellBackgroundColour)
158 void SetCellBackgroundColour(const wxColour& colour);
159 void SetCellTextColour(const wxColour& colour, int row, int col);
160 %name(SetDefCellTextColour)void SetCellTextColour(const wxColour& colour);
161 void SetCellTextFont(wxFont& font, int row, int col);
162 %name(SetDefCellTextFont)void SetCellTextFont(wxFont& font);
163 void SetCellValue(const wxString& val, int row, int col);
164 void SetColumnWidth(int col, int width);
165 void SetDividerPen(wxPen& pen);
166 void SetEditable(bool editable);
167 void SetGridCursor(int row, int col);
168 void SetLabelAlignment(int orientation, int alignment);
169 void SetLabelBackgroundColour(const wxColour& value);
170 void SetLabelSize(int orientation, int size);
171 void SetLabelTextColour(const wxColour& value);
172 void SetLabelTextFont(wxFont& font);
173 void SetLabelValue(int orientation, const wxString& value, int pos);
174 void SetRowHeight(int row, int height);
176 void UpdateDimensions();
180 class wxGridEvent : public wxEvent {
193 wxEVT_GRID_SELECT_CELL,
194 wxEVT_GRID_CREATE_CELL,
195 wxEVT_GRID_CHANGE_LABELS,
196 wxEVT_GRID_CHANGE_SEL_LABEL,
197 wxEVT_GRID_CELL_CHANGE,
198 wxEVT_GRID_CELL_LCLICK,
199 wxEVT_GRID_CELL_RCLICK,
200 wxEVT_GRID_LABEL_LCLICK,
201 wxEVT_GRID_LABEL_RCLICK,
205 //---------------------------------------------------------------------------
207 class wxNotebookEvent : public wxNotifyEvent {
210 int GetOldSelection();
211 void SetOldSelection(int page);
212 void SetSelection(int page);
217 class wxNotebook : public wxControl {
219 wxNotebook(wxWindow *parent,
221 const wxPoint& pos = wxPyDefaultPosition,
222 const wxSize& size = wxPyDefaultSize,
224 char* name = "notebook");
226 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
229 int SetSelection(int nPage);
230 void AdvanceSelection(bool bForward = TRUE);
232 bool SetPageText(int nPage, const wxString& strText);
233 wxString GetPageText(int nPage) const;
234 void SetImageList(wxImageList* imageList);
235 wxImageList* GetImageList();
236 int GetPageImage(int nPage);
237 bool SetPageImage(int nPage, int nImage);
240 // LINK ERROR: void SetPageSize(const wxSize& size);
241 // LINK ERROR: void SetPadding(const wxSize& padding);
242 bool DeletePage(int nPage);
243 bool RemovePage(int nPage);
244 bool DeleteAllPages();
245 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
246 const wxString& strText,
250 bool InsertPage(int nPage,
251 /*wxNotebookPage*/ wxWindow *pPage,
252 const wxString& strText,
253 bool bSelect = FALSE,
256 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
259 void ResizeChildren() {
260 wxSizeEvent evt(self->GetClientSize());
261 self->GetEventHandler()->ProcessEvent(evt);
268 //---------------------------------------------------------------------------
270 class wxSplitterEvent : public wxCommandEvent {
272 int GetSashPosition();
275 wxWindow* GetWindowBeingRemoved();
276 void SetSashPosition(int pos);
282 class wxSplitterWindow : public wxWindow {
284 wxSplitterWindow(wxWindow* parent, wxWindowID id,
285 const wxPoint& point = wxPyDefaultPosition,
286 const wxSize& size = wxPyDefaultSize,
287 long style=wxSP_3D|wxCLIP_CHILDREN,
288 char* name = "splitterWindow");
290 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
293 int GetMinimumPaneSize();
294 int GetSashPosition();
297 wxWindow* GetWindow1();
298 wxWindow* GetWindow2();
299 void Initialize(wxWindow* window);
303 void SetBorderSize(int width);
304 void SetSashPosition(int position, int redraw = TRUE);
305 void SetSashSize(int width);
306 void SetMinimumPaneSize(int paneSize);
307 void SetSplitMode(int mode);
308 bool SplitHorizontally(wxWindow* window1, wxWindow* window2, int sashPosition = 0);
309 bool SplitVertically(wxWindow* window1, wxWindow* window2, int sashPosition = 0);
310 bool Unsplit(wxWindow* toRemove = NULL);
313 //---------------------------------------------------------------------------
319 wxEVT_TASKBAR_LEFT_DOWN,
320 wxEVT_TASKBAR_LEFT_UP,
321 wxEVT_TASKBAR_RIGHT_DOWN,
322 wxEVT_TASKBAR_RIGHT_UP,
323 wxEVT_TASKBAR_LEFT_DCLICK,
324 wxEVT_TASKBAR_RIGHT_DCLICK
328 class wxTaskBarIcon : public wxEvtHandler {
333 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
334 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
335 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
336 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
337 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
338 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
339 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
341 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
342 bool RemoveIcon(void);
343 bool PopupMenu(wxMenu *menu);
348 //---------------------------------------------------------------------------