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
This commit is contained in:
Robin Dunn
2000-02-14 21:35:42 +00:00
parent dce4122902
commit 75ecbe4594
2 changed files with 3 additions and 14 deletions

View File

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

View File

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