]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Added further makefiles for wizard sample
[wxWidgets.git] / src / generic / grid.cpp
index 80abb681cbf4c33779090f3b560170c1a2922b6e..01af2f0d9eb4795cf868264c2bdc4a5f82e6686b 100644 (file)
@@ -9,24 +9,23 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#include "wx/defs.h"
-
-#if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID) 
-#include "gridg.cpp"
-#else
-
 #ifdef __GNUG__
     #pragma implementation "grid.h"
 #endif
 
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/defs.h"
 
 #ifdef __BORLANDC__
     #pragma hdrstop
 #endif
 
+#if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID) 
+#include "gridg.cpp"
+#else
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/dcclient.h"
@@ -817,9 +816,10 @@ void wxGrid::Init()
     m_cellEditCtrlEnabled = TRUE;
     m_editCtrlType = wxGRID_TEXTCTRL;    
     
-    // Not really needed here, it gets called by OnSize()
+    // This is here in case OnSize does not get called when the grid is
+    // displayed
     //
-    // CalcDimensions();
+    CalcDimensions();
 }
 
 
@@ -1965,6 +1965,12 @@ void wxGrid::OnGridScroll( wxScrollEvent& ev )
 
 void wxGrid::SelectCell( const wxGridCellCoords& coords )
 {
+    if ( SendEvent( EVT_GRID_SELECT_CELL, coords.GetRow(), coords.GetCol() ) )
+    {
+        // the event has been intercepted - do nothing
+        return;
+    }
+
     wxClientDC dc( this );
 
     if ( m_currentCellCoords != wxGridNoCellCoords )