]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/grid.h
removed extern from inline function declarations
[wxWidgets.git] / include / wx / generic / grid.h
index 0937a8a5e105066ccd40e05c4f2a77781346ded3..cf4d7155f2f902cf329308c86674acbceca2ebde 100644 (file)
@@ -48,7 +48,7 @@
 #define WXGRID_DEFAULT_COL_WIDTH              80
 #define WXGRID_DEFAULT_COL_LABEL_HEIGHT       32
 #define WXGRID_DEFAULT_ROW_LABEL_WIDTH        82
-#define WXGRID_LABEL_EDGE_ZONE                 5
+#define WXGRID_LABEL_EDGE_ZONE                 2
 #define WXGRID_MIN_ROW_HEIGHT                 15
 #define WXGRID_MIN_COL_WIDTH                  15
 #define WXGRID_DEFAULT_SCROLLBAR_WIDTH        16
@@ -76,6 +76,7 @@ class WXDLLEXPORT wxGridRowLabelWindow;
 class WXDLLEXPORT wxGridTableBase;
 class WXDLLEXPORT wxGridWindow;
 class WXDLLEXPORT wxGridTypeRegistry;
+class WXDLLEXPORT wxGridSelection;
 
 class WXDLLEXPORT wxCheckBox;
 class WXDLLEXPORT wxComboBox;
@@ -960,8 +961,15 @@ public:
 
     ~wxGrid();
 
-    bool CreateGrid( int numRows, int numCols );
+    enum wxGridSelectionModes {wxGridSelectCells,
+                               wxGridSelectRows,
+                               wxGridSelectColumns};
 
+    bool CreateGrid( int numRows, int numCols,
+                     wxGrid::wxGridSelectionModes selmode =
+                     wxGrid::wxGridSelectCells );
+
+    void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
 
     // ------ grid dimensions
     //
@@ -989,7 +997,9 @@ public:
     void DoEndDragResizeCol();
 
     wxGridTableBase * GetTable() const { return m_table; }
-    bool SetTable( wxGridTableBase *table, bool takeOwnership=FALSE );
+    bool SetTable( wxGridTableBase *table, bool takeOwnership=FALSE,
+                  wxGrid::wxGridSelectionModes selmode =
+                  wxGrid::wxGridSelectCells );
 
     void ClearGrid();
     bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=TRUE );
@@ -1269,34 +1279,15 @@ public:
 
     void SelectAll();
 
-    bool IsSelection()
-        { return ( m_selectedTopLeft != wxGridNoCellCoords &&
-                   m_selectedBottomRight != wxGridNoCellCoords );
-        }
+    bool IsSelection();
 
     void ClearSelection();
 
-    bool IsInSelection( int row, int col )
-        { return ( IsSelection() &&
-                   row >= m_selectedTopLeft.GetRow() &&
-                   col >= m_selectedTopLeft.GetCol() &&
-                   row <= m_selectedBottomRight.GetRow() &&
-                   col <= m_selectedBottomRight.GetCol() );
-        }
+    bool IsInSelection( int row, int col );
 
     bool IsInSelection( const wxGridCellCoords& coords )
         { return IsInSelection( coords.GetRow(), coords.GetCol() ); }
 
-    void GetSelection( int* topRow, int* leftCol, int* bottomRow, int* rightCol )
-        {
-            // these will all be -1 if there is no selected block
-            //
-            *topRow    = m_selectedTopLeft.GetRow();
-            *leftCol   = m_selectedTopLeft.GetCol();
-            *bottomRow = m_selectedBottomRight.GetRow();
-            *rightCol  = m_selectedBottomRight.GetCol();
-        }
-
 
     // This function returns the rectangle that encloses the block of cells
     // limited by TopLeft and BottomRight cell in device coords and clipped
@@ -1310,8 +1301,8 @@ public:
     //
     wxRect SelectionToDeviceRect()
         {
-            return BlockToDeviceRect( m_selectedTopLeft,
-                                      m_selectedBottomRight );
+            return BlockToDeviceRect( m_selectingTopLeft,
+                                      m_selectingBottomRight );
         }
 
     // Access or update the selection fore/back colours
@@ -1531,8 +1522,9 @@ protected:
 
     wxGridCellCoords m_currentCellCoords;
 
-    wxGridCellCoords m_selectedTopLeft;
-    wxGridCellCoords m_selectedBottomRight;
+    wxGridCellCoords m_selectingTopLeft;
+    wxGridCellCoords m_selectingBottomRight;
+    wxGridSelection  *m_selection;
     wxColour    m_selectionBackground;
     wxColour    m_selectionForeground;
 
@@ -1725,7 +1717,7 @@ protected:
     bool GetModelValues();
     bool SetModelValues();
 
-       friend class wxGridSelection;
+        friend class wxGridSelection;
 
     DECLARE_DYNAMIC_CLASS( wxGrid )
     DECLARE_EVENT_TABLE()
@@ -1898,4 +1890,3 @@ const wxEventType wxEVT_GRID_CHANGE_SEL_LABEL = wxEVT_FIRST + 1578;
 #endif  // #ifndef __WXGRID_H__
 
 #endif  // ifndef wxUSE_NEW_GRID
-