Class: Wx::PG::PGProperty

Inherits:
Object
  • Object
show all
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:

Remark:

StringProperty has a special trait: if it has value of "", and also has child properties, then its displayed value becomes composition of child property values, similar as with FontProperty, for instance.

Wx::PG::IntProperty

It derives from NumericProperty and displays value as a signed long integer. Supported special attributes:

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:

Remark:

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:

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:

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:

wxDirProperty

Like LongStringProperty, but the button triggers dir selector instead. Supported special attributes:

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:

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:

wxDateProperty

Property representing DateTime. Default editor is DatePickerCtrl, although TextCtrl should work as well. Supported special attributes:

wxEditEnumProperty

Represents a string that can be freely edited or selected from list of choices - custom combobox control is used to edit the value.

Remark:

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:

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:

wxFontProperty

Represents Font. Various sub-properties are used to edit individual subvalues. Supported special attributes:

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

See Also:

  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers
  • Property Attribute Identifiers

Requires:

  • USE_PROPGRID

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initializeWx::PG::PGProperty (protected) #initialize(label, name) ⇒ Wx::PG::PGProperty (protected)

Returns a new instance of PGProperty.

Overloads:



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.

Parameters:



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.

Parameters:

  • label (String)

    Label for added choice.

  • value (Integer) (defaults to: Wx::PG::PG_INVALID_VALUE)

    Value for new choice. Do not specify if you wish this to equal choice index.

Returns:

  • (Integer)


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.

Parameters:



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.

Remark:

Wx::PG::PropertyGrid is not automatically refreshed by this function.

Parameters:

Returns:

See Also:



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.

Parameters:

  • pendingList (Wx::Variant) (defaults to: nil)

    Assumes members in this Variant list as pending replacement values.

Returns:

  • (Boolean)


988
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 988

def are_all_children_specified(pendingList=nil) end

#are_children_componentsBoolean

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).

Returns:

  • (Boolean)


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.

Remark:

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.

Parameters:

  • flag (Wx::PGPropertyFlags)
  • set (Boolean)

See Also:



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.

Parameters:

  • thisValue (Wx::Variant)

    Value of this property. Changed value should be returned (in previous versions of Wx::PG::PropertyGrid it was only necessary to write value back to this argument).

  • childIndex (Integer)

    Index of child changed (you can use Item(childIndex) to get child property).

  • childValue (Wx::Variant)

    (Pending) value of the child property.

Returns:



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.

Parameters:

  • ignoreWithFlags (Integer)

    Cells will not be cleared for properties having these flags set.

  • recursively (Boolean)

    If true, apply this operation recursively in child properties.



1775
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1775

def clear_cells(ignoreWithFlags, recursively) end

#delete_childrenvoid

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.

Parameters:

  • index (Integer)


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.

Parameters:

  • name (String)

Returns:



928
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 928

def do_get_attribute(name) end

#do_get_editor_classWx::PG::PGEditor

Returns pointer to an instance of used editor.

Returns:



836
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 836

def do_get_editor_class; end

#do_get_validatorWx::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
Remark:

You can get common filename validator by returning FileProperty.get_class_validator. DirProperty, for example, uses it.

Returns:



869
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 869

def do_get_validator; end

#do_get_valueWx::Variant

Override this to return something else than m_value as the value.

Returns:



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.

Remark:

To actually set property attribute values from the application, use #set_attribute instead.

Parameters:

Returns:

  • (Boolean)


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.

Yield Parameters:

Returns:

  • (Object, Enumerator)

    last result of block or Enumerator if no block given.



21
# File 'lib/wx/doc/pg/pg_property.rb', line 21

def each_attribute; end

#emptyvoid

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.

Parameters:

  • enable (Boolean) (defaults to: true)

    If false, property is disabled instead.

See Also:



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.

Parameters:

  • enable (Boolean) (defaults to: true)


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).

Parameters:

  • column (Integer)


1780
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1780

def ensure_cells(column) end

#generate_composed_valueString

Composes text from values of child properties.

Returns:

  • (String)


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

Overloads:



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.

Remark:

For built-in attribute returns defVal if extra style Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set.

Parameters:

  • name (String)
  • defVal (Float)

Returns:

  • (Float)


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.

Remark:

