]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/misc2.i
more tweaks and fixes
[wxWidgets.git] / utils / wxPython / src / misc2.i
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>
21 #include <wx/caret.h>
22 #ifdef NOT_READY_YET
23 #include <wx/fontenum.h>
24 #endif
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
35 %import misc.i
36
37 //----------------------------------------------------------------------
38
39 wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
40 wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
41
42
43
44 //---------------------------------------------------------------------------
45 // wxToolTip
46
47 class wxToolTip {
48 public:
49 wxToolTip(const wxString &tip);
50
51 void SetTip(const wxString& tip);
52 wxString GetTip();
53 // *** Not in the "public" interface void SetWindow(wxWindow *win);
54 wxWindow *GetWindow();
55 };
56
57
58 %inline %{
59 void wxToolTip_Enable(bool flag) {
60 wxToolTip::Enable(flag);
61 }
62
63 void wxToolTip_SetDelay(long milliseconds) {
64 wxToolTip::SetDelay(milliseconds);
65 }
66 %}
67
68 //----------------------------------------------------------------------
69
70 class wxCaret {
71 public:
72 wxCaret(wxWindow* window, const wxSize& size);
73 ~wxCaret();
74
75 bool IsOk();
76 bool IsVisible();
77 %name(GetPositionTuple)void GetPosition(int *OUTPUT, int *OUTPUT);
78 wxPoint GetPosition();
79 %name(GetSizeTuple)void GetSize(int *OUTPUT, int *OUTPUT);
80 wxSize GetSize();
81 wxWindow *GetWindow();
82 %name(MoveXY)void Move(int x, int y);
83 void Move(const wxPoint& pt);
84 void Show(int show = TRUE);
85 void Hide();
86 void OnSetFocus();
87 void OnKillFocus();
88 };
89
90 %inline %{
91 int wxCaret_GetBlinkTime() {
92 return wxCaret::GetBlinkTime();
93 }
94
95 void wxCaret_SetBlinkTime(int milliseconds) {
96 wxCaret::SetBlinkTime(milliseconds);
97 }
98 %}
99
100 //----------------------------------------------------------------------
101 #ifdef NOT_READY_YET
102
103 %{
104 class wxPyFontEnumerator : public wxFontEnumerator {
105 public:
106 wxPyFontEnumerator() {}
107 ~wxPyFontEnumerator() {}
108
109 bool EnumerateFamilies(int fixedWidthOnly = FALSE);
110 bool EnumerateEncodings(const char* family = "");
111
112 DEC_PYCALLBACK_BOOL_STRING(OnFontFamily);
113 DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding);
114
115 PYPRIVATE;
116 };
117
118 IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFontFamily);
119 IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
120
121 %}
122
123 %name(wxFontEnumerator) class wxPyFontEnumerator {
124 public:
125 wxPyFontEnumerator() {}
126 ~wxPyFontEnumerator() {}
127 %pragma(python) addtomethod = "__init__:self._setSelf(self)"
128
129 bool EnumerateFamilies(int fixedWidthOnly = FALSE);
130 bool EnumerateEncodings(const char* family = "");
131
132 bool base_OnFontFamily(const wxString& family);
133 bool base_OnFontEncoding(const wxString& family,
134 const wxString& encoding);
135 };
136 #endif
137 //----------------------------------------------------------------------
138 //----------------------------------------------------------------------
139