From d8922744cff4a284305165f3396f96d0209091de Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 3 Apr 2015 21:47:13 +0200 Subject: [PATCH] Use wxMilliClock_t to store values returned by wxGetLocalTimeMillis(). This fixes wxComboCtrl compilation with wxUSE_LONGLONG==0 as wxMilliClock_t is always mapped to the proper base type and hence can be used even if wxLongLong type is not defined. See #16939. --- include/wx/combo.h | 2 +- include/wx/msw/combo.h | 2 +- src/common/combocmn.cpp | 2 +- src/msw/combo.cpp | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/wx/combo.h b/include/wx/combo.h index 57fbcd829b..86b08a67d5 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -647,7 +647,7 @@ protected: // used to prevent immediate re-popupping in case closed popup // by clicking on the combo control (needed because of inconsistent // transient implementation across platforms). - wxLongLong m_timeCanAcceptClick; + wxMilliClock_t m_timeCanAcceptClick; // how much popup should expand to the left/right of the control wxCoord m_extLeft; diff --git a/include/wx/msw/combo.h b/include/wx/msw/combo.h index 50dc6eba4f..9ab1b30e73 100644 --- a/include/wx/msw/combo.h +++ b/include/wx/msw/combo.h @@ -100,7 +100,7 @@ private: #if wxUSE_COMBOCTRL_POPUP_ANIMATION // Popup animation related - wxLongLong m_animStart; + wxMilliClock_t m_animStart; wxTimer m_animTimer; wxRect m_animRect; int m_animFlags; diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index f346ea9a6a..8fb1354720 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1918,7 +1918,7 @@ bool wxComboCtrlBase::HandleButtonMouseEvent( wxMouseEvent& event, bool wxComboCtrlBase::PreprocessMouseEvent( wxMouseEvent& event, int WXUNUSED(flags) ) { - wxLongLong t = ::wxGetLocalTimeMillis(); + wxMilliClock_t t = ::wxGetLocalTimeMillis(); int evtType = event.GetEventType(); #if USES_WXPOPUPWINDOW || USES_GENERICTLW diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 3f9b3accbe..d10aa0e7f9 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -731,10 +731,14 @@ void wxComboCtrl::DoTimerEvent() } else { - wxLongLong t = ::wxGetLocalTimeMillis(); + wxMilliClock_t t = ::wxGetLocalTimeMillis(); const wxRect& rect = m_animRect; +#if wxUSE_LONGLONG int pos = (int) (t-m_animStart).GetLo(); +#else + int pos = (int) (t-m_animStart); +#endif if ( pos < COMBOBOX_ANIMATION_DURATION ) { int height = rect.height;