]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
Implement wxWindow::GetToolTipText().
[wxWidgets.git] / src / propgrid / property.cpp
index 913c554e5222683d4c3940c6a1ea3ec43f2c0c53..bbd56c2a03132d0aef6edd890173cee76f56108d 100644 (file)
@@ -1372,7 +1372,7 @@ void wxPGProperty::RefreshEditor()
 
 wxVariant wxPGProperty::GetDefaultValue() const
 {
-    wxVariant defVal = GetAttribute(wxS("DefaultValue"));
+    wxVariant defVal = GetAttribute(wxPG_ATTR_DEFAULT_VALUE);
     if ( !defVal.IsNull() )
         return defVal;
 
@@ -1634,18 +1634,20 @@ long wxPGProperty::GetAttributeAsLong( const wxString& name, long defVal ) const
 {
     wxVariant variant = m_attributes.FindValue(name);
 
-    return wxPGVariantToInt(variant, defVal);
+    if ( variant.IsNull() )
+        return defVal;
+
+    return variant.GetLong();
 }
 
 double wxPGProperty::GetAttributeAsDouble( const wxString& name, double defVal ) const
 {
-    double retVal;
     wxVariant variant = m_attributes.FindValue(name);
 
-    if ( wxPGVariantToDouble(variant, &retVal) )
-        return retVal;
+    if ( variant.IsNull() )
+        return defVal;
 
-    return defVal;
+    return variant.GetDouble();
 }
 
 wxVariant wxPGProperty::GetAttributesAsList() const
@@ -2163,7 +2165,10 @@ void wxPGProperty::AdaptListToValue( wxVariant& list, wxVariant* value ) const
             }
 
             if ( allChildrenSpecified )
-                ChildChanged(*value, i, childValue);
+            {
+                *value = ChildChanged(*value, i, childValue);
+            }
+
             n++;
             if ( n == (unsigned int)list.GetCount() )
                 break;
@@ -2326,9 +2331,13 @@ wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y,
 
     /*
     if ( current )
+    {
         wxLogDebug(wxT("%s::GetItemAtY(%i) -> %s"),this->GetLabel().c_str(),y,current->GetLabel().c_str());
+    }
     else
+    {
         wxLogDebug(wxT("%s::GetItemAtY(%i) -> NULL"),this->GetLabel().c_str(),y);
+    }
     */
 
     return (wxPGProperty*) result;
@@ -2365,10 +2374,11 @@ void wxPGProperty::DeleteChildren()
     }
 }
 
-void wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue),
-                                 int WXUNUSED(childIndex),
-                                 wxVariant& WXUNUSED(childValue) ) const
+wxVariant wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue),
+                                      int WXUNUSED(childIndex),
+                                      wxVariant& WXUNUSED(childValue) ) const
 {
+    return wxNullVariant;
 }
 
 bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
@@ -2678,7 +2688,7 @@ void wxPGChoices::RemoveAt(size_t nIndex, size_t count)
 {
     AllocExclusive();
 
-    wxASSERT( m_data->m_refCount != 0xFFFFFFF );
+    wxASSERT( m_data->GetRefCount() != -1 );
     m_data->m_items.erase(m_data->m_items.begin()+nIndex,
                           m_data->m_items.begin()+nIndex+count);
 }
@@ -2794,7 +2804,7 @@ void wxPGChoices::AllocExclusive()
 {
     EnsureData();
 
-    if ( m_data->m_refCount != 1 )
+    if ( m_data->GetRefCount() != 1 )
     {
         wxPGChoicesData* data = new wxPGChoicesData();
         data->CopyDataFrom(m_data);
@@ -2812,7 +2822,7 @@ void wxPGChoices::AssignData( wxPGChoicesData* data )
     if ( data != wxPGChoicesEmptyData )
     {
         m_data = data;
-        data->m_refCount++;
+        data->IncRef();
     }
 }