X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3a43801df2f05c057892481df9d3cfe30fd8800..9f3362c440ef4c780d9a4bc8089de60a21d108bd:/src/generic/prop.cpp?ds=inline diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index fb5e94fb8f..bd2f6c1323 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -42,6 +42,7 @@ #include "wx/window.h" #include "wx/utils.h" #include "wx/list.h" +#include "wx/debug.h" #include "wx/prop.h" IMPLEMENT_DYNAMIC_CLASS(wxPropertyValue, wxObject) @@ -548,6 +549,8 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe } case wxPropertyValueStringPtr: { + wxFAIL_MSG( "wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented" ); + /* int i; int len = strlen(*(m_value.stringPtr)); for (i = 0; i < len; i++) @@ -555,6 +558,7 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe char ch = *(m_value.stringPtr)[i]; } + */ break; } case wxPropertyValueList: @@ -804,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; @@ -828,7 +832,7 @@ wxProperty::wxProperty(wxString nm, wxString role, wxPropertyValidator *ed):m_na } wxProperty::wxProperty(wxString nm, const wxPropertyValue& val, wxString role, wxPropertyValidator *ed): - m_name(nm), m_value(val), m_propertyRole(role) + m_value(val), m_name(nm), m_propertyRole(role) { m_propertyValidator = ed; m_propertyWindow = NULL; @@ -937,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) { } @@ -975,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) { @@ -1032,7 +1060,7 @@ void wxPropertyValidatorRegistry::ClearRegistry(void) { BeginFind(); wxNode *node; - while (node = Next()) + while ((node = Next())) { delete (wxPropertyValidator *)node->Data(); }