******************** wx.grid.GridCellAttr ******************** Inheritance diagram for `wx.grid.GridCellAttr`: | .. inheritance-diagram:: wx.grid.GridCellAttr | Description =========== This class can be used to alter the cells' appearance in the grid by changing their colour, font, etc... from default. An object of this class may be returned by `wx.grid.GridTableBase.GetAttr() `_. Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Clone <#Clone>`_ * `DecRef <#DecRef>`_ * `GetAlignment <#GetAlignment>`_ * `GetBackgroundColour <#GetBackgroundColour>`_ * `GetEditor <#GetEditor>`_ * `GetFont <#GetFont>`_ * `GetKind <#GetKind>`_ * `GetOverflow <#GetOverflow>`_ * `GetRenderer <#GetRenderer>`_ * `GetSize <#GetSize>`_ * `GetTextColour <#GetTextColour>`_ * `HasAlignment <#HasAlignment>`_ * `HasBackgroundColour <#HasBackgroundColour>`_ * `HasEditor <#HasEditor>`_ * `HasFont <#HasFont>`_ * `HasOverflowMode <#HasOverflowMode>`_ * `HasReadWriteMode <#HasReadWriteMode>`_ * `HasRenderer <#HasRenderer>`_ * `HasTextColour <#HasTextColour>`_ * `IncRef <#IncRef>`_ * `IsReadOnly <#IsReadOnly>`_ * `MergeWith <#MergeWith>`_ * `SetAlignment <#SetAlignment>`_ * `SetBackgroundColour <#SetBackgroundColour>`_ * `SetDefAttr <#SetDefAttr>`_ * `SetEditor <#SetEditor>`_ * `SetFont <#SetFont>`_ * `SetKind <#SetKind>`_ * `SetOverflow <#SetOverflow>`_ * `SetReadOnly <#SetReadOnly>`_ * `SetRenderer <#SetRenderer>`_ * `SetSize <#SetSize>`_ * `SetTextColour <#SetTextColour>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Alignment <#Alignment>`_ * `BackgroundColour <#BackgroundColour>`_ * `Font <#Font>`_ * `Kind <#Kind>`_ * `Overflow <#Overflow>`_ * `Size <#Size>`_ * `TextColour <#TextColour>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(attrDefault=None) Constructor specifying some of the often used attributes. **Parameters:** * `attrDefault` (`wx.grid.GridCellAttr `_) | **Returns:** `wx.grid.GridCellAttr `_ -------- .. method:: Clone() Creates a new copy of this object. | **Returns:** `wx.grid.GridCellAttr `_ -------- .. method:: DecRef() This class is reference counted: it is created with ref count of 1, so calling `DecRef() <#DecRef>`_ once will delete it. Calling `IncRef()` allows to lock it until the matching `DecRef()` is called. -------- .. method:: GetAlignment() Returns the attribute horizontal and vertical alignments. See `SetAlignment <#SetAlignment>`_ for the returned values. | **Returns:** `(hAlign, vAlign)` -------- .. method:: GetBackgroundColour() Returns the attribute background colour. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetEditor(grid, row, col) Returns the attribute editor. **Parameters:** * `grid` (`wx.grid.Grid `_) * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellEditor `_ -------- .. method:: GetFont() Returns the attribute font. | **Returns:** `wx.Font <../Widgets/wx.Font.html>`_ -------- .. method:: GetKind() `No docstrings available for this method.` -------- .. method:: GetOverflow() `No docstrings available for this method.` -------- .. method:: GetRenderer(grid, grid, grid) Returns the attribute renderer. **Parameters:** * `grid` (`wx.grid.Grid `_) * `row` (int) * `col` (int) | **Returns:** `wx.grid.GridCellRenderer `_ -------- .. method:: GetSize() `No docstrings available for this method.` -------- .. method:: GetTextColour() Returns the attribute text colour. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: HasAlignment() Returns whether the `alignment` flag has been set or not. | **Returns:** `bool` -------- .. method:: HasBackgroundColour() Returns whether the background colour has been set or not. | **Returns:** `bool` -------- .. method:: HasEditor() Returns whether the attribute has an associated editor or not. | **Returns:** `bool` -------- .. method:: HasFont() Returns whether the font has been set or not. | **Returns:** `bool` -------- .. method:: HasOverflowMode() `No docstrings available for this method.` -------- .. method:: HasReadWriteMode() `No docstrings available for this method.` -------- .. method:: HasRenderer() Returns whether the attribute has an associated renderer or not. | **Returns:** `bool` -------- .. method:: HasTextColour() Returns whether the text colour has been set or not. | **Returns:** `bool` -------- .. method:: IncRef() This class is reference counted: it is created with ref count of 1, so calling `DecRef() <#DecRef>`_ once will delete it. Calling `IncRef()` allows to lock it until the matching `DecRef()` is called. -------- .. method:: IsReadOnly() Returns whether the attribute has the `readOnly` flag set or not. | **Returns:** `bool` -------- .. method:: MergeWith(mergefrom) Merges this attribute with another one. **Parameters:** * `mergefrom` (`wx.grid.GridCellAttr `_ ) -------- .. method:: SetAlignment(hAlign, vAlign) Sets the alignment. **Parameters:** * `hAlign` (int): can be one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_RIGHT``. * `vAlign` (int): can be one of ``wx.ALIGN_TOP``, ``wx.ALIGN_CENTRE`` or ``wx.ALIGN_BOTTOM``. -------- .. method:: SetBackgroundColour(colBack) Sets the background colour. **Parameters:** * `colBack` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetDefAttr(defAttr) Sets a default attribute. **Parameters:** * `defAttr` (`wx.grid.GridCellAttr `_) -------- .. method:: SetEditor(editor) Sets the editor for this attribute. **Parameters:** * `editor` (`wx.grid.GridCellEditor `_) -------- .. method:: SetFont(font) Sets the font. **Parameters:** * `font` (`wx.Font <../Widgets/wx.Font.html>`_) -------- .. method:: SetKind(kind) | **Parameters:** * `kind` (int) -------- .. method:: SetOverflow(allow=True) | **Parameters:** * `allow` (bool) -------- .. method:: SetReadOnly(isReadOnly=True) Sets the attribute as read-only if `isReadOnly` is ``True``. **Parameters:** * `isReadOnly` (bool) -------- .. method:: SetRenderer(renderer) Sets the attribute renderer. **Parameters:** * `renderer` (`wx.grid.GridCellRenderer `_) -------- .. method:: SetSize(num_rows, num_cols) Allows this attribute to span more than 1 rows and/or columns. **Parameters:** * `num_rows` (int): Number of rows to span. * `num_cols` (int): Number of columns to span. -------- .. method:: SetTextColour(colText) Sets the text colour. **Parameters:** * `colText` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- Properties ^^^^^^^^^^ .. attribute:: Alignment See `GetAlignment <#GetAlignment>`_ and `SetAlignment <#SetAlignment>`_ .. attribute:: BackgroundColour See `GetBackgroundColour <#GetBackgroundColour>`_ and `SetBackgroundColour <#SetBackgroundColour>`_ .. attribute:: Font See `GetFont <#GetFont>`_ and `SetFont <#SetFont>`_ .. attribute:: Kind See `GetKind <#GetKind>`_ and `SetKind <#SetKind>`_ .. attribute:: Overflow See `GetOverflow <#GetOverflow>`_ and `SetOverflow <#SetOverflow>`_ .. attribute:: Size See `GetSize <#GetSize>`_ and `SetSize <#SetSize>`_ .. attribute:: TextColour See `GetTextColour <#GetTextColour>`_ and `SetTextColour <#SetTextColour>`_