Class: Wx::PG::PGChoices

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/pg/pg_property.rb,
lib/wx/doc/pg/pg_property.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

Helper class for managing choices of PropertyGrid properties.

Each entry can have label, value, bitmap, text colour, and background colour. 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 #copy member function to create a real copy.

Remark:

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

Category: PropertyGrid

Requires:

  • USE_PROPGRID

Instance Method Summary collapse

Constructor Details

#initializeWx::PG::PGChoices #initialize(a) ⇒ Wx::PG::PGChoices #initialize(labels, values = (Wx::ArrayInt.new())) ⇒ Wx::PG::PGChoices

Returns a new instance of PGChoices.

Overloads:

  • #initializeWx::PG::PGChoices

    Default constructor.

  • #initialize(a) ⇒ Wx::PG::PGChoices

    Copy constructor, uses reference counting.

    To create a real copy, use #copy member function instead.

    Parameters:

  • #initialize(labels, values = (Wx::ArrayInt.new())) ⇒ Wx::PG::PGChoices

    Constructor.

    Parameters:

    • labels (Array<String>)

      Labels for choices.

    • values (Array<Integer>) (defaults to: (Wx::ArrayInt.new()))

      Values for choices. If empty, indexes are used. Otherwise must have at least the same size as labels.



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

def initialize(*args) end

Instance Method Details

#[](i) ⇒ Wx::PG::PGChoiceEntry #[](i) ⇒ Wx::PG::PGChoiceEntry

Overloads:



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

def [](*args) end

#add(arr, arrint) ⇒ void #add(label, value = Wx::PG::PG_INVALID_VALUE) ⇒ Wx::PG::PGChoiceEntry #add(label, bitmap, value = Wx::PG::PG_INVALID_VALUE) ⇒ Wx::PG::PGChoiceEntry #add(entry) ⇒ Wx::PG::PGChoiceEntry

Overloads:

  • #add(arr, arrint) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • arr (Array<String>)
    • arrint (Array<Integer>)
  • #add(label, value = Wx::PG::PG_INVALID_VALUE) ⇒ Wx::PG::PGChoiceEntry

    Adds a single choice item.

    Parameters:

    • label (String)

      Label for added choice.

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

      Value for added choice. If unspecified, index is used.

    Returns:

  • #add(label, bitmap, value = Wx::PG::PG_INVALID_VALUE) ⇒ Wx::PG::PGChoiceEntry

    Adds a single item, with bitmap.

    Parameters:

    • label (String)
    • bitmap (Wx::Bitmap)
    • value (Integer) (defaults to: Wx::PG::PG_INVALID_VALUE)

    Returns:

  • #add(entry) ⇒ Wx::PG::PGChoiceEntry

    Adds a single item with full entry information.

    Parameters:

    Returns:



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

def add(*args) end

#add_as_sorted(label, value = Wx::PG::PG_INVALID_VALUE) ⇒ Wx::PG::PGChoiceEntry

Adds a single item, sorted.

Parameters:

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

Returns:



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

def add_as_sorted(label, value=Wx::PG::PG_INVALID_VALUE) end

#alloc_exclusivevoid

This method returns an undefined value.

Creates exclusive copy of current choices.



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

def alloc_exclusive; end

#assign(a) ⇒ void

This method returns an undefined value.

Assigns choices data, using reference counting.

To create a real copy, use #copy member function instead.

Parameters:



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

def assign(a) end

#clearvoid

This method returns an undefined value.

Deletes all items.



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

def clear; end

#copyWx::PG::PGChoices

Returns a real copy of the choices.

Returns:



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

def copy; end

#each_entry {|entry| ... } ⇒ Object, Enumerator

Iterate each choice entry. Passes each choice entry to the given block. Returns an Enumerator if no block given.

Yield Parameters:

  • entry (Wx::PG::ChoiceEntry)

    choice entry

Returns:

  • (Object, Enumerator)

    last result of block or Enumerator if no block given.



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

def each_entry; end

#each_label {|label| ... } ⇒ Object, Enumerator

Iterate each label. Passes each label string to the given block. Returns an Enumerator if no block given.

Yield Parameters:

  • label (String)

    label string

Returns:

  • (Object, Enumerator)

    last result of block or Enumerator if no block given.



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

def each_label; end

#ensure_datavoid

This method returns an undefined value.



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

def ensure_data; end

#get_countInteger Also known as: count

Returns number of items.

Returns:

  • (Integer)


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

def get_count; end

#get_indices_for_strings(strings, unmatched = nil) ⇒ Array<Integer> Also known as: indices_for_strings

Returns array of indices matching given strings.

Unmatching strings are added to ‘unmatched’, if not NULL.

Parameters:

  • strings (Array<String>)
  • unmatched (Array, nil) (defaults to: nil)

Returns:

  • (Array<Integer>)


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

def get_indices_for_strings(strings, unmatched=nil) end

#get_label(ind) ⇒ Wx::String Also known as: label

Returns label of item.

Parameters:

  • ind (Integer)

Returns:

  • (Wx::String)


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

def get_label(ind) end

#get_labelsArray<String> Also known as: labels

Returns array of choice labels.

Returns:

  • (Array<String>)


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

def get_labels; end

#get_value(ind) ⇒ Integer Also known as: value

Returns value of item.

Parameters:

  • ind (Integer)

Returns:

  • (Integer)


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

def get_value(ind) end

#get_values_for_strings(strings) ⇒ Array<Integer> Also known as: values_for_strings

Returns array of values matching the given strings.

Unmatching strings result in Wx::PG::PG_INVALID_VALUE entry in array.

Parameters:

  • strings (Array<String>)

Returns:

  • (Array<Integer>)


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

def get_values_for_strings(strings) end

#index(label) ⇒ Integer #index(val) ⇒ Integer

Overloads:

  • #index(label) ⇒ Integer

    Returns index of item with given label.

    Parameters:

    • label (String)

    Returns:

    • (Integer)
  • #index(val) ⇒ Integer

    Returns index of item with given value.

    Parameters:

    • val (Integer)

    Returns:

    • (Integer)


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

def index(*args) end

#insert(label, index, value = Wx::PG::PG_INVALID_VALUE) ⇒ Wx::PG::PGChoiceEntry #insert(entry, index) ⇒ Wx::PG::PGChoiceEntry

Overloads:



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

def insert(*args) end

#is_okBoolean Also known as: ok?

Returns false if this is a constant empty set of choices, which should not be modified.

Returns:

  • (Boolean)


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

def is_ok; end

#item(i) ⇒ Wx::PG::PGChoiceEntry

Returns item at given index.

Parameters:

  • i (Integer)

Returns:



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

def item(i) end

#remove_at(nIndex, count = 1) ⇒ void

This method returns an undefined value.

Removes count items starting at position nIndex.

Parameters:

  • nIndex (Integer)
  • count (Integer) (defaults to: 1)


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

def remove_at(nIndex, count=1) end

#set(labels, values = (Wx::ArrayInt.new())) ⇒ void

This method returns an undefined value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:

  • labels (Array<String>)
  • values (Array<Integer>) (defaults to: (Wx::ArrayInt.new()))


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

def set(labels, values=(Wx::ArrayInt.new())) end