From 75ecbe459492c19167bd12ea240520a2ca7624a6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 14 Feb 2000 21:35:42 +0000 Subject: [PATCH] 1. Initialized m_displayed to TRUE to solve a cell highlight problem for some systems. If this causes no problems then this flag can be removed. 2. Took out the edit timer so now a second click in the current cell will activate the edit control, even if it is several seconds later. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/grid.h | 4 +--- src/generic/grid.cpp | 13 ++----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 06619874ff..cb3bde6196 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -1194,8 +1194,7 @@ protected: bool m_isDragging; wxPoint m_startDragPos; - wxTimer* m_editTimer; - bool m_waitForSlowClick; + bool m_waitForSlowClick; wxGridCellCoords m_selectionStart; @@ -1225,7 +1224,6 @@ protected: void OnSize( wxSizeEvent& ); void OnKeyDown( wxKeyEvent& ); void OnEraseBackground( wxEraseEvent& ); - void OnEditTimer( wxTimerEvent& ); void SetCurrentCell( const wxGridCellCoords& coords ); diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 58efa2ce3d..56e2480219 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1695,7 +1695,6 @@ void wxGridWindow::OnEraseBackground(wxEraseEvent&) ////////////////////////////////////////////////////////////////////// -#define ID_EDIT_TIMER 1001 IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow ) @@ -1704,7 +1703,6 @@ BEGIN_EVENT_TABLE( wxGrid, wxScrolledWindow ) EVT_SIZE( wxGrid::OnSize ) EVT_KEY_DOWN( wxGrid::OnKeyDown ) EVT_ERASE_BACKGROUND( wxGrid::OnEraseBackground ) - EVT_TIMER( ID_EDIT_TIMER, wxGrid::OnEditTimer ) END_EVENT_TABLE() wxGrid::wxGrid( wxWindow *parent, @@ -1734,7 +1732,6 @@ wxGrid::~wxGrid() if (m_ownTable) delete m_table; - delete m_editTimer; } @@ -1745,7 +1742,7 @@ wxGrid::~wxGrid() void wxGrid::Create() { m_created = FALSE; // set to TRUE by CreateGrid - m_displayed = FALSE; // set to TRUE by OnPaint + m_displayed = TRUE; // FALSE; // set to TRUE by OnPaint m_table = (wxGridTableBase *) NULL; m_ownTable = FALSE; @@ -1924,7 +1921,6 @@ void wxGrid::Init() m_isDragging = FALSE; m_startDragPos = wxDefaultPosition; - m_editTimer = new wxTimer( this, ID_EDIT_TIMER ); m_waitForSlowClick = FALSE; m_rowResizeCursor = wxCursor( wxCURSOR_SIZENS ); @@ -2897,10 +2893,10 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) if (m_waitForSlowClick && coords == m_currentCellCoords) { EnableCellEditControl(TRUE); ShowCellEditControl(); + m_waitForSlowClick = FALSE; } else { SetCurrentCell( coords ); - m_editTimer->Start( 1500, TRUE ); m_waitForSlowClick = TRUE; } } @@ -3663,11 +3659,6 @@ void wxGrid::OnEraseBackground(wxEraseEvent&) { } -void wxGrid::OnEditTimer(wxTimerEvent&) -{ - m_waitForSlowClick = FALSE; -} - void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) -- 2.45.2