]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/grid.h
list also wxSystemOptions next to wxSystemSettings
[wxWidgets.git] / interface / wx / grid.h
index bd4284dc55b02dd4509b8e71583f0bf7508b49de..763c62ecde01610a3c382553277b41a97a5629cd 100644 (file)
@@ -1,11 +1,75 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        grid.h
 /////////////////////////////////////////////////////////////////////////////
 // Name:        grid.h
-// Purpose:     interface of wxGridCellFloatRenderer
+// Purpose:     interface of wxGrid and related classes
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+/**
+    @class wxGridCellRenderer
+
+    This class is responsible for actually drawing the cell in the grid. You
+    may pass it to the wxGridCellAttr (below) to change the format of one given
+    cell or to wxGrid::SetDefaultRenderer() to change the view of all cells.
+    This is an abstract class, and you will normally use one of the predefined
+    derived classes or derive your own class from it.
+
+    @library{wxadv}
+    @category{grid}
+
+    @see wxGridCellBoolRenderer, wxGridCellFloatRenderer,
+         wxGridCellNumberRenderer, wxGridCellStringRenderer
+*/
+class wxGridCellRenderer
+{
+public:
+    /**
+        This function must be implemented in derived classes to return a copy
+        of itself.
+    */
+    virtual wxGridCellRenderer* Clone() const = 0;
+
+    /**
+        Draw the given cell on the provided DC inside the given rectangle using
+        the style specified by the attribute and the default or selected state
+        corresponding to the isSelected value.
+
+        This pure virtual function has a default implementation which will
+        prepare the DC using the given attribute: it will draw the rectangle
+        with the background colour from attr and set the text colour and font.
+    */
+    virtual void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
+                      const wxRect& rect, int row, int col,
+                      bool isSelected) = 0;
+
+    /**
+        Get the preferred size of the cell for its contents.
+    */
+    virtual wxSize GetBestSize(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
+                               int row, int col) = 0;
+};
+
+/**
+    @class wxGridCellBoolRenderer
+
+    This class may be used to format boolean data in a cell.
+
+    @library{wxadv}
+    @category{grid}
+
+    @see wxGridCellRenderer, wxGridCellFloatRenderer, wxGridCellNumberRenderer,
+         wxGridCellStringRenderer
+*/
+class wxGridCellBoolRenderer : public wxGridCellRenderer
+{
+public:
+    /**
+        Default constructor.
+    */
+    wxGridCellBoolRenderer();
+};
+
 /**
     @class wxGridCellFloatRenderer
 
 /**
     @class wxGridCellFloatRenderer
 
@@ -14,8 +78,8 @@
     @library{wxadv}
     @category{grid}
 
     @library{wxadv}
     @category{grid}
 
-    @see wxGridCellRenderer, wxGridCellNumberRenderer, wxGridCellStringRenderer,
-    wxGridCellBoolRenderer
+    @see wxGridCellRenderer, wxGridCellBoolRenderer, wxGridCellNumberRenderer,
+         wxGridCellStringRenderer
 */
 class wxGridCellFloatRenderer : public wxGridCellStringRenderer
 {
 */
 class wxGridCellFloatRenderer : public wxGridCellStringRenderer
 {
@@ -54,1165 +118,914 @@ public:
     void SetWidth(int width);
 };
 
     void SetWidth(int width);
 };
 
-
-
 /**
 /**
-    @class wxGridTableBase
+    @class wxGridCellNumberRenderer
 
 
-    The almost abstract base class for grid tables.
+    This class may be used to format integer data in a cell.
 
 
-    A grid table is responsible for storing the grid data and, indirectly, grid
-    cell attributes. The data can be stored in the way most convenient for the
-    application but has to be provided in string form to wxGrid. It is also
-    possible to provide cells values in other formats if appropriate, e.g. as
-    numbers.
+    @library{wxadv}
+    @category{grid}
 
 
-    This base class is not quite abstract as it implements a trivial strategy
-    for storing the attributes by forwarding it to wxGridCellAttrProvider and
-    also provides stubs for some other functions. However it does have a number
-    of pure virtual methods which must be implemented in the derived classes.
+    @see wxGridCellRenderer, wxGridCellBoolRenderer, wxGridCellFloatRenderer,
+         wxGridCellStringRenderer
+*/
+class wxGridCellNumberRenderer : public wxGridCellStringRenderer
+{
+public:
+    /**
+        Default constructor.
+    */
+    wxGridCellNumberRenderer();
+};
 
 
-    @see wxGridStringTable
+/**
+    @class wxGridCellStringRenderer
+
+    This class may be used to format string data in a cell; it is the default
+    for string cells.
 
     @library{wxadv}
     @category{grid}
 
     @library{wxadv}
     @category{grid}
+
+    @see wxGridCellRenderer, wxGridCellBoolRenderer, wxGridCellFloatRenderer,
+         wxGridCellNumberRenderer
 */
 */
-class wxGridTableBase : public wxObject
+class wxGridCellStringRenderer : public wxGridCellRenderer
 {
 public:
 {
 public:
-    /// Default constructor.
-    wxGridTableBase();
+    /**
+        Default constructor.
+    */
+    wxGridCellStringRenderer();
+};
 
 
-    /// Destructor frees the attribute provider if it was created.
-    virtual ~wxGridTableBase();
 
 
-    /**
-        Must be overridden to return the number of rows in the table.
 
 
-        For backwards compatibility reasons, this method is not const.
-        Use GetRowsCount() instead of it in const methods of derived table
-        classes.
-     */
-    virtual int GetNumberRows() = 0;
+/**
+    @class wxGridCellEditor
 
 
-    /**
-        Must be overridden to return the number of columns in the table.
+    This class is responsible for providing and manipulating the in-place edit
+    controls for the grid.  Instances of wxGridCellEditor (actually, instances
+    of derived classes since it is an abstract class) can be associated with
+    the cell attributes for individual cells, rows, columns, or even for the
+    entire grid.
 
 
-        For backwards compatibility reasons, this method is not const.
-        Use GetColsCount() instead of it in const methods of derived table
-        classes,
-     */
-    virtual int GetNumberCols() = 0;
+    @library{wxadv}
+    @category{grid}
 
 
+    @see wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellFloatEditor,
+         wxGridCellNumberEditor, wxGridCellTextEditor
+*/
+class wxGridCellEditor
+{
+public:
     /**
     /**
-        Return the number of rows in the table.
-
-        This method is not virtual and is only provided as a convenience for
-        the derived classes which can't call GetNumberRows() without a @c
-        const_cast from their const methods.
-     */
-    int GetRowsCount() const;
+        Default constructor.
+    */
+    wxGridCellEditor();
 
     /**
 
     /**
-        Return the number of columns in the table.
+        Fetch the value from the table and prepare the edit control to begin
+        editing.
 
 
-        This method is not virtual and is only provided as a convenience for
-        the derived classes which can't call GetNumberCols() without a @c
-        const_cast from their const methods.
-     */
-    int GetColsCount() const;
+        This function should save the original value of the grid cell at the
+        given @a row and @a col and show the control allowing the user to
+        change it.
 
 
+        @see EndEdit()
+    */
+    virtual void BeginEdit(int row, int col, wxGrid* grid) = 0;
 
     /**
 
     /**
-        Accessing table cells.
-     */
-    //@{
+        Create a new object which is the copy of this one.
+    */
+    virtual wxGridCellEditor* Clone() const = 0;
 
 
-    /// Must be overridden to implement testing for empty cells.
-    virtual bool IsEmptyCell(int row, int col) = 0;
+    /**
+        Creates the actual edit control.
+    */
+    virtual void Create(wxWindow* parent, wxWindowID id,
+                        wxEvtHandler* evtHandler) = 0;
 
     /**
 
     /**
-        Same as IsEmptyCell() but taking wxGridCellCoords.
+        Final cleanup.
+    */
+    virtual void Destroy();
 
 
-        Notice that this method is not virtual, only IsEmptyCell() should be
-        overridden.
-     */
-    bool IsEmpty(const wxGridCellCoords& coords);
+    /**
+        End editing the cell.
 
 
-    /// Must be overridden to implement accessing the table values as text.
-    virtual wxString GetValue(int row, int col) = 0;
+        This function must check if the current value of the editing control is
+        valid and different from the original value (available as @a oldval in
+        its string form and possibly saved internally using its real type by
+        BeginEdit()). If it isn't, it just returns @false, otherwise it fills
+        @a newval with the representation of the new value in the string form,
+        if necessary saves it using its real type internally, and returns @true.
 
 
-    /// Must be overridden to implement setting the table values as text.
-    virtual void SetValue(int row, int col, const wxString& value) = 0;
+        If the user-defined wxEVT_GRID_CELL_CHANGING event handler doesn't veto
+        this change, ApplyEdit() will be called next.
+    */
+    virtual bool EndEdit(int row, int col, wxGrid* grid) = 0;
 
     /**
 
     /**
-        Returns the type of the value in the given cell.
+        Effectively save the changes in the grid.
 
 
-        By default all cells are strings and this method returns @c
-        wxGRID_VALUE_STRING.
+        This function should save the value of the control in the grid. It is
+        called only after EndEdit() returns @true.
      */
      */
-    virtual wxString GetTypeName(int row, int col);
+    virtual void ApplyEdit(int row, int col, wxGrid* grid) = 0;
 
     /**
 
     /**
-        Returns true if the value of the given cell can be accessed as if it
-        were of the specified type.
-
-        By default the cells can only be accessed as strings. Note that a cell
-        could be accessible in different ways, e.g. a numeric cell may return
-        @true for @c wxGRID_VALUE_NUMBER but also for @c wxGRID_VALUE_STRING
-        indicating that the value can be coerced to a string form.
-     */
-    virtual bool CanGetValueAs(int row, int col, const wxString& typeName);
+        Some types of controls on some platforms may need some help with the
+        Return key.
+    */
+    virtual void HandleReturn(wxKeyEvent& event);
 
     /**
 
     /**
-        Returns true if the value of the given cell can be set as if it were of
-        the specified type.
-
-        @see CanGetValueAs()
-     */
-    virtual bool CanSetValueAs(int row, int col, const wxString& typeName);
+        Returns @true if the edit control has been created.
+    */
+    bool IsCreated();
 
     /**
 
     /**
-        Returns the value of the given cell as a long.
-
-        This should only be called if CanGetValueAs() returns @true when called
-        with @c wxGRID_VALUE_NUMBER argument. Default implementation always
-        return 0.
-     */
-    virtual long GetValueAsLong(int row, int col);
+        Draws the part of the cell not occupied by the control: the base class
+        version just fills it with background colour from the attribute.
+    */
+    virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr* attr);
 
     /**
 
     /**
-        Returns the value of the given cell as a double.
-
-        This should only be called if CanGetValueAs() returns @true when called
-        with @c wxGRID_VALUE_FLOAT argument. Default implementation always
-        return 0.0.
-     */
-    virtual double GetValueAsDouble(int row, int col);
+        Reset the value in the control back to its starting value.
+    */
+    virtual void Reset() = 0;
 
     /**
 
     /**
-        Returns the value of the given cell as a boolean.
+        Size and position the edit control.
+    */
+    virtual void SetSize(const wxRect& rect);
 
 
-        This should only be called if CanGetValueAs() returns @true when called
-        with @c wxGRID_VALUE_BOOL argument. Default implementation always
-        return false.
-     */
-    virtual bool GetValueAsBool(int row, int col);
+    /**
+        Show or hide the edit control, use the specified attributes to set
+        colours/fonts for it.
+    */
+    virtual void Show(bool show, wxGridCellAttr* attr = NULL);
 
     /**
 
     /**
-        Returns the value of the given cell as a user-defined type.
+        If the editor is enabled by clicking on the cell, this method will be
+        called.
+    */
+    virtual void StartingClick();
 
 
-        This should only be called if CanGetValueAs() returns @true when called
-        with @a typeName. Default implementation always return @NULL.
-     */
-    virtual void *GetValueAsCustom(int row, int col, const wxString& typeName);
+    /**
+        If the editor is enabled by pressing keys on the grid, this will be
+        called to let the editor do something about that first key if desired.
+    */
+    virtual void StartingKey(wxKeyEvent& event);
 
 
+protected:
 
     /**
 
     /**
-        Sets the value of the given cell as a long.
+        The destructor is private because only DecRef() can delete us.
+    */
+    virtual ~wxGridCellEditor();
+};
 
 
-        This should only be called if CanSetValueAs() returns @true when called
-        with @c wxGRID_VALUE_NUMBER argument. Default implementation doesn't do
-        anything.
-     */
-    virtual void SetValueAsLong(int row, int col, long value);
+/**
+    @class wxGridCellBoolEditor
 
 
-    /**
-        Sets the value of the given cell as a double.
+    Grid cell editor for boolean data.
 
 
-        This should only be called if CanSetValueAs() returns @true when called
-        with @c wxGRID_VALUE_FLOAT argument. Default implementation doesn't do
-        anything.
-     */
-    virtual void SetValueAsDouble(int row, int col, double value);
+    @library{wxadv}
+    @category{grid}
 
 
+    @see wxGridCellEditor, wxGridCellChoiceEditor, wxGridCellFloatEditor,
+         wxGridCellNumberEditor, wxGridCellTextEditor
+*/
+class wxGridCellBoolEditor : public wxGridCellEditor
+{
+public:
     /**
     /**
-        Sets the value of the given cell as a boolean.
-
-        This should only be called if CanSetValueAs() returns @true when called
-        with @c wxGRID_VALUE_BOOL argument. Default implementation doesn't do
-        anything.
-     */
-    virtual void SetValueAsBool( int row, int col, bool value );
+        Default constructor.
+    */
+    wxGridCellBoolEditor();
 
     /**
 
     /**
-        Sets the value of the given cell as a user-defined type.
+        Returns @true if the given @a value is equal to the string
+        representation of the truth value we currently use (see
+        UseStringValues()).
+    */
+    static bool IsTrueValue(const wxString& value);
 
 
-        This should only be called if CanSetValueAs() returns @true when called
-        with @a typeName. Default implementation doesn't do anything.
-     */
-    virtual void SetValueAsCustom(int row, int col, const wxString& typeName,
-                                  void *value);
+    /**
+        This method allows you to customize the values returned by GetValue()
+        for the cell using this editor. By default, the default values of the
+        arguments are used, i.e. @c "1" is returned if the cell is checked and
+        an empty string otherwise.
+    */
+    static void UseStringValues(const wxString& valueTrue = "1",
+                                const wxString& valueFalse = wxEmptyString) const;
+};
 
 
-    //@}
+/**
+    @class wxGridCellChoiceEditor
 
 
-    /**
-        Called by the grid when the table is associated with it.
+    Grid cell editor for string data providing the user a choice from a list of
+    strings.
 
 
-        The default implementation stores the pointer and returns it from its
-        GetView() and so only makes sense if the table cannot be associated
-        with more than one grid at a time.
-     */
-    virtual void SetView(wxGrid *grid);
-
-    /**
-        Returns the last grid passed to SetView().
-     */
-    virtual wxGrid *GetView() const;
-
-
-    /**
-        Modifying the table structure.
-
-        Notice that none of these functions are pure virtual as they don't have
-        to be implemented if the table structure is never modified after
-        creation, i.e. neither rows nor columns are never added or deleted but
-        that you do need to implement them if they are called, i.e. if your
-        code either calls them directly or uses the matching wxGrid methods, as
-        by default they simply do nothing which is definitely inappropriate.
-     */
-    //@{
-
-    /**
-        Clear the table contents.
-
-        This method is used by wxGrid::ClearGrid().
-     */
-    virtual void Clear();
+    @library{wxadv}
+    @category{grid}
 
 
+    @see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellFloatEditor,
+         wxGridCellNumberEditor, wxGridCellTextEditor
+*/
+class wxGridCellChoiceEditor : public wxGridCellEditor
+{
+public:
     /**
     /**
-        Insert additional rows into the table.
-
-        @param pos
-            The position of the first new row.
-        @param numRows
-            The number of rows to insert.
-     */
-    virtual bool InsertRows(size_t pos = 0, size_t numRows = 1);
-
+        @param count
+            Number of strings from which the user can choose.
+        @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(size_t count = 0,
+                           const wxString choices[] = NULL,
+                           bool allowOthers = false);
     /**
     /**
-        Append additional rows at the end of the table.
-
-        This method is provided in addition to InsertRows() as some data models
-        may only support appending rows to them but not inserting them at
-        arbitrary locations. In such case you may implement this method only
-        and leave InsertRows() unimplemented.
-
-        @param pos
-            The position of the first new row.
-        @param numRows
-            The number of rows to add.
-     */
-    virtual bool AppendRows(size_t numRows = 1);
+        @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);
 
     /**
 
     /**
-        Delete rows from the table.
-
-        @param pos
-            The first row to delete.
-        @param numRows
-            The number of rows to delete.
-     */
-    virtual bool DeleteRows(size_t pos = 0, size_t numRows = 1);
-
-    /// Exactly the same as InsertRows() but for columns.
-    virtual bool InsertCols(size_t pos = 0, size_t numCols = 1);
+        Parameters string format is "item1[,item2[...,itemN]]"
+    */
+    virtual void SetParameters(const wxString& params);
+};
 
 
-    /// Exactly the same as AppendRows() but for columns.
-    virtual bool AppendCols(size_t numCols = 1);
+/**
+    @class wxGridCellTextEditor
 
 
-    /// Exactly the same as DeleteRows() but for columns.
-    virtual bool DeleteCols(size_t pos = 0, size_t numCols = 1);
+    Grid cell editor for string/text data.
 
 
-    //@}
+    @library{wxadv}
+    @category{grid}
 
 
+    @see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor,
+         wxGridCellFloatEditor, wxGridCellNumberEditor
+*/
+class wxGridCellTextEditor : public wxGridCellEditor
+{
+public:
     /**
     /**
-        Table rows and columns labels.
-
-        By default the numbers are used for labeling rows and Latin letters for
-        labeling columns. If the table has more than 26 columns, the pairs of
-        letters are used starting from the 27-th one and so on, i.e. the
-        sequence of labels is A, B, ..., Z, AA, AB, ..., AZ, BA, ..., ..., ZZ,
-        AAA, ...
-     */
-    //@{
-
-    /// Return the label of the specified row.
-    virtual wxString GetRowLabelValue(int row);
-
-    /// Return the label of the specified column.
-    virtual wxString GetColLabelValue(int col);
+        Default constructor.
+    */
+    wxGridCellTextEditor();
 
     /**
 
     /**
-        Set the given label for the specified row.
-
-        The default version does nothing, i.e. the label is not stored. You
-        must override this method in your derived class if you wish
-        wxGrid::SetRowLabelValue() to work.
-     */
-    virtual void SetRowLabelValue(int row, const wxString& label);
-
-    /// Exactly the same as SetRowLabelValue() but for columns.
-    virtual void SetColLabelValue(int col, const wxString& label);
-
-    //@}
+        The parameters string format is "n" where n is a number representing
+        the maximum width.
+    */
+    virtual void SetParameters(const wxString& params);
+};
 
 
+/**
+    @class wxGridCellFloatEditor
 
 
-    /**
-        Attributes management.
+    The editor for floating point numbers data.
 
 
-        By default the attributes management is delegated to
-        wxGridCellAttrProvider class. You may override the methods in this
-        section to handle the attributes directly if, for example, they can be
-        computed from the cell values.
-     */
-    //@{
+    @library{wxadv}
+    @category{grid}
 
 
+    @see wxGridCellEditor, wxGridCellNumberEditor, wxGridCellBoolEditor,
+    wxGridCellTextEditor, wxGridCellChoiceEditor
+*/
+class wxGridCellFloatEditor : public wxGridCellTextEditor
+{
+public:
     /**
     /**
-        Associate this attributes provider with the table.
-
-        The table takes ownership of @a attrProvider pointer and will delete it
-        when it doesn't need it any more. The pointer can be @NULL, however
-        this won't disable attributes management in the table but will just
-        result in a default attributes being recreated the next time any of the
-        other functions in this section is called. To completely disable the
-        attributes support, should this be needed, you need to override
-        CanHaveAttributes() to return @false.
-     */
-    void SetAttrProvider(wxGridCellAttrProvider *attrProvider);
+        @param width
+            Minimum number of characters to be shown.
+        @param precision
+            Number of digits after the decimal dot.
+    */
+    wxGridCellFloatEditor(int width = -1, int precision = -1);
 
     /**
 
     /**
-        Returns the attribute provider currently being used.
+        Parameters string format is "width,precision"
+    */
+    virtual void SetParameters(const wxString& params);
+};
 
 
-        This function may return @NULL if the attribute provider hasn't been
-        neither associated with this table by SetAttrProvider() nor created on
-        demand by any other methods.
-     */
-    wxGridCellAttrProvider *GetAttrProvider() const { return m_attrProvider; }
+/**
+    @class wxGridCellNumberEditor
 
 
-    /**
-        Returns true if this table supports attributes or false otherwise.
+    Grid cell editor for numeric integer data.
 
 
-        By default, the table automatically creates a wxGridCellAttrProvider
-        when this function is called if it had no attribute provider before and
-        returns @true.
-     */
-    virtual bool CanHaveAttributes();
+    @library{wxadv}
+    @category{grid}
 
 
+    @see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor,
+         wxGridCellFloatEditor, wxGridCellTextEditor
+*/
+class wxGridCellNumberEditor : public wxGridCellTextEditor
+{
+public:
     /**
     /**
-        Return the attribute for the given cell.
+        Allows you to specify the range for acceptable data. Values equal to
+        -1 for both @a min and @a max indicate that no range checking should be
+        done.
+    */
+    wxGridCellNumberEditor(int min = -1, int max = -1);
 
 
-        By default this function is simply forwarded to
-        wxGridCellAttrProvider::GetAttr() but it may be overridden to handle
-        attributes directly in the table.
-     */
-    virtual wxGridCellAttr *GetAttr(int row, int col,
-                                    wxGridCellAttr::wxAttrKind kind);
 
     /**
 
     /**
-        Set attribute of the specified cell.
-
-        By default this function is simply forwarded to
-        wxGridCellAttrProvider::SetAttr().
+        Parameters string format is "min,max".
+    */
+    virtual void SetParameters(const wxString& params);
 
 
-        The table takes ownership of @a attr, i.e. will call DecRef() on it.
-     */
-    virtual void SetAttr(wxGridCellAttr* attr, int row, int col);
+protected:
 
     /**
 
     /**
-        Set attribute of the specified row.
-
-        By default this function is simply forwarded to
-        wxGridCellAttrProvider::SetRowAttr().
-
-        The table takes ownership of @a attr, i.e. will call DecRef() on it.
-     */
-    virtual void SetRowAttr(wxGridCellAttr *attr, int row);
+        If the return value is @true, the editor uses a wxSpinCtrl to get user
+        input, otherwise it uses a wxTextCtrl.
+    */
+    bool HasRange() const;
 
     /**
 
     /**
-        Set attribute of the specified column.
-
-        By default this function is simply forwarded to
-        wxGridCellAttrProvider::SetColAttr().
-
-        The table takes ownership of @a attr, i.e. will call DecRef() on it.
-     */
-    virtual void SetColAttr(wxGridCellAttr *attr, int col);
-
-    //@}
+        String representation of the value.
+    */
+    wxString GetString() const;
 };
 
 
 
 /**
 };
 
 
 
 /**
-    @class wxGridCellEditor
+    @class wxGridCellAttr
 
 
-    This class is responsible for providing and manipulating
-    the in-place edit controls for the grid.  Instances of wxGridCellEditor
-    (actually, instances of derived classes since it is an abstract class) can be
-    associated with the cell attributes for individual cells, rows, columns, or
-    even for the entire grid.
+    This class can be used to alter the cells' appearance in the grid by
+    changing their attributes from the defaults. An object of this class may be
+    returned by wxGridTableBase::GetAttr().
 
     @library{wxadv}
     @category{grid}
 
     @library{wxadv}
     @category{grid}
-
-    @see wxGridCellTextEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
-    wxGridCellNumberEditor, wxGridCellChoiceEditor
 */
 */