For built-in attribute returns defVal if extra style Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set.

Parameters:

  • name (String)
  • defVal (Integer)

Returns:

  • (Integer)


1087
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1087

def get_attribute_as_long(name, defVal) end

#get_attributesWx::PGAttributeStorage Also known as: attributes

Returns map-like storage of property’s attributes.

Remark:

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.

Returns:

  • (Wx::PGAttributeStorage)


1113
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1113

def get_attributes; end

#get_attributes_as_listWx::Variant Also known as: attributes_as_list

Returns attributes as list Variant.

Remark:

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.

Returns:



1124
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1124

def get_attributes_as_list; end

#get_base_nameWx::String Also known as: base_name

Returns property’s base name (i.e.

parent’s name is not added in any case).

Returns:

  • (Wx::String)


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.

Parameters:

  • column (Integer)

Returns:



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.

Remark:

const version of this member function returns 'default' Wx::PG::PGCell object if the property itself didn't hold cell data.

Parameters:

  • column (Integer)

Returns:



1151
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1151

def get_cell_or_default(column) end

#get_child_countInteger Also known as: child_count

Returns number of child properties.

Returns:

  • (Integer)


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.

Parameters:

  • lh (Integer)

    Line height. Pass result of #get_grid->GetRowHeight() here.

  • iMax (Integer) (defaults to: -1))

    Only used (internally) when finding property y-positions.

Returns:

  • (Integer)


1169
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1169

def get_children_height(lh, iMax=-1) end

#get_choice_selectionInteger 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.

Returns:

  • (Integer)


899
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 899

def get_choice_selection; end

#get_choicesWx::PG::PGChoices Also known as: choices

Returns read-only reference to property’s list of choices.

Returns:



1174
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1174

def get_choices; end

#get_client_objectObject Also known as: client_object

Gets managed client object of a property.

Returns:



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.

Parameters:

  • column (Integer)

Returns:



1132
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1132

def get_column_editor(column) end

#get_common_valueInteger Also known as: common_value

Returns common value selected for this property.

-1 for none.

Returns:

  • (Integer)


1193
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1193

def get_common_value; end

#get_default_valueWx::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.

Returns:



1186
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1186

def get_default_value; end

#get_depthInteger Also known as: depth

Returns:

  • (Integer)


1197
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1197

def get_depth; end

#get_displayed_common_value_countInteger Also known as: displayed_common_value_count

Return number of displayed common values for this property.

Returns:

  • (Integer)


1202
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1202

def get_displayed_common_value_count; end

#get_displayed_stringString Also known as: displayed_string

Returns property’s displayed text.

Returns:

  • (String)


1207
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1207

def get_displayed_string; end

#get_editor_classWx::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.

Returns:



1214
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1214

def get_editor_class; end

#get_editor_dialogWx::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_’.

Parameters:

  • flagsMask (Integer)

    String will only be made to include flags combined by this parameter.

Returns:

  • (String)


1245
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1245

def get_flags_as_string(flagsMask) end

#get_gridWx::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_displayedWx::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_stringWx::String Also known as: help_string

Returns property’s help or description text.

Returns:

  • (Wx::String)

See Also:



1237
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1237

def get_help_string; end

#get_hint_textString Also known as: hint_text

Returns property’s hint text (shown in empty value cell).

Returns:

  • (String)


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.

Parameters:

  • imageWidth (Integer)

Returns:

  • (Integer)


1342
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1342

def get_image_offset(imageWidth) end

#get_index_in_parentInteger Also known as: index_in_parent

Returns position in parent’s array.

Returns:

  • (Integer)


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.

Parameters:

  • y (Integer)

Returns:



1348
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1348

def get_item_at_y(y) end

#get_labelWx::String Also known as: label

Returns property’s label.

Returns:

  • (Wx::String)


1046
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1046

def get_label; end

#get_last_visible_sub_itemWx::PG::PGProperty Also known as: last_visible_sub_item

Returns last visible child property, recursively.

Returns:



1255
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1255

def get_last_visible_sub_item; end

#get_main_parentWx::PG::PGProperty Also known as: main_parent

Returns highest level non-category, non-root parent.

Useful when you have nested properties with children.

Remark:

If immediate parent is root or category, this will return the property itself.

Returns:



1268
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1268

