]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/prop.cpp
more things are done by configure: checks for bool, whether overloading based
[wxWidgets.git] / src / generic / prop.cpp
index 44843a918e5bc1ca4aa326983599b0c1c1aa7614..a353201fcc596d2ea0bd4a23dd09f94aa9eb1fd7 100644 (file)
@@ -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(const wxString& name)
+:m_properties(wxKEY_STRING),m_name(name)
 {
 }
 
@@ -971,7 +972,7 @@ void wxPropertySheet::AddProperty(wxProperty *property)
 }
 
 // Get property by name
-wxProperty *wxPropertySheet::GetProperty(wxString name)
+wxProperty *wxPropertySheet::GetProperty(const wxString& name) const
 {
   wxNode *node = m_properties.Find((const char*) name);
   if (!node)
@@ -980,6 +981,33 @@ wxProperty *wxPropertySheet::GetProperty(wxString name)
     return (wxProperty *)node->Data();
 }
 
+bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& value)
+{
+  wxProperty* prop = GetProperty(name);
+  if(prop){
+    prop->SetValue(value);
+    return TRUE;
+  }else{
+    return FALSE;
+  }
+}
+
+void wxPropertySheet::RemoveProperty(const wxString& name)
+{
+  wxNode *node = m_properties.Find(name);
+  if(node)
+  {
+    wxProperty *prop = (wxProperty *)node->Data();
+       delete prop;
+    m_properties.DeleteNode(node);
+  }
+}      
+
+bool wxPropertySheet::HasProperty(const wxString& name) const
+{ 
+       return (GetProperty(name)?TRUE:FALSE); 
+}
+
 // Clear all properties
 void wxPropertySheet::Clear(void)
 {