wxPropertyCategoryClass Class Reference

Category (caption) property. More...

#include <propgrid.h>

Inheritance diagram for wxPropertyCategoryClass:

wxPGPropertyWithChildren wxPGProperty List of all members.

Public Types

typedef void * ClientDataType
typedef short FlagType

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)
void CalculateTextExtent (wxWindow *wnd, wxFont &font)
bool CanHaveExtraChildren () const
virtual void ChildChanged (wxPGProperty *p)
void ClearFlag (FlagType flag)
void DeleteChoice (int index)
virtual const wxPGEditorDoGetEditorClass () 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 wxPGPropertyClassInfoGetClassInfo () const
virtual const wxChar * GetClassName () const
ClientDataType GetClientData () const
size_t GetCount () const
wxPGPropertyDataExtGetDataExt ()
unsigned int GetDepth () const
wxString GetDisplayedString () const
const wxPGEditorGetEditorClass () const
unsigned int GetFlags () const
wxPropertyGridGetGrid () const
wxString GetHelpString () const
wxPGId GetId ()
virtual wxSize GetImageSize () const
unsigned int GetIndexInParent () const
wxPGPropertyGetItemAtY (unsigned int y, unsigned int lh)
const wxString & GetLabel () const
const wxPGPropertyGetLastVisibleSubItem () const
wxPGPropertyGetMainParent () const
int GetMaxLength () const
const wxString & GetName () const
wxPGPropertyWithChildrenGetParent () const
signed char GetParentingType () const
wxPropertyGridStateGetParentState () const
wxPGPropertyGetPropertyByName (const wxString &name) const
unsigned int GetTextColIndex () const
int GetTextExtent () const
const wxChar * GetType () const
wxValidator * GetValidator () const
virtual wxString GetValueAsString (int argFlags) const
wxVariant GetValueAsVariant () const
wxBitmap * GetValueImage () const
virtual const wxPGValueTypeGetValueType () const
const wxPGValueTypeGetValueTypePtr () const
int GetY () const
bool HasFlag (FlagType 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 (FlagType flag) const
bool IsKindOf (wxPGPropertyClassInfo &info)
bool IsOk () const
bool IsSomeParent (wxPGProperty *candidate_parent) const
bool IsSubProperty () const
bool IsValueUnspecified () const
wxPGPropertyItem (size_t i) const
wxPGPropertyLast () 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 (ClientDataType clientData)
void SetEditor (const wxString &editorName)
void SetEditor (const wxPGEditor *editor)
void SetFlag (FlagType flag)
void SetHelpString (const wxString &helpString)
void SetLabel (const wxString &label)
bool SetMaxLength (int maxLen)
void SetParentState (wxPropertyGridState *pstate)
void SetTextColIndex (unsigned int colInd)
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
 wxPropertyCategoryClass (const wxString &label, const wxString &name=(*((wxString *) NULL)))
 wxPropertyCategoryClass ()

Protected Member Functions

void Init ()

Protected Attributes

unsigned int m_arrIndex
unsigned char m_bgColIndex
wxByte m_capFgColIndex
wxPGArrayProperty m_children
ClientDataType m_clientData
wxPGPropertyDataExtm_dataExt
unsigned char m_depth
unsigned char m_depthBgCol
unsigned char m_expanded
unsigned char m_fgColIndex
FlagType m_flags
wxString m_label
short m_maxLen
wxString m_name
wxPGPropertyWithChildrenm_parent
signed char m_parentingType
wxPropertyGridStatem_parentState
int m_textExtent
int m_y

Detailed Description

Category (caption) property.


Constructor & Destructor Documentation

wxPropertyCategoryClass::wxPropertyCategoryClass  ) 
 

Special constructor only used in special cases.

wxPropertyCategoryClass::wxPropertyCategoryClass const wxString &  label,
const wxString &  name = (*((wxString *) NULL))
 

Construct.

Parameters:
label Label for the category.
Remarks:
All non-category properties appended will have most recently added category.


Member Function Documentation

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* wxPropertyCategoryClass::DoGetEditorClass  )  const [virtual]
 

Returns pointer to an instance of editor class.

Reimplemented from wxPGProperty.

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) }

Remarks:
You can get common filename validator by returning wxFilePropertyClass::GetClassValidator(). wxDirProperty, for example, uses it.

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.

Parameters:
value Simple container with GetString(), GetLong() etc. methods. Currently recommended means to extract value is to use wxPGVariantToXXX(value) macro.
Remarks:
Example pseudo-implementation with comments:
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.

Remarks:
  • If returns -1 in choiceinfo->m_itemCount, then in that case this class be derived from wxBaseEnumPropertyClass (see propdev.h) and GetEntry is used to fill an array (slower, but handier if you don't store your labels as arrays of strings).
  • Must not crash even if property's set of choices is uninitialized (i.e. it points to wxPGGlobalVars->m_emptyConstants).

Reimplemented in wxCustomPropertyClass.

virtual const wxPGPropertyClassInfo* wxPropertyCategoryClass::GetClassInfo  )  const [virtual]
 

Returns classinfo of the property class.

Implements wxPGProperty.

virtual const wxChar* wxPropertyCategoryClass::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.

Remarks:

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.

Remarks:
Thus, if immediate parent is root or category, this will return the property itself.

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).

Remarks:
Should not be overridden by new custom properties. Usually only used internally.

wxPropertyGridState* wxPGPropertyWithChildren::GetParentState  )  const [inline, inherited]
 

Returns wxPropertyGridState to which this property belongs.

Reimplemented from wxPGProperty.

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 wxPropertyCategoryClass::GetValueAsString int  argFlags  )  const [virtual]
 

Must be overridden with function that doesn't do anything.

Reimplemented from wxPGPropertyWithChildren.

wxVariant wxPGProperty::GetValueAsVariant  )  const [inherited]
 

Returns value as wxVariant.

virtual const wxPGValueType* wxPropertyCategoryClass::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.

Parameters:
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.

Parameters:
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.
Remarks:
  • 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.
  • Changing font and text colour affects the text drawn next to the painted image (which is done immediately after the OnCustomPaint call finishes).
  • 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.
See also:

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).

Parameters:
event Associated wxEvent.
Return values:
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.

Remarks:
If you have code similar to
// Update the value in case of last minute changes if ( primary && propgrid->IsEditorsValueModified() ) GetEditorClass()->CopyValueFromControl( this, primary );
in wxPGProperty::OnEvent wxEVT_COMMAND_BUTTON_CLICKED handler, then replace it with call to this method.
Return values:
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.

Parameters:
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 ClientDataType  clientData  )  [inline, inherited]
 

Sets client data (void*) of a property.

Remarks:
This untyped client data has to be deleted manually.

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.

Parameters:
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.
Return values:
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.


The documentation for this class was generated from the following file:
Generated on Mon Oct 29 16:56:24 2007 for wxPropertyGrid by doxygen 1.3.6