def get_main_parent; end

#get_max_lengthInteger Also known as: max_length

Returns maximum allowed length of the text the user can enter in the property text editor.

Remark:

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.

Returns:

  • (Integer)


1279
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1279

def get_max_length; end

#get_nameString Also known as: name

Returns property’s name with all (non-category, non-root) parents.

Returns:

  • (String)


1284
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1284

def get_name; end

#get_parentWx::PG::PGProperty Also known as: parent

Return parent of property.

Returns:



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).

Parameters:

  • name (String)

    Name of the child property to look for.

Returns:



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.

Remark:

Does not support scope (i.e. Parent.Child notation).

Parameters:

  • name (String)

    Name of the child property to look for.

  • hintIndex (Integer)

    Start looking for the child at this index.

Returns:



1792
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1792

def get_property_by_name_wh(name, hintIndex) end

#get_validatorWx::Validator Also known as: validator

Gets assignable version of property’s validator.

Returns:



1300
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1300

def get_validator; end

#get_valueWx::Variant Also known as: value

Returns property’s value.

Returns:



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.

Remark:

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.

Parameters:

Returns:

  • (String)


1324
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1324

def get_value_as_string(argFlags=0) end

#get_value_imageWx::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.

Returns:



1312
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1312

def get_value_image; end

#get_value_typeString Also known as: value_type

Returns value type used by this property.

Returns:

  • (String)


1329
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1329

def get_value_type; end

#get_yInteger Also known as: y

Returns coordinate to the top y of the property.

Note that the position of scrollbars is not taken into account.

Returns:

  • (Integer)


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?

Overloads:

  • #has_flag(flag) ⇒ Boolean

    Returns true if property has given flag set.

    Parameters:

    • flag (Wx::PGPropertyFlags)

    Returns:

    • (Boolean)

    See Also:

    • propgrid_propflags
  • #has_flag(flag) ⇒ Boolean

    Returns true if property has given flag set.

    Parameters:

    • flag (Integer)

    Returns:

    • (Boolean)


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.

Parameters:

  • flags (Integer)

Returns:

  • (Boolean)


1368
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1368

def has_flags_exact(flags) end

#has_visible_childrenBoolean Also known as: has_visible_children?

Returns true if property has even one visible child.

Returns:

  • (Boolean)


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.

Parameters:

  • hide (Boolean)

    true for hide, false for reveal.

  • flags (Integer) (defaults to: Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE)

    By default changes are applied recursively. Set this parameter to Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_DONT_RECURSE to prevent this.

Returns:

  • (Boolean)


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.

Parameters:

Returns:

  • (Integer)


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.

Remark:

Wx::PG::PropertyGrid is not automatically refreshed by this function.

Parameters:

Returns:

See Also:



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.

Parameters:

  • label (String)

    Text for new choice

  • index (Integer)

    Insertion position. Use NOT_FOUND to append.

  • value (Integer) (defaults to: Wx::PG::PG_INVALID_VALUE)

    Value for new choice. Do not specify if you wish this to equal choice index.

Returns:

  • (Integer)


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.

Remark:

- 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).

Parameters:

  • variant (Wx::Variant)

    On function entry this is the old value (should not be NullVariant in normal cases). Translated value must be assigned back to it.

  • number (Integer)

    Integer to be translated into variant.

  • argFlags (Integer) (defaults to: 0)

    If Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE is set, returns complete, storable value instead of displayable one.

Returns:

  • (Boolean)


723
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 723

def int_to_value(variant, number, argFlags=0) end

#is_categoryBoolean Also known as: category?

Returns true if this property is actually a Wx::PG::PropertyCategory.

Returns:

  • (Boolean)


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.

Parameters:

  • recursive (Boolean) (defaults to: false)

Returns:

  • (Boolean)


1802
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1802

def is_child_selected(recursive=false) end

#is_enabledBoolean Also known as: enabled?

Returns true if property is enabled.

Returns:

  • (Boolean)


1420
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1420

def is_enabled; end

#is_expandedBoolean Also known as: expanded?

Returns true if property has visible children.

Returns:

  • (Boolean)


1425
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1425

def is_expanded; end

#is_rootBoolean Also known as: root?

Returns true if this property is actually a RootProperty.

Returns:

  • (Boolean)


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.

