Module definitions files for build VisualAge C++ V3.0 dlls.
[wxWidgets.git] / utils / wxPython / src / windows2.i
CommitLineData
7bf85405
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: windows2.i
3// Purpose: SWIG definitions of MORE window classes
4//
5// Author: Robin Dunn
6//
7// Created: 6/2/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
03e9bead 13%module windows2
7bf85405 14
03e9bead 15%{
7bf85405
RD
16#include "helpers.h"
17#include <wx/grid.h>
18#include <wx/notebook.h>
9c039d08 19#include <wx/splitter.h>
b639c3c5
RD
20#ifdef __WXMSW__
21#include <wx/msw/taskbar.h>
22#endif
7bf85405
RD
23%}
24
25//----------------------------------------------------------------------
26
27%include typemaps.i
28%include my_typemaps.i
29
30// Import some definitions of other classes, etc.
31%import _defs.i
32%import misc.i
33%import gdi.i
34%import windows.i
35%import controls.i
36%import events.i
37
b8b8dda7 38%pragma(python) code = "import wx"
9c039d08 39
7bf85405
RD
40//---------------------------------------------------------------------------
41
dcd38683 42#ifndef OLD_GRID
b639c3c5 43
7bf85405
RD
44enum {
45 wxGRID_TEXT_CTRL,
46 wxGRID_HSCROLL,
b639c3c5 47 wxGRID_VSCROLL
7bf85405
RD
48};
49
7bf85405
RD
50class wxGridCell {
51public:
b639c3c5
RD
52 wxGridCell();
53 ~wxGridCell();
54
7bf85405 55 wxString& GetTextValue();
b639c3c5 56 void SetTextValue(const wxString& str);
b8b8dda7
RD
57 wxFont& GetFont();
58 void SetFont(wxFont& f);
7bf85405 59 wxColour& GetTextColour();
b639c3c5 60 void SetTextColour(const wxColour& colour);
7bf85405 61 wxColour& GetBackgroundColour();
b639c3c5 62 void SetBackgroundColour(const wxColour& colour);
b8b8dda7 63 wxBrush& GetBackgroundBrush();
b639c3c5
RD
64 int GetAlignment();
65 void SetAlignment(int align);
66 wxBitmap* GetCellBitmap();
b8b8dda7 67 void SetCellBitmap(wxBitmap* bitmap);
7bf85405
RD
68};
69
70
71
72
7bf85405
RD
73class wxGrid : public wxPanel {
74public:
75 wxGrid(wxWindow* parent, wxWindowID id,
76 const wxPoint& pos=wxPyDefaultPosition,
77 const wxSize& size=wxPyDefaultSize,
78 long style=0,
79 char* name="grid");
80
b8b8dda7
RD
81 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
82 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)"
83 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)"
84 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)"
85 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)"
86 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)"
87 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)"
88 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)"
89 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)"
90 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)"
b639c3c5 91
9c039d08 92
7bf85405 93 void AdjustScrollbars();
b7e72427
RD
94 bool AppendCols(int n=1, int updateLabels=TRUE);
95 bool AppendRows(int n=1, int updateLabels=TRUE);
7bf85405
RD
96 void BeginBatch();
97 bool CellHitTest(int x, int y, int *OUTPUT, int *OUTPUT);
98
99 %addmethods {
100 // TODO: For now we are just ignoring the initial cellValues
101 // and widths. Add support for loading them from
102 // Python sequence objects.
103 bool CreateGrid(int rows, int cols,
104 //PyObject* cellValues = NULL,
105 //PyObject* widths = NULL,
106 short defaultWidth = wxGRID_DEFAULT_CELL_WIDTH,
107 short defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT) {
108 return self->CreateGrid(rows, cols, NULL, NULL,
109 defaultWidth, defaultHeight);
110 }
111 }
112
113 bool CurrentCellVisible();
114 bool DeleteCols(int pos=0, int n=1, bool updateLabels=TRUE);
115 bool DeleteRows(int pos=0, int n=1, bool updateLabels=TRUE);
116 void EndBatch();
117
118 int GetBatchCount();
119 wxGridCell* GetCell(int row, int col);
120 int GetCellAlignment(int row, int col);
121 %name(GetDefCellAlignment)int GetCellAlignment();
122 wxColour& GetCellBackgroundColour(int row, int col);
0699c864 123 %name(GetDefCellBackgroundColour) wxColour& GetCellBackgroundColour();
8bf5d46e 124
7bf85405 125 //wxGridCell *** GetCells();
8bf5d46e
RD
126 %addmethods {
127 PyObject* GetCells() {
128 int row, col;
129 PyObject* rows = PyList_New(0);
130 for (row=0; row < self->GetRows(); row++) {
131 PyObject* rowList = PyList_New(0);
132 for (col=0; col < self->GetCols(); col++) {
133 wxGridCell* cell = self->GetCell(row, col);
134
1afc06c2 135 bool doSave = wxPyRestoreThread();
8bf5d46e 136 PyObject* pyCell = wxPyConstructObject(cell, "wxGridCell");
1afc06c2 137 wxPySaveThread(doSave);
8bf5d46e
RD
138
139 if (PyList_Append(rowList, pyCell) == -1)
140 return NULL;
141 }
142 if (PyList_Append(rows, rowList) == -1)
143 return NULL;
144 }
145 return rows;
146 }
147 }
7bf85405
RD
148 wxColour& GetCellTextColour(int row, int col);
149 %name(GetDefCellTextColour)wxColour& GetCellTextColour();
b8b8dda7
RD
150 wxFont& GetCellTextFont(int row, int col);
151 %name(GetDefCellTextFont)wxFont& GetCellTextFont();
7bf85405
RD
152 wxString& GetCellValue(int row, int col);
153 int GetCols();
154 int GetColumnWidth(int col);
cf694132 155 wxRect GetCurrentRect();
7bf85405
RD
156 int GetCursorColumn();
157 int GetCursorRow();
158 bool GetEditable();
159 wxScrollBar * GetHorizScrollBar();
160 int GetLabelAlignment(int orientation);
161 wxColour& GetLabelBackgroundColour();
162 int GetLabelSize(int orientation);
163 wxColour& GetLabelTextColour();
b8b8dda7 164 wxFont& GetLabelTextFont();
7bf85405
RD
165 wxString& GetLabelValue(int orientation, int pos);
166 int GetRowHeight(int row);
167 int GetRows();
168 int GetScrollPosX();
169 int GetScrollPosY();
170 wxTextCtrl* GetTextItem();
171 wxScrollBar* GetVertScrollBar();
172
173 bool InsertCols(int pos=0, int n=1, bool updateLabels=TRUE);
174 bool InsertRows(int pos=0, int n=1, bool updateLabels=TRUE);
175
b639c3c5 176 void OnActivate(bool active);
7bf85405
RD
177
178 void SetCellAlignment(int alignment, int row, int col);
179 %name(SetDefCellAlignment)void SetCellAlignment(int alignment);
180 void SetCellBackgroundColour(const wxColour& colour, int row, int col);
181 %name(SetDefCellBackgroundColour)
182 void SetCellBackgroundColour(const wxColour& colour);
183 void SetCellTextColour(const wxColour& colour, int row, int col);
184 %name(SetDefCellTextColour)void SetCellTextColour(const wxColour& colour);
b8b8dda7
RD
185 void SetCellTextFont(wxFont& font, int row, int col);
186 %name(SetDefCellTextFont)void SetCellTextFont(wxFont& font);
7bf85405
RD
187 void SetCellValue(const wxString& val, int row, int col);
188 void SetColumnWidth(int col, int width);
b8b8dda7 189 void SetDividerPen(wxPen& pen);
7bf85405
RD
190 void SetEditable(bool editable);
191 void SetGridCursor(int row, int col);
192 void SetLabelAlignment(int orientation, int alignment);
193 void SetLabelBackgroundColour(const wxColour& value);
194 void SetLabelSize(int orientation, int size);
195 void SetLabelTextColour(const wxColour& value);
b8b8dda7 196 void SetLabelTextFont(wxFont& font);
7bf85405
RD
197 void SetLabelValue(int orientation, const wxString& value, int pos);
198 void SetRowHeight(int row, int height);
199
200 void UpdateDimensions();
8bf5d46e
RD
201
202 bool GetEditInPlace();
203 void SetEditInPlace(int edit = TRUE);
204
7bf85405
RD
205};
206
b639c3c5
RD
207
208class wxGridEvent : public wxEvent {
209public:
210 int m_row;
211 int m_col;
212 int m_x;
213 int m_y;
214 bool m_control;
215 bool m_shift;
216 wxGridCell* m_cell;
1dc2f865
RD
217
218 int GetRow();
219 int GetCol();
220 wxPoint GetPosition();
221 bool ControlDown();
222 bool ShiftDown();
223 wxGridCell* GetCell();
b639c3c5
RD
224};
225
226
227enum {
228 wxEVT_GRID_SELECT_CELL,
229 wxEVT_GRID_CREATE_CELL,
230 wxEVT_GRID_CHANGE_LABELS,
231 wxEVT_GRID_CHANGE_SEL_LABEL,
232 wxEVT_GRID_CELL_CHANGE,
233 wxEVT_GRID_CELL_LCLICK,
234 wxEVT_GRID_CELL_RCLICK,
235 wxEVT_GRID_LABEL_LCLICK,
236 wxEVT_GRID_LABEL_RCLICK,
237};
238
dcd38683 239#endif
b639c3c5 240
7bf85405
RD
241//---------------------------------------------------------------------------
242
bb0054cd 243class wxNotebookEvent : public wxNotifyEvent {
7bf85405
RD
244public:
245 int GetSelection();
246 int GetOldSelection();
bb0054cd
RD
247 void SetOldSelection(int page);
248 void SetSelection(int page);
7bf85405
RD
249};
250
251
252
253class wxNotebook : public wxControl {
254public:
255 wxNotebook(wxWindow *parent,
256 wxWindowID id,
257 const wxPoint& pos = wxPyDefaultPosition,
258 const wxSize& size = wxPyDefaultSize,
259 long style = 0,
260 char* name = "notebook");
261
b8b8dda7 262 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
9c039d08 263
7bf85405
RD
264 int GetPageCount();
265 int SetSelection(int nPage);
266 void AdvanceSelection(bool bForward = TRUE);
267 int GetSelection();
268 bool SetPageText(int nPage, const wxString& strText);
269 wxString GetPageText(int nPage) const;
270 void SetImageList(wxImageList* imageList);
271 wxImageList* GetImageList();
272 int GetPageImage(int nPage);
273 bool SetPageImage(int nPage, int nImage);
274 int GetRowCount();
275
276 // LINK ERROR: void SetPageSize(const wxSize& size);
277 // LINK ERROR: void SetPadding(const wxSize& padding);
278 bool DeletePage(int nPage);
cf694132 279 bool RemovePage(int nPage);
7bf85405
RD
280 bool DeleteAllPages();
281 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
282 const wxString& strText,
cf694132 283 int bSelect = FALSE,
7bf85405 284 int imageId = -1);
fb5e0af0 285#ifdef __WXMSW__
7bf85405
RD
286 bool InsertPage(int nPage,
287 /*wxNotebookPage*/ wxWindow *pPage,
288 const wxString& strText,
289 bool bSelect = FALSE,
290 int imageId = -1);
fb5e0af0 291#endif
bb0054cd 292 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
7bf85405 293
cf694132
RD
294 %addmethods {
295 void ResizeChildren() {
296 wxSizeEvent evt(self->GetClientSize());
4cd9591a 297 self->GetEventHandler()->ProcessEvent(evt);
cf694132
RD
298 }
299 }
300
301
7bf85405
RD
302};
303
9c039d08
RD
304//---------------------------------------------------------------------------
305
bb0054cd
RD
306class wxSplitterEvent : public wxCommandEvent {
307public:
308 int GetSashPosition();
309 int GetX();
310 int GetY();
311 wxWindow* GetWindowBeingRemoved();
312 void SetSashPosition(int pos);
313}
314
315
316
317
9c039d08
RD
318class wxSplitterWindow : public wxWindow {
319public:
320 wxSplitterWindow(wxWindow* parent, wxWindowID id,
321 const wxPoint& point = wxPyDefaultPosition,
322 const wxSize& size = wxPyDefaultSize,
b639c3c5 323 long style=wxSP_3D|wxCLIP_CHILDREN,
9c039d08
RD
324 char* name = "splitterWindow");
325
b8b8dda7 326 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
9c039d08 327
b639c3c5 328 int GetBorderSize();
9c039d08
RD
329 int GetMinimumPaneSize();
330 int GetSashPosition();
b639c3c5 331 int GetSashSize();
9c039d08
RD
332 int GetSplitMode();
333 wxWindow* GetWindow1();
334 wxWindow* GetWindow2();
335 void Initialize(wxWindow* window);
336 bool IsSplit();
337
9d8bd15f 338 bool ReplaceWindow(wxWindow * winOld, wxWindow * winNew);
b639c3c5 339 void SetBorderSize(int width);
9c039d08 340 void SetSashPosition(int position, int redraw = TRUE);
b639c3c5 341 void SetSashSize(int width);
9c039d08
RD
342 void SetMinimumPaneSize(int paneSize);
343 void SetSplitMode(int mode);
4464bbee
RD
344 bool SplitHorizontally(wxWindow* window1, wxWindow* window2, int sashPosition = 0);
345 bool SplitVertically(wxWindow* window1, wxWindow* window2, int sashPosition = 0);
9c039d08
RD
346 bool Unsplit(wxWindow* toRemove = NULL);
347};
348
349//---------------------------------------------------------------------------
350
b639c3c5
RD
351#ifdef __WXMSW__
352
353enum {
354 wxEVT_TASKBAR_MOVE,
355 wxEVT_TASKBAR_LEFT_DOWN,
356 wxEVT_TASKBAR_LEFT_UP,
357 wxEVT_TASKBAR_RIGHT_DOWN,
358 wxEVT_TASKBAR_RIGHT_UP,
359 wxEVT_TASKBAR_LEFT_DCLICK,
360 wxEVT_TASKBAR_RIGHT_DCLICK
361};
9c039d08
RD
362
363
b639c3c5
RD
364class wxTaskBarIcon : public wxEvtHandler {
365public:
366 wxTaskBarIcon();
367 ~wxTaskBarIcon();
368
b8b8dda7
RD
369 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
370 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
371 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
372 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
373 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
374 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
375 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
b639c3c5
RD
376
377 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
378 bool RemoveIcon(void);
be4d9c1f
RD
379 bool PopupMenu(wxMenu *menu);
380
b639c3c5
RD
381};
382#endif
383
7bf85405 384//---------------------------------------------------------------------------