\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
+\wxheading{Include files}
+
+<wx/grid.h>
+
\wxheading{Window styles}
-There are no specific window styles for this class.
+There are no specific window styles for this class, but you may use different
+SetXXX() functions to change the controls behaviour (for example, to enable
+in-place editing).
See also \helpref{window styles overview}{windowstyles}.
\membersection{wxGrid::wxGrid}\label{wxgridconstr}
-\func{void}{wxGrid}{\param{wxWindow* }{parent}, \param{const wxWindowID}{ id}, \param{const wxPoint\&}{ pos},
-\rtfsp\param{const wxSize\&}{ size}, \param{const long}{ style=0}, \param{const wxString\& }{name="grid"}}
+\func{void}{wxGrid}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id}, \param{const wxPoint\&}{ pos},
+\rtfsp\param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="grid"}}
Constructor. Before using a wxGrid object, you must call CreateGrid to set up the required rows and columns.
Call this function after creating the wxGrid object.
+\pythonnote{Currently the \tt{cellValues} and \tt{widths} parameters
+don't exisit in the wxPython version of this method. So in other
+words, the definition of the wxPython version of this method looks like this:
+\begin{verbatim}
+ CreateGrid(rows, cols,
+ defaultWidth = wxGRID_DEFAULT_CELL_WIDTH,
+ defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT)
+\end{verbatim}
+}
+
\membersection{wxGrid::CurrentCellVisible}\label{wxgridcurrentcellvisible}
\func{bool}{CurrentCellVisible}{\void}
\membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}
-\func{void}{GetBatchCount}{\void}
+\constfunc{int}{GetBatchCount}{\void}
Return the level of batch nesting. This is initially zero, and will be incremented
every time BeginBatch is called, and decremented when EndBatch is called. When the
\membersection{wxGrid::GetCell}\label{wxgridgetcell}
-\func{wxGridCell *}{GetCell}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxGridCell *}{GetCell}{\param{int}{ row}, \param{int}{ col}}
Returns the grid cell object associated with this position.
\membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}
-\func{int}{GetCellAlignment}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{int}{GetCellAlignment}{\param{int}{ row}, \param{int}{ col}}
-\func{int}{GetCellAlignment}{\void}
+\constfunc{int}{GetCellAlignment}{\void}
Sets the text alignment for the cell at the given position, or the global alignment value.
The return value is wxLEFT, wxRIGHT or wxCENTRE.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetCellAlignment(row, col)}}{}
+\twocolitem{\bf{GetDefCellAlignment()}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}
-\func{wxColour\&}{GetCellBackgroundColour}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxColour\&}{GetCellBackgroundColour}{\param{int}{ row}, \param{int}{ col}}
-\func{wxColour\&}{GetCellBackgroundColour}{\void}
+\constfunc{wxColour\&}{GetCellBackgroundColour}{\void}
Gets the background colour for the cell at the given position, or the global background colour.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetCellBackgroundColour(row, col)}}{}
+\twocolitem{\bf{GetDefCellBackgroundColourt()}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::GetCells}\label{wxgridgetcells}
-\func{wxGridCell ***}{GetCells}{\void}
+\constfunc{wxGridCell ***}{GetCells}{\void}
Returns the array of grid cell object associated with this wxGrid.
\membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}
-\func{wxColour\&}{GetCellTextColour}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxColour\&}{GetCellTextColour}{\param{int}{ row}, \param{int}{ col}}
-\func{wxColour\&}{GetCellTextColour}{\void}
+\constfunc{wxColour\&}{GetCellTextColour}{\void}
Gets the text colour for the cell at the given position, or the global text colour.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetCellTextColour(row, col)}}{}
+\twocolitem{\bf{GetDefCellTextColour()}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::GetCellTextFont}\label{wxgridgetcelltextfont}
-\func{wxFont *}{GetCellTextFont}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{const wxFont\&}{GetCellTextFont}{\param{int}{ row}, \param{int}{ col}}
-\func{wxFont *}{GetCellTextFont}{\void}
+\constfunc{wxFont\&}{GetCellTextFont}{\void}
Gets the text font for the cell at the given position, or the global text font.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetCellTextFont(row, col)}}{}
+\twocolitem{\bf{GetDefCellTextFont()}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue}
-\func{wxString\&}{GetCellValue}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxString\&}{GetCellValue}{\param{int}{ row}, \param{int}{ col}}
Returns the cell value at the given position.
\membersection{wxGrid::GetCols}\label{wxgridgetcols}
-\func{int}{GetCols}{\void}
+\constfunc{int}{GetCols}{\void}
Returns the number of columns in the grid.
\membersection{wxGrid::GetColumnWidth}\label{wxgridcolumnwidth}
-\func{int}{GetColumnWidth}{\param{int}{ col}}
+\constfunc{int}{GetColumnWidth}{\param{int}{ col}}
Gets the width in pixels for column {\it col}.
\membersection{wxGrid::GetCurrentRect}\label{wxgridgetcurrentrect}
-\func{wxRectangle *}{GetCurrentRect}{\void}
+\constfunc{wxRectangle *}{GetCurrentRect}{\void}
Returns a pointer to the rectangle enclosing the currently selected cell.
Do not delete this pointer.
\membersection{wxGrid::GetCursorColumn}\label{wxgridgetcursorcolumn}
-\func{int}{GetCursorColumn}{\void}
+\constfunc{int}{GetCursorColumn}{\void}
Returns the column position of the currently selected cell.
\membersection{wxGrid::GetCursorRow}\label{wxgridgetcursorrow}
-\func{int}{GetCursorRow}{\void}
+\constfunc{int}{GetCursorRow}{\void}
Returns the row position of the currently selected cell.
\membersection{wxGrid::GetEditable}\label{wxgridgeteditable}
-\func{bool}{GetEditable}{\void}
+\constfunc{bool}{GetEditable}{\void}
Returns TRUE if the grid cells can be edited.
+\membersection{wxGrid::GetEditInPlace}\label{wxgridgeteditinplace}
+
+\constfunc{bool}{GetEditInPlace}{\void}
+
+Returns TRUE if editing in-place is enabled.
+
\membersection{wxGrid::GetHorizScrollBar}\label{wxgridgethorizscrollbar}
-\func{wxScrollBar *}{GetHorizScrollBar}{\void}
+\constfunc{wxScrollBar *}{GetHorizScrollBar}{\void}
Returns a pointer to the horizontal scrollbar.
\membersection{wxGrid::GetLabelAlignment}\label{wxgridgetlabelalignment}
-\func{int}{GetLabelAlignment}{\param{int}{ orientation}}
+\constfunc{int}{GetLabelAlignment}{\param{int}{ orientation}}
Gets the row or column label alignment. {\it orientation} should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp
\membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
-\func{wxColour\&}{GetLabelBackgroundColour}{\void}
+\constfunc{wxColour\&}{GetLabelBackgroundColour}{\void}
Gets a row and column label text colour.
\membersection{wxGrid::GetLabelSize}\label{wxgridgetlabelsize}
-\func{int}{GetLabelSize}{\param{int}{ orientation}}
+\constfunc{int}{GetLabelSize}{\param{int}{ orientation}}
Gets the row label height, or column label width, in pixels. {\it orientation} should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.
\membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
-\func{wxColour\&}{GetLabelTextColour}{\void}
+\constfunc{wxColour\&}{GetLabelTextColour}{\void}
Gets a row and column label text colour.
\membersection{wxGrid::GetLabelTextFont}\label{wxgridgetlabeltextfont}
-\func{wxFont *}{GetLabelTextFont}{\void}
+\constfunc{wxFont\&}{GetLabelTextFont}{\void}
Gets the font to be used for the row and column labels.
\membersection{wxGrid::GetLabelValue}\label{wxgridgetlabelvalue}
-\func{wxString\&}{GetLabelValue}{\param{int}{ orientation}, \param{int}{ pos}}
+\constfunc{wxString\&}{GetLabelValue}{\param{int}{ orientation}, \param{int}{ pos}}
Gets a row or column label value. {\it orientation} should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp
\membersection{wxGrid::GetRowHeight}\label{wxgridgetrowheight}
-\func{int}{GetRowHeight}{\param{int}{ row}}
+\constfunc{int}{GetRowHeight}{\param{int}{ row}}
Gets the height in pixels for row {\it row}.
\membersection{wxGrid::GetRows}\label{wxgridgetrows}
-\func{int}{GetRows}{\void}
+\constfunc{int}{GetRows}{\void}
Returns the number of rows in the grid.
\membersection{wxGrid::GetScrollPosX}\label{wxgridgetscrollposx}
-\func{int}{GetScrollPosX}{\void}
+\constfunc{int}{GetScrollPosX}{\void}
Returns the column scroll position.
\membersection{wxGrid::GetScrollPosY}\label{wxgridgetscrollposy}
-\func{int}{GetScrollPosY}{\void}
+\constfunc{int}{GetScrollPosY}{\void}
Returns the row scroll position.
\membersection{wxGrid::GetTextItem}\label{wxgridgettextitem}
-\func{wxText *}{GetTextItem}{\void}
+\constfunc{wxText *}{GetTextItem}{\void}
Returns a pointer to the text item used for entering text into a cell.
\membersection{wxGrid::GetVertScrollBar}\label{wxgridgetvertscrollbar}
-\func{wxScrollBar *}{GetVertScrollBar}{\void}
+\constfunc{wxScrollBar *}{GetVertScrollBar}{\void}
Returns a pointer to the vertical scrollbar.
\func{void}{OnLeftClick}{\param{int}{ row}, \param{int}{ col}, \param{int}{ x}, \param{int}{ y}, \param{bool}{ control}, \param{bool}{ shift}}
Virtual function called when the left button is depressed within a
-label.
+label.
{\it row} will be {\it -1} if the click is in the top labels.
Sets the text alignment for the cell at the given position, or for the whole grid. {\it alignment} may be wxLEFT, wxRIGHT or wxCENTRE.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{SetCellAlignment(alignment, row, col)}}{}
+\twocolitem{\bf{SetDefCellAlignment(alignment)}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
\func{void}{SetCellBackgroundColour}{\param{const wxColour\&}{ colour}, \param{int}{ row}, \param{int}{ col}}
Sets the background colour for the cell at the given position, or for the whole grid.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{SetCellBackgroundColour(colour, row, col)}}{}
+\twocolitem{\bf{SetDefCellBackgroundColour(colour)}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
\func{void}{SetCellTextColour}{\param{const wxColour\&}{ colour}, \param{int}{ row}, \param{int}{ col}}
Sets the text colour for the cell at the given position, or for the whole grid.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{SetCellTextColour(colour, row, col)}}{}
+\twocolitem{\bf{SetDefCellTextColour(colour)}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::SetCellTextFont}\label{wxgridsetcelltextfont}
-\func{void}{SetCellTextFont}{\param{wxFont *}{font}, \param{int}{ row}, \param{int}{ col}}
+\func{void}{SetCellTextFont}{\param{const wxFont\&}{ font}, \param{int}{ row}, \param{int}{ col}}
-\func{void}{SetCellTextFont}{\param{wxFont *}{font}}
+\func{void}{SetCellTextFont}{\param{const wxFont\&}{ font}}
Sets the text font for the cell at the given position, or for the whole grid.
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{SetCellTextFont(font, row, col)}}{}
+\twocolitem{\bf{SetDefCellTextFont(font)}}{}
+\end{twocollist}}
+}
+
\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
\func{void}{SetCellValue}{\param{const wxString\&}{ val}, \param{int}{ row}, \param{int}{ col}}
\membersection{wxGrid::SetDividerPen}\label{wxgridsetdividerpen}
-\func{void}{SetDividerPen}{\param{wxPen *}{pen}}
+\func{void}{SetDividerPen}{\param{const wxPen\&}{ pen}}
Specifies the pen to be used for drawing the divisions between cells. The default
is a light grey. If NULL is specified, the divisions will not be drawn.
text edit control. If FALSE, the text edit control will be hidden and the user will not
be able to edit the cell contents.
+\membersection{wxGrid::SetEditInPlace}\label{wxgridseteditinplace}
+
+\func{void}{SetEditInPlace}{\param{bool}{ edit = TRUE}}
+
+Enables (if {\it edit} is TRUE, default value) or disables in-place editing.
+When it is enabled, the cells contents can be changed by typing text directly
+in the cell.
+
\membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
\func{void}{SetGridCursor}{\param{int }{row}, \param{int}{ col}}
\membersection{wxGrid::SetLabelTextFont}\label{wxgridsetlabeltextfont}
-\func{void}{SetLabelTextFont}{\param{wxFont *}{font}}
+\func{void}{SetLabelTextFont}{\param{const wxFont\&}{ font}}
Sets the font to be used for the row and column labels.