X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/48276300668bedc1b7fafd5eccc80caf0b59cc6c..997176a34641a870b1f6c6102e30f64f86b4122a:/include/wx/event.h?ds=sidebyside diff --git a/include/wx/event.h b/include/wx/event.h index da5a1fcc17..a61b0a9d42 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1496,6 +1496,20 @@ private: wxEVT_UPDATE_UI */ +// 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 WXDLLIMPEXP_CORE wxUpdateUIEvent : public wxCommandEvent { public: @@ -1529,6 +1543,28 @@ public: void Enable(bool enable) { m_enabled = enable; m_setEnabled = TRUE; } void SetText(const wxString& text) { m_text = text; m_setText = TRUE; } + // 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) { sm_updateInterval = updateInterval; } + + // Returns the current interval between updates in milliseconds + static long GetUpdateInterval() { return sm_updateInterval ; } + + // 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) { sm_updateMode = mode; } + + // Returns the UI update mode + static wxUpdateUIMode GetMode() { return sm_updateMode ; } + virtual wxEvent *Clone() const { return new wxUpdateUIEvent(*this); } protected: @@ -1538,6 +1574,11 @@ protected: bool m_setText; bool m_setChecked; wxString m_text; +#if wxUSE_LONGLONG + static wxLongLong sm_lastUpdate; +#endif + static long sm_updateInterval; + static wxUpdateUIMode sm_updateMode; private: DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent) @@ -1857,6 +1898,20 @@ private: wxEVT_IDLE */ +// 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 WXDLLIMPEXP_CORE wxIdleEvent : public wxEvent { public: @@ -1874,8 +1929,20 @@ public: virtual wxEvent *Clone() const { return new wxIdleEvent(*this); } + // 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) ; + protected: bool m_requestMore; + static wxIdleMode sm_idleMode; private: DECLARE_DYNAMIC_CLASS(wxIdleEvent)