Helper class for managing choices for properties. More...
#include <propgrid.h>
Public Types | |
typedef long | ValArrItem |
Public Member Functions | |
wxPGChoiceEntry & | Add (const wxPGChoiceEntry &entry) |
wxPGChoiceEntry & | Add (const wxString &label, const wxBitmap &bitmap, int value=wxPG_INVALID_VALUE) |
wxPGChoiceEntry & | Add (const wxString &label, int value=wxPG_INVALID_VALUE) |
void | Add (const wxArrayString &arr, const wxArrayInt &arrint) |
void | Add (const wxArrayString &arr, const ValArrItem *values=NULL) |
void | Add (const wxChar **labels, const ValArrItem *values=NULL) |
wxPGChoiceEntry & | AddAsSorted (const wxString &label, int value=wxPG_INVALID_VALUE) |
void | Assign (const wxPGChoices &src) |
void | AssignData (wxPGChoicesData *data) |
void | Clear () |
wxPGChoices | Copy () const |
void | EnsureData () |
wxPGChoicesData * | ExtractData () |
unsigned int | GetCount () const |
wxPGChoicesData * | GetData () |
wxPGChoicesData * | GetDataPtr () const |
wxPGChoicesId | GetId () const |
wxArrayInt | GetIndicesForStrings (const wxArrayString &strings, wxArrayString *unmatched=NULL) const |
const wxString & | GetLabel (unsigned int ind) const |
wxArrayString | GetLabels () const |
int | GetValue (unsigned int ind) const |
wxArrayInt | GetValuesForStrings (const wxArrayString &strings) const |
int | Index (int val) const |
int | Index (const wxString &str) const |
wxPGChoiceEntry & | Insert (const wxPGChoiceEntry &entry, int index) |
wxPGChoiceEntry & | Insert (const wxString &label, int index, int value=wxPG_INVALID_VALUE) |
bool | IsOk () const |
wxPGChoiceEntry & | Item (unsigned int i) |
const wxPGChoiceEntry & | Item (unsigned int i) const |
void | operator= (const wxPGChoices &a) |
const wxPGChoiceEntry & | operator[] (unsigned int i) const |
wxPGChoiceEntry & | operator[] (unsigned int i) |
void | RemoveAt (size_t nIndex, size_t count=1) |
void | Set (const wxArrayString &labels, const wxArrayInt &values=wxPG_EMPTY_ARRAYINT) |
void | Set (wxArrayString &arr, const long *values=(const long *) NULL) |
void | Set (const wxChar **labels, const long *values=NULL) |
void | SetExclusive () |
wxPGChoices (wxPGChoicesData *data) | |
wxPGChoices (const wxArrayString &labels, const wxArrayInt &values=wxPG_EMPTY_ARRAYINT) | |
wxPGChoices (const wxChar **labels, const long *values=NULL) | |
wxPGChoices (const wxPGChoices &src) | |
wxPGChoices () | |
~wxPGChoices () | |
Protected Member Functions | |
void | Free () |
void | Init () |
Protected Attributes | |
wxPGChoicesData * | m_data |
Helper class for managing choices for properties.
Each entry can have label, value, bitmap, text colour, and background colour.
wxPGChoices uses reference counting, similar to other wxWidgets classes. This means, that assignment and copy constructor only copy the reference and not the actual data. Call Copy() member function to create a real copy.
Definition at line 3506 of file propgrid.h.
typedef long wxPGChoices::ValArrItem |
Definition at line 3591 of file propgrid.h.
wxPGChoices::wxPGChoices | ( | ) | [inline] |
Default constructor.
Definition at line 3511 of file propgrid.h.
wxPGChoices::wxPGChoices | ( | const wxPGChoices & | src | ) | [inline] |
Copy constructor, uses reference counting. To create a real copy, use Copy() member function instead.
Definition at line 3520 of file propgrid.h.
wxPGChoices::wxPGChoices | ( | const wxChar ** | labels, | |
const long * | values = NULL | |||
) | [inline] |
Constructor.
labels | Labels for choices | |
values | Values for choices. If NULL, indexes are used. |
Definition at line 3538 of file propgrid.h.
wxPGChoices::wxPGChoices | ( | const wxArrayString & | labels, | |
const wxArrayInt & | values = wxPG_EMPTY_ARRAYINT | |||
) | [inline] |
Constructor.
labels | Labels for choices | |
values | Values for choices. If empty, indexes are used. |
Definition at line 3553 of file propgrid.h.
wxPGChoices::wxPGChoices | ( | wxPGChoicesData * | data | ) | [inline] |
Simple interface constructor.
Definition at line 3560 of file propgrid.h.
wxPGChoices::~wxPGChoices | ( | ) | [inline] |
Destructor.
Definition at line 3568 of file propgrid.h.
wxPGChoiceEntry& wxPGChoices::Add | ( | const wxPGChoiceEntry & | entry | ) | [inline] |
Adds a single item with full entry information.
Definition at line 3626 of file propgrid.h.
wxPGChoiceEntry& wxPGChoices::Add | ( | const wxString & | label, | |
const wxBitmap & | bitmap, | |||
int | value = wxPG_INVALID_VALUE | |||
) |
Adds a single item, with bitmap.
wxPGChoiceEntry& wxPGChoices::Add | ( | const wxString & | label, | |
int | value = wxPG_INVALID_VALUE | |||
) |
Adds a single choice.
label | Label for added choice. | |
value | Value for added choice. If unspecified, index is used. |
void wxPGChoices::Add | ( | const wxArrayString & | arr, | |
const wxArrayInt & | arrint | |||
) |
Version that works with wxArrayString and wxArrayInt.
void wxPGChoices::Add | ( | const wxArrayString & | arr, | |
const ValArrItem * | values = NULL | |||
) |
Version that works with wxArrayString.
void wxPGChoices::Add | ( | const wxChar ** | labels, | |
const ValArrItem * | values = NULL | |||
) |
Adds to current. If did not have own copies, creates them now. If was empty, identical to set except that creates copies.
labels | Labels for added choices. | |
values | Values for added choices. If empty, relevant entry indexes are used. |
wxPGChoiceEntry& wxPGChoices::AddAsSorted | ( | const wxString & | label, | |
int | value = wxPG_INVALID_VALUE | |||
) |
Adds single item.
void wxPGChoices::Assign | ( | const wxPGChoices & | src | ) | [inline] |
Assigns choices data, using reference counting. To create a real copy, call Copy() member function instead.
Definition at line 3579 of file propgrid.h.
void wxPGChoices::AssignData | ( | wxPGChoicesData * | data | ) |
void wxPGChoices::Clear | ( | ) | [inline] |
Delete all choices.
Definition at line 3635 of file propgrid.h.
wxPGChoices wxPGChoices::Copy | ( | ) | const [inline] |
Creates a physical copy of the choices.
Definition at line 3644 of file propgrid.h.
void wxPGChoices::EnsureData | ( | ) | [inline] |
Definition at line 3652 of file propgrid.h.
wxPGChoicesData* wxPGChoices::ExtractData | ( | ) | [inline] |
Definition at line 3801 of file propgrid.h.
void wxPGChoices::Free | ( | ) | [protected] |
unsigned int wxPGChoices::GetCount | ( | ) | const [inline] |
Definition at line 3740 of file propgrid.h.
wxPGChoicesData* wxPGChoices::GetData | ( | ) | [inline] |
Definition at line 3790 of file propgrid.h.
wxPGChoicesData* wxPGChoices::GetDataPtr | ( | ) | const [inline] |
Definition at line 3798 of file propgrid.h.
wxPGChoicesId wxPGChoices::GetId | ( | ) | const [inline] |
Gets a unsigned number identifying this list.
Definition at line 3689 of file propgrid.h.
wxArrayInt wxPGChoices::GetIndicesForStrings | ( | const wxArrayString & | strings, | |
wxArrayString * | unmatched = NULL | |||
) | const |
Returns array of indices matching given strings. Unmatching strings are added to 'unmatched', if not NULL.
const wxString& wxPGChoices::GetLabel | ( | unsigned int | ind | ) | const [inline] |
Definition at line 3734 of file propgrid.h.
wxArrayString wxPGChoices::GetLabels | ( | ) | const |
int wxPGChoices::GetValue | ( | unsigned int | ind | ) | const [inline] |
Definition at line 3768 of file propgrid.h.
wxArrayInt wxPGChoices::GetValuesForStrings | ( | const wxArrayString & | strings | ) | const |
Returns array of values matching the given strings. Unmatching strings result in wxPG_INVALID_VALUE entry in array.
int wxPGChoices::Index | ( | int | val | ) | const |
int wxPGChoices::Index | ( | const wxString & | str | ) | const |
void wxPGChoices::Init | ( | ) | [protected] |
wxPGChoiceEntry& wxPGChoices::Insert | ( | const wxPGChoiceEntry & | entry, | |
int | index | |||
) |
Inserts a single item with full entry information.
wxPGChoiceEntry& wxPGChoices::Insert | ( | const wxString & | label, | |
int | index, | |||
int | value = wxPG_INVALID_VALUE | |||
) |
Inserts single item.
bool wxPGChoices::IsOk | ( | ) | const [inline] |
Returns false if this is a constant empty set of choices, which should not be modified.
Definition at line 3683 of file propgrid.h.
wxPGChoiceEntry& wxPGChoices::Item | ( | unsigned int | i | ) | [inline] |
Definition at line 3664 of file propgrid.h.
const wxPGChoiceEntry& wxPGChoices::Item | ( | unsigned int | i | ) | const [inline] |
Definition at line 3658 of file propgrid.h.
void wxPGChoices::operator= | ( | const wxPGChoices & | a | ) | [inline] |
Definition at line 3585 of file propgrid.h.
const wxPGChoiceEntry& wxPGChoices::operator[] | ( | unsigned int | i | ) | const [inline] |
Definition at line 3675 of file propgrid.h.
wxPGChoiceEntry& wxPGChoices::operator[] | ( | unsigned int | i | ) | [inline] |
Definition at line 3670 of file propgrid.h.
void wxPGChoices::RemoveAt | ( | size_t | nIndex, | |
size_t | count = 1 | |||
) |
Removes count items starting at position nIndex.
void wxPGChoices::Set | ( | const wxArrayString & | labels, | |
const wxArrayInt & | values = wxPG_EMPTY_ARRAYINT | |||
) | [inline] |
Version that works with wxArrayString and wxArrayInt.
Definition at line 3713 of file propgrid.h.
void wxPGChoices::Set | ( | wxArrayString & | arr, | |
const long * | values = (const long*) NULL | |||
) | [inline] |
Version that works with wxArrayString. TODO: Deprecate this.
Definition at line 3705 of file propgrid.h.
void wxPGChoices::Set | ( | const wxChar ** | labels, | |
const long * | values = NULL | |||
) | [inline] |
Does not create copies for itself.
Definition at line 3696 of file propgrid.h.
void wxPGChoices::SetExclusive | ( | ) | [inline] |
Definition at line 3723 of file propgrid.h.
wxPGChoicesData* wxPGChoices::m_data [protected] |
Definition at line 3813 of file propgrid.h.