-class wxGridCellEditor
+class wxGridCellAttr
 {
 public:
     /**
 {
 public:
     /**
-
+        Default constructor.
     */
     */
-    wxGridCellEditor();
-
+    wxGridCellAttr();
     /**
     /**
-        The dtor is private because only DecRef() can delete us.
+        Constructor specifying some of the often used attributes.
     */
     */
-    virtual ~wxGridCellEditor();
+    wxGridCellAttr(const wxColour& colText, const wxColour& colBack,
+                   const wxFont& font, int hAlign, int vAlign);
 
     /**
 
     /**
-        Fetch the value from the table and prepare the edit control
-        to begin editing. Set the focus to the edit control.
+        Creates a new copy of this object.
     */
     */
-    void BeginEdit(int row, int col, wxGrid* grid);
+    wxGridCellAttr* Clone() const;
 
     /**
 
     /**
-        Create a new object which is the copy of this one.
+        This class is reference counted: it is created with ref count of 1, so
+        calling DecRef() once will delete it. Calling IncRef() allows to lock
+        it until the matching DecRef() is called.
     */
     */
-    wxGridCellEditor* Clone() const;
+    void DecRef();
 
     /**
 
     /**
-        Creates the actual edit control.
+        See SetAlignment() for the returned values.
     */
     */
-    void Create(wxWindow* parent, wxWindowID id,
-                wxEvtHandler* evtHandler);
+    void GetAlignment(int* hAlign, int* vAlign) const;
 
     /**
 
     /**
-        Final cleanup.
+        Returns the background colour.
     */
     */
-    virtual void Destroy();
+    const wxColour& GetBackgroundColour() const;
 
     /**
 
     /**
-        Complete the editing of the current cell. Returns @true if the value has
-        changed. If necessary, the control may be destroyed.
+        Returns the cell editor.
     */
     */
-    bool EndEdit(int row, int col, wxGrid* grid);
+    wxGridCellEditor* GetEditor(const wxGrid* grid, int row, int col) const;
 
     /**
 
     /**
-        Some types of controls on some platforms may need some help
-        with the Return key.
+        Returns the font.
     */
     */
-    virtual void HandleReturn(wxKeyEvent& event);
+    const wxFont& GetFont() const;
 
     /**
 
     /**
-
+        Returns the cell renderer.
     */
     */
-    bool IsCreated();
+    wxGridCellRenderer* GetRenderer(const wxGrid* grid, int row, int col) const;
 
     /**
 
     /**
-        Draws the part of the cell not occupied by the control: the base class
-        version just fills it with background colour from the attribute.
+        Returns the text colour.
     */
     */
-    void PaintBackground(const wxRect& rectCell,
-                         wxGridCellAttr* attr);
+    const wxColour& GetTextColour() const;
 
     /**
 
     /**
-        Reset the value in the control back to its starting value.
+        Returns @true if this attribute has a valid alignment set.
     */
     */
-    void Reset();
+    bool HasAlignment() const;
 
     /**
 
     /**
-        Size and position the edit control.
-    */
-    virtual void SetSize(const wxRect& rect);
-
-    /**
-        Show or hide the edit control, use the specified attributes to set
-        colours/fonts for it.
+        Returns @true if this attribute has a valid background colour set.
     */
     */
-    virtual void Show(bool show, wxGridCellAttr* attr = NULL);
+    bool HasBackgroundColour() const;
 
     /**
 
     /**
-        If the editor is enabled by clicking on the cell, this method will be
-        called.
+        Returns @true if this attribute has a valid cell editor set.
     */
     */
-    virtual void StartingClick();
+    bool HasEditor() const;
 
     /**
 
     /**
-        If the editor is enabled by pressing keys on the grid,
-        this will be called to let the editor do something about
-        that first key if desired.
+        Returns @true if this attribute has a valid font set.
     */
     */
-    virtual void StartingKey(wxKeyEvent& event);
-};
-
-
-
-/**
-    @class wxGridCellTextEditor
-
-    The editor for string/text data.
-
-    @library{wxadv}
-    @category{grid}
+    bool HasFont() const;
 
 
-    @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
-    wxGridCellNumberEditor, wxGridCellChoiceEditor
-*/
-class wxGridCellTextEditor : public wxGridCellEditor
-{
-public:
     /**
     /**
-        Default constructor.
+        Returns @true if this attribute has a valid cell renderer set.
     */
     */
-    wxGridCellTextEditor();
+    bool HasRenderer() const;
 
     /**
 
     /**
-        The parameters string format is "n" where n is a number representing the
-        maximum width.
+        Returns @true if this attribute has a valid text colour set.
     */
     */
-    virtual void SetParameters(const wxString& params);
-};
-
-
-
-/**
-    @class wxGridCellStringRenderer
-
-    This class may be used to format string data in a cell; it is the default
-    for string cells.
-
-    @library{wxadv}
-    @category{grid}
+    bool HasTextColour() const;
 
 
-    @see wxGridCellRenderer, wxGridCellNumberRenderer, wxGridCellFloatRenderer,
-    wxGridCellBoolRenderer
-*/
-class wxGridCellStringRenderer : public wxGridCellRenderer
-{
-public:
     /**
     /**
-        Default constructor
+        This class is reference counted: it is created with ref count of 1, so
+        calling DecRef() once will delete it. Calling IncRef() allows to lock
+        it until the matching DecRef() is called.
     */
     */
-    wxGridCellStringRenderer();
-};
-
-
-
-/**
-    @class wxGridCellChoiceEditor
-
-    The editor for string data allowing to choose from a list of strings.
-
-    @library{wxadv}
-    @category{grid}
+    void IncRef();
 
 
-    @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
-    wxGridCellTextEditor, wxGridCellNumberEditor
-*/
-class wxGridCellChoiceEditor : public wxGridCellEditor
-{
-public:
-    //@{
     /**
     /**
-        @param count
-            Number of strings from which the user can choose.
-        @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.
+        Returns @true if this cell is set as read-only.
     */
     */
-    wxGridCellChoiceEditor(size_t count = 0,
-                           const wxString choices[] = NULL,
-                           bool allowOthers = false);
-    wxGridCellChoiceEditor(const wxArrayString& choices,
-                           bool allowOthers = false);
-    //@}
+    bool IsReadOnly() const;
 
     /**
 
     /**
-        Parameters string format is "item1[,item2[...,itemN]]"
+        Sets the alignment. @a hAlign can be one of @c wxALIGN_LEFT,
+        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT and @a vAlign can be one of
+        @c wxALIGN_TOP, @c wxALIGN_CENTRE or @c wxALIGN_BOTTOM.
     */
     */
-    virtual void SetParameters(const wxString& params);
-};
-
-
-
-/**
-    @class wxGridEditorCreatedEvent
-
+    void SetAlignment(int hAlign, int vAlign);
 
 
-    @library{wxadv}
-    @category{grid}
-*/
-class wxGridEditorCreatedEvent : public wxCommandEvent
-{
-public:
-    //@{
     /**
     /**
-
+        Sets the background colour.
     */
     */
-    wxGridEditorCreatedEvent();
-    wxGridEditorCreatedEvent(int id, wxEventType type,
-                             wxObject* obj,
-                             int row,
-                             int col,
-                             wxControl* ctrl);
-    //@}
+    void SetBackgroundColour(const wxColour& colBack);
 
     /**
 
     /**
-        Returns the column at which the event occurred.
+        @todo Needs documentation.
     */
     */
-    int GetCol();
+    void SetDefAttr(wxGridCellAttr* defAttr);
 
     /**
 
     /**
-        Returns the edit control.
+        Sets the editor to be used with the cells with this attribute.
     */
     */
-    wxControl* GetControl();
+    void SetEditor(wxGridCellEditor* editor);
 
     /**
 
     /**
-        Returns the row at which the event occurred.
+        Sets the font.
     */
     */
-    int GetRow();
+    void SetFont(const wxFont& font);
 
     /**
 
     /**
-        Sets the column at which the event occurred.
+        Sets the cell as read-only.
     */
     */
-    void SetCol(int col);
+    void SetReadOnly(bool isReadOnly = true);
 
     /**
 
     /**
-        Sets the edit control.
+        Sets the renderer to be used for cells with this attribute. Takes
+        ownership of the pointer.
     */
     */
-    void SetControl(wxControl* ctrl);
+    void SetRenderer(wxGridCellRenderer* renderer);
 
     /**
 
     /**
-        Sets the row at which the event occurred.
+        Sets the text colour.
     */
     */
-    void SetRow(int row);
+    void SetTextColour(const wxColour& colText);
 };
 
 
 
 /**
 };
 
 
 
 /**
-    @class wxGridRangeSelectEvent
+    @class wxGridTableBase
+
+    The almost abstract base class for grid tables.
+
+    A grid table is responsible for storing the grid data and, indirectly, grid
+    cell attributes. The data can be stored in the way most convenient for the
+    application but has to be provided in string form to wxGrid. It is also
+    possible to provide cells values in other formats if appropriate, e.g. as
+    numbers.
+
+    This base class is not quite abstract as it implements a trivial strategy
+    for storing the attributes by forwarding it to wxGridCellAttrProvider and
+    also provides stubs for some other functions. However it does have a number
+    of pure virtual methods which must be implemented in the derived classes.
 
 
+    @see wxGridStringTable
 
     @library{wxadv}
     @category{grid}
 */
 
     @library{wxadv}
     @category{grid}
 */
-class wxGridRangeSelectEvent : public wxNotifyEvent
+class wxGridTableBase : public wxObject
 {
 public:
 {
 public:
-    //@{
     /**
     /**
-
-    */
-    wxGridRangeSelectEvent();
-    wxGridRangeSelectEvent(int id, wxEventType type,
-                           wxObject* obj,
-                           const wxGridCellCoords& topLeft,
-                           const wxGridCellCoords& bottomRight,
-                           bool sel = true,
-                           bool control = false,
-                           bool shift = false,
-                           bool alt = false,
-                           bool meta = false);
-    //@}
+        Default constructor.
+     */
+    wxGridTableBase();
 
     /**
 
     /**
-        Returns @true if the Alt key was down at the time of the event.
-    */
-    bool AltDown() const;
+        Destructor frees the attribute provider if it was created.
+     */
+    virtual ~wxGridTableBase();
 
     /**
 
     /**
-        Returns @true if the Control key was down at the time of the event.
-    */
-    bool ControlDown() const;
+        Must be overridden to return the number of rows in the table.
 
 
-    /**
-        Top left corner of the rectangular area that was (de)selected.
-    */
-    wxGridCellCoords GetBottomRightCoords();
+        For backwards compatibility reasons, this method is not const.
+        Use GetRowsCount() instead of it in const methods of derived table
+        classes.
+     */
+    virtual int GetNumberRows() = 0;
 
     /**
 
     /**
-        Bottom row of the rectangular area that was (de)selected.
-    */
-    int GetBottomRow();
+        Must be overridden to return the number of columns in the table.
 
 
-    /**
-        Left column of the rectangular area that was (de)selected.
-    */
-    int GetLeftCol();
+        For backwards compatibility reasons, this method is not const.
+        Use GetColsCount() instead of it in const methods of derived table
+        classes,
+     */
+    virtual int GetNumberCols() = 0;
 
     /**
 
     /**
-        Right column of the rectangular area that was (de)selected.
-    */
-    int GetRightCol();
+        Return the number of rows in the table.
 
 
-    /**
-        Top left corner of the rectangular area that was (de)selected.
-    */
-    wxGridCellCoords GetTopLeftCoords();
+        This method is not virtual and is only provided as a convenience for
+        the derived classes which can't call GetNumberRows() without a
+        @c const_cast from their const methods.
+     */
+    int GetRowsCount() const;
 
     /**
 
     /**
-        Top row of the rectangular area that was (de)selected.
-    */
-    int GetTopRow();
+        Return the number of columns in the table.
 
 
-    /**
-        Returns @true if the Meta key was down at the time of the event.
-    */
-    bool MetaDown() const;
+        This method is not virtual and is only provided as a convenience for
+        the derived classes which can't call GetNumberCols() without a
+        @c const_cast from their const methods.
+     */
+    int GetColsCount() const;
 
 
-    /**
-        Returns @true if the area was selected, @false otherwise.
-    */
-    bool Selecting();
 
     /**
 
     /**
-        Returns @true if the Shift key was down at the time of the event.
-    */
-    bool ShiftDown() const;
-};
-
-
-
-/**
-    @class wxGridCellRenderer
+        @name Table Cell Accessors
+     */
+    //@{
 
 
-    This class is responsible for actually drawing the cell
-    in the grid. You may pass it to the wxGridCellAttr (below) to change the
-    format of one given cell or to wxGrid::SetDefaultRenderer() to change the
-    view of all cells. This is an abstract class, and you will normally use one of
-    the
-    predefined derived classes or derive your own class from it.
+    /**
+        May be overridden to implement testing for empty cells.
 
 
-    @library{wxadv}
-    @category{grid}
+        This method is used by the grid to test if the given cell is not used
+        and so whether a neighbouring cell may overflow into it. By default it
+        only returns true if the value of the given cell, as returned by
+        GetValue(), is empty.
+     */
+    virtual bool IsEmptyCell(int row, int col);
 
 
-    @see wxGridCellStringRenderer, wxGridCellNumberRenderer,
-    wxGridCellFloatRenderer, wxGridCellBoolRenderer
-*/
-class wxGridCellRenderer
-{
-public:
     /**
     /**
+        Same as IsEmptyCell() but taking wxGridCellCoords.
 
 
-    */
-    wxGridCellRenderer* Clone() const;
+        Notice that this method is not virtual, only IsEmptyCell() should be
+        overridden.
+     */
+    bool IsEmpty(const wxGridCellCoords& coords);
 
     /**
 
     /**
-        Draw the given cell on the provided DC inside the given rectangle
-        using the style specified by the attribute and the default or selected
-        state corresponding to the isSelected value.
-        This pure virtual function has a default implementation which will
-        prepare the DC using the given attribute: it will draw the rectangle
-        with the background colour from attr and set the text colour and font.
-    */
-    void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
-              const wxRect& rect, int row, int col,
-              bool isSelected);
+        Must be overridden to implement accessing the table values as text.
+     */
+    virtual wxString GetValue(int row, int col) = 0;
 
     /**
 
     /**
-        Get the preferred size of the cell for its contents.
-    */
-    wxSize GetBestSize(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
-                       int row, int col);
-};
+        Must be overridden to implement setting the table values as text.
+     */
+    virtual void SetValue(int row, int col, const wxString& value) = 0;
 
 
+    /**
+        Returns the type of the value in the given cell.
 
 
+        By default all cells are strings and this method returns
+        @c wxGRID_VALUE_STRING.
+     */
+    virtual wxString GetTypeName(int row, int col);
 
 
-/**
-    @class wxGridCellNumberEditor
+    /**
+        Returns true if the value of the given cell can be accessed as if it
+        were of the specified type.
 
 
-    The editor for numeric integer data.
-
-    @library{wxadv}
-    @category{grid}
-
-    @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
-    wxGridCellTextEditor, wxGridCellChoiceEditor
-*/
-class wxGridCellNumberEditor : public wxGridCellTextEditor
-{
-public:
-    /**
-        Allows to specify the range for acceptable data;
-        if min == max == -1, no range checking is done
-    */
-    wxGridCellNumberEditor(int min = -1, int max = -1);
+        By default the cells can only be accessed as strings. Note that a cell
+        could be accessible in different ways, e.g. a numeric cell may return
+        @true for @c wxGRID_VALUE_NUMBER but also for @c wxGRID_VALUE_STRING
+        indicating that the value can be coerced to a string form.
+     */
+    virtual bool CanGetValueAs(int row, int col, const wxString& typeName);
 
     /**
 
     /**
-        String representation of the value.
-    */
-    wxString GetString() const;
+        Returns true if the value of the given cell can be set as if it were of
+        the specified type.
 
 
-    /**
-        If the return value is @true, the editor uses a wxSpinCtrl to get user input,
-        otherwise it uses a wxTextCtrl.
-    */
-    bool HasRange() const;
+        @see CanGetValueAs()
+     */
+    virtual bool CanSetValueAs(int row, int col, const wxString& typeName);
 
     /**
 
     /**
-        Parameters string format is "min,max".
-    */
-    virtual void SetParameters(const wxString& params);
-};
-
+        Returns the value of the given cell as a long.
 
 
+        This should only be called if CanGetValueAs() returns @true when called
+        with @c wxGRID_VALUE_NUMBER argument. Default implementation always
+        return 0.
+     */
+    virtual long GetValueAsLong(int row, int col);
 
 
-/**
-    @class wxGridSizeEvent
+    /**
+        Returns the value of the given cell as a double.
 
 
-    This event class contains information about a row/column resize event.
+        This should only be called if CanGetValueAs() returns @true when called
+        with @c wxGRID_VALUE_FLOAT argument. Default implementation always
+        return 0.0.
+     */
+    virtual double GetValueAsDouble(int row, int col);
 
 
-    @library{wxadv}
-    @category{grid}
-*/
-class wxGridSizeEvent : public wxNotifyEvent
-{
-public:
-    //@{
     /**
     /**
+        Returns the value of the given cell as a boolean.
 
 
-    */
-    wxGridSizeEvent();
-    wxGridSizeEvent(int id, wxEventType type, wxObject* obj,
-                    int rowOrCol = -1,
-                    int x = -1,
-                    int y = -1,
-                    bool control = false,
-                    bool shift = false,
-                    bool alt = false,
-                    bool meta = false);
-    //@}
+        This should only be called if CanGetValueAs() returns @true when called
+        with @c wxGRID_VALUE_BOOL argument. Default implementation always
+        return false.
+     */
+    virtual bool GetValueAsBool(int row, int col);
 
     /**
 
     /**
-        Returns @true if the Alt key was down at the time of the event.
-    */
-    bool AltDown() const;
+        Returns the value of the given cell as a user-defined type.
 
 
-    /**
-        Returns @true if the Control key was down at the time of the event.
-    */
-    bool ControlDown() const;
+        This should only be called if CanGetValueAs() returns @true when called
+        with @a typeName. Default implementation always return @NULL.
+     */
+    virtual void *GetValueAsCustom(int row, int col, const wxString& typeName);
 
     /**
 
     /**
-        Position in pixels at which the event occurred.
-    */
-    wxPoint GetPosition();
+        Sets the value of the given cell as a long.
 
 
-    /**
-        Row or column at that was resized.
-    */
-    int GetRowOrCol();
+        This should only be called if CanSetValueAs() returns @true when called
+        with @c wxGRID_VALUE_NUMBER argument. Default implementation doesn't do
+        anything.
+     */
+    virtual void SetValueAsLong(int row, int col, long value);
 
     /**
 
     /**
-        Returns @true if the Meta key was down at the time of the event.
-    */
-    bool MetaDown() const;
+        Sets the value of the given cell as a double.
+
+        This should only be called if CanSetValueAs() returns @true when called
+        with @c wxGRID_VALUE_FLOAT argument. Default implementation doesn't do
+        anything.
+     */
+    virtual void SetValueAsDouble(int row, int col, double value);
 
     /**
 
     /**
-        Returns @true if the Shift key was down at the time of the event.
-    */
-    bool ShiftDown() const;
-};
+        Sets the value of the given cell as a boolean.
 
 
+        This should only be called if CanSetValueAs() returns @true when called
+        with @c wxGRID_VALUE_BOOL argument. Default implementation doesn't do
+        anything.
+     */
+    virtual void SetValueAsBool( int row, int col, bool value );
 
 
+    /**
+        Sets the value of the given cell as a user-defined type.
 
 
-/**
-    @class wxGridCellNumberRenderer
+        This should only be called if CanSetValueAs() returns @true when called
+        with @a typeName. Default implementation doesn't do anything.
+     */
+    virtual void SetValueAsCustom(int row, int col, const wxString& typeName,
+                                  void *value);
 
 
-    This class may be used to format integer data in a cell.
+    //@}
 
 
-    @library{wxadv}
-    @category{grid}
 
 
-    @see wxGridCellRenderer, wxGridCellStringRenderer, wxGridCellFloatRenderer,
-    wxGridCellBoolRenderer
-*/
-class wxGridCellNumberRenderer : public wxGridCellStringRenderer
-{
-public:
     /**
     /**
-        Default constructor
-    */
-    wxGridCellNumberRenderer();
-};
+        Called by the grid when the table is associated with it.
 
 
+        The default implementation stores the pointer and returns it from its
+        GetView() and so only makes sense if the table cannot be associated
+        with more than one grid at a time.
+     */
+    virtual void SetView(wxGrid *grid);
 
 
+    /**
+        Returns the last grid passed to SetView().
+     */
+    virtual wxGrid *GetView() const;
 
 
-/**
-    @class wxGridCellAttr
 
 
-    This class can be used to alter the cells' appearance in
-    the grid by changing their colour/font/... from default. An object of this
-    class may be returned by wxGridTableBase::GetAttr.
+    /**
+        @name Table Structure Modifiers
 
 
-    @library{wxadv}
-    @category{grid}
-*/
-class wxGridCellAttr
-{
-public:
+        Notice that none of these functions are pure virtual as they don't have
+        to be implemented if the table structure is never modified after
+        creation, i.e. neither rows nor columns are never added or deleted but
+        that you do need to implement them if they are called, i.e. if your
+        code either calls them directly or uses the matching wxGrid methods, as
+        by default they simply do nothing which is definitely inappropriate.
+     */
     //@{
     //@{
-    /**
-        Constructor specifying some of the often used attributes.
-    */
-    wxGridCellAttr();
-    wxGridCellAttr(const wxColour& colText,
-                   const wxColour& colBack,
-                   const wxFont& font,
-                   int hAlign, int vAlign);
-    //@}
 
     /**
 
     /**
-        Creates a new copy of this object.
-    */
-    wxGridCellAttr* Clone() const;
+        Clear the table contents.
+
+        This method is used by wxGrid::ClearGrid().
+     */
+    virtual void Clear();
 
     /**
 
     /**
+        Insert additional rows into the table.
 
 
-    */
-    void DecRef();
+        @param pos
+            The position of the first new row.
+        @param numRows
+            The number of rows to insert.
+     */
+    virtual bool InsertRows(size_t pos = 0, size_t numRows = 1);
 
     /**
 
     /**
-        See SetAlignment() for the returned values.
-    */
-    void GetAlignment(int* hAlign, int* vAlign) const;
+        Append additional rows at the end of the table.
 
 
-    /**
+        This method is provided in addition to InsertRows() as some data models
+        may only support appending rows to them but not inserting them at
+        arbitrary locations. In such case you may implement this method only
+        and leave InsertRows() unimplemented.
 
 
-    */
-    const wxColour GetBackgroundColour() const;
+        @param numRows
+            The number of rows to add.
+     */
+    virtual bool AppendRows(size_t numRows = 1);
 
     /**
 
     /**
+        Delete rows from the table.
 
 
-    */
-    wxGridCellEditor* GetEditor(wxGrid* grid, int row, int col) const;
+        @param pos
+            The first row to delete.
+        @param numRows
+            The number of rows to delete.
+     */
+    virtual bool DeleteRows(size_t pos = 0, size_t numRows = 1);
 
     /**
 
     /**
-
-    */
-    const wxFont GetFont() const;
+        Exactly the same as InsertRows() but for columns.
+     */
+    virtual bool InsertCols(size_t pos = 0, size_t numCols = 1);
 
     /**
 
     /**
-
-    */
-    wxGridCellRenderer* GetRenderer(wxGrid* grid, int row, int col) const;
+        Exactly the same as AppendRows() but for columns.
+     */
+    virtual bool AppendCols(size_t numCols = 1);
 
     /**
 
     /**
+        Exactly the same as DeleteRows() but for columns.
+     */
+    virtual bool DeleteCols(size_t pos = 0, size_t numCols = 1);
 
 
-    */
-    const wxColour GetTextColour() const;
+    //@}
 
     /**
 
     /**
+        @name Table Row and Column Labels
 
 
-    */
-    bool HasAlignment() const;
+        By default the numbers are used for labeling rows and Latin letters for
+        labeling columns. If the table has more than 26 columns, the pairs of
+        letters are used starting from the 27-th one and so on, i.e. the
+        sequence of labels is A, B, ..., Z, AA, AB, ..., AZ, BA, ..., ..., ZZ,
+        AAA, ...
+     */
+    //@{
 
     /**
 
     /**
+        Return the label of the specified row.
+     */
+    virtual wxString GetRowLabelValue(int row);
 
 
-    */
-    bool HasBackgroundColour() const;
+    /**
+        Return the label of the specified column.
+     */
+    virtual wxString GetColLabelValue(int col);
 
     /**
 
     /**
+        Set the given label for the specified row.
 
 
-    */
-    bool HasEditor() const;
+        The default version does nothing, i.e. the label is not stored. You
+        must override this method in your derived class if you wish
+        wxGrid::SetRowLabelValue() to work.
+     */
+    virtual void SetRowLabelValue(int row, const wxString& label);
 
     /**
 
     /**
+        Exactly the same as SetRowLabelValue() but for columns.
+     */
+    virtual void SetColLabelValue(int col, const wxString& label);
+
+    //@}
 
 
-    */
-    bool HasFont() const;
 
     /**
 
     /**
+        @name Attributes Management
 
 
-    */
-    bool HasRenderer() const;
+        By default the attributes management is delegated to
+        wxGridCellAttrProvider class. You may override the methods in this
+        section to handle the attributes directly if, for example, they can be
+        computed from the cell values.
+     */
+    //@{
 
     /**
 
     /**
-        accessors
-    */
-    bool HasTextColour() const;
+        Associate this attributes provider with the table.
 
 
-    /**
-        This class is ref counted: it is created with ref count of 1, so
-        calling DecRef() once will delete it. Calling IncRef() allows to lock
-        it until the matching DecRef() is called
-    */
-    void IncRef();
-
-    /**
-
-    */
-    bool IsReadOnly() const;
-
-    /**
-        Sets the alignment. @a hAlign can be one of @c wxALIGN_LEFT,
-        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT and @a vAlign can be one
-        of @c wxALIGN_TOP, @c wxALIGN_CENTRE or @c wxALIGN_BOTTOM.
-    */
-    void SetAlignment(int hAlign, int vAlign);
-
-    /**
-        Sets the background colour.
-    */
-    void SetBackgroundColour(const wxColour& colBack);
+        The table takes ownership of @a attrProvider pointer and will delete it
+        when it doesn't need it any more. The pointer can be @NULL, however
+        this won't disable attributes management in the table but will just
+        result in a default attributes being recreated the next time any of the
+        other functions in this section is called. To completely disable the
+        attributes support, should this be needed, you need to override
+        CanHaveAttributes() to return @false.
+     */
+    void SetAttrProvider(wxGridCellAttrProvider *attrProvider);
 
     /**
 
     /**
+        Returns the attribute provider currently being used.
 
 
-    */
-    void SetDefAttr(wxGridCellAttr* defAttr);
+        This function may return @NULL if the attribute provider hasn't been
+        neither associated with this table by SetAttrProvider() nor created on
+        demand by any other methods.
+     */
+    wxGridCellAttrProvider *GetAttrProvider() const;
 
     /**
 
     /**
+        Return the attribute for the given cell.
 
 
-    */
-    void SetEditor(wxGridCellEditor* editor);
-
-    /**
-        Sets the font.
-    */
-    void SetFont(const wxFont& font);
+        By default this function is simply forwarded to
+        wxGridCellAttrProvider::GetAttr() but it may be overridden to handle
+        attributes directly in the table.
+     */
+    virtual wxGridCellAttr *GetAttr(int row, int col,
+                                    wxGridCellAttr::wxAttrKind kind);
 
     /**
 
     /**
+        Set attribute of the specified cell.
 
 
-    */
-    void SetReadOnly(bool isReadOnly = true);
+        By default this function is simply forwarded to
+        wxGridCellAttrProvider::SetAttr().
 
 
-    /**
-        takes ownership of the pointer
-    */
-    void SetRenderer(wxGridCellRenderer* renderer);
+        The table takes ownership of @a attr, i.e. will call DecRef() on it.
+     */
+    virtual void SetAttr(wxGridCellAttr* attr, int row, int col);
 
     /**
 
     /**
-        Sets the text colour.
-    */
-    void SetTextColour(const wxColour& colText);
-};
-
-
-
-/**
-    @class wxGridCellBoolRenderer
+        Set attribute of the specified row.
 
 
-    This class may be used to format boolean data in a cell.
-    for string cells.
+        By default this function is simply forwarded to
+        wxGridCellAttrProvider::SetRowAttr().
 
 
-    @library{wxadv}
-    @category{grid}
+        The table takes ownership of @a attr, i.e. will call DecRef() on it.
+     */
+    virtual void SetRowAttr(wxGridCellAttr *attr, int row);
 
 
-    @see wxGridCellRenderer, wxGridCellStringRenderer, wxGridCellFloatRenderer,
-    wxGridCellNumberRenderer
-*/
-class wxGridCellBoolRenderer : public wxGridCellRenderer
-{
-public:
     /**
     /**
-        Default constructor
-    */
-    wxGridCellBoolRenderer();
-};
-
-
-
-/**
-    @class wxGridEvent
+        Set attribute of the specified column.
 
 
-    This event class contains information about various grid events.
+        By default this function is simply forwarded to
+        wxGridCellAttrProvider::SetColAttr().
 
 
-    @library{wxadv}
-    @category{grid}
-*/
-class wxGridEvent : public wxNotifyEvent
-{
-public:
-    //@{
-    /**
+        The table takes ownership of @a attr, i.e. will call DecRef() on it.
+     */
+    virtual void SetColAttr(wxGridCellAttr *attr, int col);
 
 
-    */
-    wxGridEvent();
-    wxGridEvent(int id, wxEventType type, wxObject* obj,
-                int row = -1, int col = -1,
-                int x = -1, int y = -1,
-                bool sel = true,
-                bool control = false,
-                bool shift = false,
-                bool alt = false,
-                bool meta = false);
     //@}
 
     /**
     //@}
 
     /**
-        Returns @true if the Alt key was down at the time of the event.
-    */
-    bool AltDown() const;
-
-    /**
-        Returns @true if the Control key was down at the time of the event.
-    */
-    bool ControlDown() const;
-
-    /**
-        Column at which the event occurred.
-    */
-    virtual int GetCol();
-
-    /**
-        Position in pixels at which the event occurred.
-    */
-    wxPoint GetPosition();
-
-    /**
-        Row at which the event occurred.
-    */
-    virtual int GetRow();
-
-    /**
-        Returns @true if the Meta key was down at the time of the event.
-    */
-    bool MetaDown() const;
-
-    /**
-        Returns @true if the user is selecting grid cells, @false -- if
-        deselecting.
-    */
-    bool Selecting();
-
-    /**
-        Returns @true if the Shift key was down at the time of the event.
-    */
-    bool ShiftDown() const;
-};
-
-
-
-/**
-    @class wxGridCellFloatEditor
-
-    The editor for floating point numbers data.
-
-    @library{wxadv}
-    @category{grid}
-
-    @see wxGridCellEditor, wxGridCellNumberEditor, wxGridCellBoolEditor,
-    wxGridCellTextEditor, wxGridCellChoiceEditor
-*/
-class wxGridCellFloatEditor : public wxGridCellTextEditor
-{
-public:
-    /**
-        @param width
-            Minimum number of characters to be shown.
-        @param precision
-            Number of digits after the decimal dot.
-    */
-    wxGridCellFloatEditor(int width = -1, int precision = -1);
+        Returns true if this table supports attributes or false otherwise.
 
 
-    /**
-        Parameters string format is "width,precision"
-    */
-    virtual void SetParameters(const wxString& params);
+        By default, the table automatically creates a wxGridCellAttrProvider
+        when this function is called if it had no attribute provider before and
+        returns @true.
+     */
+    virtual bool CanHaveAttributes();
 };
 
 
 };
 
 
