wxFlagsProperty Class Reference
Represents a bit set that fits in a long integer. wxBoolProperty sub-properties are created for editing individual bits. Textctrl is created to manually edit the flags as a text; a continous sequence of spaces, commas and semicolons is considered as a flag id separator. Note: When changing "choices" (ie. flag labels) of wxFlagsProperty, you will need to use SetPropertyChoices - otherwise they will not get updated properly.
More...
#include <props.h>
List of all members.
Public Member Functions |
virtual void | ChildChanged (wxVariant &thisValue, int childIndex, wxVariant &childValue) const |
virtual int | GetChoiceInfo (wxPGChoiceInfo *choiceinfo) |
size_t | GetItemCount () const |
const wxString & | GetLabel (size_t ind) const |
virtual wxString | GetValueAsString (int argFlags) const |
virtual void | OnSetValue () |
virtual void | RefreshChildren () |
virtual bool | StringToValue (wxVariant &variant, const wxString &text, int flags) const |
| wxFlagsProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxArrayString &labels=wxArrayString(), const wxArrayInt &values=wxArrayInt(), int value=0) |
| wxFlagsProperty (const wxString &label, const wxString &name, wxPGChoices &choices, long value=0) |
| wxFlagsProperty (const wxString &label, const wxString &name, const wxChar **labels, const long *values=NULL, long value=0) |
virtual | ~wxFlagsProperty () |
Protected Member Functions |
long | IdToBit (const wxString &id) const |
void | Init () |
Protected Attributes |
wxPGChoices | m_choices |
wxPGChoicesData * | m_oldChoicesData |
long | m_oldValue |
Detailed Description
Represents a bit set that fits in a long integer. wxBoolProperty sub-properties are created for editing individual bits. Textctrl is created to manually edit the flags as a text; a continous sequence of spaces, commas and semicolons is considered as a flag id separator. Note: When changing "choices" (ie. flag labels) of wxFlagsProperty, you will need to use SetPropertyChoices - otherwise they will not get updated properly.
Definition at line 676 of file props.h.
Constructor & Destructor Documentation
wxFlagsProperty::wxFlagsProperty |
( |
const wxString & |
label, |
|
|
const wxString & |
name, |
|
|
const wxChar ** |
labels, |
|
|
const long * |
values = NULL , |
|
|
long |
value = 0 | |
|
) |
| | |
wxFlagsProperty::wxFlagsProperty |
( |
const wxString & |
label, |
|
|
const wxString & |
name, |
|
|
wxPGChoices & |
choices, |
|
|
long |
value = 0 | |
|
) |
| | |
wxFlagsProperty::wxFlagsProperty |
( |
const wxString & |
label = wxPG_LABEL , |
|
|
const wxString & |
name = wxPG_LABEL , |
|
|
const wxArrayString & |
labels = wxArrayString() , |
|
|
const wxArrayInt & |
values = wxArrayInt() , |
|
|
int |
value = 0 | |
|
) |
| | |
virtual wxFlagsProperty::~wxFlagsProperty |
( |
|
) |
[virtual] |
Member Function Documentation
virtual void wxFlagsProperty::ChildChanged |
( |
wxVariant & |
thisValue, |
|
|
int |
childIndex, |
|
|
wxVariant & |
childValue | |
|
) |
| | const [virtual] |
Called after value of a child property has been altered. Note that this function is usually called at the time that value of this property, or given child property, is still pending for change.
Sample pseudo-code implementation:
void MyProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
{
T& data = TFromVariant(thisValue);
switch ( childIndex )
{
case 0:
data.SetSubProp1( childvalue.GetLong() );
break;
case 1:
data.SetSubProp2( childvalue.GetString() );
break;
...
}
}
- Parameters:
-
| thisValue | Value of this property, that should be altered. |
| childIndex | Index of child changed (you can use Item(childIndex) to get). |
| childValue | Value of the child property. |
Reimplemented from wxPGProperty.
virtual int wxFlagsProperty::GetChoiceInfo |
( |
wxPGChoiceInfo * |
choiceinfo |
) |
[virtual] |
Returns current value's index to the choice control. May also return, through pointer arguments, strings that should be inserted to that control. Irrelevant to classes which do not employ wxPG_EDITOR(Choice) or similar.
Reimplemented from wxPGProperty.
size_t wxFlagsProperty::GetItemCount |
( |
|
) |
const [inline] |
const wxString& wxFlagsProperty::GetLabel |
( |
size_t |
ind |
) |
const [inline] |
virtual wxString wxFlagsProperty::GetValueAsString |
( |
int |
argFlags |
) |
const [virtual] |
Returns text representation of property's value. Generally this function should not be called from the application code. Instead, call GetValueString().
- Parameters:
-
| argFlags | If wxPG_FULL_VALUE is set, returns complete, storable string value instead of displayable. If wxPG_EDITABLE_VALUE is set, returns string value that must be editable in textctrl. If wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to display as a part of composite property string value. |
- See also:
- GetValueString()
Reimplemented from wxPGProperty.
long wxFlagsProperty::IdToBit |
( |
const wxString & |
id |
) |
const [protected] |
void wxFlagsProperty::Init |
( |
|
) |
[protected] |
virtual void wxFlagsProperty::OnSetValue |
( |
|
) |
[virtual] |
This virtual function is called after m_value has been set.
Reimplemented from wxPGProperty.
virtual void wxFlagsProperty::RefreshChildren |
( |
|
) |
[virtual] |
Refresh values of child properties. Automatically called after value is set.
Reimplemented from wxPGProperty.
virtual bool wxFlagsProperty::StringToValue |
( |
wxVariant & |
variant, |
|
|
const wxString & |
text, |
|
|
int |
argFlags | |
|
) |
| | const [virtual] |
Converts 'text' into proper value 'variant'. Returns true if new (different than m_value) value could be interpreted from the text.
- Parameters:
-
| argFlags | If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If wxPG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of composite property string value (as generated by GetValueAsString() called with this same flag). |
Reimplemented from wxPGProperty.
Member Data Documentation
The documentation for this class was generated from the following file: