Class: Wx::GRID::GridCellAttr

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/grid/grid_cell_attr.rb

Overview

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 Wx::GRID::GridTableBase#get_attr. Note that objects of this class are reference-counted and it’s recommended to use Wx::GridCellAttrPtr smart pointer class when working with them to avoid memory leaks.

Category: Grid Related Classes

Requires:

  • USE_GRID

Defined Under Namespace

Classes: AttrKind

Instance Method Summary collapse

Constructor Details

#initialize(colText, colBack, font, hAlign, vAlign) ⇒ Wx::GRID::GridCellAttr

Constructor specifying some of the often used attributes.

Parameters:



64
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 64

def initialize(colText, colBack, font, hAlign, vAlign) end

Instance Method Details

#can_overflowBoolean Also known as: can_overflow?

Returns true if the cell will draw an overflowed text into the neighbouring cells.

Note that only left aligned cells currently can overflow. It means that #get_fit_mode.IsOverflow() should returns true and GetAlignment should returns Alignment::ALIGN_LEFT for hAlign parameter.

Returns:

  • (Boolean)


268
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 268

def can_overflow; end

#cloneWx::GRID::GridCellAttr

Creates a new copy of this object.



68
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 68

def clone; end

#get_alignmentArray(Integer,Integer) Also known as: alignment

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 Wx::GRID::Grid#set_default_cell_alignment but is left and top by default). Notice that valid hAlign and vAlign values (default or non-default) are always returned by this function, use #get_non_default_alignment if this is not desirable.

Returns:

  • (Array(Integer,Integer))


75
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 75

def get_alignment; end

#get_background_colourWx::Colour, ... Also known as: background_colour

Returns the background colour.

Returns:



80
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 80

def get_background_colour; end

#get_editor(grid, row, col) ⇒ Wx::GRID::GridCellEditor Also known as: editor

Returns the cell editor.

The caller is responsible for calling dec_ref on the returned pointer, use get_editor_ptr to do it automatically.

Parameters:

Returns:



90
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 90

def get_editor(grid, row, col) end

#get_fit_modeWx::GRID::GridFitMode Also known as: fit_mode

Returns the fitting mode for the cells using this attribute.

The returned Wx::GRID::GridFitMode is always specified, i.e. Wx::GRID::GridFitMode#is_specified always returns true. The default value, if #set_fit_mode hadn’t been called before, is “overflow”.



254
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 254

def get_fit_mode; end

#get_fontWx::Font, Wx::FontInfo Also known as: font

Returns the font.

Returns:



95
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 95

def get_font; end

#get_kindWx::GridCellAttr::AttrKind Also known as: kind

Returns:

  • (Wx::GridCellAttr::AttrKind)


272
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 272

def get_kind; end

#get_non_default_alignmentArray(Integer,Integer) Also known as: non_default_alignment

Get the alignment defined by this attribute.

Unlike #get_alignment this function only returns hAlign and vAlign if this attribute does define a non-default alignment. Otherwise the returned value will be ALIGN_INVALID. For example, the following fragment can be used to use the cell alignment if one is defined but right-align its contents by default (instead of left-aligning it by default) while still using the default vertical alignment:

h_align, v_align = attr.get_non_default_alignment
  h_align = Wx::ALIGN_RIGHT if h_align == Wx::ALIGN_INVALID

Returns:

  • (Array(Integer,Integer))


107
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 107

def get_non_default_alignment; end

#get_overflowBoolean Also known as: overflow

Returns true if the cells using this attribute overflow into the neighbouring cells.

Prefer using #get_fit_mode in the new code.

Returns:

  • (Boolean)


261
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 261

def get_overflow; end

#get_renderer(grid, row, col) ⇒ Wx::GRID::GridCellRenderer Also known as: renderer

Returns the cell renderer.

The caller is responsible for calling dec_ref on the returned pointer, use get_renderer_ptr to do it automatically.

Parameters:

Returns:



117
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 117

def get_renderer(grid, row, col) end

#get_sizeArray(Integer,Integer) Also known as: size

Returns:

  • (Array(Integer,Integer))


247
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 247

def get_size; end

#get_text_colourWx::Colour, ... Also known as: text_colour

Returns the text colour.

Returns:



122
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 122

def get_text_colour; end

