]> git.saurik.com Git - wxWidgets.git/commitdiff
1. Initialized m_displayed to TRUE to solve a cell highlight problem
authorRobin Dunn <robin@alldunn.com>
Mon, 14 Feb 2000 21:35:42 +0000 (21:35 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 14 Feb 2000 21:35:42 +0000 (21:35 +0000)
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
src/generic/grid.cpp

index 06619874fff6b4bd368528b0dabace7661bdfac7..cb3bde6196e2ee6a3066febed47dcb2b31199b54 100644 (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 );
index 58efa2ce3daa9af8f7c692834c2a0320028f3a7b..56e24802198ba7b83d9b98ba2c0c8f0af0c13fd9 100644 (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 )