# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx::PG # PG_LABEL_STRING = "@!" # PG_INVALID_VALUE = 2147483647 # PG_BASE_OCT = 8 # PG_BASE_DEC = 10 # PG_BASE_HEX = 16 # PG_BASE_HEXL = 32 # PG_PREFIX_NONE = 0 # PG_PREFIX_DOLLAR_SIGN = 2 # # # # # @wxrb_require USE_PROPGRID class PG_GETPROPERTYVALUES_FLAGS < Wx::Enum # Flag for {Wx::PG::PropertyGridInterface::SetProperty}* functions, {Wx::PG::PropertyGridInterface#hide_property}, etc. # PG_DONT_RECURSE = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(0) # Flag for {Wx::PG::PropertyGridInterface#get_property_values}. # PG_KEEP_STRUCTURE = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(16) # Flag for {Wx::PG::PropertyGridInterface::SetProperty}* functions, {Wx::PG::PropertyGridInterface#hide_property}, etc. # PG_RECURSE = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(32) # Flag for {Wx::PG::PropertyGridInterface#get_property_values}. # PG_INC_ATTRIBUTES = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(64) # Used when first starting recursion. # PG_RECURSE_STARTS = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(128) # Force value change. # PG_FORCE = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(256) # Only sort categories and their immediate children. # PG_SORT_TOP_LEVEL_ONLY = Wx::PG::PG_GETPROPERTYVALUES_FLAGS.new(512) end # PG_GETPROPERTYVALUES_FLAGS # Misc argument flags. # # # # @wxrb_require USE_PROPGRID class PG_MISC_ARG_FLAGS < Wx::Enum # Get/Store full value instead of displayed value. # PG_FULL_VALUE = Wx::PG::PG_MISC_ARG_FLAGS.new(1) # Perform special action in case of unsuccessful conversion. # PG_REPORT_ERROR = Wx::PG::PG_MISC_ARG_FLAGS.new(2) # # PG_PROPERTY_SPECIFIC = Wx::PG::PG_MISC_ARG_FLAGS.new(4) # Get/Store editable value instead of displayed one (should only be different in the case of common values). # PG_EDITABLE_VALUE = Wx::PG::PG_MISC_ARG_FLAGS.new(8) # Used when dealing with fragments of composite string value. # PG_COMPOSITE_FRAGMENT = Wx::PG::PG_MISC_ARG_FLAGS.new(16) # Means property for which final string value is for cannot really be edited. # PG_UNEDITABLE_COMPOSITE_FRAGMENT = Wx::PG::PG_MISC_ARG_FLAGS.new(32) # {Wx::PG::PGProperty#value_to_string} called from {Wx::PG::PGProperty#get_value_as_string} (guarantees that input {Wx::Variant} value is current own value) # PG_VALUE_IS_CURRENT = Wx::PG::PG_MISC_ARG_FLAGS.new(64) # Value is being set programmatically (i.e. # PG_PROGRAMMATIC_VALUE = Wx::PG::PG_MISC_ARG_FLAGS.new(128) end # PG_MISC_ARG_FLAGS # {Wx::PG::PGProperty#set_value} flags # # # # @wxrb_require USE_PROPGRID class PG_SETVALUE_FLAGS < Wx::Enum # # PG_SETVAL_REFRESH_EDITOR = Wx::PG::PG_SETVALUE_FLAGS.new(1) # # PG_SETVAL_AGGREGATED = Wx::PG::PG_SETVALUE_FLAGS.new(2) # # PG_SETVAL_FROM_PARENT = Wx::PG::PG_SETVALUE_FLAGS.new(4) # Set if value changed by user. # PG_SETVAL_BY_USER = Wx::PG::PG_SETVALUE_FLAGS.new(8) end # PG_SETVALUE_FLAGS # PG_ATTR_DEFAULT_VALUE = "DefaultValue" # PG_ATTR_MIN = "Min" # PG_ATTR_MAX = "Max" # PG_ATTR_UNITS = "Units" # PG_ATTR_HINT = "Hint" # PG_ATTR_AUTOCOMPLETE = "AutoComplete" # PG_BOOL_USE_CHECKBOX = "UseCheckbox" # PG_BOOL_USE_DOUBLE_CLICK_CYCLING = "UseDClickCycling" # PG_FLOAT_PRECISION = "Precision" # PG_STRING_PASSWORD = "Password" # PG_UINT_BASE = "Base" # PG_UINT_PREFIX = "Prefix" # PG_DIALOG_TITLE = "DialogTitle" # PG_FILE_WILDCARD = "Wildcard" # PG_FILE_SHOW_FULL_PATH = "ShowFullPath" # PG_FILE_SHOW_RELATIVE_PATH = "ShowRelativePath" # PG_FILE_INITIAL_PATH = "InitialPath" # PG_FILE_DIALOG_STYLE = "DialogStyle" # PG_ARRAY_DELIMITER = "Delimiter" # PG_DATE_FORMAT = "DateFormat" # PG_DATE_PICKER_STYLE = "PickerStyle" # PG_ATTR_SPINCTRL_STEP = "Step" # PG_ATTR_SPINCTRL_WRAP = "Wrap" # PG_ATTR_SPINCTRL_MOTION = "MotionSpin" # PG_ATTR_MULTICHOICE_USERSTRINGMODE = "UserStringMode" # PG_COLOUR_ALLOW_CUSTOM = "AllowCustom" # PG_COLOUR_HAS_ALPHA = "HasAlpha" # PG_PROP_MAX = 262144 # PG_PROP_PARENTAL_FLAGS = 25600 # PG_STRING_STORED_FLAGS = 54 # # # ## wxPGProperty Flags # # @wxrb_require USE_PROPGRID class PGPropertyFlags < Wx::Enum # Indicates bold font. # PG_PROP_MODIFIED = Wx::PG::PGPropertyFlags.new(1) # Disables ('greyed' text and editor does not activate) property. # PG_PROP_DISABLED = Wx::PG::PGPropertyFlags.new(2) # Hider button will hide this property. # PG_PROP_HIDDEN = Wx::PG::PGPropertyFlags.new(4) # This property has custom paint image just in front of its value. # PG_PROP_CUSTOMIMAGE = Wx::PG::PGPropertyFlags.new(8) # Do not create text based editor for this property (but button-triggered dialog and choice are ok). # PG_PROP_NOEDITOR = Wx::PG::PGPropertyFlags.new(16) # Property is collapsed, ie. # PG_PROP_COLLAPSED = Wx::PG::PGPropertyFlags.new(32) # If property is selected, then indicates that validation failed for pending value. # PG_PROP_INVALID_VALUE = Wx::PG::PGPropertyFlags.new(64) # Switched via SetWasModified(). # PG_PROP_WAS_MODIFIED = Wx::PG::PGPropertyFlags.new(512) # If set, then child properties (if any) are private, and should be "invisible" to the application. # PG_PROP_AGGREGATE = Wx::PG::PGPropertyFlags.new(1024) # If set, then child properties (if any) are copies and should not be deleted in dtor. # PG_PROP_CHILDREN_ARE_COPIES = Wx::PG::PGPropertyFlags.new(2048) # Classifies this item as a non-category. # PG_PROP_PROPERTY = Wx::PG::PGPropertyFlags.new(4096) # Classifies this item as a category. # PG_PROP_CATEGORY = Wx::PG::PGPropertyFlags.new(8192) # Classifies this item as a property that has children, but is not aggregate (i.e. # PG_PROP_MISC_PARENT = Wx::PG::PGPropertyFlags.new(16384) # Property is read-only. # PG_PROP_READONLY = Wx::PG::PGPropertyFlags.new(32768) # Property's value is composed from values of child properties. # PG_PROP_COMPOSED_VALUE = Wx::PG::PGPropertyFlags.new(65536) # Common value of property is selectable in editor. # PG_PROP_USES_COMMON_VALUE = Wx::PG::PGPropertyFlags.new(131072) # Property can be set to unspecified value via editor. # PG_PROP_AUTO_UNSPECIFIED = Wx::PG::PGPropertyFlags.new(262144) # Indicates the bit usable by derived properties. # PG_PROP_CLASS_SPECIFIC_1 = Wx::PG::PGPropertyFlags.new(524288) # Indicates the bit usable by derived properties. # PG_PROP_CLASS_SPECIFIC_2 = Wx::PG::PGPropertyFlags.new(1048576) # Indicates that the property is being deleted and should be ignored. # PG_PROP_BEING_DELETED = Wx::PG::PGPropertyFlags.new(2097152) end # PGPropertyFlags # {Wx::PG::PGProperty} is base class for all {Wx::PG::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 {Wx::props.h} or {Wx::advprops.h}. # # - {Wx::PG::ArrayStringProperty} # # - {Wx::PG::BoolProperty} # # - {Wx::PG::ColourProperty} # # - {Wx::PG::CursorProperty} # # - {Wx::PG::DateProperty} # # - {Wx::PG::DirProperty} # # - {Wx::PG::EditEnumProperty} # # - {Wx::PG::EnumProperty} # # - {Wx::PG::FileProperty} # # - {Wx::PG::FlagsProperty} # # - {Wx::PG::FloatProperty} # # - {Wx::PG::FontProperty} # # - {Wx::PG::ImageFileProperty} # # - {Wx::PG::IntProperty} # # - {Wx::PG::LongStringProperty} # # - {Wx::PG::MultiChoiceProperty} # # - {Wx::PG::PropertyCategory} # # - {Wx::PG::StringProperty} # # - {Wx::PG::SystemColourProperty} # # - {Wx::PG::UIntProperty} # # ## wxPropertyCategory # # Not an actual property per se, but a header for a group of properties. Regardless inherits from {Wx::PG::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 {Wx::PG::PGProperty#set_value} with string argument. # # ## wxStringProperty # # Simple string property. # Supported special attributes: # # - {Wx::PG::PG_STRING_PASSWORD}: Set to true in order to echo value as asterisks and to use {Wx::TE_PASSWORD} on the editor ({Wx::TextCtrl}). # - {Wx::PG::PG_ATTR_AUTOCOMPLETE}: Set to true to enable auto-completion (use a {Wx::ArrayString} value), and is also supported by any property that happens to use a {Wx::TextCtrl}-based editor. # #
# Remark: #