@@ -1221,51 +1034,54 @@ public:
     @class wxGrid
 
     wxGrid and its related classes are used for displaying and editing tabular
     @class wxGrid
 
     wxGrid and its related classes are used for displaying and editing tabular
-    data.
-    They provide a rich set of features for display, editing, and interacting
-    with a variety of data sources. For simple applications, and to help you
-    get started, wxGrid is the only class you need to refer to directly. It
-    will set up default instances of the other classes and manage them for you.
-    For more complex applications you can derive your own classes for custom
-    grid views, grid data tables, cell editors and renderers. The @ref
-    overview_grid "wxGrid overview" has examples of simple and more complex applications,
+    data. They provide a rich set of features for display, editing, and
+    interacting with a variety of data sources. For simple applications, and to
+    help you get started, wxGrid is the only class you need to refer to
+    directly. It will set up default instances of the other classes and manage
+    them for you. For more complex applications you can derive your own classes
+    for custom grid views, grid data tables, cell editors and renderers. The
+    @ref overview_grid has examples of simple and more complex applications,
     explains the relationship between the various grid classes and has a
     summary of the keyboard shortcuts and mouse functions provided by wxGrid.
 
     explains the relationship between the various grid classes and has a
     summary of the keyboard shortcuts and mouse functions provided by wxGrid.
 
-    wxGrid has been greatly expanded and redesigned for wxWidgets 2.2 onwards.
-    The new grid classes are reasonably backward-compatible but there are some
-    exceptions. There are also easier ways of doing many things compared to the
-    previous implementation.
-
     A wxGridTableBase class holds the actual data to be displayed by a wxGrid
     class. One or more wxGrid classes may act as a view for one table class.
     The default table class is called wxGridStringTable and holds an array of
     A wxGridTableBase class holds the actual data to be displayed by a wxGrid
     class. One or more wxGrid classes may act as a view for one table class.
     The default table class is called wxGridStringTable and holds an array of
-    strings. An instance of such a class is created by wxGrid::CreateGrid.
+    strings. An instance of such a class is created by CreateGrid().
 
     wxGridCellRenderer is the abstract base class for rendereing contents in a
     cell. The following renderers are predefined:
 
     wxGridCellRenderer is the abstract base class for rendereing contents in a
     cell. The following renderers are predefined:
-     - wxGridCellStringRenderer,
-     - wxGridCellBoolRenderer,
-     - wxGridCellFloatRenderer,
-     - wxGridCellNumberRenderer.
+
+    - wxGridCellBoolRenderer
+    - wxGridCellFloatRenderer
+    - wxGridCellNumberRenderer
+    - wxGridCellStringRenderer
+
     The look of a cell can be further defined using wxGridCellAttr. An object
     The look of a cell can be further defined using wxGridCellAttr. An object
-    of this type may be returned by wxGridTableBase::GetAttr.
+    of this type may be returned by wxGridTableBase::GetAttr().
 
     wxGridCellEditor is the abstract base class for editing the value of a
     cell. The following editors are predefined:
 
     wxGridCellEditor is the abstract base class for editing the value of a
     cell. The following editors are predefined:
-     - wxGridCellTextEditor
-     - wxGridCellBoolEditor
-     - wxGridCellChoiceEditor
-     - wxGridCellNumberEditor.
+
+    - wxGridCellBoolEditor
+    - wxGridCellChoiceEditor
+    - wxGridCellFloatEditor
+    - wxGridCellNumberEditor
+    - wxGridCellTextEditor
+
+    Please see wxGridEvent, wxGridSizeEvent, wxGridRangeSelectEvent, and
+    wxGridEditorCreatedEvent for the documentation of all event types you can
+    use with wxGrid.
 
     @library{wxadv}
     @category{grid}
 
 
     @library{wxadv}
     @category{grid}
 
-    @see @ref overview_grid "wxGrid overview"
+    @see @ref overview_grid, wxGridUpdateLocker
 */
 class wxGrid : public wxScrolledWindow
 {
 public:
 */
 class wxGrid : public wxScrolledWindow
 {
 public:
+
     /**
         Different selection modes supported by the grid.
      */
     /**
         Different selection modes supported by the grid.
      */
@@ -1292,6 +1108,12 @@ public:
         wxGridSelectColumns
     };
 
         wxGridSelectColumns
     };
 
+
+    /**
+        @name Constructors and Initialization
+     */
+    //@{
+
     /**
         Default constructor.
 
     /**
         Default constructor.
 
@@ -1299,20 +1121,27 @@ public:
         CreateGrid() or SetTable() to initialize the grid contents.
      */
     wxGrid();
         CreateGrid() or SetTable() to initialize the grid contents.
      */
     wxGrid();
-
     /**
         Constructor creating the grid window.
 
         You must call either CreateGrid() or SetTable() to initialize the grid
         contents before using it.
     */
     /**
         Constructor creating the grid window.
 
         You must call either CreateGrid() or SetTable() to initialize the grid
         contents before using it.
     */
-    wxGrid(wxWindow* parent,
-           wxWindowID id,
+    wxGrid(wxWindow* parent, wxWindowID id,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxWANTS_CHARS,
            const wxString& name = wxGridNameStr);
 
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxWANTS_CHARS,
            const wxString& name = wxGridNameStr);
 
+    /**
+        Destructor.
+
+        This will also destroy the associated grid table unless you passed a
+        table object to the grid and specified that the grid should not take
+        ownership of the table (see SetTable()).
+    */
+    virtual ~wxGrid();
+
     /**
         Creates the grid window for an object initialized using the default
         constructor.
     /**
         Creates the grid window for an object initialized using the default
         constructor.
@@ -1320,578 +1149,532 @@ public:
         You must call either CreateGrid() or SetTable() to initialize the grid
         contents before using it.
      */
         You must call either CreateGrid() or SetTable() to initialize the grid
         contents before using it.
      */
