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).
This commit is contained in:
Artur Wieczorek
2015-04-03 21:10:04 +02:00
parent 6a7b95f419
commit cc575a7a89
4 changed files with 7 additions and 7 deletions

View File

@@ -1815,7 +1815,7 @@ protected:
wxBitmap *m_doubleBuffer; wxBitmap *m_doubleBuffer;
/** Local time ms when control was created. */ /** Local time ms when control was created. */
wxLongLong m_timeCreated; wxMilliClock_t m_timeCreated;
/** wxPGProperty::OnEvent can change value by setting this. */ /** wxPGProperty::OnEvent can change value by setting this. */
wxVariant m_changeInEventValue; wxVariant m_changeInEventValue;
@@ -2025,7 +2025,7 @@ protected:
wxWindow* m_tlpClosed; wxWindow* m_tlpClosed;
// Local time ms when tlp was closed. // Local time ms when tlp was closed.
wxLongLong m_tlpClosedTime; wxMilliClock_t m_tlpClosedTime;
// Sort function // Sort function
wxPGSortCallback m_sortFunction; wxPGSortCallback m_sortFunction;

View File

@@ -535,7 +535,7 @@ protected:
void OnMouseEvent( wxMouseEvent& event ) void OnMouseEvent( wxMouseEvent& event )
{ {
wxLongLong t = ::wxGetLocalTimeMillis(); wxMilliClock_t t = ::wxGetLocalTimeMillis();
int evtType = event.GetEventType(); int evtType = event.GetEventType();
if ( m_property->HasFlag(wxPG_PROP_USE_DCC) && if ( m_property->HasFlag(wxPG_PROP_USE_DCC) &&
@@ -560,7 +560,7 @@ protected:
{ {
if ( m_downReceived || m_timeLastMouseUp == 1 ) if ( m_downReceived || m_timeLastMouseUp == 1 )
{ {
wxLongLong timeFromLastUp = (t-m_timeLastMouseUp); wxMilliClock_t timeFromLastUp = (t-m_timeLastMouseUp);
if ( timeFromLastUp < DOUBLE_CLICK_CONVERSION_TRESHOLD ) if ( timeFromLastUp < DOUBLE_CLICK_CONVERSION_TRESHOLD )
{ {
@@ -586,7 +586,7 @@ protected:
} }
private: private:
wxLongLong m_timeLastMouseUp; wxMilliClock_t m_timeLastMouseUp;
wxOwnerDrawnComboBox* m_combo; wxOwnerDrawnComboBox* m_combo;
wxPGProperty* m_property; // Selected property wxPGProperty* m_property; // Selected property
bool m_downReceived; bool m_downReceived;

View File

@@ -1213,7 +1213,7 @@ void wxPropertyGrid::OnTLPChanging( wxWindow* newTLP )
if ( newTLP == m_tlp ) if ( newTLP == m_tlp )
return; return;
wxLongLong currentTime = ::wxGetLocalTimeMillis(); wxMilliClock_t currentTime = ::wxGetLocalTimeMillis();
// //
// Parent changed so let's redetermine and re-hook the // Parent changed so let's redetermine and re-hook the

View File

@@ -392,7 +392,7 @@ void wxPropertyGridPageState::OnClientWidthChange( int newWidth, int widthChange
if ( !m_isSplitterPreSet && m_dontCenterSplitter ) 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 too long, don't set splitter
if ( timeSinceCreation < 250 ) if ( timeSinceCreation < 250 )