Parameters:

Returns:

  • (Boolean)


1443
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1443

def is_some_parent(candidateParent) end

#is_sub_propertyBoolean Also known as: sub_property?

Returns true if this is a sub-property.

Returns:

  • (Boolean)


1435
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1435

def is_sub_property; end

#is_text_editableBoolean Also known as: text_editable?

Returns true if property has editable TextCtrl when selected.

Remark:

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).

Returns:

  • (Boolean)


1454
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1454

def is_text_editable; end

#is_value_unspecifiedBoolean Also known as: value_unspecified?

Returns true if property’s value is considered unspecified.

This usually means that value is Null variant.

Returns:

  • (Boolean)


1461
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1461

def is_value_unspecified; end

#is_visibleBoolean Also known as: visible?

Returns true if all parents expanded.

Returns:

  • (Boolean)


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.

Parameters:

  • i (Integer)

Returns:



1472
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1472

def item(i) end

#lastWx::PG::PGProperty

Returns last sub-property.

Returns:



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.

Remark:

- 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.

Parameters:

  • dc (Wx::DC)

    DC to paint on.

  • rect (Wx::Rect)

    Box reserved for custom graphics. Includes surrounding rectangle, if any. If x+width is < 0, then this is a measure item call (see above).

  • paintdata (Wx::PG::PGPaintData)

    Wx::PG::PGPaintData structure with much useful data about painted item.

See Also:



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.

Remark:

- 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.

Parameters:

Returns:

  • (Boolean)


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.

Remark:

- 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.

Parameters:

  • item (Integer) (defaults to: -1))

    Normally -1, but can be an index to the property’s list of items.

Returns:



775
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 775

def on_measure_image(item=-1) end

#on_set_valuevoid

This method returns an undefined value.

This virtual function is called after m_value has been set.

Remark:

- 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.

Remark:

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.

Parameters:



946
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 946

def on_validation_failure(pendingValue) end

#recreate_editorBoolean

If property’s editor is created this forces its recreation.

Useful in SetAttribute etc. Returns true if actually did anything.

Returns:

  • (Boolean)


1482
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1482

def recreate_editor; end

#refresh_childrenvoid

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_editorvoid

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.

Remark:

Setting attribute's value to Null variant will simply remove it from property's set of attributes.

Parameters:

  • name (String)

    Text identifier of attribute. See wxPropertyGrid Property Attribute Identifiers.

  • value (nil, String, Integer, Float, Time, Wx::Font, Wx::Colour, Wx::Variant, Array<WxVariant>, Array<String>, ObjectWx::PG::ColourPropertyValue)

    Value of attribute.



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.

Parameters:

  • attributes (Wx::PGAttributeStorage)


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.

Parameters:

  • enable (Boolean) (defaults to: true)

    Whether to enable or disable this behaviour (it is disabled by default).



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.

Remark:

Unlike Wx::PG::PropertyGridInterface#set_property_background_colour, this does not automatically update the display.

Parameters:

  • colour (Wx::Colour, String, Symbol)

    Background colour to use.

  • flags (Integer) (defaults to: Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE)

    Default is Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children.



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.

Parameters:



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.

Parameters:

  • newValue (Integer)


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.

Remark:

This operation deselects the property and clears its value.

Parameters:

Returns:

  • (Boolean)


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.

Parameters:



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.

Parameters:

  • commonValue (Integer)


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.

Remark:

Unlike Wx::PG::PropertyGridInterface#set_property_colours_to_default, this does not automatically update the display.

Parameters:

  • flags (Integer) (defaults to: Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE)

    Default is Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE which causes colours to be set recursively. Omit this flag to only set colours for the property in question and not any of its children.



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)

Parameters:



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=

Overloads:

  • #set_editor(editor) ⇒ void

    This method returns an undefined value.

    Sets editor for a property.

    For custom editors, use pointer you received from Wx::PG::PropertyGrid.register_editor_class.

    Parameters:

    • editor (Wx::PG::PGEditor)

      For builtin editors, use Wx::PGEditor_X, where X is builtin editor’s name (TextCtrl, Choice, etc. see Wx::PG::PGEditor documentation for full list).

  • #set_editor(editorName) ⇒ void

    This method returns an undefined value.

    Sets editor for a property, by editor name.

    Parameters:

    • editorName (String)


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.

