Class: Wx::RTC::RichTextFieldType
- Defined in:
- lib/wx/doc/gen/rtc/rich_text_buffer.rb
Overview
The base class for custom field types.
Each type definition handles one field type. Override functions to provide drawing, layout, updating and property editing functionality for a field. Register field types on application initialisation with the static function Wx::RTC::RichTextBuffer.add_field_type. They will be deleted automatically on application exit.
Category: Rich Text
Direct Known Subclasses
Instance Method Summary collapse
-
#can_edit_properties(obj) ⇒ Boolean
(also: #can_edit_properties?)
Returns true if we can edit the object’s properties via a GUI.
- #copy(fieldType) ⇒ void
-
#draw(obj, dc, context, range, selection, rect, descent, style) ⇒ Boolean
Draw the item, within the given range.
-
#edit_properties(obj, parent, buffer) ⇒ Boolean
Edits the object’s properties via a GUI.
-
#get_name ⇒ String
(also: #name)
Returns the field type name.
-
#get_properties_menu_label(obj) ⇒ String
(also: #properties_menu_label)
Returns the label to be used for the properties context menu item.
-
#get_range_size(obj, range, size, descent, dc, context, flags, position = (Wx::Point.new(0, 0)), parentSize = Wx::DEFAULT_SIZE, partialExtents = nil) ⇒ Array(Boolean,Integer)
(also: #range_size)
Returns the object size for the given range.
-
#initialize(*args) ⇒ RichTextFieldType
constructor
A new instance of RichTextFieldType.
-
#is_top_level(obj) ⇒ Boolean
(also: #top_level?)
Returns true if this object is top-level, i.e.
-
#layout(obj, dc, context, rect, parentRect, style) ⇒ Boolean
Lay the item out at the specified position with the given size constraint.
-
#set_name(name) ⇒ void
(also: #name=)
Sets the field type name.
-
#update_field(buffer, obj) ⇒ Boolean
Update the field.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(name = ('')) ⇒ Wx::RTC::RichTextFieldType #initialize(fieldType) ⇒ Wx::RTC::RichTextFieldType
Returns a new instance of RichTextFieldType.
749 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 749 def initialize(*args) end |
Instance Method Details
#can_edit_properties(obj) ⇒ Boolean Also known as: can_edit_properties?
Returns true if we can edit the object’s properties via a GUI.
801 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 801 def can_edit_properties(obj) end |
#copy(fieldType) ⇒ void
This method returns an undefined value.
753 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 753 def copy(fieldType) end |
#draw(obj, dc, context, range, selection, rect, descent, style) ⇒ Boolean
Draw the item, within the given range.
Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)
767 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 767 def draw(obj, dc, context, range, selection, rect, descent, style) end |
#edit_properties(obj, parent, buffer) ⇒ Boolean
Edits the object’s properties via a GUI.
809 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 809 def edit_properties(obj, parent, buffer) end |
#get_name ⇒ String Also known as: name
Returns the field type name.
There should be a unique name per field type object.
843 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 843 def get_name; end |
#get_properties_menu_label(obj) ⇒ String Also known as:
Returns the label to be used for the properties context menu item.
814 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 814 def (obj) end |
#get_range_size(obj, range, size, descent, dc, context, flags, position = (Wx::Point.new(0, 0)), parentSize = Wx::DEFAULT_SIZE, partialExtents = nil) ⇒ Array(Boolean,Integer) Also known as: range_size
Returns the object size for the given range.
Returns false if the range is invalid for this object.
795 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 795 def get_range_size(obj, range, size, descent, dc, context, flags, position=(Wx::Point.new(0, 0)), parentSize=Wx::DEFAULT_SIZE, partialExtents=nil) end |
#is_top_level(obj) ⇒ Boolean Also known as: top_level?
Returns true if this object is top-level, i.e. contains its own paragraphs, such as a text box.
828 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 828 def is_top_level(obj) end |
#layout(obj, dc, context, rect, parentRect, style) ⇒ Boolean
Lay the item out at the specified position with the given size constraint.
Layout must set the cached size. rect is the available space for the object, and parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box).
779 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 779 def layout(obj, dc, context, rect, parentRect, style) end |
#set_name(name) ⇒ void Also known as: name=
This method returns an undefined value.
Sets the field type name.
There should be a unique name per field type object.
836 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 836 def set_name(name) end |
#update_field(buffer, obj) ⇒ Boolean
Update the field.
This would typically expand the field to its value, if this is a dynamically changing and/or composite field.
823 |
# File 'lib/wx/doc/gen/rtc/rich_text_buffer.rb', line 823 def update_field(buffer, obj) end |