]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/grid.h
update docs after r66615
[wxWidgets.git] / interface / wx / grid.h
index 4fe31735bce87aa20a308679973f943be94c2b2c..90c5d9a3a5cc96dd5a18a395dd02b6c0fba452e1 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:     interface of wxGrid and related classes
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Purpose:     interface of wxGrid and related classes
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /**
 /////////////////////////////////////////////////////////////////////////////
 
 /**
@@ -496,13 +496,21 @@ public:
             If allowOthers is @true, the user can type a string not in choices
             array.
     */
             If allowOthers is @true, the user can type a string not in choices
             array.
     */
-    //@{
     wxGridCellChoiceEditor(size_t count = 0,
                            const wxString choices[] = NULL,
                            bool allowOthers = false);
     wxGridCellChoiceEditor(size_t count = 0,
                            const wxString choices[] = NULL,
                            bool allowOthers = false);
+
+    /**
+        Choice cell renderer ctor.
+
+        @param choices
+            An array of strings from which the user can choose.
+        @param allowOthers
+            If allowOthers is @true, the user can type a string not in choices
+            array.
+    */
     wxGridCellChoiceEditor(const wxArrayString& choices,
                            bool allowOthers = false);
     wxGridCellChoiceEditor(const wxArrayString& choices,
                            bool allowOthers = false);
-    //@}
 
     /**
         Parameters string format is "item1[,item2[...,itemN]]"
 
     /**
         Parameters string format is "item1[,item2[...,itemN]]"
@@ -1678,7 +1686,20 @@ public:
 
             The user won't be able to select any cells or rows in this mode.
          */
 
             The user won't be able to select any cells or rows in this mode.
          */
-        wxGridSelectColumns
+        wxGridSelectColumns,
+
+        /**
+            The selection mode allowing the user to select either the entire
+            columns or the entire rows but not individual cells nor blocks.
+
+            Notice that while this constant is defined as @code
+            wxGridSelectColumns | wxGridSelectRows @endcode this doesn't mean
+            that all the other combinations are valid -- at least currently
+            they are not.
+
+            @since 2.9.1
+         */
+        wxGridSelectRowsOrColumns
     };
 
     /**
     };
 
     /**
@@ -2014,10 +2035,18 @@ public:
         are using the grid to display tabular data and don't have thousands of
         columns in it.
 
         are using the grid to display tabular data and don't have thousands of
         columns in it.
 
-        Also note that currently @c wxEVT_GRID_LABEL_LEFT_DCLICK and
-        @c wxEVT_GRID_LABEL_RIGHT_DCLICK events are not generated for the column
-        labels if the native columns header is used (but this limitation could
-        possibly be lifted in the future).
+        Another difference between the default behaviour and the native header
+        behaviour is that the latter provides the user with a context menu
+        (which appears on right clicking the header) allowing to rearrange the
+        grid columns if CanDragColMove() returns @true. If you want to prevent
+        this from happening for some reason, you need to define a handler for
+        @c wxEVT_GRID_LABEL_RIGHT_CLICK event which simply does nothing (in
+        particular doesn't skip the event) as this will prevent the default
+        right click handling from working.
+
+        Also note that currently @c wxEVT_GRID_LABEL_RIGHT_DCLICK event is not
+        generated for the column labels if the native columns header is used
+        (but this limitation could possibly be lifted in the future).
      */
     void UseNativeColHeader(bool native = true);
 
      */
     void UseNativeColHeader(bool native = true);
 
@@ -3817,6 +3846,31 @@ public:
     */
     bool InsertRows(int pos = 0, int numRows = 1, bool updateLabels = true);
 
     */
     bool InsertRows(int pos = 0, int numRows = 1, bool updateLabels = true);
 
+    /**
+        Invalidates the cached attribute for the given cell.
+
+        For efficiency reasons, wxGrid may cache the recently used attributes
+        (currently it caches only the single most recently used one, in fact)
+        which can result in the cell appearance not being refreshed even when
+        the attribute returned by your custom wxGridCellAttrProvider-derived
+        class has changed. To force the grid to refresh the cell attribute,
+        this function may be used. Notice that calling it will not result in
+        actually redrawing the cell, you still need to call
+        wxWindow::RefreshRect() to invalidate the area occupied by the cell in
+        the window to do this. Also note that you don't need to call this
+        function if you store the attributes in wxGrid itself, i.e. use its
+        SetAttr() and similar methods, it is only useful when using a separate
+        custom attributes provider.
+
+        @param row
+            The row of the cell whose attribute needs to be queried again.
+        @param col
+            The column of the cell whose attribute needs to be queried again.
+
+        @since 2.9.2
+     */
+    void RefreshAttr(int row, int col);
+
     /**
         Sets the cell attributes for all cells in the specified column.
 
     /**
         Sets the cell attributes for all cells in the specified column.
 
@@ -4197,6 +4251,10 @@ public:
 
     /**
         Column at which the event occurred.
 
     /**
         Column at which the event occurred.
+
+        Notice that for a @c wxEVT_GRID_SELECT_CELL event this column is the
+        column of the newly selected cell while the previously selected cell
+        can be retrieved using wxGrid::GetGridCursorCol().
     */
     virtual int GetCol();
 
     */
     virtual int GetCol();
 
@@ -4207,6 +4265,10 @@ public:
 
     /**
         Row at which the event occurred.
 
     /**
         Row at which the event occurred.
+
+        Notice that for a @c wxEVT_GRID_SELECT_CELL event this row is the row
+        of the newly selected cell while the previously selected cell can be
+        retrieved using wxGrid::GetGridCursorRow().
     */
     virtual int GetRow();
 
     */
     virtual int GetRow();