Added wxFrameBase::OnMenuOpen, and wxUSE_IDLEMENUUPDATES in platform.h
Experimental wxUpdateUIEvent::SetUpdateInterval() function to limit UI update frequency git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1529,6 +1529,20 @@ 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) { m_updateInterval = updateInterval; }
|
||||
|
||||
// Returns the current interval between updates in milliseconds
|
||||
static long GetUpdateInterval() { return m_updateInterval ; }
|
||||
|
||||
// Can we update?
|
||||
static bool CanUpdate() ;
|
||||
|
||||
// Reset the update time to provide a delay until the next
|
||||
// time we should update
|
||||
static void ResetUpdateTime() ;
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxUpdateUIEvent(*this); }
|
||||
|
||||
protected:
|
||||
@@ -1538,6 +1552,10 @@ protected:
|
||||
bool m_setText;
|
||||
bool m_setChecked;
|
||||
wxString m_text;
|
||||
#if wxUSE_LONGLONG
|
||||
static wxLongLong m_lastUpdate;
|
||||
#endif
|
||||
static long m_updateInterval;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent)
|
||||
|
@@ -142,6 +142,7 @@ public:
|
||||
|
||||
// event handlers
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
void OnMenuOpen(wxMenuEvent& event);
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
@@ -327,5 +327,17 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Choose which method we will use for updating menus
|
||||
* - in OnIdle, or when we receive a wxEVT_MENU_OPEN event.
|
||||
* Presently, only Windows and GTK+ support wxEVT_MENU_OPEN.
|
||||
*/
|
||||
#ifndef wxUSE_IDLEMENUUPDATES
|
||||
#if defined(__WXMSW__) || defined(__WXGTK__)
|
||||
#define wxUSE_IDLEMENUUPDATES 0
|
||||
#else
|
||||
#define wxUSE_IDLEMENUUPDATES 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _WX_PLATFORM_H_ */
|
||||
|
||||
|
Reference in New Issue
Block a user