Class: Wx::PG::FileProperty
- Inherits:
-
EditorDialogProperty
- Object
- Object
- PGProperty
- EditorDialogProperty
- Wx::PG::FileProperty
- Defined in:
- lib/wx/doc/gen/pg/pg_properties.rb
Overview
Like LongStringProperty, but the button triggers file selector instead.
Supported special attributes:
-
PG_DIALOG_TITLE: Sets a specific title for the file dialog (since 3.1.3).
-
PG_FILE_DIALOG_STYLE: Sets a specific FileDialog style for the file dialog (since 2.9.4).
-
PG_FILE_WILDCARD: Sets wildcard (see FileDialog for format details), “All files…” is default.
-
PG_FILE_SHOW_FULL_PATH: Default true. When false, only the file name is shown (i.e. drive and directory are hidden).
-
PG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the given path string.
-
PG_FILE_INITIAL_PATH: Sets the initial path of where to look for files.
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#display_editor_dialog(pg, value) ⇒ Boolean
protected
Shows editor dialog.
-
#do_get_validator ⇒ Wx::Validator
Returns pointer to the Validator that should be used with the editor of this property (NULL for no validator).
-
#do_set_attribute(name, value) ⇒ Boolean
Reimplement this member function to add special handling for attributes of this property.
-
#get_file_name ⇒ String
(also: #file_name)
Returns filename to file represented by current value.
- #initialize(label = Wx::PG::PG_LABEL, name = Wx::PG::PG_LABEL, value = ('')) ⇒ Wx::PG::FileProperty constructor
- #m_base_path ⇒ String
- #m_base_path=(val) ⇒ void
- #m_ind_filter ⇒ Integer
- #m_ind_filter=(val) ⇒ void
- #m_initial_path ⇒ String
- #m_initial_path=(val) ⇒ void
- #m_wildcard ⇒ String
- #m_wildcard=(val) ⇒ void
-
#on_set_value ⇒ void
This virtual function is called after m_value has been set.
-
#string_to_value(variant, text, argFlags = 0) ⇒ Boolean
Converts text into Variant value appropriate for this property.
- #value_ ⇒ Wx::Variant
- #value_=(val) ⇒ void
-
#value_to_string(value, argFlags = 0) ⇒ String
Converts property value into a text representation.
Methods inherited from EditorDialogProperty
#dlg_style_, #dlg_style_=, #dlg_title_, #dlg_title_=, #get_editor_dialog
Methods inherited from PGProperty
#adapt_list_to_value, #add_choice, #add_private_child, #append_child, #are_all_children_specified, #are_children_components, #change_flag, #child_changed, #clear_cells, #delete_children, #delete_choice, #do_get_attribute, #do_get_editor_class, #do_get_value, #each_attribute, #empty, #enable, #enable_common_value, #ensure_cells, #generate_composed_value, #get_attribute, #get_attribute_as_double, #get_attribute_as_long, #get_attributes, #get_attributes_as_list, #get_base_name, #get_cell, #get_cell_or_default, #get_child_count, #get_children_height, #get_choice_selection, #get_choices, #get_client_object, #get_column_editor, #get_common_value, #get_default_value, #get_depth, #get_displayed_common_value_count, #get_displayed_string, #get_editor_class, #get_editor_dialog, #get_flags_as_string, #get_grid, #get_grid_if_displayed, #get_help_string, #get_hint_text, #get_image_offset, #get_index_in_parent, #get_item_at_y, #get_label, #get_last_visible_sub_item, #get_main_parent, #get_max_length, #get_name, #get_parent, #get_property_by_name, #get_property_by_name_wh, #get_validator, #get_value, #get_value_as_string, #get_value_image, #get_value_type, #get_y, #has_flag, #has_flags_exact, #has_visible_children, #hide, #index, #insert_child, #insert_choice, #int_to_value, #is_category, #is_child_selected, #is_enabled, #is_expanded, #is_root, #is_some_parent, #is_sub_property, #is_text_editable, #is_value_unspecified, #is_visible, #item, #last, #on_custom_paint, #on_event, #on_measure_image, #on_validation_failure, #recreate_editor, #refresh_children, #refresh_editor, #set_attribute, #set_attributes, #set_auto_unspecified, #set_background_colour, #set_cell, #set_choice_selection, #set_choices, #set_client_object, #set_common_value, #set_default_colours, #set_default_value, #set_editor, #set_expanded, #set_flag_recursively, #set_flags_from_string, #set_help_string, #set_label, #set_max_length, #set_modified_status, #set_name, #set_parental_type, #set_text_colour, #set_validator, #set_value, #set_value_from_int, #set_value_from_string, #set_value_image, #set_value_in_event, #set_value_to_unspecified, #set_was_modified, #update_parent_values, #uses_auto_unspecified, #validate_value
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(label = Wx::PG::PG_LABEL, name = Wx::PG::PG_LABEL, value = ('')) ⇒ Wx::PG::FileProperty
890 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 890 def initialize(label=Wx::PG::PG_LABEL, name=Wx::PG::PG_LABEL, value=('')) end |
Class Method Details
.get_class_validator ⇒ Wx::Validator
989 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 989 def self.get_class_validator; end |
Instance Method Details
#display_editor_dialog(pg, value) ⇒ Boolean (protected)
Shows editor dialog.
Value to be edited should be read from value, and if dialog is not cancelled, it should be stored back and true should be returned.
Returns true if editor dialog was not cancelled and value was updated.
1058 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1058 def display_editor_dialog(pg, value) end |
#do_get_validator ⇒ Wx::Validator
Returns pointer to the Validator that should be used with the editor of this property (NULL for no validator).
Setting validator explicitly via #set_property_validator will override this. In most situations, code like this should work well:
class MyPropertyClass < Wx::PG::FileProperty
class << self
def validator
@validator ||= MyValidator.new(...)
end
end
# ...
def do_get_validator
MyPropertyClass.validator
end
# ...
end
You can get common filename validator by returning get_class_validator. DirProperty, for example, uses it.
981 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 981 def do_get_validator; end |
#do_set_attribute(name, value) ⇒ Boolean
Reimplement this member function to add special handling for attributes of this property.
Return false to have the attribute automatically stored in m_attributes. Default implementation simply does that and nothing else.
To actually set property attribute values from the application, use PGProperty#set_attribute instead.
948 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 948 def do_set_attribute(name, value) end |
#get_file_name ⇒ String Also known as: file_name
Returns filename to file represented by current value.
985 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 985 def get_file_name; end |
#m_base_path ⇒ String
1007 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1007 def m_base_path; end |
#m_base_path=(val) ⇒ void
This method returns an undefined value.
1013 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1013 def m_base_path=(val); end |
#m_ind_filter ⇒ Integer
1031 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1031 def m_ind_filter; end |
#m_ind_filter=(val) ⇒ void
This method returns an undefined value.
1037 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1037 def m_ind_filter=(val); end |
#m_initial_path ⇒ String
1019 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1019 def m_initial_path; end |
#m_initial_path=(val) ⇒ void
This method returns an undefined value.
1025 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1025 def m_initial_path=(val); end |
#m_wildcard ⇒ String
995 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 995 def m_wildcard; end |
#m_wildcard=(val) ⇒ void
This method returns an undefined value.
1001 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1001 def m_wildcard=(val); end |
#on_set_value ⇒ void
This method returns an undefined value.
This virtual function is called after m_value has been set.
- If m_value was set to Null variant (i.e. unspecified value), #on_set_value will not be called. - m_value may be of any variant type. Typically properties internally support only one variant type, and as such #on_set_value provides a good opportunity to convert supported values into internal type. - Default implementation does nothing.
905 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 905 def on_set_value; end |
#string_to_value(variant, text, argFlags = 0) ⇒ Boolean
Converts text into Variant value appropriate for this property.
Returns true if resulting Variant value was different.
Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behaviour).
934 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 934 def string_to_value(variant, text, argFlags=0) end |
#value_=(val) ⇒ void
This method returns an undefined value.
1045 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 1045 def value_=(val); end |
#value_to_string(value, argFlags = 0) ⇒ String
Converts property value into a text representation.
Default implementation calls PGProperty#generate_composed_value.
917 |
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 917 def value_to_string(value, argFlags=0) end |