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:
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:
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)
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:
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)
static const wxEventTable sm_eventTable; \
virtual const wxEventTable* GetEventTable() const;
+// N.B.: when building DLL with Borland C++ 5.5 compiler, you must initialize
+// sm_eventTable before using it in GetEventTable() or the compiler gives
+// E2233 (see http://groups.google.com/groups?selm=397dcc8a%241_2%40dnews)
#define BEGIN_EVENT_TABLE(theClass, baseClass) \
- const wxEventTable *theClass::GetEventTable() const \
- { return &theClass::sm_eventTable; } \
const wxEventTable theClass::sm_eventTable = \
{ &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \
+ const wxEventTable *theClass::GetEventTable() const \
+ { return &theClass::sm_eventTable; } \
const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define END_EVENT_TABLE() DECLARE_EVENT_TABLE_ENTRY( wxEVT_NULL, 0, 0, 0, 0 ) };