From cc575a7a89550ee4a2b55dbb28a5a5720b07ee4e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 3 Apr 2015 21:10:04 +0200 Subject: [PATCH] Use in wxPG classes wxMilliClock_t variables to store values returned by wxGetLocalTimeMillis() function. wxMilliClock_t is always mapped to the proper base type and hence can be used even if wxLongLong type is not defined (when wxUSE_LONGLONG is disabled). --- include/wx/propgrid/propgrid.h | 4 ++-- src/propgrid/editors.cpp | 6 +++--- src/propgrid/propgrid.cpp | 2 +- src/propgrid/propgridpagestate.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 2a6d719ed0..f51639b39d 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1815,7 +1815,7 @@ protected: wxBitmap *m_doubleBuffer; /** Local time ms when control was created. */ - wxLongLong m_timeCreated; + wxMilliClock_t m_timeCreated; /** wxPGProperty::OnEvent can change value by setting this. */ wxVariant m_changeInEventValue; @@ -2025,7 +2025,7 @@ protected: wxWindow* m_tlpClosed; // Local time ms when tlp was closed. - wxLongLong m_tlpClosedTime; + wxMilliClock_t m_tlpClosedTime; // Sort function wxPGSortCallback m_sortFunction; diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 952280690c..63c47b4f44 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -535,7 +535,7 @@ protected: void OnMouseEvent( wxMouseEvent& event ) { - wxLongLong t = ::wxGetLocalTimeMillis(); + wxMilliClock_t t = ::wxGetLocalTimeMillis(); int evtType = event.GetEventType(); if ( m_property->HasFlag(wxPG_PROP_USE_DCC) && @@ -560,7 +560,7 @@ protected: { if ( m_downReceived || m_timeLastMouseUp == 1 ) { - wxLongLong timeFromLastUp = (t-m_timeLastMouseUp); + wxMilliClock_t timeFromLastUp = (t-m_timeLastMouseUp); if ( timeFromLastUp < DOUBLE_CLICK_CONVERSION_TRESHOLD ) { @@ -586,7 +586,7 @@ protected: } private: - wxLongLong m_timeLastMouseUp; + wxMilliClock_t m_timeLastMouseUp; wxOwnerDrawnComboBox* m_combo; wxPGProperty* m_property; // Selected property bool m_downReceived; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index c5da6844e9..f53db99fb9 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1213,7 +1213,7 @@ void wxPropertyGrid::OnTLPChanging( wxWindow* newTLP ) if ( newTLP == m_tlp ) return; - wxLongLong currentTime = ::wxGetLocalTimeMillis(); + wxMilliClock_t currentTime = ::wxGetLocalTimeMillis(); // // Parent changed so let's redetermine and re-hook the diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 012bf352fa..55d91115a3 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -392,7 +392,7 @@ void wxPropertyGridPageState::OnClientWidthChange( int newWidth, int widthChange if ( !m_isSplitterPreSet && m_dontCenterSplitter ) { - long timeSinceCreation = (::wxGetLocalTimeMillis() - GetGrid()->m_timeCreated).ToLong(); + wxMilliClock_t timeSinceCreation = ::wxGetLocalTimeMillis() - GetGrid()->m_timeCreated; // If too long, don't set splitter if ( timeSinceCreation < 250 )