-    bool Create(wxWindow* parent,
-                wxWindowID id,
+    bool Create(wxWindow* parent, wxWindowID id,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxWANTS_CHARS,
                 const wxString& name = wxGridNameStr);
 
     /**
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxWANTS_CHARS,
                 const wxString& name = wxGridNameStr);
 
     /**
-        Destructor.
+        Creates a grid with the specified initial number of rows and columns.
 
 
-        This will also destroy the associated grid table unless you passed a
-        table object to the grid and specified that the grid should not take
-        ownership of the table (see wxGrid::SetTable).
+        Call this directly after the grid constructor. When you use this
+        function wxGrid will create and manage a simple table of string values
+        for you. All of the grid data will be stored in memory.
+
+        For applications with more complex data types or relationships, or for
+        dealing with very large datasets, you should derive your own grid table
+        class and pass a table object to the grid with SetTable().
     */
     */
-    virtual ~wxGrid();
+    bool CreateGrid(int numRows, int numCols,
+                    wxGridSelectionModes selmode = wxGridSelectCells);
 
     /**
 
     /**
-        Appends one or more new columns to the right of the grid.
+        Passes a pointer to a custom grid table to be used by the grid.
 
 
-        The @a updateLabels argument is not used at present. If you are using a
-        derived grid table class you will need to override
-        wxGridTableBase::AppendCols. See InsertCols() for further information.
+        This should be called after the grid constructor and before using the
+        grid object. If @a takeOwnership is set to @true then the table will be
+        deleted by the wxGrid destructor.
 
 
-        @return @true on success or @false if appending columns failed.
+        Use this function instead of CreateGrid() when your application
+        involves complex or non-string data or data sets that are too large to
+        fit wholly in memory.
     */
     */
-    bool AppendCols(int numCols = 1, bool updateLabels = true);
+    bool SetTable(wxGridTableBase* table, bool takeOwnership = false,
+                  wxGridSelectionModes selmode = wxGridSelectCells);
 
 
-    /**
-        Appends one or more new rows to the bottom of the grid.
+    //@}
 
 
-        The @a updateLabels argument is not used at present. If you are using a
-        derived grid table class you will need to override
-        wxGridTableBase::AppendRows. See InsertRows() for further information.
 
 
-        @return @true on success or @false if appending rows failed.
+    /**
+        @name Grid Line Formatting
+     */
+    //@{
+
+    /**
+        Turns the drawing of grid lines on or off.
     */
     */
-    bool AppendRows(int numRows = 1, bool updateLabels = true);
+    void EnableGridLines(bool enable = true);
 
     /**
 
     /**
-        Return @true if the horizontal grid lines stop at the last column
-        boundary or @false if they continue to the end of the window.
+        Returns the pen used for vertical grid lines.
 
 
-        The default is to clip grid lines.
+        This virtual function may be overridden in derived classes in order to
+        change the appearance of individual grid lines for the given column
+        @a col.
 
 
-        @see ClipHorzGridLines(), AreVertGridLinesClipped()
-     */
-    bool AreHorzGridLinesClipped() const;
+        See GetRowGridLinePen() for an example.
+    */
+    virtual wxPen GetColGridLinePen(int col);
 
     /**
 
     /**
-        Return @true if the vertical grid lines stop at the last row
-        boundary or @false if they continue to the end of the window.
+        Returns the pen used for grid lines.
 
 
-        The default is to clip grid lines.
+        This virtual function may be overridden in derived classes in order to
+        change the appearance of grid lines. Note that currently the pen width
+        must be 1.
 
 
-        @see ClipVertGridLines(), AreHorzGridLinesClipped()
-     */
-    bool AreVertGridLinesClipped() const;
+        @see GetColGridLinePen(), GetRowGridLinePen()
+    */
+    virtual wxPen GetDefaultGridLinePen();
 
     /**
 
     /**
-        Automatically sets the height and width of all rows and columns to fit their
-        contents.
+        Returns the colour used for grid lines.
+
+        @see GetDefaultGridLinePen()
     */
     */
-    void AutoSize();
+    wxColour GetGridLineColour() const;
 
     /**
 
     /**
-        Automatically adjusts width of the column to fit its label.
+        Returns the pen used for horizontal grid lines.
+
+        This virtual function may be overridden in derived classes in order to
+        change the appearance of individual grid line for the given @a row.
+
+        Example:
+        @code
+        // in a grid displaying music notation, use a solid black pen between
+        // octaves (C0=row 127, C1=row 115 etc.)
+        wxPen MidiGrid::GetRowGridLinePen(int row)
+        {
+            if ( row % 12 == 7 )
+                return wxPen(*wxBLACK, 1, wxSOLID);
+            else
+                return GetDefaultGridLinePen();
+        }
+        @endcode
     */
     */
-    void AutoSizeColLabelSize(int col);
+    virtual wxPen GetRowGridLinePen(int row);
 
     /**
 
     /**
-        Automatically sizes the column to fit its contents. If setAsMin is @true the
-        calculated width will
-        also be set as the minimal width for the column.
+        Returns @true if drawing of grid lines is turned on, @false otherwise.
     */
     */
-    void AutoSizeColumn(int col, bool setAsMin = true);
+    bool GridLinesEnabled() const;
 
     /**
 
     /**
-        Automatically sizes all columns to fit their contents. If setAsMin is @true the
-        calculated widths will
-        also be set as the minimal widths for the columns.
+        Sets the colour used to draw grid lines.
     */
     */
-    void AutoSizeColumns(bool setAsMin = true);
+    void SetGridLineColour(const wxColour& colour);
+
+    //@}
+
 
     /**
 
     /**
-        Automatically sizes the row to fit its contents. If setAsMin is @true the
-        calculated height will
-        also be set as the minimal height for the row.
-    */
-    void AutoSizeRow(int row, bool setAsMin = true);
+        @name Label Values and Formatting
+     */
+    //@{
 
     /**
 
     /**
-        Automatically adjusts height of the row to fit its label.
+        Sets the arguments to the current column label alignment values.
+
+        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
+        or @c wxALIGN_RIGHT.
+
+        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
+        @c wxALIGN_BOTTOM.
     */
     */
-    void AutoSizeRowLabelSize(int col);
+    void GetColLabelAlignment(int* horiz, int* vert) const;
 
     /**
 
     /**
-        Automatically sizes all rows to fit their contents. If setAsMin is @true the
-        calculated heights will
-        also be set as the minimal heights for the rows.
+        Returns the orientation of the column labels (either @c wxHORIZONTAL or
+        @c wxVERTICAL).
     */
     */
-    void AutoSizeRows(bool setAsMin = true);
+    int GetColLabelTextOrientation() const;
 
     /**
 
     /**
-        Increments the grid's batch count.
-
-        When the count is greater than zero repainting of the grid is
-        suppressed. Each call to BeginBatch must be matched by a later call to
-        EndBatch(). Code that does a lot of grid modification can be enclosed
-        between BeginBatch and EndBatch calls to avoid screen flicker. The
-        final EndBatch will cause the grid to be repainted.
+        Returns the specified column label.
 
 
-        Notice that you should use wxGridUpdateLocker which ensures that there
-        is always a matching EndBatch() call for this BeginBatch() if possible
-        instead of calling this method directly.
+        The default grid table class provides column labels of the form
+        A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can
+        override wxGridTableBase::GetColLabelValue() to provide your own
+        labels.
     */
     */
-    void BeginBatch();
+    wxString GetColLabelValue(int col) const;
 
     /**
 
     /**
-        Convert grid cell coordinates to grid window pixel coordinates.
+        Returns the colour used for the background of row and column labels.
+    */
+    wxColour GetLabelBackgroundColour() const;
 
 
-        This function returns the rectangle that encloses the block of cells
-        limited by @a topLeft and @a bottomRight cell in device coords and
-        clipped to the client size of the grid window.
+    /**
+        Returns the font used for row and column labels.
+    */
+    wxFont GetLabelFont() const;
 
 
-        @see CellToRect()
+    /**
+        Returns the colour used for row and column label text.
     */
     */
-    wxRect BlockToDeviceRect(const wxGridCellCoords& topLeft,
-                             const wxGridCellCoords& bottomRight) const;
+    wxColour GetLabelTextColour() const;
 
     /**
 
     /**
-        Returns @true if columns can be moved by dragging with the mouse.
+        Returns the alignment used for row labels.
 
 
-        Columns can be moved by dragging on their labels.
+        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
+        or @c wxALIGN_RIGHT.
+
+        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
+        @c wxALIGN_BOTTOM.
     */
     */
-    bool CanDragColMove() const;
+    void GetRowLabelAlignment(int* horiz, int* vert) const;
 
     /**
 
     /**
-        Returns @true if columns can be resized by dragging with the mouse.
+        Returns the specified row label.
 
 
-        Columns can be resized by dragging the edges of their labels. If grid
-        line dragging is enabled they can also be resized by dragging the right
-        edge of the column in the grid cell area (see
-        wxGrid::EnableDragGridSize).
+        The default grid table class provides numeric row labels. If you are
+        using a custom grid table you can override
+        wxGridTableBase::GetRowLabelValue() to provide your own labels.
     */
     */
-    bool CanDragColSize() const;
+    wxString GetRowLabelValue(int row) const;
 
     /**
 
     /**
-        Return @true if the dragging of grid lines to resize rows and columns
-        is enabled or @false otherwise.
+        Hides the column labels by calling SetColLabelSize() with a size of 0.
+        Show labels again by calling that method with a width greater than 0.
     */
     */
-    bool CanDragGridSize() const;
+    void HideColLabels();
 
     /**
 
     /**
-        Returns @true if rows can be resized by dragging with the mouse.
+        Hides the row labels by calling SetRowLabelSize() with a size of 0.
 
 
-        Rows can be resized by dragging the edges of their labels. If grid line
-        dragging is enabled they can also be resized by dragging the lower edge
-        of the row in the grid cell area (see wxGrid::EnableDragGridSize).
+        The labels can be shown again by calling SetRowLabelSize() with a width
+        greater than 0.
     */
     */
-    bool CanDragRowSize() const;
+    void HideRowLabels();
 
     /**
 
     /**
-        Returns @true if the in-place edit control for the current grid cell
-        can be used and @false otherwise.
+        Sets the horizontal and vertical alignment of column label text.
 
 
-        This function always returns @false for the read-only cells.
+        Horizontal alignment should be one of @c wxALIGN_LEFT,
+        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT. Vertical alignment should be one
+        of @c wxALIGN_TOP, @c wxALIGN_CENTRE or @c wxALIGN_BOTTOM.
     */
     */
-    bool CanEnableCellControl() const;
+    void SetColLabelAlignment(int horiz, int vert);
 
     /**
 
     /**
-        Returns @true if this grid has support for cell attributes.
-
-        The grid supports attributes if it has the associated table which, in
-        turn, has attributes support, i.e. wxGridTableBase::CanHaveAttributes()
-        returns @true.
+        Sets the orientation of the column labels (either @c wxHORIZONTAL or
+        @c wxVERTICAL).
     */
     */
-    bool CanHaveAttributes() const;
+    void SetColLabelTextOrientation(int textOrientation);
 
 
-    //@{
     /**
     /**
-        Return the rectangle corresponding to the grid cell's size and position
-        in logical coordinates.
+        Set the value for the given column label.
 
 
-        @see BlockToDeviceRect()
+        If you are using a custom grid table you must override
+        wxGridTableBase::SetColLabelValue() for this to have any effect.
     */
     */
-    wxRect CellToRect(int row, int col) const;
-    const wxRect CellToRect(const wxGridCellCoords& coords) const;
-
-    //@}
+    void SetColLabelValue(int col, const wxString& value);
 
     /**
 
     /**
-        Clears all data in the underlying grid table and repaints the grid.
-
-        The table is not deleted by this function. If you are using a derived
-        table class then you need to override wxGridTableBase::Clear() for this
-        function to have any effect.
+        Sets the background colour for row and column labels.
     */
     */
-    void ClearGrid();
+    void SetLabelBackgroundColour(const wxColour& colour);
 
     /**
 
     /**
-        Deselects all cells that are currently selected.
+        Sets the font for row and column labels.
     */
     */
-    void ClearSelection();
+    void SetLabelFont(const wxFont& font);
 
     /**
 
     /**
-        Change whether the horizontal grid lines are clipped by the end of the
-        last column.
-
-        By default the grid lines are not drawn beyond the end of the last
-        column but after calling this function with @a clip set to @false they
-        will be drawn across the entire grid window.
-
-        @see AreHorzGridLinesClipped(), ClipVertGridLines()
-     */
-    void ClipHorzGridLines(bool clip);
+        Sets the colour for row and column label text.
+    */
+    void SetLabelTextColour(const wxColour& colour);
 
     /**
 
     /**
-        Change whether the vertical grid lines are clipped by the end of the
-        last row.
-
-        By default the grid lines are not drawn beyond the end of the last
-        row but after calling this function with @a clip set to @false they
-        will be drawn across the entire grid window.
+        Sets the horizontal and vertical alignment of row label text.
 
 
-        @see AreVertzGridLinesClipped(), ClipHorzGridLines()
-     */
-    void ClipVertzGridLines(bool clip);
+        Horizontal alignment should be one of @c wxALIGN_LEFT,
+        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT. Vertical alignment should be one
+        of @c wxALIGN_TOP, @c wxALIGN_CENTRE or @c wxALIGN_BOTTOM.
+    */
+    void SetRowLabelAlignment(int horiz, int vert);
 
     /**
 
     /**
-        Creates a grid with the specified initial number of rows and columns.
+        Sets the value for the given row label.
 
 
-        Call this directly after the grid constructor. When you use this
-        function wxGrid will create and manage a simple table of string values
-        for you. All of the grid data will be stored in memory.
-        For applications with more complex data types or relationships, or for
-        dealing with very large datasets, you should derive your own grid table
-        class and pass a table object to the grid with SetTable().
+        If you are using a derived grid table you must override
+        wxGridTableBase::SetRowLabelValue() for this to have any effect.
     */
     */
-    bool CreateGrid(int numRows, int numCols,
-                    wxGridSelectionModes selmode = wxGridSelectCells);
+    void SetRowLabelValue(int row, const wxString& value);
 
     /**
 
     /**
-        Deletes one or more columns from a grid starting at the specified
-        position.
+        Call this in order to make the column labels use a native look by using
+        wxRenderer::DrawHeaderButton() internally.
 
 
-        The @a updateLabels argument is not used at present. If you are using a
-        derived grid table class you will need to override
-        wxGridTableBase::DeleteCols. See InsertCols() for further information.
+        There is no equivalent method for drawing row columns as there is not
+        native look for that. This option is useful when using wxGrid for
+        displaying tables and not as a spread-sheet.
 
 
-        @return @true on success or @false if deleting columns failed.
+        @see UseNativeHeader()
     */
     */
-    bool DeleteCols(int pos = 0, int numCols = 1, bool updateLabels = true);
+    void SetUseNativeColLabels(bool native = true);
 
     /**
 
     /**
-        Deletes one or more rows from a grid starting at the specified position.
+        Enable the use of native header window for column labels.
+
+        If this function is called with @true argument, a wxHeaderCtrl is used
+        instead to display the column labels instead of drawing them in wxGrid
+        code itself. This has the advantage of making the grid look and feel
+        perfectly the same as native applications (using SetUseNativeColLabels()
+        the grid can be made to look more natively but it still doesn't feel
+        natively, notably the column resizing and dragging still works slightly
+        differently as it is implemented in wxWidgets itself) but results in
+        different behaviour for column and row headers, for which there is no
+        equivalent function, and, most importantly, is unsuitable for grids
+        with huge numbers of columns as wxHeaderCtrl doesn't support virtual
+        mode. Because of this, by default the grid does not use the native
+        header control but you should call this function to enable it if you
+        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).
+     */
+    void UseNativeColHeader(bool native = true);
 
 
-        The @a updateLabels argument is not used at present. If you are using a
-        derived grid table class you will need to override
-        wxGridTableBase::DeleteRows. See InsertRows() for further information.
+    //@}
 
 
-        @return @true on success or @false if appending rows failed.
-    */
-    bool DeleteRows(int pos = 0, int numRows = 1, bool updateLabels = true);
 
     /**
 
     /**
-        Disables in-place editing of grid cells.
+        @name Cell Formatting
 
 
-        Equivalent to calling EnableCellEditControl(@false).
-    */
-    void DisableCellEditControl();
+        Note that wxGridCellAttr can be used alternatively to most of these
+        methods. See the "Attributes Management" of wxGridTableBase.
+     */
+    //@{
 
     /**
 
     /**
-        Disables column moving by dragging with the mouse.
+        Sets the arguments to the horizontal and vertical text alignment values
+        for the grid cell at the specified location.
 
 
-        Equivalent to passing @false to EnableDragColMove().
+        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
+        or @c wxALIGN_RIGHT.
+
+        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
+        @c wxALIGN_BOTTOM.
     */
     */
-    void DisableDragColMove();
+    void GetCellAlignment(int row, int col, int* horiz, int* vert) const;
 
     /**
 
     /**
-        Disables column sizing by dragging with the mouse.
-
-        Equivalent to passing @false to EnableDragColSize().
+        Returns the background colour of the cell at the specified location.
     */
     */
-    void DisableDragColSize();
+    wxColour GetCellBackgroundColour(int row, int col) const;
 
     /**
 
     /**
-        Disable mouse dragging of grid lines to resize rows and columns.
-
-        Equivalent to passing @false to EnableDragGridSize()
+        Returns the font for text in the grid cell at the specified location.
     */
     */
-    void DisableDragGridSize();
+    wxFont GetCellFont(int row, int col) const;
 
     /**
 
     /**
-        Disables row sizing by dragging with the mouse.
-
-        Equivalent to passing @false to EnableDragRowSize().
+        Returns the text colour for the grid cell at the specified location.
     */
     */
-    void DisableDragRowSize();
+    wxColour GetCellTextColour(int row, int col) const;
 
     /**
 
     /**
-        Enables or disables in-place editing of grid cell data.
+        Returns the default cell alignment.
+
+        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
+        or @c wxALIGN_RIGHT.
+
+        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
+        @c wxALIGN_BOTTOM.
 
 
-        The grid will issue either a wxEVT_GRID_EDITOR_SHOWN or
-        wxEVT_GRID_EDITOR_HIDDEN event.
+        @see SetDefaultCellAlignment()
     */
     */
-    void EnableCellEditControl(bool enable = true);
+    void GetDefaultCellAlignment(int* horiz, int* vert) const;
 
     /**
 
     /**
-        Enables or disables column moving by dragging with the mouse.
+        Returns the current default background colour for grid cells.
     */
     */
-    void EnableDragColMove(bool enable = true);
+    wxColour GetDefaultCellBackgroundColour() const;
 
     /**
 
     /**
-        Enables or disables column sizing by dragging with the mouse.
+        Returns the current default font for grid cell text.
     */
     */
-    void EnableDragColSize(bool enable = true);
+    wxFont GetDefaultCellFont() const;
 
     /**
 
     /**
-        Enables or disables row and column resizing by dragging gridlines with the
-        mouse.
-    */
-    void EnableDragGridSize(bool enable = true);
-
-    /**
-        Enables or disables row sizing by dragging with the mouse.
+        Returns the current default colour for grid cell text.
     */
     */
-    void EnableDragRowSize(bool enable = true);
+    wxColour GetDefaultCellTextColour() const;
 
     /**
 
     /**
-        Makes the grid globally editable or read-only.
-
-        If the edit argument is @false this function sets the whole grid as
-        read-only. If the argument is @true the grid is set to the default
-        state where cells may be editable. In the default state you can set
-        single grid cells and whole rows and columns to be editable or
-        read-only via wxGridCellAttribute::SetReadOnly. For single cells you
-        can also use the shortcut function SetReadOnly().
+        Sets the horizontal and vertical alignment for grid cell text at the
+        specified location.
 
 
-        For more information about controlling grid cell attributes see the
-        wxGridCellAttr cell attribute class and the
-        @ref overview_grid "wxGrid overview".
-    */
-    void EnableEditing(bool edit);
+        Horizontal alignment should be one of @c wxALIGN_LEFT,
+        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT.
 
 
-    /**
-        Turns the drawing of grid lines on or off.
+        Vertical alignment should be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE
+        or @c wxALIGN_BOTTOM.
     */
     */
-    void EnableGridLines(bool enable = true);
-
+    void SetCellAlignment(int row, int col, int horiz, int vert);
     /**
     /**
-        Decrements the grid's batch count.
+        Sets the horizontal and vertical alignment for grid cell text at the
+        specified location.
 
 
-        When the count is greater than zero repainting of the grid is
-        suppressed. Each previous call to BeginBatch() must be matched by a
-        later call to EndBatch. Code that does a lot of grid modification can
-        be enclosed between BeginBatch and EndBatch calls to avoid screen
-        flicker. The final EndBatch will cause the grid to be repainted.
+        Horizontal alignment should be one of @c wxALIGN_LEFT,
+        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT.
 
 
-        @see wxGridUpdateLocker
+        Vertical alignment should be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE
+        or @c wxALIGN_BOTTOM.
     */
     */
-    void EndBatch();
+    void SetCellAlignment(int align, int row, int col);
 
     /**
 
     /**
-        Overridden wxWindow method.
+        Set the background colour for the given cell or all cells by default.
     */
     */
-    void Fit();
+    void SetCellBackgroundColour(int row, int col, const wxColour& colour);
 
     /**
 
     /**
-        Causes immediate repainting of the grid.
-
-        Use this instead of the usual wxWindow::Refresh.
+        Sets the font for text in the grid cell at the specified location.
     */
     */
-    void ForceRefresh();
+    void SetCellFont(int row, int col, const wxFont& font);
 
     /**
 
     /**
-        Returns the number of times that BeginBatch() has been called
-        without (yet) matching calls to EndBatch(). While
-        the grid's batch count is greater than zero the display will not be updated.
+        Sets the text colour for the given cell.
     */
     */
-    int GetBatchCount();
-
+    void SetCellTextColour(int row, int col, const wxColour& colour);
     /**
     /**
-        Sets the arguments to the horizontal and vertical text alignment values
-        for the grid cell at the specified location.
-
-        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
-        or @c wxALIGN_RIGHT.
-
-        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
-        @c wxALIGN_BOTTOM.
+        Sets the text colour for the given cell.
     */
     */
-    void GetCellAlignment(int row, int col, int* horiz, int* vert) const;
-
+    void SetCellTextColour(const wxColour& val, int row, int col);
     /**
     /**
-        Returns the background colour of the cell at the specified location.
+        Sets the text colour for all cells by default.
     */
     */
-    wxColour GetCellBackgroundColour(int row, int col) const;
+    void SetCellTextColour(const wxColour& colour);
 
     /**
 
     /**
-        Returns a pointer to the editor for the cell at the specified location.
-
-        See wxGridCellEditor and the @ref overview_grid "wxGrid overview" 
-        for more information about cell editors and renderers.
+        Sets the default horizontal and vertical alignment for grid cell text.
 
 
-        The caller must call DecRef() on the returned pointer.
+        Horizontal alignment should be one of @c wxALIGN_LEFT,
+        @c wxALIGN_CENTRE or @c wxALIGN_RIGHT. Vertical alignment should be one
+        of @c wxALIGN_TOP, @c wxALIGN_CENTRE or @c wxALIGN_BOTTOM.
     */
     */
-    wxGridCellEditor* GetCellEditor(int row, int col) const;
+    void SetDefaultCellAlignment(int horiz, int vert);
 
     /**
 
     /**
-        Returns the font for text in the grid cell at the specified location.
+        Sets the default background colour for grid cells.
     */
     */
-    wxFont GetCellFont(int row, int col) const;
+    void SetDefaultCellBackgroundColour(const wxColour& colour);
 
     /**
 
     /**
-        Returns a pointer to the renderer for the grid cell at the specified
-        location.
-
-        See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
-        for more information about cell editors and renderers.
-
-        The caller must call DecRef() on the returned pointer.
+        Sets the default font to be used for grid cell text.
     */
     */
-    wxGridCellRenderer* GetCellRenderer(int row, int col) const;
+    void SetDefaultCellFont(const wxFont& font);
 
     /**
 
     /**
-        Returns the text colour for the grid cell at the specified location.
+        Sets the current default colour for grid cell text.
     */
     */
-    wxColour GetCellTextColour(int row, int col) const;
-
-    //@{
-    /**
-        Returns the string contained in the cell at the specified location.
-
-        For simple applications where a grid object automatically uses a
-        default grid table of string values you use this function together with
-        SetCellValue() to access cell values. For more complex applications
-        where you have derived your own grid table class that contains various
-        data types (e.g. numeric, boolean or user-defined custom types) then
-        you only use this function for those cells that contain string values.
+    void SetDefaultCellTextColour(const wxColour& colour);
 
 
-        See wxGridTableBase::CanGetValueAs and the @ref overview_grid "wxGrid overview"
-        for more information.
-    */
-    wxString GetCellValue(int row, int col) const;
-    const wxString  GetCellValue(const wxGridCellCoords& coords) const;
     //@}
 
     //@}
 
-    /**
-        Returns the column ID of the specified column position.
-    */
-    int GetColAt(int colPos) const;
 
     /**
 
     /**
-        Returns the pen used for vertical grid lines.
-
-        This virtual function may be overridden in derived classes in order to
-        change the appearance of individual grid lines for the given column @e
-        col.
+        @name Cell Values, Editors, and Renderers
 
 
-        See GetRowGridLinePen() for an example.
-    */
-    virtual wxPen GetColGridLinePen(int col);
+        Note that wxGridCellAttr can be used alternatively to most of these
+        methods. See the "Attributes Management" of wxGridTableBase.
+     */
+    //@{
 
     /**
 
     /**
-        Sets the arguments to the current column label alignment values.
-
-        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
-        or @c wxALIGN_RIGHT.
-
-        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
-        @c wxALIGN_BOTTOM.
-    */
-    void GetColLabelAlignment(int* horiz, int* vert) const;
+        Returns @true if the in-place edit control for the current grid cell
+        can be used and @false otherwise.
 
 
-    /**
-        Returns the current height of the column labels.
+        This function always returns @false for the read-only cells.
     */
     */
-    int GetColLabelSize() const;
+    bool CanEnableCellControl() const;
 
     /**
 
     /**
-        Returns the specified column label.
-
-        The default grid table class provides column labels of the form
-        A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can
-        override wxGridTableBase::GetColLabelValue to provide your own labels.
-    */
-    wxString GetColLabelValue(int col) const;
+        Disables in-place editing of grid cells.
 
 
-    /**
-        Returns the coordinate of the left border specified column.
+        Equivalent to calling EnableCellEditControl(@false).
     */
     */
-    int GetColLeft(int col) const;
+    void DisableCellEditControl();
 
     /**
 
     /**
-        Returns the minimal width to which a column may be resized.
+        Enables or disables in-place editing of grid cell data.
 
 
-        Use SetColMinimalAcceptableWidth() to change this value globally or
-        SetColMinimalWidth() to do it for individual columns.
+        The grid will issue either a @c wxEVT_GRID_EDITOR_SHOWN or
+        @c wxEVT_GRID_EDITOR_HIDDEN event.
     */
     */
-    int GetColMinimalAcceptableWidth() const;
+    void EnableCellEditControl(bool enable = true);
 
     /**
 
     /**
-        Get the minimal width of the given column/row.
+        Makes the grid globally editable or read-only.
 
 
-        The value returned by this function may be different than that returned
-        by GetColMinimalAcceptableWidth() if SetColMinimalWidth() had been
-        called for this column.
-    */
-    int GetColMinimalWidth(int col) const;
+        If the edit argument is @false this function sets the whole grid as
+        read-only. If the argument is @true the grid is set to the default
+        state where cells may be editable. In the default state you can set
+        single grid cells and whole rows and columns to be editable or
+        read-only via wxGridCellAttr::SetReadOnly(). For single cells you
+        can also use the shortcut function SetReadOnly().
 
 
-    /**
-        Returns the position of the specified column.
+        For more information about controlling grid cell attributes see the
+        wxGridCellAttr class and the @ref overview_grid.
     */
     */
-    int GetColPos(int colID) const;
+    void EnableEditing(bool edit);
 
     /**
 
     /**
-        Returns the coordinate of the right border specified column.
-    */
-    int GetColRight(int col) const;
+        Returns a pointer to the editor for the cell at the specified location.
 
 
-    /**
-        Returns the width of the specified column.
+        See wxGridCellEditor and the @ref overview_grid for more information
+        about cell editors and renderers.
+
+        The caller must call DecRef() on the returned pointer.
     */
     */
-    int GetColSize(int col) const;
+    wxGridCellEditor* GetCellEditor(int row, int col) const;
 
     /**
 
     /**
-        Returns the default cell alignment.
-
-        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
-        or @c wxALIGN_RIGHT.
+        Returns a pointer to the renderer for the grid cell at the specified
+        location.
 
 
-        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
-        @c wxALIGN_BOTTOM.
+        See wxGridCellRenderer and the @ref overview_grid for more information
+        about cell editors and renderers.
 
 
-        @see SetDefaultCellAlignment()
+        The caller must call DecRef() on the returned pointer.
     */
     */
-    void GetDefaultCellAlignment(int* horiz, int* vert) const;
+    wxGridCellRenderer* GetCellRenderer(int row, int col) const;
 
     /**
 
     /**
-        Returns the current default background colour for grid cells.
-    */
-    wxColour GetDefaultCellBackgroundColour() const;
+        Returns the string contained in the cell at the specified location.
 
 
-    /**
-        Returns the current default font for grid cell text.
-    */
-    wxFont GetDefaultCellFont() const;
+        For simple applications where a grid object automatically uses a
+        default grid table of string values you use this function together with
+        SetCellValue() to access cell values. For more complex applications
+        where you have derived your own grid table class that contains various
+        data types (e.g. numeric, boolean or user-defined custom types) then
+        you only use this function for those cells that contain string values.
 
 
-    /**
-        Returns the current default colour for grid cell text.
+        See wxGridTableBase::CanGetValueAs() and the @ref overview_grid for
+        more information.
     */
     */
-    wxColour GetDefaultCellTextColour() const;
-
+    wxString GetCellValue(int row, int col) const;
     /**
     /**
-        Returns the default height for column labels.
-    */
-    int GetDefaultColLabelSize() const;
+        Returns the string contained in the cell at the specified location.
 
 
-    /**
-        Returns the current default width for grid columns.
+        For simple applications where a grid object automatically uses a
+        default grid table of string values you use this function together with
+        SetCellValue() to access cell values. For more complex applications
+        where you have derived your own grid table class that contains various
+        data types (e.g. numeric, boolean or user-defined custom types) then
+        you only use this function for those cells that contain string values.
+
+        See wxGridTableBase::CanGetValueAs() and the @ref overview_grid for
+        more information.
     */
     */
-    int GetDefaultColSize() const;
+    const wxString& GetCellValue(const wxGridCellCoords& coords) const;
 
     /**
         Returns a pointer to the current default grid cell editor.
 
 
     /**
         Returns a pointer to the current default grid cell editor.
 
-        See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
-        for more information about cell editors and renderers.
+        See wxGridCellEditor and the @ref overview_grid for more information
+        about cell editors and renderers.
     */
     wxGridCellEditor* GetDefaultEditor() const;
 
     */
     wxGridCellEditor* GetDefaultEditor() const;
 
-    //@{
     /**
         Returns the default editor for the specified cell.
 
     /**
         Returns the default editor for the specified cell.
 
@@ -1899,14 +1682,25 @@ public:
         cell type but this method may be overridden in the derived classes to
         use custom editors for some cells by default.
 
         cell type but this method may be overridden in the derived classes to
         use custom editors for some cells by default.
 
-        Notice that the same may be usually achieved in simpler way by
+        Notice that the same may be achieved in a usually simpler way by
         associating a custom editor with the given cell or cells.
 
         The caller must call DecRef() on the returned pointer.
     */
     virtual wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const;
         associating a custom editor with the given cell or cells.
 
         The caller must call DecRef() on the returned pointer.
     */
     virtual wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const;
-    wxGridCellEditor*  GetDefaultEditorForCell(const wxGridCellCoords& c) const;
-    //@}
+    /**
+        Returns the default editor for the specified cell.
+
+        The base class version returns the editor appropriate for the current
+        cell type but this method may be overridden in the derived classes to
+        use custom editors for some cells by default.
+
+        Notice that the same may be achieved in a usually simpler way by
+        associating a custom editor with the given cell or cells.
+
+        The caller must call DecRef() on the returned pointer.
+    */
+    wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c) const;
 
     /**
         Returns the default editor for the cells containing values of the given
 
     /**
         Returns the default editor for the cells containing values of the given
@@ -1919,25 +1713,13 @@ public:
 
         The caller must call DecRef() on the returned pointer.
     */
 
         The caller must call DecRef() on the returned pointer.
     */
