]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/misc2.i
new wxMenu stuff and thread implementations
[wxWidgets.git] / utils / wxPython / src / misc2.i
CommitLineData
bb0054cd
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: misc2.i
3// Purpose: Definitions of miscelaneous functions and classes that need
4// to know about wxWindow. (So they can't be in misc.i or an
5// import loop will happen.)
6//
7// Author: Robin Dunn
8//
9// Created: 18-June-1999
10// RCS-ID: $Id$
11// Copyright: (c) 1998 by Total Control Software
12// Licence: wxWindows license
13/////////////////////////////////////////////////////////////////////////////
14
15%module misc2
16
17%{
18#include "helpers.h"
19#include <wx/resource.h>
20#include <wx/tooltip.h>
f0261a72 21#include <wx/caret.h>
134d79dc 22#ifdef NOT_READY_YET
f0261a72 23#include <wx/fontenum.h>
134d79dc 24#endif
bb0054cd
RD
25%}
26
27//----------------------------------------------------------------------
28
29%include typemaps.i
30%include my_typemaps.i
31
32// Import some definitions of other classes, etc.
33%import _defs.i
34%import windows.i
f0261a72 35%import misc.i
06c0fba4
RD
36%import gdi.i
37
38//---------------------------------------------------------------------------
39// Dialog Functions
40
41wxString wxFileSelector(char* message,
42 char* default_path = NULL,
43 char* default_filename = NULL,
44 char* default_extension = NULL,
45 char* wildcard = "*.*",
46 int flags = 0,
47 wxWindow *parent = NULL,
48 int x = -1, int y = -1);
49
50wxString wxGetTextFromUser(const wxString& message,
51 const wxString& caption = wxPyEmptyStr,
52 const wxString& default_value = wxPyEmptyStr,
53 wxWindow *parent = NULL,
54 int x = -1, int y = -1,
55 bool centre = TRUE);
56
57
58// TODO: Need to custom wrap this one...
59// int wxGetMultipleChoice(char* message, char* caption,
60// int LCOUNT, char** LIST,
61// int nsel, int *selection,
62// wxWindow *parent = NULL, int x = -1, int y = -1,
63// bool centre = TRUE, int width=150, int height=200);
64
65
66wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
67 int LCOUNT, wxString* LIST,
68 wxWindow *parent = NULL,
69 int x = -1, int y = -1,
70 bool centre = TRUE,
71 int width=150, int height=200);
72
73int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
74 int LCOUNT, wxString* LIST,
75 wxWindow *parent = NULL,
76 int x = -1, int y = -1,
77 bool centre = TRUE,
78 int width=150, int height=200);
79
80
81int wxMessageBox(const wxString& message,
82 const wxString& caption = wxPyEmptyStr,
83 int style = wxOK | wxCENTRE,
84 wxWindow *parent = NULL,
85 int x = -1, int y = -1);
86
87long wxGetNumberFromUser(const wxString& message,
88 const wxString& prompt,
89 const wxString& caption,
90 long value,
91 long min = 0, long max = 100,
92 wxWindow *parent = NULL,
93 const wxPoint& pos = wxPyDefaultPosition);
94
95//---------------------------------------------------------------------------
96// GDI Functions
97
98bool wxColourDisplay();
99int wxDisplayDepth();
100void wxSetCursor(wxCursor& cursor);
bb0054cd
RD
101
102//----------------------------------------------------------------------
06c0fba4 103// Miscellaneous functions
bb0054cd
RD
104
105wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
106wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
107
06c0fba4
RD
108void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
109wxWindow * wxGetActiveWindow();
110
111
112//---------------------------------------------------------------------------
113// Resource System
114
115bool wxResourceAddIdentifier(char *name, int value);
116void wxResourceClear(void);
117wxBitmap wxResourceCreateBitmap(char *resource);
118wxIcon wxResourceCreateIcon(char *resource);
119wxMenuBar * wxResourceCreateMenuBar(char *resource);
120int wxResourceGetIdentifier(char *name);
121bool wxResourceParseData(char *resource, wxResourceTable *table = NULL);
122bool wxResourceParseFile(char *filename, wxResourceTable *table = NULL);
123bool wxResourceParseString(char *resource, wxResourceTable *table = NULL);
bb0054cd 124
06c0fba4
RD
125//---------------------------------------------------------------------------
126// System Settings
127
128enum {
129 wxSYS_WHITE_BRUSH,
130 wxSYS_LTGRAY_BRUSH,
131 wxSYS_GRAY_BRUSH,
132 wxSYS_DKGRAY_BRUSH,
133 wxSYS_BLACK_BRUSH,
134 wxSYS_NULL_BRUSH,
135 wxSYS_HOLLOW_BRUSH,
136 wxSYS_WHITE_PEN,
137 wxSYS_BLACK_PEN,
138 wxSYS_NULL_PEN,
139 wxSYS_OEM_FIXED_FONT,
140 wxSYS_ANSI_FIXED_FONT,
141 wxSYS_ANSI_VAR_FONT,
142 wxSYS_SYSTEM_FONT,
143 wxSYS_DEVICE_DEFAULT_FONT,
144 wxSYS_DEFAULT_PALETTE,
145 wxSYS_SYSTEM_FIXED_FONT,
146 wxSYS_DEFAULT_GUI_FONT,
147
148 wxSYS_COLOUR_SCROLLBAR,
149 wxSYS_COLOUR_BACKGROUND,
150 wxSYS_COLOUR_ACTIVECAPTION,
151 wxSYS_COLOUR_INACTIVECAPTION,
152 wxSYS_COLOUR_MENU,
153 wxSYS_COLOUR_WINDOW,
154 wxSYS_COLOUR_WINDOWFRAME,
155 wxSYS_COLOUR_MENUTEXT,
156 wxSYS_COLOUR_WINDOWTEXT,
157 wxSYS_COLOUR_CAPTIONTEXT,
158 wxSYS_COLOUR_ACTIVEBORDER,
159 wxSYS_COLOUR_INACTIVEBORDER,
160 wxSYS_COLOUR_APPWORKSPACE,
161 wxSYS_COLOUR_HIGHLIGHT,
162 wxSYS_COLOUR_HIGHLIGHTTEXT,
163 wxSYS_COLOUR_BTNFACE,
164 wxSYS_COLOUR_BTNSHADOW,
165 wxSYS_COLOUR_GRAYTEXT,
166 wxSYS_COLOUR_BTNTEXT,
167 wxSYS_COLOUR_INACTIVECAPTIONTEXT,
168 wxSYS_COLOUR_BTNHIGHLIGHT,
169
170 wxSYS_COLOUR_3DDKSHADOW,
171 wxSYS_COLOUR_3DLIGHT,
172 wxSYS_COLOUR_INFOTEXT,
173 wxSYS_COLOUR_INFOBK,
174
175 wxSYS_COLOUR_DESKTOP,
176 wxSYS_COLOUR_3DFACE,
177 wxSYS_COLOUR_3DSHADOW,
178 wxSYS_COLOUR_3DHIGHLIGHT,
179 wxSYS_COLOUR_3DHILIGHT,
180 wxSYS_COLOUR_BTNHILIGHT,
181
182 wxSYS_MOUSE_BUTTONS,
183 wxSYS_BORDER_X,
184 wxSYS_BORDER_Y,
185 wxSYS_CURSOR_X,
186 wxSYS_CURSOR_Y,
187 wxSYS_DCLICK_X,
188 wxSYS_DCLICK_Y,
189 wxSYS_DRAG_X,
190 wxSYS_DRAG_Y,
191 wxSYS_EDGE_X,
192 wxSYS_EDGE_Y,
193 wxSYS_HSCROLL_ARROW_X,
194 wxSYS_HSCROLL_ARROW_Y,
195 wxSYS_HTHUMB_X,
196 wxSYS_ICON_X,
197 wxSYS_ICON_Y,
198 wxSYS_ICONSPACING_X,
199 wxSYS_ICONSPACING_Y,
200 wxSYS_WINDOWMIN_X,
201 wxSYS_WINDOWMIN_Y,
202 wxSYS_SCREEN_X,
203 wxSYS_SCREEN_Y,
204 wxSYS_FRAMESIZE_X,
205 wxSYS_FRAMESIZE_Y,
206 wxSYS_SMALLICON_X,
207 wxSYS_SMALLICON_Y,
208 wxSYS_HSCROLL_Y,
209 wxSYS_VSCROLL_X,
210 wxSYS_VSCROLL_ARROW_X,
211 wxSYS_VSCROLL_ARROW_Y,
212 wxSYS_VTHUMB_Y,
213 wxSYS_CAPTION_Y,
214 wxSYS_MENU_Y,
215 wxSYS_NETWORK_PRESENT,
216 wxSYS_PENWINDOWS_PRESENT,
217 wxSYS_SHOW_SOUNDS,
218 wxSYS_SWAP_BUTTONS,
219};
220
221
222
223%inline %{
224
225 wxColour wxSystemSettings_GetSystemColour(int index) {
226 return wxSystemSettings::GetSystemColour(index);
227 }
228
229 wxFont wxSystemSettings_GetSystemFont(int index) {
230 return wxSystemSettings::GetSystemFont(index);
231 }
232
233 int wxSystemSettings_GetSystemMetric(int index) {
234 return wxSystemSettings::GetSystemMetric(index);
235 }
236%}
bb0054cd
RD
237
238//---------------------------------------------------------------------------
239// wxToolTip
240
241class wxToolTip {
242public:
243 wxToolTip(const wxString &tip);
244
245 void SetTip(const wxString& tip);
246 wxString GetTip();
247 // *** Not in the "public" interface void SetWindow(wxWindow *win);
248 wxWindow *GetWindow();
249};
250
251
252%inline %{
253 void wxToolTip_Enable(bool flag) {
254 wxToolTip::Enable(flag);
255 }
256
257 void wxToolTip_SetDelay(long milliseconds) {
258 wxToolTip::SetDelay(milliseconds);
259 }
260%}
261
262//----------------------------------------------------------------------
f0261a72
RD
263
264class wxCaret {
265public:
266 wxCaret(wxWindow* window, const wxSize& size);
267 ~wxCaret();
268
269 bool IsOk();
270 bool IsVisible();
271 %name(GetPositionTuple)void GetPosition(int *OUTPUT, int *OUTPUT);
272 wxPoint GetPosition();
273 %name(GetSizeTuple)void GetSize(int *OUTPUT, int *OUTPUT);
274 wxSize GetSize();
275 wxWindow *GetWindow();
276 %name(MoveXY)void Move(int x, int y);
277 void Move(const wxPoint& pt);
278 void Show(int show = TRUE);
279 void Hide();
280 void OnSetFocus();
281 void OnKillFocus();
282};
283
284%inline %{
285 int wxCaret_GetBlinkTime() {
286 return wxCaret::GetBlinkTime();
287 }
288
289 void wxCaret_SetBlinkTime(int milliseconds) {
290 wxCaret::SetBlinkTime(milliseconds);
291 }
292%}
293
bb0054cd 294//----------------------------------------------------------------------
f0261a72
RD
295#ifdef NOT_READY_YET
296
297%{
298class wxPyFontEnumerator : public wxFontEnumerator {
299public:
300 wxPyFontEnumerator() {}
301 ~wxPyFontEnumerator() {}
302
303 bool EnumerateFamilies(int fixedWidthOnly = FALSE);
304 bool EnumerateEncodings(const char* family = "");
305
306 DEC_PYCALLBACK_BOOL_STRING(OnFontFamily);
307 DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding);
308
309 PYPRIVATE;
310};
311
312IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFontFamily);
313IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
314
315%}
316
317%name(wxFontEnumerator) class wxPyFontEnumerator {
318public:
319 wxPyFontEnumerator() {}
320 ~wxPyFontEnumerator() {}
321 %pragma(python) addtomethod = "__init__:self._setSelf(self)"
322
323 bool EnumerateFamilies(int fixedWidthOnly = FALSE);
324 bool EnumerateEncodings(const char* family = "");
325
326 bool base_OnFontFamily(const wxString& family);
327 bool base_OnFontEncoding(const wxString& family,
328 const wxString& encoding);
329};
330#endif
2abc0a0f
RD
331
332//----------------------------------------------------------------------
333
334class wxBusyCursor {
335public:
336 wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
337 ~wxBusyCursor();
338};
339
340
341
342//----------------------------------------------------------------------
f0261a72
RD
343//----------------------------------------------------------------------
344//----------------------------------------------------------------------
345