X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7261371b17e5927b451c62c8683f40b4df338895..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/propgrid/propgridiface.cpp diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 9ea84d5b42..5f66781a81 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -6,7 +6,7 @@ // Created: 2008-08-24 // RCS-ID: $Id$ // Copyright: (c) Jaakko Salli -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". @@ -73,10 +73,8 @@ wxPGProperty* wxPGPropArgCls::GetPtr( wxPropertyGridInterface* iface ) const return iface->GetPropertyByNameA(*m_ptr.stringName); else if ( m_flags & IsCharPtr ) return iface->GetPropertyByNameA(m_ptr.charName); -#if wxUSE_WCHAR_T else if ( m_flags & IsWCharPtr ) return iface->GetPropertyByNameA(m_ptr.wcharName); -#endif return NULL; } @@ -166,10 +164,6 @@ wxPGProperty* wxPropertyGridInterface::RemoveProperty( wxPGPropArg id ) state->DoDelete( p, false ); - // Mark the property as 'unattached' - p->m_parentState = NULL; - p->m_parent = NULL; - RefreshGrid(state); return p; @@ -283,7 +277,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable ) grid->DoSelectProperty( p, wxPG_SEL_FORCE ); } - state->DoEnableProperty(p, enable); + p->DoEnable(enable); RefreshProperty( p ); @@ -359,6 +353,17 @@ void wxPropertyGridInterface::ClearModifiedStatus() GetPropertyGrid()->RefreshEditor(); } +bool wxPropertyGridInterface::SetColumnProportion( unsigned int column, + int proportion ) +{ + wxCHECK(m_pState, false); + wxPropertyGrid* pg = m_pState->GetGrid(); + wxCHECK(pg, false); + wxCHECK(pg->HasFlag(wxPG_SPLITTER_AUTO_CENTER), false); + m_pState->DoSetColumnProportion(column, proportion); + return true; +} + // ----------------------------------------------------------------------- // wxPropertyGridInterface property value setting and getting // ----------------------------------------------------------------------- @@ -694,7 +699,7 @@ void wxPropertyGridInterface::SetPropertyCell( wxPGPropArg id, wxPG_PROP_ARG_CALL_PROLOG() wxPGCell& cell = p->GetCell(column); - if ( text.length() && text != wxPG_LABEL ) + if ( !text.empty() && text != wxPG_LABEL ) cell.SetText(text); if ( bitmap.IsOk() ) cell.SetBitmap(bitmap); @@ -927,7 +932,7 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const } // Remove last '|' - if ( result.length() ) + if ( !result.empty() ) result.RemoveLast(); return result; @@ -1029,13 +1034,13 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res { if ( pageState->IsDisplayed() ) { - if ( values[0].length() ) + if ( !values[0].empty() ) newSelection = GetPropertyByName(value); pgSelectionSet = true; } else { - if ( values[0].length() ) + if ( !values[0].empty() ) pageState->DoSetSelection(GetPropertyByName(value)); else pageState->DoClearSelection();