-    virtual wxGridCellEditor *
-    GetDefaultEditorForType(const wxString& typeName) const;
-
-    /**
-        Returns the pen used for grid lines.
-
-        This virtual function may be overridden in derived classes in order to
-        change the appearance of grid lines. Note that currently the pen width
-        must be 1.
-
-        @see GetColGridLinePen(), GetRowGridLinePen()
-    */
-    virtual wxPen GetDefaultGridLinePen();
+    virtual wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName) const;
 
     /**
         Returns a pointer to the current default grid cell renderer.
 
 
     /**
         Returns a pointer to the current default grid cell renderer.
 
-        See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
-        for more information about cell editors and renderers.
+        See wxGridCellRenderer and the @ref overview_grid for more information
+        about cell editors and renderers.
 
         The caller must call DecRef() on the returned pointer.
     */
 
         The caller must call DecRef() on the returned pointer.
     */
@@ -1952,7 +1734,7 @@ public:
 
         The caller must call DecRef() on the returned pointer.
     */
 
         The caller must call DecRef() on the returned pointer.
     */
-    virtual wxGridCellRenderer *GetDefaultRendererForCell(int row, int col) const;
+    virtual wxGridCellRendererGetDefaultRendererForCell(int row, int col) const;
 
     /**
         Returns the default renderer for the cell containing values of the
 
     /**
         Returns the default renderer for the cell containing values of the
@@ -1960,1156 +1742,1963 @@ public:
 
         @see GetDefaultEditorForType()
     */
 
         @see GetDefaultEditorForType()
     */
-    virtual wxGridCellRenderer *
-    GetDefaultRendererForType(const wxString& typeName) const;
+    virtual wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const;
 
     /**
 
     /**
-        Returns the default width for the row labels.
+        Hides the in-place cell edit control.
     */
     */
-    int GetDefaultRowLabelSize() const;
+    void HideCellEditControl();
 
     /**
 
     /**
-        Returns the current default height for grid rows.
+        Returns @true if the in-place edit control is currently enabled.
     */
     */
-    int GetDefaultRowSize() const;
+    bool IsCellEditControlEnabled() const;
 
     /**
 
     /**
-        Returns the current grid cell column position.
+        Returns @true if the current cell is read-only.
+
+        @see SetReadOnly(), IsReadOnly()
     */
     */
-    int GetGridCursorCol() const;
+    bool IsCurrentCellReadOnly() const;
 
     /**
 
     /**
-        Returns the current grid cell row position.
-    */
-    int GetGridCursorRow() const;
-
-    /**
-        Returns the colour used for grid lines.
+        Returns @false if the whole grid has been set as read-only or @true
+        otherwise.
 
 
-        @see GetDefaultGridLinePen()
+        See EnableEditing() for more information about controlling the editing
+        status of grid cells.
     */
     */
-    wxColour GetGridLineColour() const;
+    bool IsEditable() const;
 
     /**
 
     /**
-        Returns the colour used for the background of row and column labels.
-    */
-    wxColour GetLabelBackgroundColour() const;
+        Returns @true if the cell at the specified location can't be edited.
 
 
-    /**
-        Returns the font used for row and column labels.
+        @see SetReadOnly(), IsCurrentCellReadOnly()
     */
     */
-    wxFont GetLabelFont() const;
+    bool IsReadOnly(int row, int col) const;
 
     /**
 
     /**
-        Returns the colour used for row and column label text.
-    */
-    wxColour GetLabelTextColour() const;
+        Register a new data type.
 
 
-    /**
-        Returns the total number of grid columns.
+        The data types allow to naturally associate specific renderers and
+        editors to the cells containing values of the given type. For example,
+        the grid automatically registers a data type with the name
+        @c wxGRID_VALUE_STRING which uses wxGridCellStringRenderer and
+        wxGridCellTextEditor as its renderer and editor respectively -- this is
+        the data type used by all the cells of the default wxGridStringTable,
+        so this renderer and editor are used by default for all grid cells.
+
+        However if a custom table returns @c wxGRID_VALUE_BOOL from its
+        wxGridTableBase::GetTypeName() method, then wxGridCellBoolRenderer and
+        wxGridCellBoolEditor are used for it because the grid also registers a
+        boolean data type with this name.
+
+        And as this mechanism is completely generic, you may register your own
+        data types using your own custom renderers and editors. Just remember
+        that the table must identify a cell as being of the given type for them
+        to be used for this cell.
 
 
-        This is the same as the number of columns in the underlying grid
-        table.
+        @param typeName
+            Name of the new type. May be any string, but if the type name is
+            the same as the name of an already registered type, including one
+            of the standard ones (which are @c wxGRID_VALUE_STRING, @c
+            wxGRID_VALUE_BOOL, @c wxGRID_VALUE_NUMBER, @c wxGRID_VALUE_FLOAT
+            and @c wxGRID_VALUE_CHOICE), then the new registration information
+            replaces the previously used renderer and editor.
+        @param renderer
+            The renderer to use for the cells of this type. Its ownership is
+            taken by the grid, i.e. it will call DecRef() on this pointer when
+            it doesn't need it any longer.
+        @param editor
+            The editor to use for the cells of this type. Its ownership is also
+            taken by the grid.
     */
     */
-    int GetNumberCols() const;
+    void RegisterDataType(const wxString& typeName,
+                          wxGridCellRenderer* renderer,
+                          wxGridCellEditor* editor);
 
     /**
 
     /**
-        Returns the total number of grid rows.
+        Sets the value of the current grid cell to the current in-place edit
+        control value.
 
 
-        This is the same as the number of rows in the underlying grid table.
+        This is called automatically when the grid cursor moves from the
+        current cell to a new cell. It is also a good idea to call this
+        function when closing a grid since any edits to the final cell location
+        will not be saved otherwise.
     */
     */
-    int GetNumberRows() const;
+    void SaveEditControlValue();
 
     /**
 
     /**
-        Returns the attribute for the given cell creating one if necessary.
+        Sets the editor for the grid cell at the specified location.
 
 
-        If the cell already has an attribute, it is returned. Otherwise a new
-        attribute is created, associated with the cell and returned. In any
-        case the caller must call DecRef() on the returned pointer.
+        The grid will take ownership of the pointer.
 
 
-        This function may only be called if CanHaveAttributes() returns @true.
+        See wxGridCellEditor and the @ref overview_grid for more information
+        about cell editors and renderers.
     */
     */
-    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+    void SetCellEditor(int row, int col, wxGridCellEditor* editor);
 
     /**
 
     /**
-        Returns the pen used for horizontal grid lines.
+        Sets the renderer for the grid cell at the specified location.
 
 
-        This virtual function may be overridden in derived classes in order to
-        change the appearance of individual grid line for the given row @e row.
+        The grid will take ownership of the pointer.
 
 
-        Example:
-        @code
-           // in a grid displaying music notation, use a solid black pen between
-           // octaves (C0=row 127, C1=row 115 etc.)
-           wxPen MidiGrid::GetRowGridLinePen(int row)
-           {
-               if ( row % 12 == 7 )
-                  return wxPen(*wxBLACK, 1, wxSOLID);
-               else
-                  return GetDefaultGridLinePen();
-           }
-        @endcode
+        See wxGridCellRenderer and the @ref overview_grid for more information
+        about cell editors and renderers.
     */
     */
-    virtual wxPen GetRowGridLinePen(int row);
+    void SetCellRenderer(int row, int col, wxGridCellRenderer* renderer);
 
     /**
 
     /**
-        Returns the alignment used for row labels.
+        Sets the string value for the cell at the specified location.
 
 
-        Horizontal alignment will be one of @c wxALIGN_LEFT, @c wxALIGN_CENTRE
-        or @c wxALIGN_RIGHT.
+        For simple applications where a grid object automatically uses a
+        default grid table of string values you use this function together with
+        GetCellValue() to access cell values. For more complex applications
+        where you have derived your own grid table class that contains various
+        data types (e.g. numeric, boolean or user-defined custom types) then
+        you only use this function for those cells that contain string values.
 
 
-        Vertical alignment will be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE or
-        @c wxALIGN_BOTTOM.
+        See wxGridTableBase::CanSetValueAs() and the @ref overview_grid for
+        more information.
     */
     */
-    void GetRowLabelAlignment(int* horiz, int* vert) const;
+    void SetCellValue(int row, int col, const wxString& s);
+    /**
+        Sets the string value for the cell at the specified location.
+
+        For simple applications where a grid object automatically uses a
+        default grid table of string values you use this function together with
+        GetCellValue() to access cell values. For more complex applications
+        where you have derived your own grid table class that contains various
+        data types (e.g. numeric, boolean or user-defined custom types) then
+        you only use this function for those cells that contain string values.
 
 
+        See wxGridTableBase::CanSetValueAs() and the @ref overview_grid for
+        more information.
+    */
+    void SetCellValue(const wxGridCellCoords& coords, const wxString& s);
     /**
     /**
-        Returns the current width of the row labels.
+        @deprecated Please use SetCellValue(int,int,const wxString&) or
+                    SetCellValue(const wxGridCellCoords&,const wxString&)
+                    instead.
+
+        Sets the string value for the cell at the specified location.
+
+        For simple applications where a grid object automatically uses a
+        default grid table of string values you use this function together with
+        GetCellValue() to access cell values. For more complex applications
+        where you have derived your own grid table class that contains various
+        data types (e.g. numeric, boolean or user-defined custom types) then
+        you only use this function for those cells that contain string values.
+
+        See wxGridTableBase::CanSetValueAs() and the @ref overview_grid for
+        more information.
     */
     */
-    int GetRowLabelSize() const;
+    void SetCellValue(const wxString& val, int row, int col);
 
     /**
 
     /**
-        Returns the specified row label.
+        Sets the specified column to display boolean values.
 
 
-        The default grid table class provides numeric row labels. If you are
-        using a custom grid table you can override
-        wxGridTableBase::GetRowLabelValue to provide your own labels.
+        @see SetColFormatCustom()
     */
     */
-    wxString GetRowLabelValue(int row) const;
+    void SetColFormatBool(int col);
 
     /**
 
     /**
-        Returns the minimal size to which rows can be resized.
+        Sets the specified column to display data in a custom format.
 
 
-        Use SetRowMinimalAcceptableHeight() to change this value globally or
-        SetRowMinimalHeight() to do it for individual cells.
+        This method provides an alternative to defining a custom grid table
+        which would return @a typeName from its GetTypeName() method for the
+        cells in this column: while it doesn't really change the type of the
+        cells in this column, it does associate the renderer and editor used
+        for the cells of the specified type with them.
 
 
-        @see GetColMinimalAcceptableWidth()
+        See the @ref overview_grid for more information on working with custom
+        data types.
     */
     */
-    int GetRowMinimalAcceptableHeight() const;
+    void SetColFormatCustom(int col, const wxString& typeName);
 
     /**
 
     /**
-        Returns the minimal size for the given column.
+        Sets the specified column to display floating point values with the
+        given width and precision.
 
 
-        The value returned by this function may be different than that returned
-        by GetRowMinimalAcceptableHeight() if SetRowMinimalHeight() had been
-        called for this row.
+        @see SetColFormatCustom()
     */
     */
-    int GetRowMinimalHeight(int col) const;
+    void SetColFormatFloat(int col, int width = -1, int precision = -1);
 
     /**
 
     /**
-        Returns the height of the specified row.
+        Sets the specified column to display integer values.
+
+        @see SetColFormatCustom()
     */
     */
-    int GetRowSize(int row) const;
+    void SetColFormatNumber(int col);
 
     /**
 
     /**
-        Returns the number of pixels per horizontal scroll increment.
+        Sets the default editor for grid cells.
 
 
-        The default is 15.
+        The grid will take ownership of the pointer.
 
 
-        @see GetScrollLineY(), SetScrollLineX(), SetScrollLineY()
+        See wxGridCellEditor and the @ref overview_grid for more information
+        about cell editors and renderers.
     */
     */
-    int GetScrollLineX() const;
+    void SetDefaultEditor(wxGridCellEditor* editor);
 
     /**
 
     /**
-        Returns the number of pixels per vertical scroll increment.
+        Sets the default renderer for grid cells.
 
 
-        The default is 15.
+        The grid will take ownership of the pointer.
 
 
-        @see GetScrollLineX(), SetScrollLineX(), SetScrollLineY()
+        See wxGridCellRenderer and the @ref overview_grid for more information
+        about cell editors and renderers.
     */
     */
-    int GetScrollLineY() const;
+    void SetDefaultRenderer(wxGridCellRenderer* renderer);
 
     /**
 
     /**
-        Returns an array of individually selected cells.
-
-        Notice that this array does @em not contain all the selected cells in
-        general as it doesn't include the cells selected as part of column, row
-        or block selection. You must use this method, GetSelectedCols(),
-        GetSelectedRows() and GetSelectionBlockTopLeft() and
-        GetSelectionBlockBottomRight() methods to obtain the entire selection
-        in general.
+        Makes the cell at the specified location read-only or editable.
 
 
-        Please notice this behaviour is by design and is needed in order to
-        support grids of arbitrary size (when an entire column is selected in
-        a grid with a million of columns, we don't want to create an array with
-        a million of entries in this function, instead it returns an empty
-        array and GetSelectedCols() returns an array containing one element).
+        @see IsReadOnly()
     */
     */
-    wxGridCellCoordsArray GetSelectedCells() const;
+    void SetReadOnly(int row, int col, bool isReadOnly = true);
 
     /**
 
     /**
-        Returns an array of selected columns.
-
-        Please notice that this method alone is not sufficient to find all the
-        selected columns as it contains only the columns which were
-        individually selected but not those being part of the block selection
-        or being selected in virtue of all of their cells being selected
-        individually, please see GetSelectedCells() for more details.
+        Displays the in-place cell edit control for the current cell.
     */
     */
-    wxArrayInt GetSelectedCols() const;
+    void ShowCellEditControl();
+
+    //@}
+
 
     /**
 
     /**
-        Returns an array of selected rows.
+        @name Column and Row Sizes
+     */
+    //@{
 
 
-        Please notice that this method alone is not sufficient to find all the
-        selected rows as it contains only the rows which were individually
-        selected but not those being part of the block selection or being
-        selected in virtue of all of their cells being selected individually,
-        please see GetSelectedCells() for more details.
+    /**
+        Automatically sets the height and width of all rows and columns to fit
+        their contents.
     */
     */
-    wxArrayInt GetSelectedRows() const;
+    void AutoSize();
 
     /**
 
     /**
-        Access or update the selection fore/back colours
+        Automatically adjusts width of the column to fit its label.
     */
     */
-    wxColour GetSelectionBackground() const;
+    void AutoSizeColLabelSize(int col);
 
     /**
 
     /**
-        Returns an array of the bottom right corners of blocks of selected
-        cells.
-
-        Please see GetSelectedCells() for more information about the selection
-        representation in wxGrid.
-
-        @see GetSelectionBlockTopLeft()
+        Automatically sizes the column to fit its contents. If @a setAsMin is
+        @true the calculated width will also be set as the minimal width for
+        the column.
     */
     */
-    wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
+    void AutoSizeColumn(int col, bool setAsMin = true);
 
     /**
 
     /**
-        Returns an array of the top left corners of blocks of selected cells.
-
-        Please see GetSelectedCells() for more information about the selection
-        representation in wxGrid.
-
-        @see GetSelectionBlockBottomRight()
+        Automatically sizes all columns to fit their contents. If @a setAsMin
+        is @true the calculated widths will also be set as the minimal widths
+        for the columns.
     */
     */
-    wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
+    void AutoSizeColumns(bool setAsMin = true);
 
     /**
 
     /**
-        Returns the colour used for drawing the selection foreground.
+        Automatically sizes the row to fit its contents. If @a setAsMin is
+        @true the calculated height will also be set as the minimal height for
+        the row.
     */
     */
-    wxColour GetSelectionForeground() const;
+    void AutoSizeRow(int row, bool setAsMin = true);
 
     /**
 
     /**
-        Returns the current selection mode.
-
-        @see SetSelectionMode().
+        Automatically adjusts height of the row to fit its label.
     */
     */
-    wxGridSelectionModes GetSelectionMode() const;
+    void AutoSizeRowLabelSize(int col);
 
     /**
 
     /**
-        Returns a base pointer to the current table object.
+        Automatically sizes all rows to fit their contents. If @a setAsMin is
+        @true the calculated heights will also be set as the minimal heights
+        for the rows.
+    */
+    void AutoSizeRows(bool setAsMin = true);
 
 
-        The returned pointer is still owned by the grid.
+    /**
+        Returns the current height of the column labels.
     */
     */
-    wxGridTableBase *GetTable() const;
+    int GetColLabelSize() const;
 
 
-    //@{
     /**
     /**
-        Make the given cell current and ensure it is visible.
+        Returns the minimal width to which a column may be resized.
 
 
-        This method is equivalent to calling MakeCellVisible() and
-        SetGridCursor() and so, as with the latter, a wxEVT_GRID_SELECT_CELL
-        event is generated by it and the selected cell doesn't change if the
-        event is vetoed.
-     */
-    void GoToCell(int row, int col);
-    void GoToCell(const wxGridCellCoords& coords);
-    //@}
+        Use SetColMinimalAcceptableWidth() to change this value globally or
+        SetColMinimalWidth() to do it for individual columns.
+
+        @see GetRowMinimalAcceptableHeight()
+    */
+    int GetColMinimalAcceptableWidth() const;
 
     /**
 
     /**
-        Returns @true if drawing of grid lines is turned on, @false otherwise.
+        Returns the width of the specified column.
     */
     */
-    bool GridLinesEnabled() const;
+    int GetColSize(int col) const;
 
     /**
 
     /**
-        Hides the in-place cell edit control.
+        Returns @true if the specified column is not currently hidden.
+     */
+    bool IsColShown(int col) const;
+
+    /**
+        Returns the default height for column labels.
     */
     */
-    void HideCellEditControl();
+    int GetDefaultColLabelSize() const;
 
     /**
 
     /**
-        Hides the column labels by calling SetColLabelSize()
-        with a size of 0. Show labels again by calling that method with
-        a width greater than 0.
+        Returns the current default width for grid columns.
     */
     */
-    void HideColLabels();
+    int GetDefaultColSize() const;
 
     /**
 
     /**
-        Hides the row labels by calling SetRowLabelSize() with a size of 0.
+        Returns the default width for the row labels.
+    */
+    int GetDefaultRowLabelSize() const;
 
 
-        The labels can be shown again by calling SetRowLabelSize() with a width
-        greater than 0.
+    /**
+        Returns the current default height for grid rows.
     */
     */
-    void HideRowLabels();
+    int GetDefaultRowSize() const;
 
     /**
 
     /**
-        Inserts one or more new columns into a grid with the first new column
-        at the specified position.
+        Returns the minimal size to which rows can be resized.
 
 
-        Notice that inserting the columns in the grid requires grid table
-        cooperation: when this method is called, grid object begins by
-        requesting the underlying grid table to insert new columns. If this is
-        successful the table notifies the grid and the grid updates the
-        display. For a default grid (one where you have called
-        wxGrid::CreateGrid) this process is automatic. If you are using a
-        custom grid table (specified with wxGrid::SetTable) then you must
-        override wxGridTableBase::InsertCols() in your derived table class.
+        Use SetRowMinimalAcceptableHeight() to change this value globally or
+        SetRowMinimalHeight() to do it for individual cells.
 
 
-        @param pos
-            The position which the first newly inserted column will have.
-        @param numCols
-            The number of columns to insert.
-        @param updateLabels
-            Currently not used.
-        @return
-            @true if the columns were successfully inserted, @false if an error
-            occurred (most likely the table couldn't be updated).
+        @see GetColMinimalAcceptableWidth()
     */
     */
-    bool InsertCols(int pos = 0, int numCols = 1, bool updateLabels = true);
+    int GetRowMinimalAcceptableHeight() const;
 
     /**
 
     /**
-        Inserts one or more new rows into a grid with the first new row at the
-        specified position.
-
-        Notice that you must implement wxGridTableBase::InsertRows() if you use
-        a grid with a custom table, please see InsertCols() for more
-        information.
-
-        @param pos
-            The position which the first newly inserted row will have.
-        @param numRows
-            The number of rows to insert.
-        @param updateLabels
-            Currently not used.
-        @return
-            @true if the rows were successfully inserted, @false if an error
-            occurred (most likely the table couldn't be updated).
+        Returns the current width of the row labels.
     */
     */
-    bool InsertRows(int pos = 0, int numRows = 1, bool updateLabels = true);
+    int GetRowLabelSize() const;
 
     /**
 
     /**
-        Returns @true if the in-place edit control is currently enabled.
+        Returns the height of the specified row.
     */
     */
-    bool IsCellEditControlEnabled() const;
+    int GetRowSize(int row) const;
 
     /**
 
     /**
-        Returns @true if the current cell is read-only.
+        Returns @true if the specified row is not currently hidden.
+     */
+    bool IsRowShown(int row) const;
 
 
-        @see SetReadOnly(), IsReadOnly()
+    /**
+        Sets the height of the column labels.
+
+        If @a height equals to @c wxGRID_AUTOSIZE then height is calculated
+        automatically so that no label is truncated. Note that this could be
+        slow for a large table.
     */
     */
