# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx::RTC # RE_READONLY = 16 # RE_MULTILINE = 32 # RE_CENTRE_CARET = 32768 # RE_CENTER_CARET = 32768 # RICHTEXT_SHIFT_DOWN = 1 # RICHTEXT_CTRL_DOWN = 2 # RICHTEXT_ALT_DOWN = 4 # RICHTEXT_EX_NO_GUIDELINES = 256 # RICHTEXT_DEFAULT_OVERALL_SIZE = nil # RICHTEXT_DEFAULT_IMAGE_SIZE = nil # RICHTEXT_DEFAULT_SPACING = 3 # RICHTEXT_DEFAULT_MARGIN = 3 # RICHTEXT_DEFAULT_UNFOCUSSED_BACKGROUND = nil # RICHTEXT_DEFAULT_FOCUSSED_BACKGROUND = nil # RICHTEXT_DEFAULT_UNSELECTED_BACKGROUND = nil # RICHTEXT_DEFAULT_TYPE_COLOUR = nil # RICHTEXT_DEFAULT_FOCUS_RECT_COLOUR = nil # RICHTEXT_DEFAULT_CARET_WIDTH = 2 # RICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD = 20000 # RICHTEXT_DEFAULT_LAYOUT_INTERVAL = 50 # RICHTEXT_DEFAULT_DELAYED_IMAGE_PROCESSING_INTERVAL = 200 # ID_RICHTEXT_PROPERTIES1 = 6000 # ID_RICHTEXT_PROPERTIES2 = 6001 # ID_RICHTEXT_PROPERTIES3 = 6002 # # # # class RichTextCtrlSelectionState < Wx::Enum # # RichTextCtrlSelectionState_Normal = Wx::RTC::RichTextCtrlSelectionState.new(0) # # RichTextCtrlSelectionState_CommonAncestor = Wx::RTC::RichTextCtrlSelectionState.new(1) end # RichTextCtrlSelectionState # # EVT_RICHTEXT_LEFT_CLICK = 10351 # # EVT_RICHTEXT_RIGHT_CLICK = 10353 # # EVT_RICHTEXT_MIDDLE_CLICK = 10352 # # EVT_RICHTEXT_LEFT_DCLICK = 10354 # # EVT_RICHTEXT_RETURN = 10355 # # EVT_RICHTEXT_CHARACTER = 10356 # # EVT_RICHTEXT_CONSUMING_CHARACTER = 10357 # # EVT_RICHTEXT_DELETE = 10358 # # EVT_RICHTEXT_STYLESHEET_CHANGING = 10361 # # EVT_RICHTEXT_STYLESHEET_CHANGED = 10362 # # EVT_RICHTEXT_STYLESHEET_REPLACING = 10359 # # EVT_RICHTEXT_STYLESHEET_REPLACED = 10360 # # EVT_RICHTEXT_CONTENT_INSERTED = 10363 # # EVT_RICHTEXT_CONTENT_DELETED = 10364 # # EVT_RICHTEXT_STYLE_CHANGED = 10365 # # EVT_RICHTEXT_PROPERTIES_CHANGED = 10366 # # EVT_RICHTEXT_SELECTION_CHANGED = 10367 # # EVT_RICHTEXT_BUFFER_RESET = 10368 # # EVT_RICHTEXT_FOCUS_OBJECT_CHANGED = 10369 # {Wx::RTC::RichTextCtrl} provides a generic, ground-up implementation of a text control capable of showing multiple styles and images. # {Wx::RTC::RichTextCtrl} sends notification events: see {Wx::RTC::RichTextEvent}. # It also sends the standard {Wx::TextCtrl} events {Wx::EVT_TEXT_ENTER} and {Wx::EVT_TEXT}, and {Wx::TextUrlEvent} when URL content is clicked. # For more information, see the wxRichTextCtrl Overview. # === Styles # # This class supports the following styles: # # - {Wx::RTC::RE_CENTRE_CARET}: The control will try to keep the caret line centred vertically while editing. {Wx::RTC::RE_CENTER_CARET} is a synonym for this style. # - {Wx::RTC::RE_MULTILINE}: The control will be multiline (mandatory). # - {Wx::RTC::RE_READONLY}: The control will not be editable. # # === # # Category: Rich Text
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# class RichTextCtrl < Control # @overload initialize() # Default constructor. # @return [RichTextCtrl] # @overload initialize(parent, id=-1, value=(''), pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::RTC::RE_MULTILINE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::TextCtrlNameStr) # Constructor, creating and showing a rich text control. # # @see Wx::RTC::RichTextCtrl#create # @see Wx::Validator # @param parent [Wx::Window] Parent window. Must not be NULL. # @param id [Integer] Window identifier. The value {Wx::StandardID::ID_ANY} indicates a default value. # @param value [String] Default string. # @param pos [Array(Integer, Integer), Wx::Point] Window position. # @param size [Array(Integer, Integer), Wx::Size] Window size. # @param style [Integer] Window style. # @param validator [Wx::Validator] Window validator. # @param name [String] Window name. # @return [RichTextCtrl] def initialize(*args) end # Creates the underlying window. # @param parent [Wx::Window] # @param id [Integer] # @param value [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [true,false] def create(parent, id=-1, value=(''), pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::RTC::RE_MULTILINE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::TextCtrlNameStr) end # Initialises the members of the control. # @return [void] def init; end # Gets the text for the given range. # The end point of range is specified as the last character position of the span of text, plus one. # @param from [Integer] # @param to [Integer] # @return [String] def get_range(from, to) end alias_method :range, :get_range # Returns the length of the specified line in characters. # @param lineNo [Integer] # @return [Integer] def get_line_length(lineNo) end alias_method :line_length, :get_line_length # Returns the text for the given line. # @param lineNo [Integer] # @return [String] def get_line_text(lineNo) end alias_method :line_text, :get_line_text # Returns the number of lines in the buffer. # @return [Integer] def get_number_of_lines; end alias_method :number_of_lines, :get_number_of_lines # Returns true if the buffer has been modified. # @return [true,false] def is_modified; end alias_method :modified?, :is_modified # Returns true if the control is editable. # @return [true,false] def is_editable; end alias_method :editable?, :is_editable # Returns true if the control is single-line. # Currently {Wx::RTC::RichTextCtrl} does not support single-line editing. # @return [true,false] def is_single_line; end alias_method :single_line?, :is_single_line # Returns true if the control is multiline. # @return [true,false] def is_multi_line; end alias_method :multi_line?, :is_multi_line # @return [Wx::RichTextSelection] def get_selection; end alias_method :selection, :get_selection # Returns the text within the current selection range, if any. # @return [String] def get_string_selection; end alias_method :string_selection, :get_string_selection # Gets the current filename associated with the control. # @return [String] def get_filename; end alias_method :filename, :get_filename # Sets the current filename. # @param filename [String] # @return [void] def set_filename(filename) end alias_method :filename=, :set_filename # Sets the size of the buffer beyond which layout is delayed during resizing. # This optimizes sizing for large buffers. The default is 20000. # @param threshold [Integer] # @return [void] def set_delayed_layout_threshold(threshold) end alias_method :delayed_layout_threshold=, :set_delayed_layout_threshold # Gets the size of the buffer beyond which layout is delayed during resizing. # This optimizes sizing for large buffers. The default is 20000. # @return [Integer] def get_delayed_layout_threshold; end alias_method :delayed_layout_threshold, :get_delayed_layout_threshold # @return [true,false] def get_full_layout_required; end alias_method :full_layout_required, :get_full_layout_required # @param b [true,false] # @return [void] def set_full_layout_required(b) end alias_method :full_layout_required=, :set_full_layout_required # @return [Wx::LongLong] def get_full_layout_time; end alias_method :full_layout_time, :get_full_layout_time # @param t [Wx::LongLong] # @return [void] def set_full_layout_time(t) end alias_method :full_layout_time=, :set_full_layout_time # @return [Integer] def get_full_layout_saved_position; end alias_method :full_layout_saved_position, :get_full_layout_saved_position # @param p [Integer] # @return [void] def set_full_layout_saved_position(p) end alias_method :full_layout_saved_position=, :set_full_layout_saved_position # @return [void] def force_delayed_layout; end # Sets the text (normal) cursor. # @param cursor [Wx::Cursor] # @return [void] def set_text_cursor(cursor) end alias_method :text_cursor=, :set_text_cursor # Returns the text (normal) cursor. # @return [Wx::Cursor] def get_text_cursor; end alias_method :text_cursor, :get_text_cursor # Sets the cursor to be used over URLs. # @param cursor [Wx::Cursor] # @return [void] def set_url_cursor(cursor) end alias_method :url_cursor=, :set_url_cursor # Returns the cursor to be used over URLs. # @return [Wx::Cursor] def get_url_cursor; end alias_method :url_cursor, :get_url_cursor # Returns true if we are showing the caret position at the start of a line instead of at the end of the previous one. # @return [true,false] def get_caret_at_line_start; end alias_method :caret_at_line_start, :get_caret_at_line_start # Sets a flag to remember that we are showing the caret position at the start of a line instead of at the end of the previous one. # @param atStart [true,false] # @return [void] def set_caret_at_line_start(atStart) end alias_method :caret_at_line_start=, :set_caret_at_line_start # Returns true if we are extending a selection. # @return [true,false] def get_dragging; end alias_method :dragging, :get_dragging # Sets a flag to remember if we are extending a selection. # @param dragging [true,false] # @return [void] def set_dragging(dragging) end alias_method :dragging=, :set_dragging # Are we trying to start Drag'n'Drop? # @return [true,false] def get_pre_drag; end alias_method :pre_drag, :get_pre_drag # Set if we're trying to start Drag'n'Drop. # @param pd [true,false] # @return [void] def set_pre_drag(pd) end alias_method :pre_drag=, :set_pre_drag # Get the possible Drag'n'Drop start point. # @return [Wx::Point] def get_drag_start_point; end alias_method :drag_start_point, :get_drag_start_point # Set the possible Drag'n'Drop start point. # @param sp [Wx::Point] # @return [void] def set_drag_start_point(sp) end alias_method :drag_start_point=, :set_drag_start_point # Get the possible Drag'n'Drop start time. # @return [Wx::DateTime] def get_drag_start_time; end alias_method :drag_start_time, :get_drag_start_time # Set the possible Drag'n'Drop start time. # @param st [Wx::DateTime] # @return [void] def set_drag_start_time(st) end alias_method :drag_start_time=, :set_drag_start_time # Returns the current context menu. # @return [Wx::Menu] def get_context_menu; end alias_method :context_menu, :get_context_menu # Sets the current context menu. # @param menu [Wx::Menu] # @return [void] def set_context_menu(menu) end alias_method :context_menu=, :set_context_menu # Returns an anchor so we know how to extend the selection. # It's a caret position since it's between two characters. # @return [Integer] def get_selection_anchor; end alias_method :selection_anchor, :get_selection_anchor # Sets an anchor so we know how to extend the selection. # It's a caret position since it's between two characters. # @param anchor [Integer] # @return [void] def set_selection_anchor(anchor) end alias_method :selection_anchor=, :set_selection_anchor # Returns the anchor object if selecting multiple containers. # @return [Wx::RichTextObject] def get_selection_anchor_object; end alias_method :selection_anchor_object, :get_selection_anchor_object # Sets the anchor object if selecting multiple containers. # @param anchor [Wx::RichTextObject] # @return [void] def set_selection_anchor_object(anchor) end alias_method :selection_anchor_object=, :set_selection_anchor_object # @overload get_context_menu_properties_info() # Returns an object that stores information about context menu property item(s), in order to communicate between the context menu event handler and the code that responds to it. # The {Wx::RichTextContextMenuPropertiesInfo} stores one item for each object that could respond to a property-editing event. If objects are nested, several might be editable. # @return [Wx::RichTextContextMenuPropertiesInfo] # @overload get_context_menu_properties_info() # @return [Wx::RichTextContextMenuPropertiesInfo] def get_context_menu_properties_info(*args) end alias_method :context_menu_properties_info, :get_context_menu_properties_info # Returns the {Wx::RichTextObject} object that currently has the editing focus. # If there are no composite objects, this will be the top-level buffer. # @return [Wx::RichTextParagraphLayoutBox] def get_focus_object; end alias_method :focus_object, :get_focus_object # Setter for m_focusObject. # @param obj [Wx::RichTextParagraphLayoutBox] # @return [void] def store_focus_object(obj) end # Sets the {Wx::RichTextObject} object that currently has the editing focus. # @param obj [Wx::RichTextParagraphLayoutBox] The {Wx::RichTextObject} to set focus on. # @param setCaretPosition [true,false] Optionally set the caret position. # @return [true,false] def set_focus_object(obj, setCaretPosition=true) end alias_method :focus_object=, :set_focus_object # Invalidates the whole buffer to trigger painting later. # @return [void] def invalidate; end # Clears the buffer content, leaving a single empty paragraph. # Cannot be undone. # @return [void] def clear; end # Replaces the content in the specified range with the string specified by value. # @param from [Integer] # @param to [Integer] # @param value [String] # @return [void] def replace(from, to, value) end # Removes the content in the specified range. # @param from [Integer] # @param to [Integer] # @return [void] def remove(from, to) end # Loads content into the control's buffer using the given type. # If the specified type is {Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY}, the type is deduced from the filename extension. # This function looks for a suitable {Wx::RTC::RichTextFileHandler} object. # @param file [String] # @param type [Integer] # @return [true,false] def load_file(file, type=Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY) end # Helper function for {Wx::RTC::RichTextCtrl#load_file}. # Loads content into the control's buffer using the given type. # If the specified type is {Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY}, the type is deduced from the filename extension. # This function looks for a suitable {Wx::RTC::RichTextFileHandler} object. # @param file [String] # @param fileType [Integer] # @return [true,false] def do_load_file(file, fileType) end # Saves the buffer content using the given type. # If the specified type is {Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY}, the type is deduced from the filename extension. # This function looks for a suitable {Wx::RTC::RichTextFileHandler} object. # @param file [String] # @param type [Integer] # @return [true,false] def save_file(file=(''), type=Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY) end # Helper function for {Wx::RTC::RichTextCtrl#save_file}. # Saves the buffer content using the given type. # If the specified type is {Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY}, the type is deduced from the filename extension. # This function looks for a suitable {Wx::RTC::RichTextFileHandler} object. # @param file [String] # @param fileType [Integer] # @return [true,false] def do_save_file(file=(''), fileType=Wx::RTC::RichTextFileType::RICHTEXT_TYPE_ANY) end # Sets flags that change the behaviour of loading or saving. # See the documentation for each handler class to see what flags are relevant for each handler. # @param flags [Integer] # @return [void] def set_handler_flags(flags) end alias_method :handler_flags=, :set_handler_flags # Returns flags that change the behaviour of loading or saving. # See the documentation for each handler class to see what flags are relevant for each handler. # @return [Integer] def get_handler_flags; end alias_method :handler_flags, :get_handler_flags # Marks the buffer as modified. # @return [void] def mark_dirty; end # Sets the buffer's modified status to false, and clears the buffer's command history. # @return [void] def discard_edits; end # @param modified [true,false] # @return [void] def set_modified(modified) end alias_method :modified=, :set_modified # Sets the maximum number of characters that may be entered in a single line text control. # For compatibility only; currently does nothing. # @param len [Integer] # @return [void] def set_max_length(len) end alias_method :max_length=, :set_max_length # Writes text at the current position. # @param text [String] # @return [void] def write_text(text) end # Sets the insertion point to the end of the buffer and writes the text. # @param text [String] # @return [void] def append_text(text) end # @overload get_style(position, style) # Gets the attributes at the given position. # This function gets the combined style - that is, the style you see on the screen as a result of combining base style, paragraph style and character style attributes. # To get the character or paragraph style alone, use {Wx::RTC::RichTextCtrl#get_uncombined_style}. # @param position [Integer] # @param style [Wx::TextAttr] # @return [true,false] # @overload get_style(position, style) # @param position [Integer] # @param style [Wx::RichTextAttr] # @return [true,false] # @overload get_style(position, style, container) # @param position [Integer] # @param style [Wx::RichTextAttr] # @param container [Wx::RichTextParagraphLayoutBox] # @return [true,false] def get_style(*args) end alias_method :style, :get_style # @overload set_style(start, end_, style) # @param start [Integer] # @param end_ [Integer] # @param style [Wx::RichTextAttr] # @return [true,false] # @overload set_style(range, style) # @param range [Range] # @param style [Wx::RichTextAttr] # @return [true,false] def set_style(*args) end # @overload get_style_for_range(range, style) # @param range [Range] # @param style [Wx::RichTextAttr] # @return [true,false] # @overload get_style_for_range(range, style, container) # @param range [Range] # @param style [Wx::RichTextAttr] # @param container [Wx::RichTextParagraphLayoutBox] # @return [true,false] def get_style_for_range(*args) end alias_method :style_for_range, :get_style_for_range # Sets the attributes for the given range, passing flags to determine how the attributes are set. # The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the style for a character at position 5, use the range (5,6). # flags may contain a bit list of the following values: # - {Wx::RTC::RICHTEXT_SETSTYLE_NONE}: no style flag.- {Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO}: specifies that this operation should be undoable.- {Wx::RTC::RICHTEXT_SETSTYLE_OPTIMIZE}: specifies that the style should not be applied if the combined style at this point is already the style in question.- {Wx::RTC::RICHTEXT_SETSTYLE_PARAGRAPHS_ONLY}: specifies that the style should only be applied to paragraphs, and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.- {Wx::RTC::RICHTEXT_SETSTYLE_CHARACTERS_ONLY}: specifies that the style should only be applied to characters, and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.- {Wx::RTC::RICHTEXT_SETSTYLE_RESET}: resets (clears) the existing style before applying the new style.- {Wx::RTC::RICHTEXT_SETSTYLE_REMOVE}: removes the specified style. Only the style flags are used in this operation. # @param range [Range] # @param style [Wx::RichTextAttr] # @param flags [Integer] # @return [true,false] def set_style_ex(range, style, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO) end # @overload get_uncombined_style(position, style) # Gets the attributes at the given position. # This function gets the uncombined style - that is, the attributes associated with the paragraph or character content, and not necessarily the combined attributes you see on the screen. To get the combined attributes, use {Wx::RTC::RichTextCtrl#get_style}. # If you specify (any) paragraph attribute in style's flags, this function will fetch the paragraph attributes. Otherwise, it will return the character attributes. # @param position [Integer] # @param style [Wx::RichTextAttr] # @return [true,false] # @overload get_uncombined_style(position, style, container) # @param position [Integer] # @param style [Wx::RichTextAttr] # @param container [Wx::RichTextParagraphLayoutBox] # @return [true,false] def get_uncombined_style(*args) end alias_method :uncombined_style, :get_uncombined_style # @overload set_default_style(style) # Sets the current default style, which can be used to change how subsequently inserted text is displayed. # @param style [Wx::TextAttr] # @return [true,false] # @overload set_default_style(style) # @param style [Wx::RichTextAttr] # @return [true,false] def set_default_style(*args) end alias_method :default_style=, :set_default_style # Returns the current default style, which can be used to change how subsequently inserted text is displayed. # @return [Wx::RichTextAttr] def get_default_style_ex; end alias_method :default_style_ex, :get_default_style_ex # @param range [Range] # @param defName [String] # @param flags [Integer] # @param startFrom [Integer] # @param specifiedLevel [Integer] # @return [true,false] def set_list_style(range, defName, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) end # Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph. # flags is a bit list of the following: # - {Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO}: specifies that this command will be undoable. # @see Wx::RTC::RichTextCtrl#set_list_style # @see Wx::RTC::RichTextCtrl#promote_list # @see Wx::RTC::RichTextCtrl#number_list. # @param range [Range] # @param flags [Integer] # @return [true,false] def clear_list_style(range, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO) end # @overload number_list(range, def_=nil, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) # Numbers the paragraphs in the given range. # Pass flags to determine how the attributes are set. # Either the style definition or the name of the style definition (in the current sheet) can be passed. # flags is a bit list of the following: # - {Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO}: specifies that this command will be undoable.- {Wx::RTC::RICHTEXT_SETSTYLE_RENUMBER}: specifies that numbering should start from startFrom, otherwise existing attributes are used.- {Wx::RTC::RICHTEXT_SETSTYLE_SPECIFY_LEVEL}: specifies that listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. # @see Wx::RTC::RichTextCtrl#set_list_style # @see Wx::RTC::RichTextCtrl#promote_list # @see Wx::RTC::RichTextCtrl#clear_list_style. # @param range [Range] # @param def_ [Wx::RichTextListStyleDefinition] # @param flags [Integer] # @param startFrom [Integer] # @param specifiedLevel [Integer] # @return [true,false] # @overload number_list(range, defName, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) # @param range [Range] # @param defName [String] # @param flags [Integer] # @param startFrom [Integer] # @param specifiedLevel [Integer] # @return [true,false] def number_list(*args) end # @overload promote_list(promoteBy, range, def_=nil, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO, specifiedLevel=-1) # Promotes or demotes the paragraphs in the given range. # A positive promoteBy produces a smaller indent, and a negative number produces a larger indent. Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. # flags is a bit list of the following: # - {Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO}: specifies that this command will be undoable.- {Wx::RTC::RICHTEXT_SETSTYLE_RENUMBER}: specifies that numbering should start from startFrom, otherwise existing attributes are used.- {Wx::RTC::RICHTEXT_SETSTYLE_SPECIFY_LEVEL}: specifies that listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. # @see Wx::RTC::RichTextCtrl#set_list_style # @see # # @see Wx::RTC::RichTextCtrl#set_list_style # @see Wx::RTC::RichTextCtrl#clear_list_style. # @param promoteBy [Integer] # @param range [Range] # @param def_ [Wx::RichTextListStyleDefinition] # @param flags [Integer] # @param specifiedLevel [Integer] # @return [true,false] # @overload promote_list(promoteBy, range, defName, flags=Wx::RTC::RICHTEXT_SETSTYLE_WITH_UNDO, specifiedLevel=-1) # @param promoteBy [Integer] # @param range [Range] # @param defName [String] # @param flags [Integer] # @param specifiedLevel [Integer] # @return [true,false] def promote_list(*args) end # Sets the properties for the given range, passing flags to determine how the attributes are set. # You can merge properties or replace them. # The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the properties for a character at position 5, use the range (5,6). # flags may contain a bit list of the following values: # - {Wx::RICHTEXT_SETSPROPERTIES_NONE}: no flag.- {Wx::RTC::RICHTEXT_SETPROPERTIES_WITH_UNDO}: specifies that this operation should be undoable.- {Wx::RTC::RICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY}: specifies that the properties should only be applied to paragraphs, and not the content.- {Wx::RTC::RICHTEXT_SETPROPERTIES_CHARACTERS_ONLY}: specifies that the properties should only be applied to characters, and not the paragraph.- {Wx::RTC::RICHTEXT_SETPROPERTIES_RESET}: resets (clears) the existing properties before applying the new properties.- {Wx::RTC::RICHTEXT_SETPROPERTIES_REMOVE}: removes the specified properties. # @param range [Range] # @param properties [Wx::RichTextProperties] # @param flags [Integer] # @return [true,false] def set_properties(range, properties, flags=Wx::RTC::RICHTEXT_SETPROPERTIES_WITH_UNDO) end # Deletes the content within the given range. # @param range [Range] # @return [true,false] def delete(range) end # Translates from column and line number to position. # @param x [Integer] # @param y [Integer] # @return [Integer] def xy_to_position(x, y) end # Converts a text position to zero-based column and line numbers. # @param pos [Integer] # @return [Array(true,false,Integer,Integer)] def position_to_xy(pos) end # Scrolls the buffer so that the given position is in view. # @param pos [Integer] # @return [void] def show_position(pos) end # @param pt [Array(Integer, Integer), Wx::Point] # @return [Array(TextCtrlHitTestResult,Integer,Integer)] def hit_test(pt) end # Finds the container at the given point, which is assumed to be in client coordinates. # @param pt [Wx::Point] # @param position [long] # @param hit [int] # @param hitObj [Wx::RichTextObject] # @param flags [Integer] # @return [Wx::RichTextParagraphLayoutBox] def find_container_at_point(pt, position, hit, hitObj, flags=0) end # Copies the selected content (if any) to the clipboard. # @return [void] def copy; end # Copies the selected content (if any) to the clipboard and deletes the selection. # This is undoable. # @return [void] def cut; end # Pastes content from the clipboard to the buffer. # @return [void] def paste; end # Deletes the content in the selection, if any. # This is undoable. # @return [void] def delete_selection; end # Returns true if selected content can be copied to the clipboard. # @return [true,false] def can_copy; end alias_method :can_copy?, :can_copy # Returns true if selected content can be copied to the clipboard and deleted. # @return [true,false] def can_cut; end alias_method :can_cut?, :can_cut # Returns true if the clipboard content can be pasted to the buffer. # @return [true,false] def can_paste; end alias_method :can_paste?, :can_paste # Returns true if selected content can be deleted. # @return [true,false] def can_delete_selection; end alias_method :can_delete_selection?, :can_delete_selection # Undoes the command at the top of the command history, if there is one. # @return [void] def undo; end # Redoes the current command. # @return [void] def redo_; end # Returns true if there is a command in the command history that can be undone. # @return [true,false] def can_undo; end alias_method :can_undo?, :can_undo # Returns true if there is a command in the command history that can be redone. # @return [true,false] def can_redo; end alias_method :can_redo?, :can_redo # Sets the insertion point and causes the current editing style to be taken from the new position (unlike {Wx::RTC::RichTextCtrl#set_caret_position}). # @param pos [Integer] # @return [void] def set_insertion_point(pos) end alias_method :insertion_point=, :set_insertion_point # Sets the insertion point to the end of the text control. # @return [void] def set_insertion_point_end; end # Returns the current insertion point. # @return [Integer] def get_insertion_point; end alias_method :insertion_point, :get_insertion_point # Returns the last position in the buffer. # @return [Wx::TextPos] def get_last_position; end alias_method :last_position, :get_last_position # @overload set_selection(from, to) # Sets the selection to the given range. # The end point of range is specified as the last character position of the span of text, plus one. # So, for example, to set the selection for a character at position 5, use the range (5,6). # @param from [Integer] # @param to [Integer] # @return [void] # @overload set_selection(sel) # @param sel [Wx::RichTextSelection] # @return [void] def set_selection(*args) end alias_method :selection=, :set_selection # Selects all the text in the buffer. # @return [void] def select_all; end # Makes the control editable, or not. # @param editable [true,false] # @return [void] def set_editable(editable) end alias_method :editable=, :set_editable # Returns true if there is a selection and the object containing the selection was the same as the current focus object. # @return [true,false] def has_selection; end alias_method :has_selection?, :has_selection # Returns true if there was a selection, whether or not the current focus object is the same as the selection's container object. # @return [true,false] def has_unfocused_selection; end alias_method :has_unfocused_selection?, :has_unfocused_selection # @overload write_image(image, bitmapType=Wx::BitmapType::BITMAP_TYPE_PNG, textAttr=(Wx::RichTextAttr.new())) # Write a bitmap or image at the current insertion point. # Supply an optional type to use for internal and file storage of the raw data. # @param image [Wx::Image] # @param bitmapType [BitmapType] # @param textAttr [Wx::RichTextAttr] # @return [true,false] # @overload write_image(bitmap, bitmapType=Wx::BitmapType::BITMAP_TYPE_PNG, textAttr=(Wx::RichTextAttr.new())) # @param bitmap [Wx::Bitmap] # @param bitmapType [BitmapType] # @param textAttr [Wx::RichTextAttr] # @return [true,false] # @overload write_image(filename, bitmapType, textAttr=(Wx::RichTextAttr.new())) # Loads an image from a file and writes it at the current insertion point. # @param filename [String] # @param bitmapType [BitmapType] # @param textAttr [Wx::RichTextAttr] # @return [true,false] # @overload write_image(imageBlock, textAttr=(Wx::RichTextAttr.new())) # Writes an image block at the current insertion point. # @param imageBlock [Wx::RichTextImageBlock] # @param textAttr [Wx::RichTextAttr] # @return [true,false] def write_image(*args) end # Inserts a new paragraph at the current insertion point. # # @see Wx::RTC::RichTextCtrl#line_break. # @return [true,false] def newline; end # Inserts a line break at the current insertion point. # A line break forces wrapping within a paragraph, and can be introduced by using this function, by appending the {Wx::Char} value {Wx::RICH_TEXT_LINE_BREAK_CHAR} to text content, or by typing Shift-Return. # @return [true,false] def line_break; end # Sets the basic (overall) style. # This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). # @param style [Wx::RichTextAttr] # @return [void] def set_basic_style(style) end alias_method :basic_style=, :set_basic_style # Gets the basic (overall) style. # This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). # @return [Wx::RichTextAttr] def get_basic_style; end alias_method :basic_style, :get_basic_style # Begins applying a style. # @param style [Wx::RichTextAttr] # @return [true,false] def begin_style(style) end # Ends the current style. # @return [true,false] def end_style; end # Ends application of all styles in the current style stack. # @return [true,false] def end_all_styles; end # Begins using bold. # @return [true,false] def begin_bold; end # Ends using bold. # @return [true,false] def end_bold; end # Begins using italic. # @return [true,false] def begin_italic; end # Ends using italic. # @return [true,false] def end_italic; end # Begins using underlining. # @return [true,false] def begin_underline; end # End applying underlining. # @return [true,false] def end_underline; end # Begins using the given point size. # @param pointSize [Integer] # @return [true,false] def begin_font_size(pointSize) end # Ends using a point size. # @return [true,false] def end_font_size; end # Begins using this font. # @param font [Wx::Font,Wx::FontInfo] # @return [true,false] def begin_font(font) end # Ends using a font. # @return [true,false] def end_font; end # Begins using this colour. # @param colour [Wx::Colour,String,Symbol] # @return [true,false] def begin_text_colour(colour) end # Ends applying a text colour. # @return [true,false] def end_text_colour; end # Begins using alignment. # For alignment values, see {Wx::TextAttr}. # @param alignment [TextAttrAlignment] # @return [true,false] def begin_alignment(alignment) end # Ends alignment. # @return [true,false] def end_alignment; end # Begins applying a left indent and subindent in tenths of a millimetre. # The subindent is an offset from the left edge of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented to the right of the subsequent lines. # {Wx::RTC::RichTextBuffer} uses indentation to render a bulleted item. The content of the paragraph, including the first line, starts at the leftIndent plus the leftSubIndent. # @param leftIndent [Integer] The distance between the margin and the bullet. # @param leftSubIndent [Integer] The distance between the left edge of the bullet and the left edge of the actual paragraph. # @return [true,false] def begin_left_indent(leftIndent, leftSubIndent=0) end # Ends left indent. # @return [true,false] def end_left_indent; end # Begins a right indent, specified in tenths of a millimetre. # @param rightIndent [Integer] # @return [true,false] def begin_right_indent(rightIndent) end # Ends right indent. # @return [true,false] def end_right_indent; end # Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre. # @param before [Integer] # @param after [Integer] # @return [true,false] def begin_paragraph_spacing(before, after) end # Ends paragraph spacing. # @return [true,false] def end_paragraph_spacing; end # Begins applying line spacing. # spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing. # The {Wx::TextAttrLineSpacing} constants are defined for convenience. # @param lineSpacing [Integer] # @return [true,false] def begin_line_spacing(lineSpacing) end # Ends line spacing. # @return [true,false] def end_line_spacing; end # Begins a numbered bullet. # This call will be needed for each item in the list, and the application should take care of incrementing the numbering. # bulletNumber is a number, usually starting with 1. leftIndent and leftSubIndent are values in tenths of a millimetre. bulletStyle is a bitlist of the {Wx::TextAttrBulletStyle} values. # {Wx::RTC::RichTextBuffer} uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent. # @param bulletNumber [Integer] # @param leftIndent [Integer] # @param leftSubIndent [Integer] # @param bulletStyle [Integer] # @return [true,false] def begin_numbered_bullet(bulletNumber, leftIndent, leftSubIndent, bulletStyle=(Wx::TextAttrBulletStyle::TEXT_ATTR_BULLET_STYLE_ARABIC|Wx::TextAttrBulletStyle::TEXT_ATTR_BULLET_STYLE_PERIOD)) end # Ends application of a numbered bullet. # @return [true,false] def end_numbered_bullet; end # Begins applying a symbol bullet, using a character from the current font. # See {Wx::RTC::RichTextCtrl#begin_numbered_bullet} for an explanation of how indentation is used to render the bulleted paragraph. # @param symbol [String] # @param leftIndent [Integer] # @param leftSubIndent [Integer] # @param bulletStyle [Integer] # @return [true,false] def begin_symbol_bullet(symbol, leftIndent, leftSubIndent, bulletStyle=Wx::TextAttrBulletStyle::TEXT_ATTR_BULLET_STYLE_SYMBOL) end # Ends applying a symbol bullet. # @return [true,false] def end_symbol_bullet; end # Begins applying a symbol bullet. # @param bulletName [String] # @param leftIndent [Integer] # @param leftSubIndent [Integer] # @param bulletStyle [Integer] # @return [true,false] def begin_standard_bullet(bulletName, leftIndent, leftSubIndent, bulletStyle=Wx::TextAttrBulletStyle::TEXT_ATTR_BULLET_STYLE_STANDARD) end # Begins applying a standard bullet. # @return [true,false] def end_standard_bullet; end # Begins using the named character style. # @param characterStyle [String] # @return [true,false] def begin_character_style(characterStyle) end # Ends application of a named character style. # @return [true,false] def end_character_style; end # Begins applying the named paragraph style. # @param paragraphStyle [String] # @return [true,false] def begin_paragraph_style(paragraphStyle) end # Ends application of a named paragraph style. # @return [true,false] def end_paragraph_style; end # Begins using a specified list style. # Optionally, you can also pass a level and a number. # @param listStyle [String] # @param level [Integer] # @param number [Integer] # @return [true,false] def begin_list_style(listStyle, level=1, number=1) end # Ends using a specified list style. # @return [true,false] def end_list_style; end # Begins applying {Wx::TextAttrFlags::TEXT_ATTR_URL} to the content. # Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining. # @param url [String] # @param characterStyle [String] # @return [true,false] def begin_url(url, characterStyle=('')) end # Ends applying a URL. # @return [true,false] def end_url; end # Sets the default style to the style under the cursor. # @return [true,false] def set_default_style_to_cursor_style; end # Cancels any selection. # @return [void] def select_none; end # Selects the word at the given character position. # @param position [Integer] # @return [true,false] def select_word(position) end # Returns the selection range in character positions. # -1, -1 means no selection. # The range is in API convention, i.e. a single character selection is denoted by (n, n+1) # @return [Range] def get_selection_range; end alias_method :selection_range, :get_selection_range # Sets the selection to the given range. # The end point of range is specified as the last character position of the span of text, plus one. # So, for example, to set the selection for a character at position 5, use the range (5,6). # @param range [Range] # @return [void] def set_selection_range(range) end alias_method :selection_range=, :set_selection_range # Returns the selection range in character positions. # -2, -2 means no selection -1, -1 means select everything. The range is in internal format, i.e. a single character selection is denoted by (n, n) # @return [Range] def get_internal_selection_range; end alias_method :internal_selection_range, :get_internal_selection_range # Sets the selection range in character positions. # -2, -2 means no selection -1, -1 means select everything. The range is in internal format, i.e. a single character selection is denoted by (n, n) # @param range [Range] # @return [void] def set_internal_selection_range(range) end alias_method :internal_selection_range=, :set_internal_selection_range # Adds a new paragraph of text to the end of the buffer. # @param text [String] # @return [Range] def add_paragraph(text) end # Adds an image to the control's buffer. # @param image [Wx::Image] # @return [Range] def add_image(image) end # Lays out the buffer, which must be done before certain operations, such as setting the caret position. # This function should not normally be required by the application. # @param onlyVisibleRect [true,false] # @return [true,false] def layout_content(onlyVisibleRect=false) end # Implements layout. # An application may override this to perform operations before or after layout. # @param buffer [Wx::RichTextBuffer] # @param dc [Wx::DC] # @param context [Wx::RichTextDrawingContext] # @param rect [Wx::Rect] # @param parentRect [Wx::Rect] # @param flags [Integer] # @return [void] def do_layout_buffer(buffer, dc, context, rect, parentRect, flags) end # Move the caret to the given character position. # Please note that this does not update the current editing style from the new position; to do that, call {Wx::RTC::RichTextCtrl#set_insertion_point} instead. # @param pos [Integer] # @param showAtLineStart [true,false] # @param container [Wx::RichTextParagraphLayoutBox] # @return [true,false] def move_caret(pos, showAtLineStart=false, container=nil) end # Moves right. # @param noPositions [Integer] # @param flags [Integer] # @return [true,false] def move_right(noPositions=1, flags=0) end # Moves left. # @param noPositions [Integer] # @param flags [Integer] # @return [true,false] def move_left(noPositions=1, flags=0) end # Moves to the start of the paragraph. # @param noLines [Integer] # @param flags [Integer] # @return [true,false] def move_up(noLines=1, flags=0) end # Moves the caret down. # @param noLines [Integer] # @param flags [Integer] # @return [true,false] def move_down(noLines=1, flags=0) end # Moves to the end of the line. # @param flags [Integer] # @return [true,false] def move_to_line_end(flags=0) end # Moves to the start of the line. # @param flags [Integer] # @return [true,false] def move_to_line_start(flags=0) end # Moves to the end of the paragraph. # @param flags [Integer] # @return [true,false] def move_to_paragraph_end(flags=0) end # Moves to the start of the paragraph. # @param flags [Integer] # @return [true,false] def move_to_paragraph_start(flags=0) end # Moves to the start of the buffer. # @param flags [Integer] # @return [true,false] def move_home(flags=0) end # Moves to the end of the buffer. # @param flags [Integer] # @return [true,false] def move_end(flags=0) end # Moves one or more pages up. # @param noPages [Integer] # @param flags [Integer] # @return [true,false] def page_up(noPages=1, flags=0) end # Moves one or more pages down. # @param noPages [Integer] # @param flags [Integer] # @return [true,false] def page_down(noPages=1, flags=0) end # Moves a number of words to the left. # @param noPages [Integer] # @param flags [Integer] # @return [true,false] def word_left(noPages=1, flags=0) end # Move a number of words to the right. # @param noPages [Integer] # @param flags [Integer] # @return [true,false] def word_right(noPages=1, flags=0) end # @overload get_buffer() # Returns the buffer associated with the control. # @return [Wx::RichTextBuffer] # @overload get_buffer() # @return [Wx::RichTextBuffer] def get_buffer(*args) end alias_method :buffer, :get_buffer # Starts batching undo history for commands. # @param cmdName [String] # @return [true,false] def begin_batch_undo(cmdName) end # Ends batching undo command history. # @return [true,false] def end_batch_undo; end # Returns true if undo commands are being batched. # @return [true,false] def batching_undo; end # Starts suppressing undo history for commands. # @return [true,false] def begin_suppress_undo; end # Ends suppressing undo command history. # @return [true,false] def end_suppress_undo; end # Returns true if undo history suppression is on. # @return [true,false] def suppressing_undo; end # Test if this whole range has character attributes of the specified kind. # If any of the attributes are different within the range, the test fails. # You can use this to implement, for example, bold button updating. style must have flags indicating which attributes are of interest. # @param range [Range] # @param style [Wx::RichTextAttr] # @return [true,false] def has_character_attributes(range, style) end alias_method :has_character_attributes?, :has_character_attributes # Test if this whole range has paragraph attributes of the specified kind. # If any of the attributes are different within the range, the test fails. You can use this to implement, for example, centering button updating. style must have flags indicating which attributes are of interest. # @param range [Range] # @param style [Wx::RichTextAttr] # @return [true,false] def has_paragraph_attributes(range, style) end alias_method :has_paragraph_attributes?, :has_paragraph_attributes # Returns true if all of the selection, or the content at the caret position, is bold. # @return [true,false] def is_selection_bold; end alias_method :selection_bold?, :is_selection_bold # Returns true if all of the selection, or the content at the caret position, is italic. # @return [true,false] def is_selection_italics; end alias_method :selection_italics?, :is_selection_italics # Returns true if all of the selection, or the content at the caret position, is underlined. # @return [true,false] def is_selection_underlined; end alias_method :selection_underlined?, :is_selection_underlined # Returns true if all of the selection, or the content at the current caret position, has the supplied {Wx::TextAttrEffects} flag(s). # @param flag [Integer] # @return [true,false] def does_selection_have_text_effect_flag(flag) end # Returns true if all of the selection is aligned according to the specified flag. # @param alignment [TextAttrAlignment] # @return [true,false] def is_selection_aligned(alignment) end alias_method :selection_aligned?, :is_selection_aligned # Apples bold to the selection or the default style (undoable). # @return [true,false] def apply_bold_to_selection; end # Applies italic to the selection or the default style (undoable). # @return [true,false] def apply_italic_to_selection; end # Applies underline to the selection or the default style (undoable). # @return [true,false] def apply_underline_to_selection; end # Applies one or more {Wx::TextAttrEffects} flags to the selection (undoable). # If there is no selection, it is applied to the default style. # @param flags [Integer] # @return [true,false] def apply_text_effect_to_selection(flags) end # Applies the given alignment to the selection or the default style (undoable). # For alignment values, see {Wx::TextAttr}. # @param alignment [TextAttrAlignment] # @return [true,false] def apply_alignment_to_selection(alignment) end # Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles in the buffer. # This might be useful if the styles have changed. If sheet is NULL, the sheet set with {Wx::RTC::RichTextCtrl#set_style_sheet} is used. Currently this applies paragraph styles only. # @param def_ [Wx::RichTextStyleDefinition] # @return [true,false] def apply_style(def_) end # Sets the style sheet associated with the control. # A style sheet allows named character and paragraph styles to be applied. # @param styleSheet [Wx::RichTextStyleSheet] # @return [void] def set_style_sheet(styleSheet) end alias_method :style_sheet=, :set_style_sheet # Returns the style sheet associated with the control, if any. # A style sheet allows named character and paragraph styles to be applied. # @return [Wx::RichTextStyleSheet] def get_style_sheet; end alias_method :style_sheet, :get_style_sheet # Push the style sheet to top of stack. # @param styleSheet [Wx::RichTextStyleSheet] # @return [true,false] def push_style_sheet(styleSheet) end # Pops the style sheet from top of stack. # @return [Wx::RichTextStyleSheet] def pop_style_sheet; end # Applies the style sheet to the buffer, for example if the styles have changed. # @param styleSheet [Wx::RichTextStyleSheet] # @return [true,false] def apply_style_sheet(styleSheet=nil) end # Shows the given context menu, optionally adding appropriate property-editing commands for the current position in the object hierarchy. # @param menu [Wx::Menu] # @param pt [Array(Integer, Integer), Wx::Point] # @param addPropertyCommands [true,false] # @return [true,false] def show_context_menu(menu, pt, addPropertyCommands) end # Prepares the context menu, optionally adding appropriate property-editing commands. # Returns the number of property commands added. # @param menu [Wx::Menu] # @param pt [Array(Integer, Integer), Wx::Point] # @param addPropertyCommands [true,false] # @return [Integer] def prepare_context_menu(menu, pt, addPropertyCommands) end # Returns true if we can edit the object's properties via a GUI. # @param obj [Wx::RichTextObject] # @return [true,false] def can_edit_properties(obj) end alias_method :can_edit_properties?, :can_edit_properties # Edits the object's properties via a GUI. # @param obj [Wx::RichTextObject] # @param parent [Wx::Window] # @return [true,false] def edit_properties(obj, parent) end # Gets the object's properties menu label. # @param obj [Wx::RichTextObject] # @return [String] def get_properties_menu_label(obj) end alias_method :properties_menu_label, :get_properties_menu_label # Prepares the content just before insertion (or after buffer reset). # Called by the same function in {Wx::RTC::RichTextBuffer}. Currently is only called if undo mode is on. # @param container [Wx::RichTextParagraphLayoutBox] # @return [void] def prepare_content(container) end # Can we delete this range? Sends an event to the control. # @param container [Wx::RichTextParagraphLayoutBox] # @param range [Range] # @return [true,false] def can_delete_range(container, range) end alias_method :can_delete_range?, :can_delete_range # Can we insert content at this position? Sends an event to the control. # @param container [Wx::RichTextParagraphLayoutBox] # @param pos [Integer] # @return [true,false] def can_insert_content(container, pos) end alias_method :can_insert_content?, :can_insert_content # Enable or disable the vertical scrollbar. # @param enable [true,false] # @return [void] def enable_vertical_scrollbar(enable) end # Returns true if the vertical scrollbar is enabled. # @return [true,false] def get_vertical_scrollbar_enabled; end alias_method :vertical_scrollbar_enabled, :get_vertical_scrollbar_enabled # Sets the scale factor for displaying fonts, for example for more comfortable editing. # @param fontScale [Float] # @param refresh [true,false] # @return [void] def set_font_scale(fontScale, refresh=false) end alias_method :font_scale=, :set_font_scale # Returns the scale factor for displaying fonts, for example for more comfortable editing. # @return [Float] def get_font_scale; end alias_method :font_scale, :get_font_scale # Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing. # This can be useful when editing in a small control where you still want legible text, but a minimum of wasted white space. # @param dimScale [Float] # @param refresh [true,false] # @return [void] def set_dimension_scale(dimScale, refresh=false) end alias_method :dimension_scale=, :set_dimension_scale # Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing. # @return [Float] def get_dimension_scale; end alias_method :dimension_scale, :get_dimension_scale # Sets an overall scale factor for displaying and editing the content. # @param scale [Float] # @param refresh [true,false] # @return [void] def set_scale(scale, refresh=false) end alias_method :scale=, :set_scale # Returns an overall scale factor for displaying and editing the content. # @return [Float] def get_scale; end alias_method :scale, :get_scale # Returns an unscaled point. # @param pt [Array(Integer, Integer), Wx::Point] # @return [Wx::Point] def get_unscaled_point(pt) end alias_method :unscaled_point, :get_unscaled_point # Returns a scaled point. # @param pt [Array(Integer, Integer), Wx::Point] # @return [Wx::Point] def get_scaled_point(pt) end alias_method :scaled_point, :get_scaled_point # Returns an unscaled size. # @param sz [Array(Integer, Integer), Wx::Size] # @return [Wx::Size] def get_unscaled_size(sz) end alias_method :unscaled_size, :get_unscaled_size # Returns a scaled size. # @param sz [Array(Integer, Integer), Wx::Size] # @return [Wx::Size] def get_scaled_size(sz) end alias_method :scaled_size, :get_scaled_size # Returns an unscaled rectangle. # @param rect [Wx::Rect] # @return [Wx::Rect] def get_unscaled_rect(rect) end alias_method :unscaled_rect, :get_unscaled_rect # Returns a scaled rectangle. # @param rect [Wx::Rect] # @return [Wx::Rect] def get_scaled_rect(rect) end alias_method :scaled_rect, :get_scaled_rect # Returns true if this control can use virtual attributes and virtual text. # The default is false. # @return [true,false] def get_virtual_attributes_enabled; end alias_method :virtual_attributes_enabled, :get_virtual_attributes_enabled # Pass true to let the control use virtual attributes. # The default is false. # @param b [true,false] # @return [void] def enable_virtual_attributes(b) end # Sends the event to the control. # @param event [Wx::CommandEvent] # @return [void] def command(event) end # Loads the first dropped file. # @param event [Wx::DropFilesEvent] # @return [void] def on_drop_files(event) end # @param event [Wx::MouseCaptureLostEvent] # @return [void] def on_capture_lost(event) end # @param event [Wx::SysColourChangedEvent] # @return [void] def on_sys_colour_changed(event) end # Standard handler for the {Wx::StandardID::ID_CUT} command. # @param event [Wx::CommandEvent] # @return [void] def on_cut(event) end # Standard handler for the {Wx::StandardID::ID_COPY} command. # @param event [Wx::CommandEvent] # @return [void] def on_copy(event) end # Standard handler for the {Wx::StandardID::ID_PASTE} command. # @param event [Wx::CommandEvent] # @return [void] def on_paste(event) end # Standard handler for the {Wx::StandardID::ID_UNDO} command. # @param event [Wx::CommandEvent] # @return [void] def on_undo(event) end # Standard handler for the {Wx::StandardID::ID_REDO} command. # @param event [Wx::CommandEvent] # @return [void] def on_redo(event) end # Standard handler for the {Wx::StandardID::ID_SELECTALL} command. # @param event [Wx::CommandEvent] # @return [void] def on_select_all(event) end # Standard handler for property commands. # @param event [Wx::CommandEvent] # @return [void] def on_properties(event) end # Standard handler for the {Wx::StandardID::ID_CLEAR} command. # @param event [Wx::CommandEvent] # @return [void] def on_clear(event) end # Standard update handler for the {Wx::StandardID::ID_CUT} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_cut(event) end # Standard update handler for the {Wx::StandardID::ID_COPY} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_copy(event) end # Standard update handler for the {Wx::StandardID::ID_PASTE} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_paste(event) end # Standard update handler for the {Wx::StandardID::ID_UNDO} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_undo(event) end # Standard update handler for the {Wx::StandardID::ID_REDO} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_redo(event) end # Standard update handler for the {Wx::StandardID::ID_SELECTALL} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_select_all(event) end # Standard update handler for property commands. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_properties(event) end # Standard update handler for the {Wx::StandardID::ID_CLEAR} command. # @param event [Wx::UpdateUIEvent] # @return [void] def on_update_clear(event) end # Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands. # @param event [Wx::ContextMenuEvent] # @return [void] def on_context_menu(event) end # @param event [Wx::PaintEvent] # @return [void] def on_paint(event) end # @param event [Wx::EraseEvent] # @return [void] def on_erase_background(event) end # @param event [Wx::MouseEvent] # @return [void] def on_left_click(event) end # @param event [Wx::MouseEvent] # @return [void] def on_left_up(event) end # @param event [Wx::MouseEvent] # @return [void] def on_move_mouse(event) end # @param event [Wx::MouseEvent] # @return [void] def on_left_d_click(event) end # @param event [Wx::MouseEvent] # @return [void] def on_middle_click(event) end # @param event [Wx::MouseEvent] # @return [void] def on_right_click(event) end # @param event [Wx::KeyEvent] # @return [void] def on_char(event) end # @param event [Wx::SizeEvent] # @return [void] def on_size(event) end # @param event [Wx::FocusEvent] # @return [void] def on_set_focus(event) end # @param event [Wx::FocusEvent] # @return [void] def on_kill_focus(event) end # @param event [Wx::IdleEvent] # @return [void] def on_idle(event) end # @param event [Wx::ScrollWinEvent] # @return [void] def on_scroll(event) end # Sets the font, and also the basic and default attributes (see {Wx::RTC::RichTextCtrl#set_default_style}). # @param font [Wx::Font,Wx::FontInfo] # @return [true,false] def set_font(font) end alias_method :font=, :set_font # A helper function setting up scrollbars, for example after a resize. # @param atTop [true,false] # @return [void] def setup_scrollbars(atTop=false) end # Helper function implementing keyboard navigation. # @param keyCode [Integer] # @param flags [Integer] # @return [true,false] def keyboard_navigate(keyCode, flags) end # @param value [String] # @param flags [Integer] # @return [void] def do_write_text(value, flags=0) end # Return true from here to allow the colours of this window to be changed by {Wx::RTC::RichTextCtrl#inherit_attributes}. # Returning false forbids inheriting them from the parent window. # The base class version returns false, but this method is overridden in {Wx::Control} where it returns true. # @return [true,false] def should_inherit_colours; end # Internal function to position the visible caret according to the current caret position. # @param container [Wx::RichTextParagraphLayoutBox] # @return [void] def position_caret(container=nil) end # Helper function for extending the selection, returning true if the selection was changed. # Selections are in caret positions. # @param oldPosition [Integer] # @param newPosition [Integer] # @param flags [Integer] # @return [true,false] def extend_selection(oldPosition, newPosition, flags) end # Extends a table selection in the given direction. # @param table [Wx::RichTextTable] # @param noRowSteps [Integer] # @param noColSteps [Integer] # @return [true,false] def extend_cell_selection(table, noRowSteps, noColSteps) end # Starts selecting table cells. # @param table [Wx::RichTextTable] # @param newCell [Wx::RichTextParagraphLayoutBox] # @return [true,false] def start_cell_selection(table, newCell) end # Scrolls position into view. # This function takes a caret position. # @param position [Integer] # @param keyCode [Integer] # @return [true,false] def scroll_into_view(position, keyCode) end # Refreshes the area affected by a selection change. # @param oldSelection [Wx::RichTextSelection] # @param newSelection [Wx::RichTextSelection] # @return [true,false] def refresh_for_selection_change(oldSelection, newSelection) end # Sets the caret position. # The caret position is the character position just before the caret. A value of -1 means the caret is at the start of the buffer. Please note that this does not update the current editing style from the new position or cause the actual caret to be refreshed; to do that, call {Wx::RTC::RichTextCtrl#set_insertion_point} instead. # @param position [Integer] # @param showAtLineStart [true,false] # @return [void] def set_caret_position(position, showAtLineStart=false) end alias_method :caret_position=, :set_caret_position # Returns the current caret position. # @return [Integer] def get_caret_position; end alias_method :caret_position, :get_caret_position # The adjusted caret position is the character position adjusted to take into account whether we're at the start of a paragraph, in which case style information should be taken from the next position, not current one. # @param caretPos [Integer] # @return [Integer] def get_adjusted_caret_position(caretPos) end alias_method :adjusted_caret_position, :get_adjusted_caret_position # Move the caret one visual step forward: this may mean setting a flag and keeping the same position if we're going from the end of one line to the start of the next, which may be the exact same caret position. # @param oldPosition [Integer] # @return [void] def move_caret_forward(oldPosition) end # Move the caret one visual step forward: this may mean setting a flag and keeping the same position if we're going from the end of one line to the start of the next, which may be the exact same caret position. # @param oldPosition [Integer] # @return [void] def move_caret_back(oldPosition) end # Returns the caret height and position for the given character position. # If container is null, the current focus object will be used. # @param position [Integer] # @param rect [Wx::Rect] # @param container [Wx::RichTextParagraphLayoutBox] # @return [true,false] def get_caret_position_for_index(position, rect, container=nil) end alias_method :caret_position_for_index, :get_caret_position_for_index # Internal helper function returning the line for the visible caret position. # If the caret is shown at the very end of the line, it means the next character is actually on the following line. So this function gets the line we're expecting to find if this is the case. # @param caretPosition [Integer] # @return [Wx::RichTextLine] def get_visible_line_for_caret_position(caretPosition) end alias_method :visible_line_for_caret_position, :get_visible_line_for_caret_position # Gets the command processor associated with the control's buffer. # @return [Wx::CommandProcessor] def get_command_processor; end alias_method :command_processor, :get_command_processor # Deletes content if there is a selection, e.g. # when pressing a key. Returns the new caret position in newPos, or leaves it if there was no action. This is undoable. # @return [Array(true,false,Integer)] def delete_selected_content; end # Transforms logical (unscrolled) position to physical window position. # @param ptLogical [Array(Integer, Integer), Wx::Point] # @return [Wx::Point] def get_physical_point(ptLogical) end alias_method :physical_point, :get_physical_point # Transforms physical window position to logical (unscrolled) position. # @param ptPhysical [Array(Integer, Integer), Wx::Point] # @return [Wx::Point] def get_logical_point(ptPhysical) end alias_method :logical_point, :get_logical_point # Helper function for finding the caret position for the next word. # Direction is 1 (forward) or -1 (backwards). # @param direction [Integer] # @return [Integer] def find_next_word_position(direction=1) end # Returns true if the given position is visible on the screen. # @param pos [Integer] # @return [true,false] def is_position_visible(pos) end alias_method :position_visible?, :is_position_visible # Returns the first visible position in the current view. # @return [Integer] def get_first_visible_position; end alias_method :first_visible_position, :get_first_visible_position # Enable or disable images. # @param b [true,false] # @return [void] def enable_images(b) end # Returns true if images are enabled. # @return [true,false] def get_images_enabled; end alias_method :images_enabled, :get_images_enabled # Enable or disable delayed image loading. # @param b [true,false] # @return [void] def enable_delayed_image_loading(b) end # Returns true if delayed image loading is enabled. # @return [true,false] def get_delayed_image_loading; end alias_method :delayed_image_loading, :get_delayed_image_loading # Gets the flag indicating that delayed image processing is required. # @return [true,false] def get_delayed_image_processing_required; end alias_method :delayed_image_processing_required, :get_delayed_image_processing_required # Sets the flag indicating that delayed image processing is required. # @param b [true,false] # @return [void] def set_delayed_image_processing_required(b) end alias_method :delayed_image_processing_required=, :set_delayed_image_processing_required # Returns the last time delayed image processing was performed. # @return [Wx::LongLong] def get_delayed_image_processing_time; end alias_method :delayed_image_processing_time, :get_delayed_image_processing_time # Sets the last time delayed image processing was performed. # @param t [Wx::LongLong] # @return [void] def set_delayed_image_processing_time(t) end alias_method :delayed_image_processing_time=, :set_delayed_image_processing_time # Returns the caret position since the default formatting was changed. # As soon as this position changes, we no longer reflect the default style in the UI. A value of -2 means that we should only reflect the style of the content under the caret. # @return [Integer] def get_caret_position_for_default_style; end alias_method :caret_position_for_default_style, :get_caret_position_for_default_style # Set the caret position for the default style that the user is selecting. # @param pos [Integer] # @return [void] def set_caret_position_for_default_style(pos) end alias_method :caret_position_for_default_style=, :set_caret_position_for_default_style # Returns true if the user has recently set the default style without moving the caret, and therefore the UI needs to reflect the default style and not the style at the caret. # Below is an example of code that uses this function to determine whether the UI should show that the current style is bold. # @see Wx::RTC::RichTextCtrl#set_and_show_default_style. # @return [true,false] def is_default_style_showing; end alias_method :default_style_showing?, :is_default_style_showing # Sets attr as the default style and tells the control that the UI should reflect this attribute until the user moves the caret. # # @see Wx::RTC::RichTextCtrl#is_default_style_showing. # @param attr [Wx::RichTextAttr] # @return [void] def set_and_show_default_style(attr) end alias_method :and_show_default_style=, :set_and_show_default_style # Returns the first visible point in the window. # @return [Wx::Point] def get_first_visible_point; end alias_method :first_visible_point, :get_first_visible_point # Returns the content of the entire control as a string. # @return [String] def get_value; end alias_method :value, :get_value # Replaces existing content with the given text. # @param value [String] # @return [void] def set_value(value) end alias_method :value=, :set_value # Processes the back key. # @param event [Wx::KeyEvent] # @param flags [Integer] # @return [true,false] def process_back_key(event, flags) end # Given a character position at which there is a list style, find the range encompassing the same list style by looking backwards and forwards. # @param pos [Integer] # @param isNumberedList [bool] # @return [Range] def find_range_for_list(pos, isNumberedList) end # Sets up the caret for the given position and container, after a mouse click. # @param container [Wx::RichTextParagraphLayoutBox] # @param position [Integer] # @param hitTestFlags [Integer] # @param extendSelection [true,false] # @return [true,false] def set_caret_position_after_click(container, position, hitTestFlags, extendSelection=false) end # Find the caret position for the combination of hit-test flags and character position. # Returns the caret position and also an indication of where to place the caret (caretLineStart) since this is ambiguous (same position used for end of line and start of next). # @param position [Integer] # @param hitTestFlags [Integer] # @param container [Wx::RichTextParagraphLayoutBox] # @param caretLineStart [bool] # @return [Integer] def find_caret_position_for_character_position(position, hitTestFlags, container, caretLineStart) end # Processes mouse movement in order to change the cursor. # @param container [Wx::RichTextParagraphLayoutBox] # @param obj [Wx::RichTextObject] # @param position [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @return [true,false] def process_mouse_movement(container, obj, position, pos) end # @return [String] def do_get_value; end # @overload process_delayed_image_loading(refresh) # Do delayed image loading and garbage-collect other images. # @param refresh [true,false] # @return [true,false] # @overload process_delayed_image_loading(screenRect, box, loadCount) # @param screenRect [Wx::Rect] # @param box [Wx::RichTextParagraphLayoutBox] # @param loadCount [int] # @return [true,false] def process_delayed_image_loading(*args) end # Request delayed image processing. # @return [void] def request_delayed_image_processing; end # Respond to timer events. # @param event [Wx::TimerEvent] # @return [void] def on_timer(event) end # Font names take a long time to retrieve, so cache them (on demand). # @return [Wx::ArrayString] def self.get_available_font_names; end # Clears the cache of available font names. # @return [void] def self.clear_available_font_names; end end # RichTextCtrl end