//---------------------------------------------------------------------------
-class wxEvent {
+enum Propagation_state
+{
+ // don't propagate it at all
+ wxEVENT_PROPAGATE_NONE = 0,
+
+ // propagate it until it is processed
+ wxEVENT_PROPAGATE_MAX = INT_MAX
+};
+
+
+int wxNewEventType();
+
+
+
+class wxEvent : public wxObject {
public:
- wxEvent(int id = 0);
+ // wxEvent(int id = 0); // *** This class is now an ABC
~wxEvent();
wxObject* GetEventObject();
wxEventType GetEventType();
int GetId();
- bool GetSkipped();
long GetTimestamp();
void SetEventObject(wxObject* object);
void SetEventType(wxEventType typ);
void SetId(int id);
void SetTimestamp(long timeStamp);
+
+ bool IsCommandEvent() const;
+
+ // Can instruct event processor that we wish to ignore this event
+ // (treat as if the event table entry had not been found): this must be done
+ // to allow the event processing by the base classes (calling event.Skip()
+ // is the analog of calling the base class verstion of a virtual function)
void Skip(bool skip = TRUE);
+ bool GetSkipped() const;
+
+ // Determine if this event should be propagating to the parent window.
+ bool ShouldPropagate() const;
+
+ // Stop an event from propagating to its parent window, returns the old
+ // propagation level value
+ int StopPropagation();
+
+ // Resume the event propagation by restoring the propagation level
+ // (returned by StopPropagation())
+ void ResumePropagation(int propagationLevel);
+
+ wxEvent *Clone();
+};
+
+//---------------------------------------------------------------------------
+
+// Helper class to temporarily change an event not to propagate.
+class wxPropagationDisabler
+{
+public:
+ wxPropagationDisabler(wxEvent& event);
+ ~wxPropagationDisabler();
+};
+
+
+// Another one to temporarily lower propagation level.
+class wxPropagateOnce
+{
+public:
+ wxPropagateOnce(wxEvent& event);
+ ~wxPropagateOnce();
};
//---------------------------------------------------------------------------
public:
wxSizeEvent(const wxSize& sz, int id = 0);
wxSize GetSize();
+ wxRect GetRect() const;
+ void SetRect(wxRect rect);
};
//---------------------------------------------------------------------------
void SetExtraLong(long extraLong);
void SetInt(int i);
+ %addmethods {
+ PyObject* GetClientData() {
+ wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
+ if (data) {
+ Py_INCREF(data->m_obj);
+ return data->m_obj;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+ }
};
long GetX();
long GetY();
+ int GetWheelRotation() const { return m_wheelRotation; }
+ int GetWheelDelta() const { return m_wheelDelta; }
+ int GetLinesPerAction() const { return m_linesPerAction; }
+
long m_x, m_y;
bool m_leftDown;
bool m_middleDown;
bool m_shiftDown;
bool m_altDown;
bool m_metaDown;
+ int m_wheelRotation;
+ int m_wheelDelta;
+ int m_linesPerAction;
+};
+
+//---------------------------------------------------------------------------
+
+class wxMouseCaptureChangedEvent : public wxEvent
+{
+public:
+ wxMouseCaptureChangedEvent(wxWindowID id = 0, wxWindow* gainedCapture = NULL);
+ wxWindow* GetCapturedWindow() const;
+};
+
+//---------------------------------------------------------------------------
+
+class wxSetCursorEvent : public wxEvent
+{
+public:
+ wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0);
+
+ wxCoord GetX() const;
+ wxCoord GetY() const;
+
+ void SetCursor(const wxCursor& cursor);
+ const wxCursor& GetCursor() const;
+ bool HasCursor() const;
};
//---------------------------------------------------------------------------
bool MetaDown();
bool AltDown();
bool ShiftDown();
- long KeyCode();
long GetKeyCode();
+ %pragma(python) addtoclass = "KeyCode = GetKeyCode"
bool HasModifiers();
+ // get the raw key code (platform-dependent)
+ long GetRawKeyCode() const;
+
+ // get the raw key flags (platform-dependent)
+ long GetRawKeyFlags() const;
+
long GetX();
long GetY();
wxPoint GetPosition();
%name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT);
- long m_x, m_y;
- long m_keyCode;
- bool m_controlDown;
- bool m_shiftDown;
- bool m_altDown;
- bool m_metaDown;
- bool m_scanCode;
+ long m_x, m_y;
+ long m_keyCode;
+ bool m_controlDown;
+ bool m_shiftDown;
+ bool m_altDown;
+ bool m_metaDown;
+ bool m_scanCode;
+ long m_rawCode;
+ long m_rawFlags;
};
class wxMoveEvent: public wxEvent {
public:
wxMoveEvent(const wxPoint& pt, int id = 0);
-
wxPoint GetPosition();
+ wxRect GetRect() const;
+ void SetRect(wxRect rect);
};
//---------------------------------------------------------------------------
class wxFocusEvent: public wxEvent {
public:
- wxFocusEvent(WXTYPE eventType = 0, int id = 0);
+ wxFocusEvent(int eventType = 0, int id = 0);
};
+//---------------------------------------------------------------------------
+
+// wxChildFocusEvent notifies the parent that a child has got the focus: unlike
+// wxFocusEvent it is propgated upwards the window chain
+class wxChildFocusEvent : public wxCommandEvent
+{
+public:
+ wxChildFocusEvent(wxWindow *win = NULL);
+ wxWindow *GetWindow() const;
+};
+
+
//---------------------------------------------------------------------------
class wxActivateEvent: public wxEvent{
public:
- wxActivateEvent(WXTYPE eventType = 0, int active = TRUE, int id = 0);
+ wxActivateEvent(int eventType = 0, int active = TRUE, int id = 0);
bool GetActive();
};
class wxMenuEvent: public wxEvent {
public:
- wxMenuEvent(WXTYPE id = 0, int id = 0);
+ wxMenuEvent(int id = 0, int winid = 0, wxMenu* menu = NULL);
int GetMenuId();
+ bool IsPopup();
+ wxMenu* GetMenu() const;
};
//---------------------------------------------------------------------------
class wxIconizeEvent: public wxEvent {
public:
- wxIconizeEvent(int id = 0);
+ wxIconizeEvent(int id = 0, bool iconized = TRUE);
+ bool Iconized();
};
//---------------------------------------------------------------------------
}
for (int i=0; i<count; i++) {
+#if wxUSE_UNICODE
+ PyList_SetItem(list, i, PyUnicode_FromWideChar(files[i], files[i].Len()));
+#else
PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
+#endif
}
return list;
}
//---------------------------------------------------------------------------
+// Whether to always send idle events to windows, or
+// to only send update events to those with the
+// wxWS_EX_PROCESS_IDLE style.
+
+enum wxIdleMode
+{
+ // Send idle events to all windows
+ wxIDLE_PROCESS_ALL,
+
+ // Send idle events to windows that have
+ // the wxWS_EX_PROCESS_IDLE flag specified
+ wxIDLE_PROCESS_SPECIFIED
+};
+
+
class wxIdleEvent: public wxEvent {
public:
wxIdleEvent();
void RequestMore(bool needMore = TRUE);
bool MoreRequested();
+
+ // Specify how wxWindows will send idle events: to
+ // all windows, or only to those which specify that they
+ // will process the events.
+ static void SetMode(wxIdleMode mode) { sm_idleMode = mode; }
+
+ // Returns the idle event mode
+ static wxIdleMode GetMode() { return sm_idleMode ; }
+
+ // Can we send an idle event?
+ static bool CanSend(wxWindow* win) ;
+
};
//---------------------------------------------------------------------------
+// Whether to always send update events to windows, or
+// to only send update events to those with the
+// wxWS_EX_PROCESS_UI_UPDATES style.
+
+enum wxUpdateUIMode
+{
+ // Send UI update events to all windows
+ wxUPDATE_UI_PROCESS_ALL,
+
+ // Send UI update events to windows that have
+ // the wxWS_EX_PROCESS_UI_UPDATES flag specified
+ wxUPDATE_UI_PROCESS_SPECIFIED
+};
+
+
class wxUpdateUIEvent: public wxEvent {
public:
wxUpdateUIEvent(wxWindowID commandId = 0);
void Check(bool check);
void Enable(bool enable);
void SetText(const wxString& text);
+
+
+ // Sets the interval between updates in milliseconds.
+ // Set to -1 to disable updates, or to 0 to update as frequently as possible.
+ static void SetUpdateInterval(long updateInterval);
+
+ // Returns the current interval between updates in milliseconds
+ static long GetUpdateInterval();
+
+ // Can we update this window?
+ static bool CanUpdate(wxWindow* win);
+
+ // Reset the update time to provide a delay until the next
+ // time we should update
+ static void ResetUpdateTime();
+
+ // Specify how wxWindows will send update events: to
+ // all windows, or only to those which specify that they
+ // will process the events.
+ static void SetMode(wxUpdateUIMode mode);
+
+ // Returns the UI update mode
+ static wxUpdateUIMode GetMode();
};
//---------------------------------------------------------------------------
public:
wxNotifyEvent(int commandType = wxEVT_NULL, int id = 0);
bool IsAllowed();
+ void Allow();
void Veto();
};
+//---------------------------------------------------------------------------
+
+class wxDisplayChangedEvent : public wxEvent
+{
+public:
+ wxDisplayChangedEvent();
+};
+
+
//---------------------------------------------------------------------------
class wxPaletteChangedEvent : public wxEvent {
//---------------------------------------------------------------------------
+class wxContextMenuEvent : public wxCommandEvent
+{
+public:
+ wxContextMenuEvent(wxEventType type = wxEVT_NULL,
+ wxWindowID id = 0,
+ const wxPoint& pt = wxDefaultPosition);
+ const wxPoint& GetPosition();
+ void SetPosition(const wxPoint& pos);
+};
+
+//----------------------------------------------------------------------
+
class wxTimerEvent : public wxEvent
{
public:
int GetInterval();
};
+//---------------------------------------------------------------------------
+
+class wxTextUrlEvent : public wxCommandEvent
+{
+public:
+ wxTextUrlEvent(int id, const wxMouseEvent& evtMouse,
+ long start, long end);
+ const wxMouseEvent& GetMouseEvent();
+ long GetURLStart();
+ long GetURLEnd();
+};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxPyEvent : public wxEvent {
public:
- wxPyEvent(int id=0);
+ wxPyEvent(int winid=0, wxEventType commandType = wxEVT_NULL );
~wxPyEvent();
%pragma(python) addtomethod = "__init__:self.SetSelf(self)"