************ wx.grid.Grid ************ Inheritance diagram for `wx.grid.Grid`: | .. inheritance-diagram:: wx.grid.Grid | Description =========== `wx.grid.Grid` 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 help you get started, `wx.grid.Grid` is the only class you need to refer 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. `wx.grid.Grid` has been greatly expanded and redesigned for wxPython 2.2 onwards. A `wx.grid.GridTableBase `_ class holds the actual data to be displayed by a `wx.grid.Grid` class. One or more `wx.grid.Grid` classes may act as a view for one table class. The default table class is called `wx.grid.GridStringTable` and holds an array of strings. An instance of such a class is created by `CreateGrid <#CreateGrid>`_. `wx.grid.GridCellRenderer `_ is the abstract base class for rendereing contents in a cell. The following renderers are predefined: * `wx.grid.GridCellStringRenderer `_ * `wx.grid.GridCellBoolRenderer `_ * `wx.grid.GridCellFloatRenderer `_ * `wx.grid.GridCellNumberRenderer `_ The look of a cell can be further defined using `wx.grid.GridCellAttr `_. An object of this type may be returned by `wx.grid.GridTableBase.GetAttr `_. `wx.grid.GridCellEditor `_ is the abstract base class for editing the value of a cell. The following editors are predefined: * `wx.grid.GridCellTextEditor `_ * `wx.grid.GridCellBoolEditor `_ * `wx.grid.GridCellChoiceEditor `_ * `wx.grid.GridCellNumberEditor `_ Derived From ^^^^^^^^^^^^^ * `wx.ScrolledWindow <../Widgets/wx.ScrolledWindow.html>`_ * `wx.Window <../Widgets/wx.Window.html>`_ * `wx.EvtHandler <../Widgets/wx.EvtHandler.html>`_ * `wx.Object <../Widgets/wx.Object.html>`_ Event Handling ^^^^^^^^^^^^^^ The event handler for the following functions takes a `wx.grid.GridEvent <../Events/wx.grid.GridEvent.html>`_ parameter. The ``..._CMD_...`` variants also take a window identifier. ================================================== ================================================== Event Name Description ================================================== ================================================== wx.grid.EVT_GRID_CELL_LEFT_CLICK(func) The user clicked a cell with the left mouse button. Processes a ``wx.grid.wxEVT_GRID_CELL_LEFT_CLICK``. wx.grid.EVT_GRID_CELL_RIGHT_CLICK(func) The user clicked a cell with the right mouse button. Processes a ``wx.grid.wxEVT_GRID_CELL_RIGHT_CLICK``. wx.grid.EVT_GRID_CELL_LEFT_DCLICK(func) The user double-clicked a cell with the left mouse button. Processes a ``wx.grid.wxEVT_GRID_CELL_LEFT_DCLICK``. wx.grid.EVT_GRID_CELL_RIGHT_DCLICK(func) The user double-clicked a cell with the right mouse button. Processes a ``wx.grid.wxEVT_GRID_CELL_RIGHT_DCLICK``. wx.grid.EVT_GRID_LABEL_LEFT_CLICK(func) The user clicked a label with the left mouse button. Processes a ``wx.grid.wxEVT_GRID_LABEL_LEFT_CLICK``. wx.grid.EVT_GRID_LABEL_RIGHT_CLICK(func) The user clicked a label with the right mouse button. Processes a ``wx.grid.wxEVT_GRID_LABEL_RIGHT_CLICK``. wx.grid.EVT_GRID_LABEL_LEFT_DCLICK(func) The user double-clicked a label with the left mouse button. Processes a ``wx.grid.wxEVT_GRID_LABEL_LEFT_DCLICK``. wx.grid.EVT_GRID_LABEL_RIGHT_DCLICK(func) The user double-clicked a label with the right mouse button. Processes a ``wx.grid.wxEVT_GRID_LABEL_RIGHT_DCLICK``. wx.grid.EVT_GRID_CELL_CHANGE(func) The user changed the data in a cell. Processes a ``wx.grid.wxEVT_GRID_CELL_CHANGE``. wx.grid.EVT_GRID_SELECT_CELL(func) The user moved to, and selected a cell. Processes a ``wx.grid.wxEVT_GRID_SELECT_CELL``. wx.grid.EVT_GRID_EDITOR_HIDDEN(func) The editor for a cell was hidden. Processes a ``wx.grid.wxEVT_GRID_EDITOR_HIDDEN``. wx.grid.EVT_GRID_EDITOR_SHOWN(func) The editor for a cell was shown. Processes a ``wx.grid.wxEVT_GRID_EDITOR_SHOWN``. wx.grid.EVT_GRID_CMD_CELL_LEFT_CLICK(id, func) The user clicked a cell with the left mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_CELL_LEFT_CLICK``. wx.grid.EVT_GRID_CMD_CELL_RIGHT_CLICK(id, func) The user clicked a cell with the right mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_CELL_RIGHT_CLICK``. wx.grid.EVT_GRID_CMD_CELL_LEFT_DCLICK(id, func) The user double-clicked a cell with the left mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_CELL_LEFT_DCLICK``. wx.grid.EVT_GRID_CMD_CELL_RIGHT_DCLICK(id, func) The user double-clicked a cell with the right mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_CELL_RIGHT_DCLICK``. wx.grid.EVT_GRID_CMD_LABEL_LEFT_CLICK(id, func) The user clicked a label with the left mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_LABEL_LEFT_CLICK``. wx.grid.EVT_GRID_CMD_LABEL_RIGHT_CLICK(id, func) The user clicked a label with the right mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_LABEL_RIGHT_CLICK``. wx.grid.EVT_GRID_CMD_LABEL_LEFT_DCLICK(id, func) The user double-clicked a label with the left mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_LABEL_LEFT_DCLICK``. wx.grid.EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id, func) The user double-clicked a label with the right mouse button; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_LABEL_RIGHT_DCLICK``. wx.grid.EVT_GRID_CMD_CELL_CHANGE(id, func) The user changed the data in a cell; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_CELL_CHANGE``. wx.grid.EVT_GRID_CMD_SELECT_CELL(id, func) The user moved to, and selected a cell; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_SELECT_CELL``. wx.grid.EVT_GRID_CMD_EDITOR_HIDDEN(id, func) The editor for a cell was hidden; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_EDITOR_HIDDEN``. wx.grid.EVT_GRID_CMD_EDITOR_SHOWN(id, func) The editor for a cell was shown; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_EDITOR_SHOWN``. ================================================== ================================================== | | The event handler for the following functions takes a `wx.grid.GridSizeEvent <../Events/wx.grid.GridSizeEvent.html>`_ parameter. The ``..._CMD_...`` variants also take a window identifier. ================================================== ================================================== Event Name Description ================================================== ================================================== wx.grid.EVT_GRID_COL_SIZE(func) The user resized a column by dragging it. Processes a ``wx.grid.wxEVT_GRID_COL_SIZE``. wx.grid.EVT_GRID_ROW_SIZE(func) The user resized a row by dragging it. Processes a ``wx.grid.wxEVT_GRID_ROW_SIZE``. wx.grid.EVT_GRID_CMD_COL_SIZE(func) The user resized a column by dragging it; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_COL_SIZE``. wx.grid.EVT_GRID_CMD_ROW_SIZE(func) The user resized a row by dragging it; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_ROW_SIZE``. ================================================== ================================================== | | The event handler for the following functions takes a `wx.grid.GridRangeSelectEvent <../Events/wx.grid.GridRangeSelectEvent.html>`_ parameter. The ``..._CMD_...`` variants also take a window identifier. ================================================== ================================================== Event Name Description ================================================== ================================================== wx.grid.EVT_GRID_RANGE_SELECT(func) The user selected a group of contiguous cells. Processes a ``wx.grid.wxEVT_GRID_RANGE_SELECT``. wx.grid.EVT_GRID_CMD_RANGE_SELECT(id, func) The user selected a group of contiguous cells; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_RANGE_SELECT``. ================================================== ================================================== | | The event handler for the following functions takes a `wx.grid.GridEditorCreatedEvent <../Events/wx.grid.GridEditorCreatedEvent.html>`_ parameter. The ``..._CMD_...`` variants also take a window identifier. ================================================== ================================================== Event Name Description ================================================== ================================================== wx.grid.EVT_GRID_EDITOR_CREATED(func) The editor for a cell was created. Processes a ``wx.grid.wxEVT_GRID_EDITOR_CREATED``. wx.grid.EVT_GRID_CMD_EDITOR_CREATED(id, func) The editor for a cell was created; variant taking a window identifier. Processes a ``wx.grid.wxEVT_GRID_EDITOR_CREATED``. ================================================== ================================================== | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `AppendCols <#AppendCols>`_ * `AppendRows <#AppendRows>`_ * `AutoSize <#AutoSize>`_ * `AutoSizeColLabelSize <#AutoSizeColLabelSize>`_ * `AutoSizeColumn <#AutoSizeColumn>`_ * `AutoSizeColumns <#AutoSizeColumns>`_ * `AutoSizeRow <#AutoSizeRow>`_ * `AutoSizeRowLabelSize <#AutoSizeRowLabelSize>`_ * `AutoSizeRows <#AutoSizeRows>`_ * `BeginBatch <#BeginBatch>`_ * `BlockToDeviceRect <#BlockToDeviceRect>`_ * `CanDragCell <#CanDragCell>`_ * `CanDragColMove <#CanDragColMove>`_ * `CanDragColSize <#CanDragColSize>`_ * `CanDragGridSize <#CanDragGridSize>`_ * `CanDragRowSize <#CanDragRowSize>`_ * `CanEnableCellControl <#CanEnableCellControl>`_ * `CellToRect <#CellToRect>`_ * `ClearGrid <#ClearGrid>`_ * `ClearSelection <#ClearSelection>`_ * `CreateGrid <#CreateGrid>`_ * `DeleteCols <#DeleteCols>`_ * `DeleteRows <#DeleteRows>`_ * `DeselectCell <#DeselectCell>`_ * `DeselectCol <#DeselectCol>`_ * `DeselectRow <#DeselectRow>`_ * `DisableCellEditControl <#DisableCellEditControl>`_ * `DisableDragCell <#DisableDragCell>`_ * `DisableDragColMove <#DisableDragColMove>`_ * `DisableDragColSize <#DisableDragColSize>`_ * `DisableDragGridSize <#DisableDragGridSize>`_ * `DisableDragRowSize <#DisableDragRowSize>`_ * `DrawCellHighlight <#DrawCellHighlight>`_ * `DrawTextRectangle <#DrawTextRectangle>`_ * `EnableCellEditControl <#EnableCellEditControl>`_ * `EnableDragCell <#EnableDragCell>`_ * `EnableDragColMove <#EnableDragColMove>`_ * `EnableDragColSize <#EnableDragColSize>`_ * `EnableDragGridSize <#EnableDragGridSize>`_ * `EnableDragRowSize <#EnableDragRowSize>`_ * `EnableEditing <#EnableEditing>`_ * `EnableGridLines <#EnableGridLines>`_ * `EndBatch <#EndBatch>`_ * `Fit <#Fit>`_ * `ForceRefresh <#ForceRefresh>`_ * `GetBatchCount <#GetBatchCount>`_ * `GetCellAlignment <#GetCellAlignment>`_ * `GetCellBackgroundColour <#GetCellBackgroundColour>`_ * `GetCellEditor <#GetCellEditor>`_ * `GetCellFont <#GetCellFont>`_ * `GetCellHighlightColour <#GetCellHighlightColour>`_ * `GetCellHighlightPenWidth <#GetCellHighlightPenWidth>`_ * `GetCellHighlightROPenWidth <#GetCellHighlightROPenWidth>`_ * `GetCellOverflow <#GetCellOverflow>`_ * `GetCellRenderer <#GetCellRenderer>`_ * `GetCellSize <#GetCellSize>`_ * `GetCellTextColour <#GetCellTextColour>`_ * `GetCellValue <#GetCellValue>`_ * `GetColAt <#GetColAt>`_ * `GetColGridLinePen <#GetColGridLinePen>`_ * `GetColLabelAlignment <#GetColLabelAlignment>`_ * `GetColLabelSize <#GetColLabelSize>`_ * `GetColLabelTextOrientation <#GetColLabelTextOrientation>`_ * `GetColLabelValue <#GetColLabelValue>`_ * `GetColMinimalAcceptableWidth <#GetColMinimalAcceptableWidth>`_ * `GetColPos <#GetColPos>`_ * `GetColSize <#GetColSize>`_ * `GetDefaultCellAlignment <#GetDefaultCellAlignment>`_ * `GetDefaultCellBackgroundColour <#GetDefaultCellBackgroundColour>`_ * `GetDefaultCellFont <#GetDefaultCellFont>`_ * `GetDefaultCellOverflow <#GetDefaultCellOverflow>`_ * `GetDefaultCellTextColour <#GetDefaultCellTextColour>`_ * `GetDefaultColLabelSize <#GetDefaultColLabelSize>`_ * `GetDefaultColSize <#GetDefaultColSize>`_ * `GetDefaultEditor <#GetDefaultEditor>`_ * `GetDefaultEditorForCell <#GetDefaultEditorForCell>`_ * `GetDefaultEditorForType <#GetDefaultEditorForType>`_ * `GetDefaultGridLinePen <#GetDefaultGridLinePen>`_ * `GetDefaultRenderer <#GetDefaultRenderer>`_ * `GetDefaultRendererForCell <#GetDefaultRendererForCell>`_ * `GetDefaultRendererForType <#GetDefaultRendererForType>`_ * `GetDefaultRowLabelSize <#GetDefaultRowLabelSize>`_ * `GetDefaultRowSize <#GetDefaultRowSize>`_ * `GetGridColLabelWindow <#GetGridColLabelWindow>`_ * `GetGridCornerLabelWindow <#GetGridCornerLabelWindow>`_ * `GetGridCursorCol <#GetGridCursorCol>`_ * `GetGridCursorRow <#GetGridCursorRow>`_ * `GetGridLineColour <#GetGridLineColour>`_ * `GetGridRowLabelWindow <#GetGridRowLabelWindow>`_ * `GetGridWindow <#GetGridWindow>`_ * `GetLabelBackgroundColour <#GetLabelBackgroundColour>`_ * `GetLabelFont <#GetLabelFont>`_ * `GetLabelTextColour <#GetLabelTextColour>`_ * `GetNumberCols <#GetNumberCols>`_ * `GetNumberRows <#GetNumberRows>`_ * `GetOrCreateCellAttr <#GetOrCreateCellAttr>`_ * `GetRowGridLinePen <#GetRowGridLinePen>`_ * `GetRowLabelAlignment <#GetRowLabelAlignment>`_ * `GetRowLabelSize <#GetRowLabelSize>`_ * `GetRowLabelValue <#GetRowLabelValue>`_ * `GetRowMinimalAcceptableHeight <#GetRowMinimalAcceptableHeight>`_ * `GetRowSize <#GetRowSize>`_ * `GetScrollLineX <#GetScrollLineX>`_ * `GetScrollLineY <#GetScrollLineY>`_ * `GetScrollX <#GetScrollX>`_ * `GetScrollY <#GetScrollY>`_ * `GetSelectedCells <#GetSelectedCells>`_ * `GetSelectedCols <#GetSelectedCols>`_ * `GetSelectedRows <#GetSelectedRows>`_ * `GetSelectionBackground <#GetSelectionBackground>`_ * `GetSelectionBlockBottomRight <#GetSelectionBlockBottomRight>`_ * `GetSelectionBlockTopLeft <#GetSelectionBlockTopLeft>`_ * `GetSelectionForeground <#GetSelectionForeground>`_ * `GetSelectionMode <#GetSelectionMode>`_ * `GetTable <#GetTable>`_ * `GetTextBoxSize <#GetTextBoxSize>`_ * `GridLinesEnabled <#GridLinesEnabled>`_ * `HideCellEditControl <#HideCellEditControl>`_ * `InsertCols <#InsertCols>`_ * `InsertRows <#InsertRows>`_ * `IsCellEditControlEnabled <#IsCellEditControlEnabled>`_ * `IsCellEditControlShown <#IsCellEditControlShown>`_ * `IsCurrentCellReadOnly <#IsCurrentCellReadOnly>`_ * `IsEditable <#IsEditable>`_ * `IsInSelection <#IsInSelection>`_ * `IsReadOnly <#IsReadOnly>`_ * `IsSelection <#IsSelection>`_ * `IsVisible <#IsVisible>`_ * `MakeCellVisible <#MakeCellVisible>`_ * `MoveCursorDown <#MoveCursorDown>`_ * `MoveCursorDownBlock <#MoveCursorDownBlock>`_ * `MoveCursorLeft <#MoveCursorLeft>`_ * `MoveCursorLeftBlock <#MoveCursorLeftBlock>`_ * `MoveCursorRight <#MoveCursorRight>`_ * `MoveCursorRightBlock <#MoveCursorRightBlock>`_ * `MoveCursorUp <#MoveCursorUp>`_ * `MoveCursorUpBlock <#MoveCursorUpBlock>`_ * `MovePageDown <#MovePageDown>`_ * `MovePageUp <#MovePageUp>`_ * `ProcessTableMessage <#ProcessTableMessage>`_ * `RegisterDataType <#RegisterDataType>`_ * `SaveEditControlValue <#SaveEditControlValue>`_ * `SelectAll <#SelectAll>`_ * `SelectBlock <#SelectBlock>`_ * `SelectCol <#SelectCol>`_ * `SelectRow <#SelectRow>`_ * `SetAttr <#SetAttr>`_ * `SetCellAlignment <#SetCellAlignment>`_ * `SetCellBackgroundColour <#SetCellBackgroundColour>`_ * `SetCellEditor <#SetCellEditor>`_ * `SetCellFont <#SetCellFont>`_ * `SetCellHighlightColour <#SetCellHighlightColour>`_ * `SetCellHighlightPenWidth <#SetCellHighlightPenWidth>`_ * `SetCellHighlightROPenWidth <#SetCellHighlightROPenWidth>`_ * `SetCellOverflow <#SetCellOverflow>`_ * `SetCellRenderer <#SetCellRenderer>`_ * `SetCellSize <#SetCellSize>`_ * `SetCellTextColour <#SetCellTextColour>`_ * `SetCellValue <#SetCellValue>`_ * `SetColAttr <#SetColAttr>`_ * `SetColFormatBool <#SetColFormatBool>`_ * `SetColFormatCustom <#SetColFormatCustom>`_ * `SetColFormatFloat <#SetColFormatFloat>`_ * `SetColFormatNumber <#SetColFormatNumber>`_ * `SetColLabelAlignment <#SetColLabelAlignment>`_ * `SetColLabelSize <#SetColLabelSize>`_ * `SetColLabelTextOrientation <#SetColLabelTextOrientation>`_ * `SetColLabelValue <#SetColLabelValue>`_ * `SetColMinimalAcceptableWidth <#SetColMinimalAcceptableWidth>`_ * `SetColMinimalWidth <#SetColMinimalWidth>`_ * `SetColPos <#SetColPos>`_ * `SetColSize <#SetColSize>`_ * `SetDefaultCellAlignment <#SetDefaultCellAlignment>`_ * `SetDefaultCellBackgroundColour <#SetDefaultCellBackgroundColour>`_ * `SetDefaultCellFont <#SetDefaultCellFont>`_ * `SetDefaultCellOverflow <#SetDefaultCellOverflow>`_ * `SetDefaultCellTextColour <#SetDefaultCellTextColour>`_ * `SetDefaultColSize <#SetDefaultColSize>`_ * `SetDefaultEditor <#SetDefaultEditor>`_ * `SetDefaultRenderer <#SetDefaultRenderer>`_ * `SetDefaultRowSize <#SetDefaultRowSize>`_ * `SetGridCursor <#SetGridCursor>`_ * `SetGridLineColour <#SetGridLineColour>`_ * `SetLabelBackgroundColour <#SetLabelBackgroundColour>`_ * `SetLabelFont <#SetLabelFont>`_ * `SetLabelTextColour <#SetLabelTextColour>`_ * `SetMargins <#SetMargins>`_ * `SetReadOnly <#SetReadOnly>`_ * `SetRowAttr <#SetRowAttr>`_ * `SetRowLabelAlignment <#SetRowLabelAlignment>`_ * `SetRowLabelSize <#SetRowLabelSize>`_ * `SetRowLabelValue <#SetRowLabelValue>`_ * `SetRowMinimalAcceptableHeight <#SetRowMinimalAcceptableHeight>`_ * `SetRowMinimalHeight <#SetRowMinimalHeight>`_ * `SetRowSize <#SetRowSize>`_ * `SetScrollLineX <#SetScrollLineX>`_ * `SetScrollLineY <#SetScrollLineY>`_ * `SetSelectionBackground <#SetSelectionBackground>`_ * `SetSelectionForeground <#SetSelectionForeground>`_ * `SetSelectionMode <#SetSelectionMode>`_ * `SetTable <#SetTable>`_ * `ShowCellEditControl <#ShowCellEditControl>`_ * `XToCol <#XToCol>`_ * `XToEdgeOfCol <#XToEdgeOfCol>`_ * `XYToCell <#XYToCell>`_ * `YToEdgeOfRow <#YToEdgeOfRow>`_ * `YToRow <#YToRow>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `BatchCount <#BatchCount>`_ * `CellHighlightColour <#CellHighlightColour>`_ * `CellHighlightPenWidth <#CellHighlightPenWidth>`_ * `CellHighlightROPenWidth <#CellHighlightROPenWidth>`_ * `CellSize <#CellSize>`_ * `ColLabelAlignment <#ColLabelAlignment>`_ * `ColLabelSize <#ColLabelSize>`_ * `ColLabelTextOrientation <#ColLabelTextOrientation>`_ * `ColMinimalAcceptableWidth <#ColMinimalAcceptableWidth>`_ * `DefaultCellAlignment <#DefaultCellAlignment>`_ * `DefaultCellBackgroundColour <#DefaultCellBackgroundColour>`_ * `DefaultCellFont <#DefaultCellFont>`_ * `DefaultCellOverflow <#DefaultCellOverflow>`_ * `DefaultCellTextColour <#DefaultCellTextColour>`_ * `DefaultColLabelSize <#DefaultColLabelSize>`_ * `DefaultColSize <#DefaultColSize>`_ * `DefaultEditor <#DefaultEditor>`_ * `DefaultGridLinePen <#DefaultGridLinePen>`_ * `DefaultRenderer <#DefaultRenderer>`_ * `DefaultRowLabelSize <#DefaultRowLabelSize>`_ * `DefaultRowSize <#DefaultRowSize>`_ * `GridColLabelWindow <#GridColLabelWindow>`_ * `GridCornerLabelWindow <#GridCornerLabelWindow>`_ * `GridCursorCol <#GridCursorCol>`_ * `GridCursorRow <#GridCursorRow>`_ * `GridLineColour <#GridLineColour>`_ * `GridRowLabelWindow <#GridRowLabelWindow>`_ * `GridWindow <#GridWindow>`_ * `LabelBackgroundColour <#LabelBackgroundColour>`_ * `LabelFont <#LabelFont>`_ * `LabelTextColour <#LabelTextColour>`_ * `NumberCols <#NumberCols>`_ * `NumberRows <#NumberRows>`_ * `RowLabelAlignment <#RowLabelAlignment>`_ * `RowLabelSize <#RowLabelSize>`_ * `RowMinimalAcceptableHeight <#RowMinimalAcceptableHeight>`_ * `ScrollLineX <#ScrollLineX>`_ * `ScrollLineY <#ScrollLineY>`_ * `SelectedCells <#SelectedCells>`_ * `SelectedCols <#SelectedCols>`_ * `SelectedRows <#SelectedRows>`_ * `SelectionBackground <#SelectionBackground>`_ * `SelectionBlockBottomRight <#SelectionBlockBottomRight>`_ * `SelectionBlockTopLeft <#SelectionBlockTopLeft>`_ * `SelectionForeground <#SelectionForeground>`_ * `SelectionMode <#SelectionMode>`_ * `Table <#Table>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.WANTS_CHARS, name=wx.PanelNameStr) Constructor to create a grid object. Call either `CreateGrid <#CreateGrid>`_ or `SetTable <#SetTable>`_ directly after this to initialize the grid before using it. **Parameters:** * `parent` (`wx.Window <../Widgets/wx.Window.html>`_): Parent window. Must not be ``None``. * `id` (int): Window identifier, may be -1. * `pos` (`wx.Point <../Widgets/wx.Point.html>`_): Window position. * `size` (`wx.Size <../Widgets/wx.Size.html>`_): Window size. * `style` (long): Window style. * `name` (string): Window name. | **Returns:** `wx.grid.Grid `_ -------- .. method:: AppendCols(numCols=1, updateLabels=True) 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 `wx.grid.GridTableBase.AppendCols `_. See `InsertCols <#InsertCols>`_ for further information. **Parameters:** * `numCols` (int) * `updateLabels` (bool) | **Returns:** `bool` -------- .. method:: AppendRows(numRows=1, updateLabels=True) Appends one or more new rows 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 `wx.grid.GridTableBase.AppendRows `_. See `InsertRows <#InsertRows>`_ for further information. **Parameters:** * `numRows` (int) * `updateLabels` (bool) | **Returns:** `bool` -------- .. method:: AutoSize() Automatically sets the height and width of all rows and columns to fit their contents. .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: AutoSizeColLabelSize(col) | **Parameters:** * `col` (int) -------- .. method:: AutoSizeColumn(col, setAsMin=True) Automatically sizes the column `col` to fit its contents. If `setAsMin` is ``True`` the calculated width will also be set as the minimal width for the column. **Parameters:** * `col` (int) * `setAsMin` (bool) .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: AutoSizeColumns(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. **Parameters:** * `setAsMin` (bool) .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: AutoSizeRow(row, setAsMin) Automatically sizes the row `row` to fit its contents. If `setAsMin` is ``True`` the calculated height will also be set as the minimal height for the row. **Parameters:** * `row` (int) * `setAsMin` (bool) .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: AutoSizeRowLabelSize(row) | **Parameters:** * `row` (int) -------- .. method:: AutoSizeRows(setAsMin=True) Automatically sizes all rows to fit their contents. If `setAsMin` is ``True`` the calculated heights will also be set as the minimal heights for the rows. **Parameters:** * `setAsMin` (bool) .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: BeginBatch() Increments the grid's batch count. When the count is greater than zero repainting of the grid is suppressed. Each call to `BeginBatch` must be matched by a later call to `EndBatch <#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. -------- .. method:: BlockToDeviceRect(topLeft, bottomRight) This function returns the rectangle that encloses the block of cells limited by `topLeft` and `bottomRight` cell in device coords and clipped to the client size of the grid window. **Parameters:** * `topLeft` (`wx.grid.GridCellCoords`) * `bottomRight` (`wx.grid.GridCellCoords`) | **Returns:** `wx.Rect <../Widgets/wx.Rect.html>`_ -------- .. method:: CanDragCell() `No docstrings available for this method.` -------- .. method:: CanDragColMove() Returns ``True`` if columns can be moved by dragging with the mouse. Columns can be moved by dragging on their labels. | **Returns:** `bool` -------- .. method:: CanDragColSize() Returns ``True`` if columns can be resized by dragging with the mouse. Columns can be resized by dragging the edges of their labels. If grid line dragging is enabled they can also be resized by dragging the right edge of the column in the grid cell area | **Returns:** `bool` .. seealso:: `EnableDragGridSize <#EnableDragGridSize>`_ -------- .. method:: CanDragGridSize() Return ``True`` if the dragging of grid lines to resize rows and columns is enabled or ``False`` otherwise. | **Returns:** `bool` -------- .. method:: CanDragRowSize() Returns ``True`` if rows can be resized by dragging with the mouse. Rows can be resized by dragging the edges of their labels. If grid line dragging is enabled they can also be resized by dragging the lower edge of the row in the grid cell area | **Returns:** `bool` .. seealso:: `EnableDragGridSize <#EnableDragGridSize>`_ -------- .. method:: CanEnableCellControl() 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). | **Returns:** `bool` -------- .. method:: CellToRect(row, col) Return the rectangle corresponding to the grid cell's size and position in logical coordinates. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.Rect <../Widgets/wx.Rect.html>`_ -------- .. method:: ClearGrid() Clears all data in the underlying grid table and repaints the grid. The table is not deleted by this function. If you are using a derived table class then you need to override `wx.grid.GridTableBase.Clear `_ for this function to have any effect. -------- .. method:: ClearSelection() Deselects all cells that are currently selected. -------- .. method:: CreateGrid(numRows, numCols, selmode=wx.grid.Grid.wxGridSelectCells) Creates a grid with the specified initial number of rows and columns. Call this directly after the grid constructor. When you use this function wx.Grid 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 <#SetTable>`_. **Parameters:** * `numRows` (int) * `numCols` (int) * `selmode` (int) | **Returns:** `bool` .. seealso:: `SetSelectionMode <#SetSelectionMode>`_ -------- .. method:: DeleteCols(pos=0, numCols=1, updateLabels=True) 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 `wx.grid.GridTableBase.DeleteCols `_. See `InsertCols <#InsertCols>`_ for further information. **Parameters:** * `pos` (int) * `numCols` (int) * `updateLabels` (bool) | **Returns:** `bool` -------- .. method:: DeleteRows(pos=0, numRows=1, 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 `wx.grid.GridTableBase.DeleteRows `_. See `InsertRows <#InsertRows>`_ for further information. **Parameters:** * `pos` (int) * `numRows` (int) * `updateLabels` (bool) | **Returns:** `bool` -------- .. method:: DeselectCell(row, col) | **Parameters:** * `row` (int) * `col` (int) -------- .. method:: DeselectCol(col) | **Parameters:** * `col` (int) -------- .. method:: DeselectRow(row) | **Parameters:** * `row` (int) -------- .. method:: DisableCellEditControl() Disables in-place editing of grid cells. Equivalent to calling `EnableCellEditControl <#EnableCellEditControl>`_ (``False``). -------- .. method:: DisableDragCell() `No docstrings available for this method.` -------- .. method:: DisableDragColMove() Disables column moving by dragging with the mouse. Equivalent to passing ``False`` to `EnableDragColMove <#EnableDragColMove>`_. -------- .. method:: DisableDragColSize() Disables column sizing by dragging with the mouse. Equivalent to passing ``False`` to `EnableDragColSize <#EnableDragColSize>`_. -------- .. method:: DisableDragGridSize() Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing ``False`` to `EnableDragGridSize <#EnableDragGridSize>`_ -------- .. method:: DisableDragRowSize() Disables row sizing by dragging with the mouse. Equivalent to passing ``False`` to `EnableDragRowSize <#EnableDragRowSize>`_. -------- .. method:: DrawCellHighlight(dc, attr) | **Parameters:** * `dc` (`wx.DC <../Widgets/wx.DC.html>`_) * `attr` (`wx.grid.GridCellAttr `_) -------- .. method:: DrawTextRectangle(dc, text, rect, horizontalAlignment=wx.LEFT, verticalAlignment=wx.TOP, textOrientation=wx.HORIZONTAL) | **Parameters:** * `dc` (`wx.DC <../Widgets/wx.DC.html>`_) * `text` (string) * `rect` (`wx.Rect <../Widgets/wx.Rect.html>`_) * `horizontalAlignment` (int) * `verticalAlignment` (int) * `textOrientation` (int) -------- .. method:: EnableCellEditControl(enable=True) Enables or disables in-place editing of grid cell data. The grid will issue either a ``wx.grid.EVT_GRID_EDITOR_SHOWN`` or ``wx.grid.EVT_GRID_EDITOR_HIDDEN`` event. **Parameters:** * `enable` (bool) -------- .. method:: EnableDragCell(enable=True) | **Parameters:** * `enable` (bool) -------- .. method:: EnableDragColMove(enable=True) Enables or disables column moving by dragging with the mouse. **Parameters:** * `enable` (bool) -------- .. method:: EnableDragColSize(enable=True) Enables or disables column sizing by dragging with the mouse. **Parameters:** * `enable` (bool) -------- .. method:: EnableDragGridSize(enable=True) Enables or disables row and column resizing by dragging gridlines with the mouse. **Parameters:** * `enable` (bool) -------- .. method:: EnableDragRowSize(enable=True) Enables or disables row sizing by dragging with the mouse. **Parameters:** * `enable` (bool) -------- .. method:: EnableEditing(edit) If the edit argument is ``False`` this function sets the whole grid as read-only. If the argument is ``True`` the grid is set to the default state where cells may be editable. In the default state you can set single grid cells and whole rows and columns to be editable or read-only via `wx.grid.GridCellAtt.SetReadOnly `_. For single cells you can also use the shortcut function `SetReadOnly <#SetReadOnly>`_. For more information about controlling grid cell attributes see the `wx.grid.GridCellAttr `_ cell attribute class. **Parameters:** * `edit` (bool) -------- .. method:: EnableGridLines(enable=True) Turns the drawing of grid lines on or off. **Parameters:** * `enable` (bool) -------- .. method:: EndBatch() Decrements the grid's batch count. When the count is greater than zero repainting of the grid is suppressed. Each previous call to `BeginBatch <#BeginBatch>`_ must be matched by a later call to `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. -------- .. method:: Fit() Overrides `wx.Window.Fit <../Widgets/wx.Window.html#Fit>`_ Reimplemented from `wx.Window <../Widgets/wx.Window.html>`_ -------- .. method:: ForceRefresh() Causes immediate repainting of the grid. Use this instead of the usual `wx.Window.Refresh <../Widgets/wx.Window.html#Refresh>`_. -------- .. method:: GetBatchCount() Returns the number of times that `BeginBatch <#BeginBatch>`_ has been called without (yet) matching calls to `EndBatch <#EndBatch>`_. While the grid's batch count is greater than zero the display will not be updated. | **Returns:** `int` -------- .. method:: GetCellAlignment(row, col) 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 ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment will be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `(horiz, vert)` -------- .. method:: GetCellBackgroundColour(row, col) Returns the background colour of the cell at the specified location. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetCellEditor(row, col) Returns a pointer to the editor for the cell at the specified location. See `wx.grid.GridCellEditor `_ for more information about cell editors and renderers. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellEditor `_ -------- .. method:: GetCellFont(row, col) Returns the font for text in the grid cell at the specified location. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.Font <../Widgets/wx.Font.html>`_ -------- .. method:: GetCellHighlightColour() `No docstrings available for this method.` -------- .. method:: GetCellHighlightPenWidth() `No docstrings available for this method.` -------- .. method:: GetCellHighlightROPenWidth() `No docstrings available for this method.` -------- .. method:: GetCellOverflow(row, col) | **Parameters:** * `row` (int) * `col` (int) | **Returns:** `bool` -------- .. method:: GetCellRenderer(row, col) Returns a pointer to the renderer for the grid cell at the specified location. See `wx.grid.GridCellRenderer `_ for more information about cell editors and renderers. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellRenderer `_ -------- .. method:: GetCellSize(row, col) | **Parameters:** * `row` (int) * `col` (int) | **Returns:** `(num_rows, num_cols)` -------- .. method:: GetCellTextColour(row, col) Returns the text colour for the grid cell at the specified location. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetCellValue(row, col) Returns the string contained in 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 `SetCellValue <#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 `wx.grid.GridTableBase.CanGetValueAs `_ for more information. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `string` -------- .. method:: GetColAt(colPos) Returns the column ID of the specified column position. **Parameters:** * `colPos` (int) | **Returns:** `int` -------- .. method:: GetColGridLinePen(col) 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 `col`. See `GetRowGridLinePen <#GetRowGridLinePen>`_ for an example. **Parameters:** * `col` (int) | **Returns:** `wx.Pen <../Widgets/wx.Pen.html>`_ -------- .. method:: GetColLabelAlignment() Sets the arguments to the current column label alignment values. Horizontal alignment will be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment will be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. | **Returns:** `(horiz, vert)` -------- .. method:: GetColLabelSize() Returns the current height of the column labels. | **Returns:** `int` -------- .. method:: GetColLabelTextOrientation() `No docstrings available for this method.` -------- .. method:: GetColLabelValue(col) Returns the specified column label. The default grid table class provides column labels of the form A, B, ..., Z, AA, AB, ..., ZZ, AAA... If you are using a custom grid table you can override `wx.grid.GridTableBase.GetColLabelValue `_ to provide your own labels. **Parameters:** * `col` (int) | **Returns:** `string` -------- .. method:: GetColMinimalAcceptableWidth() This returns the value of the lowest column width that can be handled correctly. | **Returns:** `int` .. seealso:: `SetColMinimalAcceptableWidth <#SetColMinimalAcceptableWidth>`_ -------- .. method:: GetColPos(colID) Returns the position of the specified column. **Parameters:** * `colID` (int) | **Returns:** `int` -------- .. method:: GetColSize(col) Returns the width of the specified column. **Parameters:** * `col` (int) | **Returns:** `int` -------- .. method:: GetDefaultCellAlignment() Sets the arguments to the current default horizontal and vertical text alignment values. Horizontal alignment will be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment will be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. | **Returns:** `(horiz, vert)` -------- .. method:: GetDefaultCellBackgroundColour() Returns the current default background colour for grid cells. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetDefaultCellFont() Returns the current default font for grid cell text. | **Returns:** `wx.Font <../Widgets/wx.Font.html>`_ -------- .. method:: GetDefaultCellOverflow() `No docstrings available for this method.` -------- .. method:: GetDefaultCellTextColour() Returns the current default colour for grid cell text. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetDefaultColLabelSize() Returns the default height for column labels. | **Returns:** `int` -------- .. method:: GetDefaultColSize() Returns the current default width for grid columns. | **Returns:** `int` -------- .. method:: GetDefaultEditor() Returns a pointer to the current default grid cell editor. See `wx.grid.GridCellEditor `_ for more information about cell editors and renderers. | **Returns:** `wx.grid.GridCellEditor `_ -------- .. method:: GetDefaultEditorForCell(row, col) | **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellEditor `_ -------- .. method:: GetDefaultEditorForType(typeName) | **Parameters:** * `typeName` (string) | **Returns:** `wx.grid.GridCellEditor `_ -------- .. method:: GetDefaultGridLinePen() 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. | **Returns:** `wx.Pen <../Widgets/wx.Pen.html>`_ .. note:: Note that currently the pen width must be 1. .. seealso:: `GetColGridLinePen <#GetColGridLinePen>`_, `GetRowGridLinePen <#GetRowGridLinePen>`_ -------- .. method:: GetDefaultRenderer() Returns a pointer to the current default grid cell renderer. See `wx.grid.GridCellEditor `_ for more information about cell editors and renderers. | **Returns:** `wx.grid.GridCellRenderer `_ -------- .. method:: GetDefaultRendererForCell(row, col) | **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellRenderer `_ -------- .. method:: GetDefaultRendererForType(typeName) **Parameters:** * `typeName` (string) | **Returns:** `wx.grid.GridCellRenderer `_ -------- .. method:: GetDefaultRowLabelSize() Returns the default width for the row labels. | **Returns:** `int` -------- .. method:: GetDefaultRowSize() Returns the current default height for grid rows. | **Returns:** `int` -------- .. method:: GetGridColLabelWindow() `No docstrings available for this method.` -------- .. method:: GetGridCornerLabelWindow() `No docstrings available for this method.` -------- .. method:: GetGridCursorCol() Returns the current grid cell column position. | **Returns:** `int` -------- .. method:: GetGridCursorRow() Returns the current grid cell row position. | **Returns:** `int` -------- .. method:: GetGridLineColour() Returns the colour used for grid lines. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ .. seealso:: `GetDefaultGridLinePen <#GetDefaultGridLinePen>`_ -------- .. method:: GetGridRowLabelWindow() `No docstrings available for this method.` -------- .. method:: GetGridWindow() `No docstrings available for this method.` -------- .. method:: GetLabelBackgroundColour() Returns the colour used for the background of row and column labels. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetLabelFont() Returns the font used for row and column labels. | **Returns:** `wx.Font <../Widgets/wx.Font.html>`_ -------- .. method:: GetLabelTextColour() Returns the colour used for row and column label text. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetNumberCols() Returns the total number of grid columns (actually the number of columns in the underlying grid table). | **Returns:** `int` -------- .. method:: GetNumberRows() Returns the total number of grid rows (actually the number of rows in the underlying grid table). | **Returns:** `int` -------- .. method:: GetOrCreateCellAttr(row, col) | **Parameters:** * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellAttr `_ -------- .. method:: GetRowGridLinePen(row) 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 `row`. Example:: # In a grid displaying music notation, use a solid black pen between # octaves (C0=row 127, C1=row 115 etc.) def GetRowGridLinePen(row): if row%12 == 7: return wx.Pen(wx.BLACK, 1, wx.SOLID) else: return self.GetDefaultGridLinePen() | **Parameters:** * `row` (int) | **Returns:** `wx.Pen <../Widgets/wx.Pen.html>`_ -------- .. method:: GetRowLabelAlignment() Sets the arguments to the current row label alignment values. Horizontal alignment will be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment will be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. | **Returns:** `(horiz, vert)` -------- .. method:: GetRowLabelSize() Returns the current width of the row labels. | **Returns:** `int` -------- .. method:: GetRowLabelValue(row) Returns the specified row label. The default grid table class provides numeric row labels. If you are using a custom grid table you can override `wx.grid.GridTableBase.GetRowLabelValue `_ to provide your own labels. **Parameters:** * `row` (int) | **Returns:** `string` -------- .. method:: GetRowMinimalAcceptableHeight() This returns the value of the lowest row width that can be handled correctly. | **Returns:** `int` .. seealso:: `SetRowMinimalAcceptableHeight <#SetRowMinimalAcceptableHeight>`_ -------- .. method:: GetRowSize(row) Returns the height of the specified row. **Parameters:** * `row` (int) | **Returns:** `int` -------- .. method:: GetScrollLineX() Returns the number of pixels per horizontal scroll increment. The default is 15. | **Returns:** `int` .. seealso:: `GetScrollLineY <#GetScrollLineY>`_, `SetScrollLineX <#SetScrollLineX>`_, `SetScrollLineY <#SetScrollLineY>`_ -------- .. method:: GetScrollLineY() Returns the number of pixels per vertical scroll increment. The default is 15. | **Returns:** `int` .. seealso:: `GetScrollLineX <#GetScrollLineX>`_, `SetScrollLineX <#SetScrollLineX>`_, `SetScrollLineY <#SetScrollLineY>`_ -------- .. method:: GetScrollX(x) | **Parameters:** * `x` (int) | **Returns:** `int` -------- .. method:: GetScrollY(y) | **Parameters:** * `y` (int) | **Returns:** `int` -------- .. method:: GetSelectedCells() Returns an array of singly selected cells. | **Returns:** `list of wx.grid.GridCellCoords` -------- .. method:: GetSelectedCols() Returns an array of selected columns. | **Returns:** `list of integers` -------- .. method:: GetSelectedRows() Returns an array of selected rows. | **Returns:** `list of integers` -------- .. method:: GetSelectionBackground() Access or update the selection fore/back colours. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetSelectionBlockBottomRight() Returns an array of the bottom right corners of blocks of selected cells. | **Returns:** `list of wx.grid.GridCellCoords` .. seealso:: `GetSelectionBlockTopLeft <#GetSelectionBlockTopLeft>`_ -------- .. method:: GetSelectionBlockTopLeft() Returns an array of the top left corners of blocks of selected cells. | **Returns:** `list of wx.grid.GridCellCoords` .. seealso:: `GetSelectionBlockBottomRight <#GetSelectionBlockBottomRight>`_ -------- .. method:: GetSelectionForeground() | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetSelectionMode() Returns the current selection mode. | **Returns:** `int` .. seealso:: `SetSelectionMode <#SetSelectionMode>`_ -------- .. method:: GetTable() Returns a base pointer to the current table object. | **Returns:** `wx.grid.GridTableBase `_ -------- .. method:: GetTextBoxSize(dc, lines) | **Parameters:** * `dc` (`wx.DC <../Widgets/wx.DC.html>`_) * `lines` (list) | **Returns:** `(width, height)` -------- .. method:: GridLinesEnabled() Returns ``True`` if drawing of grid lines is turned on, ``False`` otherwise. | **Returns:** `bool` -------- .. method:: HideCellEditControl() Hides the in-place cell edit control. -------- .. method:: InsertCols(pos=0, numCols=1, updateLabels=True) Inserts one or more new columns into a grid with the first new column 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 columns. If this is successful the table notifies the grid and the grid updates the display. For a default grid (one where you have called `CreateGrid <#CreateGrid>`_) this process is automatic. If you are using a custom grid table (specified with `SetTable <#SetTable>`_) then you must override `wx.grid.GridTableBase.InsertCols `_ in your derived table class. **Parameters:** * `pos` (int) * `numCols` (int) * `updateLabels` (bool) | **Returns:** `bool` -------- .. method:: InsertRows(pos=0, numRows=1, 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 the grid updates the display. For a default grid (one where you have called `CreateGrid <#CreateGrid>`_) this process is automatic. If you are using a custom grid table (specified with `SetTable <#SetTable>`_) then you must override `wx.grid.GridTableBase.InsertRows `_ in your derived table class. **Parameters:** * `pos` (int) * `numRows` (int) * `updateLabels` (bool) | **Returns:** `bool` -------- .. method:: IsCellEditControlEnabled() Returns ``True`` if the in-place edit control is currently enabled. | **Returns:** `bool` -------- .. method:: IsCellEditControlShown() `No docstrings available for this method.` -------- .. method:: IsCurrentCellReadOnly() Returns ``True`` if the current cell has been set to read-only. | **Returns:** `bool` .. seealso:: `SetReadOnly <#SetReadOnly>`_ -------- .. method:: IsEditable() Returns ``False`` if the whole grid has been set as read-only or ``True`` otherwise. See `EnableEditing <#EnableEditing>`_ for more information about controlling the editing status of grid cells. | **Returns:** `bool` -------- .. method:: IsInSelection(row, col) Is this cell currently selected? **Parameters:** * `row` (int) * `col` (int) | **Returns:** `bool` -------- .. method:: IsReadOnly(row, col) Returns ``True`` if the cell at the specified location can't be edited. **Parameters:** * `row` (int) * `col` (int) | **Returns:** `bool` .. seealso:: `IsReadOnly <#IsReadOnly>`_ -------- .. method:: IsSelection() Returns ``True`` if there are currently rows, columns or blocks of cells selected. | **Returns:** `bool` -------- .. method:: IsVisible(row, col, wholeCellVisible =True) Returns ``True`` if a cell is either wholly visible (the default) or at least partially visible in the grid window. **Parameters:** * `row` (int) * `col` (int) * `wholeCellVisible` (bool) | **Returns:** `bool` -------- .. method:: MakeCellVisible(row, col) Brings the specified cell into the visible grid cell area with minimal scrolling. Does nothing if the cell is already visible. **Parameters:** * `row` (int) * `col` (int) -------- .. method:: MoveCursorDown(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Down`` cursor key presses or ``Shift+Down`` to expand a selection. -------- .. method:: MoveCursorDownBlock(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Ctrl+Down`` cursor key presses or ``Shift+Ctrl+Down`` to expand a selection. -------- .. method:: MoveCursorLeft(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Left`` cursor key presses or ``Shift+Left`` to expand a selection. -------- .. method:: MoveCursorLeftBlock(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Ctrl+Left`` cursor key presses or ``Shift+Ctrl+Left`` to expand a selection. -------- .. method:: MoveCursorRight(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Right`` cursor key presses or ``Shift+Right`` to expand a selection. -------- .. method:: MoveCursorRightBlock(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Ctrl+Right`` cursor key presses or ``Shift+Ctrl+Right`` to expand a selection. -------- .. method:: MoveCursorUp(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Up`` cursor key presses or ``Shift+Up`` to expand a selection. -------- .. method:: MoveCursorUpBlock(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``. **Parameters:** * `expandSelection` (bool) | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``Ctrl+Up`` cursor key presses or ``Shift+Ctrl+Up`` to expand a selection. -------- .. method:: MovePageDown() Moves the grid cursor down by some number of rows so that the previous bottom visible row becomes the top visible row. | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``PgDn`` key presses. -------- .. method:: MovePageUp() Moves the grid cursor up by some number of rows so that the previous top visible row becomes the bottom visible row. | **Returns:** `bool` .. note:: Keyboard note: This function is called for ``PgUp`` key presses. -------- .. method:: ProcessTableMessage() `No docstrings available for this method.` -------- .. method:: RegisterDataType(typeName, renderer, editor) Methods for a registry for mapping data types to Renderers/Editors. **Parameters:** * `typeName` (string) * `renderer` (`wx.grid.GridCellRenderer `_) * `editor` (`wx.grid.GridCellEditor `_) -------- .. method:: SaveEditControlValue() 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. -------- .. method:: SelectAll() Selects all cells in the grid. -------- .. method:: SelectBlock(topRow, leftCol, bottomRow, rightCol, 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. **Parameters:** * `topRow` (int) * `leftCol` (int) * `bottomRow` (int) * `rightCol` (int) * `addToSelected` (bool) -------- .. method:: SelectCol(col, 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. **Parameters:** * `col` (int) * `addToSelected` (bool) -------- .. method:: SelectRow(row, 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. **Parameters:** * `row` (int) * `addToSelected` (bool) -------- .. method:: SetAttr(row, col, attr) | **Parameters:** * `row` (int) * `col` (int) * `attr` (`wx.grid.GridCellAttr `_) -------- .. method:: SetCellAlignment(row, col, horiz, vert) Sets the horizontal and vertical alignment for grid cell text at the specified location. Horizontal alignment (`horiz`) should be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment (`vert`) should be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. **Parameters:** * `row` (int) * `col` (int) * `horiz` (int) * `vert` (int) -------- .. method:: SetCellBackgroundColour(row, col, colour) Sets the cell background colour. **Parameters:** * `row` (int) * `col` (int) * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetCellEditor(row, col, editor) Sets the editor for the grid cell at the specified location. The grid will take ownership of the pointer. See `wx.grid.GridCellEditor `_ for more information about cell editors and renderers. **Parameters:** * `row` (int) * `col` (int) * `editor` (`wx.grid.GridCellEditor `_) -------- .. method:: SetCellFont(row, col, font) Sets the font for text in the grid cell at the specified location. **Parameters:** * `row` (int) * `col` (int) * `font` (`wx.Font <../Widgets/wx.Font.html>`_) -------- .. method:: SetCellHighlightColour(colour) | **Parameters:** * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetCellHighlightPenWidth(width) | **Parameters:** * `width` (int) -------- .. method:: SetCellHighlightROPenWidth(width) | **Parameters:** * `width` (int) -------- .. method:: SetCellOverflow(row, col, allow) | **Parameters:** * `row` (int) * `col` (int) * `allow` (bool) -------- .. method:: SetCellRenderer(row, col, renderer) Sets the renderer for the grid cell at the specified location. The grid will take ownership of the pointer. See `wx.grid.GridCellRenderer `_ for more information about cell editors and renderers. **Parameters:** * `row` (int) * `col` (int) * `renderer` (`wx.grid.GridCellRenderer `_) -------- .. method:: SetCellSize(row, col, num_rows, num_cols) | **Parameters:** * `row` (int) * `col` (int) * `num_rows` (int) * `num_cols` (int) -------- .. method:: SetCellTextColour(row, col, colour) Sets the text colour for the grid cell at the specified location. **Parameters:** * `row` (int) * `col` (int) * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetCellValue(row, col, s) 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 `GetCellValue <#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. See `wx.grid.GridTableBase.CanSetValueAs `_ for more information. **Parameters:** * `row` (int) * `col` (int) * `s` (string) -------- .. method:: SetColAttr(col, attr) Sets the cell attributes for all cells in the specified column. For more information about controlling grid cell attributes see the `wx.grid.GridCellAttr `_ cell attribute class. **Parameters:** * `col` (int) * `attr` (`wx.grid.GridCellAttr `_) -------- .. method:: SetColFormatBool(col) Sets the specified column to display boolean values. `wx.grid.Grid` displays boolean values with a checkbox. **Parameters:** * `col` (int) -------- .. method:: SetColFormatCustom(col, typeName) Sets the specified column to display data in a custom format. **Parameters:** * `col` (int) * `typeName` (string) -------- .. method:: SetColFormatFloat(col, width=-1, precision=-1) Sets the specified column to display floating point values with the given width and precision. **Parameters:** * `col` (int) * `width` (int) * `precision` (int) -------- .. method:: SetColFormatNumber(col) Sets the specified column to display integer values. **Parameters:** * `col` (int) -------- .. method:: SetColLabelAlignment(horiz, vert) Sets the horizontal and vertical alignment of column label text. Horizontal alignment (`horiz`) should be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment (`vert`) should be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. **Parameters:** * `horiz` (int) * `vert` (int) -------- .. method:: SetColLabelSize(height) Sets the height of the column labels. If `height` equals to ``wx.grid.GRID_AUTOSIZE`` then the height is calculated automatically so that no label is truncated. This flag is new since wxPython version 2.8.8. **Parameters:** * `height` (int) .. note:: Note that this could be slow for a large table. -------- .. method:: SetColLabelTextOrientation(textOrientation) | **Parameters:** * `textOrientation` (int) -------- .. method:: SetColLabelValue(col, value) Set the value for the given column label. If you are using a derived grid table you must override `wx.grid.GridTableBase.SetColLabelValue `_ for this to have any effect. **Parameters:** * `col` (int) * `value` (string) -------- .. method:: SetColMinimalAcceptableWidth(width) This modifies the minimum column width that can be handled correctly. Specifying a low value here allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller than the actual minimum size will incur a performance penalty in the functions which perform grid cell index lookup on the basis of screen coordinates. This should normally be called when creating the grid because it will not resize existing columns with sizes smaller than the value specified here. **Parameters:** * `width` (int) -------- .. method:: SetColMinimalWidth(col, 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. **Parameters:** * `col` (int) * `width` (int) .. seealso:: `GetColMinimalAcceptableWidth <#GetColMinimalAcceptableWidth>`_. -------- .. method:: SetColPos(colID, newPos) Sets the position of the specified column. **Parameters:** * `colID` (int) * `newPos` (int) -------- .. method:: SetColSize(col, width) Sets the width of the specified column. This function does not refresh the grid. If you are calling it outside of a `BeginBatch <#BeginBatch>`_ / `EndBatch <#EndBatch>`_ block you can use `ForceRefresh <#ForceRefresh>`_ to see the changes. **Parameters:** * `col` (int) * `width` (int) .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: SetDefaultCellAlignment(horiz, vert) Sets the default horizontal and vertical alignment for grid cell text. Horizontal alignment (`horiz`) should be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment (`vert`) should be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. **Parameters:** * `horiz` (int) * `vert` (int) -------- .. method:: SetDefaultCellBackgroundColour(colour) Sets the default background colour for grid cells. **Parameters:** * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetDefaultCellFont(font) Sets the default font to be used for grid cell text. **Parameters:** * `font` (`wx.Font <../Widgets/wx.Font.html>`_) -------- .. method:: SetDefaultCellOverflow(allow) | **Parameters:** * `allow` (bool) -------- .. method:: SetDefaultCellTextColour(colour) Sets the current default colour for grid cell text. **Parameters:** * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetDefaultColSize(width, resizeExistingCols=False) Sets the default width for columns in the grid. This will only affect columns subsequently added to the grid unless `resizeExistingCols` is ``True``. **Parameters:** * `width` (int) * `resizeExistingCols` (bool) -------- .. method:: SetDefaultEditor(editor) Sets the default editor for grid cells. The grid will take ownership of the pointer. See `wx.grid.GridCellEditor `_ for more information about cell editors and renderers. **Parameters:** * `editor` (`wx.grid.GridCellEditor `_) -------- .. method:: SetDefaultRenderer(renderer) Sets the default renderer for grid cells. The grid will take ownership of the pointer. See `wx.grid.GridCellRenderer `_ for more information about cell editors and renderers. **Parameters:** * `renderer` (`wx.grid.GridCellRenderer `_) -------- .. method:: SetDefaultRowSize(height, resizeExistingRows=False) Sets the default height for rows in the grid. This will only affect rows subsequently added to the grid unless `resizeExistingRows` is ``True``. **Parameters:** * `height` (int) * `resizeExistingRows` (bool) -------- .. method:: SetGridCursor(row, col) Set the grid cursor to the specified cell. This function calls `MakeCellVisible <#MakeCellVisible>`_. **Parameters:** * `row` (int) * `col` (int) -------- .. method:: SetGridLineColour(colour) Sets the colour used to draw grid lines. **Parameters:** * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetLabelBackgroundColour(colour) Sets the background colour for row and column labels. **Parameters:** * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetLabelFont(font) Sets the font for row and column labels. **Parameters:** * `font` (`wx.Font <../Widgets/wx.Font.html>`_) -------- .. method:: SetLabelTextColour(colour) Sets the colour for row and column label text. **Parameters:** * `colour` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetMargins(extraWidth, extraHeight) A grid may occupy more space than needed for its rows/columns. This function allows to set how big this extra space is. **Parameters:** * `extraWidth` (int) * `extraHeight` (int) -------- .. method:: SetReadOnly(row, col, isReadOnly=True) Makes the cell at the specified location read-only or editable. **Parameters:** * `row` (int) * `col` (int) * `isReadOnly` (bool) .. seealso:: `IsReadOnly <#IsReadOnly>`_ -------- .. method:: SetRowAttr(row, attr) Sets the cell attributes for all cells in the specified row. See the `wx.grid.GridCellAttr `_ class for more information about controlling cell attributes. **Parameters:** * `row` (int) * `attr` (`wx.grid.GridCellAttr `_) -------- .. method:: SetRowLabelAlignment(horiz, vert) Sets the horizontal and vertical alignment of row label text. Horizontal alignment (`horiz`) should be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. Vertical alignment (`vert`) should be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. **Parameters:** * `horiz` (int) * `vert` (int) -------- .. method:: SetRowLabelSize(width) Sets the width of the row labels. If `width` equals ``wx.grid.GRID_AUTOSIZE`` then the width is calculated automatically so that no label is truncated. This flag is new since wxPython version 2.8.8. **Parameters:** * `width` (int) .. note:: Note that this could be slow for a large table. -------- .. method:: SetRowLabelValue(row, value) Set the value for the given row label. If you are using a derived grid table you must override `wx.grid.GridTableBase.SetRowLabelValue `_ for this to have any effect. **Parameters:** * `row` (int) * `value` (string) -------- .. method:: SetRowMinimalAcceptableHeight(height) This modifies the minimum row width that can be handled correctly. Specifying a low value here allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller than the actual minimum size will incur a performance penalty in the functions which perform grid cell index lookup on the basis of screen coordinates. This should normally be called when creating the grid because it will not resize existing rows with sizes smaller than the value specified here. **Parameters:** * `height` (int) -------- .. method:: SetRowMinimalHeight(row, height) Sets the minimal height for the specified row. This should normally be called when creating the grid because it will not resize a row that is already shorter than the minimal height. The `height` argument must be higher than the minimimal acceptable row height. **Parameters:** * `row` (int) * `height` (int) .. seealso:: `GetRowMinimalAcceptableHeight <#GetRowMinimalAcceptableHeight>`_ -------- .. method:: SetRowSize(row, height) Sets the height of the specified row. This function does not refresh the grid. If you are calling it outside of a `BeginBatch <#BeginBatch>`_ / `EndBatch <#EndBatch>`_ block you can use `ForceRefresh <#ForceRefresh>`_ to see the changes. **Parameters:** * `col` (int) * `height` (int) .. note:: `wx.grid.Grid` sets up arrays to store individual row and column sizes when non-default sizes are used. The memory requirements for this could become prohibitive if your grid is very large. -------- .. method:: SetScrollLineX(x) Sets the number of pixels per horizontal scroll increment. The default is 15. Sometimes `wx.grid.Grid` has trouble setting the scrollbars correctly due to rounding errors: setting this to 1 can help. **Parameters:** * `x` (int) .. seealso:: `GetScrollLineX <#GetScrollLineX>`_, `GetScrollLineY <#GetScrollLineY>`_, `SetScrollLineY <#SetScrollLineY>`_ -------- .. method:: SetScrollLineY(y) Sets the number of pixels per vertical scroll increment. The default is 15. Sometimes `wx.grid.Grid` has trouble setting the scrollbars correctly due to rounding errors: setting this to 1 can help. **Parameters:** * `y` (int) .. seealso:: `GetScrollLineX <#GetScrollLineX>`_, `GetScrollLineY <#GetScrollLineY>`_, `SetScrollLineX <#SetScrollLineX>`_ -------- .. method:: SetSelectionBackground(c) | **Parameters:** * `c` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetSelectionForeground(c) | **Parameters:** * `c` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetSelectionMode(selmode) Set the selection behaviour of the grid. `selmode` may be one of the following values (all members of `wx.grid.Grid` class): ======================================== ======================================================= Selection Mode Description ======================================== ======================================================= ``wxGridSelectCells`` The default mode when individual cells are selected. ``wxGridSelectRows`` Selections will consist of whole rows. ``wxGridSelectCols`` Selections will consist of whole columns. ======================================== ======================================================= | **Parameters:** * `selmode` (int) -------- .. method:: SetTable(table, takeOwnership=False, selmode=wx.grid.Grid.wxGridSelectCells) Passes a pointer to a custom grid table to be used by the grid. This should be called after the grid constructor and before using the grid object. If `takeOwnership` is set to ``True`` then the table will be deleted by the `wx.grid.Grid` destructor. Use this function instead of `CreateGrid <#CreateGrid>`_ when your application involves complex or non-string data or data sets that are too large to fit wholly in memory. **Parameters:** * `table` (`wx.grid.GridTableBase `_) * `takeOwnership` (bool) * `selmode` (int) | **Returns:** `bool` .. seealso:: `SetSelectionMode <#SetSelectionMode>`_ -------- .. method:: ShowCellEditControl() Displays the in-place cell edit control for the current cell. -------- .. method:: XToCol(x, clipToMinMax=False) Returns the grid column that corresponds to the logical `x` coordinate. Returns ``wx.NOT_FOUND`` if there is no column at the `x` position. **Parameters:** * `x` (int): The x position to evaluate. * `clipToMinMax` (bool): If ``True``, rather than returning ``wx.NOT_FOUND``, it returns either the first or last column depending on whether `x` is too far to the left or right respectively. | **Returns:** `int` -------- .. method:: XToEdgeOfCol(x) Returns the column whose right hand edge is close to the given logical `x` position. If no column edge is near to this position ``wx.NOT_FOUND`` is returned. **Parameters:** * `x` (int) | **Returns:** `int` -------- .. method:: XYToCell(x, y) | **Parameters:** * `x` (int) * `y` (int) | **Returns:** `wx.grid.GridCellCoords` -------- .. method:: YToEdgeOfRow(y) Returns the row whose bottom edge is close to the given logical `y` position. If no row edge is near to this position ``wx.NOT_FOUND`` is returned. **Parameters:** * `y` (int) | **Returns:** `int` -------- .. method:: YToRow(y) Returns the grid row that corresponds to the logical `y` coordinate. Returns ``wx.NOT_FOUND`` if there is no row at the `y` position. **Parameters:** * `y` (int) | **Returns:** `int` -------- Properties ^^^^^^^^^^ .. attribute:: BatchCount See `GetBatchCount <#GetBatchCount>`_ .. attribute:: CellHighlightColour See `GetCellHighlightColour <#GetCellHighlightColour>`_ and `SetCellHighlightColour <#SetCellHighlightColour>`_ .. attribute:: CellHighlightPenWidth See `GetCellHighlightPenWidth <#GetCellHighlightPenWidth>`_ and `SetCellHighlightPenWidth <#SetCellHighlightPenWidth>`_ .. attribute:: CellHighlightROPenWidth See `GetCellHighlightROPenWidth <#GetCellHighlightROPenWidth>`_ and `SetCellHighlightROPenWidth <#SetCellHighlightROPenWidth>`_ .. attribute:: CellSize See `GetCellSize <#GetCellSize>`_ and `SetCellSize <#SetCellSize>`_ .. attribute:: ColLabelAlignment See `GetColLabelAlignment <#GetColLabelAlignment>`_ and `SetColLabelAlignment <#SetColLabelAlignment>`_ .. attribute:: ColLabelSize See `GetColLabelSize <#GetColLabelSize>`_ and `SetColLabelSize <#SetColLabelSize>`_ .. attribute:: ColLabelTextOrientation See `GetColLabelTextOrientation <#GetColLabelTextOrientation>`_ and `SetColLabelTextOrientation <#SetColLabelTextOrientation>`_ .. attribute:: ColMinimalAcceptableWidth See `GetColMinimalAcceptableWidth <#GetColMinimalAcceptableWidth>`_ and `SetColMinimalAcceptableWidth <#SetColMinimalAcceptableWidth>`_ .. attribute:: DefaultCellAlignment See `GetDefaultCellAlignment <#GetDefaultCellAlignment>`_ and `SetDefaultCellAlignment <#SetDefaultCellAlignment>`_ .. attribute:: DefaultCellBackgroundColour See `GetDefaultCellBackgroundColour <#GetDefaultCellBackgroundColour>`_ and `SetDefaultCellBackgroundColour <#SetDefaultCellBackgroundColour>`_ .. attribute:: DefaultCellFont See `GetDefaultCellFont <#GetDefaultCellFont>`_ and `SetDefaultCellFont <#SetDefaultCellFont>`_ .. attribute:: DefaultCellOverflow See `GetDefaultCellOverflow <#GetDefaultCellOverflow>`_ and `SetDefaultCellOverflow <#SetDefaultCellOverflow>`_ .. attribute:: DefaultCellTextColour See `GetDefaultCellTextColour <#GetDefaultCellTextColour>`_ and `SetDefaultCellTextColour <#SetDefaultCellTextColour>`_ .. attribute:: DefaultColLabelSize See `GetDefaultColLabelSize <#GetDefaultColLabelSize>`_ .. attribute:: DefaultColSize See `GetDefaultColSize <#GetDefaultColSize>`_ and `SetDefaultColSize <#SetDefaultColSize>`_ .. attribute:: DefaultEditor See `GetDefaultEditor <#GetDefaultEditor>`_ and `SetDefaultEditor <#SetDefaultEditor>`_ .. attribute:: DefaultGridLinePen See `GetDefaultGridLinePen <#GetDefaultGridLinePen>`_ .. attribute:: DefaultRenderer See `GetDefaultRenderer <#GetDefaultRenderer>`_ and `SetDefaultRenderer <#SetDefaultRenderer>`_ .. attribute:: DefaultRowLabelSize See `GetDefaultRowLabelSize <#GetDefaultRowLabelSize>`_ .. attribute:: DefaultRowSize See `GetDefaultRowSize <#GetDefaultRowSize>`_ and `SetDefaultRowSize <#SetDefaultRowSize>`_ .. attribute:: GridColLabelWindow See `GetGridColLabelWindow <#GetGridColLabelWindow>`_ .. attribute:: GridCornerLabelWindow See `GetGridCornerLabelWindow <#GetGridCornerLabelWindow>`_ .. attribute:: GridCursorCol See `GetGridCursorCol <#GetGridCursorCol>`_ .. attribute:: GridCursorRow See `GetGridCursorRow <#GetGridCursorRow>`_ .. attribute:: GridLineColour See `GetGridLineColour <#GetGridLineColour>`_ and `SetGridLineColour <#SetGridLineColour>`_ .. attribute:: GridRowLabelWindow See `GetGridRowLabelWindow <#GetGridRowLabelWindow>`_ .. attribute:: GridWindow See `GetGridWindow <#GetGridWindow>`_ .. attribute:: LabelBackgroundColour See `GetLabelBackgroundColour <#GetLabelBackgroundColour>`_ and `SetLabelBackgroundColour <#SetLabelBackgroundColour>`_ .. attribute:: LabelFont See `GetLabelFont <#GetLabelFont>`_ and `SetLabelFont <#SetLabelFont>`_ .. attribute:: LabelTextColour See `GetLabelTextColour <#GetLabelTextColour>`_ and `SetLabelTextColour <#SetLabelTextColour>`_ .. attribute:: NumberCols See `GetNumberCols <#GetNumberCols>`_ .. attribute:: NumberRows See `GetNumberRows <#GetNumberRows>`_ .. attribute:: RowLabelAlignment See `GetRowLabelAlignment <#GetRowLabelAlignment>`_ and `SetRowLabelAlignment <#SetRowLabelAlignment>`_ .. attribute:: RowLabelSize See `GetRowLabelSize <#GetRowLabelSize>`_ and `SetRowLabelSize <#SetRowLabelSize>`_ .. attribute:: RowMinimalAcceptableHeight See `GetRowMinimalAcceptableHeight <#GetRowMinimalAcceptableHeight>`_ and `SetRowMinimalAcceptableHeight <#SetRowMinimalAcceptableHeight>`_ .. attribute:: ScrollLineX See `GetScrollLineX <#GetScrollLineX>`_ and `SetScrollLineX <#SetScrollLineX>`_ .. attribute:: ScrollLineY See `GetScrollLineY <#GetScrollLineY>`_ and `SetScrollLineY <#SetScrollLineY>`_ .. attribute:: SelectedCells See `GetSelectedCells <#GetSelectedCells>`_ .. attribute:: SelectedCols See `GetSelectedCols <#GetSelectedCols>`_ .. attribute:: SelectedRows See `GetSelectedRows <#GetSelectedRows>`_ .. attribute:: SelectionBackground See `GetSelectionBackground <#GetSelectionBackground>`_ and `SetSelectionBackground <#SetSelectionBackground>`_ .. attribute:: SelectionBlockBottomRight See `GetSelectionBlockBottomRight <#GetSelectionBlockBottomRight>`_ .. attribute:: SelectionBlockTopLeft See `GetSelectionBlockTopLeft <#GetSelectionBlockTopLeft>`_ .. attribute:: SelectionForeground See `GetSelectionForeground <#GetSelectionForeground>`_ and `SetSelectionForeground <#SetSelectionForeground>`_ .. attribute:: SelectionMode See `GetSelectionMode <#GetSelectionMode>`_ and `SetSelectionMode <#SetSelectionMode>`_ .. attribute:: Table See `GetTable <#GetTable>`_ and `SetTable <#SetTable>`_