Fixed bug: SetPropertyValueUnspecified(p) and p->SetValue(wxNullVariant) were out of sync
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1748,8 +1748,6 @@ protected:
|
|||||||
const wxRect* clip_rect,
|
const wxRect* clip_rect,
|
||||||
bool isBuffered ) const;
|
bool isBuffered ) const;
|
||||||
|
|
||||||
void DoSetPropertyValueUnspecified( wxPGProperty* p );
|
|
||||||
|
|
||||||
/** Draws an expand/collapse (ie. +/-) button.
|
/** Draws an expand/collapse (ie. +/-) button.
|
||||||
*/
|
*/
|
||||||
virtual void DrawExpanderButton( wxDC& dc, const wxRect& rect,
|
virtual void DrawExpanderButton( wxDC& dc, const wxRect& rect,
|
||||||
|
@@ -1030,7 +1030,12 @@ public:
|
|||||||
If it has children (it may be category), then the same thing is done to
|
If it has children (it may be category), then the same thing is done to
|
||||||
them.
|
them.
|
||||||
*/
|
*/
|
||||||
void SetPropertyValueUnspecified( wxPGPropArg id );
|
void SetPropertyValueUnspecified( wxPGPropArg id )
|
||||||
|
{
|
||||||
|
wxPG_PROP_ARG_CALL_PROLOG()
|
||||||
|
wxVariant nullVariant;
|
||||||
|
SetPropVal(p, nullVariant);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
/** Sets various property values from a list of wxVariants. If property with
|
/** Sets various property values from a list of wxVariants. If property with
|
||||||
|
@@ -606,8 +606,6 @@ public:
|
|||||||
void DoSetPropertyValues( const wxVariantList& list,
|
void DoSetPropertyValues( const wxVariantList& list,
|
||||||
wxPGProperty* default_category );
|
wxPGProperty* default_category );
|
||||||
|
|
||||||
void DoSetPropertyValueUnspecified( wxPGProperty* p );
|
|
||||||
|
|
||||||
void SetSplitterLeft( bool subProps = false );
|
void SetSplitterLeft( bool subProps = false );
|
||||||
|
|
||||||
/** Set virtual width for this particular page. */
|
/** Set virtual width for this particular page. */
|
||||||
|
@@ -1285,9 +1285,6 @@ void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags )
|
|||||||
{
|
{
|
||||||
m_value = value;
|
m_value = value;
|
||||||
OnSetValue();
|
OnSetValue();
|
||||||
|
|
||||||
if ( !(flags & wxPG_SETVAL_FROM_PARENT) )
|
|
||||||
UpdateParentValues();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( flags & wxPG_SETVAL_BY_USER )
|
if ( flags & wxPG_SETVAL_BY_USER )
|
||||||
@@ -1317,6 +1314,9 @@ void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !(flags & wxPG_SETVAL_FROM_PARENT) )
|
||||||
|
UpdateParentValues();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update editor control
|
// Update editor control
|
||||||
//
|
//
|
||||||
|
@@ -1185,24 +1185,6 @@ void wxPropertyGrid::PrepareAfterItemsAdded()
|
|||||||
RecalculateVirtualSize();
|
RecalculateVirtualSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
|
||||||
// wxPropertyGrid property value setting and getting
|
|
||||||
// -----------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxPropertyGrid::DoSetPropertyValueUnspecified( wxPGProperty* p )
|
|
||||||
{
|
|
||||||
m_pState->DoSetPropertyValueUnspecified(p);
|
|
||||||
DrawItemAndChildren(p);
|
|
||||||
|
|
||||||
wxPGProperty* parent = p->GetParent();
|
|
||||||
while ( parent &&
|
|
||||||
(parent->GetFlags() & wxPG_PROP_PARENTAL_FLAGS) == wxPG_PROP_MISC_PARENT )
|
|
||||||
{
|
|
||||||
DrawItem(parent);
|
|
||||||
parent = parent->GetParent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// wxPropertyGrid property operations
|
// wxPropertyGrid property operations
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@@ -3635,7 +3617,12 @@ void wxPropertyGrid::RefreshEditor()
|
|||||||
wnd->SetFont(GetFont());
|
wnd->SetFont(GetFont());
|
||||||
}
|
}
|
||||||
|
|
||||||
p->GetEditorClass()->UpdateControl(p, wnd);
|
const wxPGEditor* editorClass = p->GetEditorClass();
|
||||||
|
|
||||||
|
editorClass->UpdateControl(p, wnd);
|
||||||
|
|
||||||
|
if ( p->IsValueUnspecified() )
|
||||||
|
editorClass ->SetValueToUnspecified(p, wnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
@@ -498,18 +498,6 @@ bool wxPropertyGridInterface::ExpandAll( bool doExpand )
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
void wxPropertyGridInterface::SetPropertyValueUnspecified( wxPGPropArg id )
|
|
||||||
{
|
|
||||||
wxPG_PROP_ARG_CALL_PROLOG()
|
|
||||||
wxPropertyGrid* propGrid = p->GetGridIfDisplayed();
|
|
||||||
if ( propGrid )
|
|
||||||
propGrid->DoSetPropertyValueUnspecified(p);
|
|
||||||
else
|
|
||||||
p->GetParentState()->DoSetPropertyValueUnspecified(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxPropertyGridInterface::ClearModifiedStatus()
|
void wxPropertyGridInterface::ClearModifiedStatus()
|
||||||
{
|
{
|
||||||
unsigned int pageIndex = 0;
|
unsigned int pageIndex = 0;
|
||||||
|
@@ -1208,33 +1208,6 @@ bool wxPropertyGridPageState::DoSetPropertyValueWxObjectPtr( wxPGProperty* p, wx
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxPropertyGridPageState::DoSetPropertyValueUnspecified( wxPGProperty* p )
|
|
||||||
{
|
|
||||||
wxCHECK_RET( p, wxT("invalid property id") );
|
|
||||||
|
|
||||||
if ( !p->IsValueUnspecified() )
|
|
||||||
{
|
|
||||||
// Value should be set first - editor class methods may need it
|
|
||||||
p->m_value.MakeNull();
|
|
||||||
|
|
||||||
wxASSERT( m_pPropGrid );
|
|
||||||
|
|
||||||
if ( m_pPropGrid->GetState() == this )
|
|
||||||
{
|
|
||||||
if ( m_pPropGrid->m_selected == p && m_pPropGrid->m_wndEditor )
|
|
||||||
{
|
|
||||||
p->GetEditorClass()->SetValueToUnspecified(p, m_pPropGrid->GetEditorControl());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int i;
|
|
||||||
for ( i = 0; i < p->GetChildCount(); i++ )
|
|
||||||
DoSetPropertyValueUnspecified( p->Item(i) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// wxPropertyGridPageState property operations
|
// wxPropertyGridPageState property operations
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user