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>
23 #include <wx/fontenum.h>
27 //----------------------------------------------------------------------
30 %include my_typemaps.i
32 // Import some definitions of other classes, etc.
38 //---------------------------------------------------------------------------
41 wxString wxFileSelector(char* message,
42 char* default_path = NULL,
43 char* default_filename = NULL,
44 char* default_extension = NULL,
45 char* wildcard = "*.*",
47 wxWindow *parent = NULL,
48 int x = -1, int y = -1);
50 wxString 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,
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);
66 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
67 int LCOUNT, wxString* LIST,
68 wxWindow *parent = NULL,
69 int x = -1, int y = -1,
71 int width=150, int height=200);
73 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
74 int LCOUNT, wxString* LIST,
75 wxWindow *parent = NULL,
76 int x = -1, int y = -1,
78 int width=150, int height=200);
81 int 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);
87 long wxGetNumberFromUser(const wxString& message,
88 const wxString& prompt,
89 const wxString& caption,
91 long min = 0, long max = 100,
92 wxWindow *parent = NULL,
93 const wxPoint& pos = wxPyDefaultPosition);
95 //---------------------------------------------------------------------------
98 bool wxColourDisplay();
100 void wxSetCursor(wxCursor& cursor);
102 //----------------------------------------------------------------------
103 // Miscellaneous functions
105 wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
106 wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
108 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
109 wxWindow * wxGetActiveWindow();
112 //---------------------------------------------------------------------------
115 bool wxResourceAddIdentifier(char *name, int value);
116 void wxResourceClear(void);
117 wxBitmap wxResourceCreateBitmap(char *resource);
118 wxIcon wxResourceCreateIcon(char *resource);
119 wxMenuBar * wxResourceCreateMenuBar(char *resource);
120 int wxResourceGetIdentifier(char *name);
121 bool wxResourceParseData(char *resource, wxResourceTable *table = NULL);
122 bool wxResourceParseFile(char *filename, wxResourceTable *table = NULL);
123 bool wxResourceParseString(char *resource, wxResourceTable *table = NULL);
125 //---------------------------------------------------------------------------
139 wxSYS_OEM_FIXED_FONT,
140 wxSYS_ANSI_FIXED_FONT,
143 wxSYS_DEVICE_DEFAULT_FONT,
144 wxSYS_DEFAULT_PALETTE,
145 wxSYS_SYSTEM_FIXED_FONT,
146 wxSYS_DEFAULT_GUI_FONT,
148 wxSYS_COLOUR_SCROLLBAR,
149 wxSYS_COLOUR_BACKGROUND,
150 wxSYS_COLOUR_ACTIVECAPTION,
151 wxSYS_COLOUR_INACTIVECAPTION,
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,
170 wxSYS_COLOUR_3DDKSHADOW,
171 wxSYS_COLOUR_3DLIGHT,
172 wxSYS_COLOUR_INFOTEXT,
175 wxSYS_COLOUR_DESKTOP,
177 wxSYS_COLOUR_3DSHADOW,
178 wxSYS_COLOUR_3DHIGHLIGHT,
179 wxSYS_COLOUR_3DHILIGHT,
180 wxSYS_COLOUR_BTNHILIGHT,
193 wxSYS_HSCROLL_ARROW_X,
194 wxSYS_HSCROLL_ARROW_Y,
210 wxSYS_VSCROLL_ARROW_X,
211 wxSYS_VSCROLL_ARROW_Y,
215 wxSYS_NETWORK_PRESENT,
216 wxSYS_PENWINDOWS_PRESENT,
225 wxColour wxSystemSettings_GetSystemColour(int index) {
226 return wxSystemSettings::GetSystemColour(index);
229 wxFont wxSystemSettings_GetSystemFont(int index) {
230 return wxSystemSettings::GetSystemFont(index);
233 int wxSystemSettings_GetSystemMetric(int index) {
234 return wxSystemSettings::GetSystemMetric(index);
238 //---------------------------------------------------------------------------
243 wxToolTip(const wxString &tip);
245 void SetTip(const wxString& tip);
247 // *** Not in the "public" interface void SetWindow(wxWindow *win);
248 wxWindow *GetWindow();
253 void wxToolTip_Enable(bool flag) {
254 wxToolTip::Enable(flag);
257 void wxToolTip_SetDelay(long milliseconds) {
258 wxToolTip::SetDelay(milliseconds);
262 //----------------------------------------------------------------------
266 wxCaret(wxWindow* window, const wxSize& size);
271 %name(GetPositionTuple)void GetPosition(int *OUTPUT, int *OUTPUT);
272 wxPoint GetPosition();
273 %name(GetSizeTuple)void GetSize(int *OUTPUT, int *OUTPUT);
275 wxWindow *GetWindow();
276 %name(MoveXY)void Move(int x, int y);
277 void Move(const wxPoint& pt);
278 void Show(int show = TRUE);
285 int wxCaret_GetBlinkTime() {
286 return wxCaret::GetBlinkTime();
289 void wxCaret_SetBlinkTime(int milliseconds) {
290 wxCaret::SetBlinkTime(milliseconds);
294 //----------------------------------------------------------------------
298 class wxPyFontEnumerator : public wxFontEnumerator {
300 wxPyFontEnumerator() {}
301 ~wxPyFontEnumerator() {}
303 bool EnumerateFamilies(int fixedWidthOnly = FALSE);
304 bool EnumerateEncodings(const char* family = "");
306 DEC_PYCALLBACK_BOOL_STRING(OnFontFamily);
307 DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding);
312 IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFontFamily);
313 IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
317 %name(wxFontEnumerator) class wxPyFontEnumerator {
319 wxPyFontEnumerator() {}
320 ~wxPyFontEnumerator() {}
321 %pragma(python) addtomethod = "__init__:self._setSelf(self)"
323 bool EnumerateFamilies(int fixedWidthOnly = FALSE);
324 bool EnumerateEncodings(const char* family = "");
326 bool base_OnFontFamily(const wxString& family);
327 bool base_OnFontEncoding(const wxString& family,
328 const wxString& encoding);
332 //----------------------------------------------------------------------
336 wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
342 //----------------------------------------------------------------------
343 //----------------------------------------------------------------------
344 //----------------------------------------------------------------------