]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/include/wx/wxPython/pyclasses.h
c74f8cacf94ee835a71387e13d29b3a12a99566f
1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPython python-aware classes for redirecting virtual method
4 // calls for classes located in the core but that need to be
5 // visible to multiple modules
9 // Created: 11-Oct-2003
11 // Copyright: (c) 2003 by Total Control Software
12 // Licence: wxWindows license
13 /////////////////////////////////////////////////////////////////////////////
15 #ifndef __pyclasses_h__
16 #define __pyclasses_h__
20 //---------------------------------------------------------------------------
22 class wxPySizer
: public wxSizer
{
23 DECLARE_DYNAMIC_CLASS(wxPySizer
);
25 wxPySizer() : wxSizer() {};
27 DEC_PYCALLBACK___pure(RecalcSizes
);
28 DEC_PYCALLBACK_wxSize__pure(CalcMin
);
33 //---------------------------------------------------------------------------
35 class wxPyValidator
: public wxValidator
{
36 DECLARE_DYNAMIC_CLASS(wxPyValidator
);
44 wxObject
* Clone() const {
45 wxPyValidator
* ptr
= NULL
;
46 wxPyValidator
* self
= (wxPyValidator
*)this;
48 wxPyBeginBlockThreads();
49 if (wxPyCBH_findCallback(self
->m_myInst
, "Clone")) {
51 ro
= wxPyCBH_callCallbackObj(self
->m_myInst
, Py_BuildValue("()"));
53 wxPyConvertSwigPtr(ro
, (void **)&ptr
, wxT("wxPyValidator"));
57 wxPyEndBlockThreads();
59 // This is very dangerous!!! But is the only way I could find
60 // to squash a memory leak. Currently it is okay, but if the
61 // validator architecture in wxWindows ever changes, problems
68 DEC_PYCALLBACK_BOOL_WXWIN(Validate
);
69 DEC_PYCALLBACK_BOOL_(TransferToWindow
);
70 DEC_PYCALLBACK_BOOL_(TransferFromWindow
);
76 //---------------------------------------------------------------------------
79 class wxPyPen
: public wxPen
{
81 wxPyPen(wxColour
& colour
, int width
=1, int style
=wxSOLID
)
82 : wxPen(colour
, width
, style
)
86 void SetDashes(int nb_dashes
, const wxDash
*dash
);
93 //---------------------------------------------------------------------------
95 class wxPyTimer
: public wxTimer
98 wxPyTimer(wxEvtHandler
*owner
=NULL
, int id
= -1)
101 if (owner
== NULL
) SetOwner(this);
104 DEC_PYCALLBACK__(Notify
);
109 //---------------------------------------------------------------------------
112 class wxPyProcess
: public wxProcess
{
114 wxPyProcess(wxEvtHandler
*parent
= NULL
, int id
= -1)
115 : wxProcess(parent
, id
)
118 DEC_PYCALLBACK_VOID_INTINT(OnTerminate
);
124 //---------------------------------------------------------------------------
126 class wxPyDropSource
: public wxDropSource
{
129 wxPyDropSource(wxWindow
*win
= NULL
,
130 const wxCursor
©
= wxNullCursor
,
131 const wxCursor
&move
= wxNullCursor
,
132 const wxCursor
&none
= wxNullCursor
)
133 : wxDropSource(win
, copy
, move
, none
) {}
135 wxPyDropSource(wxWindow
*win
= NULL
,
136 const wxIcon
& copy
= wxNullIcon
,
137 const wxIcon
& move
= wxNullIcon
,
138 const wxIcon
& none
= wxNullIcon
)
139 : wxDropSource(win
, copy
, move
, none
) {}
141 ~wxPyDropSource() { }
143 DEC_PYCALLBACK_BOOL_DR(GiveFeedback
);
148 class wxPyDropTarget
: public wxDropTarget
{
150 wxPyDropTarget(wxDataObject
*dataObject
= NULL
)
151 : wxDropTarget(dataObject
) {}
153 // called when mouse leaves the window: might be used to remove the
154 // feedback which was given in OnEnter()
155 DEC_PYCALLBACK__(OnLeave
);
157 // called when the mouse enters the window (only once until OnLeave())
158 DEC_PYCALLBACK_DR_2WXCDR(OnEnter
);
160 // called when the mouse moves in the window - shouldn't take long to
161 // execute or otherwise mouse movement would be too slow
162 DEC_PYCALLBACK_DR_2WXCDR(OnDragOver
);
164 // called after OnDrop() returns True: you will usually just call
165 // GetData() from here and, probably, also refresh something to update the
166 // new data and, finally, return the code indicating how did the operation
167 // complete (returning default value in case of success and wxDragError on
168 // failure is usually ok)
169 DEC_PYCALLBACK_DR_2WXCDR_pure(OnData
);
171 // this function is called when data is dropped at position (x, y) - if it
172 // returns True, OnData() will be called immediately afterwards which will
173 // allow to retrieve the data dropped.
174 DEC_PYCALLBACK_BOOL_INTINT(OnDrop
);
182 //---------------------------------------------------------------------------
184 class wxPyVScrolledWindow
;
186 class wxPyHtmlListBox
;
188 class wxPyPopupTransientWindow
;
189 class wxPyPreviewFrame
;
191 class wxPyPreviewControlBar
;
192 class wxPyPrintPreview
;
196 class wxGenericDragImage
;
201 class wxTaskBarIconEvent
;
203 class wxToggleButton
;
206 //---------------------------------------------------------------------------
208 //---------------------------------------------------------------------------
209 //---------------------------------------------------------------------------