]>
Commit | Line | Data |
---|---|---|
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 | ||
13 | %module windows2 | |
14 | ||
15 | %{ | |
16 | #include "helpers.h" | |
17 | #ifdef OLD_GRID | |
18 | #include <wx/grid.h> | |
19 | #endif | |
20 | #include <wx/notebook.h> | |
21 | #include <wx/splitter.h> | |
22 | #include <wx/imaglist.h> | |
23 | #ifdef __WXMSW__ | |
24 | #include <wx/msw/taskbar.h> | |
25 | #endif | |
26 | %} | |
27 | ||
28 | //---------------------------------------------------------------------- | |
29 | ||
30 | %include typemaps.i | |
31 | %include my_typemaps.i | |
32 | ||
33 | // Import some definitions of other classes, etc. | |
34 | %import _defs.i | |
35 | %import misc.i | |
36 | %import gdi.i | |
37 | %import windows.i | |
38 | %import controls.i | |
39 | %import events.i | |
40 | ||
41 | %pragma(python) code = "import wx" | |
42 | ||
43 | //--------------------------------------------------------------------------- | |
44 | ||
45 | enum { | |
46 | /* notebook control event types */ | |
47 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, | |
48 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, | |
49 | }; | |
50 | ||
51 | ||
52 | class wxNotebookEvent : public wxNotifyEvent { | |
53 | public: | |
54 | wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, | |
55 | int nSel = -1, int nOldSel = -1); | |
56 | ||
57 | int GetSelection(); | |
58 | int GetOldSelection(); | |
59 | void SetOldSelection(int page); | |
60 | void SetSelection(int page); | |
61 | }; | |
62 | ||
63 | ||
64 | ||
65 | class wxNotebook : public wxControl { | |
66 | public: | |
67 | wxNotebook(wxWindow *parent, | |
68 | wxWindowID id, | |
69 | const wxPoint& pos = wxDefaultPosition, | |
70 | const wxSize& size = wxDefaultSize, | |
71 | long style = 0, | |
72 | char* name = "notebook"); | |
73 | %name(wxPreNotebook)wxNotebook(); | |
74 | ||
75 | bool Create(wxWindow *parent, | |
76 | wxWindowID id, | |
77 | const wxPoint& pos = wxDefaultPosition, | |
78 | const wxSize& size = wxDefaultSize, | |
79 | long style = 0, | |
80 | char* name = "notebook"); | |
81 | ||
82 | int GetPageCount(); | |
83 | int SetSelection(int nPage); | |
84 | void AdvanceSelection(bool bForward = TRUE); | |
85 | int GetSelection(); | |
86 | bool SetPageText(int nPage, const wxString& strText); | |
87 | wxString GetPageText(int nPage) const; | |
88 | void SetImageList(wxImageList* imageList); | |
89 | wxImageList* GetImageList(); | |
90 | int GetPageImage(int nPage); | |
91 | bool SetPageImage(int nPage, int nImage); | |
92 | int GetRowCount(); | |
93 | ||
94 | void SetPageSize(const wxSize& size); | |
95 | void SetPadding(const wxSize& padding); | |
96 | bool DeletePage(int nPage); | |
97 | bool RemovePage(int nPage); | |
98 | bool DeleteAllPages(); | |
99 | bool AddPage(/*wxNotebookPage*/ wxWindow *pPage, | |
100 | const wxString& strText, | |
101 | int bSelect = FALSE, | |
102 | int imageId = -1); | |
103 | bool InsertPage(int nPage, | |
104 | /*wxNotebookPage*/ wxWindow *pPage, | |
105 | const wxString& strText, | |
106 | bool bSelect = FALSE, | |
107 | int imageId = -1); | |
108 | /*wxNotebookPage*/ wxWindow *GetPage(int nPage); | |
109 | ||
110 | %addmethods { | |
111 | void ResizeChildren() { | |
112 | wxSizeEvent evt(self->GetClientSize()); | |
113 | self->GetEventHandler()->ProcessEvent(evt); | |
114 | } | |
115 | } | |
116 | ||
117 | ||
118 | }; | |
119 | ||
120 | //--------------------------------------------------------------------------- | |
121 | ||
122 | ||
123 | enum { | |
124 | /* splitter window events */ | |
125 | wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, | |
126 | wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, | |
127 | wxEVT_COMMAND_SPLITTER_UNSPLIT, | |
128 | wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, | |
129 | }; | |
130 | ||
131 | ||
132 | enum | |
133 | { | |
134 | wxSPLIT_HORIZONTAL, | |
135 | wxSPLIT_VERTICAL, | |
136 | wxSPLIT_DRAG_NONE, | |
137 | wxSPLIT_DRAG_DRAGGING, | |
138 | wxSPLIT_DRAG_LEFT_DOWN | |
139 | }; | |
140 | ||
141 | ||
142 | class wxSplitterEvent : public wxCommandEvent { | |
143 | public: | |
144 | wxSplitterEvent(wxEventType type = wxEVT_NULL, | |
145 | wxSplitterWindow *splitter = NULL); | |
146 | ||
147 | int GetSashPosition(); | |
148 | int GetX(); | |
149 | int GetY(); | |
150 | wxWindow* GetWindowBeingRemoved(); | |
151 | void SetSashPosition(int pos); | |
152 | } | |
153 | ||
154 | ||
155 | ||
156 | ||
157 | class wxSplitterWindow : public wxWindow { | |
158 | public: | |
159 | wxSplitterWindow(wxWindow* parent, wxWindowID id, | |
160 | const wxPoint& point = wxDefaultPosition, | |
161 | const wxSize& size = wxDefaultSize, | |
162 | long style=wxSP_3D|wxCLIP_CHILDREN, | |
163 | char* name = "splitterWindow"); | |
164 | %name(wxPreSplitterWindow)wxSplitterWindow(); | |
165 | ||
166 | bool Create(wxWindow* parent, wxWindowID id, | |
167 | const wxPoint& point = wxDefaultPosition, | |
168 | const wxSize& size = wxDefaultSize, | |
169 | long style=wxSP_3D|wxCLIP_CHILDREN, | |
170 | char* name = "splitterWindow"); | |
171 | ||
172 | ||
173 | // Gets the only or left/top pane | |
174 | wxWindow *GetWindow1(); | |
175 | ||
176 | // Gets the right/bottom pane | |
177 | wxWindow *GetWindow2(); | |
178 | ||
179 | // Sets the split mode | |
180 | void SetSplitMode(int mode); | |
181 | ||
182 | // Gets the split mode | |
183 | int GetSplitMode(); | |
184 | ||
185 | // Initialize with one window | |
186 | void Initialize(wxWindow *window); | |
187 | ||
188 | // Associates the given window with window 2, drawing the appropriate sash | |
189 | // and changing the split mode. | |
190 | // Does nothing and returns FALSE if the window is already split. | |
191 | // A sashPosition of 0 means choose a default sash position, | |
192 | // negative sashPosition specifies the size of right/lower pane as it's | |
193 | // absolute value rather than the size of left/upper pane. | |
194 | virtual bool SplitVertically(wxWindow *window1, | |
195 | wxWindow *window2, | |
196 | int sashPosition = 0); | |
197 | virtual bool SplitHorizontally(wxWindow *window1, | |
198 | wxWindow *window2, | |
199 | int sashPosition = 0); | |
200 | ||
201 | // Removes the specified (or second) window from the view | |
202 | // Doesn't actually delete the window. | |
203 | bool Unsplit(wxWindow *toRemove = NULL); | |
204 | ||
205 | // Replaces one of the windows with another one (neither old nor new | |
206 | // parameter should be NULL) | |
207 | bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew); | |
208 | ||
209 | // Is the window split? | |
210 | bool IsSplit(); | |
211 | ||
212 | // Sets the sash size | |
213 | void SetSashSize(int width); | |
214 | ||
215 | // Sets the border size | |
216 | void SetBorderSize(int width); | |
217 | ||
218 | // Gets the sash size | |
219 | int GetSashSize(); | |
220 | ||
221 | // Gets the border size | |
222 | int GetBorderSize(); | |
223 | ||
224 | // Set the sash position | |
225 | void SetSashPosition(int position, bool redraw = TRUE); | |
226 | ||
227 | // Gets the sash position | |
228 | int GetSashPosition(); | |
229 | ||
230 | // If this is zero, we can remove panes by dragging the sash. | |
231 | void SetMinimumPaneSize(int min); | |
232 | int GetMinimumPaneSize(); | |
233 | ||
234 | }; | |
235 | ||
236 | //--------------------------------------------------------------------------- | |
237 | ||
238 | #ifdef __WXMSW__ | |
239 | ||
240 | enum { | |
241 | wxEVT_TASKBAR_MOVE, | |
242 | wxEVT_TASKBAR_LEFT_DOWN, | |
243 | wxEVT_TASKBAR_LEFT_UP, | |
244 | wxEVT_TASKBAR_RIGHT_DOWN, | |
245 | wxEVT_TASKBAR_RIGHT_UP, | |
246 | wxEVT_TASKBAR_LEFT_DCLICK, | |
247 | wxEVT_TASKBAR_RIGHT_DCLICK | |
248 | }; | |
249 | ||
250 | ||
251 | class wxTaskBarIcon : public wxEvtHandler { | |
252 | public: | |
253 | wxTaskBarIcon(); | |
254 | ~wxTaskBarIcon(); | |
255 | ||
256 | // We still use the magic methods here since that is the way it is documented... | |
257 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)" | |
258 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)" | |
259 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)" | |
260 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)" | |
261 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)" | |
262 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)" | |
263 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)" | |
264 | ||
265 | bool SetIcon(const wxIcon& icon, const char* tooltip = ""); | |
266 | bool RemoveIcon(void); | |
267 | bool PopupMenu(wxMenu *menu); | |
268 | bool IsIconInstalled(); | |
269 | bool IsOK(); | |
270 | }; | |
271 | #endif | |
272 | ||
273 | //--------------------------------------------------------------------------- |