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.
This commit is contained in:
Artur Wieczorek
2015-04-03 21:47:13 +02:00
committed by Vadim Zeitlin
parent a088915a56
commit d8922744cf
4 changed files with 8 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;