This class can be used to alter the cells' appearance in the grid by changing their colour/font/... from default. An object of this class may be returned by wxGridTable::GetAttr().
Derived from
No base class
Include files
<wx/grid.h>
Members
wxGridCellAttr::wxGridCellAttr
wxGridCellAttr::Clone
wxGridCellAttr::IncRef
wxGridCellAttr::DecRef
wxGridCellAttr::SetTextColour
wxGridCellAttr::SetBackgroundColour
wxGridCellAttr::SetFont
wxGridCellAttr::SetAlignment
wxGridCellAttr::SetReadOnly
wxGridCellAttr::SetRenderer
wxGridCellAttr::SetEditor
wxGridCellAttr::HasTextColour
wxGridCellAttr::HasBackgroundColour
wxGridCellAttr::HasFont
wxGridCellAttr::HasAlignment
wxGridCellAttr::HasRenderer
wxGridCellAttr::HasEditor
wxGridCellAttr::GetTextColour
wxGridCellAttr::GetBackgroundColour
wxGridCellAttr::GetFont
wxGridCellAttr::GetAlignment
wxGridCellAttr::GetRenderer
wxGridCellAttr::GetEditor
wxGridCellAttr::IsReadOnly
wxGridCellAttr::SetDefAttr
wxGridCellAttr()
Default constructor.
wxGridCellAttr(const wxColour& colText, const wxColour& colBack, const wxFont& font, int hAlign, int vAlign)
Constructor specifying some of the often used attributes.
wxGridCellAttr* Clone() const
Creates a new copy of this object.
void IncRef()
This class is ref counted: it is created with ref count of 1, so calling DecRef() once will delete it. Calling IncRef() allows to lock it until the matching DecRef() is called
void DecRef()
void SetTextColour(const wxColour& colText)
Sets the text colour.
void SetBackgroundColour(const wxColour& colBack)
Sets the background colour.
void SetFont(const wxFont& font)
Sets the font.
void SetAlignment(int hAlign, int vAlign)
Sets the alignment. hAlign can be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT and vAlign can be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
void SetReadOnly(bool isReadOnly = true)
void SetRenderer(wxGridCellRenderer* renderer)
takes ownership of the pointer
void SetEditor(wxGridCellEditor* editor)
bool HasTextColour() const
accessors
bool HasBackgroundColour() const
bool HasFont() const
bool HasAlignment() const
bool HasRenderer() const
bool HasEditor() const
const wxColour& GetTextColour() const
const wxColour& GetBackgroundColour() const
const wxFont& GetFont() const
void GetAlignment(int* hAlign, int* vAlign) const
See SetAlignment for the returned values.
wxGridCellRenderer* GetRenderer(wxGrid* grid, int row, int col) const
wxGridCellEditor* GetEditor(wxGrid* grid, int row, int col) const
bool IsReadOnly() const
void SetDefAttr(wxGridCellAttr* defAttr)