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

wxPGId wxPropertyGrid::Insert ( wxPGId  priorthis,
wxPGProperty newproperty 
) [inline]

Inserts property to the list.

Parameters:
priorthisNew property is inserted just prior to this. Available only in the first variant. There are two versions of this function to allow this parameter to be either an id or name to a property.
parentNew property is inserted under this category. Available only in the second variant. There are two versions of this function to allow this parameter to be either an id or name to a property.
indexIndex under category. Available only in the second variant. If index is < 0, property is appended in category.
newpropertyPointer to the inserted property. wxPropertyGrid will take ownership of this object.
Returns:
Returns id for the property,
Remarks:

While Append may be faster way to add items, make note that when both data storages (categoric and non-categoric) are active, Insert becomes even more slow. This is especially true if current mode is non-categoric.

Example of use:

            // append category
            wxPGId my_cat_id = propertygrid->Append( new wxPropertyCategoryClass (wxT("My Category")) );

            ...

            // insert into category - using second variant
            wxPGId my_item_id_1 = propertygrid->Insert( my_cat_id, 0, new wxStringProperty(wxT("My String 1")) );

            // insert before to first item - using first variant
            wxPGId my_item_id_2 = propertygrid->Insert ( my_item_id, new wxStringProperty(wxT("My String 2")) );

Definition at line 5481 of file propgrid.h.

    {
        wxPGId res = _Insert( wxPGIdToPtr( priorthis ), newproperty );
        DrawItems( newproperty, (wxPGProperty*) NULL );
        return res;
    }

Generated by  Doxygen 1.6.0   Back to index