Class: Wx::PG::PGProperty
- Defined in:
- lib/wx/doc/gen/pg/pg_property.rb,
lib/wx/doc/pg/pg_property.rb
Overview
PGProperty is base class for all PropertyGrid properties and as such it is not intended to be instantiated directly.
In sections below we cover few related topics.
-
Supplied Ready-to-use Property Classes
-
Creating Custom Properties
Supplied Ready-to-use Property Classes
Here is a list and short description of supplied fully-functional property classes. They are located in either props.h or advprops.h.
wxPropertyCategory
Not an actual property per se, but a header for a group of properties. Regardless inherits from PGProperty, and supports displaying ‘labels’ for columns other than the first one. Easiest way to set category’s label for second column is to call #set_value with string argument.
wxStringProperty
Simple string property. Supported special attributes:
-
PG_STRING_PASSWORD: Set to true in order to echo value as asterisks and to use TE_PASSWORD on the editor (TextCtrl).
-
PG_ATTR_AUTOCOMPLETE: Set to true to enable auto-completion (use a ArrayString value), and is also supported by any property that happens to use a TextCtrl-based editor.
StringProperty has a special trait: if it has value of "
Wx::PG::IntProperty
It derives from NumericProperty and displays value as a signed long integer. Supported special attributes:
-
PG_ATTR_MIN, PG_ATTR_MAX to specify acceptable value range.
-
PG_ATTR_SPINCTRL_STEP, PG_ATTR_SPINCTRL_WRAP, PG_ATTR_SPINCTRL_MOTION: Sets SpinCtrl editor parameters.
Wx::PG::UIntProperty
Like IntProperty, but displays value as unsigned int. To set the prefix used globally, manipulate PG_UINT_PREFIX string attribute. To set the globally used base, manipulate PG_UINT_BASE int attribute. Regardless of current prefix, understands (hex) values starting with both “0x” and “$” (apart from edit mode). Like IntProperty, UIntProperty seamlessly supports 64-bit unsigned integers (i.e. ULongLong). Same Variant safety rules apply. Supported special attributes:
-
PG_ATTR_MIN, PG_ATTR_MAX: Specifies acceptable value range.
-
PG_UINT_BASE: Defines base. Valid constants are PG_BASE_OCT, PG_BASE_DEC, PG_BASE_HEX and PG_BASE_HEXL (lowercase characters). Arbitrary bases are not supported.
-
PG_UINT_PREFIX: Defines displayed prefix. Possible values are PG_PREFIX_NONE, Wx::PG_PREFIX_0X and PG_PREFIX_DOLLAR_SIGN. Only PG_PREFIX_NONE works with decimal and octal numbers.
-
PG_ATTR_SPINCTRL_STEP, PG_ATTR_SPINCTRL_WRAP, PG_ATTR_SPINCTRL_MOTION: Sets SpinCtrl editor parameters.
For example how to use seamless 64-bit integer support, see IntProperty documentation (just use ULongLong instead of LongLong).
wxFloatProperty
Like StringProperty, but converts text to a double-precision floating point. Default float-to-text precision is 6 decimals, but this can be changed by modifying PG_FLOAT_PRECISION attribute. Note that when displaying the value, sign is omitted if the resulting textual representation is effectively zero (for example, -0.0001 with precision of 3 will become 0.0 instead of -0.0). This behaviour is unlike what C standard library does, but should result in better end-user experience in almost all cases. Supported special attributes:
-
PG_ATTR_MIN, PG_ATTR_MAX: Specifies acceptable value range.
-
PG_FLOAT_PRECISION: Sets the (max) precision used when floating point value is rendered as text. The default -1 means shortest floating-point 6-digit representation.
-
PG_ATTR_SPINCTRL_STEP, PG_ATTR_SPINCTRL_WRAP, PG_ATTR_SPINCTRL_MOTION: Sets SpinCtrl editor parameters.
wxBoolProperty
Represents a boolean value. Choice is used as editor control, by the default. PG_BOOL_USE_CHECKBOX attribute can be set to true in order to use check box instead. Supported special attributes:
-
PG_BOOL_USE_CHECKBOX: If set to true uses check box editor instead of combo box.
-
PG_BOOL_USE_DOUBLE_CLICK_CYCLING: If set to true cycles combo box instead showing the list.
wxLongStringProperty
Like StringProperty, but has a button that triggers a small text editor dialog. Note that in long string values, some control characters are escaped: tab is represented by "\t"
, line break by "\n"
, carriage return by "\r"
and backslash characters are doubled. If another character is preceded by backslash, the backslash is skipped. Note also that depending on the system (port), some sequences of special characters, like e.g. "\r\n"
, can be interpreted and presented in a different way in the editor and therefore such sequences may not be the same before and after the edition. To display a custom dialog on button press, you can subclass LongStringProperty and override DisplayEditorDialog, like this:
bool DisplayEditorDialog( wxPropertyGrid* propGrid, wxVariant& value ) override
{
wxSize dialogSize(...size of your dialog...);
wxPoint dlgPos = propGrid->GetGoodEditorDialogPosition(this,
dialogSize)
// Create dialog dlg at dlgPos. Use value as initial string
// value.
...
if ( dlg.ShowModal() == wxID_OK )
{
value = dlg.GetStringValue);
return true;
}
return false;
}
Supported special attributes:
-
PG_DIALOG_TITLE: Sets a specific title for the text editor dialog.
wxDirProperty
Like LongStringProperty, but the button triggers dir selector instead. Supported special attributes:
-
PG_DIALOG_TITLE: Sets specific title for the dir selector.
wxFileProperty
Like LongStringProperty, but the button triggers file selector instead. Default wildcard is “All files…” but this can be changed by setting PG_FILE_WILDCARD attribute. Supported special attributes:
-
PG_DIALOG_TITLE: Sets a specific title for the file dialog.
-
PG_FILE_DIALOG_STYLE: Sets a specific FileDialog style for the file dialog.
-
PG_FILE_WILDCARD: Sets wildcard (see FileDialog for format details), “All files…” is default.
-
PG_FILE_SHOW_FULL_PATH: Default true. When false, only the file name is shown (i.e. drive and directory are hidden).
-
PG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the given path string.
-
PG_FILE_INITIAL_PATH: Sets the initial path of where to look for files.
wxEnumProperty
Represents a single selection from a list of choices - OwnerDrawnComboBox is used to edit the value.
wxFlagsProperty
Represents a bit set that fits in a long integer. BoolProperty sub- properties are created for editing individual bits. Textctrl is created to manually edit the flags as a text; a continuous sequence of spaces, commas and semicolons are considered as a flag id separator. Note: When changing “choices” (i.e. flag labels) of FlagsProperty, you will need to use #set_choices - otherwise they will not get updated properly. FlagsProperty supports the same attributes as BoolProperty.
wxArrayStringProperty
Property that manages a list of strings. Allows editing of a list of strings in TextCtrl and in a separate dialog. Supported special attributes:
-
PG_ARRAY_DELIMITER: Sets string delimiter character.
-
PG_DIALOG_TITLE: Sets a specific title for the editor dialog. Default is comma (‘,’).
wxDateProperty
Property representing DateTime. Default editor is DatePickerCtrl, although TextCtrl should work as well. Supported special attributes:
-
PG_DATE_FORMAT: Determines displayed date format (with Wx::DateTime::Format). Default is recommended as it is locale-dependent.
-
PG_DATE_PICKER_STYLE: Determines window style used with DatePickerCtrl. Default is DP_DEFAULT | DP_SHOWCENTURY. Using DP_ALLOWNONE enables additional support for unspecified property value.
wxEditEnumProperty
Represents a string that can be freely edited or selected from list of choices - custom combobox control is used to edit the value.
Uses int value, similar to EnumProperty, unless text entered by user is not in choices (in which case string value is used).
wxMultiChoiceProperty
Allows editing a multiple selection from a list of strings. This is property is pretty much built around concept of MultiChoiceDialog. It uses ArrayString value. Supported special attributes:
-
PG_ATTR_MULTICHOICE_USERSTRINGMODE: If > 0, allows user to manually enter strings that are not in the list of choices. If this value is 1, user strings are preferably placed in front of valid choices. If value is 2, then those strings will placed behind valid choices.
-
PG_DIALOG_TITLE: Sets a specific title for the editor dialog.
wxImageFileProperty
Property representing image file(name). Like FileProperty, but has thumbnail of the image in front of the filename and autogenerates wildcard from available image handlers. Supported special attributes:
-
PG_DIALOG_TITLE: Sets a specific title for the file dialog.
-
PG_FILE_DIALOG_STYLE: Sets a specific FileDialog style for the file dialog.
-
PG_FILE_WILDCARD: Sets wildcard (see FileDialog for format details), “All files…” is default.
-
PG_FILE_SHOW_FULL_PATH: Default true. When false, only the file name is shown (i.e. drive and directory are hidden).
-
PG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the given path string.
-
PG_FILE_INITIAL_PATH: Sets the initial path of where to look for files.
wxColourProperty
Useful alternate editor: Choice. Represents Colour. Button is used to trigger a colour picker dialog. There are various sub-classing opportunities with this class. See below in SystemColourProperty section for details. Supported special attributes:
-
PG_COLOUR_HAS_ALPHA: If set to true allows user to edit the alpha colour component.
wxFontProperty
Represents Font. Various sub-properties are used to edit individual subvalues. Supported special attributes:
-
PG_DIALOG_TITLE: Sets a specific title for the font dialog.
wxSystemColourProperty
Represents Colour and a system colour index. Choice is used to edit the value. Drop-down list has color images. Note that value type is ColourPropertyValue instead of Colour (which ColourProperty uses).
In SystemColourProperty, and its derived class ColourProperty, there are various sub-classing features. To set a basic list of colour names, call #set_choices.
# Override in derived class to customize how colours are translated
# to strings.
def colour_to_string(col, index) end
# Returns index of entry that triggers colour picker dialog
# (default is last).
def get_custom_colour_index; end
# Helper function to show the colour dialog
def query_colour_from_user(variant) end
# Returns colour for given choice.
# Default function returns Wx::SystemSettings.get_colour(index).
def get_colour(index) end
wxCursorProperty
Represents a Cursor. Choice is used to edit the value. Drop-down list has cursor images under some (WXMSW) platforms.
Creating Custom Properties
New properties can be created by subclassing PGProperty or one of the provided property classes, and (re)implementing necessary member functions. Below, each virtual member function has ample documentation about its purpose and any odd details which to keep in mind. Here is a very simple ‘template’ code:
class MyProperty < Wx::PG::PGProperty
# All arguments of this ctor must have a default value -
# use Wx::PG::PG_LABEL for label and name
def initialize(label = Wx::PG::PG_LABEL, name = Wx::PG::PG_LABEL, value = '')
super(label, name)
# self.value is Wx::Variant
self.value = value
end
def do_get_editor_class
# Determines editor used by property.
# You can replace 'TEXT_CTRL' below with any of these
# builtin-in property editor identifiers: CHOICE, COMBO_BOX,
# TEXT_CTRL_AND_BUTTON, CHOICE_AND_BUTTON, CHECK_BOX, SPIN_CTRL,
# DATE_PICKER_CTRL.
return Wx::PG::PG_EDITOR_TEXT_CTRL
end
def value_to_string(value, argFlags)
# TODO: Convert given property value to a string
end
def string_to_value(variant, text, argFlags)
# TODO: Adapt string to property value.
end
protected
# ...
end
Category: PropertyGrid
Direct Known Subclasses
BoolProperty, DateProperty, EditorDialogProperty, EnumProperty, FlagsProperty, NumericProperty, PropertyCategory, StringProperty
Instance Method Summary collapse
-
#adapt_list_to_value(list, value) ⇒ void
Adapts list variant into proper value using consecutive #child_changed calls.
-
#add_choice(label, value = Wx::PG::PG_INVALID_VALUE) ⇒ Integer
Append a new choice to property’s list of choices.
-
#add_private_child(prop) ⇒ void
Adds a private child property.
-
#append_child(childProperty) ⇒ Wx::PG::PGProperty
Use this member function to add independent (i.e.
-
#are_all_children_specified(pendingList = nil) ⇒ Boolean
Determines, recursively, if all children are not unspecified.
-
#are_children_components ⇒ Boolean
Returns true if children of this property are component values (for instance, points size, face name, and is_underlined are component values of a font).
-
#change_flag(flag, set) ⇒ void
Sets or clears given property flag.
-
#child_changed(thisValue, childIndex, childValue) ⇒ Wx::Variant
Called after value of a child property has been altered.
-
#clear_cells(ignoreWithFlags, recursively) ⇒ void
Clear cells associated with property.
-
#delete_children ⇒ void
Deletes children of the property.
-
#delete_choice(index) ⇒ void
Removes entry from property’s PGChoices and editor control (if it is active).
-
#do_get_attribute(name) ⇒ Wx::Variant
Returns value of an attribute.
-
#do_get_editor_class ⇒ Wx::PG::PGEditor
Returns pointer to an instance of used editor.
-
#do_get_validator ⇒ Wx::Validator
Returns pointer to the Validator that should be used with the editor of this property (nil for no validator).
-
#do_get_value ⇒ Wx::Variant
Override this to return something else than m_value as the value.
-
#do_set_attribute(name, value) ⇒ Boolean
Reimplement this member function to add special handling for attributes of this property.
-
#each_attribute ⇒ Object
Iterate each attribute.
-
#empty ⇒ void
Deletes all child properties.
-
#enable(enable = true) ⇒ void
Enables or disables the property.
-
#enable_common_value(enable = true) ⇒ void
Call to enable or disable usage of common value (integer value that can be selected for properties instead of their normal values) for this property.
-
#ensure_cells(column) ⇒ void
Makes sure m_cells has size of column+1 (or more).
-
#generate_composed_value ⇒ String
Composes text from values of child properties.
- #get_attribute(*args) ⇒ Object (also: #attribute)
-
#get_attribute_as_double(name, defVal) ⇒ Float
(also: #attribute_as_double)
Returns named attribute, as double, if found.
-
#get_attribute_as_long(name, defVal) ⇒ Integer
(also: #attribute_as_long)
Returns named attribute, as long, if found.
-
#get_attributes ⇒ Wx::PGAttributeStorage
(also: #attributes)
Returns map-like storage of property’s attributes.
-
#get_attributes_as_list ⇒ Wx::Variant
(also: #attributes_as_list)
Returns attributes as list Variant.
-
#get_base_name ⇒ Wx::String
(also: #base_name)
Returns property’s base name (i.e.
-
#get_cell(column) ⇒ Wx::PG::PGCell
(also: #cell)
Returns PGCell of given column, creating one if necessary.
-
#get_cell_or_default(column) ⇒ Wx::PG::PGCell
(also: #cell_or_default)
Returns PGCell of given column.
-
#get_child_count ⇒ Integer
(also: #child_count)
Returns number of child properties.
-
#get_children_height(lh, iMax = -1)) ⇒ Integer
(also: #children_height)
Returns height of children, recursively, and by taking expanded/collapsed status into account.
-
#get_choice_selection ⇒ Integer
(also: #choice_selection)
Returns which choice is currently selected.
-
#get_choices ⇒ Wx::PG::PGChoices
(also: #choices)
Returns read-only reference to property’s list of choices.
-
#get_client_object ⇒ Object
(also: #client_object)
Gets managed client object of a property.
-
#get_column_editor(column) ⇒ Wx::PG::PGEditor
(also: #column_editor)
Returns editor used for given column.
-
#get_common_value ⇒ Integer
(also: #common_value)
Returns common value selected for this property.
-
#get_default_value ⇒ Wx::Variant
(also: #default_value)
Returns property’s default value.
- #get_depth ⇒ Integer (also: #depth)
-
#get_displayed_common_value_count ⇒ Integer
(also: #displayed_common_value_count)
Return number of displayed common values for this property.
-
#get_displayed_string ⇒ String
(also: #displayed_string)
Returns property’s displayed text.
-
#get_editor_class ⇒ Wx::PG::PGEditor
(also: #editor_class)
Returns PGEditor that will be used and created when property becomes selected.
-
#get_editor_dialog ⇒ Wx::PG::PGEditorDialogAdapter
(also: #editor_dialog)
Returns instance of a new PGEditorDialogAdapter instance, which is used when user presses the (optional) button next to the editor control;.
-
#get_flags_as_string(flagsMask) ⇒ String
(also: #flags_as_string)
Gets flags as a’|‘ delimited string.
-
#get_grid ⇒ Wx::PG::PropertyGrid
(also: #grid)
Returns property grid where property lies.
-
#get_grid_if_displayed ⇒ Wx::PG::PropertyGrid
(also: #grid_if_displayed)
Returns owner PropertyGrid, but only if one is currently on a page displaying this property.
-
#get_help_string ⇒ Wx::String
(also: #help_string)
Returns property’s help or description text.
-
#get_hint_text ⇒ String
(also: #hint_text)
Returns property’s hint text (shown in empty value cell).
-
#get_image_offset(imageWidth) ⇒ Integer
(also: #image_offset)
Converts image width into full image offset, with margins.
-
#get_index_in_parent ⇒ Integer
(also: #index_in_parent)
Returns position in parent’s array.
-
#get_item_at_y(y) ⇒ Wx::PG::PGProperty
(also: #item_at_y)
Returns property at given virtual y coordinate.
-
#get_label ⇒ Wx::String
(also: #label)
Returns property’s label.
-
#get_last_visible_sub_item ⇒ Wx::PG::PGProperty
(also: #last_visible_sub_item)
Returns last visible child property, recursively.
-
#get_main_parent ⇒ Wx::PG::PGProperty
(also: #main_parent)
Returns highest level non-category, non-root parent.
-
#get_max_length ⇒ Integer
(also: #max_length)
Returns maximum allowed length of the text the user can enter in the property text editor.
-
#get_name ⇒ String
(also: #name)
Returns property’s name with all (non-category, non-root) parents.
-
#get_parent ⇒ Wx::PG::PGProperty
(also: #parent)
Return parent of property.
-
#get_property_by_name(name) ⇒ Wx::PG::PGProperty
(also: #property_by_name)
Returns (direct) child property with given name (or nil if not found).
-
#get_property_by_name_wh(name, hintIndex) ⇒ Wx::PG::PGProperty
(also: #property_by_name_wh)
Returns (direct) child property with given name (or nil if not found), with hint index.
-
#get_validator ⇒ Wx::Validator
(also: #validator)
Gets assignable version of property’s validator.
-
#get_value ⇒ Wx::Variant
(also: #value)
Returns property’s value.
-
#get_value_as_string(flags = PGPropValFormatFlags::Null) ⇒ String
(also: #value_as_string)
Returns text representation of property’s value.
-
#get_value_image ⇒ Wx::Bitmap
(also: #value_image)
Returns bitmap that appears next to value text.
-
#get_value_type ⇒ String
(also: #value_type)
Returns value type used by this property.
-
#get_y ⇒ Integer
(also: #y)
Returns coordinate to the top y of the property.
-
#has_any_child ⇒ Boolean
(also: #has_any_child?)
Checks if there is any child property.
-
#has_flag(flag) ⇒ Boolean
(also: #has_flag?)
Returns true if property has given flag set.
-
#has_flags_exact(flags) ⇒ Boolean
(also: #has_flags_exact?)
Returns true if property has all given flags set.
-
#has_visible_children ⇒ Boolean
(also: #has_visible_children?)
Returns true if property has even one visible child.
-
#hide(hide, flags = PGPropertyValuesFlags::Recurse) ⇒ Boolean
Hides or reveals the property.
-
#index(p) ⇒ Integer
Returns index of given child property.
-
#initialize(*args) ⇒ PGProperty
constructor
protected
A new instance of PGProperty.
-
#insert_child(index, childProperty) ⇒ Wx::PG::PGProperty
Use this member function to add independent (i.e.
-
#insert_choice(label, index, value = Wx::PG::PG_INVALID_VALUE) ⇒ Integer
Inserts a new choice to property’s list of choices.
-
#int_to_value(variant, number, flags = PGPropValFormatFlags::Null) ⇒ Boolean
Converts integer (possibly a choice selection) into Variant value appropriate for this property.
-
#is_category ⇒ Boolean
(also: #category?)
Returns true if this property is actually a PropertyCategory.
-
#is_child_selected(recursive = false) ⇒ Boolean
(also: #child_selected?)
Returns true if child property is selected.
-
#is_enabled ⇒ Boolean
(also: #enabled?)
Returns true if property is enabled.
-
#is_expanded ⇒ Boolean
(also: #expanded?)
Returns true if property has visible children.
-
#is_root ⇒ Boolean
(also: #root?)
Returns true if this property is actually a RootProperty.
-
#is_some_parent(candidateParent) ⇒ Boolean
(also: #some_parent?)
Returns true if candidateParent is some parent of this property.
-
#is_sub_property ⇒ Boolean
(also: #sub_property?)
Returns true if this is a sub-property.
-
#is_text_editable ⇒ Boolean
(also: #text_editable?)
Returns true if property has editable TextCtrl when selected.
-
#is_value_unspecified ⇒ Boolean
(also: #value_unspecified?)
Returns true if property’s value is considered unspecified.
-
#is_visible ⇒ Boolean
(also: #visible?)
Returns true if all parents expanded.
-
#item(i) ⇒ Wx::PG::PGProperty
Returns child property at index i.
-
#last ⇒ Wx::PG::PGProperty
Returns last sub-property.
-
#on_custom_paint(dc, rect, paintdata) ⇒ void
Override to paint an image in front of the property value text or drop-down list item (but only if #on_measure_image is overridden as well).
-
#on_event(propgrid, wnd_primary, event) ⇒ Boolean
Events received by editor widgets are processed here.
-
#on_measure_image(item = -1)) ⇒ Wx::Size
Returns size of the custom painted image in front of property.
-
#on_set_value ⇒ void
This virtual function is called after m_value has been set.
-
#on_validation_failure(pendingValue) ⇒ void
Called whenever validation has failed with given pending value.
-
#recreate_editor ⇒ Boolean
If property’s editor is created this forces its recreation.
-
#refresh_children ⇒ void
Refresh values of child properties.
-
#refresh_editor ⇒ void
If property’s editor is active, then update it’s value.
-
#set_attribute(name, value) ⇒ void
Sets an attribute for this property.
- #set_attributes(attributes) ⇒ void
-
#set_auto_unspecified(enable = true) ⇒ void
(also: #auto_unspecified=)
Set if user can change the property’s value to unspecified by modifying the value of the editor control (usually by clearing it).
-
#set_background_colour(colour, flags = PGPropertyValuesFlags::Recurse) ⇒ void
(also: #background_colour=)
Sets property’s background colour.
-
#set_cell(column, cell) ⇒ void
Sets cell information for given column.
-
#set_choice_selection(newValue) ⇒ void
(also: #choice_selection=)
Sets selected choice and changes property value.
-
#set_choices(choices) ⇒ Boolean
(also: #choices=)
Sets new set of choices for the property.
-
#set_client_object(clientObject) ⇒ void
(also: #client_object=)
Sets client object of a property.
-
#set_common_value(commonValue) ⇒ void
(also: #common_value=)
Sets common value selected for this property.
-
#set_default_colours(flags = PGPropertyValuesFlags::Recurse) ⇒ void
(also: #default_colours=)
Sets property’s default text and background colours.
-
#set_default_value(value) ⇒ void
(also: #default_value=)
Set default value of a property.
- #set_editor(*args) ⇒ Object (also: #editor=)
- #set_expanded(expanded) ⇒ void (also: #expanded=)
-
#set_flag_recursively(flag, set) ⇒ void
Sets or clears given property flag, recursively.
-
#set_flags_from_string(str) ⇒ void
(also: #flags_from_string=)
Sets flags from a ‘|’ delimited string.
-
#set_help_string(helpString) ⇒ void
(also: #help_string=)
Sets property’s help string, which is shown, for example, in PropertyGridManager‘s description text box.
-
#set_label(label) ⇒ void
(also: #label=)
Sets property’s label.
-
#set_max_length(maxLen) ⇒ Boolean
(also: #max_length=)
Set maximum length of the text the user can enter in the text editor associated with property.
-
#set_modified_status(modified) ⇒ void
(also: #modified_status=)
Sets property’s “is it modified?” flag.
-
#set_name(newName) ⇒ void
(also: #name=)
Sets new (base) name for property.
-
#set_parental_type(flag) ⇒ void
(also: #parental_type=)
Changes what sort of parent this property is for its children.
-
#set_text_colour(colour, flags = PGPropertyValuesFlags::Recurse) ⇒ void
(also: #text_colour=)
Sets property’s text colour.
-
#set_validator(validator) ⇒ void
(also: #validator=)
Sets Validator for a property.
-
#set_value(value, pList = nil, flags = PGSetValueFlags::RefreshEditor) ⇒ void
(also: #value=)
Call this to set value of the property.
-
#set_value_from_int(value, flags = PGPropValFormatFlags::Null) ⇒ Boolean
(also: #value_from_int=)
Converts integer to a value, and if successful, calls #set_value on it.
-
#set_value_from_string(text, flags = PGPropValFormatFlags::ProgrammaticValue) ⇒ Boolean
(also: #value_from_string=)
Converts string to a value, and if successful, calls #set_value on it.
-
#set_value_image(bmp) ⇒ void
(also: #value_image=)
Set Bitmap taken from BitmapBundle in front of the value.
-
#set_value_in_event(value) ⇒ void
(also: #value_in_event=)
Call this function in #on_event, OnButtonClick() etc.
-
#set_value_to_unspecified ⇒ void
Sets property’s value to unspecified (i.e.
-
#set_was_modified(set = true) ⇒ void
(also: #was_modified=)
Call with false in #on_set_value to cancel value changes after all (i.e.
-
#string_to_value(variant, text, flags = PGPropValFormatFlags::Null) ⇒ Boolean
Converts text into Variant value appropriate for this property.
-
#update_parent_values ⇒ Wx::PG::PGProperty
Updates composed values of parent non-category properties, recursively.
-
#uses_auto_unspecified ⇒ Boolean
Returns true if containing grid uses Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_AUTO_UNSPECIFIED_VALUES.
-
#validate_value(value, validationInfo) ⇒ Boolean
Implement this function in derived class to check the value.
- #value_ ⇒ Wx::Variant
- #value_=(val) ⇒ void
-
#value_to_string(value, flags = PGPropValFormatFlags::Null) ⇒ String
Converts property value into a text representation.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::PG::PGProperty (protected) #initialize(label, name) ⇒ Wx::PG::PGProperty (protected)
Returns a new instance of PGProperty.
1855 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1855 def initialize(*args) end |
Instance Method Details
#adapt_list_to_value(list, value) ⇒ void
This method returns an undefined value.
Adapts list variant into proper value using consecutive #child_changed calls.
975 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 975 def adapt_list_to_value(list, value) end |
#add_choice(label, value = Wx::PG::PG_INVALID_VALUE) ⇒ Integer
Append a new choice to property’s list of choices.
Index to added choice.
962 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 962 def add_choice(label, value=Wx::PG::PG_INVALID_VALUE) end |
#add_private_child(prop) ⇒ void
This method returns an undefined value.
Adds a private child property.
If you use this instead of Wx::PG::PropertyGridInterface#insert or Wx::PG::PropertyGridInterface#append_in, then property’s parental type will automatically be set up to Wx::PG::PGFlags::Aggregate. In other words, all properties of this property will become private.
969 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 969 def add_private_child(prop) end |
#append_child(childProperty) ⇒ Wx::PG::PGProperty
Use this member function to add independent (i.e.
regular) children to a property. Appended childProperty.
Wx::PG::PropertyGrid is not automatically refreshed by this function.
991 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 991 def append_child(childProperty) end |
#are_all_children_specified(pendingList = nil) ⇒ Boolean
Determines, recursively, if all children are not unspecified.
996 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 996 def are_all_children_specified(pendingList=nil) end |
#are_children_components ⇒ Boolean
Returns true if children of this property are component values (for instance, points size, face name, and is_underlined are component values of a font).
1000 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1000 def are_children_components; end |
#change_flag(flag, set) ⇒ void
This method returns an undefined value.
Sets or clears given property flag.
Mainly for internal use.
Setting a property flag never has any side-effect, and is intended almost exclusively for internal use. So, for example, if you want to disable a property, call ```ruby enable(false) ``` instead of setting Wx::PG::PGFlags::Disabled flag.
1020 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1020 def change_flag(flag, set) end |
#child_changed(thisValue, childIndex, childValue) ⇒ Wx::Variant
Called after value of a child property has been altered.
Must return new value of the whole property (after any alterations warranted by child’s new value). Note that this function is usually called at the time that value of this property, or given child property, is still pending for change, and as such, result of #get_value or m_value should not be relied on. Sample pseudo-code implementation:
class MyProperty < Wx::PG::FlagsProperty
def child_changed(thisValue, childIndex, childValue)
# Acquire reference to actual type of data stored in variant
flags = thisValue.object;
case childIndex
when 0
flags.sub_prop1 = childValue.to_i
when 1
flags.sub_prop2 = childValue.to_s
# ...
end
# return altered data
Wx::Variant.new(flags)
end
end
Modified value of the whole property.
840 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 840 def child_changed(thisValue, childIndex, childValue) end |
#clear_cells(ignoreWithFlags, recursively) ⇒ void
This method returns an undefined value.
Clear cells associated with property.
1783 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1783 def clear_cells(ignoreWithFlags, recursively) end |
#delete_children ⇒ void
This method returns an undefined value.
Deletes children of the property.
1024 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1024 def delete_children; end |
#delete_choice(index) ⇒ void
This method returns an undefined value.
Removes entry from property’s Wx::PG::PGChoices and editor control (if it is active).
If selected item is deleted, then the value is set to unspecified.
1031 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1031 def delete_choice(index) end |
#do_get_attribute(name) ⇒ Wx::Variant
Returns value of an attribute.
Override if custom handling of attributes is needed. Default implementation simply return nil variant.
936 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 936 def do_get_attribute(name) end |
#do_get_editor_class ⇒ Wx::PG::PGEditor
Returns pointer to an instance of used editor.
844 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 844 def do_get_editor_class; end |
#do_get_validator ⇒ Wx::Validator
Returns pointer to the Validator that should be used with the editor of this property (nil for no validator).
Setting validator explicitly via #set_property_validator will override this. In most situations, code like this should work well:
class MyPropertyClass < Wx::PG::IntProperty
class << self
def validator
@validator ||= MyValidator.new(...)
end
end
# ...
def do_get_validator
MyPropertyClass.validator
end
# ...
end
You can get common filename validator by returning FileProperty.get_class_validator. DirProperty, for example, uses it.
877 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 877 def do_get_validator; end |
#do_get_value ⇒ Wx::Variant
Override this to return something else than m_value as the value.
676 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 676 def do_get_value; end |
#do_set_attribute(name, value) ⇒ Boolean
Reimplement this member function to add special handling for attributes of this property.
Return false to have the attribute automatically stored in m_attributes. Default implementation simply does that and nothing else.
To actually set property attribute values from the application, use #set_attribute instead.
928 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 928 def do_set_attribute(name, value) end |
#each_attribute {|variant| ... } ⇒ Object #each_attribute ⇒ Enumerator
Iterate each attribute. Passes the variant for each attribute to the given block. Returns an Enumerator if no block given.
29 |
# File 'lib/wx/doc/pg/pg_property.rb', line 29 def each_attribute(*) end |
#empty ⇒ void
This method returns an undefined value.
Deletes all child properties.
1805 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1805 def empty; end |
#enable(enable = true) ⇒ void
This method returns an undefined value.
Enables or disables the property.
Disabled property usually appears as having grey text.
1039 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1039 def enable(enable=true) end |
#enable_common_value(enable = true) ⇒ void
This method returns an undefined value.
Call to enable or disable usage of common value (integer value that can be selected for properties instead of their normal values) for this property.
Common values are disabled by the default for all properties.
1046 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1046 def enable_common_value(enable=true) end |
#ensure_cells(column) ⇒ void
This method returns an undefined value.
Makes sure m_cells has size of column+1 (or more).
1788 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1788 def ensure_cells(column) end |
#generate_composed_value ⇒ String
Composes text from values of child properties.
1050 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1050 def generate_composed_value; end |
#get_attribute(name) ⇒ Wx::Variant #get_attribute(name, defVal) ⇒ String Also known as: attribute
1080 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1080 def get_attribute(*args) end |
#get_attribute_as_double(name, defVal) ⇒ Float Also known as: attribute_as_double
Returns named attribute, as double, if found.
Otherwise defVal is returned.
For built-in attribute returns defVal if extra style Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set.
1110 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1110 def get_attribute_as_double(name, defVal) end |
#get_attribute_as_long(name, defVal) ⇒ Integer Also known as: attribute_as_long
Returns named attribute, as long, if found.
Otherwise defVal is returned.
For built-in attribute returns defVal if extra style Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set.
1095 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1095 def get_attribute_as_long(name, defVal) end |
#get_attributes ⇒ Wx::PGAttributeStorage Also known as: attributes
Returns map-like storage of property’s attributes.
If extra style Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set, then builtin-attributes are not included in the storage.
1121 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1121 def get_attributes; end |
#get_attributes_as_list ⇒ Wx::Variant Also known as: attributes_as_list
Returns attributes as list Variant.
If extra style Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set, then builtin-attributes are not included in the list.
1132 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1132 def get_attributes_as_list; end |
#get_base_name ⇒ Wx::String Also known as: base_name
Returns property’s base name (i.e.
parent’s name is not added in any case).
1147 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1147 def get_base_name; end |
#get_cell(column) ⇒ Wx::PG::PGCell Also known as: cell
Returns Wx::PG::PGCell of given column, creating one if necessary.
1165 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1165 def get_cell(column) end |
#get_cell_or_default(column) ⇒ Wx::PG::PGCell Also known as: cell_or_default
Returns Wx::PG::PGCell of given column.
const version of this member function returns 'default' Wx::PG::PGCell object if the property itself didn't hold cell data.
1159 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1159 def get_cell_or_default(column) end |
#get_child_count ⇒ Integer Also known as: child_count
Returns number of child properties.
1170 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1170 def get_child_count; end |
#get_children_height(lh, iMax = -1)) ⇒ Integer Also known as: children_height
Returns height of children, recursively, and by taking expanded/collapsed status into account.
1182 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1182 def get_children_height(lh, iMax=-1) end |
#get_choice_selection ⇒ Integer Also known as: choice_selection
Returns which choice is currently selected.
Only applies to properties which have choices. Needs to reimplemented in derived class if property value does not map directly to a choice. Integer as index, bool, and string usually do.
907 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 907 def get_choice_selection; end |
#get_choices ⇒ Wx::PG::PGChoices Also known as: choices
Returns read-only reference to property’s list of choices.
1187 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1187 def get_choices; end |
#get_client_object ⇒ Object Also known as: client_object
Gets managed client object of a property.
1192 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1192 def get_client_object; end |
#get_column_editor(column) ⇒ Wx::PG::PGEditor Also known as: column_editor
Returns editor used for given column.
nil for no editor.
1140 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1140 def get_column_editor(column) end |
#get_common_value ⇒ Integer Also known as: common_value
Returns common value selected for this property.
-1 for none.
1206 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1206 def get_common_value; end |
#get_default_value ⇒ Wx::Variant Also known as: default_value
Returns property’s default value.
If property’s value type is not a built-in one, and “DefaultValue” attribute is not defined, then this function usually returns Null variant.
1199 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1199 def get_default_value; end |
#get_depth ⇒ Integer Also known as: depth
1210 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1210 def get_depth; end |
#get_displayed_common_value_count ⇒ Integer Also known as: displayed_common_value_count
Return number of displayed common values for this property.
1215 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1215 def get_displayed_common_value_count; end |
#get_displayed_string ⇒ String Also known as: displayed_string
Returns property’s displayed text.
1220 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1220 def get_displayed_string; end |
#get_editor_class ⇒ Wx::PG::PGEditor Also known as: editor_class
Returns Wx::PG::PGEditor that will be used and created when property becomes selected.
Returns more accurate value than #do_get_editor_class.
1227 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1227 def get_editor_class; end |
#get_editor_dialog ⇒ Wx::PG::PGEditorDialogAdapter Also known as: editor_dialog
Returns instance of a new Wx::PG::PGEditorDialogAdapter instance, which is used when user presses the (optional) button next to the editor control;.
Default implementation returns nil (i.e. no action is generated when button is pressed).
942 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 942 def get_editor_dialog; end |
#get_flags_as_string(flagsMask) ⇒ String Also known as: flags_as_string
Gets flags as a’|‘ delimited string.
Note that flag names are not prepended with ‘Wx::PG::PGFlags’.
1258 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1258 def get_flags_as_string(flagsMask) end |
#get_grid ⇒ Wx::PG::PropertyGrid Also known as: grid
Returns property grid where property lies.
1237 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1237 def get_grid; end |
#get_grid_if_displayed ⇒ Wx::PG::PropertyGrid Also known as: grid_if_displayed
Returns owner Wx::PG::PropertyGrid, but only if one is currently on a page displaying this property.
1242 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1242 def get_grid_if_displayed; end |
#get_help_string ⇒ Wx::String Also known as: help_string
Returns property’s help or description text.
1250 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1250 def get_help_string; end |
#get_hint_text ⇒ String Also known as: hint_text
Returns property’s hint text (shown in empty value cell).
1232 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1232 def get_hint_text; end |
#get_image_offset(imageWidth) ⇒ Integer Also known as: image_offset
Converts image width into full image offset, with margins.
1355 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1355 def get_image_offset(imageWidth) end |
#get_index_in_parent ⇒ Integer Also known as: index_in_parent
Returns position in parent’s array.
1263 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1263 def get_index_in_parent; end |
#get_item_at_y(y) ⇒ Wx::PG::PGProperty Also known as: item_at_y
Returns property at given virtual y coordinate.
1361 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1361 def get_item_at_y(y) end |
#get_label ⇒ Wx::String Also known as: label
Returns property’s label.
1054 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1054 def get_label; end |
#get_last_visible_sub_item ⇒ Wx::PG::PGProperty Also known as: last_visible_sub_item
Returns last visible child property, recursively.
1268 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1268 def get_last_visible_sub_item; end |
#get_main_parent ⇒ Wx::PG::PGProperty Also known as: main_parent
Returns highest level non-category, non-root parent.
Useful when you have nested properties with children.
If immediate parent is root or category, this will return the property itself.
1281 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1281 def get_main_parent; end |
#get_max_length ⇒ Integer Also known as: max_length
Returns maximum allowed length of the text the user can enter in the property text editor.
0 is returned if length is not explicitly limited and the text can be as long as it is supported by the underlying native text control widget.
1292 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1292 def get_max_length; end |
#get_name ⇒ String Also known as: name
Returns property’s name with all (non-category, non-root) parents.
1297 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1297 def get_name; end |
#get_parent ⇒ Wx::PG::PGProperty Also known as: parent
Return parent of property.
1302 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1302 def get_parent; end |
#get_property_by_name(name) ⇒ Wx::PG::PGProperty Also known as: property_by_name
Returns (direct) child property with given name (or nil if not found).
1308 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1308 def get_property_by_name(name) end |
#get_property_by_name_wh(name, hintIndex) ⇒ Wx::PG::PGProperty Also known as: property_by_name_wh
Returns (direct) child property with given name (or nil if not found), with hint index.
Does not support scope (i.e. Parent.Child notation).
1800 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1800 def get_property_by_name_wh(name, hintIndex) end |
#get_validator ⇒ Wx::Validator Also known as: validator
Gets assignable version of property’s validator.
1313 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1313 def get_validator; end |
#get_value ⇒ Wx::Variant Also known as: value
Returns property’s value.
1318 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1318 def get_value; end |
#get_value_as_string(flags = PGPropValFormatFlags::Null) ⇒ String Also known as: value_as_string
Returns text representation of property’s value.
In older versions, this function used to be overridden to convert property's value into a string representation. This function is now handled by #value_to_string, and overriding this function now will result in run-time assertion failure.
1337 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1337 def get_value_as_string(flags=PGPropValFormatFlags::Null) end |
#get_value_image ⇒ Wx::Bitmap Also known as: value_image
Returns bitmap that appears next to value text.
Only returns non-null bitmap if one was set with #set_value_image.
1325 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1325 def get_value_image; end |
#get_value_type ⇒ String Also known as: value_type
Returns value type used by this property.
1342 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1342 def get_value_type; end |
#get_y ⇒ Integer Also known as: y
Returns coordinate to the top y of the property.
Note that the position of scrollbars is not taken into account.
1349 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1349 def get_y; end |
#has_any_child ⇒ Boolean Also known as: has_any_child?
Checks if there is any child property.
1175 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1175 def has_any_child; end |
#has_flag(flag) ⇒ Boolean Also known as: has_flag?
Returns true if property has given flag set.
1370 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1370 def has_flag(flag) end |
#has_flags_exact(flags) ⇒ Boolean Also known as: has_flags_exact?
Returns true if property has all given flags set.
1376 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1376 def has_flags_exact(flags) end |
#has_visible_children ⇒ Boolean Also known as: has_visible_children?
Returns true if property has even one visible child.
1381 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1381 def has_visible_children; end |
#hide(hide, flags = PGPropertyValuesFlags::Recurse) ⇒ Boolean
Hides or reveals the property.
1388 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1388 def hide(hide, flags=PGPropertyValuesFlags::Recurse) end |
#index(p) ⇒ Integer
Returns index of given child property.
NOT_FOUND if given property is not child of this.
1395 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1395 def index(p) end |
#insert_child(index, childProperty) ⇒ Wx::PG::PGProperty
Use this member function to add independent (i.e.
regular) children to a property. Inserted childProperty.
Wx::PG::PropertyGrid is not automatically refreshed by this function.
1412 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1412 def insert_child(index, childProperty) end |
#insert_choice(label, index, value = Wx::PG::PG_INVALID_VALUE) ⇒ Integer
Inserts a new choice to property’s list of choices.
1419 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1419 def insert_choice(label, index, value=Wx::PG::PG_INVALID_VALUE) end |
#int_to_value(variant, number, flags = PGPropValFormatFlags::Null) ⇒ Boolean
Converts integer (possibly a choice selection) into Variant value appropriate for this property.
Returns true if resulting Variant value was different.
- If property is not supposed to use choice or spinctrl or other editor with int-based value, it is not necessary to implement this method. - Default implementation simply assign given int to m_value. - If property uses choice control, and displays a dialog on some choice items, then it is preferred to display that dialog in IntToValue instead of OnEvent. - You might want to take into account that m_value is Mull variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behaviour).
731 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 731 def int_to_value(variant, number, flags=PGPropValFormatFlags::Null) end |
#is_category ⇒ Boolean Also known as: category?
Returns true if this property is actually a Wx::PG::PropertyCategory.
1423 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1423 def is_category; end |
#is_child_selected(recursive = false) ⇒ Boolean Also known as: child_selected?
Returns true if child property is selected.
1810 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1810 def is_child_selected(recursive=false) end |
#is_enabled ⇒ Boolean Also known as: enabled?
Returns true if property is enabled.
1428 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1428 def is_enabled; end |
#is_expanded ⇒ Boolean Also known as: expanded?
Returns true if property has visible children.
1433 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1433 def ; end |
#is_root ⇒ Boolean Also known as: root?
Returns true if this property is actually a RootProperty.
1438 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1438 def is_root; end |
#is_some_parent(candidateParent) ⇒ Boolean Also known as: some_parent?
Returns true if candidateParent is some parent of this property.
Use, for example, to detect if item is inside collapsed section.
1451 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1451 def is_some_parent(candidateParent) end |
#is_sub_property ⇒ Boolean Also known as: sub_property?
Returns true if this is a sub-property.
1443 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1443 def is_sub_property; end |
#is_text_editable ⇒ Boolean Also known as: text_editable?
Returns true if property has editable TextCtrl when selected.
Although disabled properties do not displayed editor, they still return true here as being disabled is considered a temporary condition (unlike being read-only or having limited editing enabled).
1462 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1462 def is_text_editable; end |
#is_value_unspecified ⇒ Boolean Also known as: value_unspecified?
Returns true if property’s value is considered unspecified.
This usually means that value is Null variant.
1469 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1469 def is_value_unspecified; end |
#is_visible ⇒ Boolean Also known as: visible?
Returns true if all parents expanded.
1474 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1474 def is_visible; end |
#item(i) ⇒ Wx::PG::PGProperty
Returns child property at index i.
1480 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1480 def item(i) end |
#last ⇒ Wx::PG::PGProperty
Returns last sub-property.
1484 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1484 def last; end |
#on_custom_paint(dc, rect, paintdata) ⇒ void
This method returns an undefined value.
Override to paint an image in front of the property value text or drop-down list item (but only if #on_measure_image is overridden as well).
If property’s #on_measure_image returns size that has height != 0 but less than row height ( < 0 has special meanings), Wx::PG::PropertyGrid calls this method to draw a custom image in a limited area in front of the editor control or value text/graphics, and if control has drop-down list, then the image is drawn there as well (even in the case #on_measure_image returned higher height than row height). NOTE: Following applies when #on_measure_image returns a “flexible” height ( using wxPG_FLEXIBLE_SIZE(W,H)
macro), which implies variable height items: If (rect.x+rect.width) is < 0, then this is a measure item call, which means that dc is invalid and only thing that should be done is to set paintdata.m_drawnHeight to the height of the image of item at index paintdata.m_choiceItem. This call may be done even as often as once every drop-down popup show.
- You can actually exceed rect width, but if you do so then paintdata.m_drawnWidth must be set to the full width drawn in pixels. - Due to technical reasons, rect's height will be default even if custom height was reported during measure call. - Brush is guaranteed to be default background colour. It has been already used to clear the background of area being painted. It can be modified. - Pen is guaranteed to be 1-wide 'black' (or whatever is the proper colour) pen for drawing framing rectangle. It can be changed as well.
900 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 900 def on_custom_paint(dc, rect, paintdata) end |
#on_event(propgrid, wnd_primary, event) ⇒ Boolean
Events received by editor widgets are processed here.
Note that editor class usually processes most events. Some, such as button press events of TextCtrlAndButton class, can be handled here. Also, if custom handling for regular events is desired, then that can also be done (for example, SystemColourProperty custom handles EVT_CHOICE to display colour picker dialog when ‘custom’ selection is made). If the event causes value to be changed, #set_value_in_event should be called to set the new value. The parameter event is the associated Event.
Should
return true if any changes in value should be reported.
- If property uses choice control, and displays a dialog on some choice items, then it is preferred to display that dialog in IntToValue instead of OnEvent.
807 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 807 def on_event(propgrid, wnd_primary, event) end |
#on_measure_image(item = -1)) ⇒ Wx::Size
Returns size of the custom painted image in front of property.
This method must be overridden to return non-default value if OnCustomPaint is to be called.
- Default behaviour is to return size(0,0), which means no image. - Default image width or height is indicated with dimension -1. - You can also return Wx::PG::PG_DEFAULT_IMAGE_SIZE which equals DEFAULT_SIZE.
783 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 783 def on_measure_image(item=-1) end |
#on_set_value ⇒ void
This method returns an undefined value.
This virtual function is called after m_value has been set.
- If m_value was set to Null variant (i.e. unspecified value), #on_set_value will not be called. - m_value may be of any variant type. Typically properties internally support only one variant type, and as such #on_set_value provides a good opportunity to convert supported values into internal type. - Default implementation does nothing.
672 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 672 def on_set_value; end |
#on_validation_failure(pendingValue) ⇒ void
This method returns an undefined value.
Called whenever validation has failed with given pending value.
If you implement this in your custom property class, please remember to call the base implementation as well, since they may use it to revert property into pre-change state.
954 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 954 def on_validation_failure(pendingValue) end |
#recreate_editor ⇒ Boolean
If property’s editor is created this forces its recreation.
Useful in SetAttribute etc. Returns true if actually did anything.
1490 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1490 def recreate_editor; end |
#refresh_children ⇒ void
This method returns an undefined value.
Refresh values of child properties.
Automatically called after value is set.
914 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 914 def refresh_children; end |
#refresh_editor ⇒ void
This method returns an undefined value.
If property’s editor is active, then update it’s value.
1494 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1494 def refresh_editor; end |
#set_attribute(name, value) ⇒ void
This method returns an undefined value.
Sets an attribute for this property.
Setting attribute's value to Null variant will simply remove it from property's set of attributes.
1506 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1506 def set_attribute(name, value) end |
#set_attributes(attributes) ⇒ void
This method returns an undefined value.
1510 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1510 def set_attributes(attributes) end |
#set_auto_unspecified(enable = true) ⇒ void Also known as: auto_unspecified=
This method returns an undefined value.
Set if user can change the property’s value to unspecified by modifying the value of the editor control (usually by clearing it).
Currently, this can work with following properties: IntProperty, UIntProperty, FloatProperty, EditEnumProperty.
1517 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1517 def set_auto_unspecified(enable=true) end |
#set_background_colour(colour, flags = PGPropertyValuesFlags::Recurse) ⇒ void Also known as: background_colour=
This method returns an undefined value.
Sets property’s background colour.
Unlike Wx::PG::PropertyGridInterface#set_property_background_colour, this does not automatically update the display.
1530 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1530 def set_background_colour(colour, flags=PGPropertyValuesFlags::Recurse) end |
#set_cell(column, cell) ⇒ void
This method returns an undefined value.
Sets cell information for given column.
1550 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1550 def set_cell(column, cell) end |
#set_choice_selection(newValue) ⇒ void Also known as: choice_selection=
This method returns an undefined value.
Sets selected choice and changes property value.
Tries to retain value type, although currently if it is not string, then it is forced to integer. If newValue is NOT_FOUND (-1
), then the property’s value is reset to unspecified, as if #set_value_to_unspecified was called.
1584 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1584 def set_choice_selection(newValue) end |
#set_choices(choices) ⇒ Boolean Also known as: choices=
Sets new set of choices for the property.
This operation deselects the property and clears its value.
1569 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1569 def set_choices(choices) end |
#set_client_object(clientObject) ⇒ void Also known as: client_object=
This method returns an undefined value.
Sets client object of a property.
1575 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1575 def set_client_object(clientObject) end |
#set_common_value(commonValue) ⇒ void Also known as: common_value=
This method returns an undefined value.
Sets common value selected for this property.
-1 for none.
1557 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1557 def set_common_value(commonValue) end |
#set_default_colours(flags = PGPropertyValuesFlags::Recurse) ⇒ void Also known as: default_colours=
This method returns an undefined value.
Sets property’s default text and background colours.
Unlike Wx::PG::PropertyGridInterface#set_property_colours_to_default, this does not automatically update the display.
1700 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1700 def set_default_colours(flags=PGPropertyValuesFlags::Recurse) end |
#set_default_value(value) ⇒ void Also known as: default_value=
This method returns an undefined value.
Set default value of a property.
Synonymous to
set_attribute('DefaultValue', value)
1596 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1596 def set_default_value(value) end |
#set_editor(editor) ⇒ void #set_editor(editorName) ⇒ void Also known as: editor=
1543 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1543 def set_editor(*args) end |
#set_expanded(expanded) ⇒ void Also known as: expanded=
This method returns an undefined value.
1601 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1601 def () end |
#set_flag_recursively(flag, set) ⇒ void
This method returns an undefined value.
Sets or clears given property flag, recursively.
This function is primarily intended for internal use.
1619 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1619 def set_flag_recursively(flag, set) end |
#set_flags_from_string(str) ⇒ void Also known as: flags_from_string=
This method returns an undefined value.
Sets flags from a ‘|’ delimited string.
Note that flag names are not prepended with ‘Wx::PG::PGFlags’.
1609 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1609 def set_flags_from_string(str) end |
#set_help_string(helpString) ⇒ void Also known as: help_string=
This method returns an undefined value.
Sets property’s help string, which is shown, for example, in Wx::PG::PropertyGridManager‘s description text box.
1624 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1624 def set_help_string(helpString) end |
#set_label(label) ⇒ void Also known as: label=
This method returns an undefined value.
Sets property’s label.
- Properties under same parent may have same labels. However, property names must still remain unique. - Unlike Wx::PG::PropertyGridInterface#set_property_label, this does not automatically update the display.
1640 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1640 def set_label(label) end |
#set_max_length(maxLen) ⇒ Boolean Also known as: max_length=
Set maximum length of the text the user can enter in the text editor associated with property.
It does not affect a text representation of the value already stored when the limit is set, nor does it affect the length of the text representation of the value set programmatically e.g. with #set_value or Wx::PG::PropertyGridInterface#set_property_value. If maxLen is 0, the length is not limited and the text can be as long as it is supported by the underlying native text control widget. Returns true if maximum length was set.
1649 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1649 def set_max_length(maxLen) end |
#set_modified_status(modified) ⇒ void Also known as: modified_status=
This method returns an undefined value.
Sets property’s “is it modified?” flag.
Affects children recursively.
1657 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1657 def set_modified_status(modified) end |
#set_name(newName) ⇒ void Also known as: name=
This method returns an undefined value.
Sets new (base) name for property.
1663 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1663 def set_name(newName) end |
#set_parental_type(flag) ⇒ void Also known as: parental_type=
This method returns an undefined value.
Changes what sort of parent this property is for its children.
You generally do not need to call this function.
1675 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1675 def set_parental_type(flag) end |
#set_text_colour(colour, flags = PGPropertyValuesFlags::Recurse) ⇒ void Also known as: text_colour=
This method returns an undefined value.
Sets property’s text colour.
Unlike Wx::PG::PropertyGridInterface#set_property_text_colour, this does not automatically update the display.
1688 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1688 def set_text_colour(colour, flags=PGPropertyValuesFlags::Recurse) end |
#set_validator(validator) ⇒ void Also known as: validator=
This method returns an undefined value.
Sets Validator for a property.
1706 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1706 def set_validator(validator) end |
#set_value(value, pList = nil, flags = PGSetValueFlags::RefreshEditor) ⇒ void Also known as: value=
This method returns an undefined value.
Call this to set value of the property.
Unlike methods in Wx::PG::PropertyGrid, this does not automatically update the display.
Use Wx::PG::PropertyGrid#change_property_value instead if you need to run through validation process and send property change event.
If you need to change property value in event, based on user input, use #set_value_in_event instead.
1724 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1724 def set_value(value, pList=nil, flags=PGSetValueFlags::RefreshEditor) end |
#set_value_from_int(value, flags = PGPropValFormatFlags::Null) ⇒ Boolean Also known as: value_from_int=
Converts integer to a value, and if successful, calls #set_value on it.
Default behaviour is to do nothing.
true if value was changed.
764 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 764 def set_value_from_int(value, flags=PGPropValFormatFlags::Null) end |
#set_value_from_string(text, flags = PGPropValFormatFlags::ProgrammaticValue) ⇒ Boolean Also known as: value_from_string=
Converts string to a value, and if successful, calls #set_value on it.
Default behaviour is to do nothing.
true if value was changed.
753 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 753 def set_value_from_string(text, flags=PGPropValFormatFlags::ProgrammaticValue) end |
#set_value_image(bmp) ⇒ void Also known as: value_image=
This method returns an undefined value.
Set Bitmap taken from BitmapBundle in front of the value.
This bitmap may be ignored by custom cell renderers.
1732 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1732 def set_value_image(bmp) end |
#set_value_in_event(value) ⇒ void Also known as: value_in_event=
This method returns an undefined value.
Call this function in #on_event, OnButtonClick() etc.
to change the property value based on user input.
This method is const since it doesn't actually modify value, but posts given variant as pending value, stored in Wx::PG::PropertyGrid.
1746 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1746 def set_value_in_event(value) end |
#set_value_to_unspecified ⇒ void
This method returns an undefined value.
Sets property’s value to unspecified (i.e.
Null variant).
1753 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1753 def set_value_to_unspecified; end |
#set_was_modified(set = true) ⇒ void Also known as: was_modified=
This method returns an undefined value.
Call with false in #on_set_value to cancel value changes after all (i.e.
cancel true returned by #string_to_value or #int_to_value).
1760 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1760 def set_was_modified(set=true) end |
#string_to_value(variant, text, flags = PGPropValFormatFlags::Null) ⇒ Boolean
Converts text into Variant value appropriate for this property.
Returns true if resulting Variant value was different.
Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behaviour).
710 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 710 def string_to_value(variant, text, flags=PGPropValFormatFlags::Null) end |
#update_parent_values ⇒ Wx::PG::PGProperty
Updates composed values of parent non-category properties, recursively.
Returns topmost property updated.
Must not call #set_value (as can be called in it).
1773 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1773 def update_parent_values; end |
#uses_auto_unspecified ⇒ Boolean
Returns true if containing grid uses Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_AUTO_UNSPECIFIED_VALUES.
1777 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1777 def uses_auto_unspecified; end |
#validate_value(value, validationInfo) ⇒ Boolean
Implement this function in derived class to check the value.
Return true if it is ok. Returning false prevents property change events from occurring.
- Default implementation always returns true.
693 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 693 def validate_value(value, validationInfo) end |
#value_=(val) ⇒ void
This method returns an undefined value.
1819 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1819 def value_=(val); end |
#value_to_string(value, flags = PGPropValFormatFlags::Null) ⇒ String
Converts property value into a text representation.
Default implementation calls #generate_composed_value.
743 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 743 def value_to_string(value, flags=PGPropValFormatFlags::Null) end |