#include <propgrid.h>
Inheritance diagram for wxPGRootPropertyClass:
Public Member Functions | |
void | AddChild (wxPGProperty *prop) |
void | AddChild2 (wxPGProperty *prop, int index=-1, bool correct_mode=true) |
int | AppendChoice (const wxString &label, int value=INT_MAX) |
bool | CanHaveExtraChildren () const |
virtual void | ChildChanged (wxPGProperty *p) |
void | ClearFlag (unsigned char flag) |
void | DeleteChoice (int index) |
virtual const wxPGEditor * | DoGetEditorClass () const |
virtual wxValidator * | DoGetValidator () const |
virtual wxPGVariant | DoGetValue () const |
void | DoSetName (const wxString &str) |
virtual void | DoSetValue (wxPGVariant value) |
void | Empty () |
bool | EnsureDataExt () |
void | FixIndexesOfChildren (size_t starthere=0) |
unsigned int | GetArrIndex () const |
wxString | GetAttributes (unsigned int flagmask=0xFFFF) |
size_t | GetChildCount () const |
virtual int | GetChoiceInfo (wxPGChoiceInfo *choiceinfo) |
virtual const wxPGPropertyClassInfo * | GetClassInfo () const |
virtual const wxChar * | GetClassName () const |
void * | GetClientData () const |
size_t | GetCount () const |
wxPGPropertyDataExt * | GetDataExt () |
unsigned int | GetDepth () const |
wxString | GetDisplayedString () const |
const wxPGEditor * | GetEditorClass () const |
unsigned int | GetFlags () const |
wxPropertyGrid * | GetGrid () const |
wxString | GetHelpString () const |
wxPGId | GetId () |
virtual wxSize | GetImageSize () const |
unsigned int | GetIndexInParent () const |
wxPGProperty * | GetItemAtY (unsigned int y, unsigned int lh) |
const wxString & | GetLabel () const |
const wxPGProperty * | GetLastVisibleSubItem () const |
wxPGProperty * | GetMainParent () const |
int | GetMaxLength () const |
const wxString & | GetName () const |
wxPGPropertyWithChildren * | GetParent () const |
signed char | GetParentingType () const |
wxPropertyGridState * | GetParentState () const |
wxPGProperty * | GetPropertyByName (const wxString &name) const |
const wxChar * | GetType () const |
wxValidator * | GetValidator () const |
virtual wxString | GetValueAsString (int argFlags=0) const |
wxVariant | GetValueAsVariant () const |
wxBitmap * | GetValueImage () const |
virtual const wxPGValueType * | GetValueType () const |
const wxPGValueType * | GetValueTypePtr () const |
int | GetY () const |
bool | HasFlag (unsigned char flag) const |
bool | Hide (bool hide) |
int | Index (const wxPGProperty *p) const |
void | Init (const wxString &label, const wxString &name) |
int | InsertChoice (const wxString &label, int index, int value=INT_MAX) |
bool | IsEnabled () const |
bool | IsExpanded () const |
bool | IsFlagSet (unsigned char flag) const |
bool | IsKindOf (wxPGPropertyClassInfo &info) |
bool | IsOk () const |
bool | IsSomeParent (wxPGProperty *candidate_parent) const |
bool | IsSubProperty () const |
bool | IsValueUnspecified () const |
wxPGProperty * | Item (size_t i) const |
wxPGProperty * | Last () const |
virtual void | OnCustomPaint (wxDC &dc, const wxRect &rect, wxPGPaintData &paintdata) |
virtual bool | OnEvent (wxPropertyGrid *propgrid, wxWindow *wnd_primary, wxEvent &event) |
void | PrepareSubProperties () |
bool | PrepareValueForDialogEditing (wxPropertyGrid *propgrid) |
bool | RecreateEditor () |
virtual void | RefreshChildren () |
void | SetAttrib (int id, wxVariant value) |
virtual void | SetAttribute (int id, wxVariant &value) |
void | SetAttributes (const wxString &attributes) |
bool | SetChoices (const wxArrayString &labels, const wxArrayInt &values=(*((wxArrayInt *) NULL))) |
bool | SetChoices (wxPGChoices &choices) |
void | SetChoiceSelection (int newValue, const wxPGChoiceInfo &choiceInfo) |
void | SetChoicesExclusive () |
void | SetClientData (void *clientData) |
void | SetEditor (const wxString &editorName) |
void | SetEditor (const wxPGEditor *editor) |
void | SetFlag (unsigned char flag) |
void | SetHelpString (const wxString &helpString) |
void | SetLabel (const wxString &label) |
bool | SetMaxLength (int maxLen) |
void | SetParentState (wxPropertyGridState *pstate) |
void | SetValidator (const wxValidator &validator) |
virtual bool | SetValueFromInt (long value, int flags=0) |
virtual bool | SetValueFromString (const wxString &text, int flags) |
void | SetValueImage (wxBitmap &bmp) |
void | SetValueToUnspecified () |
void | ShowError (const wxString &msg) |
bool | StdValidationProcedure (wxPGVariant value) |
void | SubPropsChanged (int oldSelInd=-1) |
void | UpdateControl (wxWindow *primary) |
bool | UsesAutoUnspecified () const |
wxPGRootPropertyClass () | |
Protected Member Functions | |
void | Init () |
Protected Attributes | |
unsigned int | m_arrIndex |
unsigned char | m_bgColIndex |
wxPGArrayProperty | m_children |
void * | m_clientData |
wxPGPropertyDataExt * | m_dataExt |
unsigned char | m_depth |
unsigned char | m_depthBgCol |
unsigned char | m_expanded |
unsigned char | m_fgColIndex |
unsigned char | m_flags |
wxString | m_label |
short | m_maxLen |
wxString | m_name |
wxPGPropertyWithChildren * | m_parent |
signed char | m_parentingType |
wxPropertyGridState * | m_parentState |
int | m_y |
wxPGRootPropertyClass::wxPGRootPropertyClass | ( | ) |
Constructor.
void wxPGPropertyWithChildren::AddChild | ( | wxPGProperty * | prop | ) | [inherited] |
This is used by properties that have fixed sub-properties.
void wxPGPropertyWithChildren::AddChild2 | ( | wxPGProperty * | prop, | |
int | index = -1 , |
|||
bool | correct_mode = true | |||
) | [inherited] |
This is used by Insert etc.
int wxPGProperty::AppendChoice | ( | const wxString & | label, | |
int | value = INT_MAX | |||
) | [inline, inherited] |
Adds entry to property's wxPGChoices and editor control (if it is active).
Returns index of item added.
bool wxPGProperty::CanHaveExtraChildren | ( | ) | const [inline, inherited] |
Returns true if extra children can be added for this property (i.e.
it is wxPropertyCategory or wxCustomProperty)
virtual void wxPGPropertyWithChildren::ChildChanged | ( | wxPGProperty * | p | ) | [virtual, inherited] |
Called after child property p has been altered.
The value of this parent property should now be updated accordingly.
Reimplemented in wxParentPropertyClass.
void wxPGProperty::DeleteChoice | ( | int | index | ) | [inherited] |
Removes entry from property's wxPGChoices and editor control (if it is active).
If selected item is deleted, then the value is set to unspecified.
virtual const wxPGEditor* wxPGRootPropertyClass::DoGetEditorClass | ( | ) | const [virtual] |
virtual wxValidator* wxPGProperty::DoGetValidator | ( | ) | const [virtual, inherited] |
Returns pointer to the wxValidator that should be used with the editor of this property (NULL for no validator).
Setting validator explicitly via SetPropertyValidator will override this.
In most situations, code like this should work well (macros are used to maintain one actual validator instance, so on the second call the function exits within the first macro):
wxValidator* wxMyPropertyClass::DoGetValidator () const { WX_PG_DOGETVALIDATOR_ENTRY() wxMyValidator* validator = new wxMyValidator(...); ... prepare validator... WX_PG_DOGETVALIDATOR_EXIT(validator) }
virtual wxPGVariant wxPGProperty::DoGetValue | ( | ) | const [virtual, inherited] |
Returns properly constructed wxPGVariant.
Reimplemented in wxParentPropertyClass, and wxCustomPropertyClass.
virtual void wxPGProperty::DoSetValue | ( | wxPGVariant | value | ) | [virtual, inherited] |
Sets property's internal value.
value | Simple container with GetString(), GetLong() etc. methods. Currently recommended means to extract value is to use wxPGVariantToXXX(value) macro. |
void wxMyProperty::DoSetValue ( wxPGVariant value ) { // A) Get value. For example const wxMyValueType* pvalue = wxPGVariantToWxObjectPtr(value,wxMyValueType); // or: const wxString& str = wxPGVariantToString(value); // or: long val = wxPGVariantToLong(value); // B) If value is wxObject or void based with NULL default, then handle that: if ( pvalue ) m_value = *pvalue; else pmyvalue->SetToDefault(); // Otherwise // m_value = *pvalue; // is sufficient. // C) If has children, this should be here (before displaying in control). RefreshChildren(); }
Reimplemented in wxParentPropertyClass, and wxCustomPropertyClass.
void wxPGPropertyWithChildren::Empty | ( | ) | [inherited] |
Deletes all sub-properties.
bool wxPGProperty::EnsureDataExt | ( | ) | [inherited] |
If property did not have data extension, one is created now (returns true in that case).
wxString wxPGProperty::GetAttributes | ( | unsigned int | flagmask = 0xFFFF |
) | [inherited] |
Returns comma-delimited string of property attributes.
size_t wxPGProperty::GetChildCount | ( | ) | const [inherited] |
Returns number of children (always 0 for normal properties).
virtual int wxPGProperty::GetChoiceInfo | ( | wxPGChoiceInfo * | choiceinfo | ) | [virtual, inherited] |
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 in wxCustomPropertyClass.
virtual const wxPGPropertyClassInfo* wxPGRootPropertyClass::GetClassInfo | ( | ) | const [virtual] |
virtual const wxChar* wxPGRootPropertyClass::GetClassName | ( | ) | const [virtual] |
Returns classname (for example, "wxStringProperty" for wxStringProperty) of a property class.
Implements wxPGProperty.
size_t wxPGPropertyWithChildren::GetCount | ( | ) | const [inline, inherited] |
Returns number of sub-properties.
wxPGPropertyDataExt* wxPGProperty::GetDataExt | ( | ) | [inline, inherited] |
Returns property's data extension (NULL if none).
wxPropertyGrid* wxPGProperty::GetGrid | ( | ) | const [inherited] |
Returns property grid where property lies.
wxPGId wxPGProperty::GetId | ( | ) | [inline, inherited] |
Returns property id.
virtual wxSize wxPGProperty::GetImageSize | ( | ) | const [virtual, inherited] |
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.
Reimplemented in wxCustomPropertyClass.
unsigned int wxPGProperty::GetIndexInParent | ( | ) | const [inline, inherited] |
Returns position in parent's array.
const wxString& wxPGProperty::GetLabel | ( | ) | const [inline, inherited] |
Returns property's label.
const wxPGProperty* wxPGProperty::GetLastVisibleSubItem | ( | ) | const [inherited] |
Returns last visible sub-property, recursively.
wxPGProperty* wxPGProperty::GetMainParent | ( | ) | const [inherited] |
Returns highest level non-category, non-root parent.
Useful when you have nested wxCustomProperties/wxParentProperties.
const wxString& wxPGProperty::GetName | ( | ) | const [inline, inherited] |
Returns property's name (alternate way to access property).
wxPGPropertyWithChildren* wxPGProperty::GetParent | ( | ) | const [inline, inherited] |
Return parent of property.
signed char wxPGProperty::GetParentingType | ( | ) | const [inline, inherited] |
Returns 0 for normal items.
1 for categories, -1 for other properties with children, -2 for wxCustomProperty (mostly like -1 ones but with few expections).
wxPropertyGridState* wxPGPropertyWithChildren::GetParentState | ( | ) | const [inline, inherited] |
wxPGProperty* wxPGPropertyWithChildren::GetPropertyByName | ( | const wxString & | name | ) | const [inherited] |
Returns (direct) child property with given name (or NULL if not found).
const wxChar* wxPGProperty::GetType | ( | ) | const [inline, inherited] |
Returns type name of property that is compatible with CreatePropertyByType.
and wxVariant::GetType.
wxValidator* wxPGProperty::GetValidator | ( | ) | const [inline, inherited] |
Gets assignable version of property's validator.
virtual wxString wxPGPropertyWithChildren::GetValueAsString | ( | int | argFlags = 0 |
) | const [virtual, inherited] |
Advanced variant of GetValueAsString() that forms a string that contains sequence of text representations of sub-properties.
Reimplemented from wxPGProperty.
Reimplemented in wxParentPropertyClass, wxCustomPropertyClass, and wxPropertyCategoryClass.
wxVariant wxPGProperty::GetValueAsVariant | ( | ) | const [inherited] |
Returns value as wxVariant.
virtual const wxPGValueType* wxPGRootPropertyClass::GetValueType | ( | ) | const [virtual] |
Returns pointer to the object that has methods related to the value type of this property.
Keep atleast this method abstract so the class is kept abstract.
Implements wxPGProperty.
int wxPGProperty::GetY | ( | ) | const [inline, inherited] |
Gets pre-calculated top y coordinate of property graphics.
This cannot be relied on all times (wxPropertyGrid knows when :) ), and value is -1 if property is not visible.
bool wxPGProperty::Hide | ( | bool | hide | ) | [inline, inherited] |
Hides or reveals the property.
hide | true for hide, false for reveal. |
int wxPGPropertyWithChildren::Index | ( | const wxPGProperty * | p | ) | const [inline, inherited] |
Returns index of given sub-property.
void wxPGProperty::Init | ( | const wxString & | label, | |
const wxString & | name | |||
) | [inherited] |
Initializes the property.
Usually only called in the constructor.
int wxPGProperty::InsertChoice | ( | const wxString & | label, | |
int | index, | |||
int | value = INT_MAX | |||
) | [inherited] |
Adds entry to property's wxPGChoices and editor control (if it is active).
Returns index of item added.
bool wxPGProperty::IsOk | ( | ) | const [inline, inherited] |
Returns true if property is valid and wxPropertyGrid methods can operate on it safely.
bool wxPGProperty::IsSubProperty | ( | ) | const [inline, inherited] |
Returns true if this is a sub-property.
wxPGProperty* wxPGPropertyWithChildren::Item | ( | size_t | i | ) | const [inline, inherited] |
Returns sub-property at index i.
wxPGProperty* wxPGPropertyWithChildren::Last | ( | ) | const [inline, inherited] |
Returns last sub-property.
virtual void wxPGProperty::OnCustomPaint | ( | wxDC & | dc, | |
const wxRect & | rect, | |||
wxPGPaintData & | paintdata | |||
) | [virtual, inherited] |
Override to paint an image in front of the property value text or drop-down list item (but only if wxPGProperty::GetImageSize is overridden as well).
If property's GetImageSize() returns size that has height != 0 but less than row height ( < 0 has special meanings), wxPropertyGrid 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 GetImageSize() returned higher height than row height).
NOTE: Following applies when GetImageSize() returns a "flexible" height ( using wxPG_FLEXIBLE_SIZE(W,H) macro), which implies variable height items: If rect.x 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.
dc | wxDC to paint on. | |
rect | Box reserved for custom graphics. Includes surrounding rectangle, if any. If x is < 0, then this is a measure item call (see above). | |
paintdata | wxPGPaintData structure with much useful data. |
Reimplemented in wxCustomPropertyClass.
virtual bool wxPGProperty::OnEvent | ( | wxPropertyGrid * | propgrid, | |
wxWindow * | wnd_primary, | |||
wxEvent & | event | |||
) | [virtual, inherited] |
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, should be handled here. Also, if custom handling for regular events is desired, then that can also be done (for example, wxSystemColourProperty custom handles wxEVT_COMMAND_CHOICE_SELECTED).
event | Associated wxEvent. |
Should | return true if any changes in value should be reported. This is case, for example, when enter is pressed in wxTextCtrl. |
bool wxPGProperty::PrepareValueForDialogEditing | ( | wxPropertyGrid * | propgrid | ) | [inherited] |
Updates property value in case there were last minute changes.
If value was unspecified, it will be set to default. Use only for properties that have TextCtrl-based editor.
// Update the value in case of last minute changes if ( primary && propgrid->IsEditorsValueModified() ) GetEditorClass()->CopyValueFromControl( this, primary );
True | if value changed. |
bool wxPGProperty::RecreateEditor | ( | ) | [inherited] |
If property's editor is created this forces its recreation.
Useful in SetAttribute etc. Returns true if actually did anything.
virtual void wxPGPropertyWithChildren::RefreshChildren | ( | ) | [virtual, inherited] |
Refresh values of child properties.
virtual void wxPGProperty::SetAttribute | ( | int | id, | |
wxVariant & | value | |||
) | [virtual, inherited] |
Sets an attribute of this property.
This is quite property class specific, and there are no common attributes. Note that attribute may be specific to a property instance, or it may affect all properties of its class.
id | Identifier of attribute | |
value | Value for that attribute. |
Reimplemented in wxCustomPropertyClass.
void wxPGProperty::SetAttributes | ( | const wxString & | attributes | ) | [inherited] |
Sets attributes from a comma-delimited string.
bool wxPGProperty::SetChoices | ( | const wxArrayString & | labels, | |
const wxArrayInt & | values = (*((wxArrayInt *) NULL)) | |||
) | [inline, inherited] |
Sets new set of choices for property.
bool wxPGProperty::SetChoices | ( | wxPGChoices & | choices | ) | [inherited] |
Sets new set of choices for property.
void wxPGProperty::SetChoiceSelection | ( | int | newValue, | |
const wxPGChoiceInfo & | choiceInfo | |||
) | [inherited] |
Changes value of a property with choices, but only works if the value type is long or string.
void wxPGProperty::SetChoicesExclusive | ( | ) | [inherited] |
If property has choices and they are not yet exclusive, new such copy of them will be created.
void wxPGProperty::SetClientData | ( | void * | clientData | ) | [inline, inherited] |
Sets client data (void*) of a property.
void wxPGProperty::SetEditor | ( | const wxString & | editorName | ) | [inline, inherited] |
Sets editor for a property.
void wxPGProperty::SetEditor | ( | const wxPGEditor * | editor | ) | [inline, inherited] |
Sets editor for a property.
bool wxPGProperty::SetMaxLength | ( | int | maxLen | ) | [inline, inherited] |
Set max length of text editor.
void wxPGProperty::SetValidator | ( | const wxValidator & | validator | ) | [inline, inherited] |
Sets wxValidator for a property.
virtual bool wxPGProperty::SetValueFromInt | ( | long | value, | |
int | flags = 0 | |||
) | [virtual, inherited] |
Converts integer to a value, and if succesfull, calls DoSetValue() on it.
Default behaviour is to do nothing.
value | Int to get the value from. | |
flags | If has wxPG_FULL_VALUE, then the value given is a actual value and not an index. |
true | if value was changed. |
Reimplemented in wxCustomPropertyClass.
virtual bool wxPGPropertyWithChildren::SetValueFromString | ( | const wxString & | text, | |
int | flags | |||
) | [virtual, inherited] |
This overridden version converts comma or semicolon separated tokens into child values.
Reimplemented from wxPGProperty.
Reimplemented in wxCustomPropertyClass.
void wxPGProperty::SetValueImage | ( | wxBitmap & | bmp | ) | [inherited] |
Set wxBitmap in front of the value.
This bitmap will be ignored if property class has implemented OnCustomPaint.
bool wxPGProperty::UsesAutoUnspecified | ( | ) | const [inherited] |
Returns true if containing grid uses wxPG_EX_AUTO_UNSPECIFIED_VALUES.