/////////////////////////////////////////////////////////////////////////////
// Name: grid.h
-// Purpose: documentation for wxGridCellFloatRenderer class
+// Purpose: interface of wxGridCellFloatRenderer
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
/**
@class wxGridCellFloatRenderer
@wxheader{grid.h}
-
+
This class may be used to format floating point data in a cell.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellRenderer, wxGridCellNumberRenderer, wxGridCellStringRenderer,
+
+ @see wxGridCellRenderer, wxGridCellNumberRenderer, wxGridCellStringRenderer,
wxGridCellBoolRenderer
*/
class wxGridCellFloatRenderer : public wxGridCellStringRenderer
{
public:
/**
- @param width
- Minimum number of characters to be shown.
-
- @param precision
- Number of digits after the decimal dot.
+ @param width
+ Minimum number of characters to be shown.
+ @param precision
+ Number of digits after the decimal dot.
*/
wxGridCellFloatRenderer(int width = -1, int precision = -1);
/**
Returns the precision ( see @ref constr() wxGridCellFloatRenderer ).
*/
- int GetPrecision();
+ int GetPrecision() const;
/**
Returns the width ( see @ref constr() wxGridCellFloatRenderer ).
*/
- int GetWidth();
+ int GetWidth() const;
/**
Parameters string format is "width[,precision]".
};
+
/**
@class wxGridTableBase
@wxheader{grid.h}
-
+
Grid table classes.
-
+
@library{wxadv}
@category{FIXME}
*/
{
public:
/**
-
+
*/
wxGridTableBase();
/**
-
+
*/
~wxGridTableBase();
/**
-
+
*/
bool AppendCols(size_t numCols = 1);
/**
-
+
*/
bool AppendRows(size_t numRows = 1);
/**
-
+
*/
bool CanGetValueAs(int row, int col, const wxString& typeName);
bool CanHaveAttributes();
/**
-
+
*/
bool CanSetValueAs(int row, int col, const wxString& typeName);
/**
-
+
*/
void Clear();
/**
-
+
*/
bool DeleteCols(size_t pos = 0, size_t numCols = 1);
/**
-
+
*/
bool DeleteRows(size_t pos = 0, size_t numRows = 1);
/**
get the currently used attr provider (may be @NULL)
*/
- wxGridCellAttrProvider* GetAttrProvider();
+ wxGridCellAttrProvider* GetAttrProvider() const;
/**
-
+
*/
wxString GetColLabelValue(int col);
/**
-
+
*/
int GetNumberCols();
int GetNumberRows();
/**
-
+
*/
wxString GetRowLabelValue(int row);
wxString GetTypeName(int row, int col);
/**
-
+
*/
wxString GetValue(int row, int col);
/**
-
+
*/
bool GetValueAsBool(int row, int col);
const wxString& typeName);
/**
-
+
*/
double GetValueAsDouble(int row, int col);
/**
-
+
*/
long GetValueAsLong(int row, int col);
/**
-
+
*/
- wxGrid * GetView();
+ wxGrid* GetView() const;
/**
-
+
*/
bool InsertCols(size_t pos = 0, size_t numCols = 1);
/**
-
+
*/
bool InsertRows(size_t pos = 0, size_t numRows = 1);
/**
-
+
*/
bool IsEmptyCell(int row, int col);
void SetAttrProvider(wxGridCellAttrProvider* attrProvider);
/**
-
+
*/
void SetColAttr(wxGridCellAttr* attr, int col);
/**
- , @b const@e wxString)
+ , @e wxString)
*/
- void SetColLabelValue();
+ void SetColLabelValue() const;
/**
-
+
*/
void SetRowAttr(wxGridCellAttr* attr, int row);
/**
- , @b const@e wxString)
+ , @e wxString)
*/
- void SetRowLabelValue();
+ void SetRowLabelValue() const;
/**
-
+
*/
void SetValue(int row, int col, const wxString& value);
/**
-
+
*/
void SetValueAsBool(int row, int col, bool value);
/**
-
+
*/
void SetValueAsCustom(int row, int col, const wxString& typeName,
void* value);
/**
-
+
*/
void SetValueAsDouble(int row, int col, double value);
/**
-
+
*/
void SetValueAsLong(int row, int col, long value);
void SetView(wxGrid* grid);
/**
-
+
*/
void UpdateAttrCols(size_t pos, int numCols);
};
+
/**
@class wxGridCellEditor
@wxheader{grid.h}
-
+
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.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellTextEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
+
+ @see wxGridCellTextEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
wxGridCellNumberEditor, wxGridCellChoiceEditor
*/
-class wxGridCellEditor
+class wxGridCellEditor
{
public:
/**
-
+
*/
wxGridCellEditor();
/**
Create a new object which is the copy of this one.
*/
- wxGridCellEditor* Clone();
+ wxGridCellEditor* Clone() const;
/**
Creates the actual edit control.
void HandleReturn(wxKeyEvent& event);
/**
-
+
*/
bool IsCreated();
Show or hide the edit control, use the specified attributes to set
colours/fonts for it.
*/
- void Show(bool show, wxGridCellAttr* attr = @NULL);
+ void Show(bool show, wxGridCellAttr* attr = NULL);
/**
If the editor is enabled by clicking on the cell, this method will be
};
+
/**
@class wxGridCellTextEditor
@wxheader{grid.h}
-
+
The editor for string/text data.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
+
+ @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
wxGridCellNumberEditor, wxGridCellChoiceEditor
*/
class wxGridCellTextEditor : public wxGridCellEditor
};
+
/**
@class wxGridCellStringRenderer
@wxheader{grid.h}
-
+
This class may be used to format string data in a cell; it is the default
for string cells.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellRenderer, wxGridCellNumberRenderer, wxGridCellFloatRenderer,
+
+ @see wxGridCellRenderer, wxGridCellNumberRenderer, wxGridCellFloatRenderer,
wxGridCellBoolRenderer
*/
class wxGridCellStringRenderer : public wxGridCellRenderer
};
+
/**
@class wxGridCellChoiceEditor
@wxheader{grid.h}
-
+
The editor for string data allowing to choose from a list of strings.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
+
+ @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.
+ @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);
- wxGridCellChoiceEditor(const wxArrayString& choices,
- bool allowOthers = @false);
+ const wxString choices[] = NULL,
+ bool allowOthers = false);
+ wxGridCellChoiceEditor(const wxArrayString& choices,
+ bool allowOthers = false);
//@}
/**
};
+
/**
@class wxGridEditorCreatedEvent
@wxheader{grid.h}
-
-
+
+
@library{wxadv}
@category{FIXME}
*/
public:
//@{
/**
-
+
*/
wxGridEditorCreatedEvent();
- wxGridEditorCreatedEvent(int id, wxEventType type,
- wxObject* obj,
- int row,
- int col,
- wxControl* ctrl);
+ wxGridEditorCreatedEvent(int id, wxEventType type,
+ wxObject* obj,
+ int row,
+ int col,
+ wxControl* ctrl);
//@}
/**
};
+
/**
@class wxGridRangeSelectEvent
@wxheader{grid.h}
-
-
+
+
@library{wxadv}
@category{FIXME}
*/
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);
+ 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);
//@}
/**
};
+
/**
@class wxGridCellRenderer
@wxheader{grid.h}
-
+
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{FIXME}
-
- @seealso
- wxGridCellStringRenderer, wxGridCellNumberRenderer, wxGridCellFloatRenderer,
- wxGridCellBoolRenderer
+
+ @see wxGridCellStringRenderer, wxGridCellNumberRenderer,
+ wxGridCellFloatRenderer, wxGridCellBoolRenderer
*/
-class wxGridCellRenderer
+class wxGridCellRenderer
{
public:
/**
-
+
*/
- wxGridCellRenderer* Clone();
+ wxGridCellRenderer* Clone() const;
/**
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.
};
+
/**
@class wxGridCellNumberEditor
@wxheader{grid.h}
-
+
The editor for numeric integer data.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
+
+ @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellBoolEditor,
wxGridCellTextEditor, wxGridCellChoiceEditor
*/
class wxGridCellNumberEditor : public wxGridCellTextEditor
/**
String representation of the value.
*/
- wxString GetString();
+ wxString GetString() const;
/**
If the return value is @true, the editor uses a wxSpinCtrl to get user input,
otherwise it uses a wxTextCtrl.
*/
- bool HasRange();
+ bool HasRange() const;
/**
Parameters string format is "min,max".
};
+
/**
@class wxGridSizeEvent
@wxheader{grid.h}
-
+
This event class contains information about a row/column resize event.
-
+
@library{wxadv}
@category{FIXME}
*/
public:
//@{
/**
-
+
*/
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);
+ 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);
//@}
/**
};
+
/**
@class wxGridCellNumberRenderer
@wxheader{grid.h}
-
+
This class may be used to format integer data in a cell.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellRenderer, wxGridCellStringRenderer, wxGridCellFloatRenderer,
+
+ @see wxGridCellRenderer, wxGridCellStringRenderer, wxGridCellFloatRenderer,
wxGridCellBoolRenderer
*/
class wxGridCellNumberRenderer : public wxGridCellStringRenderer
};
+
/**
@class wxGridCellAttr
@wxheader{grid.h}
-
+
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.
-
+
@library{wxadv}
@category{FIXME}
*/
-class wxGridCellAttr
+class wxGridCellAttr
{
public:
//@{
Constructor specifying some of the often used attributes.
*/
wxGridCellAttr();
- wxGridCellAttr(const wxColour& colText,
- const wxColour& colBack,
- const wxFont& font,
- int hAlign, int vAlign);
+ wxGridCellAttr(const wxColour& colText,
+ const wxColour& colBack,
+ const wxFont& font,
+ int hAlign, int vAlign);
//@}
/**
Creates a new copy of this object.
*/
- wxGridCellAttr* Clone();
+ wxGridCellAttr* Clone() const;
/**
-
+
*/
void DecRef();
/**
See SetAlignment() for the returned values.
*/
- void GetAlignment(int* hAlign, int* vAlign);
+ void GetAlignment(int* hAlign, int* vAlign) const;
/**
-
+
*/
- const wxColour GetBackgroundColour();
+ const wxColour GetBackgroundColour() const;
/**
-
+
*/
- wxGridCellEditor* GetEditor(wxGrid* grid, int row, int col);
+ wxGridCellEditor* GetEditor(wxGrid* grid, int row, int col) const;
/**
-
+
*/
- const wxFont GetFont();
+ const wxFont GetFont() const;
/**
-
+
*/
- wxGridCellRenderer* GetRenderer(wxGrid* grid, int row, int col);
+ wxGridCellRenderer* GetRenderer(wxGrid* grid, int row, int col) const;
/**
-
+
*/
- const wxColour GetTextColour();
+ const wxColour GetTextColour() const;
/**
-
+
*/
- bool HasAlignment();
+ bool HasAlignment() const;
/**
-
+
*/
- bool HasBackgroundColour();
+ bool HasBackgroundColour() const;
/**
-
+
*/
- bool HasEditor();
+ bool HasEditor() const;
/**
-
+
*/
- bool HasFont();
+ bool HasFont() const;
/**
-
+
*/
- bool HasRenderer();
+ bool HasRenderer() const;
/**
accessors
*/
- bool HasTextColour();
+ bool HasTextColour() const;
/**
This class is ref counted: it is created with ref count of 1, so
void IncRef();
/**
-
+
*/
- bool IsReadOnly();
+ bool IsReadOnly() const;
/**
- Sets the alignment. @e hAlign can be one of @c wxALIGN_LEFT,
- @c wxALIGN_CENTRE or @c wxALIGN_RIGHT and @e vAlign can be one
+ 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);
void SetBackgroundColour(const wxColour& colBack);
/**
-
+
*/
void SetDefAttr(wxGridCellAttr* defAttr);
/**
-
+
*/
void SetEditor(wxGridCellEditor* editor);
void SetFont(const wxFont& font);
/**
-
+
*/
- void SetReadOnly(bool isReadOnly = @true);
+ void SetReadOnly(bool isReadOnly = true);
/**
takes ownership of the pointer
};
+
/**
@class wxGridCellBoolRenderer
@wxheader{grid.h}
-
+
This class may be used to format boolean data in a cell.
for string cells.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellRenderer, wxGridCellStringRenderer, wxGridCellFloatRenderer,
+
+ @see wxGridCellRenderer, wxGridCellStringRenderer, wxGridCellFloatRenderer,
wxGridCellNumberRenderer
*/
class wxGridCellBoolRenderer : public wxGridCellRenderer
};
+
/**
@class wxGridEvent
@wxheader{grid.h}
-
+
This event class contains information about various grid events.
-
+
@library{wxadv}
@category{FIXME}
*/
public:
//@{
/**
-
+
*/
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);
+ 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);
//@}
/**
};
+
/**
@class wxGridCellFloatEditor
@wxheader{grid.h}
-
+
The editor for floating point numbers data.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellEditor, wxGridCellNumberEditor, wxGridCellBoolEditor,
+
+ @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.
+ @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);
};
+
/**
@class wxGrid
@wxheader{grid.h}
-
+
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
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_gridoverview "wxGrid classes overview" has
+ renderers. The @ref overview_gridoverview 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.
-
+
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.
+ 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.
-
+
wxGridCellRenderer is the abstract base
class for rendereing contents in a cell. The following renderers are
predefined:
wxGridCellNumberRenderer. The
look of a cell can be further defined using wxGridCellAttr.
An object 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:
wxGridCellBoolEditor
wxGridCellChoiceEditor
wxGridCellNumberEditor.
-
+
@library{wxadv}
@category{miscwnd}
-
- @seealso
- @ref overview_gridoverview "wxGrid overview"
+
+ @see @ref overview_gridoverview "wxGrid overview"
*/
class wxGrid : public wxScrolledWindow
{
it.
*/
wxGrid();
- wxGrid(wxWindow* parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxWANTS_CHARS,
- const wxString& name = wxPanelNameStr);
+ wxGrid(wxWindow* parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxWANTS_CHARS,
+ const wxString& name = wxPanelNameStr);
//@}
/**
/**
Appends one or more new columns to the right of the grid and returns @true if
successful. The 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.
*/
- bool AppendCols(int numCols = 1, bool updateLabels = @true);
+ bool AppendCols(int numCols = 1, bool updateLabels = true);
/**
Appends one or more new rows to the bottom of the grid and returns @true if
successful. The 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.
*/
- bool AppendRows(int numRows = 1, bool updateLabels = @true);
+ bool AppendRows(int numRows = 1, bool updateLabels = true);
/**
Automatically sets the height and width of all rows and columns to fit their
calculated width will
also be set as the minimal width for the column.
*/
- void AutoSizeColumn(int col, bool setAsMin = @true);
+ void AutoSizeColumn(int col, bool setAsMin = true);
/**
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.
*/
- void AutoSizeColumns(bool setAsMin = @true);
+ void AutoSizeColumns(bool setAsMin = true);
/**
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);
+ void AutoSizeRow(int row, bool setAsMin = true);
/**
Automatically adjusts height of the row to fit its label.
calculated heights will
also be set as the minimal heights for the rows.
*/
- void AutoSizeRows(bool setAsMin = @true);
+ void AutoSizeRows(bool setAsMin = true);
/**
AutoSizeColumn()
-
+
AutoSizeRow()
-
+
AutoSizeColumns()
-
+
AutoSizeRows()
-
+
AutoSize()
-
+
SetColMinimalWidth()
-
+
SetRowMinimalHeight()
-
+
SetColMinimalAcceptableWidth()
-
+
SetRowMinimalAcceptableHeight()
-
+
GetColMinimalAcceptableWidth()
-
+
GetRowMinimalAcceptableHeight()
*/
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.
-
- @sa wxGridUpdateLocker
+
+ @see wxGridUpdateLocker
*/
void BeginBatch();
limited by TopLeft and BottomRight cell in device coords and clipped
to the client size of the grid window.
*/
- wxRect BlockToDeviceRect(const wxGridCellCoords & topLeft,
- const wxGridCellCoords & bottomRight);
+ wxRect BlockToDeviceRect(const wxGridCellCoords& topLeft,
+ const wxGridCellCoords& bottomRight) const;
/**
Returns @true if columns can be moved by dragging with the mouse. Columns can be
moved
by dragging on their labels.
*/
- bool CanDragColMove();
+ bool CanDragColMove() const;
/**
Returns @true if columns can be resized by dragging with the mouse. Columns can
resized by dragging the right edge of the column in the grid cell area
(see wxGrid::EnableDragGridSize).
*/
- bool CanDragColSize();
+ bool CanDragColSize() const;
/**
Return @true if the dragging of grid lines to resize rows and columns is enabled
or @false otherwise.
*/
- bool CanDragGridSize();
+ bool CanDragGridSize() const;
/**
Returns @true if rows can be resized by dragging with the mouse. Rows can be
resized by dragging the lower edge of the row in the grid cell area
(see wxGrid::EnableDragGridSize).
*/
- bool CanDragRowSize();
+ bool CanDragRowSize() const;
/**
Returns @true if the in-place edit control for the current grid cell can be used
and
@false otherwise (e.g. if the current cell is read-only).
*/
- bool CanEnableCellControl();
+ bool CanEnableCellControl() const;
/**
Do we have some place to store attributes in?
*/
- bool CanHaveAttributes();
+ bool CanHaveAttributes() const;
/**
EnableDragRowSize()
-
+
EnableDragColSize()
-
+
CanDragRowSize()
-
+
CanDragColSize()
-
+
EnableDragColMove()
-
+
CanDragColMove()
-
+
EnableDragGridSize()
-
+
CanDragGridSize()
-
+
GetColAt()
-
+
SetColPos()
-
+
GetColPos()
-
+
EnableDragCell()
-
+
CanDragCell()
*/
logical
coordinates.
*/
- wxRect CellToRect(int row, int col);
- wxRect CellToRect(const wxGridCellCoords& coords);
+ wxRect CellToRect(int row, int col) const;
+ const wxRect CellToRect(const wxGridCellCoords& coords) const;
//@}
/**
/**
@ref ctor() wxGrid
-
+
@ref dtor() ~wxGrid
-
+
CreateGrid()
-
+
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().
/**
MoveCursorUp()
-
+
MoveCursorDown()
-
+
MoveCursorLeft()
-
+
MoveCursorRight()
-
+
MoveCursorPageUp()
-
+
MoveCursorPageDown()
-
+
MoveCursorUpBlock()
-
+
MoveCursorDownBlock()
-
+
MoveCursorLeftBlock()
-
+
MoveCursorRightBlock()
*/
Deletes one or more columns from a grid starting at the specified position and
returns
@true if successful. The 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.
*/
bool DeleteCols(int pos = 0, int numCols = 1,
- bool updateLabels = @true);
+ bool updateLabels = true);
/**
Deletes one or more rows from a grid starting at the specified position and
returns
@true if successful. The 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.
*/
bool DeleteRows(int pos = 0, int numRows = 1,
- bool updateLabels = @true);
+ bool updateLabels = true);
/**
Disables in-place editing of grid cells.
either a
wxEVT_GRID_EDITOR_SHOWN or wxEVT_GRID_EDITOR_HIDDEN event.
*/
- void EnableCellEditControl(bool enable = @true);
+ void EnableCellEditControl(bool enable = true);
/**
Enables or disables column moving by dragging with the mouse.
*/
- void EnableDragColMove(bool enable = @true);
+ void EnableDragColMove(bool enable = true);
/**
Enables or disables column sizing by dragging with the mouse.
*/
- void EnableDragColSize(bool enable = @true);
+ void EnableDragColSize(bool enable = true);
/**
Enables or disables row and column resizing by dragging gridlines with the
mouse.
*/
- void EnableDragGridSize(bool enable = @true);
+ void EnableDragGridSize(bool enable = true);
/**
Enables or disables row sizing by dragging with the mouse.
*/
- void EnableDragRowSize(bool enable = @true);
+ void EnableDragRowSize(bool enable = true);
/**
If the edit argument is @false this function sets the whole grid as read-only.
wxGridCellAttribute::SetReadOnly. For single
cells you can also use the shortcut function
SetReadOnly().
-
For more information about controlling grid cell attributes see the
wxGridCellAttr cell attribute class and the
- @ref overview_gridoverview "wxGrid classes overview".
+ @ref overview_gridoverview.
*/
void EnableEditing(bool edit);
/**
Turns the drawing of grid lines on or off.
*/
- void EnableGridLines(bool enable = @true);
+ void EnableGridLines(bool enable = true);
/**
Decrements the grid's batch count. When the count is greater than zero
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.
-
- @sa wxGridUpdateLocker
+
+ @see wxGridUpdateLocker
*/
void EndBatch();
/**
Overridden wxWindow method.
*/
-#define void Fit() /* implementation is private */
+ void Fit();
/**
Causes immediate repainting of the grid. Use this instead of the usual
without (yet) matching calls to EndBatch(). While
the grid's batch count is greater than zero the display will not be updated.
*/
- int GetBatchCount();
+ int GetBatchCount() const;
/**
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 wxALIGN_LEFT, wxALIGN_CENTRE or
- wxALIGN_RIGHT.
-
+ wxALIGN_RIGHT.
+
Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
*/
- void GetCellAlignment(int row, int col, int* horiz, int* vert);
+ void GetCellAlignment(int row, int col, int* horiz, int* vert) const;
/**
Returns the background colour of the cell at the specified location.
*/
- wxColour GetCellBackgroundColour(int row, int col);
+ wxColour GetCellBackgroundColour(int row, int col) const;
/**
Returns a pointer to the editor for the cell at the specified location.
-
See wxGridCellEditor and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
*/
- wxGridCellEditor* GetCellEditor(int row, int col);
+ wxGridCellEditor* GetCellEditor(int row, int col) const;
/**
Returns the font for text in the grid cell at the specified location.
*/
- wxFont GetCellFont(int row, int col);
+ wxFont GetCellFont(int row, int col) const;
/**
Returns a pointer to the renderer for the grid cell at the specified location.
-
See wxGridCellRenderer and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
*/
- wxGridCellRenderer* GetCellRenderer(int row, int col);
+ wxGridCellRenderer* GetCellRenderer(int row, int col) const;
/**
Returns the text colour for the grid cell at the specified location.
*/
- wxColour GetCellTextColour(int row, int col);
+ wxColour GetCellTextColour(int row, int col) const;
//@{
/**
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_gridoverview "wxGrid overview" for more information.
*/
- wxString GetCellValue(int row, int col);
- wxString GetCellValue(const wxGridCellCoords& coords);
+ 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);
+ 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.
-
See GetRowGridLinePen() for an example.
*/
wxPen GetColGridLinePen(int col);
/**
Sets the arguments to the current column label alignment values.
-
Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or
wxALIGN_RIGHT.
-
+
Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
*/
- void GetColLabelAlignment(int* horiz, int* vert);
+ void GetColLabelAlignment(int* horiz, int* vert) const;
/**
Returns the current height of the column labels.
*/
- int GetColLabelSize();
+ int GetColLabelSize() const;
/**
Returns the specified column label. The default grid table class provides
wxGridTableBase::GetColLabelValue to provide
your own labels.
*/
- wxString GetColLabelValue(int col);
+ wxString GetColLabelValue(int col) const;
/**
-
+
*/
- int GetColLeft(int col);
+ int GetColLeft(int col) const;
/**
This returns the value of the lowest column width that can be handled
correctly. See
member SetColMinimalAcceptableWidth() for details.
*/
- int GetColMinimalAcceptableWidth();
+ int GetColMinimalAcceptableWidth() const;
/**
Get the minimal width of the given column/row.
*/
- int GetColMinimalWidth(int col);
+ int GetColMinimalWidth(int col) const;
/**
Returns the position of the specified column.
*/
- int GetColPos(int colID);
+ int GetColPos(int colID) const;
/**
-
+
*/
- int GetColRight(int col);
+ int GetColRight(int col) const;
/**
Returns the width of the specified column.
*/
- int GetColSize(int col);
+ int GetColSize(int col) const;
/**
Sets the arguments to the current default horizontal and vertical text alignment
values.
-
Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or
- wxALIGN_RIGHT.
-
+ wxALIGN_RIGHT.
+
Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
*/
- void GetDefaultCellAlignment(int* horiz, int* vert);
+ void GetDefaultCellAlignment(int* horiz, int* vert) const;
/**
Returns the current default background colour for grid cells.
*/
- wxColour GetDefaultCellBackgroundColour();
+ wxColour GetDefaultCellBackgroundColour() const;
/**
Returns the current default font for grid cell text.
*/
- wxFont GetDefaultCellFont();
+ wxFont GetDefaultCellFont() const;
/**
Returns the current default colour for grid cell text.
*/
- wxColour GetDefaultCellTextColour();
+ wxColour GetDefaultCellTextColour() const;
/**
Returns the default height for column labels.
*/
- int GetDefaultColLabelSize();
+ int GetDefaultColLabelSize() const;
/**
Returns the current default width for grid columns.
*/
- int GetDefaultColSize();
+ int GetDefaultColSize() const;
/**
Returns a pointer to the current default grid cell editor.
-
See wxGridCellEditor and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
*/
- wxGridCellEditor* GetDefaultEditor();
+ wxGridCellEditor* GetDefaultEditor() const;
//@{
/**
-
+
*/
- wxGridCellEditor* GetDefaultEditorForCell(int row, int col);
- wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c);
+ wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const;
+ const wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c) const;
//@}
/**
-
+
*/
- wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName);
+ 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.
-
- @sa GetColGridLinePen(), GetRowGridLinePen()
+
+ @see GetColGridLinePen(), GetRowGridLinePen()
*/
wxPen GetDefaultGridLinePen();
/**
Returns a pointer to the current default grid cell renderer.
-
See wxGridCellRenderer and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
*/
- wxGridCellRenderer* GetDefaultRenderer();
+ wxGridCellRenderer* GetDefaultRenderer() const;
/**
-
+
*/
- wxGridCellRenderer* GetDefaultRendererForCell(int row, int col);
+ wxGridCellRenderer* GetDefaultRendererForCell(int row, int col) const;
/**
-
+
*/
- wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName);
+ wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const;
/**
Returns the default width for the row labels.
*/
- int GetDefaultRowLabelSize();
+ int GetDefaultRowLabelSize() const;
/**
Returns the current default height for grid rows.
*/
- int GetDefaultRowSize();
+ int GetDefaultRowSize() const;
/**
Returns the current grid cell column position.
*/
- int GetGridCursorCol();
+ int GetGridCursorCol() const;
/**
Returns the current grid cell row position.
*/
- int GetGridCursorRow();
+ int GetGridCursorRow() const;
/**
Returns the colour used for grid lines.
-
- @sa GetDefaultGridLinePen()
+
+ @see GetDefaultGridLinePen()
*/
- wxColour GetGridLineColour();
+ wxColour GetGridLineColour() const;
/**
Returns the colour used for the background of row and column labels.
*/
- wxColour GetLabelBackgroundColour();
+ wxColour GetLabelBackgroundColour() const;
/**
Returns the font used for row and column labels.
*/
- wxFont GetLabelFont();
+ wxFont GetLabelFont() const;
/**
Returns the colour used for row and column label text.
*/
- wxColour GetLabelTextColour();
+ wxColour GetLabelTextColour() const;
/**
Returns the total number of grid columns (actually the number of columns in the
underlying grid
table).
*/
- int GetNumberCols();
+ int GetNumberCols() const;
/**
Returns the total number of grid rows (actually the number of rows in the
underlying grid table).
*/
- int GetNumberRows();
+ int GetNumberRows() const;
/**
-
+
*/
- wxGridCellAttr* GetOrCreateCellAttr(int row, int col);
+ wxGridCellAttr* GetOrCreateCellAttr(int row, int col) const;
/**
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 row @e row.
-
Example:
*/
wxPen GetRowGridLinePen(int row);
/**
Sets the arguments to the current row label alignment values.
-
- Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT.
-
+ Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT.
+
Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
*/
- void GetRowLabelAlignment(int* horiz, int* vert);
+ void GetRowLabelAlignment(int* horiz, int* vert) const;
/**
Returns the current width of the row labels.
*/
- int GetRowLabelSize();
+ int GetRowLabelSize() const;
/**
Returns the specified row label. The default grid table class provides numeric
wxGridTableBase::GetRowLabelValue to provide
your own labels.
*/
- wxString GetRowLabelValue(int row);
+ wxString GetRowLabelValue(int row) const;
/**
This returns the value of the lowest row width that can be handled correctly.
See
member SetRowMinimalAcceptableHeight() for details.
*/
- int GetRowMinimalAcceptableHeight();
+ int GetRowMinimalAcceptableHeight() const;
/**
-
+
*/
- int GetRowMinimalHeight(int col);
+ int GetRowMinimalHeight(int col) const;
/**
Returns the height of the specified row.
*/
- int GetRowSize(int row);
+ int GetRowSize(int row) const;
/**
Returns the number of pixels per horizontal scroll increment. The default is 15.
-
- @sa GetScrollLineY(), SetScrollLineX(), SetScrollLineY()
+
+ @see GetScrollLineY(), SetScrollLineX(), SetScrollLineY()
*/
- int GetScrollLineX();
+ int GetScrollLineX() const;
/**
Returns the number of pixels per vertical scroll increment. The default is 15.
-
- @sa GetScrollLineX(), SetScrollLineX(), SetScrollLineY()
+
+ @see GetScrollLineX(), SetScrollLineX(), SetScrollLineY()
*/
- int GetScrollLineY();
+ int GetScrollLineY() const;
/**
Returns an array of singly selected cells.
*/
- wxGridCellCoordsArray GetSelectedCells();
+ wxGridCellCoordsArray GetSelectedCells() const;
/**
Returns an array of selected cols.
*/
- wxArrayInt GetSelectedCols();
+ wxArrayInt GetSelectedCols() const;
/**
Returns an array of selected rows.
*/
- wxArrayInt GetSelectedRows();
+ wxArrayInt GetSelectedRows() const;
/**
Access or update the selection fore/back colours
*/
- wxColour GetSelectionBackground();
+ wxColour GetSelectionBackground() const;
/**
Returns an array of the bottom right corners of blocks of selected cells,
see GetSelectionBlockTopLeft().
*/
- wxGridCellCoordsArray GetSelectionBlockBottomRight();
+ wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
/**
Returns an array of the top left corners of blocks of selected cells,
see GetSelectionBlockBottomRight().
*/
- wxGridCellCoordsArray GetSelectionBlockTopLeft();
+ wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
/**
-
+
*/
- wxColour GetSelectionForeground();
+ wxColour GetSelectionForeground() const;
/**
Returns the current selection mode, see SetSelectionMode().
*/
- wxGrid::wxGridSelectionModes GetSelectionMode();
+ wxGrid::wxGridSelectionModes GetSelectionMode() const;
/**
Returns a base pointer to the current table object.
*/
- wxGridTableBase * GetTable();
+ wxGridTableBase* GetTable() const;
/**
Returned number of whole cols visible.
*/
- int GetViewWidth();
+ int GetViewWidth() const;
/**
EnableGridLines()
-
+
GridLinesEnabled()
-
+
SetGridLineColour()
-
+
GetGridLineColour()
-
+
GetDefaultGridLinePen()
-
+
GetRowGridLinePen()
-
+
GetColGridLinePen()
*/
/**
Returns @true if drawing of grid lines is turned on, @false otherwise.
*/
- bool GridLinesEnabled();
+ bool GridLinesEnabled() const;
/**
Hides the in-place cell edit control.
void InitColWidths();
/**
- NB: @e never access m_row/col arrays directly because they are created
+ @note @e never access m_row/col arrays directly because they are created
on demand, @e always use accessor functions instead!
-
Init the m_rowHeights/Bottoms arrays with default values.
*/
void InitRowHeights();
specified position and returns @true if successful. The updateLabels argument is
not
used at present.
-
The sequence of actions begins with the grid object requesting the underlying
grid
table to insert new columns. If this is successful the table notifies the grid
table class.
*/
bool InsertCols(int pos = 0, int numCols = 1,
- bool updateLabels = @true);
+ bool updateLabels = true);
/**
Inserts one or more new rows into a grid with the first new row at the specified
position and returns @true if successful. The updateLabels argument is not used
at
present.
-
The sequence of actions begins with the grid object requesting the underlying
grid
table to insert new rows. If this is successful the table notifies the grid and
table class.
*/
bool InsertRows(int pos = 0, int numRows = 1,
- bool updateLabels = @true);
+ bool updateLabels = true);
/**
Returns @true if the in-place edit control is currently enabled.
*/
- bool IsCellEditControlEnabled();
+ bool IsCellEditControlEnabled() const;
/**
Returns @true if the current cell has been set to read-only
(see wxGrid::SetReadOnly).
*/
- bool IsCurrentCellReadOnly();
+ bool IsCurrentCellReadOnly() const;
/**
Returns @false if the whole grid has been set as read-only or @true otherwise.
See EnableEditing() for more information about
controlling the editing status of grid cells.
*/
- bool IsEditable();
+ bool IsEditable() const;
//@{
/**
Is this cell currently selected.
*/
- bool IsInSelection(int row, int col);
- bool IsInSelection(const wxGridCellCoords& coords);
+ bool IsInSelection(int row, int col) const;
+ const bool IsInSelection(const wxGridCellCoords& coords) const;
//@}
/**
Returns @true if the cell at the specified location can't be edited.
See also IsReadOnly().
*/
- bool IsReadOnly(int row, int col);
+ bool IsReadOnly(int row, int col) const;
/**
Returns @true if there are currently rows, columns or blocks of cells selected.
*/
- bool IsSelection();
+ bool IsSelection() const;
//@{
/**
partially
visible in the grid window.
*/
- bool IsVisible(int row, int col, bool wholeCellVisible = @true);
- bool IsVisible(const wxGridCellCoords& coords,
- bool wholeCellVisible = @true);
+ bool IsVisible(int row, int col, bool wholeCellVisible = true) const;
+ const bool IsVisible(const wxGridCellCoords& coords,
+ bool wholeCellVisible = true) const;
//@}
//@{
nothing if the cell is already visible.
*/
void MakeCellVisible(int row, int col);
- void MakeCellVisible(const wxGridCellCoords& coords);
+ void MakeCellVisible(const wxGridCellCoords& coords);
//@}
/**
/**
SetRowLabelValue()
-
+
SetColLabelValue()
-
+
GetRowLabelValue()
-
+
GetColLabelValue()
-
+
SetUseNativeColLabels()
-
+
HideColLabels()
-
+
HideRowLabels()
-
+
SetRowLabelSize()
-
+
SetColLabelSize()
-
+
GetRowLabelSize()
-
+
GetColLabelSize()
-
+
AutoSizeRowLabelSize()
-
+
AutoSizeColLabelSize()
-
+
GetDefaultRowLabelSize()
-
+
GetDefaultColLabelSize()
-
+
SetRowLabelAlignment()
-
+
SetColLabelAlignment()
-
+
GetRowLabelAlignment()
-
+
GetColLabelAlignment()
-
+
SetLabelFont()
-
+
SetLabelTextColour()
-
+
SetLabelBackgroundColour()
-
+
GetLabelFont()
-
+
GetLabelBackgroundColour()
-
+
GetLabelTextColour()
-
+
SetColLabelTextOrientation()
-
+
GetColLabelTextOrientation()
*/
*/
void SelectBlock(int topRow, int leftCol, int bottomRow,
int rightCol,
- bool addToSelected = @false);
- void SelectBlock(const wxGridCellCoords& topLeft,
- const wxGridCellCoords& bottomRight,
- bool addToSelected = @false);
+ bool addToSelected = false);
+ void SelectBlock(const wxGridCellCoords& topLeft,
+ const wxGridCellCoords& bottomRight,
+ bool addToSelected = false);
//@}
/**
selection will be
deselected; if @true the column will be added to the existing selection.
*/
- void SelectCol(int col, bool addToSelected = @false);
+ void SelectCol(int col, bool addToSelected = false);
/**
Selects the specified row. If addToSelected is @false then any existing
selection will be
deselected; if @true the row will be added to the existing selection.
*/
- void SelectRow(int row, bool addToSelected = @false);
+ void SelectRow(int row, bool addToSelected = false);
/**
ClearSelection()
-
+
IsSelection()
-
+
SelectAll()
-
+
SelectBlock()
-
+
SelectCol()
-
+
SelectRow()
*/
This function returns the rectangle that encloses the selected cells
in device coords and clipped to the client size of the grid window.
*/
- wxRect SelectionToDeviceRect();
+ wxRect SelectionToDeviceRect() const;
//@{
/**
Sets the horizontal and vertical alignment for grid cell text at the specified
location.
-
Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or
- wxALIGN_RIGHT.
-
+ wxALIGN_RIGHT.
+
Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or
wxALIGN_BOTTOM.
*/
void SetCellAlignment(int row, int col, int horiz, int vert);
- void SetCellAlignment(int align, int row, int col);
+ void SetCellAlignment(int align, int row, int col);
//@}
/**
-
+
*/
void SetCellBackgroundColour(int row, int col,
const wxColour& colour);
/**
Sets the editor for the grid cell at the specified location.
The grid will take ownership of the pointer.
-
See wxGridCellEditor and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
/**
Sets the renderer for the grid cell at the specified location.
The grid will take ownership of the pointer.
-
See wxGridCellRenderer and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
Sets the text colour for the grid cell at the specified location.
*/
void SetCellTextColour(int row, int col, const wxColour& colour);
- void SetCellTextColour(const wxColour& val, int row, int col);
- void SetCellTextColour(const wxColour& colour);
+ void SetCellTextColour(const wxColour& val, int row, int col);
+ void SetCellTextColour(const wxColour& colour);
//@}
//@{
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.
-
See wxGridTableBase::CanSetValueAs
and the @ref overview_gridoverview "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);
+ void SetCellValue(const wxGridCellCoords& coords,
+ const wxString& s);
+ void SetCellValue(const wxString& val, int row, int col);
//@}
/**
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_gridoverview "wxGrid classes overview".
+ @ref overview_gridoverview.
*/
void SetColAttr(int col, wxGridCellAttr* attr);
/**
Sets the horizontal and vertical alignment of column label text.
-
Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or
wxALIGN_RIGHT.
-
Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or
wxALIGN_BOTTOM.
*/
/**
Sets the height of the column labels.
-
- If @e height equals to @c wxGRID_AUTOSIZE then height is calculated
+ 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.
*/
/**
Sets the width of the specified column.
-
This function does not refresh the grid. If you are calling it outside of a
BeginBatch / EndBatch
block you can use ForceRefresh() to see the changes.
-
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.
/**
Sets the default horizontal and vertical alignment for grid cell text.
-
Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or
wxALIGN_RIGHT.
-
Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or
wxALIGN_BOTTOM.
*/
the grid unless resizeExistingCols is @true.
*/
void SetDefaultColSize(int width,
- bool resizeExistingCols = @false);
+ bool resizeExistingCols = false);
/**
Sets the default editor for grid cells. The grid will take ownership of the
pointer.
-
See wxGridCellEditor and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
/**
Sets the default renderer for grid cells. The grid will take ownership of the
pointer.
-
See wxGridCellRenderer and
the @ref overview_gridoverview "wxGrid overview" for more information about
cell editors and renderers.
to the grid unless resizeExistingRows is @true.
*/
void SetDefaultRowSize(int height,
- bool resizeExistingRows = @false);
+ bool resizeExistingRows = false);
/**
Set the grid cursor to the specified cell.
/**
Common part of AutoSizeColumn/Row() and GetBestSize()
*/
- int SetOrCalcColumnSizes(bool calcOnly, bool setAsMin = @true);
+ int SetOrCalcColumnSizes(bool calcOnly, bool setAsMin = true);
/**
-
+
*/
- int SetOrCalcRowSizes(bool calcOnly, bool setAsMin = @true);
+ int SetOrCalcRowSizes(bool calcOnly, bool setAsMin = true);
/**
Makes the cell at the specified location read-only or editable.
See also IsReadOnly().
*/
- void SetReadOnly(int row, int col, bool isReadOnly = @true);
+ void SetReadOnly(int row, int col, bool isReadOnly = true);
/**
Sets the cell attributes for all cells in the specified row.
/**
Sets the horizontal and vertical alignment of row label text.
-
Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or
wxALIGN_RIGHT.
-
Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or
wxALIGN_BOTTOM.
*/
/**
Sets the width of the row labels.
-
- If @e width equals @c wxGRID_AUTOSIZE then width is calculated automatically
+ 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.
*/
void SetRowLabelSize(int width);
/**
Sets the height of the specified row.
-
This function does not refresh the grid. If you are calling it outside of a
BeginBatch / EndBatch
block you can use ForceRefresh() to see the changes.
-
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.
Sets the number of pixels per horizontal scroll increment. The default is 15.
Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
errors: setting this to 1 can help.
-
- @sa GetScrollLineX(), GetScrollLineY(), SetScrollLineY()
+
+ @see GetScrollLineX(), GetScrollLineY(), SetScrollLineY()
*/
void SetScrollLineX(int x);
Sets the number of pixels per vertical scroll increment. The default is 15.
Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
errors: setting this to 1 can help.
-
- @sa GetScrollLineX(), GetScrollLineY(), SetScrollLineX()
+
+ @see GetScrollLineX(), GetScrollLineY(), SetScrollLineX()
*/
void SetScrollLineY(int y);
/**
-
+
*/
void SetSelectionBackground(const wxColour& c);
/**
-
+
*/
void SetSelectionForeground(const wxColour& c);
/**
Set the selection behaviour of the grid.
-
- @param wxGridSelectCells()
- The default mode where individual cells are selected.
-
- @param wxGridSelectRows()
- Selections will consist of whole rows.
-
- @param wxGridSelectColumns()
- Selections will consist of whole columns.
+
+ @param wxGridSelectCells()
+ The default mode where individual cells are selected.
+ @param wxGridSelectRows()
+ Selections will consist of whole rows.
+ @param wxGridSelectColumns()
+ Selections will consist of whole columns.
*/
void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
after the grid constructor and before using the grid object. If 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.
*/
- bool SetTable(wxGridTableBase* table, bool takeOwnership = @false,
+ bool SetTable(wxGridTableBase* table, bool takeOwnership = false,
wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells);
/**
there is not native look for that. This option is useful when using
wxGrid for displaying tables and not as a spread-sheet.
*/
- void SetUseNativeColLabels(bool native= @true);
+ void SetUseNativeColLabels(bool native = true);
/**
Displays the in-place cell edit control for the current cell.
void ShowCellEditControl();
/**
- @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.
+ @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.
*/
- int XToCol(int x, bool clipToMinMax = @false);
+ int XToCol(int x, bool clipToMinMax = false) const;
/**
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.
*/
- int XToEdgeOfCol(int x);
+ int XToEdgeOfCol(int x) const;
/**
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.
*/
- int YToEdgeOfRow(int y);
+ int YToEdgeOfRow(int y) const;
/**
Returns the grid row that corresponds to the logical y coordinate. Returns
@c wxNOT_FOUND if there is no row at the y position.
*/
- int YToRow(int y);
+ int YToRow(int y) const;
};
+
/**
@class wxGridCellBoolEditor
@wxheader{grid.h}
-
+
The editor for boolean data.
-
+
@library{wxadv}
@category{FIXME}
-
- @seealso
- wxGridCellEditor, wxGridCellFloatEditor, wxGridCellNumberEditor,
+
+ @see wxGridCellEditor, wxGridCellFloatEditor, wxGridCellNumberEditor,
wxGridCellTextEditor, wxGridCellChoiceEditor
*/
class wxGridCellBoolEditor : public wxGridCellEditor
wxGridCellBoolEditor();
/**
- Returns @true if the given @e value is equal to the string representation of
- the truth value we currently use (see
+ Returns @true if the given @a value is equal to the string representation of
+ the truth value we currently use (see
wxGridCellBoolEditor::UseStringValues).
*/
static bool IsTrueValue(const wxString& value);
/**
- , @b const wxString&@e valueFalse = _T(""))
-
+ , 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.
*/
- static void UseStringValues();
+ static void UseStringValues() const;
};
+
/**
@class wxGridUpdateLocker
@wxheader{grid.h}
-
+
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();
-
+
// destructor called, grid refreshed
}
@endcode
-
- Using this class is easier and safer than calling
+
+ 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).
-
+
@library{wxadv}
@category{FIXME}
*/
-class wxGridUpdateLocker
+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 @e grid is
+ 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
+ The default constructor could be followed by a call to
Create() to set the
grid object later.
*/
- wxGridUpdateLocker(wxGrid * grid = @NULL);
+ wxGridUpdateLocker(wxGrid* grid = NULL);
/**
Destructor reenables updates for the grid this object is associated with.
*/
void Create(wxGrid* grid);
};
+