DeleteProperty on wxPropertyGrid (RIGHT CLICKED EVT) problem
Posted: Sat Jan 22, 2011 4:38 pm
I have a problem while deleting property from wxPropertyGrid widget when property is selected and right clicked.
Here is my snippet:
Can anybody help me?
Here is my snippet:
Code: Select all
class MyFrame : public wxFrame
{
private:
wxPropertyGrid* pg;
void OnPropertyGridItemRightClick( wxPropertyGridEvent& event );
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_PG_RIGHT_CLICK(wxID_ANY,MyFrame::OnPropertyGridItemRightClick )
END_EVENT_TABLE()
void MyFrame::OnPropertyGridItemRightClick( wxPropertyGridEvent& event )
{
wxPGProperty* p = event.GetProperty();
if ( p )
{
if (p->IsCategory())
{
pg->DeleteProperty ( p ); //here is a problem and property can not be deleted
}
}
}