wxGridCellAttr — wx v2.4.3

Search documentation of wx

# View Source wxGridCellAttr (wx v2.4.3)

This class can be used to alter the cells' appearance in the grid by changing their attributes from the defaults.

An object of this class may be returned by `wxGridTableBase::GetAttr()` (not implemented in wx).

Note that objects of this class are reference-counted and it's recommended to use wxGridCellAttrPtr smart pointer class when working with them to avoid memory leaks.

wxWidgets docs: wxGridCellAttr

# Summary

## Types

wxGridCellAttr()

## Functions

getAlignment(This)

Get the alignment to use for the cell with the given attribute.

getBackgroundColour(This)

Returns the background colour.

getEditor(This, Grid, Row, Col)

Returns the cell editor.

getFont(This)

Returns the font.

getRenderer(This, Grid, Row, Col)

Returns the cell renderer.

getTextColour(This)

Returns the text colour.

hasAlignment(This)

Returns true if this attribute has a valid alignment set.

hasBackgroundColour(This)

Returns true if this attribute has a valid background colour set.

hasEditor(This)

Returns true if this attribute has a valid cell editor set.

hasFont(This)

Returns true if this attribute has a valid font set.

hasRenderer(This)

Returns true if this attribute has a valid cell renderer set.

hasTextColour(This)

Returns true if this attribute has a valid text colour set.

isReadOnly(This)

Returns true if this cell is set as read-only.

setAlignment(This, HAlign, VAlign)

Sets the alignment.

setBackgroundColour(This, ColBack)

Sets the background colour.

setDefAttr(This, DefAttr)
setEditor(This, Editor)

Sets the editor to be used with the cells with this attribute.

setFont(This, Font)

Sets the font.

setReadOnly(This)

Equivalent to `setReadOnly(This, [])`.

setReadOnly/2

Sets the cell as read-only.

setRenderer(This, Renderer)

Sets the renderer to be used for cells with this attribute.

setTextColour(This, ColText)

Sets the text colour.

# Types

Link to this type

# wxGridCellAttr()

View Source

    -type wxGridCellAttr() :: wx:wx_object().

# Functions

Link to this function

# getAlignment(This)

View Source

    -spec getAlignment(This) -> {HAlign :: integer(), VAlign :: integer()} when This :: wxGridCellAttr().

Get the alignment to use for the cell with the given attribute.

If this attribute doesn't specify any alignment, the default attribute alignment is used (which can be changed using `wxGrid:setDefaultCellAlignment/3` but is left and top by default).

Notice that `hAlign` and `vAlign` values are always overwritten by this function, use `GetNonDefaultAlignment()` (not implemented in wx) if this is not desirable.

Link to this function

# getBackgroundColour(This)

View Source

    -spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxGridCellAttr().

Returns the background colour.

Link to this function

# getEditor(This, Grid, Row, Col)

View Source

    -spec getEditor(This, Grid, Row, Col) -> wxGridCellEditor:wxGridCellEditor()
                       when
                           This :: wxGridCellAttr(),
                           Grid :: wxGrid:wxGrid(),
                           Row :: integer(),
                           Col :: integer().

Returns the cell editor.

The caller is responsible for calling `DecRef()` (not implemented in wx) on the returned pointer, use `GetEditorPtr()` (not implemented in wx) to do it automatically.

Link to this function

# getFont(This)

View Source

    -spec getFont(This) -> wxFont:wxFont() when This :: wxGridCellAttr().

Returns the font.

Link to this function

# getRenderer(This, Grid, Row, Col)

View Source

    -spec getRenderer(This, Grid, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer()
                         when
                             This :: wxGridCellAttr(),
                             Grid :: wxGrid:wxGrid(),
                             Row :: integer(),
                             Col :: integer().

Returns the cell renderer.

The caller is responsible for calling `DecRef()` (not implemented in wx) on the returned pointer, use `GetRendererPtr()` (not implemented in wx) to do it automatically.

Link to this function

# getTextColour(This)

View Source

    -spec getTextColour(This) -> wx:wx_colour4() when This :: wxGridCellAttr().

Returns the text colour.

Link to this function

# hasAlignment(This)

View Source

    -spec hasAlignment(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid alignment set.

Link to this function

# hasBackgroundColour(This)

View Source

    -spec hasBackgroundColour(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid background colour set.

Link to this function

# hasEditor(This)

View Source

    -spec hasEditor(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid cell editor set.

Link to this function

# hasFont(This)

View Source

    -spec hasFont(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid font set.

Link to this function

# hasRenderer(This)

View Source

    -spec hasRenderer(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid cell renderer set.

Link to this function

# hasTextColour(This)

View Source

    -spec hasTextColour(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid text colour set.

Link to this function

# isReadOnly(This)

View Source

    -spec isReadOnly(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this cell is set as read-only.

Link to this function

# setAlignment(This, HAlign, VAlign)

View Source

    -spec setAlignment(This, HAlign, VAlign) -> ok
                          when This :: wxGridCellAttr(), HAlign :: integer(), VAlign :: integer().

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`.

Link to this function

# setBackgroundColour(This, ColBack)

View Source

    -spec setBackgroundColour(This, ColBack) -> ok when This :: wxGridCellAttr(), ColBack :: wx:wx_colour().

Sets the background colour.

Link to this function

# setDefAttr(This, DefAttr)

View Source

    -spec setDefAttr(This, DefAttr) -> ok when This :: wxGridCellAttr(), DefAttr :: wxGridCellAttr().

Link to this function

# setEditor(This, Editor)

View Source

    -spec setEditor(This, Editor) -> ok
                       when This :: wxGridCellAttr(), Editor :: wxGridCellEditor:wxGridCellEditor().

Sets the editor to be used with the cells with this attribute.

Link to this function

# setFont(This, Font)

View Source

    -spec setFont(This, Font) -> ok when This :: wxGridCellAttr(), Font :: wxFont:wxFont().

Sets the font.

Link to this function

# setReadOnly(This)

View Source

    -spec setReadOnly(This) -> ok when This :: wxGridCellAttr().

Equivalent to `setReadOnly(This, [])`.

Link to this function

# setReadOnly/2

View Source

    -spec setReadOnly(This, [Option]) -> ok when This :: wxGridCellAttr(), Option :: {isReadOnly, boolean()}.

Sets the cell as read-only.

Link to this function

# setRenderer(This, Renderer)

View Source

    -spec setRenderer(This, Renderer) -> ok
                         when This :: wxGridCellAttr(), Renderer :: wxGridCellRenderer:wxGridCellRenderer().

Sets the renderer to be used for cells with this attribute.

Takes ownership of the pointer.

Link to this function

# setTextColour(This, ColText)

View Source

    -spec setTextColour(This, ColText) -> ok when This :: wxGridCellAttr(), ColText :: wx:wx_colour().

Sets the text colour.