X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66fb9e1241d75e4981ff3323cfe957bdcbd53ebd..23513e07f50f4b06869c4903ccb1f679c13e8ffd:/samples/propgrid/propgrid.cpp diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 56abbad6d2..092b6c6360 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -134,21 +134,21 @@ bool wxSampleMultiButtonEditor::OnEvent( wxPropertyGrid* propGrid, if ( event.GetId() == buttons->GetButtonId(0) ) { - // Do something when first button is pressed + // Do something when the first button is pressed wxLogDebug("First button pressed"); - return true; + return false; // Return false since value did not change } if ( event.GetId() == buttons->GetButtonId(1) ) { - // Do something when second button is pressed - wxLogDebug("Second button pressed"); - return true; + // Do something when the second button is pressed + wxMessageBox("Second button pressed"); + return false; // Return false since value did not change } if ( event.GetId() == buttons->GetButtonId(2) ) { - // Do something when third button is pressed - wxLogDebug("Third button pressed"); - return true; + // Do something when the third button is pressed + wxMessageBox("Third button pressed"); + return false; // Return false since value did not change } } return wxPGTextCtrlEditor::OnEvent(propGrid, property, ctrl, event); @@ -477,10 +477,9 @@ wxVectorProperty::wxVectorProperty( const wxString& label, : wxPGProperty(label,name) { SetValue( WXVARIANT(value) ); - SetParentalType(wxPG_PROP_AGGREGATE); - AddChild( new wxFloatProperty(wxT("X"),wxPG_LABEL,value.x) ); - AddChild( new wxFloatProperty(wxT("Y"),wxPG_LABEL,value.y) ); - AddChild( new wxFloatProperty(wxT("Z"),wxPG_LABEL,value.z) ); + AddPrivateChild( new wxFloatProperty(wxT("X"),wxPG_LABEL,value.x) ); + AddPrivateChild( new wxFloatProperty(wxT("Y"),wxPG_LABEL,value.y) ); + AddPrivateChild( new wxFloatProperty(wxT("Z"),wxPG_LABEL,value.z) ); } wxVectorProperty::~wxVectorProperty() { } @@ -526,10 +525,9 @@ wxTriangleProperty::wxTriangleProperty( const wxString& label, : wxPGProperty(label,name) { SetValue( WXVARIANT(value) ); - SetParentalType(wxPG_PROP_AGGREGATE); - AddChild( new wxVectorProperty(wxT("A"),wxPG_LABEL,value.a) ); - AddChild( new wxVectorProperty(wxT("B"),wxPG_LABEL,value.b) ); - AddChild( new wxVectorProperty(wxT("C"),wxPG_LABEL,value.c) ); + AddPrivateChild( new wxVectorProperty(wxT("A"),wxPG_LABEL,value.a) ); + AddPrivateChild( new wxVectorProperty(wxT("B"),wxPG_LABEL,value.b) ); + AddPrivateChild( new wxVectorProperty(wxT("C"),wxPG_LABEL,value.c) ); } wxTriangleProperty::~wxTriangleProperty() { } @@ -1727,11 +1725,12 @@ void FormMain::PopulateWithExamples () // For testing purposes, combine two methods of adding children // - // AddChild() requires that we call this - pid->SetParentalType(wxPG_PROP_MISC_PARENT); - - pid->AddChild( new wxStringProperty(wxT("Latest Release"), wxPG_LABEL, wxT("2.8.8"))); - pid->AddChild( new wxBoolProperty(wxT("Win API"), wxPG_LABEL, true) ); + pid->AppendChild( new wxStringProperty(wxT("Latest Release"), + wxPG_LABEL, + wxT("2.8.10"))); + pid->AppendChild( new wxBoolProperty(wxT("Win API"), + wxPG_LABEL, + true) ); pg->Append( pid );