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>
22 //----------------------------------------------------------------------
25 %include my_typemaps.i
27 // Import some definitions of other classes, etc.
35 %pragma(python) code = "import wxp"
37 //---------------------------------------------------------------------------
49 wxString& GetTextValue();
50 void SetTextValue(const wxString& str);
52 void SetFont(wxFont *f);
53 wxColour& GetTextColour();
54 void SetTextColour(const wxColour& colour);
55 wxColour& GetBackgroundColour();
56 void SetBackgroundColour(const wxColour& colour);
57 wxBrush *GetBackgroundBrush();
59 void SetAlignment(int align);
60 wxBitmap *GetCellBitmap();
61 void SetCellBitmap(wxBitmap *bitmap);
68 class wxGrid : public wxPanel {
70 wxGrid(wxWindow* parent, wxWindowID id,
71 const wxPoint& pos=wxPyDefaultPosition,
72 const wxSize& size=wxPyDefaultSize,
76 %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
78 void AdjustScrollbars();
79 bool AppendCols(int n=1, bool updateLabels=TRUE);
80 bool AppendRows(int n=1, bool updateLabels=TRUE);
82 bool CellHitTest(int x, int y, int *OUTPUT, int *OUTPUT);
85 // TODO: For now we are just ignoring the initial cellValues
86 // and widths. Add support for loading them from
87 // Python sequence objects.
88 bool CreateGrid(int rows, int cols,
89 //PyObject* cellValues = NULL,
90 //PyObject* widths = NULL,
91 short defaultWidth = wxGRID_DEFAULT_CELL_WIDTH,
92 short defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT) {
93 return self->CreateGrid(rows, cols, NULL, NULL,
94 defaultWidth, defaultHeight);
98 bool CurrentCellVisible();
99 bool DeleteCols(int pos=0, int n=1, bool updateLabels=TRUE);
100 bool DeleteRows(int pos=0, int n=1, bool updateLabels=TRUE);
104 wxGridCell* GetCell(int row, int col);
105 int GetCellAlignment(int row, int col);
106 %name(GetDefCellAlignment)int GetCellAlignment();
107 wxColour& GetCellBackgroundColour(int row, int col);
108 %name(GetDefCellBackgroundColour)
109 wxColour& GetCellBackgroundColour();
110 //wxGridCell *** GetCells();
111 wxColour& GetCellTextColour(int row, int col);
112 %name(GetDefCellTextColour)wxColour& GetCellTextColour();
113 wxFont* GetCellTextFont(int row, int col);
114 %name(GetDefCellTextFont)wxFont* GetCellTextFont();
115 wxString& GetCellValue(int row, int col);
117 int GetColumnWidth(int col);
118 wxRect& GetCurrentRect();
119 int GetCursorColumn();
122 wxScrollBar * GetHorizScrollBar();
123 int GetLabelAlignment(int orientation);
124 wxColour& GetLabelBackgroundColour();
125 int GetLabelSize(int orientation);
126 wxColour& GetLabelTextColour();
127 wxFont* GetLabelTextFont();
128 wxString& GetLabelValue(int orientation, int pos);
129 int GetRowHeight(int row);
133 wxTextCtrl* GetTextItem();
134 wxScrollBar* GetVertScrollBar();
136 bool InsertCols(int pos=0, int n=1, bool updateLabels=TRUE);
137 bool InsertRows(int pos=0, int n=1, bool updateLabels=TRUE);
139 // TODO: How to handle callbacks that don't come from
142 //void OnActivate(bool active);
143 //void OnChangeLabels();
144 //void OnChangeSelectionLabel();
145 //wxGridCell* OnCreateCell();
146 //void OnLeftClick(int row, int col, int x, int y, bool control, bool shift);
147 //void OnRightClick(int row, int col, int x, int y, bool control, bool shift);
148 //void OnLabelLeftClick(int row, int col, int x, int y, bool control, bool shift);
149 //void OnLabelRightClick(int row, int col, int x, int y, bool control, bool shift);
150 //void OnSelectCell(int row, int col);
151 //void OnSelectCellImplementation(wxDC *dc, int row, int col);
153 void SetCellAlignment(int alignment, int row, int col);
154 %name(SetDefCellAlignment)void SetCellAlignment(int alignment);
155 void SetCellBackgroundColour(const wxColour& colour, int row, int col);
156 %name(SetDefCellBackgroundColour)
157 void SetCellBackgroundColour(const wxColour& colour);
158 void SetCellTextColour(const wxColour& colour, int row, int col);
159 %name(SetDefCellTextColour)void SetCellTextColour(const wxColour& colour);
160 void SetCellTextFont(wxFont *font, int row, int col);
161 %name(SetDefCellTextFont)void SetCellTextFont(wxFont *font);
162 void SetCellValue(const wxString& val, int row, int col);
163 void SetColumnWidth(int col, int width);
164 void SetDividerPen(wxPen *pen);
165 void SetEditable(bool editable);
166 void SetGridCursor(int row, int col);
167 void SetLabelAlignment(int orientation, int alignment);
168 void SetLabelBackgroundColour(const wxColour& value);
169 void SetLabelSize(int orientation, int size);
170 void SetLabelTextColour(const wxColour& value);
171 void SetLabelTextFont(wxFont *font);
172 void SetLabelValue(int orientation, const wxString& value, int pos);
173 void SetRowHeight(int row, int height);
175 void UpdateDimensions();
178 //---------------------------------------------------------------------------
180 class wxNotebookEvent : public wxCommandEvent {
183 int GetOldSelection();
188 class wxNotebook : public wxControl {
190 wxNotebook(wxWindow *parent,
192 const wxPoint& pos = wxPyDefaultPosition,
193 const wxSize& size = wxPyDefaultSize,
195 char* name = "notebook");
197 %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
200 int SetSelection(int nPage);
201 void AdvanceSelection(bool bForward = TRUE);
203 bool SetPageText(int nPage, const wxString& strText);
204 wxString GetPageText(int nPage) const;
205 void SetImageList(wxImageList* imageList);
206 wxImageList* GetImageList();
207 int GetPageImage(int nPage);
208 bool SetPageImage(int nPage, int nImage);
211 // LINK ERROR: void SetPageSize(const wxSize& size);
212 // LINK ERROR: void SetPadding(const wxSize& padding);
213 bool DeletePage(int nPage);
214 bool DeleteAllPages();
215 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
216 const wxString& strText,
217 bool bSelect = FALSE,
220 bool InsertPage(int nPage,
221 /*wxNotebookPage*/ wxWindow *pPage,
222 const wxString& strText,
223 bool bSelect = FALSE,
226 wxNotebookPage *GetPage(int nPage);
230 //---------------------------------------------------------------------------
232 class wxSplitterWindow : public wxWindow {
234 wxSplitterWindow(wxWindow* parent, wxWindowID id,
235 const wxPoint& point = wxPyDefaultPosition,
236 const wxSize& size = wxPyDefaultSize,
238 char* name = "splitterWindow");
240 %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
242 int GetMinimumPaneSize();
243 int GetSashPosition();
245 wxWindow* GetWindow1();
246 wxWindow* GetWindow2();
247 void Initialize(wxWindow* window);
250 // TODO: How to handle callbacks that don't come from
253 //void OnDoubleClickSash(int x, int y);
254 //void OnUnsplit(wxWindow* removed);
256 void SetSashPosition(int position, int redraw = TRUE);
257 void SetMinimumPaneSize(int paneSize);
258 void SetSplitMode(int mode);
259 bool SplitHorizontally(wxWindow* window1, wxWindow* window2, int sashPosition = -1);
260 bool SplitVertically(wxWindow* window1, wxWindow* window2, int sashPosition = -1);
261 bool Unsplit(wxWindow* toRemove = NULL);
264 //---------------------------------------------------------------------------
268 //---------------------------------------------------------------------------
269 /////////////////////////////////////////////////////////////////////////////
272 // Revision 1.4 1998/10/02 06:40:43 RD
273 // Version 0.4 of wxPython for MSW.
275 // Revision 1.3 1998/08/18 19:48:20 RD
276 // more wxGTK compatibility things.
278 // It builds now but there are serious runtime problems...
280 // Revision 1.2 1998/08/15 07:36:50 RD
281 // - Moved the header in the .i files out of the code that gets put into
282 // the .cpp files. It caused CVS conflicts because of the RCS ID being
283 // different each time.
285 // - A few minor fixes.
287 // Revision 1.1 1998/08/09 08:25:52 RD