wxPropertyGrid
Macros | Typedefs
wxPropertyGrid Miscellanous

This section describes some miscellanous values, types and macros. More...

Macros

#define WX_PG_CLASSINFO(NAME)   (&NAME::ms_classInfo)
 Use this with wxPropertyGrid::IsPropertyKindOf. More...
 
#define wxPG_COLOUR(R, G, B)   ((wxUint32)(R+(G<<8)+(B<<16)))
 Convert Red, Green and Blue to a single 32-bit value.
 
#define wxPG_COLOUR_BLACK   (*wxBLACK)
 
#define wxPG_DEFAULT_IMAGE_SIZE   wxSize(-1, -1)
 If property is supposed to have custom-painted image, then returning this in OnMeasureImage() will usually be enough.
 
#define wxPG_EMPTY_ARRAYINT   wxArrayInt()
 
#define wxPG_EMPTY_ARRAYSTRING   wxArrayString()
 
#define wxPG_INVALID_VALUE   INT_MAX
 
#define wxPG_LABEL   (*((wxString*)NULL))
 
#define wxPG_NULL_BITMAP   wxNullBitmap
 

Typedefs

typedef wxString wxPGCachedString
 
typedef void(* wxPGPaintCallback) (wxPGProperty *property, wxDC &dc, const wxRect &rect, wxPGPaintData &paintdata)
 This callback function is used by atleast wxCustomProperty to facilitiate drawing items in drop down list. More...
 
typedef int(* wxPGSortCallback) (wxPropertyGrid *propGrid, wxPGProperty *p1, wxPGProperty *p2)
 This callback function is used for sorting properties. More...
 
typedef bool(* wxPropertyGridCallback) (wxPropertyGrid *propGrid, wxPGProperty *property, wxWindow *ctrl, int data)
 This callback function is used by atleast wxCustomProperty to facilitiate easy custom action on button press. More...
 

Detailed Description

This section describes some miscellanous values, types and macros.

Macro Definition Documentation

◆ WX_PG_CLASSINFO

#define WX_PG_CLASSINFO (   NAME)    (&NAME::ms_classInfo)

Use this with wxPropertyGrid::IsPropertyKindOf.

For example, as in

pg->IsPropertyKindOf(WX_PG_CLASSINFO(wxStringProperty))

Typedef Documentation

◆ wxPGPaintCallback

typedef void(* wxPGPaintCallback) (wxPGProperty *property, wxDC &dc, const wxRect &rect, wxPGPaintData &paintdata)

This callback function is used by atleast wxCustomProperty to facilitiate drawing items in drop down list.

Works very much like the old wxPGProperty::OnCustomPaint.

◆ wxPGSortCallback

typedef int(* wxPGSortCallback) (wxPropertyGrid *propGrid, wxPGProperty *p1, wxPGProperty *p2)

This callback function is used for sorting properties.

Call wxPropertyGrid::SetSortFunction() to set it.

This function should return a value greater than 0 if position of p1 is after p2. So, for instance, when comparing property names, you can use following implementation:

int MyPropertySortFunction(wxPropertyGrid* propGrid,
{
return p1->GetBaseName().compare( p2->GetBaseName() );
}

◆ wxPropertyGridCallback

typedef bool(* wxPropertyGridCallback) (wxPropertyGrid *propGrid, wxPGProperty *property, wxWindow *ctrl, int data)

This callback function is used by atleast wxCustomProperty to facilitiate easy custom action on button press.

Parameters
propGridrelated wxPropertyGrid
propertyrelated wxPGProperty
ctrlIf not NULL (for example, not selected), a wxWindow* or equivalent
dataValue depends on the context.
Return values
Trueif changed value of the property.