-    bool IsCurrentCellReadOnly() const;
+    void SetColLabelSize(int height);
 
     /**
 
     /**
-        Returns @false if the whole grid has been set as read-only or @true
-        otherwise.
+        Sets the minimal @a width to which the user can resize columns.
 
 
-        See EnableEditing() for more information about controlling the editing
-        status of grid cells.
+        @see GetColMinimalAcceptableWidth()
     */
     */
-    bool IsEditable() const;
+    void SetColMinimalAcceptableWidth(int width);
 
 
-    //@{
     /**
     /**
-        Is this cell currently selected?
+        Sets the minimal @a width for the specified column @a col.
+
+        It is usually best to call this method during grid creation as calling
+        it later will not resize the column to the given minimal width even if
+        it is currently narrower than it.
+
+        @a width must be greater than the minimal acceptable column width as
+        returned by GetColMinimalAcceptableWidth().
     */
     */
-    bool IsInSelection(int row, int col) const;
-    bool IsInSelection(const wxGridCellCoords& coords) const;
-    //@}
+    void SetColMinimalWidth(int col, int width);
 
     /**
 
     /**
-        Returns @true if the cell at the specified location can't be edited.
+        Sets the width of the specified column.
 
 
-        @see SetReadOnly(), IsCurrentCellReadOnly()
+        @param col
+            The column index.
+        @param width
+            The new column width in pixels, 0 to hide the column or -1 to fit
+            the column width to its label width.
     */
     */
-    bool IsReadOnly(int row, int col) const;
+    void SetColSize(int col, int width);
 
     /**
 
     /**
-        Returns @true if there are currently any selected cells, rows, columns
-        or blocks.
-    */
-    bool IsSelection() const;
+        Hides the specified column.
+
+        To show the column later you need to call SetColSize() with non-0
+        width or ShowCol().
+
+        @param col
+            The column index.
+     */
+    void HideCol(int col);
 
 
-    //@{
     /**
     /**
-        Returns @true if a cell is either wholly or at least partially visible
-        in the grid window.
+        Shows the previously hidden column by resizing it to non-0 size.
+
+        @see HideCol(), SetColSize()
+     */
+    void ShowCol(int col);
 
 
-        By default, the cell must be entirely visible for this function to
-        return true but if @a wholeCellVisible is @false, the function returns
-        @true even if the cell is only partially visible.
-    */
-    bool IsVisible(int row, int col, bool wholeCellVisible = true) const;
-    const bool IsVisible(const wxGridCellCoords& coords,
-                         bool wholeCellVisible = true) const;
-    //@}
 
 
-    //@{
     /**
     /**
-        Brings the specified cell into the visible grid cell area with minimal
-        scrolling.
+        Sets the default width for columns in the grid.
 
 
-        Does nothing if the cell is already visible.
+        This will only affect columns subsequently added to the grid unless
+        @a resizeExistingCols is @true.
+
+        If @a width is less than GetColMinimalAcceptableWidth(), then the
+        minimal acceptable width is used instead of it.
     */
     */
-    void MakeCellVisible(int row, int col);
-    void MakeCellVisible(const wxGridCellCoords& coords);
-    //@}
+    void SetDefaultColSize(int width, bool resizeExistingCols = false);
 
     /**
 
     /**
-        Moves the grid cursor down by one row.
+        Sets the default height for rows in the grid.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        This will only affect rows subsequently added to the grid unless
+        @a resizeExistingRows is @true.
+
+        If @a height is less than GetRowMinimalAcceptableHeight(), then the
+        minimal acceptable heihgt is used instead of it.
     */
     */
-    bool MoveCursorDown(bool expandSelection);
+    void SetDefaultRowSize(int height, bool resizeExistingRows = false);
 
     /**
 
     /**
-        Moves the grid cursor down in the current column such that it skips to
-        the beginning or end of a block of non-empty cells.
+        Sets the width of the row labels.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        If @a width equals @c wxGRID_AUTOSIZE then width is calculated
+        automatically so that no label is truncated. Note that this could be
+        slow for a large table.
     */
     */
-    bool MoveCursorDownBlock(bool expandSelection);
+    void SetRowLabelSize(int width);
 
     /**
 
     /**
-        Moves the grid cursor left by one column.
+        Sets the minimal row @a height used by default.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        See SetColMinimalAcceptableWidth() for more information.
     */
     */
-    bool MoveCursorLeft(bool expandSelection);
+    void SetRowMinimalAcceptableHeight(int height);
 
     /**
 
     /**
-        Moves the grid cursor left in the current row such that it skips to the
-        beginning or end of a block of non-empty cells.
+        Sets the minimal @a height for the specified @a row.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        See SetColMinimalWidth() for more information.
     */
     */
-    bool MoveCursorLeftBlock(bool expandSelection);
+    void SetRowMinimalHeight(int row, int height);
 
     /**
 
     /**
-        Moves the grid cursor right by one column.
+        Sets the height of the specified row.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        See SetColSize() for more information.
     */
     */
-    bool MoveCursorRight(bool expandSelection);
+    void SetRowSize(int row, int height);
 
     /**
 
     /**
-        Moves the grid cursor right in the current row such that it skips to
-        the beginning or end of a block of non-empty cells.
+        Hides the specified row.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        To show the row later you need to call SetRowSize() with non-0
+        width or ShowRow().
+
+        @param col
+            The row index.
+     */
+    void HideRow(int col);
+
+    /**
+        Shows the previously hidden row by resizing it to non-0 size.
+
+        @see HideRow(), SetRowSize()
+     */
+    void ShowRow(int col);
+
+    //@}
+
+
+    /**
+        @name User-Resizing and Dragging
+     */
+    //@{
+
+    /**
+        Return @true if the dragging of cells is enabled or @false otherwise.
     */
     */
-    bool MoveCursorRightBlock(bool expandSelection);
+    bool CanDragCell() const;
 
     /**
 
     /**
-        Moves the grid cursor up by one row.
+        Returns @true if columns can be moved by dragging with the mouse.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        Columns can be moved by dragging on their labels.
     */
     */
-    bool MoveCursorUp(bool expandSelection);
+    bool CanDragColMove() const;
 
     /**
 
     /**
-        Moves the grid cursor up in the current column such that it skips to
-        the beginning or end of a block of non-empty cells.
+        Returns @true if columns can be resized by dragging with the mouse.
 
 
-        If a block of cells was previously selected it will expand if the
-        argument is @true or be cleared if the argument is @false.
+        Columns can be resized by dragging the edges of their labels. If grid
+        line dragging is enabled they can also be resized by dragging the right
+        edge of the column in the grid cell area (see EnableDragGridSize()).
     */
     */
-    bool MoveCursorUpBlock(bool expandSelection);
+    bool CanDragColSize() const;
 
     /**
 
     /**
-        Moves the grid cursor down by some number of rows so that the previous
-        bottom visible row becomes the top visible row.
+        Return @true if the dragging of grid lines to resize rows and columns
+        is enabled or @false otherwise.
     */
     */
-    bool MovePageDown();
+    bool CanDragGridSize() const;
 
     /**
 
     /**
-        Moves the grid cursor up by some number of rows so that the previous
-        top visible row becomes the bottom visible row.
+        Returns @true if rows can be resized by dragging with the mouse.
+
+        Rows can be resized by dragging the edges of their labels. If grid line
+        dragging is enabled they can also be resized by dragging the lower edge
+        of the row in the grid cell area (see EnableDragGridSize()).
     */
     */
-    bool MovePageUp();
+    bool CanDragRowSize() const;
 
     /**
 
     /**
-        Register a new data type.
+        Disables column moving by dragging with the mouse.
 
 
-        The data types allow to naturally associate specific renderers and
-        editors to the cells containing values of the given type. For example,
-        the grid automatically registers a data type with the name @c
-        wxGRID_VALUE_STRING which uses wxGridCellStringRenderer and
-        wxGridCellTextEditor as its renderer and editor respectively -- this is
-        the data type used by all the cells of the default wxGridStringTable,
-        so this renderer and editor are used by default for all grid cells.
+        Equivalent to passing @false to EnableDragColMove().
+    */
+    void DisableDragColMove();
 
 
-        However if a custom table returns @c wxGRID_VALUE_BOOL from its
-        wxGridTableBase::GetTypeName() method, then wxGridCellBoolRenderer and
-        wxGridCellBoolEditor are used for it because the grid also registers a
-        boolean data type with this name.
+    /**
+        Disables column sizing by dragging with the mouse.
 
 
-        And as this mechanism is completely generic, you may register your own
-        data types using your own custom renderers and editors. Just remember
-        that the table must identify a cell as being of the given type for them
-        to be used for this cell.
+        Equivalent to passing @false to EnableDragColSize().
+    */
+    void DisableDragColSize();
 
 
-        @param typeName
-            Name of the new type. May be any string, but if the type name is
-            the same as the name of an already registered type, including one
-            of the standard ones (which are @c wxGRID_VALUE_STRING, @c
-            wxGRID_VALUE_BOOL, @c wxGRID_VALUE_NUMBER, @c wxGRID_VALUE_FLOAT
-            and @c wxGRID_VALUE_CHOICE), then the new registration information
-            replaces the previously used renderer and editor.
-        @param renderer
-            The renderer to use for the cells of this type. Its ownership is
-            taken by the grid, i.e. it will call DecRef() on this pointer when
-            it doesn't need it any longer.
-        @param editor
-            The editor to use for the cells of this type. Its ownership is also
-            taken by the grid.
+    /**
+        Disable mouse dragging of grid lines to resize rows and columns.
+
+        Equivalent to passing @false to EnableDragGridSize()
     */
     */
-    void RegisterDataType(const wxString& typeName,
-                          wxGridCellRenderer* renderer,
-                          wxGridCellEditor* editor);
+    void DisableDragGridSize();
 
     /**
 
     /**
-        Sets the value of the current grid cell to the current in-place edit
-        control value.
+        Disables row sizing by dragging with the mouse.
 
 
-        This is called automatically when the grid cursor moves from the
-        current cell to a new cell. It is also a good idea to call this
-        function when closing a grid since any edits to the final cell location
-        will not be saved otherwise.
+        Equivalent to passing @false to EnableDragRowSize().
     */
     */
-    void SaveEditControlValue();
+    void DisableDragRowSize();
 
     /**
 
     /**
-        Selects all cells in the grid.
+        Enables or disables cell dragging with the mouse.
     */
     */
-    void SelectAll();
+    void EnableDragCell(bool enable = true);
+
+    /**
+        Enables or disables column moving by dragging with the mouse.
+    */
+    void EnableDragColMove(bool enable = true);
+
+    /**
+        Enables or disables column sizing by dragging with the mouse.
+    */
+    void EnableDragColSize(bool enable = true);
+
+    /**
+        Enables or disables row and column resizing by dragging gridlines with
+        the mouse.
+    */
+    void EnableDragGridSize(bool enable = true);
+
+    /**
+        Enables or disables row sizing by dragging with the mouse.
+    */
+    void EnableDragRowSize(bool enable = true);
+
+    /**
+        Returns the column ID of the specified column position.
+    */
+    int GetColAt(int colPos) const;
 
 
+    /**
+        Returns the position of the specified column.
+    */
+    int GetColPos(int colID) const;
+
+    /**
+        Sets the position of the specified column.
+    */
+    void SetColPos(int colID, int newPos);
+
+    /**
+        Sets the positions of all columns at once.
+
+        This method takes an array containing the indices of the columns in
+        their display order, i.e. uses the same convention as
+        wxHeaderCtrl::SetColumnsOrder().
+    */
+    void SetColumnsOrder(const wxArrayInt& order);
+
+    /**
+        Resets the position of the columns to the default.
+    */
+    void ResetColPos();
+
+    //@}
+
+
+    /**
+        @name Cursor Movement
+    */
     //@{
     //@{
+
     /**
     /**
-        Selects a rectangular block of cells.
+        Returns the current grid cell column position.
+    */
+    int GetGridCursorCol() const;
 
 
-        If @a addToSelected is @false then any existing selection will be
-        deselected; if @true the column will be added to the existing
-        selection.
+    /**
+        Returns the current grid cell row position.
     */
     */
-    void SelectBlock(int topRow, int leftCol, int bottomRow, int rightCol,
-                     bool addToSelected = false);
-    void SelectBlock(const wxGridCellCoords& topLeft,
-                     const wxGridCellCoords& bottomRight,
-                     bool addToSelected = false);
+    int GetGridCursorRow() const;
+
+    /**
+        Make the given cell current and ensure it is visible.
+
+        This method is equivalent to calling MakeCellVisible() and
+        SetGridCursor() and so, as with the latter, a @c wxEVT_GRID_SELECT_CELL
+        event is generated by it and the selected cell doesn't change if the
+        event is vetoed.
+     */
+    void GoToCell(int row, int col);
+    /**
+        Make the given cell current and ensure it is visible.
+
+        This method is equivalent to calling MakeCellVisible() and
+        SetGridCursor() and so, as with the latter, a @c wxEVT_GRID_SELECT_CELL
+        event is generated by it and the selected cell doesn't change if the
+        event is vetoed.
+     */
+    void GoToCell(const wxGridCellCoords& coords);
+
+    /**
+        Moves the grid cursor down by one row.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorDown(bool expandSelection);
+
+    /**
+        Moves the grid cursor down in the current column such that it skips to
+        the beginning or end of a block of non-empty cells.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorDownBlock(bool expandSelection);
+
+    /**
+        Moves the grid cursor left by one column.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorLeft(bool expandSelection);
+
+    /**
+        Moves the grid cursor left in the current row such that it skips to the
+        beginning or end of a block of non-empty cells.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorLeftBlock(bool expandSelection);
+
+    /**
+        Moves the grid cursor right by one column.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorRight(bool expandSelection);
+
+    /**
+        Moves the grid cursor right in the current row such that it skips to
+        the beginning or end of a block of non-empty cells.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorRightBlock(bool expandSelection);
+
+    /**
+        Moves the grid cursor up by one row.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorUp(bool expandSelection);
+
+    /**
+        Moves the grid cursor up in the current column such that it skips to
+        the beginning or end of a block of non-empty cells.
+
+        If a block of cells was previously selected it will expand if the
+        argument is @true or be cleared if the argument is @false.
+    */
+    bool MoveCursorUpBlock(bool expandSelection);
+
+    /**
+        Moves the grid cursor down by some number of rows so that the previous
+        bottom visible row becomes the top visible row.
+    */
+    bool MovePageDown();
+
+    /**
+        Moves the grid cursor up by some number of rows so that the previous
+        top visible row becomes the bottom visible row.
+    */
+    bool MovePageUp();
+
+    /**
+        Set the grid cursor to the specified cell.
+
+        The grid cursor indicates the current cell and can be moved by the user
+        using the arrow keys or the mouse.
+
+        Calling this function generates a @c wxEVT_GRID_SELECT_CELL event and
+        if the event handler vetoes this event, the cursor is not moved.
+
+        This function doesn't make the target call visible, use GoToCell() to
+        do this.
+    */
+    void SetGridCursor(int row, int col);
+    /**
+        Set the grid cursor to the specified cell.
+
+        The grid cursor indicates the current cell and can be moved by the user
+        using the arrow keys or the mouse.
+
+        Calling this function generates a @c wxEVT_GRID_SELECT_CELL event and
+        if the event handler vetoes this event, the cursor is not moved.
+
+        This function doesn't make the target call visible, use GoToCell() to
+        do this.
+    */
+    void SetGridCursor(const wxGridCellCoords& coords);
+
     //@}
 
     //@}
 
