class wxEvent {
public:
+ wxEvent(int id = 0);
+ ~wxEvent();
+
wxObject* GetEventObject();
wxEventType GetEventType();
int GetId();
class wxSizeEvent : public wxEvent {
public:
+ wxSizeEvent(const wxSize& sz, int id = 0);
wxSize GetSize();
};
class wxCloseEvent : public wxEvent {
public:
+ wxCloseEvent(int commandEventType = 0, int id = 0);
+
void SetLoggingOff(bool loggingOff);
bool GetLoggingOff();
void Veto(bool veto = TRUE);
class wxCommandEvent : public wxEvent {
public:
+ wxCommandEvent(int commandEventType = 0, int id = 0);
+
bool Checked();
long GetExtraLong();
int GetInt();
int GetSelection();
wxString GetString();
bool IsSelection();
+ void SetString(const wxString& s);
+ void SetExtraLong(long extraLong);
+ void SetInt(int i);
+
};
class wxScrollEvent: public wxCommandEvent {
public:
+ wxScrollEvent(int commandType = 0, int id = 0, int pos = 0,
+ int orientation = 0);
+
int GetOrientation();
int GetPosition();
};
class wxScrollWinEvent: public wxEvent {
public:
+ wxScrollWinEvent(int commandType = 0, int pos = 0,
+ int orientation = 0);
+
int GetOrientation();
int GetPosition();
};
class wxSpinEvent : public wxScrollEvent {
public:
+ wxSpinEvent(int commandType = 0, int id = 0);
};
class wxMouseEvent: public wxEvent {
public:
+ wxMouseEvent(int mouseEventType = 0);
+
bool IsButton();
bool ButtonDown(int but = -1);
bool ButtonDClick(int but = -1);
bool Moving();
bool Entering();
bool Leaving();
- void Position(long *OUTPUT, long *OUTPUT);
wxPoint GetPosition();
+ %name(GetPositionTuple)void GetPosition(long *OUTPUT, long *OUTPUT);
wxPoint GetLogicalPosition(const wxDC& dc);
long GetX();
long GetY();
class wxKeyEvent: public wxEvent {
public:
+ wxKeyEvent(int keyEventType);
+
bool ControlDown();
bool MetaDown();
bool AltDown();
bool ShiftDown();
long KeyCode();
+ long GetX();
+ long GetY();
+ wxPoint GetPosition();
+ %name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT);
};
//---------------------------------------------------------------------------
-// class wxNavigationKeyEvent : public wxCommandEvent {
-// public:
-// wxNavigationKeyEvent();
-
-// bool GetDirection();
-// void SetDirection(bool bForward);
-// bool IsWindowChange();
-// void SetWindowChange(bool bIs);
-// wxWindow* GetCurrentFocus();
-// void SetCurrentFocus(wxWindow *win);
-// };
+class wxNavigationKeyEvent : public wxEvent {
+public:
+ wxNavigationKeyEvent();
+
+ bool GetDirection();
+ void SetDirection(bool bForward);
+ bool IsWindowChange();
+ void SetWindowChange(bool bIs);
+ wxWindow* GetCurrentFocus();
+ void SetCurrentFocus(wxWindow *win);
+};
//---------------------------------------------------------------------------
class wxMoveEvent: public wxEvent {
public:
+ wxMoveEvent(const wxPoint& pt, int id = 0);
+
wxPoint GetPosition();
};
class wxPaintEvent: public wxEvent {
public:
+ wxPaintEvent(int id = 0);
};
class wxEraseEvent: public wxEvent {
public:
+ wxEraseEvent(int id = 0, wxDC* dc = NULL);
+
wxDC *GetDC();
};
class wxFocusEvent: public wxEvent {
public:
-
+ wxFocusEvent(WXTYPE eventType = 0, int id = 0);
};
//---------------------------------------------------------------------------
class wxActivateEvent: public wxEvent{
public:
+ wxActivateEvent(WXTYPE eventType = 0, int active = TRUE, int id = 0);
bool GetActive();
};
class wxInitDialogEvent: public wxEvent {
public:
-
+ wxInitDialogEvent(int id = 0);
};
//---------------------------------------------------------------------------
class wxMenuEvent: public wxEvent {
public:
+ wxMenuEvent(WXTYPE id = 0, int id = 0);
int GetMenuId();
};
class wxShowEvent: public wxEvent {
public:
+ wxShowEvent(int id = 0, int show = FALSE);
void SetShow(bool show);
bool GetShow();
};
class wxIconizeEvent: public wxEvent {
public:
+ wxIconizeEvent(int id = 0);
};
//---------------------------------------------------------------------------
class wxMaximizeEvent: public wxEvent {
public:
-
+ wxMaximizeEvent(int id = 0);
};
//---------------------------------------------------------------------------
class wxJoystickEvent: public wxEvent {
public:
+ wxJoystickEvent(int type = wxEVT_NULL,
+ int state = 0,
+ int joystick = wxJOYSTICK1,
+ int change = 0);
wxPoint GetPosition();
int GetZPosition();
int GetButtonState();
class wxIdleEvent: public wxEvent {
public:
+ wxIdleEvent();
void RequestMore(bool needMore = TRUE);
bool MoreRequested();
};
class wxUpdateUIEvent: public wxEvent {
public:
+ wxUpdateUIEvent(wxWindowID commandId = 0);
bool GetChecked();
bool GetEnabled();
wxString GetText();
class wxSysColourChangedEvent: public wxEvent {
public:
-
+ wxSysColourChangedEvent();
};
//---------------------------------------------------------------------------
class wxNotifyEvent : public wxCommandEvent {
public:
+ wxNotifyEvent(int commandType = wxEVT_NULL, int id = 0);
bool IsAllowed();
void Veto();
};
//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-// This one can be derived from in Python and passed through the event
-// system without loosing anything so long as the Python data is saved with
-// SetPyData...
-%{
-class wxPyEvent : public wxEvent {
- DECLARE_DYNAMIC_CLASS(wxPyEvent)
+class wxPaletteChangedEvent : public wxEvent {
public:
- wxPyEvent(int id=0, PyObject* userData = Py_None)
- : wxEvent(id) {
- m_userData = userData;
- Py_INCREF(m_userData);
- }
+ wxPaletteChangedEvent(wxWindowID id = 0);
- ~wxPyEvent() {
- bool doSave = wxPyRestoreThread();
- Py_DECREF(m_userData);
- wxPySaveThread(doSave);
- }
+ void SetChangedWindow(wxWindow* win);
+ wxWindow* GetChangedWindow();
- void SetPyData(PyObject* userData) {
- bool doSave = wxPyRestoreThread();
- Py_DECREF(m_userData);
- m_userData = userData;
- Py_INCREF(m_userData);
- wxPySaveThread(doSave);
- }
+};
- PyObject* GetPyData() const {
- Py_INCREF(m_userData);
- return m_userData;
- }
+//---------------------------------------------------------------------------
- // This one is so the event object can be Cloned...
- void CopyObject(wxObject& dest) const {
- wxEvent::CopyObject(dest);
- ((wxPyEvent*)&dest)->SetPyData(m_userData);
- }
+class wxQueryNewPaletteEvent : public wxEvent {
+public:
+ wxQueryNewPaletteEvent(wxWindowID id = 0);
-private:
- PyObject* m_userData;
+ void SetPaletteRealized(bool realized);
+ bool GetPaletteRealized();
};
-IMPLEMENT_DYNAMIC_CLASS(wxPyEvent, wxEvent)
-
-%}
+//---------------------------------------------------------------------------
-class wxPyEvent : public wxEvent {
+class wxWindowCreateEvent : public wxEvent {
public:
- wxPyEvent(int id=0, PyObject* userData = Py_None);
- ~wxPyEvent();
+ wxWindowCreateEvent(wxWindow *win = NULL);
- void SetPyData(PyObject* userData);
- PyObject* GetPyData();
+ wxWindow *GetWindow();
};
-//---------------------------------------------------------------------------
-// Same for this one except it is a wxCommandEvent and so will get passed up the
-// containment heirarchy.
-
-%{
-class wxPyCommandEvent : public wxCommandEvent {
- DECLARE_DYNAMIC_CLASS(wxPyCommandEvent)
+class wxWindowDestroyEvent : public wxEvent {
public:
- wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0, PyObject* userData = Py_None)
- : wxCommandEvent(commandType, id) {
- m_userData = userData;
- Py_INCREF(m_userData);
- }
+ wxWindowDestroyEvent(wxWindow *win = NULL);
- ~wxPyCommandEvent() {
- bool doSave = wxPyRestoreThread();
- Py_DECREF(m_userData);
- wxPySaveThread(doSave);
- }
-
- void SetPyData(PyObject* userData) {
- bool doSave = wxPyRestoreThread();
- Py_DECREF(m_userData);
- m_userData = userData;
- Py_INCREF(m_userData);
- wxPySaveThread(doSave);
- }
+ wxWindow *GetWindow();
+};
- PyObject* GetPyData() const {
- Py_INCREF(m_userData);
- return m_userData;
- }
- // This one is so the event object can be Cloned...
- void CopyObject(wxObject& dest) const {
- wxCommandEvent::CopyObject(dest);
- ((wxPyCommandEvent*)&dest)->SetPyData(m_userData);
- }
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+// These classes can be derived from in Python and passed through the event
+// system without loosing anything. They do this by keeping a reference to
+// themselves and some special case handling in wxPyCallback::EventThunker.
-private:
- PyObject* m_userData;
-};
+class wxPyEvent : public wxEvent {
+public:
+ wxPyEvent(int id=0);
+ ~wxPyEvent();
-IMPLEMENT_DYNAMIC_CLASS(wxPyCommandEvent, wxCommandEvent)
+ %pragma(python) addtomethod = "__init__:self.SetSelf(self)"
-%}
+ void SetSelf(PyObject* self);
+ PyObject* GetSelf();
+};
class wxPyCommandEvent : public wxCommandEvent {
public:
- wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0, PyObject* userData = Py_None);
+ wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0);
~wxPyCommandEvent();
- void SetPyData(PyObject* userData);
- PyObject* GetPyData();
+ %pragma(python) addtomethod = "__init__:self.SetSelf(self)"
+
+ void SetSelf(PyObject* self);
+ PyObject* GetSelf();
};
+
+
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------