X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b6a582bef796b43ad4cf0a96bd40bfd631460c6..3fff75338a0f7ba6a210aa330fee64c91f636bc8:/src/propgrid/property.cpp diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index dcda1ef198..bbd56c2a03 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1353,10 +1353,7 @@ void wxPGProperty::SetValueInEvent( wxVariant value ) const void wxPGProperty::SetFlagRecursively( FlagType flag, bool set ) { - if ( set ) - SetFlag(flag); - else - ClearFlag(flag); + ChangeFlag(flag, set); unsigned int i; for ( i = 0; i < GetChildCount(); i++ ) @@ -1375,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; @@ -1637,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 @@ -2166,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; @@ -2277,7 +2279,9 @@ int wxPGProperty::GetChildrenHeight( int lh, int iMax_ ) const return h; } -wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y, unsigned int lh, unsigned int* nextItemY ) const +wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y, + unsigned int lh, + unsigned int* nextItemY ) const { wxASSERT( nextItemY ); @@ -2327,9 +2331,13 @@ wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y, unsigned int lh, unsigne /* 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; @@ -2349,6 +2357,12 @@ void wxPGProperty::Empty() m_children.clear(); } +wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y ) const +{ + unsigned int nextItem; + return GetItemAtY( y, GetGrid()->GetRowHeight(), &nextItem); +} + void wxPGProperty::DeleteChildren() { wxPropertyGridPageState* state = m_parentState; @@ -2360,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 @@ -2673,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); } @@ -2789,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); @@ -2807,7 +2822,7 @@ void wxPGChoices::AssignData( wxPGChoicesData* data ) if ( data != wxPGChoicesEmptyData ) { m_data = data; - data->m_refCount++; + data->IncRef(); } }