+
     /**
     /**
-        Selects the specified column.
+        @name User Selection
+     */
+    //@{
 
 
-        If @a addToSelected is @false then any existing selection will be
-        deselected; if @true the column will be added to the existing
-        selection.
+    /**
+        Deselects all cells that are currently selected.
+    */
+    void ClearSelection();
 
 
-        This method won't select anything if the current selection mode is
-        wxGridSelectRows.
+    /**
+        Returns an array of individually selected cells.
+
+        Notice that this array does @em not contain all the selected cells in
+        general as it doesn't include the cells selected as part of column, row
+        or block selection. You must use this method, GetSelectedCols(),
+        GetSelectedRows() and GetSelectionBlockTopLeft() and
+        GetSelectionBlockBottomRight() methods to obtain the entire selection
+        in general.
+
+        Please notice this behaviour is by design and is needed in order to
+        support grids of arbitrary size (when an entire column is selected in
+        a grid with a million of columns, we don't want to create an array with
+        a million of entries in this function, instead it returns an empty
+        array and GetSelectedCols() returns an array containing one element).
+    */
+    wxGridCellCoordsArray GetSelectedCells() const;
+
+    /**
+        Returns an array of selected columns.
+
+        Please notice that this method alone is not sufficient to find all the
+        selected columns as it contains only the columns which were
+        individually selected but not those being part of the block selection
+        or being selected in virtue of all of their cells being selected
+        individually, please see GetSelectedCells() for more details.
+    */
+    wxArrayInt GetSelectedCols() const;
+
+    /**
+        Returns an array of selected rows.
+
+        Please notice that this method alone is not sufficient to find all the
+        selected rows as it contains only the rows which were individually
+        selected but not those being part of the block selection or being
+        selected in virtue of all of their cells being selected individually,
+        please see GetSelectedCells() for more details.
+    */
+    wxArrayInt GetSelectedRows() const;
+
+    /**
+        Returns the colour used for drawing the selection background.
+    */
+    wxColour GetSelectionBackground() const;
+
+    /**
+        Returns an array of the bottom right corners of blocks of selected
+        cells.
+
+        Please see GetSelectedCells() for more information about the selection
+        representation in wxGrid.
+
+        @see GetSelectionBlockTopLeft()
+    */
+    wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
+
+    /**
+        Returns an array of the top left corners of blocks of selected cells.
+
+        Please see GetSelectedCells() for more information about the selection
+        representation in wxGrid.
+
+        @see GetSelectionBlockBottomRight()
+    */
+    wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
+
+    /**
+        Returns the colour used for drawing the selection foreground.
+    */
+    wxColour GetSelectionForeground() const;
+
+    /**
+        Returns the current selection mode.
+
+        @see SetSelectionMode().
+    */
+    wxGridSelectionModes GetSelectionMode() const;
+
+    /**
+        Returns @true if the given cell is selected.
+    */
+    bool IsInSelection(int row, int col) const;
+    /**
+        Returns @true if the given cell is selected.
+    */
+    bool IsInSelection(const wxGridCellCoords& coords) const;
+
+    /**
+        Returns @true if there are currently any selected cells, rows, columns
+        or blocks.
+    */
+    bool IsSelection() const;
+
+    /**
+        Selects all cells in the grid.
+    */
+    void SelectAll();
+
+    /**
+        Selects a rectangular block of cells.
+
+        If @a addToSelected is @false then any existing selection will be
+        deselected; if @true the column will be added to the existing
+        selection.
+    */
+    void SelectBlock(int topRow, int leftCol, int bottomRow, int rightCol,
+                     bool addToSelected = false);
+    /**
+        Selects a rectangular block of cells.
+
+        If @a addToSelected is @false then any existing selection will be
+        deselected; if @true the column will be added to the existing
+        selection.
+    */
+    void SelectBlock(const wxGridCellCoords& topLeft,
+                     const wxGridCellCoords& bottomRight,
+                     bool addToSelected = false);
+
+    /**
+        Selects the specified column.
+
+        If @a addToSelected is @false then any existing selection will be
+        deselected; if @true the column will be added to the existing
+        selection.
+
+        This method won't select anything if the current selection mode is
+        wxGridSelectRows.
+    */
+    void SelectCol(int col, bool addToSelected = false);
+
+    /**
+        Selects the specified row.
+
+        If @a addToSelected is @false then any existing selection will be
+        deselected; if @true the row will be added to the existing selection.
+
+        This method won't select anything if the current selection mode is
+        wxGridSelectColumns.
+    */
+    void SelectRow(int row, bool addToSelected = false);
+
+    /**
+        Set the colour to be used for drawing the selection background.
+    */
+    void SetSelectionBackground(const wxColour& c);
+
+    /**
+        Set the colour to be used for drawing the selection foreground.
+    */
+    void SetSelectionForeground(const wxColour& c);
+
+    /**
+        Set the selection behaviour of the grid.
+
+        The existing selection is converted to conform to the new mode if
+        possible and discarded otherwise (e.g. any individual selected cells
+        are deselected if the new mode allows only the selection of the entire
+        rows or columns).
+    */
+    void SetSelectionMode(wxGridSelectionModes selmode);
+
+    //@}
+
+
+    /**
+        @name Scrolling
+     */
+    //@{
+
+    /**
+        Returns the number of pixels per horizontal scroll increment.
+
+        The default is 15.
+
+        @see GetScrollLineY(), SetScrollLineX(), SetScrollLineY()
+    */
+    int GetScrollLineX() const;
+
+    /**
+        Returns the number of pixels per vertical scroll increment.
+
+        The default is 15.
+
+        @see GetScrollLineX(), SetScrollLineX(), SetScrollLineY()
+    */
+    int GetScrollLineY() const;
+
+    /**
+        Returns @true if a cell is either entirely or at least partially
+        visible in the grid window.
+
+        By default, the cell must be entirely visible for this function to
+        return @true but if @a wholeCellVisible is @false, the function returns
+        @true even if the cell is only partially visible.
+    */
+    bool IsVisible(int row, int col, bool wholeCellVisible = true) const;
+    /**
+        Returns @true if a cell is either entirely or at least partially
+        visible in the grid window.
+
+        By default, the cell must be entirely visible for this function to
+        return @true but if @a wholeCellVisible is @false, the function returns
+        @true even if the cell is only partially visible.
+    */
+    bool IsVisible(const wxGridCellCoords& coords,
+                   bool wholeCellVisible = true) const;
+
+    /**
+        Brings the specified cell into the visible grid cell area with minimal
+        scrolling.
+
+        Does nothing if the cell is already visible.
+    */
+    void MakeCellVisible(int row, int col);
+    /**
+        Brings the specified cell into the visible grid cell area with minimal
+        scrolling.
+
+        Does nothing if the cell is already visible.
+    */
+    void MakeCellVisible(const wxGridCellCoords& coords);
+
+    /**
+        Sets the number of pixels per horizontal scroll increment.
+
+        The default is 15.
+
+        @see GetScrollLineX(), GetScrollLineY(), SetScrollLineY()
+    */
+    void SetScrollLineX(int x);
+
+    /**
+        Sets the number of pixels per vertical scroll increment.
+
+        The default is 15.
+
+        @see GetScrollLineX(), GetScrollLineY(), SetScrollLineX()
+    */
+    void SetScrollLineY(int y);
+
+    //@}
+
+
+    /**
+        @name Cell and Device Coordinate Translation
+     */
+    //@{
+
+    /**
+        Convert grid cell coordinates to grid window pixel coordinates.
+
+        This function returns the rectangle that encloses the block of cells
+        limited by @a topLeft and @a bottomRight cell in device coords and
+        clipped to the client size of the grid window.
+
+        @see CellToRect()
+    */
+    wxRect BlockToDeviceRect(const wxGridCellCoords& topLeft,
+                             const wxGridCellCoords& bottomRight) const;
+
+    /**
+        Return the rectangle corresponding to the grid cell's size and position
+        in logical coordinates.
+
+        @see BlockToDeviceRect()
+    */
+    wxRect CellToRect(int row, int col) const;
+    /**
+        Return the rectangle corresponding to the grid cell's size and position
+        in logical coordinates.
+
+        @see BlockToDeviceRect()
+    */
+    const wxRect CellToRect(const wxGridCellCoords& coords) const;
+
+    /**
+        Returns the column at the given pixel position.
+
+        @param x
+            The x position to evaluate.
+        @param clipToMinMax
+            If @true, rather than returning @c wxNOT_FOUND, it returns either
+            the first or last column depending on whether @a x is too far to
+            the left or right respectively.
+        @return
+            The column index or @c wxNOT_FOUND.
+    */
+    int XToCol(int x, bool clipToMinMax = false) const;
+
+    /**
+        Returns the column whose right hand edge is close to the given logical
+        @a x position.
+
+        If no column edge is near to this position @c wxNOT_FOUND is returned.
+    */
+    int XToEdgeOfCol(int x) const;
+
+    /**
+        Translates logical pixel coordinates to the grid cell coordinates.
+
+        Notice that this function expects logical coordinates on input so if
+        you use this function in a mouse event handler you need to translate
+        the mouse position, which is expressed in device coordinates, to
+        logical ones.
+
+        @see XToCol(), YToRow()
+     */
+    wxGridCellCoords XYToCell(int x, int y) const;
+    /**
+        Translates logical pixel coordinates to the grid cell coordinates.
+
+        Notice that this function expects logical coordinates on input so if
+        you use this function in a mouse event handler you need to translate
+        the mouse position, which is expressed in device coordinates, to
+        logical ones.
+
+        @see XToCol(), YToRow()
+     */
+    wxGridCellCoords XYToCell(const wxPoint& pos) const;
+    // XYToCell(int, int, wxGridCellCoords&) overload is intentionally
+    // undocumented, using it is ugly and non-const reference parameters are
+    // not used in wxWidgets API
+
+    /**
+        Returns the row whose bottom edge is close to the given logical @a y
+        position.
+
+        If no row edge is near to this position @c wxNOT_FOUND is returned.
+    */
+    int YToEdgeOfRow(int y) const;
+
+    /**
+        Returns the grid row that corresponds to the logical @a y coordinate.
+
+        Returns @c wxNOT_FOUND if there is no row at the @a y position.
+    */
+    int YToRow(int y, bool clipToMinMax = false) const;
+
+    //@}
+
+
+    /**
+        @name Miscellaneous Functions
+     */
+    //@{
+
+    /**
+        Appends one or more new columns to the right of the grid.
+
+        The @a updateLabels argument is not used at present. If you are using a
+        derived grid table class you will need to override
+        wxGridTableBase::AppendCols(). See InsertCols() for further
+        information.
+
+        @return @true on success or @false if appending columns failed.
+    */
+    bool AppendCols(int numCols = 1, bool updateLabels = true);
+
+    /**
+        Appends one or more new rows to the bottom of the grid.
+
+        The @a updateLabels argument is not used at present. If you are using a
+        derived grid table class you will need to override
+        wxGridTableBase::AppendRows(). See InsertRows() for further
+        information.
+
+        @return @true on success or @false if appending rows failed.
+    */
+    bool AppendRows(int numRows = 1, bool updateLabels = true);
+
+    /**
+        Return @true if the horizontal grid lines stop at the last column
+        boundary or @false if they continue to the end of the window.
+
+        The default is to clip grid lines.
+
+        @see ClipHorzGridLines(), AreVertGridLinesClipped()
+     */
+    bool AreHorzGridLinesClipped() const;
+
+    /**
+        Return @true if the vertical grid lines stop at the last row
+        boundary or @false if they continue to the end of the window.
+
+        The default is to clip grid lines.
+
+        @see ClipVertGridLines(), AreHorzGridLinesClipped()
+     */
+    bool AreVertGridLinesClipped() const;
+
+    /**
+        Increments the grid's batch count.
+
+        When the count is greater than zero repainting of the grid is
+        suppressed. Each call to BeginBatch must be matched by a later call to
+        EndBatch(). Code that does a lot of grid modification can be enclosed
+        between BeginBatch() and EndBatch() calls to avoid screen flicker. The
+        final EndBatch() call will cause the grid to be repainted.
+
+        Notice that you should use wxGridUpdateLocker which ensures that there
+        is always a matching EndBatch() call for this BeginBatch() if possible
+        instead of calling this method directly.
+    */
+    void BeginBatch();
+
+    /**
+        Clears all data in the underlying grid table and repaints the grid.
+
+        The table is not deleted by this function. If you are using a derived
+        table class then you need to override wxGridTableBase::Clear() for this
+        function to have any effect.
+    */
+    void ClearGrid();
+
+    /**
+        Change whether the horizontal grid lines are clipped by the end of the
+        last column.
+
+        By default the grid lines are not drawn beyond the end of the last
+        column but after calling this function with @a clip set to @false they
+        will be drawn across the entire grid window.
+
+        @see AreHorzGridLinesClipped(), ClipVertGridLines()
+     */
+    void ClipHorzGridLines(bool clip);
+
+    /**
+        Change whether the vertical grid lines are clipped by the end of the
+        last row.
+
+        By default the grid lines are not drawn beyond the end of the last
+        row but after calling this function with @a clip set to @false they
+        will be drawn across the entire grid window.
+
+        @see AreVertGridLinesClipped(), ClipHorzGridLines()
+     */
+    void ClipVertGridLines(bool clip);
+
+    /**
+        Deletes one or more columns from a grid starting at the specified
+        position.
+
+        The @a updateLabels argument is not used at present. If you are using a
+        derived grid table class you will need to override
+        wxGridTableBase::DeleteCols(). See InsertCols() for further
+        information.
+
+        @return @true on success or @false if deleting columns failed.
+    */
+    bool DeleteCols(int pos = 0, int numCols = 1, bool updateLabels = true);
+
+    /**
+        Deletes one or more rows from a grid starting at the specified
+        position.
+
+        The @a updateLabels argument is not used at present. If you are using a
+        derived grid table class you will need to override
+        wxGridTableBase::DeleteRows(). See InsertRows() for further
+        information.
+
+        @return @true on success or @false if appending rows failed.
+    */
+    bool DeleteRows(int pos = 0, int numRows = 1, bool updateLabels = true);
+
+    /**
+        Decrements the grid's batch count.
+
+        When the count is greater than zero repainting of the grid is
+        suppressed. Each previous call to BeginBatch() must be matched by a
+        later call to EndBatch(). Code that does a lot of grid modification can
+        be enclosed between BeginBatch() and EndBatch() calls to avoid screen
+        flicker. The final EndBatch() will cause the grid to be repainted.
+
+        @see wxGridUpdateLocker
+    */
+    void EndBatch();
+
+    /**
+        Overridden wxWindow method.
+    */
+    virtual void Fit();
+
+    /**
+        Causes immediate repainting of the grid.
+
+        Use this instead of the usual wxWindow::Refresh().
+    */
+    void ForceRefresh();
+
+    /**
+        Returns the number of times that BeginBatch() has been called without
+        (yet) matching calls to EndBatch(). While the grid's batch count is
+        greater than zero the display will not be updated.
+    */
+    int GetBatchCount();
+
+    /**
+        Returns the total number of grid columns.
+
+        This is the same as the number of columns in the underlying grid table.
+    */
+    int GetNumberCols() const;
+
+    /**
+        Returns the total number of grid rows.
+
+        This is the same as the number of rows in the underlying grid table.
+    */
+    int GetNumberRows() const;
+
+    /**
+        Returns the attribute for the given cell creating one if necessary.
+
+        If the cell already has an attribute, it is returned. Otherwise a new
+        attribute is created, associated with the cell and returned. In any
+        case the caller must call DecRef() on the returned pointer.
+
+        This function may only be called if CanHaveAttributes() returns @true.
+    */
+    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+
+    /**
+        Returns a base pointer to the current table object.
+
+        The returned pointer is still owned by the grid.
+    */
+    wxGridTableBase *GetTable() const;
+
+    /**
+        Inserts one or more new columns into a grid with the first new column
+        at the specified position.
+
+        Notice that inserting the columns in the grid requires grid table
+        cooperation: when this method is called, grid object begins by
+        requesting the underlying grid table to insert new columns. If this is
+        successful the table notifies the grid and the grid updates the
+        display. For a default grid (one where you have called CreateGrid())
+        this process is automatic. If you are using a custom grid table
+        (specified with SetTable()) then you must override
+        wxGridTableBase::InsertCols() in your derived table class.
+
+        @param pos
+            The position which the first newly inserted column will have.
+        @param numCols
+            The number of columns to insert.
+        @param updateLabels
+            Currently not used.
+        @return
+            @true if the columns were successfully inserted, @false if an error
+            occurred (most likely the table couldn't be updated).
+    */
+    bool InsertCols(int pos = 0, int numCols = 1, bool updateLabels = true);
+
+    /**
+        Inserts one or more new rows into a grid with the first new row at the
+        specified position.
+
+        Notice that you must implement wxGridTableBase::InsertRows() if you use
+        a grid with a custom table, please see InsertCols() for more
+        information.
+
+        @param pos
+            The position which the first newly inserted row will have.
+        @param numRows
+            The number of rows to insert.
+        @param updateLabels
+            Currently not used.
+        @return
+            @true if the rows were successfully inserted, @false if an error
+            occurred (most likely the table couldn't be updated).
+    */
+    bool InsertRows(int pos = 0, int numRows = 1, bool updateLabels = true);
+
+    /**
+        Sets the cell attributes for all cells in the specified column.
+
+        For more information about controlling grid cell attributes see the
+        wxGridCellAttr cell attribute class and the @ref overview_grid.
     */
     */
-    void SelectCol(int col, bool addToSelected = false);
+    void SetColAttr(int col, wxGridCellAttr* attr);
 
     /**
 
     /**
-        Selects the specified row.
-
-        If @a addToSelected is @false then any existing selection will be
-        deselected; if @true the row will be added to the existing selection.
+        Sets the extra margins used around the grid area.
 
 
-        This method won't select anything if the current selection mode is
-        wxGridSelectColumns.
+        A grid may occupy more space than needed for its data display and
+        this function allows to set how big this extra space is
     */
     */
-    void SelectRow(int row, bool addToSelected = false);
+    void SetMargins(int extraWidth, int extraHeight);
 
 
-    //@{
     /**
     /**
-        Sets the horizontal and vertical alignment for grid cell text at the
-        specified location.
+        Sets the cell attributes for all cells in the specified row.
 
 
-        Horizontal alignment should be one of @c wxALIGN_LEFT, @c
-        wxALIGN_CENTRE or @c wxALIGN_RIGHT.
+        The grid takes ownership of the attribute pointer.
 
 
-        Vertical alignment should be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE
-        or @c wxALIGN_BOTTOM.
+        See the wxGridCellAttr class for more information about controlling
+        cell attributes.
     */
     */
-    void SetCellAlignment(int row, int col, int horiz, int vert);
-    void SetCellAlignment(int align, int row, int col);
+    void SetRowAttr(int row, wxGridCellAttr* attr);
+
     //@}
 
     //@}
 
-    //@{
+protected:
     /**
     /**
-        Set the background colour for the given cell or all cells by default.
+        Returns @true if this grid has support for cell attributes.
+
+        The grid supports attributes if it has the associated table which, in
+        turn, has attributes support, i.e. wxGridTableBase::CanHaveAttributes()
+        returns @true.
     */
     */
-    void SetCellBackgroundColour(int row, int col, const wxColour& colour);
-    //@}
+    bool CanHaveAttributes() const;
 
     /**
 
     /**
-        Sets the editor for the grid cell at the specified location.
-
-        The grid will take ownership of the pointer.
+        Get the minimal width of the given column/row.
 
 
-        See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
-        for more information about cell editors and renderers.
+        The value returned by this function may be different than that returned
+        by GetColMinimalAcceptableWidth() if SetColMinimalWidth() had been
+        called for this column.
     */
     */
-    void SetCellEditor(int row, int col, wxGridCellEditor* editor);
+    int GetColMinimalWidth(int col) const;
 
     /**
 
     /**
-        Sets the font for text in the grid cell at the specified location.
+        Returns the coordinate of the right border specified column.
     */
     */
-    void SetCellFont(int row, int col, const wxFont& font);
+    int GetColRight(int col) const;
 
     /**
 
     /**
-        Sets the renderer for the grid cell at the specified location.
+        Returns the coordinate of the left border specified column.
+    */
+    int GetColLeft(int col) const;
 
 
-        The grid will take ownership of the pointer.
+    /**
+        Returns the minimal size for the given column.
 
 
-        See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
-        for more information about cell editors and renderers.
+        The value returned by this function may be different than that returned
+        by GetRowMinimalAcceptableHeight() if SetRowMinimalHeight() had been
+        called for this row.
     */
     */
-    void SetCellRenderer(int row, int col, wxGridCellRenderer* renderer);
+    int GetRowMinimalHeight(int col) const;
+
 
 
-    //@{
     /**
     /**
-        Sets the text colour for the given cell or all cells by default.
-    */
-    void SetCellTextColour(int row, int col, const wxColour& colour);
-    void SetCellTextColour(const wxColour& val, int row, int col);
-    void SetCellTextColour(const wxColour& colour);
-    //@}
+        @name Sorting support.
 
 
+        wxGrid doesn't provide any support for sorting the data but it does
+        generate events allowing the user code to sort it and supports
+        displaying the sort indicator in the column used for sorting.
+
+        To use wxGrid sorting support you need to handle wxEVT_GRID_COL_SORT
+        event (and not veto it) and resort the data displayed in the grid. The
+        grid will automatically update the sorting indicator on the column
+        which was clicked.
+
+        You can also call the functions in this section directly to update the
+        sorting indicator. Once again, they don't do anything with the grid
+        data, it remains your responsibility to actually sort it appropriately.
+     */
     //@{
     //@{
