Class: Wx::GRID::GridCellAttr
- Inherits:
-
Object
- Object
- Wx::GRID::GridCellAttr
- 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
Defined Under Namespace
Classes: AttrKind
Instance Method Summary collapse
-
#can_overflow ⇒ Boolean
(also: #can_overflow?)
Returns true if the cell will draw an overflowed text into the neighbouring cells.
-
#clone ⇒ Wx::GRID::GridCellAttr
Creates a new copy of this object.
-
#get_alignment ⇒ Array(Integer,Integer)
(also: #alignment)
Get the alignment to use for the cell with the given attribute.
-
#get_background_colour ⇒ Wx::Colour, ...
(also: #background_colour)
Returns the background colour.
-
#get_editor(grid, row, col) ⇒ Wx::GRID::GridCellEditor
(also: #editor)
Returns the cell editor.
-
#get_fit_mode ⇒ Wx::GRID::GridFitMode
(also: #fit_mode)
Returns the fitting mode for the cells using this attribute.
-
#get_font ⇒ Wx::Font, Wx::FontInfo
(also: #font)
Returns the font.
- #get_kind ⇒ Wx::GridCellAttr::AttrKind (also: #kind)
-
#get_non_default_alignment ⇒ Array(Integer,Integer)
(also: #non_default_alignment)
Get the alignment defined by this attribute.
-
#get_overflow ⇒ Boolean
(also: #overflow)
Returns true if the cells using this attribute overflow into the neighbouring cells.
-
#get_renderer(grid, row, col) ⇒ Wx::GRID::GridCellRenderer
(also: #renderer)
Returns the cell renderer.
- #get_size ⇒ Array(Integer,Integer) (also: #size)
-
#get_text_colour ⇒ Wx::Colour, ...
(also: #text_colour)
Returns the text colour.
-
#has_alignment ⇒ Boolean
(also: #has_alignment?)
Returns true if this attribute has a valid alignment set.
-
#has_background_colour ⇒ Boolean
(also: #has_background_colour?)
Returns true if this attribute has a valid background colour set.
-
#has_editor ⇒ Boolean
(also: #has_editor?)
Returns true if this attribute has a valid cell editor set.
-
#has_font ⇒ Boolean
(also: #has_font?)
Returns true if this attribute has a valid font set.
- #has_overflow_mode ⇒ Boolean (also: #has_overflow_mode?)
- #has_read_write_mode ⇒ Boolean (also: #has_read_write_mode?)
-
#has_renderer ⇒ Boolean
(also: #has_renderer?)
Returns true if this attribute has a valid cell renderer set.
- #has_size ⇒ Boolean (also: #has_size?)
-
#has_text_colour ⇒ Boolean
(also: #has_text_colour?)
Returns true if this attribute has a valid text colour set.
-
#initialize(colText, colBack, font, hAlign, vAlign) ⇒ Wx::GRID::GridCellAttr
constructor
Constructor specifying some of the often used attributes.
-
#is_read_only ⇒ Boolean
(also: #read_only?)
Returns true if this cell is set as read-only.
-
#set_alignment(hAlign, vAlign) ⇒ void
Sets the alignment.
-
#set_background_colour(colBack) ⇒ void
(also: #background_colour=)
Sets the background colour.
-
#set_editor(editor) ⇒ void
(also: #editor=)
Sets the editor to be used with the cells with this attribute.
-
#set_fit_mode(fitMode) ⇒ void
(also: #fit_mode=)
Specifies the behaviour of the cell contents if it doesn’t fit into the available space.
-
#set_font(font) ⇒ void
(also: #font=)
Sets the font.
- #set_kind(kind) ⇒ void (also: #kind=)
-
#set_overflow(allow = true) ⇒ void
(also: #overflow=)
Specifies if cells using this attribute should overflow or clip their contents.
-
#set_read_only(isReadOnly = true) ⇒ void
(also: #read_only=)
Sets the cell as read-only.
-
#set_renderer(renderer) ⇒ void
(also: #renderer=)
Sets the renderer to be used for cells with this attribute.
- #set_size(num_rows, num_cols) ⇒ void
-
#set_text_colour(colText) ⇒ void
(also: #text_colour=)
Sets the text colour.
Constructor Details
#initialize(colText, colBack, font, hAlign, vAlign) ⇒ Wx::GRID::GridCellAttr
Constructor specifying some of the often used attributes.
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_overflow ⇒ Boolean 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.
268 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 268 def can_overflow; end |
#clone ⇒ Wx::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_alignment ⇒ Array(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.
75 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 75 def get_alignment; end |
#get_background_colour ⇒ Wx::Colour, ... Also known as: background_colour
Returns the background colour.
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.
90 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 90 def get_editor(grid, row, col) end |
#get_fit_mode ⇒ Wx::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_font ⇒ Wx::Font, Wx::FontInfo Also known as: font
Returns the font.
95 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 95 def get_font; end |
#get_kind ⇒ Wx::GridCellAttr::AttrKind Also known as: kind
272 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 272 def get_kind; end |
#get_non_default_alignment ⇒ Array(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
107 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 107 def get_non_default_alignment; end |
#get_overflow ⇒ Boolean 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.
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.
117 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 117 def get_renderer(grid, row, col) end |
#get_size ⇒ Array(Integer,Integer) Also known as: size
247 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 247 def get_size; end |
#get_text_colour ⇒ Wx::Colour, ... Also known as: text_colour
Returns the text colour.
122 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 122 def get_text_colour; end |
#has_alignment ⇒ Boolean Also known as: has_alignment?
Returns true if this attribute has a valid alignment set.
127 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 127 def has_alignment; end |
#has_background_colour ⇒ Boolean Also known as: has_background_colour?
Returns true if this attribute has a valid background colour set.
132 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 132 def has_background_colour; end |
#has_editor ⇒ Boolean Also known as: has_editor?
Returns true if this attribute has a valid cell editor set.
137 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 137 def has_editor; end |
#has_font ⇒ Boolean Also known as: has_font?
Returns true if this attribute has a valid font set.
142 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 142 def has_font; end |
#has_overflow_mode ⇒ Boolean Also known as: has_overflow_mode?
239 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 239 def has_overflow_mode; end |
#has_read_write_mode ⇒ Boolean Also known as: has_read_write_mode?
235 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 235 def has_read_write_mode; end |
#has_renderer ⇒ Boolean Also known as: has_renderer?
Returns true if this attribute has a valid cell renderer set.
147 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 147 def has_renderer; end |
#has_size ⇒ Boolean Also known as: has_size?
243 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 243 def has_size; end |
#has_text_colour ⇒ Boolean Also known as: has_text_colour?
Returns true if this attribute has a valid text colour set.
152 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 152 def has_text_colour; end |
#is_read_only ⇒ Boolean Also known as: read_only?
Returns true if this cell is set as read-only.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
203 |
# File 'lib/wx/doc/gen/grid/grid_cell_attr.rb', line 203 def set_text_colour(colText) end |