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.
*/
neither associated with this table by SetAttrProvider() nor created on
demand by any other methods.
*/
- wxGridCellAttrProvider *GetAttrProvider() const { return m_attrProvider; }
-
- /**
- Returns true if this table supports attributes or false otherwise.
-
- 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();
+ wxGridCellAttrProvider *GetAttrProvider() const;
/**
Return the attribute for the given cell.
virtual void SetColAttr(wxGridCellAttr *attr, int col);
//@}
+
+ /**
+ Returns true if this table supports attributes or false otherwise.
+
+ 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();
};
*/
wxGridCellEditor();
- /**
- The dtor is private because only DecRef() can delete us.
- */
- virtual ~wxGridCellEditor();
-
/**
Fetch the value from the table and prepare the edit control
to begin editing. Set the focus to the edit control.
/**
Creates the actual edit control.
*/
- void Create(wxWindow* parent, wxWindowID id,
- wxEvtHandler* evtHandler);
+ virtual void Create(wxWindow* parent, wxWindowID id,
+ wxEvtHandler* evtHandler) = 0;
/**
Final cleanup.
Draws the part of the cell not occupied by the control: the base class
version just fills it with background colour from the attribute.
*/
- void PaintBackground(const wxRect& rectCell,
- wxGridCellAttr* attr);
+ virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr* attr);
/**
Reset the value in the control back to its starting value.
that first key if desired.
*/
virtual void StartingKey(wxKeyEvent& event);
+
+protected:
+
+ /**
+ The dtor is private because only DecRef() can delete us.
+ */
+ virtual ~wxGridCellEditor();
};
wxGridCellChoiceEditor(size_t count = 0,
const wxString choices[] = NULL,
bool allowOthers = false);
+ /**
+ @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);
//@}
/**
Get the preferred size of the cell for its contents.
*/
- wxSize GetBestSize(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
- int row, int col);
+ virtual wxSize GetBestSize(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
+ int row, int col) = 0;
};
*/
wxGridCellNumberEditor(int min = -1, int max = -1);
+
/**
- String representation of the value.
+ Parameters string format is "min,max".
*/
- wxString GetString() const;
+ virtual void SetParameters(const wxString& params);
+
+protected:
/**
If the return value is @true, the editor uses a wxSpinCtrl to get user input,
bool HasRange() const;
/**
- Parameters string format is "min,max".
+ String representation of the value.
*/
- virtual void SetParameters(const wxString& params);
+ wxString GetString() const;
};
/**
*/
- const wxColour GetBackgroundColour() const;
+ const wxColour& GetBackgroundColour() const;
/**
*/
- wxGridCellEditor* GetEditor(wxGrid* grid, int row, int col) const;
+ wxGridCellEditor* GetEditor(const wxGrid* grid, int row, int col) const;
/**
*/
- const wxFont GetFont() const;
+ const wxFont& GetFont() const;
/**
*/
- wxGridCellRenderer* GetRenderer(wxGrid* grid, int row, int col) const;
+ wxGridCellRenderer* GetRenderer(const wxGrid* grid, int row, int col) const;
/**
*/
- const wxColour GetTextColour() const;
+ const wxColour& GetTextColour() const;
/**
*/
bool CanEnableCellControl() const;
- /**
- 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.
- */
- bool CanHaveAttributes() const;
-
//@{
/**
Return the rectangle corresponding to the grid cell's size and position
/**
Overridden wxWindow method.
*/
- void Fit();
+ virtual void Fit();
/**
Causes immediate repainting of the grid.
/**
Returns a pointer to the editor for the cell at the specified location.
- See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
+ See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
for more information about cell editors and renderers.
The caller must call DecRef() on the returned pointer.
*/
wxString GetColLabelValue(int col) const;
- /**
- Returns the coordinate of the left border specified column.
- */
- int GetColLeft(int col) const;
-
/**
Returns the minimal width to which a column may be resized.
*/
int GetColMinimalAcceptableWidth() const;
- /**
- Get the minimal width of the given column/row.
-
- 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;
-
/**
Returns the position of the specified column.
*/
int GetColPos(int colID) const;
- /**
- Returns the coordinate of the right border specified column.
- */
- int GetColRight(int col) const;
-
/**
Returns the width of the specified column.
*/
*/
int GetRowMinimalAcceptableHeight() const;
- /**
- Returns the minimal size for the given column.
-
- The value returned by this function may be different than that returned
- by GetRowMinimalAcceptableHeight() if SetRowMinimalHeight() had been
- called for this row.
- */
- int GetRowMinimalHeight(int col) const;
-
/**
Returns the height of the specified row.
*/
@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;
+ bool IsVisible(const wxGridCellCoords& coords,
+ bool wholeCellVisible = true) const;
//@}
//@{
The grid will take ownership of the pointer.
- See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
+ See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
for more information about cell editors and renderers.
*/
void SetDefaultRenderer(wxGridCellRenderer* renderer);
Returns @c wxNOT_FOUND if there is no row at the y position.
*/
- int YToRow(int y) const;
+ int YToRow(int y, bool clipToMinMax = false) const;
+
+protected:
+ /**
+ 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.
+ */
+ bool CanHaveAttributes() const;
+
+ /**
+ Get the minimal width of the given column/row.
+
+ 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;
+
+ /**
+ Returns the coordinate of the right border specified column.
+ */
+ int GetColRight(int col) const;
+
+ /**
+ Returns the coordinate of the left border specified column.
+ */
+ int GetColLeft(int col) const;
+
+ /**
+ Returns the minimal size for the given column.
+
+ The value returned by this function may be different than that returned
+ by GetRowMinimalAcceptableHeight() if SetRowMinimalHeight() had been
+ called for this row.
+ */
+ int GetRowMinimalHeight(int col) const;
};