Class: Wx::PG::SystemColourProperty

Inherits:
EnumProperty show all
Defined in:
lib/wx/doc/gen/pg/pg_properties.rb

Overview

Has dropdown list of wxWidgets system colours.

Value used is of ColourPropertyValue type. Supported special attributes: PG_COLOUR_ALLOW_CUSTOM, PG_COLOUR_HAS_ALPHA

Requires:

  • USE_PROPGRID

Direct Known Subclasses

ColourProperty

Instance Method Summary collapse

Methods inherited from EnumProperty

#get_choice_selection, #get_index, #get_index_for_value, #get_item_count, #set_index, #validate_value

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_validator, #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, #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_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::ColourPropertyValue.new())) ⇒ Wx::PG::SystemColourProperty

Parameters:

  • label (String) (defaults to: Wx::PG::PG_LABEL)
  • name (String) (defaults to: Wx::PG::PG_LABEL)
  • value (Wx::PG::ColourPropertyValue) (defaults to: (Wx::ColourPropertyValue.new()))


2469
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2469

def initialize(label=Wx::PG::PG_LABEL, name=Wx::PG::PG_LABEL, value=(Wx::ColourPropertyValue.new())) end

Instance Method Details

#col_to_ind(colour) ⇒ Integer

Parameters:

Returns:

  • (Integer)


2651
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2651

def col_to_ind(colour) end

#colour_to_string(col, index, argFlags = 0) ⇒ String

Override in derived class to customize how colours are printed as strings.

Parameters:

  • col (Wx::Colour, String, Symbol)
  • index (Integer)
  • argFlags (Integer) (defaults to: 0)

Returns:

  • (String)


2512
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2512

def colour_to_string(col, index, argFlags=0) 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 PGProperty#set_attribute instead.

Parameters:

Returns:

  • (Boolean)


2584
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2584

def do_set_attribute(name, value) end

#do_translate_val(v) ⇒ Wx::Variant (protected)

Parameters:

Returns:



2666
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2666

def do_translate_val(v) end

#get_colour(index) ⇒ Wx::Colour Also known as: colour

Default is to use SystemSettings.get_colour(index).

Override to use custom colour tables etc.

Parameters:

  • index (Integer)

Returns:



2636
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2636

def get_colour(index) end

#get_custom_colour_indexInteger Also known as: custom_colour_index

Returns index of entry that triggers colour picker dialog (default is last).

Returns:

  • (Integer)


2516
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2516

def get_custom_colour_index; end

#get_val(pVariant = nil) ⇒ Wx::PG::ColourPropertyValue Also known as: val

Parameters:

Returns:



2641
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2641

def get_val(pVariant=nil) end

#init(type, colour) ⇒ void

This method returns an undefined value.

Parameters:

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


2647
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2647

def init(type, colour) 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 PG_MISC_ARG_FLAGS::PG_FULL_VALUE is set, returns complete, storable value instead of displayable one.

Returns:

  • (Boolean)


2505
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2505

def int_to_value(variant, number, argFlags=0) 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 PGProperty#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), 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)

    PGPaintData structure with much useful data about painted item.

See Also:



2625
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2625

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, Wx::PG::SystemColourProperty custom handles EVT_CHOICE to display colour picker dialog when ‘custom’ selection is made). If the event causes value to be changed, PGProperty#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)


2570
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2570

def on_event(propgrid, wnd_primary, event) end

#on_measure_image(item) ⇒ 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 PG_DEFAULT_IMAGE_SIZE which equals DEFAULT_SIZE.

Parameters:

  • item (Integer)

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

Returns:



2602
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2602

def on_measure_image(item) 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.



2484
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2484

def on_set_value; end

#query_colour_from_user(variant) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


2629
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2629

def query_colour_from_user(variant) 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 PG_MISC_ARG_FLAGS::PG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If 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)


2546
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2546

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

#value_Wx::Variant

Returns:



2655
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2655

def value_; end

#value_=(val) ⇒ void

This method returns an undefined value.

Parameters:



2659
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2659

def value_=(val); end

#value_to_string(value, argFlags = 0) ⇒ String

Converts property value into a text representation.

Remark:

Default implementation calls PGProperty#generate_composed_value.

Parameters:

Returns:

  • (String)


2529
# File 'lib/wx/doc/gen/pg/pg_properties.rb', line 2529

def value_to_string(value, argFlags=0) end