Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void wxCustomPropertyClass::SetAttribute ( int  id,
wxVariant &  value 
) [virtual]

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:
idIdentifier of attribute
valueValue for that attribute.

Reimplemented from wxPGProperty.

Definition at line 2706 of file props.cpp.

References wxPGProperty::GetGrid(), wxPGProperty::SetEditor(), wxPropertyContainerMethods::SetPropertyEditor(), wxPropertyContainerMethods::SetPropertyImage(), wxPGProperty::SetValueImage(), wxPG_CUSTOM_PAINT_CALLBACK, wxPG_CUSTOM_PRIVATE_CHILDREN, and wxPG_PROP_CUSTOMIMAGE.

{
#ifdef wxPG_COMPATIBILITY_1_0_0
    wxPropertyGrid* grid = GetGrid();
    if ( id == wxPG_CUSTOM_EDITOR )
    {
        if ( grid )
            grid->SetPropertyEditor( wxPGIdGen(this), (wxPGEditor*) value.GetVoidPtr() );
        else
            SetEditor( (wxPGEditor*) value.GetVoidPtr() );
    }
    else if ( id == wxPG_CUSTOM_IMAGE )
    {
        wxBitmap* bmp = (wxBitmap*) value.GetWxObjectPtr();
        if ( grid )
            grid->SetPropertyImage(wxPGIdGen(this),*bmp);
        else
            SetValueImage(*bmp);
    }
    else if ( id == wxPG_CUSTOM_CALLBACK )
    {
        m_callback = (wxPropertyGridCallback) value.GetVoidPtr();
    }
    else
#endif
    if ( id == wxPG_CUSTOM_PAINT_CALLBACK )
    {
        void* voidValue = value.GetVoidPtr();
        m_paintCallback = (wxPGPaintCallback) voidValue;
        if ( voidValue )
            m_flags |= wxPG_PROP_CUSTOMIMAGE;
        else if ( !GetValueImage() )
            m_flags &= ~(wxPG_PROP_CUSTOMIMAGE);
    }
    else
    if ( id == wxPG_CUSTOM_PRIVATE_CHILDREN )
    {
        if ( value.GetLong() )
            m_parentingType = -1;
        else
            m_parentingType = -2;
    }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index