X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e607eac25c66866c3ad05313eb65510dd31ab557..8d2c70414cc0c6b93147d0c0cc963f217fcb2023:/src/propgrid/propgridiface.cpp diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index ecc6c0ef30..9acbb60a0f 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -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; @@ -270,7 +264,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable ) return false; // If active, Set active Editor. - if ( grid->GetState() == state && p == grid->GetSelection() ) + if ( grid && grid->GetState() == state && p == grid->GetSelection() ) grid->DoSelectProperty( p, wxPG_SEL_FORCE ); } else @@ -279,7 +273,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable ) return false; // If active, Disable as active Editor. - if ( grid->GetState() == state && p == grid->GetSelection() ) + if ( grid && grid->GetState() == state && p == grid->GetSelection() ) grid->DoSelectProperty( p, wxPG_SEL_FORCE ); } @@ -350,6 +344,7 @@ void wxPropertyGridInterface::ClearModifiedStatus() if ( !page ) break; page->DoGetRoot()->SetFlagRecursively(wxPG_PROP_MODIFIED, false); + page->m_anyModified = false; pageIndex++; } @@ -358,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 // ----------------------------------------------------------------------- @@ -586,8 +592,6 @@ void wxPropertyGridInterface::Sort( int flags ) { wxPropertyGrid* pg = GetPropertyGrid(); - pg->DoClearSelection(); - unsigned int pageIndex = 0; for (;;) @@ -597,6 +601,10 @@ void wxPropertyGridInterface::Sort( int flags ) page->DoSort(flags); pageIndex++; } + + // Fix positions of any open editor controls + if ( pg ) + pg->CorrectEditorWidgetPosY(); } // -----------------------------------------------------------------------