X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8710cf5cabdb94c688f2d8d01ee83ac9b715125d..9f3362c440ef4c780d9a4bc8089de60a21d108bd:/src/generic/prop.cpp diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index 44843a918e..bd2f6c1323 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -808,7 +808,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxProperty, wxObject) wxProperty::wxProperty(void) { - m_propertyRole = (char *)NULL; + m_propertyRole = wxEmptyString; m_propertyValidator = NULL; m_propertyWindow = NULL; m_enabled = TRUE; @@ -941,7 +941,8 @@ wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property) IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet, wxObject) -wxPropertySheet::wxPropertySheet(void):m_properties(wxKEY_STRING) +wxPropertySheet::wxPropertySheet(wxString name) +:m_properties(wxKEY_STRING),m_name(name) { } @@ -979,7 +980,30 @@ wxProperty *wxPropertySheet::GetProperty(wxString name) else return (wxProperty *)node->Data(); } - +bool wxPropertySheet::SetProperty(const wxString name, wxPropertyValue value) +{ + wxProperty* prop = GetProperty(name); + if(prop){ + prop->SetValue(value); + return TRUE; + }else{ + return FALSE; + } +} +void wxPropertySheet::RemoveProperty(wxString name) +{ + wxNode *node = m_properties.Find(name); + if(node) + { + wxProperty *prop = (wxProperty *)node->Data(); + delete prop; + m_properties.DeleteNode(node); + } +} +bool wxPropertySheet::HasProperty(wxString name) +{ + return (GetProperty(name)?TRUE:FALSE); +} // Clear all properties void wxPropertySheet::Clear(void) {