grid.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,963 行 · 第 1/5 页

TEX
1,963
字号
\membersection{wxGrid::IsSelection}\label{wxgridisselection}

\func{bool}{IsSelection}{\void}

Returns true if there are currently rows, columns or blocks of cells selected.



\membersection{wxGrid::IsVisible}\label{wxgridisvisible}

\func{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}

\func{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}

Returns true if a cell is either wholly visible (the default) or at least partially
visible in the grid window.



\membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}

\func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}

\func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}

Brings the specified cell into the visible grid cell area with minimal scrolling. Does
nothing if the cell is already visible.



\membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}

\func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}

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.

\wxheading{Keyboard}\\
This function is called for Down cursor key presses or Shift+Down to expand a selection.



\membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}

\func{bool}{MoveCursorLeft}{\param{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.

\wxheading{Keyboard}\\
This function is called for Left cursor key presses or Shift+Left to expand a selection.



\membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}

\func{bool}{MoveCursorRight}{\param{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.

\wxheading{Keyboard}\\
This function is called for Right cursor key presses or Shift+Right to expand a selection.



\membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}

\func{bool}{MoveCursorUp}{\param{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.

\wxheading{Keyboard}\\
This function is called for Up cursor key presses or Shift+Up to expand a selection.



\membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}

\func{bool}{MoveCursorDownBlock}{\param{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.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.



\membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}

\func{bool}{MoveCursorLeftBlock}{\param{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.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.



\membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}

\func{bool}{MoveCursorRightBlock}{\param{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.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.



\membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}

\func{bool}{MoveCursorUpBlock}{\param{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.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.



\membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}

\func{bool}{MovePageDown}{\void}

Moves the grid cursor down by some number of rows so that the previous bottom visible row
becomes the top visible row.

\wxheading{Keyboard}\\
This function is called for PgDn keypresses.



\membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}

\func{bool}{MovePageUp}{\void}

Moves the grid cursor up by some number of rows so that the previous top visible row
becomes the bottom visible row.

\wxheading{Keyboard}\\
This function is called for PgUp keypresses.



\membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}

\func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}

Methods for a registry for mapping data types to Renderers/Editors



\membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}

\func{void}{SaveEditControlValue}{\void}

Sets the value of the current grid cell to the current in-place edit control value.
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.



\membersection{wxGrid::SelectAll}\label{wxgridselectall}

\func{void}{SelectAll}{\void}

Selects all cells in the grid.



\membersection{wxGrid::SelectBlock}\label{wxgridselectblock}

\func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
\param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}

\func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
\param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}

Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
deselected; if true the column will be added to the existing selection.



\membersection{wxGrid::SelectCol}\label{wxgridselectcol}

\func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}

Selects the specified column. If addToSelected is false then any existing selection will be
deselected; if true the column will be added to the existing selection.



\membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}

\func{wxRect}{SelectionToDeviceRect}{\void}

This function returns the rectangle that encloses the selected cells
in device coords and clipped to the client size of the grid window.



\membersection{wxGrid::SelectRow}\label{wxgridselectrow}

\func{void}{SelectRow}{\param{int }{row}, \param{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.



\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}

\func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}

\func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}

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. \\
Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.



\membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}

\func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}



\membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}

\func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}

Sets the editor for the grid cell at the specified location.
The grid will take ownership of the pointer.

See \helpref{wxGridCellEditor}{wxgridcelleditor} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}

\func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}

Sets the font for text in the grid cell at the specified location.



\membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}

\func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}

Sets the renderer for the grid cell at the specified location.
The grid will take ownership of the pointer.

See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}

\func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}

\func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}

\func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}

Sets the text colour for the grid cell at the specified location.



\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}

\func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}

\func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}

\func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}

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 \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} 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 \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
and the \helpref{wxGrid overview}{gridoverview} for more information.



\membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}

\func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}

Sets the cell attributes for all cells in the specified column.

For more information about controlling grid cell attributes see the
\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
\helpref{wxGrid classes overview}{gridoverview}.



\membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}

\func{void}{SetColFormatBool}{\param{int }{col}}

Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.



\membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}

\func{void}{SetColFormatNumber}{\param{int }{col}}

Sets the specified column to display integer values.



\membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}

\func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}

Sets the specified column to display floating point values with the given width and precision.



\membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}

\func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}

Sets the specified column to display data in a custom format.
See the \helpref{wxGrid overview}{gridoverview} for more information on working
with custom data types.



\membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}

\func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}

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.



\membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}

\func{void}{SetColLabelSize}{\param{int }{height}}

Sets the height of the column labels.



\membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}

\func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}

Set the value for the given column label. If you are using a derived grid table you must
override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
for this to have any effect.



\membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}

\func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}

Sets the minimal width for the specified column. This should normally be called when creating the grid
because it will not resize a column that is already narrower than the minimal width.
The width argument must be higher than the minimimal acceptable column width, see
\helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?