# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx::GRID # 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 # class GridCellAttr < ::Object # Kind of the attribute to retrieve. # # # @see Wx::GridCellAttrProvider#get_attr # @see Wx::GRID::GridTableBase#get_attr # # class AttrKind < Wx::Enum # Return the combined effective attribute for the cell. # Any = Wx::GRID::GridCellAttr::AttrKind.new(0) # Return the attribute explicitly set for this cell. # Cell = Wx::GRID::GridCellAttr::AttrKind.new(2) # Return the attribute set for this cells row. # Row = Wx::GRID::GridCellAttr::AttrKind.new(3) # Return the attribute set for this cells column. # Col = Wx::GRID::GridCellAttr::AttrKind.new(4) # # Default = Wx::GRID::GridCellAttr::AttrKind.new(1) # # Merged = Wx::GRID::GridCellAttr::AttrKind.new(5) end # AttrKind # @overload initialize(attrDefault=nil) # Default constructor. # @param attrDefault [Wx::GridCellAttr] # @return [GridCellAttr] # @overload initialize(colText, colBack, font, hAlign, vAlign) # Constructor specifying some of the often used attributes. # @param colText [Wx::Colour,String,Symbol] # @param colBack [Wx::Colour,String,Symbol] # @param font [Wx::Font,Wx::FontInfo] # @param hAlign [Integer] # @param vAlign [Integer] # @return [GridCellAttr] def initialize(*args) end # Creates a new copy of this object. # @return [Wx::GridCellAttr] def clone; end # 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 hAlign and vAlign values are always overwritten by this function, use {Wx::GRID::GridCellAttr#get_non_default_alignment} if this is not desirable. # @return [Array(Integer,Integer)] def get_alignment; end alias_method :alignment, :get_alignment # Returns the background colour. # @return [Wx::Colour,String,Symbol] def get_background_colour; end alias_method :background_colour, :get_background_colour # Returns the cell editor. # The caller is responsible for calling {Wx::GRID::GridCellAttr#dec_ref} on the returned pointer, use {Wx::GRID::GridCellAttr#get_editor_ptr} to do it automatically. # @param grid [Wx::Grid] # @param row [Integer] # @param col [Integer] # @return [Wx::GRID::GridCellEditor] def get_editor(grid, row, col) end alias_method :editor, :get_editor # Returns the font. # @return [Wx::Font,Wx::FontInfo] def get_font; end alias_method :font, :get_font # Get the alignment defined by this attribute. # Unlike {Wx::GRID::GridCellAttr#get_alignment} this function only modifies hAlign and vAlign if this attribute does define a non-default alignment. This means that they must be initialized before calling this function and that their values will be preserved unchanged if they are different from {Wx::Alignment::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: # # int hAlign = wxALIGN_RIGHT, # vAlign = wxALIGN_INVALID; # attr.GetNonDefaultAlignment(&hAlign, &vAlign); # @return [Array(Integer,Integer)] def get_non_default_alignment; end alias_method :non_default_alignment, :get_non_default_alignment # Returns the cell renderer. # The caller is responsible for calling {Wx::GRID::GridCellAttr#dec_ref} on the returned pointer, use {Wx::GRID::GridCellAttr#get_renderer_ptr} to do it automatically. # @param grid [Wx::Grid] # @param row [Integer] # @param col [Integer] # @return [Wx::GRID::GridCellRenderer] def get_renderer(grid, row, col) end alias_method :renderer, :get_renderer # Returns the text colour. # @return [Wx::Colour,String,Symbol] def get_text_colour; end alias_method :text_colour, :get_text_colour # Returns true if this attribute has a valid alignment set. # @return [true,false] def has_alignment; end alias_method :has_alignment?, :has_alignment # Returns true if this attribute has a valid background colour set. # @return [true,false] def has_background_colour; end alias_method :has_background_colour?, :has_background_colour # Returns true if this attribute has a valid cell editor set. # @return [true,false] def has_editor; end alias_method :has_editor?, :has_editor # Returns true if this attribute has a valid font set. # @return [true,false] def has_font; end alias_method :has_font?, :has_font # Returns true if this attribute has a valid cell renderer set. # @return [true,false] def has_renderer; end alias_method :has_renderer?, :has_renderer # Returns true if this attribute has a valid text colour set. # @return [true,false] def has_text_colour; end alias_method :has_text_colour?, :has_text_colour # Returns true if this cell is set as read-only. # @return [true,false] def is_read_only; end alias_method :read_only?, :is_read_only # Sets the alignment. # hAlign can be one of {Wx::Alignment::ALIGN_LEFT}, {Wx::Alignment::ALIGN_CENTRE} or {Wx::Alignment::ALIGN_RIGHT} and vAlign can be one of {Wx::Alignment::ALIGN_TOP}, {Wx::Alignment::ALIGN_CENTRE} or {Wx::Alignment::ALIGN_BOTTOM}. # @param hAlign [Integer] # @param vAlign [Integer] # @return [void] def set_alignment(hAlign, vAlign) end # Sets the background colour. # @param colBack [Wx::Colour,String,Symbol] # @return [void] def set_background_colour(colBack) end alias_method :background_colour=, :set_background_colour # # TodoNeeds documentation. # @param defAttr [Wx::GridCellAttr] # @return [void] def set_def_attr(defAttr) end alias_method :def_attr=, :set_def_attr # Sets the editor to be used with the cells with this attribute. # @param editor [Wx::GridCellEditor] # @return [void] def set_editor(editor) end alias_method :editor=, :set_editor # Sets the font. # @param font [Wx::Font,Wx::FontInfo] # @return [void] def set_font(font) end alias_method :font=, :set_font # Sets the cell as read-only. # @param isReadOnly [true,false] # @return [void] def set_read_only(isReadOnly=true) end alias_method :read_only=, :set_read_only # Sets the renderer to be used for cells with this attribute. # Takes ownership of the pointer. # @param renderer [Wx::GridCellRenderer] # @return [void] def set_renderer(renderer) end alias_method :renderer=, :set_renderer # Sets the text colour. # @param colText [Wx::Colour,String,Symbol] # @return [void] def set_text_colour(colText) end alias_method :text_colour=, :set_text_colour # @param mergefrom [Wx::GridCellAttr] # @return [void] def merge_with(mergefrom) end # @param num_rows [Integer] # @param num_cols [Integer] # @return [void] def set_size(num_rows, num_cols) end # Specifies the behaviour of the cell contents if it doesn't fit into the available space. # # @see Wx::GridFitMode # @param fitMode [Wx::GridFitMode] # @return [void] def set_fit_mode(fitMode) end alias_method :fit_mode=, :set_fit_mode # Specifies if cells using this attribute should overflow or clip their contents. # This is the same as calling {Wx::GRID::GridCellAttr#set_fit_mode} with either Wx::GridFitMode#overflow or Wx::GridFitMode#clip argument depending on whether allow is true or false. # Prefer using {Wx::GRID::GridCellAttr#set_fit_mode} directly instead in the new code. # @param allow [true,false] # @return [void] def set_overflow(allow=true) end alias_method :overflow=, :set_overflow # @param kind [AttrKind] # @return [void] def set_kind(kind) end alias_method :kind=, :set_kind # @return [true,false] def has_read_write_mode; end alias_method :has_read_write_mode?, :has_read_write_mode # @return [true,false] def has_overflow_mode; end alias_method :has_overflow_mode?, :has_overflow_mode # @return [true,false] def has_size; end alias_method :has_size?, :has_size # @return [Array(Integer,Integer)] def get_size; end alias_method :size, :get_size # Returns the fitting mode for the cells using this attribute. # The returned {Wx::GridFitMode} is always specified, i.e. Wx::GridFitMode#is_specified always returns true. The default value, if {Wx::GRID::GridCellAttr#set_fit_mode} hadn't been called before, is "overflow". # @return [Wx::GridFitMode] def get_fit_mode; end alias_method :fit_mode, :get_fit_mode # Returns true if the cells using this attribute overflow into the neighbouring cells. # Prefer using {Wx::GRID::GridCellAttr#get_fit_mode} in the new code. # @return [true,false] def get_overflow; end alias_method :overflow, :get_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 {Wx::GRID::GridCellAttr#get_fit_mode}.IsOverflow() should returns true and GetAlignment should returns {Wx::Alignment::ALIGN_LEFT} for hAlign parameter. # @return [true,false] def can_overflow; end alias_method :can_overflow?, :can_overflow # @return [AttrKind] def get_kind; end alias_method :kind, :get_kind end # GridCellAttr end