1 /////////////////////////////////////////////////////////////////////////////
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.)
9 // Created: 18-June-1999
11 // Copyright: (c) 1998 by Total Control Software
12 // Licence: wxWindows license
13 /////////////////////////////////////////////////////////////////////////////
19 #include <wx/resource.h>
20 #include <wx/tooltip.h>
22 #include <wx/fontenum.h>
25 //----------------------------------------------------------------------
28 %include my_typemaps.i
30 // Import some definitions of other classes, etc.
37 //---------------------------------------------------------------------------
40 wxString wxFileSelector(char* message,
41 char* default_path = NULL,
42 char* default_filename = NULL,
43 char* default_extension = NULL,
44 char* wildcard = "*.*",
46 wxWindow *parent = NULL,
47 int x = -1, int y = -1);
49 wxString wxGetTextFromUser(const wxString& message,
50 const wxString& caption = wxPyEmptyStr,
51 const wxString& default_value = wxPyEmptyStr,
52 wxWindow *parent = NULL,
53 int x = -1, int y = -1,
57 // TODO: Need to custom wrap this one...
58 // int wxGetMultipleChoice(char* message, char* caption,
59 // int LCOUNT, char** LIST,
60 // int nsel, int *selection,
61 // wxWindow *parent = NULL, int x = -1, int y = -1,
62 // bool centre = TRUE, int width=150, int height=200);
65 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
66 int LCOUNT, wxString* LIST,
67 wxWindow *parent = NULL,
68 int x = -1, int y = -1,
70 int width=150, int height=200);
72 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
73 int LCOUNT, wxString* LIST,
74 wxWindow *parent = NULL,
75 int x = -1, int y = -1,
77 int width=150, int height=200);
80 int wxMessageBox(const wxString& message,
81 const wxString& caption = wxPyEmptyStr,
82 int style = wxOK | wxCENTRE,
83 wxWindow *parent = NULL,
84 int x = -1, int y = -1);
86 long wxGetNumberFromUser(const wxString& message,
87 const wxString& prompt,
88 const wxString& caption,
90 long min = 0, long max = 100,
91 wxWindow *parent = NULL,
92 const wxPoint& pos = wxPyDefaultPosition);
94 //---------------------------------------------------------------------------
97 bool wxColourDisplay();
99 void wxSetCursor(wxCursor& cursor);
101 //----------------------------------------------------------------------
102 // Miscellaneous functions
104 wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
105 wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
107 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
108 wxWindow * wxGetActiveWindow();
111 //---------------------------------------------------------------------------
114 bool wxResourceAddIdentifier(char *name, int value);
115 void wxResourceClear(void);
116 wxBitmap wxResourceCreateBitmap(char *resource);
117 wxIcon wxResourceCreateIcon(char *resource);
118 wxMenuBar * wxResourceCreateMenuBar(char *resource);
119 int wxResourceGetIdentifier(char *name);
120 bool wxResourceParseData(char *resource, wxResourceTable *table = NULL);
121 bool wxResourceParseFile(char *filename, wxResourceTable *table = NULL);
122 bool wxResourceParseString(char *resource, wxResourceTable *table = NULL);
124 //---------------------------------------------------------------------------
138 wxSYS_OEM_FIXED_FONT,
139 wxSYS_ANSI_FIXED_FONT,
142 wxSYS_DEVICE_DEFAULT_FONT,
143 wxSYS_DEFAULT_PALETTE,
144 wxSYS_SYSTEM_FIXED_FONT,
145 wxSYS_DEFAULT_GUI_FONT,
147 wxSYS_COLOUR_SCROLLBAR,
148 wxSYS_COLOUR_BACKGROUND,
149 wxSYS_COLOUR_ACTIVECAPTION,
150 wxSYS_COLOUR_INACTIVECAPTION,
153 wxSYS_COLOUR_WINDOWFRAME,
154 wxSYS_COLOUR_MENUTEXT,
155 wxSYS_COLOUR_WINDOWTEXT,
156 wxSYS_COLOUR_CAPTIONTEXT,
157 wxSYS_COLOUR_ACTIVEBORDER,
158 wxSYS_COLOUR_INACTIVEBORDER,
159 wxSYS_COLOUR_APPWORKSPACE,
160 wxSYS_COLOUR_HIGHLIGHT,
161 wxSYS_COLOUR_HIGHLIGHTTEXT,
162 wxSYS_COLOUR_BTNFACE,
163 wxSYS_COLOUR_BTNSHADOW,
164 wxSYS_COLOUR_GRAYTEXT,
165 wxSYS_COLOUR_BTNTEXT,
166 wxSYS_COLOUR_INACTIVECAPTIONTEXT,
167 wxSYS_COLOUR_BTNHIGHLIGHT,
169 wxSYS_COLOUR_3DDKSHADOW,
170 wxSYS_COLOUR_3DLIGHT,
171 wxSYS_COLOUR_INFOTEXT,
174 wxSYS_COLOUR_DESKTOP,
176 wxSYS_COLOUR_3DSHADOW,
177 wxSYS_COLOUR_3DHIGHLIGHT,
178 wxSYS_COLOUR_3DHILIGHT,
179 wxSYS_COLOUR_BTNHILIGHT,
192 wxSYS_HSCROLL_ARROW_X,
193 wxSYS_HSCROLL_ARROW_Y,
209 wxSYS_VSCROLL_ARROW_X,
210 wxSYS_VSCROLL_ARROW_Y,
214 wxSYS_NETWORK_PRESENT,
215 wxSYS_PENWINDOWS_PRESENT,
224 wxColour wxSystemSettings_GetSystemColour(int index) {
225 return wxSystemSettings::GetSystemColour(index);
228 wxFont wxSystemSettings_GetSystemFont(int index) {
229 return wxSystemSettings::GetSystemFont(index);
232 int wxSystemSettings_GetSystemMetric(int index) {
233 return wxSystemSettings::GetSystemMetric(index);
237 //---------------------------------------------------------------------------
242 wxToolTip(const wxString &tip);
244 void SetTip(const wxString& tip);
246 // *** Not in the "public" interface void SetWindow(wxWindow *win);
247 wxWindow *GetWindow();
252 void wxToolTip_Enable(bool flag) {
253 wxToolTip::Enable(flag);
256 void wxToolTip_SetDelay(long milliseconds) {
257 wxToolTip::SetDelay(milliseconds);
261 //----------------------------------------------------------------------
265 wxCaret(wxWindow* window, const wxSize& size);
270 %name(GetPositionTuple)void GetPosition(int *OUTPUT, int *OUTPUT);
271 wxPoint GetPosition();
272 %name(GetSizeTuple)void GetSize(int *OUTPUT, int *OUTPUT);
274 wxWindow *GetWindow();
275 %name(MoveXY)void Move(int x, int y);
276 void Move(const wxPoint& pt);
277 void Show(int show = TRUE);
284 int wxCaret_GetBlinkTime() {
285 return wxCaret::GetBlinkTime();
288 void wxCaret_SetBlinkTime(int milliseconds) {
289 wxCaret::SetBlinkTime(milliseconds);
293 //----------------------------------------------------------------------
296 class wxPyFontEnumerator : public wxFontEnumerator {
298 wxPyFontEnumerator() {}
299 ~wxPyFontEnumerator() {}
301 DEC_PYCALLBACK_BOOL_STRING(OnFacename);
302 DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding);
307 IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFacename);
308 IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
312 %name(wxFontEnumerator) class wxPyFontEnumerator {
314 wxPyFontEnumerator();
315 ~wxPyFontEnumerator();
316 void _setSelf(PyObject* self);
317 %pragma(python) addtomethod = "__init__:self._setSelf(self)"
319 bool EnumerateFacenames(
320 wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
321 bool fixedWidthOnly = FALSE);
322 bool EnumerateEncodings(const char* facename = "");
324 //wxArrayString* GetEncodings();
325 //wxArrayString* GetFacenames();
327 PyObject* GetEncodings() {
328 wxArrayString* arr = self->GetEncodings();
329 PyObject* list = PyList_New(0);
330 for (size_t x=0; x<arr->GetCount(); x++)
331 PyList_Append(list, PyString_FromString((*arr)[x]));
335 PyObject* GetFacenames() {
336 wxArrayString* arr = self->GetFacenames();
337 PyObject* list = PyList_New(0);
338 for (size_t x=0; x<arr->GetCount(); x++)
339 PyList_Append(list, PyString_FromString((*arr)[x]));
345 //----------------------------------------------------------------------
349 wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
353 //----------------------------------------------------------------------
355 void wxPostEvent(wxEvtHandler *dest, wxEvent& event);
358 //----------------------------------------------------------------------
359 //----------------------------------------------------------------------
360 //----------------------------------------------------------------------