Parameters:

  • expanded (Boolean)


1593
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1593

def set_expanded(expanded) 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.

Parameters:

  • flag (Wx::PGPropertyFlags)
  • set (Boolean)

See Also:



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_’.

Parameters:

  • str (String)


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.

Parameters:

  • helpString (String)


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.

Remark:

- 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.

Parameters:

  • label (String)


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.

Parameters:

  • maxLen (Integer)

Returns:

  • (Boolean)


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.

Parameters:

  • modified (Boolean)


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.

Parameters:

  • newName (String)


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.

Remark:

You generally do not need to call this function.

Parameters:



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.

Remark:

Unlike Wx::PG::PropertyGridInterface#set_property_text_colour, this does not automatically update the display.

Parameters:

  • colour (Wx::Colour, String, Symbol)

    Text colour to use.

  • flags (Integer) (defaults to: Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE)

    Default is Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children.



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.

Parameters:



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.

Remark:

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.

Parameters:

  • value (nil, String, Integer, Float, Time, Wx::Font, Wx::Colour, Wx::Variant, Array<WxVariant>, Array<String>, ObjectWx::PG::ColourPropertyValue)

    The value to set.

  • pList (Wx::Variant) (defaults to: nil)

    Pointer to list variant that contains child values. Used to indicate which children should be marked as modified. Usually you just use NULL.

  • flags (Integer) (defaults to: Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR)

    Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR is set by default, to refresh editor and redraw properties.



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.

Parameters:

Returns:

  • (Boolean)


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.

Parameters:

  • text (String)

    String to get the value from.

  • flags (Integer) (defaults to: Wx::PG::PG_MISC_ARG_FLAGS::PG_PROGRAMMATIC_VALUE)

    If Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE is set, the function sets complete, storable value instead of displayable one (they may be different). Wx::PG::PG_MISC_ARG_FLAGS::PG_PROGRAMMATIC_VALUE flag is used to indicate that value is being set programmatically (i.e. operation is not caused by user input). If Wx::PG::PG_MISC_ARG_FLAGS::PG_REPORT_ERROR is set, a special action should be performed if string couldn’t have been successfully converted to the valid value (e.g. a special value can be set in this case).

Returns:

  • (Boolean)


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.

Parameters:



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.

Remark:

This method is const since it doesn't actually modify value, but posts given variant as pending value, stored in Wx::PG::PropertyGrid.

Parameters:

  • value (nil, String, Integer, Float, Time, Wx::Font, Wx::Colour, Wx::Variant, Array<WxVariant>, Array<String>, ObjectWx::PG::ColourPropertyValue)


1738
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1738

def set_value_in_event(value) end

#set_value_to_unspecifiedvoid

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).

Parameters:

  • set (Boolean) (defaults to: true)


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.

Remark:

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).

Parameters:

  • variant (Wx::Variant)

    On function entry this is the old value (should not be NullVariant in normal cases). Translated value must be assigned back to it.

  • text (String)

    Text to be translated into variant.

  • argFlags (Integer) (defaults to: 0)

    If Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If Wx::PG::PG_MISC_ARG_FLAGS::PG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of composite property string value (as generated by #value_to_string called with this same flag).

Returns:

  • (Boolean)


702
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 702

def string_to_value(variant, text, argFlags=0) end

#update_parent_valuesWx::PG::PGProperty

Updates composed values of parent non-category properties, recursively.

Returns topmost property updated.

Remark:

Must not call #set_value (as can be called in it).

Returns:



1765
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1765

def update_parent_values; end

#uses_auto_unspecifiedBoolean

Returns true if containing grid uses Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_AUTO_UNSPECIFIED_VALUES.

Returns:

  • (Boolean)


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.

Remark:

- Default implementation always returns true.

Parameters:

Returns:

  • (Boolean)


685
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 685

def validate_value(value, validationInfo) end

#value_Wx::Variant

Returns:



1807
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 1807

def value_; end

#value_=(val) ⇒ void

This method returns an undefined value.

Parameters:



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.

Remark:

Default implementation calls #generate_composed_value.

Parameters:

Returns:

  • (String)


735
# File 'lib/wx/doc/gen/pg/pg_property.rb', line 735

def value_to_string(value, argFlags=0) end