# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx::GRID # This class is responsible for providing and manipulating the in-place edit controls for the grid. # Instances of {Wx::GRID::GridCellEditor} (actually, instances of derived classes since it is an abstract class) can be associated with the cell attributes for individual cells, rows, columns, or even for the entire grid. # Normally {Wx::GRID::GridCellEditor} shows some UI control allowing the user to edit the cell, but starting with wxWidgets 3.1.4 it's also possible to define "activatable" cell editors, that change the value of the cell directly when it's activated (typically by pressing Space key or clicking on it), see {Wx::GRID::GridCellEditor#try_activate} method. Note that when implementing an editor which is always activatable, i.e. never shows any in-place editor, it is more convenient to derive its class from {Wx::GRID::GridCellActivatableEditor} than from {Wx::GRID::GridCellEditor} itself. # # Category: Grid Related Classes # @see Wx::GRID::GridCellAutoWrapStringEditor # @see Wx::GRID::GridCellBoolEditor # @see Wx::GRID::GridCellChoiceEditor # @see Wx::GRID::GridCellEnumEditor # @see Wx::GRID::GridCellFloatEditor # @see Wx::GRID::GridCellNumberEditor # @see Wx::GRID::GridCellTextEditor # @see Wx::GRID::GridCellDateEditor # # # # @note This class is untracked and should not be derived from nor instances extended! # @wxrb_require USE_GRID class GridCellEditor < ::Object # Default constructor. # @return [Wx::GRID::GridCellEditor] def initialize; end # Fetch the value from the table and prepare the edit control to begin editing. # This function should save the original value of the grid cell at the given row and col and show the control allowing the user to change it. # @see Wx::GRID::GridCellEditor#end_edit # @param row [Integer] # @param col [Integer] # @param grid [Wx::GRID::Grid] # @return [void] def begin_edit(row, col, grid) end # Create a new object which is the copy of this one. # @return [Wx::GRID::GridCellEditor] def clone; end # Creates the actual edit control. # @param parent [Wx::Window] # @param id [Integer] # @param evtHandler [Wx::EvtHandler] # @return [void] def create(parent, id, evtHandler) end # Final cleanup. # @return [void] def destroy; end # End editing the cell. # This function must check if the current value of the editing control is valid and different from the original value (available as oldval in its string form and possibly saved internally using its real type by {Wx::GRID::GridCellEditor#begin_edit}). If it isn't, it just returns false, otherwise it must do the following: # # - Save the new value internally so that {Wx::GRID::GridCellEditor#apply_edit} could apply it. # - Fill newval (which is never NULL) with the string representation of the new value. # - Return true # # Notice that it must not modify the grid as the change could still be vetoed. # If the user-defined {Wx::GRID::EVT_GRID_CELL_CHANGING} event handler doesn't veto this change, {Wx::GRID::GridCellEditor#apply_edit} will be called next. # @param row [Integer] # @param col [Integer] # @param grid [Wx::GRID::Grid] # @param oldval [String] # @param newval [String] # @return [Boolean] def end_edit(row, col, grid, oldval, newval) end # Effectively save the changes in the grid. # This function should save the value of the control in the grid. It is called only after {Wx::GRID::GridCellEditor#end_edit} returns true. # @param row [Integer] # @param col [Integer] # @param grid [Wx::GRID::Grid] # @return [void] def apply_edit(row, col, grid) end # Some types of controls on some platforms may need some help with the Return key. # @param event [Wx::KeyEvent] # @return [void] def handle_return(event) end # Returns true if the edit control has been created. # @return [Boolean] def is_created; end alias_method :created?, :is_created # Draws the part of the cell not occupied by the control: the base class version just fills it with background colour from the attribute. # @param dc [Wx::DC] # @param rectCell [Wx::Rect] # @param attr [Wx::GRID::GridCellAttr] # @return [void] def paint_background(dc, rectCell, attr) end # Reset the value in the control back to its starting value. # @return [void] def reset; end # Size and position the edit control. # @param rect [Wx::Rect] # @return [void] def set_size(rect) end alias_method :size=, :set_size # Show or hide the edit control, use the specified attributes to set colours/fonts for it. # @param show [Boolean] # @param attr [Wx::GRID::GridCellAttr] # @return [void] def show(show, attr=nil) end # If the editor is enabled by clicking on the cell, this method will be called. # @return [void] def starting_click; end # If the editor is enabled by pressing keys on the grid, this will be called to let the editor do something about that first key if desired. # @param event [Wx::KeyEvent] # @return [void] def starting_key(event) end # Return true to allow the given key to start editing: the base class version only checks that the event has no modifiers. # If the key is F2 (special), editing will always start and this method will not be called at all (but {Wx::GRID::GridCellEditor#starting_key} will) # @param event [Wx::KeyEvent] # @return [Boolean] def is_accepted_key(event) end alias_method :accepted_key?, :is_accepted_key # Returns the value currently in the editor control. # @return [String] def get_value; end alias_method :value, :get_value # Get the edit window used by this editor. # @return [Wx::Window] def get_window; end alias_method :window, :get_window # Set the {Wx::Window} that will be used by this cell editor for editing the value. # @param window [Wx::Window] # @return [void] def set_window(window) end alias_method :window=, :set_window # Get the {Wx::Control} used by this editor. # This function is preserved for compatibility, but {Wx::GRID::GridCellEditor#get_window} should be preferred in the new code as the associated window doesn't need to be of a {Wx::Control}-derived class. # Note that if {Wx::GRID::GridCellEditor#set_window} had been called with an object not deriving from {Wx::Control}, this method will return NULL. # @return [Wx::Control] def get_control; end alias_method :control, :get_control # Set the {Wx::Control} that will be used by this cell editor for editing the value. # This function is preserved for compatibility, but {Wx::GRID::GridCellEditor#set_window} should be preferred in the new code, see {Wx::GRID::GridCellEditor#get_control}. # @param control [Wx::Control] # @return [void] def set_control(control) end alias_method :control=, :set_control # Function allowing to create an "activatable" editor. # As explained in this class description, activatable editors don't show any edit control but change the cell value directly, when it is activated (by any way described by {Wx::GridActivationSource}). # To create such editor, this method must be overridden to return Wx::GridActivationResult#do_change passing it the new value of the cell. If the change is not vetoed by {Wx::GRID::EVT_GRID_CELL_CHANGING} handler, {Wx::GRID::GridCellEditor#do_activate} will be called to actually change the value, so it must be overridden as well if {Wx::GRID::GridCellEditor#try_activate} is overridden. # By default, Wx::GridActivationResult#do_edit is returned, meaning that this is a normal editor, using an edit control for changing the cell value. # @param row [Integer] # @param col [Integer] # @param grid [Wx::GRID::Grid] # @param actSource [Wx::GridActivationSource] # @return [Wx::GridActivationResult] def try_activate(row, col, grid, actSource) end # Function which must be overridden for "activatable" editors. # If {Wx::GRID::GridCellEditor#try_activate} is overridden to return "change" action, this function will be called to actually apply this change. Note that it is not passed the value to apply, as it is assumed that the editor class stores this value as a member variable anyhow. # @param row [Integer] # @param col [Integer] # @param grid [Wx::GRID::Grid] # @return [void] def do_activate(row, col, grid) end protected end # GridCellEditor end