wxGrid is a class for displaying and editing tabular information.
+{\bf Note:} there is a new grid implementation from wxWindows 2.1.14,
+with an API that is backwardly compatible with the one documented here.
+This documentation is awaiting updates for the new and improved API.
+
\wxheading{Derived from}
\helpref{wxPanel}{wxpanel}\\
\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}.
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}
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}
\constfunc{wxColour\&}{GetCellBackgroundColour}{\param{int}{ row}, \param{int}{ col}}
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}
\constfunc{wxGridCell ***}{GetCells}{\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}
\constfunc{const wxFont\&}{GetCellTextFont}{\param{int}{ row}, \param{int}{ col}}
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}
\constfunc{wxString\&}{GetCellValue}{\param{int}{ row}, \param{int}{ col}}
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}
\constfunc{wxScrollBar *}{GetHorizScrollBar}{\void}
\membersection{wxGrid::GetTextItem}\label{wxgridgettextitem}
-\constfunc{wxText *}{GetTextItem}{\void}
+\constfunc{wxTextCtrl *}{GetTextItem}{\void}
Returns a pointer to the text item used for entering text into a cell.
\func{void}{OnChangeSelectionLabel}{\void}
Called when a cell is selected, to allow the application an
-opportunity to update the selection label (the label of the wxText item
+opportunity to update the selection label (the label of the wxTextCtrl
used for entering cell text). By default, the cell column letter and row
number are concatenated to form the selection label.
\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{const wxFont\&}{ font}, \param{int}{ row}, \param{int}{ col}}
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}}
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}}
might alter size characteristics. You may also need to follow it with
a call to AdjustScrollbars.
-