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, 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 character by “". 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. ”rn“, 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 ) wxOVERRIDE
{
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;
}
Also, if you wish not to have line breaks and tabs translated to escape sequences, then do following in constructor of your subclass:
m_flags |= wxPG_PROP_NO_ESCAPE;
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 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 (NULL 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 {|variant| ... } ⇒ Object, Enumerator
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 NULL 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 NULL 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(argFlags = 0) ⇒ 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_flag(*args) ⇒ Object (also: #has_flag?)
-
#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 = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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, argFlags = 0) ⇒ 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 = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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 = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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.
-
#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 = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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 = Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR) ⇒ void
(also: #value=)
Call this to set value of the property.
-
#set_value_from_int(value, flags = 0) ⇒ Boolean
(also: #value_from_int=)
Converts integer to a value, and if successful, calls #set_value on it.
-
#set_value_from_string(text, flags = Wx::PG::PG_MISC_ARG_FLAGS::PG_PROGRAMMATIC_VALUE) ⇒ 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, argFlags = 0) ⇒ 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, argFlags = 0) ⇒ 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.
1847 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1847 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.
967 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 967 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.
954 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 954 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::PGPropertyFlags::PG_PROP_AGGREGATE. In other words, all properties of this property will become private.
961 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 961 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.
983 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 983 def append_child(childProperty) end |
#are_all_children_specified(pendingList = nil) ⇒ Boolean
Determines, recursively, if all children are not unspecified.
988 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 988 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).
992 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 992 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::PGPropertyFlags::PG_PROP_DISABLED flag.
1012 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1012 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.
832 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 832 def child_changed(thisValue, childIndex, childValue) end |
#clear_cells(ignoreWithFlags, recursively) ⇒ void
This method returns an undefined value.
Clear cells associated with property.
1775 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1775 def clear_cells(ignoreWithFlags, recursively) end |
#delete_children ⇒ void
This method returns an undefined value.
Deletes children of the property.
1016 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1016 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.
1023 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1023 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 NULL variant.
928 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 928 def do_get_attribute(name) end |
#do_get_editor_class ⇒ Wx::PG::PGEditor
Returns pointer to an instance of used editor.
836 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 836 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 (NULL 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.
869 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 869 def do_get_validator; end |
#do_get_value ⇒ Wx::Variant
Override this to return something else than m_value as the value.
668 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 668 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.
920 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 920 def do_set_attribute(name, value) end |
#each_attribute {|variant| ... } ⇒ Object, Enumerator
Iterate each attribute. Passes the variant for each attribute to the given block. Returns an Enumerator if no block given.
21 |
# File 'lib/wx/doc/pg/pg_property.rb', line 21 def each_attribute; end |
#empty ⇒ void
This method returns an undefined value.
Deletes all child properties.
1797 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1797 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.
1031 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1031 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.
1038 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1038 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).
1780 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1780 def ensure_cells(column) end |
#generate_composed_value ⇒ String
Composes text from values of child properties.
1042 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1042 def generate_composed_value; end |
#get_attribute(name) ⇒ Wx::Variant #get_attribute(name, defVal) ⇒ String Also known as: attribute
1072 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1072 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.
1102 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1102 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.
1087 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1087 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.
1113 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1113 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.
1124 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1124 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).
1139 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1139 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.
1157 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1157 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.
1151 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1151 def get_cell_or_default(column) end |
#get_child_count ⇒ Integer Also known as: child_count
Returns number of child properties.
1162 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1162 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.
1169 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1169 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.
899 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 899 def get_choice_selection; end |
#get_choices ⇒ Wx::PG::PGChoices Also known as: choices
Returns read-only reference to property’s list of choices.
1174 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1174 def get_choices; end |
#get_client_object ⇒ Object Also known as: client_object
Gets managed client object of a property.
1179 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1179 def get_client_object; end |
#get_column_editor(column) ⇒ Wx::PG::PGEditor Also known as: column_editor
Returns editor used for given column.
NULL for no editor.
1132 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1132 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.
1193 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1193 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.
1186 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1186 def get_default_value; end |
#get_depth ⇒ Integer Also known as: depth
1197 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1197 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.
1202 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1202 def get_displayed_common_value_count; end |
#get_displayed_string ⇒ String Also known as: displayed_string
Returns property’s displayed text.
1207 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1207 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.
1214 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1214 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 NULL (i.e. no action is generated when button is pressed).
934 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 934 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_PROP_’.
1245 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1245 def get_flags_as_string(flagsMask) end |
#get_grid ⇒ Wx::PG::PropertyGrid Also known as: grid
Returns property grid where property lies.
1224 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1224 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.
1229 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1229 def get_grid_if_displayed; end |
#get_help_string ⇒ Wx::String Also known as: help_string
Returns property’s help or description text.
1237 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1237 def get_help_string; end |
#get_hint_text ⇒ String Also known as: hint_text
Returns property’s hint text (shown in empty value cell).
1219 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1219 def get_hint_text; end |
#get_image_offset(imageWidth) ⇒ Integer Also known as: image_offset
Converts image width into full image offset, with margins.
1342 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1342 def get_image_offset(imageWidth) end |
#get_index_in_parent ⇒ Integer Also known as: index_in_parent
Returns position in parent’s array.
1250 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1250 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.
1348 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1348 def get_item_at_y(y) end |
#get_label ⇒ Wx::String Also known as: label
Returns property’s label.
1046 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1046 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.
1255 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1255 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.
1268 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1268 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.
1279 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1279 def get_max_length; end |
#get_name ⇒ String Also known as: name
Returns property’s name with all (non-category, non-root) parents.
1284 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1284 def get_name; end |
#get_parent ⇒ Wx::PG::PGProperty Also known as: parent
Return parent of property.
1289 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1289 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 NULL if not found).
1295 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1295 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 NULL if not found), with hint index.
Does not support scope (i.e. Parent.Child notation).
1792 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1792 def get_property_by_name_wh(name, hintIndex) end |
#get_validator ⇒ Wx::Validator Also known as: validator
Gets assignable version of property’s validator.
1300 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1300 def get_validator; end |
#get_value ⇒ Wx::Variant Also known as: value
Returns property’s value.
1305 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1305 def get_value; end |
#get_value_as_string(argFlags = 0) ⇒ 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.
1324 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1324 def get_value_as_string(argFlags=0) 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.
1312 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1312 def get_value_image; end |
#get_value_type ⇒ String Also known as: value_type
Returns value type used by this property.
1329 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1329 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.
1336 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1336 def get_y; end |
#has_flag(flag) ⇒ Boolean #has_flag(flag) ⇒ Boolean Also known as: has_flag?
1362 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1362 def has_flag(*args) end |
#has_flags_exact(flags) ⇒ Boolean Also known as: has_flags_exact?
Returns true if property has all given flags set.
1368 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1368 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.
1373 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1373 def has_visible_children; end |
#hide(hide, flags = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) ⇒ Boolean
Hides or reveals the property.
1380 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1380 def hide(hide, flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end |
#index(p) ⇒ Integer
Returns index of given child property.
NOT_FOUND if given property is not child of this.
1387 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1387 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.
1404 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1404 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.
1411 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1411 def insert_choice(label, index, value=Wx::PG::PG_INVALID_VALUE) end |
#int_to_value(variant, number, argFlags = 0) ⇒ 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).
723 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 723 def int_to_value(variant, number, argFlags=0) end |
#is_category ⇒ Boolean Also known as: category?
Returns true if this property is actually a Wx::PG::PropertyCategory.
1415 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1415 def is_category; end |
#is_child_selected(recursive = false) ⇒ Boolean Also known as: child_selected?
Returns true if child property is selected.
1802 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1802 def is_child_selected(recursive=false) end |
#is_enabled ⇒ Boolean Also known as: enabled?
Returns true if property is enabled.
1420 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1420 def is_enabled; end |
#is_expanded ⇒ Boolean Also known as: expanded?
Returns true if property has visible children.
1425 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1425 def ; end |
#is_root ⇒ Boolean Also known as: root?
Returns true if this property is actually a RootProperty.
1430 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1430 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.
1443 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1443 def is_some_parent(candidateParent) end |
#is_sub_property ⇒ Boolean Also known as: sub_property?
Returns true if this is a sub-property.
1435 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1435 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).
1454 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1454 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.
1461 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1461 def is_value_unspecified; end |
#is_visible ⇒ Boolean Also known as: visible?
Returns true if all parents expanded.
1466 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1466 def is_visible; end |
#item(i) ⇒ Wx::PG::PGProperty
Returns child property at index i.
1472 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1472 def item(i) end |
#last ⇒ Wx::PG::PGProperty
Returns last sub-property.
1476 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1476 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.
892 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 892 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.
799 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 799 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.
775 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 775 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.
664 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 664 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.
946 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 946 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.
1482 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1482 def recreate_editor; end |
#refresh_children ⇒ void
This method returns an undefined value.
Refresh values of child properties.
Automatically called after value is set.
906 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 906 def refresh_children; end |
#refresh_editor ⇒ void
This method returns an undefined value.
If property’s editor is active, then update it’s value.
1486 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1486 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.
1498 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1498 def set_attribute(name, value) end |
#set_attributes(attributes) ⇒ void
This method returns an undefined value.
1502 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1502 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.
1509 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1509 def set_auto_unspecified(enable=true) end |
#set_background_colour(colour, flags = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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.
1522 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1522 def set_background_colour(colour, flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end |
#set_cell(column, cell) ⇒ void
This method returns an undefined value.
Sets cell information for given column.
1542 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1542 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.
1576 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1576 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.
1561 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1561 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.
1567 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1567 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.
1549 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1549 def set_common_value(commonValue) end |
#set_default_colours(flags = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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.
1692 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1692 def set_default_colours(flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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)
1588 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1588 def set_default_value(value) end |
#set_editor(editor) ⇒ void #set_editor(editorName) ⇒ void Also known as: editor=
1535 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1535 def set_editor(*args) end |
#set_expanded(expanded) ⇒ void Also known as: expanded=
This method returns an undefined value.
1593 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1593 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.
1611 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1611 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_PROP_’.
1601 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1601 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.
1616 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1616 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.
1632 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1632 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.
If it 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.
1641 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1641 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.
1649 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1649 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.
1655 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1655 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.
1667 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1667 def set_parental_type(flag) end |
#set_text_colour(colour, flags = Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_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.
1680 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1680 def set_text_colour(colour, flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end |
#set_validator(validator) ⇒ void Also known as: validator=
This method returns an undefined value.
Sets Validator for a property.
1698 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1698 def set_validator(validator) end |
#set_value(value, pList = nil, flags = Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR) ⇒ 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.
1716 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1716 def set_value(value, pList=nil, flags=Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR) end |
#set_value_from_int(value, flags = 0) ⇒ 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.
756 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 756 def set_value_from_int(value, flags=0) end |
#set_value_from_string(text, flags = Wx::PG::PG_MISC_ARG_FLAGS::PG_PROGRAMMATIC_VALUE) ⇒ 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.
745 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 745 def set_value_from_string(text, flags=Wx::PG::PG_MISC_ARG_FLAGS::PG_PROGRAMMATIC_VALUE) 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.
1724 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1724 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.
1738 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1738 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).
1745 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1745 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).
1752 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1752 def set_was_modified(set=true) end |
#string_to_value(variant, text, argFlags = 0) ⇒ 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).
702 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 702 def string_to_value(variant, text, argFlags=0) 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).
1765 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1765 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.
1769 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1769 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.
685 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 685 def validate_value(value, validationInfo) end |
#value_=(val) ⇒ void
This method returns an undefined value.
1811 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1811 def value_=(val); end |
#value_to_string(value, argFlags = 0) ⇒ String
Converts property value into a text representation.
Default implementation calls #generate_composed_value.
735 |
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 735 def value_to_string(value, argFlags=0) end |