#has_alignmentBoolean Also known as: has_alignment?

Returns true if this attribute has a valid alignment set.

Returns:

  • (Boolean)


127
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 127

def has_alignment; end

#has_background_colourBoolean Also known as: has_background_colour?

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

Returns:

  • (Boolean)


132
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 132

def has_background_colour; end

#has_editorBoolean Also known as: has_editor?

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

Returns:

  • (Boolean)


137
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 137

def has_editor; end

#has_fontBoolean Also known as: has_font?

Returns true if this attribute has a valid font set.

Returns:

  • (Boolean)


142
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 142

def has_font; end

#has_overflow_modeBoolean Also known as: has_overflow_mode?

Returns:

  • (Boolean)


239
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 239

def has_overflow_mode; end

#has_read_write_modeBoolean Also known as: has_read_write_mode?

Returns:

  • (Boolean)


235
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 235

def has_read_write_mode; end

#has_rendererBoolean Also known as: has_renderer?

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

Returns:

  • (Boolean)


147
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 147

def has_renderer; end

#has_sizeBoolean Also known as: has_size?

Returns:

  • (Boolean)


243
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 243

def has_size; end

#has_text_colourBoolean Also known as: has_text_colour?

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

Returns:

  • (Boolean)


152
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 152

def has_text_colour; end

#is_read_onlyBoolean Also known as: read_only?

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

Returns:

  • (Boolean)


157
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 157

def is_read_only; end

#set_alignment(hAlign, vAlign) ⇒ void

This method returns an undefined value.

Sets the alignment.

hAlign can be one of Alignment::ALIGN_LEFT, Alignment::ALIGN_CENTRE or Alignment::ALIGN_RIGHT and vAlign can be one of Alignment::ALIGN_TOP, Alignment::ALIGN_CENTRE or Alignment::ALIGN_BOTTOM.

Parameters:

  • hAlign (Integer)
  • vAlign (Integer)


166
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 166

def set_alignment(hAlign, vAlign) end

#set_background_colour(colBack) ⇒ void Also known as: background_colour=

This method returns an undefined value.

Sets the background colour.

Parameters:



171
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 171

def set_background_colour(colBack) end

#set_editor(editor) ⇒ void Also known as: editor=

This method returns an undefined value.

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

Parameters:



177
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 177

def set_editor(editor) end

#set_fit_mode(fitMode) ⇒ void Also known as: fit_mode=

This method returns an undefined value.

Specifies the behaviour of the cell contents if it doesn’t fit into the available space.

Parameters:

See Also:



217
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 217

def set_fit_mode(fitMode) end

#set_font(font) ⇒ void Also known as: font=

This method returns an undefined value.

Sets the font.

Parameters:



183
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 183

def set_font(font) end

#set_kind(kind) ⇒ void Also known as: kind=

This method returns an undefined value.

Parameters:

  • kind (Wx::GridCellAttr::AttrKind)


231
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 231

def set_kind(kind) end

#set_overflow(allow = true) ⇒ void Also known as: overflow=

This method returns an undefined value.

Specifies if cells using this attribute should overflow or clip their contents.

This is the same as calling #set_fit_mode with either Wx::GRID::GridFitMode.overflow or Wx::GRID::GridFitMode.clip argument depending on whether allow is true or false. Prefer using #set_fit_mode directly instead in the new code.

Parameters:

  • allow (Boolean) (defaults to: true)


226
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 226

def set_overflow(allow=true) end

#set_read_only(isReadOnly = true) ⇒ void Also known as: read_only=

This method returns an undefined value.

Sets the cell as read-only.

Parameters:

  • isReadOnly (Boolean) (defaults to: true)


189
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 189

def set_read_only(isReadOnly=true) end

#set_renderer(renderer) ⇒ void Also known as: renderer=

This method returns an undefined value.

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

Takes ownership of the pointer.

Parameters:



197
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 197

def set_renderer(renderer) end

#set_size(num_rows, num_cols) ⇒ void

This method returns an undefined value.

Parameters:

  • num_rows (Integer)
  • num_cols (Integer)


209
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 209

def set_size(num_rows, num_cols) end

#set_text_colour(colText) ⇒ void Also known as: text_colour=

This method returns an undefined value.

Sets the text colour.

Parameters:



203
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 203

def set_text_colour(colText) end