+
     /**
     /**
-        Sets the string value for the cell at the specified location.
+        Return the column in which the sorting indicator is currently
+        displayed.
 
 
-        For simple applications where a grid object automatically uses a
-        default grid table of string values you use this function together with
-        GetCellValue() to access cell values. For more complex applications
-        where you have derived your own grid table class that contains various
-        data types (e.g. numeric, boolean or user-defined custom types) then
-        you only use this function for those cells that contain string values.
-        The last form is for backward compatibility only.
+        Returns @c wxNOT_FOUND if sorting indicator is not currently displayed
+        at all.
 
 
-        See wxGridTableBase::CanSetValueAs and the @ref overview_grid
-        "wxGrid overview" for more information.
-    */
-    void SetCellValue(int row, int col, const wxString& s);
-    void SetCellValue(const wxGridCellCoords& coords, const wxString& s);
-    void SetCellValue(const wxString& val, int row, int col);
-    //@}
+        @see SetSortingColumn()
+     */
+    int GetSortingColumn() const;
 
     /**
 
     /**
-        Sets the cell attributes for all cells in the specified column.
+        Return @true if this column is currently used for sorting.
 
 
-        For more information about controlling grid cell attributes see the
-        wxGridCellAttr cell attribute class and the @ref overview_grid "wxGrid overview".
-    */
-    void SetColAttr(int col, wxGridCellAttr* attr);
+        @see GetSortingColumn()
+     */
+    bool IsSortingBy(int col) const;
 
     /**
 
     /**
-        Sets the specified column to display boolean values.
+        Return @true if the current sorting order is ascending or @false if it
+        is descending.
 
 
-        @see SetColFormatCustom()
-    */
-    void SetColFormatBool(int col);
+        It only makes sense to call this function if GetSortingColumn() returns
+        a valid column index and not @c wxNOT_FOUND.
+
+        @see SetSortingColumn()
+     */
+    bool IsSortOrderAscending() const;
 
     /**
 
     /**
-        Sets the specified column to display data in a custom format.
+        Set the column to display the sorting indicator in and its direction.
 
 
-        This method provides an alternative to defining a custom grid table
-        which would return @a typeName from its GetTypeName() method for the
-        cells in this column: while it doesn't really change the type of the
-        cells in this column, it does associate the renderer and editor used
-        for the cells of the specified type with them.
+        @param col
+            The column to display the sorting indicator in or @c wxNOT_FOUND to
+            remove any currently displayed sorting indicator.
+        @param ascending
+            If @true, display the ascending sort indicator, otherwise display
+            the descending sort indicator.
 
 
-        See the @ref overview_grid "wxGrid overview" for more
-        information on working with custom data types.
-    */
-    void SetColFormatCustom(int col, const wxString& typeName);
+        @see GetSortingColumn(), IsSortOrderAscending()
+     */
+    void SetSortingColumn(int col, bool ascending = true);
 
     /**
 
     /**
-        Sets the specified column to display floating point values with the
-        given width and precision.
+        Remove any currently shown sorting indicator.
 
 
-        @see SetColFormatCustom()
-    */
-    void SetColFormatFloat(int col, int width = -1, int precision = -1);
+        This is equivalent to calling SetSortingColumn() with @c wxNOT_FOUND
+        first argument.
+     */
+    void UnsetSortingColumn();
+    //@}
 
     /**
 
     /**
-        Sets the specified column to display integer values.
+        @name Accessors for component windows.
 
 
-        @see SetColFormatCustom()
-    */
-    void SetColFormatNumber(int col);
+        Return the various child windows of wxGrid.
+
+        wxGrid is an empty parent window for 4 children representing the column
+        labels window (top), the row labels window (left), the corner window
+        (top left) and the main grid window. It may be necessary to use these
+        individual windows and not the wxGrid window itself if you need to
+        handle events for them (this can be done using wxEvtHandler::Connect()
+        or wxWindow::PushEventHandler()) or do something else requiring the use
+        of the correct window pointer. Notice that you should not, however,
+        change these windows (e.g. reposition them or draw over them) because
+        they are managed by wxGrid itself.
+     */
+    //@{
 
     /**
 
     /**
-        Sets the horizontal and vertical alignment of column label text.
+        Return the main grid window containing the grid cells.
 
 
-        Horizontal alignment should be one of @c wxALIGN_LEFT, @c
-        wxALIGN_CENTRE or @c wxALIGN_RIGHT.
-        Vertical alignment should be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE
-        or @c wxALIGN_BOTTOM.
-    */
-    void SetColLabelAlignment(int horiz, int vert);
+        This window is always shown.
+     */
+    wxWindow *GetGridWindow() const;
 
     /**
 
     /**
-        Sets the height of the column labels.
+        Return the row labels window.
 
 
-        If @a height equals to @c wxGRID_AUTOSIZE then height is calculated
-        automatically so that no label is truncated. Note that this could be
-        slow for a large table.
-    */
-    void SetColLabelSize(int height);
+        This window is not shown if the row labels were hidden using
+        HideRowLabels().
+     */
+    wxWindow *GetGridRowLabelWindow() const;
 
     /**
 
     /**
-        Set the value for the given column label.
+        Return the column labels window.
 
 
-        If you are using a custom grid table you must override
-        wxGridTableBase::SetColLabelValue for this to have any effect.
-    */
-    void SetColLabelValue(int col, const wxString& value);
+        This window is not shown if the columns labels were hidden using
+        HideColLabels().
+
+        Depending on whether UseNativeColHeader() was called or not this can be
+        either a wxHeaderCtrl or a plain wxWindow.  This function returns a valid
+        window pointer in either case but in the former case you can also use
+        GetGridColHeader() to access it if you need wxHeaderCtrl-specific
+        functionality.
+     */
+    wxWindow *GetGridWindow() const;
 
     /**
 
     /**
-        Sets the minimal width to which the user can resize columns.
+        Return the window in the top left grid corner.
 
 
-        @see GetColMinimalAcceptableWidth()
-    */
-    void SetColMinimalAcceptableWidth(int width);
+        This window is shown only of both columns and row labels are shown and
+        normally doesn't contain anything. Clicking on it is handled by wxGrid
+        however and can be used to select the entire grid.
+     */
+    wxWindow *GetGridCornerLabelWindow() const;
 
     /**
 
     /**
-        Sets the minimal width for the specified column.
+        Return the header control used for column labels display.
 
 
-        It is usually best to call this method during grid creation as calling
-        it later will not resize the column to the given minimal width even if
-        it is currently narrower than it.
+        This function can only be called if UseNativeColHeader() had been
+        called.
+     */
+    wxHeaderCtrl *GetGridColHeader() const;
 
 
-        @a width must be greater than the minimal acceptable column width as
-        returned by GetColMinimalAcceptableWidth().
-    */
-    void SetColMinimalWidth(int col, int width);
+    //@}
+};
 
 
-    /**
-        Sets the position of the specified column.
-    */
-    void SetColPos(int colID, int newPos);
 
 
-    /**
-        Sets the width of the specified column.
 
 
-        Notice that this function does not refresh the grid, you need to call
-        ForceRefresh() to make the changes take effect immediately.
+/**
+    @class wxGridUpdateLocker
 
 
-        @param col
-            The column index.
-        @param width
-            The new column width in pixels or a negative value to fit the
-            column width to its label width.
-    */
-    void SetColSize(int col, int width);
+    This small class can be used to prevent wxGrid from redrawing during its
+    lifetime by calling wxGrid::BeginBatch() in its constructor and
+    wxGrid::EndBatch() in its destructor. It is typically used in a function
+    performing several operations with a grid which would otherwise result in
+    flicker. For example:
 
 
-    /**
-        Sets the default horizontal and vertical alignment for grid cell text.
+    @code
+    void MyFrame::Foo()
+    {
+        m_grid = new wxGrid(this, ...);
 
 
-        Horizontal alignment should be one of @c wxALIGN_LEFT, @c
-        wxALIGN_CENTRE or @c wxALIGN_RIGHT.
-        Vertical alignment should be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE
-        or @c wxALIGN_BOTTOM.
-    */
-    void SetDefaultCellAlignment(int horiz, int vert);
+        wxGridUpdateLocker noUpdates(m_grid);
+        m_grid-AppendColumn();
+        // ... many other operations with m_grid ...
+        m_grid-AppendRow();
 
 
+        // destructor called, grid refreshed
+    }
+    @endcode
+
+    Using this class is easier and safer than calling wxGrid::BeginBatch() and
+    wxGrid::EndBatch() because you don't risk missing the call the latter (due
+    to an exception for example).
+
+    @library{wxadv}
+    @category{grid}
+*/
+class wxGridUpdateLocker
+{
+public:
     /**
     /**
-        Sets the default background colour for grid cells.
+        Creates an object preventing the updates of the specified @a grid. The
+        parameter could be @NULL in which case nothing is done. If @a grid is
+        non-@NULL then the grid must exist for longer than this
+        wxGridUpdateLocker object itself.
+
+        The default constructor could be followed by a call to Create() to set
+        the grid object later.
     */
     */
-    void SetDefaultCellBackgroundColour(const wxColour& colour);
+    wxGridUpdateLocker(wxGrid* grid = NULL);
 
     /**
 
     /**
-        Sets the default font to be used for grid cell text.
+        Destructor reenables updates for the grid this object is associated
+        with.
     */
     */
-    void SetDefaultCellFont(const wxFont& font);
+    ~wxGridUpdateLocker();
 
     /**
 
     /**
-        Sets the current default colour for grid cell text.
+        This method can be called if the object had been constructed using the
+        default constructor. It must not be called more than once.
     */
     */
-    void SetDefaultCellTextColour(const wxColour& colour);
+    void Create(wxGrid* grid);
+};
 
 
-    /**
-        Sets the default width for columns in the grid.
 
 
-        This will only affect columns subsequently added to the grid unless
-        @a resizeExistingCols is @true.
 
 
-        If @a width is less than GetColMinimalAcceptableWidth(), then the
-        minimal acceptable width is used instead of it.
-    */
-    void SetDefaultColSize(int width, bool resizeExistingCols = false);
+/**
+    @class wxGridEvent
 
 
-    /**
-        Sets the default editor for grid cells.
+    This event class contains information about various grid events.
 
 
-        The grid will take ownership of the pointer.
+    Notice that all grid event table macros are available in two versions:
+    @c EVT_GRID_XXX and @c EVT_GRID_CMD_XXX. The only difference between the
+    two is that the former doesn't allow to specify the grid window identifier
+    and so takes a single parameter, the event handler, but is not suitable if
+    there is more than one grid control in the window where the event table is
+    used (as it would catch the events from all the grids). The version with @c
+    CMD takes the id as first argument and the event handler as the second one
+    and so can be used with multiple grids as well. Otherwise there are no
+    difference between the two and only the versions without the id are
+    documented below for brevity.
+
+    @beginEventTable{wxGridEvent}
+    @event{EVT_GRID_CELL_CHANGING(func)}
+        The user is about to change the data in a cell. The new cell value as
+        string is available from GetString() event object method. This event
+        can be vetoed if the change is not allowed.
+        Processes a @c wxEVT_GRID_CELL_CHANGING event type.
+    @event{EVT_GRID_CELL_CHANGED(func)}
+        The user changed the data in a cell. The old cell value as string is
+        available from GetString() event object method. Notice that vetoing
+        this event still works for backwards compatibility reasons but any new
+        code should only veto EVT_GRID_CELL_CHANGING event and not this one.
+        Processes a @c wxEVT_GRID_CELL_CHANGED event type.
+    @event{EVT_GRID_CELL_LEFT_CLICK(func)}
+        The user clicked a cell with the left mouse button. Processes a
+        @c wxEVT_GRID_CELL_LEFT_CLICK event type.
+    @event{EVT_GRID_CELL_LEFT_DCLICK(func)}
+        The user double-clicked a cell with the left mouse button. Processes a
+        @c wxEVT_GRID_CELL_LEFT_DCLICK event type.
+    @event{EVT_GRID_CELL_RIGHT_CLICK(func)}
+        The user clicked a cell with the right mouse button. Processes a
+        @c wxEVT_GRID_CELL_RIGHT_CLICK event type.
+    @event{EVT_GRID_CELL_RIGHT_DCLICK(func)}
+        The user double-clicked a cell with the right mouse button. Processes a
+        @c wxEVT_GRID_CELL_RIGHT_DCLICK event type.
+    @event{EVT_GRID_EDITOR_HIDDEN(func)}
+        The editor for a cell was hidden. Processes a
+        @c wxEVT_GRID_EDITOR_HIDDEN event type.
+    @event{EVT_GRID_EDITOR_SHOWN(func)}
+        The editor for a cell was shown. Processes a
+        @c wxEVT_GRID_EDITOR_SHOWN event type.
+    @event{EVT_GRID_LABEL_LEFT_CLICK(func)}
+        The user clicked a label with the left mouse button. Processes a
+        @c wxEVT_GRID_LABEL_LEFT_CLICK event type.
+    @event{EVT_GRID_LABEL_LEFT_DCLICK(func)}
+        The user double-clicked a label with the left mouse button. Processes a
+        @c wxEVT_GRID_LABEL_LEFT_DCLICK event type.
+    @event{EVT_GRID_LABEL_RIGHT_CLICK(func)}
+        The user clicked a label with the right mouse button. Processes a
+        @c wxEVT_GRID_LABEL_RIGHT_CLICK event type.
+    @event{EVT_GRID_LABEL_RIGHT_DCLICK(func)}
+        The user double-clicked a label with the right mouse button. Processes
+        a @c wxEVT_GRID_LABEL_RIGHT_DCLICK event type.
+    @event{EVT_GRID_SELECT_CELL(func)}
+        The user moved to, and selected a cell. Processes a
+        @c wxEVT_GRID_SELECT_CELL event type.
+    @event{EVT_GRID_COL_MOVE(func)}
+        The user tries to change the order of the columns in the grid by
+        dragging the column specified by GetCol(). This event can be vetoed to
+        either prevent the user from reordering the column change completely
+        (but notice that if you don't want to allow it at all, you simply
+        shouldn't call wxGrid::EnableDragColMove() in the first place), vetoed
+        but handled in some way in the handler, e.g. by really moving the
+        column to the new position at the associated table level, or allowed to
+        proceed in which case wxGrid::SetColPos() is used to reorder the
+        columns display order without affecting the use of the column indices
+        otherwise.
+        This event macro corresponds to @c wxEVT_GRID_COL_MOVE event type.
+    @event{EVT_GRID_COL_SORT(func)}
+        This event is generated when a column is clicked by the user and its
+        name is explained by the fact that the custom reaction to a click on a
+        column is to sort the grid contents by this column. However the grid
+        itself has no special support for sorting and it's up to the handler of
+        this event to update the associated table. But if the event is handled
+        (and not vetoed) the grid supposes that the table was indeed resorted
+        and updates the column to indicate the new sort order and refreshes
+        itself.
+        This event macro corresponds to @c wxEVT_GRID_COL_SORT event type.
+    @endEventTable
 
 
-        See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
-        for more information about cell editors and renderers.
+    @library{wxadv}
+    @category{grid,events}
+*/
+class wxGridEvent : public wxNotifyEvent
+{
+public:
+    /**
+        Default constructor.
     */
     */
-    void SetDefaultEditor(wxGridCellEditor* editor);
-
+    wxGridEvent();
     /**
     /**
-        Sets the default renderer for grid cells.
-
-        The grid will take ownership of the pointer.
-
-        See wxGridCellRenderer and the @ref overview_grid "wxGrid overview" 
-        for more information about cell editors and renderers.
+        Constructor for initializing all event attributes.
     */
     */
-    void SetDefaultRenderer(wxGridCellRenderer* renderer);
+    wxGridEvent(int id, wxEventType type, wxObject* obj,
+                int row = -1, int col = -1, int x = -1, int y = -1,
+                bool sel = true, bool control = false, bool shift = false,
+                bool alt = false, bool meta = false);
 
     /**
 
     /**
-        Sets the default height for rows in the grid.
-
-        This will only affect rows subsequently added to the grid unless
-        @a resizeExistingRows is @true.
-
-        If @a height is less than GetRowMinimalAcceptableHeight(), then the
-        minimal acceptable heihgt is used instead of it.
+        Returns @true if the Alt key was down at the time of the event.
     */
     */
-    void SetDefaultRowSize(int height, bool resizeExistingRows = false);
+    bool AltDown() const;
 
 
-    //@{
     /**
     /**
-        Set the grid cursor to the specified cell.
-
-        The grid cursor indicates the current cell and can be moved by the user
-        using the arrow keys or the mouse.
-
-        Calling this function generates a wxEVT_GRID_SELECT_CELL event and if
-        the event handler vetoes this event, the cursor is not moved.
-
-        This function doesn't make the target call visible, use GoToCell() to
-        do this.
+        Returns @true if the Control key was down at the time of the event.
     */
     */
-    void SetGridCursor(int row, int col);
-    void SetGridCursor(const wxGridCellCoords& coords);
-    //@}
+    bool ControlDown() const;
+
+    /**
+        Column at which the event occurred.
+    */
+    virtual int GetCol();
 
     /**
 
     /**
-        Sets the colour used to draw grid lines.
+        Position in pixels at which the event occurred.
     */
     */
-    void SetGridLineColour(const wxColour& colour);
+    wxPoint GetPosition();
 
     /**
 
     /**
-        Sets the background colour for row and column labels.
+        Row at which the event occurred.
     */
     */
-    void SetLabelBackgroundColour(const wxColour& colour);
+    virtual int GetRow();
 
     /**
 
     /**
-        Sets the font for row and column labels.
+        Returns @true if the Meta key was down at the time of the event.
     */
     */
-    void SetLabelFont(const wxFont& font);
+    bool MetaDown() const;
 
     /**
 
     /**
-        Sets the colour for row and column label text.
+        Returns @true if the user is selecting grid cells, or @false if
+        deselecting.
     */
     */
-    void SetLabelTextColour(const wxColour& colour);
+    bool Selecting();
 
     /**
 
     /**
-        Sets the extra margins used around the grid area.
-
-        A grid may occupy more space than needed for its data display and
-        this function allows to set how big this extra space is
+        Returns @true if the Shift key was down at the time of the event.
     */
     */
-    void SetMargins(int extraWidth, int extraHeight);
+    bool ShiftDown() const;
+};
 
 
-    /**
-        Makes the cell at the specified location read-only or editable.
 
 
-        @see IsReadOnly()
-    */
-    void SetReadOnly(int row, int col, bool isReadOnly = true);
 
 
-    /**
-        Sets the cell attributes for all cells in the specified row.
+/**
+    @class wxGridSizeEvent
 
 
-        The grid takes ownership of the attribute pointer.
+    This event class contains information about a row/column resize event.
 
 
-        See the wxGridCellAttr class for more information about controlling
-        cell attributes.
-    */
-    void SetRowAttr(int row, wxGridCellAttr* attr);
+    @beginEventTable{wxGridSizeEvent}
+    @event{EVT_GRID_COL_SIZE(func)}
+        The user resized a column by dragging it. Processes a
+        @c wxEVT_GRID_COL_SIZE event type.
+    @event{EVT_GRID_ROW_SIZE(func)}
+        The user resized a row by dragging it. Processes a
+        @c wxEVT_GRID_ROW_SIZE event type.
+    @event{EVT_GRID_CMD_COL_SIZE(id, func)}
+        The user resized a column by dragging it; variant taking a window
+        identifier. Processes a @c wxEVT_GRID_COL_SIZE event type.
+    @event{EVT_GRID_CMD_ROW_SIZE(id, func)}
+        The user resized a row by dragging it; variant taking a window
+        identifier. Processes a @c wxEVT_GRID_ROW_SIZE event type.
+    @endEventTable
 
 
+    @library{wxadv}
+    @category{grid,events}
+*/
+class wxGridSizeEvent : public wxNotifyEvent
+{
+public:
     /**
     /**
-        Sets the horizontal and vertical alignment of row label text.
-
-        Horizontal alignment should be one of @c wxALIGN_LEFT, @c
-        wxALIGN_CENTRE or @c wxALIGN_RIGHT.
-        Vertical alignment should be one of @c wxALIGN_TOP, @c wxALIGN_CENTRE
-        or @c wxALIGN_BOTTOM.
+        Default constructor.
     */
     */
-    void SetRowLabelAlignment(int horiz, int vert);
-
+    wxGridSizeEvent();
     /**
     /**
-        Sets the width of the row labels.
-
-        If @a width equals @c wxGRID_AUTOSIZE then width is calculated
-        automatically so that no label is truncated. Note that this could be
-        slow for a large table.
+        Constructor for initializing all event attributes.
     */
     */
-    void SetRowLabelSize(int width);
+    wxGridSizeEvent(int id, wxEventType type, wxObject* obj,
+                    int rowOrCol = -1, int x = -1, int y = -1,
+                    bool control = false, bool shift = false,
+                    bool alt = false, bool meta = false);
 
     /**
 
     /**
-        Sets the value for the given row label.
-
-        If you are using a derived grid table you must override
-        wxGridTableBase::SetRowLabelValue for this to have any effect.
+        Returns @true if the Alt key was down at the time of the event.
     */
     */
-    void SetRowLabelValue(int row, const wxString& value);
+    bool AltDown() const;
 
     /**
 
     /**
-        Sets the minimal row height used by default.
-
-        See SetColMinimalAcceptableWidth() for more information.
+        Returns @true if the Control key was down at the time of the event.
     */
     */
-    void SetRowMinimalAcceptableHeight(int height);
+    bool ControlDown() const;
 
     /**
 
     /**
-        Sets the minimal height for the specified row.
-
-        See SetColMinimalWidth() for more information.
+        Position in pixels at which the event occurred.
     */
     */
-    void SetRowMinimalHeight(int row, int height);
+    wxPoint GetPosition();
 
     /**
 
     /**
-        Sets the height of the specified row.
+        Row or column at that was resized.
+    */
+    int GetRowOrCol();
 
 
-        See SetColSize() for more information.
+    /**
+        Returns @true if the Meta key was down at the time of the event.
     */
     */
-    void SetRowSize(int row, int height);
+    bool MetaDown() const;
 
     /**
 
     /**
-        Sets the number of pixels per horizontal scroll increment.
+        Returns @true if the Shift key was down at the time of the event.
+    */
+    bool ShiftDown() const;
+};
 
 
-        The default is 15.
 
 
-        @see GetScrollLineX(), GetScrollLineY(), SetScrollLineY()
-    */
-    void SetScrollLineX(int x);
 
 
-    /**
-        Sets the number of pixels per vertical scroll increment.
+/**
+    @class wxGridRangeSelectEvent
 
 
-        The default is 15.
+    @beginEventTable{wxGridRangeSelectEvent}
+    @event{EVT_GRID_RANGE_SELECT(func)}
+        The user selected a group of contiguous cells. Processes a
+        @c wxEVT_GRID_RANGE_SELECT event type.
+    @event{EVT_GRID_CMD_RANGE_SELECT(id, func)}
+        The user selected a group of contiguous cells; variant taking a window
+        identifier. Processes a @c wxEVT_GRID_RANGE_SELECT event type.
+    @endEventTable
 
 
-        @see GetScrollLineX(), GetScrollLineY(), SetScrollLineX()
+    @library{wxadv}
+    @category{grid,events}
+*/
+class wxGridRangeSelectEvent : public wxNotifyEvent
+{
+public:
+    /**
+        Default constructor.
     */
     */
-    void SetScrollLineY(int y);
-
+    wxGridRangeSelectEvent();
     /**
     /**
-        Set the colour to be used for drawing the selection background.
+        Constructor for initializing all event attributes.
     */
     */
-    void SetSelectionBackground(const wxColour& c);
+    wxGridRangeSelectEvent(int id, wxEventType type,
+                           wxObject* obj,
+                           const wxGridCellCoords& topLeft,
+                           const wxGridCellCoords& bottomRight,
+                           bool sel = true, bool control = false,
+                           bool shift = false, bool alt = false,
+                           bool meta = false);
 
     /**
 
     /**
-        Set the colour to be used for drawing the selection foreground.
+        Returns @true if the Alt key was down at the time of the event.
     */
     */
-    void SetSelectionForeground(const wxColour& c);
+    bool AltDown() const;
 
     /**
 
     /**
-        Set the selection behaviour of the grid.
-
-        The existing selection is converted to conform to the new mode if
-        possible and discarded otherwise (e.g. any individual selected cells
-        are deselected if the new mode allows only the selection of the entire
-        rows or columns).
+        Returns @true if the Control key was down at the time of the event.
     */
     */
-    void SetSelectionMode(wxGridSelectionModes selmode);
+    bool ControlDown() const;
 
     /**
 
     /**
-        Passes a pointer to a custom grid table to be used by the grid.
-
-        This should be called after the grid constructor and before using the
-        grid object. If @a takeOwnership is set to @true then the table will be
-        deleted by the wxGrid destructor.
-
-        Use this function instead of CreateGrid() when your application
-        involves complex or non-string data or data sets that are too large to
-        fit wholly in memory.
+        Top left corner of the rectangular area that was (de)selected.
     */
     */
-    bool SetTable(wxGridTableBase* table,
-                  bool takeOwnership = false,
-                  wxGridSelectionModes selmode = wxGridSelectCells);
+    wxGridCellCoords GetBottomRightCoords();
 
     /**
 
     /**
-        Call this in order to make the column labels use a native look by using
-        wxRenderer::DrawHeaderButton internally.
-
-        There is no equivalent method for drawing row columns as there is not
-        native look for that. This option is useful when using wxGrid for
-        displaying tables and not as a spread-sheet.
+        Bottom row of the rectangular area that was (de)selected.
     */
     */
-    void SetUseNativeColLabels(bool native = true);
+    int GetBottomRow();
 
     /**
 
     /**
-        Displays the in-place cell edit control for the current cell.
+        Left column of the rectangular area that was (de)selected.
     */
     */
-    void ShowCellEditControl();
+    int GetLeftCol();
 
     /**
 
     /**
-        Returns the column at the given pixel position.
-
-        @param x
-            The x position to evaluate.
-        @param clipToMinMax
-            If @true, rather than returning wxNOT_FOUND, it returns either the
-            first or last column depending on whether x is too far to the left
-            or right respectively.
-        @return
-            The column index or wxNOT_FOUND.
+        Right column of the rectangular area that was (de)selected.
     */
     */
-    int XToCol(int x, bool clipToMinMax = false) const;
+    int GetRightCol();
 
     /**
 
     /**
-        Returns the column whose right hand edge is close to the given logical
-        x position.
-
-        If no column edge is near to this position @c wxNOT_FOUND is returned.
+        Top left corner of the rectangular area that was (de)selected.
     */
     */
-    int XToEdgeOfCol(int x) const;
+    wxGridCellCoords GetTopLeftCoords();
 
 
-    //@{
     /**
     /**
-        Translates logical pixel coordinates to the grid cell coordinates.
-
-        Notice that this function expects logical coordinates on input so if
-        you use this function in a mouse event handler you need to translate
-        the mouse position, which is expressed in device coordinates, to
-        logical ones.
-
-        @see XToCol(), YToRow()
-     */
-
-    // XYToCell(int, int, wxGridCellCoords&) overload is intentionally
-    // undocumented, using it is ugly and non-const reference parameters are
-    // not used in wxWidgets API
-
-    wxGridCellCoords XYToCell(int x, int y) const;
-    wxGridCellCoords XYToCell(const wxPoint& pos) const;
-
-    //@}
+        Top row of the rectangular area that was (de)selected.
+    */
+    int GetTopRow();
 
     /**
 
     /**
-        Returns the row whose bottom edge is close to the given logical y
-        position.
-
-        If no row edge is near to this position @c wxNOT_FOUND is returned.
+        Returns @true if the Meta key was down at the time of the event.
     */
     */
-    int YToEdgeOfRow(int y) const;
+    bool MetaDown() const;
 
     /**
 
     /**
-        Returns the grid row that corresponds to the logical y coordinate.
+        Returns @true if the area was selected, @false otherwise.
+    */
+    bool Selecting();
 
 
-        Returns @c wxNOT_FOUND if there is no row at the y position.
+    /**
+        Returns @true if the Shift key was down at the time of the event.
     */
     */
-    int YToRow(int y) const;
+    bool ShiftDown() const;
 };
 
 
 
 /**
 };
 
 
 
 /**
-    @class wxGridCellBoolEditor
+    @class wxGridEditorCreatedEvent
 
 
-    The editor for boolean data.
+    @beginEventTable{wxGridEditorCreatedEvent}
+    @event{EVT_GRID_EDITOR_CREATED(func)}
+        The editor for a cell was created. Processes a
+        @c wxEVT_GRID_EDITOR_CREATED event type.
+    @event{EVT_GRID_CMD_EDITOR_CREATED(id, func)}
+        The editor for a cell was created; variant taking a window identifier.
+        Processes a @c wxEVT_GRID_EDITOR_CREATED event type.
+    @endEventTable
 
     @library{wxadv}
 
     @library{wxadv}
-    @category{grid}
-
-    @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellNumberEditor,
-    wxGridCellTextEditor, wxGridCellChoiceEditor
+    @category{grid,events}
 */
 */
-class wxGridCellBoolEditor : public wxGridCellEditor
+class wxGridEditorCreatedEvent : public wxCommandEvent
 {
 public:
     /**
         Default constructor.
     */
 {
 public:
     /**
         Default constructor.
     */
-    wxGridCellBoolEditor();
-
+    wxGridEditorCreatedEvent();
     /**
     /**
-        Returns @true if the given @a value is equal to the string representation of
-        the truth value we currently use (see
-        wxGridCellBoolEditor::UseStringValues).
+        Constructor for initializing all event attributes.
     */
     */
-    static bool IsTrueValue(const wxString& value);
+    wxGridEditorCreatedEvent(int id, wxEventType type, wxObject* obj,
+                             int row, int col, wxControl* ctrl);
 
     /**
 
     /**
-        ,  wxString&@e valueFalse = _T(""))
-        This method allows to customize the values returned by GetValue() method for
-        the cell using this editor. By default, the default values of the arguments are
-        used, i.e. @c "1" is returned if the cell is checked and an empty string
-        otherwise, using this method allows to change this.
+        Returns the column at which the event occurred.
     */
     */
-    static void UseStringValues() const;
-};
-
-
-
-/**
-    @class wxGridUpdateLocker
-
-    This small class can be used to prevent wxGrid from redrawing
-    during its lifetime by calling wxGrid::BeginBatch
-    in its constructor and wxGrid::EndBatch in its
-    destructor. It is typically used in a function performing several operations
-    with a grid which would otherwise result in flicker. For example:
-
-    @code
-    void MyFrame::Foo()
-        {
-            m_grid = new wxGrid(this, ...);
-
-            wxGridUpdateLocker noUpdates(m_grid);
-            m_grid-AppendColumn();
-            ... many other operations with m_grid...
-            m_grid-AppendRow();
+    int GetCol();
 
 
-            // destructor called, grid refreshed
-        }
-    @endcode
+    /**
+        Returns the edit control.
+    */
+    wxControl* GetControl();
 
 
-    Using this class is easier and safer than calling
-    wxGrid::BeginBatch and wxGrid::EndBatch
-    because you don't risk not to call the latter (due to an exception for example).
+    /**
+        Returns the row at which the event occurred.
+    */
+    int GetRow();
 
 
-    @library{wxadv}
-    @category{grid}
-*/
-class wxGridUpdateLocker
-{
-public:
     /**
     /**
-        Creates an object preventing the updates of the specified @e grid. The
-        parameter could be @NULL in which case nothing is done. If @a grid is
-        non-@NULL then the grid must exist for longer than wxGridUpdateLocker object
-        itself.
-        The default constructor could be followed by a call to
-        Create() to set the
-        grid object later.
+        Sets the column at which the event occurred.
     */
     */
-    wxGridUpdateLocker(wxGrid* grid = NULL);
+    void SetCol(int col);
 
     /**
 
     /**
-        Destructor reenables updates for the grid this object is associated with.
+        Sets the edit control.
     */
     */
-    ~wxGridUpdateLocker();
+    void SetControl(wxControl* ctrl);
 
     /**
 
     /**
-        This method can be called if the object had been constructed using the default
-        constructor. It must not be called more than once.
+        Sets the row at which the event occurred.
     */
     */
-    void Create(wxGrid* grid);
+    void SetRow(int row);
 };
 
 };