{Wx::PG::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 {Wx::PG::FontProperty}, for instance. #

#
# # ## wxIntProperty # # It derives from {Wx::PG::NumericProperty} and displays value as a signed long integer. {Wx::PG::IntProperty} seamlessly supports 64-bit integers (i.e. {Wx::LongLong}) on overflow. To safely convert variant to integer, use code like this: # # ``` # wxLongLong ll; # ll << property->GetValue(); # # // or # wxLongLong ll = propertyGrid->GetPropertyValueAsLong(property); # ``` # # Getting 64-bit value: # ``` # wxLongLong_t value = pg->GetPropertyValueAsLongLong(); # # // or # # wxLongLong value; # wxVariant variant = property->GetValue(); # if ( variant.IsType(wxPG_VARIANT_TYPE_LONGLONG) ) # value = variant.GetLongLong(); # else # value = variant.GetLong(); # ``` # # Setting 64-bit value: # ``` # pg->SetPropertyValue(longLongVal); # # // or # # property->SetValue(WXVARIANT(longLongVal)); # ``` # # Supported special attributes: # # - {Wx::PG::PG_ATTR_MIN}, {Wx::PG::PG_ATTR_MAX} to specify acceptable value range. # - {Wx::PG::PG_ATTR_SPINCTRL_STEP}, {Wx::PG::PG_ATTR_SPINCTRL_WRAP}, {Wx::PG::PG_ATTR_SPINCTRL_MOTION}: Sets SpinCtrl editor parameters. # # ## wxUIntProperty # # Like {Wx::PG::IntProperty}, but displays value as unsigned int. To set the prefix used globally, manipulate {Wx::PG::PG_UINT_PREFIX} string attribute. To set the globally used base, manipulate {Wx::PG::PG_UINT_BASE} int attribute. Regardless of current prefix, understands (hex) values starting with both "0x" and "$" (apart from edit mode). Like {Wx::PG::IntProperty}, {Wx::PG::UIntProperty} seamlessly supports 64-bit unsigned integers (i.e. {Wx::ULongLong}). Same {Wx::Variant} safety rules apply. # Supported special attributes: # # - {Wx::PG::PG_ATTR_MIN}, {Wx::PG::PG_ATTR_MAX}: Specifies acceptable value range. # - {Wx::PG::PG_UINT_BASE}: Defines base. Valid constants are {Wx::PG::PG_BASE_OCT}, {Wx::PG::PG_BASE_DEC}, {Wx::PG::PG_BASE_HEX} and {Wx::PG::PG_BASE_HEXL} (lowercase characters). Arbitrary bases are not supported. # - {Wx::PG::PG_UINT_PREFIX}: Defines displayed prefix. Possible values are {Wx::PG::PG_PREFIX_NONE}, {Wx::PG::PG_PREFIX_0x} and {Wx::PG::PG_PREFIX_DOLLAR_SIGN}. Only {Wx::PG::PG_PREFIX_NONE} works with decimal and octal numbers. # - {Wx::PG::PG_ATTR_SPINCTRL_STEP}, {Wx::PG::PG_ATTR_SPINCTRL_WRAP}, {Wx::PG::PG_ATTR_SPINCTRL_MOTION}: Sets SpinCtrl editor parameters. # #
# Remark: #

For example how to use seamless 64-bit integer support, see {Wx::PG::IntProperty} documentation (just use {Wx::ULongLong} instead of {Wx::LongLong}). #

#
# # ## wxFloatProperty # # Like {Wx::PG::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 {Wx::PG::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: # # - {Wx::PG::PG_ATTR_MIN}, {Wx::PG::PG_ATTR_MAX}: Specifies acceptable value range. # - {Wx::PG::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. # - {Wx::PG::PG_ATTR_SPINCTRL_STEP}, {Wx::PG::PG_ATTR_SPINCTRL_WRAP}, {Wx::PG::PG_ATTR_SPINCTRL_MOTION}: Sets SpinCtrl editor parameters. # # ## wxBoolProperty # # Represents a boolean value. {Wx::Choice} is used as editor control, by the default. {Wx::PG::PG_BOOL_USE_CHECKBOX} attribute can be set to true in order to use check box instead. # Supported special attributes: # # - {Wx::PG::PG_BOOL_USE_CHECKBOX}: If set to true uses check box editor instead of combo box. # - {Wx::PG::PG_BOOL_USE_DOUBLE_CLICK_CYCLING}: If set to true cycles combo box instead showing the list. # # ## wxLongStringProperty # # Like {Wx::PG::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. "\r # # ", 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 # {Wx::PG::LongStringProperty} and override DisplayEditorDialog, like this: # # bool DisplayEditorDialog( {Wx::PG::PropertyGrid}* propGrid, {Wx::Variant}& value ) {Wx::OVERRIDE} # { # {Wx::Size} dialogSize(...size of your dialog...); # # {Wx::Point} dlgPos = propGrid->GetGoodEditorDialogPosition(this, # dialogSize) # # // Create dialog dlg at dlgPos. Use value as initial string # // value. # ... # # if ( dlg.ShowModal() == {Wx::StandardID::ID_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 |= {Wx::PG_PROP_NO_ESCAPE}; # # Supported special attributes: # - ::{Wx::PG::PG_DIALOG_TITLE}: Sets a specific title for the text editor dialog. # # ## {Wx::PG::DirProperty} # # Like {Wx::PG::LongStringProperty}, but the button triggers dir selector instead. # # Supported special attributes: # - ::{Wx::PG::PG_DIALOG_TITLE}: Sets specific title for the dir selector. # # ## {Wx::PG::FileProperty} # # Like {Wx::PG::LongStringProperty}, but the button triggers file selector instead. # Default wildcard is "All files..." but this can be changed by setting # ::{Wx::PG::PG_FILE_WILDCARD} attribute. # # Supported special attributes: # - ::{Wx::PG::PG_DIALOG_TITLE}: Sets a specific title for the file dialog. # - ::{Wx::PG::PG_FILE_DIALOG_STYLE}: Sets a specific {Wx::FileDialog} style for the file dialog. # - ::{Wx::PG::PG_FILE_WILDCARD}: Sets wildcard (see {Wx::FileDialog} for format details), "All files..." is default. # - ::{Wx::PG::PG_FILE_SHOW_FULL_PATH}: Default true. When false, only the file name is shown # (i.e. drive and directory are hidden). # - ::{Wx::PG::PG_FILE_SHOW_RELATIVE_PATH}: If set, then the filename is shown relative to the # given path string. # - ::{Wx::PG::PG_FILE_INITIAL_PATH}: Sets the initial path of where to look for files. # # ## {Wx::PG::EnumProperty} # # Represents a single selection from a list of choices - # {Wx::OwnerDrawnComboBox} is used to edit the value. # # ## {Wx::PG::FlagsProperty} # # Represents a bit set that fits in a long integer. {Wx::PG::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 {Wx::PG::FlagsProperty}, # you will need to use {Wx::PG::PGProperty#set_choices} - otherwise they will not # get updated properly. # # {Wx::PG::FlagsProperty} supports the same attributes as {Wx::PG::BoolProperty}. # # ## {Wx::PG::ArrayStringProperty} # # Property that manages a list of strings. Allows editing of a list # of strings in {Wx::TextCtrl} and in a separate dialog. # # Supported special attributes: # - ::{Wx::PG::PG_ARRAY_DELIMITER}: Sets string delimiter character. # - ::{Wx::PG::PG_DIALOG_TITLE}: Sets a specific title for the editor dialog. # Default is comma (','). # # ## {Wx::PG::DateProperty} # # Property representing {Wx::DateTime}. Default editor is DatePickerCtrl, # although TextCtrl should work as well. # # Supported special attributes: # - ::{Wx::PG::PG_DATE_FORMAT}: Determines displayed date format (with Wx::DateTime::Format). # Default is recommended as it is locale-dependent. # - ::{Wx::PG::PG_DATE_PICKER_STYLE}: Determines window style used with {Wx::DatePickerCtrl}. # Default is ::{Wx::DP_DEFAULT} | ::{Wx::DP_SHOWCENTURY}. Using ::{Wx::DP_ALLOWNONE} # enables additional support for unspecified property value. # # ## {Wx::PG::EditEnumProperty} # # 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 {Wx::PG::EnumProperty}, unless text entered by user is # is not in choices (in which case string value is used). # # ## {Wx::PG::MultiChoiceProperty} # # Allows editing a multiple selection from a list of strings. This is # property is pretty much built around concept of {Wx::MultiChoiceDialog}. # It uses {Wx::ArrayString} value. # # Supported special attributes: # - ::{Wx::PG::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. # - ::{Wx::PG::PG_DIALOG_TITLE}: Sets a specific title for the editor dialog. # # ## {Wx::PG::ImageFileProperty} # # Property representing image file(name). Like {Wx::PG::FileProperty}, # but has thumbnail of the image in front of the filename # and autogenerates wildcard from available image handlers. # # Supported special attributes: # - ::{Wx::PG::PG_DIALOG_TITLE}: Sets a specific title for the file dialog. # - ::{Wx::PG::PG_FILE_DIALOG_STYLE}: Sets a specific {Wx::FileDialog} style for the file dialog. # - ::{Wx::PG::PG_FILE_WILDCARD}: Sets wildcard (see {Wx::FileDialog} for format details), "All files..." is default. # # - {Wx::PG::PG_FILE_SHOW_FULL_PATH}: Default true. When false, only the file name is shown (i.e. drive and directory are hidden). # - {Wx::PG::PG_FILE_SHOW_RELATIVE_PATH}: If set, then the filename is shown relative to the given path string. # - {Wx::PG::PG_FILE_INITIAL_PATH}: Sets the initial path of where to look for files. # # ## wxColourProperty # # Useful alternate editor: Choice. # Represents {Wx::Colour}. {Wx::Button} is used to trigger a colour picker dialog. There are various sub-classing opportunities with this class. See below in {Wx::PG::SystemColourProperty} section for details. # Supported special attributes: # # - {Wx::PG::PG_COLOUR_HAS_ALPHA}: If set to true allows user to edit the alpha colour component. # # ## wxFontProperty # # Represents {Wx::Font}. Various sub-properties are used to edit individual subvalues. # Supported special attributes: # # - {Wx::PG::PG_DIALOG_TITLE}: Sets a specific title for the font dialog. # # ## wxSystemColourProperty # # Represents {Wx::Colour} and a system colour index. {Wx::Choice} is used to edit the value. Drop-down list has color images. Note that value type is {Wx::PG::ColourPropertyValue} instead of {Wx::Colour} (which {Wx::PG::ColourProperty} uses). # # In {Wx::PG::SystemColourProperty}, and its derived class {Wx::PG::ColourProperty}, there are various sub-classing features. To set a basic list of colour names, call {Wx::PG::PGProperty#set_choices}. # # ```ruby # # 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 {Wx::Cursor}. {Wx::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 {Wx::PG::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: # # ``` ruby # 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: {Wx::PG::PropertyGrid} # @see wxPropertyGrid Property Attribute Identifiers # # @see wxPropertyGrid Property Attribute Identifiers # # @see wxPropertyGrid Property Attribute Identifiers # # @see wxPropertyGrid Property Attribute Identifiers # # @see wxPropertyGrid Property Attribute Identifiers # # @see wxPropertyGrid Property Attribute Identifiers # # @see wxPropertyGrid Property Attribute Identifiers # # # @wxrb_require USE_PROPGRID class PGProperty < Object # This virtual function is called after m_value has been set. # #
# Remark: #

# # - If m_value was set to Null variant (i.e. unspecified value), {Wx::PG::PGProperty#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 {Wx::PG::PGProperty#on_set_value} provides a good opportunity to convert supported values into internal type. # - Default implementation does nothing. # #

#
# @return [void] def on_set_value; end # Override this to return something else than m_value as the value. # @return [Wx::Variant] def do_get_value; end # 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. # #

#
# @param value [Wx::Variant] # @param validationInfo [Wx::PG::PGValidationInfo] # @return [Boolean] def validate_value(value, validationInfo) end # Converts text into {Wx::Variant} value appropriate for this property. # # Returns true if resulting {Wx::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). # @param variant [Wx::Variant] On function entry this is the old value (should not be {Wx::NullVariant} in normal cases). Translated value must be assigned back to it. # @param text [String] Text to be translated into variant. # @param argFlags [Integer] 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 {Wx::PG::PGProperty#value_to_string} called with this same flag). # @return [Boolean] def string_to_value(variant, text, argFlags=0) end # Converts integer (possibly a choice selection) into {Wx::Variant} value appropriate for this property. # # Returns true if resulting {Wx::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). # #

#
# @param variant [Wx::Variant] On function entry this is the old value (should not be {Wx::NullVariant} in normal cases). Translated value must be assigned back to it. # @param number [Integer] Integer to be translated into variant. # @param argFlags [Integer] If {Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE} is set, returns complete, storable value instead of displayable one. # @return [Boolean] def int_to_value(variant, number, argFlags=0) end # Converts property value into a text representation. # #
# Remark: #

Default implementation calls {Wx::PG::PGProperty#generate_composed_value}. #

#
# @param value [Wx::Variant] Value to be converted. # @param argFlags [Integer] If 0 (default value), then displayed string is returned. If {Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE} is set, returns complete, storable string value instead of displayable. If {Wx::PG::PG_MISC_ARG_FLAGS::PG_EDITABLE_VALUE} is set, returns string value that must be editable in textctrl. If {Wx::PG::PG_MISC_ARG_FLAGS::PG_COMPOSITE_FRAGMENT} is set, returns text that is appropriate to display as a part of string property's composite text representation. # @return [String] def value_to_string(value, argFlags=0) end # Converts string to a value, and if successful, calls {Wx::PG::PGProperty#set_value} on it. # # Default behaviour is to do nothing. # # true if value was changed. # @param text [String] String to get the value from. # @param flags [Integer] 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). # @return [Boolean] def set_value_from_string(text, flags=Wx::PG::PG_MISC_ARG_FLAGS::PG_PROGRAMMATIC_VALUE) end alias_method :value_from_string=, :set_value_from_string # Converts integer to a value, and if successful, calls {Wx::PG::PGProperty#set_value} on it. # # Default behaviour is to do nothing. # # true if value was changed. # @param value [Integer] Int to get the value from. # @param flags [Integer] If has {Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE}, then the value given is an actual value and not an index. # @return [Boolean] def set_value_from_int(value, flags=0) end alias_method :value_from_int=, :set_value_from_int # 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 {Wx::DEFAULT_SIZE}. # #

#
# @param item [Integer] Normally -1, but can be an index to the property's list of items. # @return [Wx::Size] def on_measure_image(item=-1) end # 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, {Wx::PG::SystemColourProperty} custom handles {Wx::EVT_CHOICE} to display colour picker dialog when 'custom' selection is made). # If the event causes value to be changed, {Wx::PG::PGProperty#set_value_in_event} should be called to set the new value. # The parameter event is the associated {Wx::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. # #

#
# @param propgrid [Wx::PG::PropertyGrid] # @param wnd_primary [Wx::Window] # @param event [Wx::Event] # @return [Boolean] def on_event(propgrid, wnd_primary, event) end # 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 {Wx::PG::PGProperty#get_value} or m_value should not be relied on. # Sample pseudo-code implementation: # # ```ruby # 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. # @param 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). # @param childIndex [Integer] Index of child changed (you can use Item(childIndex) to get child property). # @param childValue [Wx::Variant] (Pending) value of the child property. # @return [Wx::Variant] def child_changed(thisValue, childIndex, childValue) end # Returns pointer to an instance of used editor. # @return [Wx::PG::PGEditor] def do_get_editor_class; end # Returns pointer to the {Wx::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: # # ```ruby # 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 {Wx::PG::FileProperty.get_class_validator}. {Wx::PG::DirProperty}, for example, uses it. #

#
# @return [Wx::Validator] def do_get_validator; end # Override to paint an image in front of the property value text or drop-down list item (but only if {Wx::PG::PGProperty#on_measure_image} is overridden as well). # # If property's {Wx::PG::PGProperty#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 {Wx::PG::PGProperty#on_measure_image} returned higher height than row height). # NOTE: Following applies when {Wx::PG::PGProperty#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. # #

#
# @see Wx::PG::PGProperty#value_to_string # @param dc [Wx::DC] {Wx::DC} to paint on. # @param 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). # @param paintdata [Wx::PG::PGPaintData] {Wx::PG::PGPaintData} structure with much useful data about painted item. # @return [void] def on_custom_paint(dc, rect, paintdata) end # 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. # @return [Integer] def get_choice_selection; end alias_method :choice_selection, :get_choice_selection # Refresh values of child properties. # # Automatically called after value is set. # @return [void] def refresh_children; end # 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 {Wx::PG::PGProperty#set_attribute} instead. #

#
# @param name [String] # @param value [Wx::Variant] # @return [Boolean] def do_set_attribute(name, value) end # Returns value of an attribute. # # Override if custom handling of attributes is needed. # Default implementation simply return NULL variant. # @param name [String] # @return [Wx::Variant] def do_get_attribute(name) end # 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). # @return [Wx::PG::PGEditorDialogAdapter] def get_editor_dialog; end alias_method :editor_dialog, :get_editor_dialog # 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. #

#
# @param pendingValue [Wx::Variant] # @return [void] def on_validation_failure(pendingValue) end # Append a new choice to property's list of choices. # # Index to added choice. # @param label [String] Label for added choice. # @param value [Integer] Value for new choice. Do not specify if you wish this to equal choice index. # @return [Integer] def add_choice(label, value=Wx::PG::PG_INVALID_VALUE) end # 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. # @param prop [Wx::PG::PGProperty] # @return [void] def add_private_child(prop) end # Adapts list variant into proper value using consecutive {Wx::PG::PGProperty#child_changed} calls. # @param list [Wx::Variant] # @param value [Wx::Variant] # @return [void] def adapt_list_to_value(list, value) end # 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. #

#
# @see Wx::PG::PGProperty#insert_child # @see Wx::PG::PGProperty#add_private_child # @param childProperty [Wx::PG::PGProperty] # @return [Wx::PG::PGProperty] def append_child(childProperty) end # Determines, recursively, if all children are not unspecified. # @param pendingList [Wx::Variant] Assumes members in this {Wx::Variant} list as pending replacement values. # @return [Boolean] def are_all_children_specified(pendingList=nil) end # 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). # @return [Boolean] def are_children_components; end # 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. #

#
# @see Wx::PG::PGProperty#has_flag # @see GetFlags() # @param flag [Wx::PGPropertyFlags] # @param set [Boolean] # @return [void] def change_flag(flag, set) end # Deletes children of the property. # @return [void] def delete_children; end # 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. # @param index [Integer] # @return [void] def delete_choice(index) end # Enables or disables the property. # # Disabled property usually appears as having grey text. # @see Wx::PG::PropertyGridInterface#enable_property # @param enable [Boolean] If false, property is disabled instead. # @return [void] def enable(enable=true) end # 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. # @param enable [Boolean] # @return [void] def enable_common_value(enable=true) end # Composes text from values of child properties. # @return [String] def generate_composed_value; end # Returns property's label. # @return [Wx::String] def get_label; end alias_method :label, :get_label # @overload get_attribute(name) # Returns property attribute value, null variant if not found. # #
# Remark: #

For built-in attribute returns null variant if extra style {Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES} is set. #

#
# @param name [String] # @return [Wx::Variant] # @overload get_attribute(name, defVal) # Returns named attribute, as string, 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. #

#
# @param name [String] # @param defVal [String] # @return [String] def get_attribute(*args) end alias_method :attribute, :get_attribute # 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. #

#
# @param name [String] # @param defVal [Integer] # @return [Integer] def get_attribute_as_long(name, defVal) end alias_method :attribute_as_long, :get_attribute_as_long # 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. #

#
# @param name [String] # @param defVal [Float] # @return [Float] def get_attribute_as_double(name, defVal) end alias_method :attribute_as_double, :get_attribute_as_double # 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. #

#
# @return [Wx::PGAttributeStorage] def get_attributes; end alias_method :attributes, :get_attributes # Returns attributes as list {Wx::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. #

#
# @return [Wx::Variant] def get_attributes_as_list; end alias_method :attributes_as_list, :get_attributes_as_list # Returns editor used for given column. # # NULL for no editor. # @param column [Integer] # @return [Wx::PG::PGEditor] def get_column_editor(column) end alias_method :column_editor, :get_column_editor # Returns property's base name (i.e. # # parent's name is not added in any case). # @return [Wx::String] def get_base_name; end alias_method :base_name, :get_base_name # 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. #

#
# @param column [Integer] # @return [Wx::PG::PGCell] def get_cell_or_default(column) end alias_method :cell_or_default, :get_cell_or_default # Returns {Wx::PG::PGCell} of given column, creating one if necessary. # @param column [Integer] # @return [Wx::PG::PGCell] def get_cell(column) end alias_method :cell, :get_cell # Returns number of child properties. # @return [Integer] def get_child_count; end alias_method :child_count, :get_child_count # Returns height of children, recursively, and by taking expanded/collapsed status into account. # @param lh [Integer] Line height. Pass result of {Wx::PG::PGProperty#get_grid}->GetRowHeight() here. # @param iMax [Integer] Only used (internally) when finding property y-positions. # @return [Integer] def get_children_height(lh, iMax=-1) end alias_method :children_height, :get_children_height # Returns read-only reference to property's list of choices. # @return [Wx::PG::PGChoices] def get_choices; end alias_method :choices, :get_choices # Gets managed client object of a property. # @return [Object] def get_client_object; end alias_method :client_object, :get_client_object # 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. # @return [Wx::Variant] def get_default_value; end alias_method :default_value, :get_default_value # Returns common value selected for this property. # # -1 for none. # @return [Integer] def get_common_value; end alias_method :common_value, :get_common_value # @return [Integer] def get_depth; end alias_method :depth, :get_depth # Return number of displayed common values for this property. # @return [Integer] def get_displayed_common_value_count; end alias_method :displayed_common_value_count, :get_displayed_common_value_count # Returns property's displayed text. # @return [String] def get_displayed_string; end alias_method :displayed_string, :get_displayed_string # Returns {Wx::PG::PGEditor} that will be used and created when property becomes selected. # # Returns more accurate value than {Wx::PG::PGProperty#do_get_editor_class}. # @return [Wx::PG::PGEditor] def get_editor_class; end alias_method :editor_class, :get_editor_class # Returns property's hint text (shown in empty value cell). # @return [String] def get_hint_text; end alias_method :hint_text, :get_hint_text # Returns property grid where property lies. # @return [Wx::PG::PropertyGrid] def get_grid; end alias_method :grid, :get_grid # Returns owner {Wx::PG::PropertyGrid}, but only if one is currently on a page displaying this property. # @return [Wx::PG::PropertyGrid] def get_grid_if_displayed; end alias_method :grid_if_displayed, :get_grid_if_displayed # Returns property's help or description text. # # # @see Wx::PG::PGProperty#set_help_string # @return [Wx::String] def get_help_string; end alias_method :help_string, :get_help_string # Gets flags as a'|' delimited string. # # Note that flag names are not prepended with '{Wx::PG_PROP_}'. # @param flagsMask [Integer] String will only be made to include flags combined by this parameter. # @return [String] def get_flags_as_string(flagsMask) end alias_method :flags_as_string, :get_flags_as_string # Returns position in parent's array. # @return [Integer] def get_index_in_parent; end alias_method :index_in_parent, :get_index_in_parent # Returns last visible child property, recursively. # @return [Wx::PG::PGProperty] def get_last_visible_sub_item; end alias_method :last_visible_sub_item, :get_last_visible_sub_item # 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. #

#
# @return [Wx::PG::PGProperty] def get_main_parent; end alias_method :main_parent, :get_main_parent # 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. #

#
# @return [Integer] def get_max_length; end alias_method :max_length, :get_max_length # Returns property's name with all (non-category, non-root) parents. # @return [String] def get_name; end alias_method :name, :get_name # Return parent of property. # @return [Wx::PG::PGProperty] def get_parent; end alias_method :parent, :get_parent # Returns (direct) child property with given name (or NULL if not found). # @param name [String] Name of the child property to look for. # @return [Wx::PG::PGProperty] def get_property_by_name(name) end alias_method :property_by_name, :get_property_by_name # Gets assignable version of property's validator. # @return [Wx::Validator] def get_validator; end alias_method :validator, :get_validator # Returns property's value. # @return [Wx::Variant] def get_value; end alias_method :value, :get_value # Returns bitmap that appears next to value text. # # Only returns non-NULL bitmap if one was set with {Wx::PG::PGProperty#set_value_image}. # @return [Wx::Bitmap] def get_value_image; end alias_method :value_image, :get_value_image # 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 {Wx::PG::PGProperty#value_to_string}, and overriding this function now will result in run-time assertion failure. #

#
# @param argFlags [Integer] If 0 (default value), then displayed string is returned. If {Wx::PG::PG_MISC_ARG_FLAGS::PG_FULL_VALUE} is set, returns complete, storable string value instead of displayable. If {Wx::PG::PG_MISC_ARG_FLAGS::PG_EDITABLE_VALUE} is set, returns string value that must be editable in textctrl. If {Wx::PG::PG_MISC_ARG_FLAGS::PG_COMPOSITE_FRAGMENT} is set, returns text that is appropriate to display as a part of string property's composite text representation. # @return [String] def get_value_as_string(argFlags=0) end alias_method :value_as_string, :get_value_as_string # Returns value type used by this property. # @return [String] def get_value_type; end alias_method :value_type, :get_value_type # Returns coordinate to the top y of the property. # # Note that the position of scrollbars is not taken into account. # @return [Integer] def get_y; end alias_method :y, :get_y # Converts image width into full image offset, with margins. # @param imageWidth [Integer] # @return [Integer] def get_image_offset(imageWidth) end alias_method :image_offset, :get_image_offset # Returns property at given virtual y coordinate. # @param y [Integer] # @return [Wx::PG::PGProperty] def get_item_at_y(y) end alias_method :item_at_y, :get_item_at_y # @overload has_flag(flag) # Returns true if property has given flag set. # # # @see propgrid_propflags # @param flag [Wx::PGPropertyFlags] # @return [Boolean] # @overload has_flag(flag) # Returns true if property has given flag set. # @param flag [Integer] # @return [Boolean] def has_flag(*args) end alias_method :has_flag?, :has_flag # Returns true if property has all given flags set. # @param flags [Integer] # @return [Boolean] def has_flags_exact(flags) end alias_method :has_flags_exact?, :has_flags_exact # Returns true if property has even one visible child. # @return [Boolean] def has_visible_children; end alias_method :has_visible_children?, :has_visible_children # Hides or reveals the property. # @param hide [Boolean] true for hide, false for reveal. # @param flags [Integer] By default changes are applied recursively. Set this parameter to {Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_DONT_RECURSE} to prevent this. # @return [Boolean] def hide(hide, flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end # Returns index of given child property. # # {Wx::NOT_FOUND} if given property is not child of this. # @param p [Wx::PG::PGProperty] # @return [Integer] def index(p) end # 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. #

#
# @see Wx::PG::PGProperty#append_child # @see Wx::PG::PGProperty#add_private_child # @param index [Integer] # @param childProperty [Wx::PG::PGProperty] # @return [Wx::PG::PGProperty] def insert_child(index, childProperty) end # Inserts a new choice to property's list of choices. # @param label [String] Text for new choice # @param index [Integer] Insertion position. Use {Wx::NOT_FOUND} to append. # @param value [Integer] Value for new choice. Do not specify if you wish this to equal choice index. # @return [Integer] def insert_choice(label, index, value=Wx::PG::PG_INVALID_VALUE) end # Returns true if this property is actually a {Wx::PG::PropertyCategory}. # @return [Boolean] def is_category; end alias_method :category?, :is_category # Returns true if property is enabled. # @return [Boolean] def is_enabled; end alias_method :enabled?, :is_enabled # Returns true if property has visible children. # @return [Boolean] def is_expanded; end alias_method :expanded?, :is_expanded # Returns true if this property is actually a {Wx::RootProperty}. # @return [Boolean] def is_root; end alias_method :root?, :is_root # Returns true if this is a sub-property. # @return [Boolean] def is_sub_property; end alias_method :sub_property?, :is_sub_property # Returns true if candidateParent is some parent of this property. # # Use, for example, to detect if item is inside collapsed section. # @param candidateParent [Wx::PG::PGProperty] # @return [Boolean] def is_some_parent(candidateParent) end alias_method :some_parent?, :is_some_parent # Returns true if property has editable {Wx::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). #

#
# @return [Boolean] def is_text_editable; end alias_method :text_editable?, :is_text_editable # Returns true if property's value is considered unspecified. # # This usually means that value is Null variant. # @return [Boolean] def is_value_unspecified; end alias_method :value_unspecified?, :is_value_unspecified # Returns true if all parents expanded. # @return [Boolean] def is_visible; end alias_method :visible?, :is_visible # Returns child property at index i. # @param i [Integer] # @return [Wx::PG::PGProperty] def item(i) end # Returns last sub-property. # @return [Wx::PG::PGProperty] def last; end # If property's editor is created this forces its recreation. # # Useful in SetAttribute etc. Returns true if actually did anything. # @return [Boolean] def recreate_editor; end # If property's editor is active, then update it's value. # @return [void] def refresh_editor; end # Sets an attribute for this property. # #
# Remark: #

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

#
# @param name [String] Text identifier of attribute. See wxPropertyGrid Property Attribute Identifiers. # @param value [nil,String,Integer,Float,Time,Wx::Font,Wx::Colour,Wx::Variant,Array,Array,ObjectWx::PG::ColourPropertyValue] Value of attribute. # @return [void] def set_attribute(name, value) end # @param attributes [Wx::PGAttributeStorage] # @return [void] def set_attributes(attributes) end # 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: {Wx::PG::IntProperty}, {Wx::PG::UIntProperty}, {Wx::PG::FloatProperty}, {Wx::PG::EditEnumProperty}. # @param enable [Boolean] Whether to enable or disable this behaviour (it is disabled by default). # @return [void] def set_auto_unspecified(enable=true) end alias_method :auto_unspecified=, :set_auto_unspecified # Sets property's background colour. # #
# Remark: #

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

#
# @param colour [Wx::Colour,String,Symbol] Background colour to use. # @param flags [Integer] 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. # @return [void] def set_background_colour(colour, flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end alias_method :background_colour=, :set_background_colour # @overload set_editor(editor) # Sets editor for a property. # # For custom editors, use pointer you received from {Wx::PG::PropertyGrid.register_editor_class}. # @param 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). # @return [void] # @overload set_editor(editorName) # Sets editor for a property, by editor name. # @param editorName [String] # @return [void] def set_editor(*args) end alias_method :editor=, :set_editor # Sets cell information for given column. # @param column [Integer] # @param cell [Wx::PG::PGCell] # @return [void] def set_cell(column, cell) end # Sets common value selected for this property. # # -1 for none. # @param commonValue [Integer] # @return [void] def set_common_value(commonValue) end alias_method :common_value=, :set_common_value # Sets new set of choices for the property. # #
# Remark: #

This operation deselects the property and clears its value. #

#
# @param choices [Wx::PG::PGChoices] # @return [Boolean] def set_choices(choices) end alias_method :choices=, :set_choices # Sets client object of a property. # @param clientObject [Object] # @return [void] def set_client_object(clientObject) end alias_method :client_object=, :set_client_object # 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. # @param newValue [Integer] # @return [void] def set_choice_selection(newValue) end alias_method :choice_selection=, :set_choice_selection # Set default value of a property. # # Synonymous to # # ```ruby # set_attribute('DefaultValue', value) # ``` # @param value [Wx::Variant] # @return [void] def set_default_value(value) end alias_method :default_value=, :set_default_value # @param expanded [Boolean] # @return [void] def set_expanded(expanded) end alias_method :expanded=, :set_expanded # Sets flags from a '|' delimited string. # # Note that flag names are not prepended with '{Wx::PG_PROP_}'. # @param str [String] # @return [void] def set_flags_from_string(str) end alias_method :flags_from_string=, :set_flags_from_string # Sets or clears given property flag, recursively. # # This function is primarily intended for internal use. # @see Wx::PG::PGProperty#change_flag # @param flag [Wx::PGPropertyFlags] # @param set [Boolean] # @return [void] def set_flag_recursively(flag, set) end # Sets property's help string, which is shown, for example, in {Wx::PG::PropertyGridManager}'s description text box. # @param helpString [String] # @return [void] def set_help_string(helpString) end alias_method :help_string=, :set_help_string # 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. # #

#
# @param label [String] # @return [void] def set_label(label) end alias_method :label=, :set_label # 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. # @param maxLen [Integer] # @return [Boolean] def set_max_length(maxLen) end alias_method :max_length=, :set_max_length # Sets property's "is it modified?" flag. # # Affects children recursively. # @param modified [Boolean] # @return [void] def set_modified_status(modified) end alias_method :modified_status=, :set_modified_status # Sets new (base) name for property. # @param newName [String] # @return [void] def set_name(newName) end alias_method :name=, :set_name # Changes what sort of parent this property is for its children. # #
# Remark: #

You generally do not need to call this function. #

#
# @param flag [Integer] Use one of the following values: {Wx::PG::PGPropertyFlags::PG_PROP_MISC_PARENT} (for generic parents), {Wx::PG::PGPropertyFlags::PG_PROP_CATEGORY} (for categories), or {Wx::PG::PGPropertyFlags::PG_PROP_AGGREGATE} (for derived property classes with private children). # @return [void] def set_parental_type(flag) end alias_method :parental_type=, :set_parental_type # Sets property's text colour. # #
# Remark: #

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

#
# @param colour [Wx::Colour,String,Symbol] Text colour to use. # @param flags [Integer] 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. # @return [void] def set_text_colour(colour, flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end alias_method :text_colour=, :set_text_colour # 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. #

#
# @param flags [Integer] 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. # @return [void] def set_default_colours(flags=Wx::PG::PG_GETPROPERTYVALUES_FLAGS::PG_RECURSE) end alias_method :default_colours=, :set_default_colours # Sets {Wx::Validator} for a property. # @param validator [Wx::Validator] # @return [void] def set_validator(validator) end alias_method :validator=, :set_validator # 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 {Wx::PG::PGProperty#set_value_in_event} instead. # @param value [nil,String,Integer,Float,Time,Wx::Font,Wx::Colour,Wx::Variant,Array,Array,ObjectWx::PG::ColourPropertyValue] The value to set. # @param pList [Wx::Variant] Pointer to list variant that contains child values. Used to indicate which children should be marked as modified. Usually you just use NULL. # @param flags [Integer] {Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR} is set by default, to refresh editor and redraw properties. # @return [void] def set_value(value, pList=nil, flags=Wx::PG::PG_SETVALUE_FLAGS::PG_SETVAL_REFRESH_EDITOR) end alias_method :value=, :set_value # Set {Wx::Bitmap} taken from {Wx::BitmapBundle} in front of the value. # # This bitmap may be ignored by custom cell renderers. # @param bmp [Wx::BitmapBundle] # @return [void] def set_value_image(bmp) end alias_method :value_image=, :set_value_image # Call this function in {Wx::PG::PGProperty#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}. #

#
# @param value [nil,String,Integer,Float,Time,Wx::Font,Wx::Colour,Wx::Variant,Array,Array,ObjectWx::PG::ColourPropertyValue] # @return [void] def set_value_in_event(value) end alias_method :value_in_event=, :set_value_in_event # Sets property's value to unspecified (i.e. # # Null variant). # @return [void] def set_value_to_unspecified; end # Call with false in {Wx::PG::PGProperty#on_set_value} to cancel value changes after all (i.e. # # cancel true returned by {Wx::PG::PGProperty#string_to_value} or {Wx::PG::PGProperty#int_to_value}). # @param set [Boolean] # @return [void] def set_was_modified(set=true) end alias_method :was_modified=, :set_was_modified # Updates composed values of parent non-category properties, recursively. # # Returns topmost property updated. # #
# Remark: #

Must not call {Wx::PG::PGProperty#set_value} (as can be called in it). #

#
# @return [Wx::PG::PGProperty] def update_parent_values; end # Returns true if containing grid uses {Wx::PG::PG_EX_WINDOW_STYLES::PG_EX_AUTO_UNSPECIFIED_VALUES}. # @return [Boolean] def uses_auto_unspecified; end # Clear cells associated with property. # @param ignoreWithFlags [Integer] Cells will not be cleared for properties having these flags set. # @param recursively [Boolean] If true, apply this operation recursively in child properties. # @return [void] def clear_cells(ignoreWithFlags, recursively) end # Makes sure m_cells has size of column+1 (or more). # @param column [Integer] # @return [void] def ensure_cells(column) end # 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). #

#
# @param name [String] Name of the child property to look for. # @param hintIndex [Integer] Start looking for the child at this index. # @return [Wx::PG::PGProperty] def get_property_by_name_wh(name, hintIndex) end alias_method :property_by_name_wh, :get_property_by_name_wh # Deletes all child properties. # @return [void] def empty; end # Returns true if child property is selected. # @param recursive [Boolean] # @return [Boolean] def is_child_selected(recursive=false) end alias_method :child_selected?, :is_child_selected # # @return [Wx::Variant] def value_; end # # @param val [nil,String,Integer,Float,Time,Wx::Font,Wx::Colour,Wx::Variant,Array,Array,ObjectWx::PG::ColourPropertyValue] # @return [void] def value_=(val); end protected # @overload initialize() # Default constructor. # # It is protected because {Wx::PG::PGProperty} is only a base class for other property classes. # @return [Wx::PG::PGProperty] # @overload initialize(label, name) # Constructor. # # It is protected because {Wx::PG::PGProperty} is only a base class for other property classes. Non-abstract property classes should have constructor of this style: # # ```ruby # class WxPointProperty < Wx::PG::PGProperty # # def initialize(label = Wx::PG::PG_LABEL, name = Wx::PG::PG_LABEL, value = Wx::Point.new) # super(label, name) # # # should work in pretty much 100% of cases # self.value = value # # # add private child properties # add_private_child( Wx::PG::IntProperty.new("X", Wx::PG::PG_LABEL,value.x)) # add_private_child( Wx::PG::IntProperty.new("Y", Wx::PG::PG_LABEL,value.y)) # end # # # ... # # end # ``` # @param label [String] # @param name [String] # @return [Wx::PG::PGProperty] def initialize(*args) end end # PGProperty # Helper class for managing choices of {Wx::PG::PropertyGrid} properties. # # Each entry can have label, value, bitmap, text colour, and background colour. # {Wx::PG::PGChoices} uses reference counting, similar to other wxWidgets classes. This means that assignment operator and copy constructor only copy the reference and not the actual data. Use {Wx::PG::PGChoices#copy} member function to create a real copy. # #
# Remark: #

If you do not specify value for entry, index is used. #

#
# # Category: {Wx::PG::PropertyGrid} # # # @note This class is untracked and should not be derived from nor instances extended! # @wxrb_require USE_PROPGRID class PGChoices < ::Object # @overload initialize() # Default constructor. # @return [Wx::PG::PGChoices] # @overload initialize(a) # Copy constructor, uses reference counting. # # To create a real copy, use {Wx::PG::PGChoices#copy} member function instead. # @param a [Wx::PG::PGChoices] # @return [Wx::PG::PGChoices] # @overload initialize(labels, values=(Wx::ArrayInt.new())) # Constructor. # @param labels [Array] Labels for choices. # @param values [Array] Values for choices. If empty, indexes are used. Otherwise must have at least the same size as labels. # @return [Wx::PG::PGChoices] def initialize(*args) end # @overload add(arr, arrint) # This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. # @param arr [Array] # @param arrint [Array] # @return [void] # @overload add(label, value=Wx::PG::PG_INVALID_VALUE) # Adds a single choice item. # @param label [String] Label for added choice. # @param value [Integer] Value for added choice. If unspecified, index is used. # @return [Wx::PG::PGChoiceEntry] # @overload add(label, bitmap, value=Wx::PG::PG_INVALID_VALUE) # Adds a single item, with bitmap. # @param label [String] # @param bitmap [Wx::Bitmap] # @param value [Integer] # @return [Wx::PG::PGChoiceEntry] # @overload add(entry) # Adds a single item with full entry information. # @param entry [Wx::PG::PGChoiceEntry] # @return [Wx::PG::PGChoiceEntry] def add(*args) end # Adds a single item, sorted. # @param label [String] # @param value [Integer] # @return [Wx::PG::PGChoiceEntry] def add_as_sorted(label, value=Wx::PG::PG_INVALID_VALUE) end # Assigns choices data, using reference counting. # # To create a real copy, use {Wx::PG::PGChoices#copy} member function instead. # @param a [Wx::PG::PGChoices] # @return [void] def assign(a) end # Deletes all items. # @return [void] def clear; end # Returns a real copy of the choices. # @return [Wx::PG::PGChoices] def copy; end # @return [void] def ensure_data; end # Returns label of item. # @param ind [Integer] # @return [Wx::String] def get_label(ind) end alias_method :label, :get_label # Returns number of items. # @return [Integer] def get_count; end alias_method :count, :get_count # Returns value of item. # @param ind [Integer] # @return [Integer] def get_value(ind) end alias_method :value, :get_value # Returns array of values matching the given strings. # # Unmatching strings result in {Wx::PG::PG_INVALID_VALUE} entry in array. # @param strings [Array] # @return [Array] def get_values_for_strings(strings) end alias_method :values_for_strings, :get_values_for_strings # Returns array of indices matching given strings. # # Unmatching strings are added to 'unmatched', if not NULL. # @param strings [Array] # @param unmatched [Array,nil] # @return [Array] def get_indices_for_strings(strings, unmatched=nil) end alias_method :indices_for_strings, :get_indices_for_strings # @overload index(label) # Returns index of item with given label. # @param label [String] # @return [Integer] # @overload index(val) # Returns index of item with given value. # @param val [Integer] # @return [Integer] def index(*args) end # @overload insert(label, index, value=Wx::PG::PG_INVALID_VALUE) # Inserts a single item. # @param label [String] # @param index [Integer] # @param value [Integer] # @return [Wx::PG::PGChoiceEntry] # @overload insert(entry, index) # Inserts a single item with full entry information. # @param entry [Wx::PG::PGChoiceEntry] # @param index [Integer] # @return [Wx::PG::PGChoiceEntry] def insert(*args) end # Returns false if this is a constant empty set of choices, which should not be modified. # @return [Boolean] def is_ok; end alias_method :ok?, :is_ok # Returns item at given index. # @param i [Integer] # @return [Wx::PG::PGChoiceEntry] def item(i) end # Removes count items starting at position nIndex. # @param nIndex [Integer] # @param count [Integer] # @return [void] def remove_at(nIndex, count=1) end # This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. # @param labels [Array] # @param values [Array] # @return [void] def set(labels, values=(Wx::ArrayInt.new())) end # Creates exclusive copy of current choices. # @return [void] def alloc_exclusive; end # Returns array of choice labels. # @return [Array] def get_labels; end alias_method :labels, :get_labels # @overload [](i) # @param i [Integer] # @return [Wx::PG::PGChoiceEntry] # @overload [](i) # @param i [Integer] # @return [Wx::PG::PGChoiceEntry] def [](*args) end end # PGChoices # Contains information related to property's OnCustomPaint. # # # # # @note This class is untracked and should not be derived from nor instances extended! # @wxrb_require USE_PROPGRID class PGPaintData < ::Object # {Wx::PG::PropertyGrid} # # # @return [Wx::PG::PropertyGrid] def parent; end # {Wx::PG::PropertyGrid} # # # @param val [Wx::PG::PropertyGrid] # @return [void] def parent=(val); end # Normally -1, otherwise index to drop-down list item that has to be drawn. # # # @return [Integer] def choice_item; end # Normally -1, otherwise index to drop-down list item that has to be drawn. # # # @param val [Integer] # @return [void] def choice_item=(val); end # Set to drawn width in OnCustomPaint (optional). # # # @return [Integer] def drawn_width; end # Set to drawn width in OnCustomPaint (optional). # # # @param val [Integer] # @return [void] def drawn_width=(val); end # In a measure item call, set this to the height of item at m_choiceItem index. # # # @return [Integer] def drawn_height; end # In a measure item call, set this to the height of item at m_choiceItem index. # # # @param val [Integer] # @return [void] def drawn_height=(val); end end # PGPaintData end