Removed wxPropertyGridInterface::ClearPropertyValue() (use SetPropertyValue(defaultValue) instead)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -230,15 +230,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue );
|
bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue );
|
||||||
|
|
||||||
/** Resets value of a property to its default. */
|
|
||||||
bool ClearPropertyValue( wxPGPropArg id )
|
|
||||||
{
|
|
||||||
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
|
|
||||||
p->SetValue(p->GetDefaultValue());
|
|
||||||
RefreshProperty(p);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Deletes a property by id. If category is deleted, all children are
|
Deletes a property by id. If category is deleted, all children are
|
||||||
automatically deleted as well.
|
automatically deleted as well.
|
||||||
|
@@ -110,11 +110,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue );
|
bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue );
|
||||||
|
|
||||||
/**
|
|
||||||
Resets value of a property to its default.
|
|
||||||
*/
|
|
||||||
bool ClearPropertyValue( wxPGPropArg id );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Deletes a property.
|
Deletes a property.
|
||||||
*/
|
*/
|
||||||
|
@@ -655,7 +655,6 @@ enum
|
|||||||
ID_CATCOLOURS,
|
ID_CATCOLOURS,
|
||||||
ID_SETCOLOUR,
|
ID_SETCOLOUR,
|
||||||
ID_STATICLAYOUT,
|
ID_STATICLAYOUT,
|
||||||
ID_CLEAR,
|
|
||||||
ID_POPULATE1,
|
ID_POPULATE1,
|
||||||
ID_POPULATE2,
|
ID_POPULATE2,
|
||||||
ID_COLLAPSE,
|
ID_COLLAPSE,
|
||||||
@@ -753,7 +752,6 @@ BEGIN_EVENT_TABLE(FormMain, wxFrame)
|
|||||||
EVT_MENU( ID_SELECTSTYLE, FormMain::OnSelectStyle )
|
EVT_MENU( ID_SELECTSTYLE, FormMain::OnSelectStyle )
|
||||||
|
|
||||||
EVT_MENU( ID_STATICLAYOUT, FormMain::OnMisc )
|
EVT_MENU( ID_STATICLAYOUT, FormMain::OnMisc )
|
||||||
EVT_MENU( ID_CLEAR, FormMain::OnMisc )
|
|
||||||
EVT_MENU( ID_COLLAPSE, FormMain::OnMisc )
|
EVT_MENU( ID_COLLAPSE, FormMain::OnMisc )
|
||||||
EVT_MENU( ID_COLLAPSEALL, FormMain::OnMisc )
|
EVT_MENU( ID_COLLAPSEALL, FormMain::OnMisc )
|
||||||
|
|
||||||
@@ -2117,7 +2115,6 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
|
|||||||
menuTools1->AppendSeparator();
|
menuTools1->AppendSeparator();
|
||||||
menuTools1->Append(ID_SETCOLOUR, wxT("Set Bg Colour") );
|
menuTools1->Append(ID_SETCOLOUR, wxT("Set Bg Colour") );
|
||||||
menuTools1->Append(ID_UNSPECIFY, wxT("Set to Unspecified") );
|
menuTools1->Append(ID_UNSPECIFY, wxT("Set to Unspecified") );
|
||||||
menuTools1->Append(ID_CLEAR, wxT("Set Value to Default") );
|
|
||||||
menuTools1->AppendSeparator();
|
menuTools1->AppendSeparator();
|
||||||
m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
|
m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
|
||||||
wxT("Toggles item's enabled state.") );
|
wxT("Toggles item's enabled state.") );
|
||||||
@@ -2954,10 +2951,6 @@ void FormMain::OnMisc ( wxCommandEvent& event )
|
|||||||
if ( event.IsChecked() ) m_pPropGridManager->SetWindowStyleFlag( wsf|wxPG_STATIC_LAYOUT );
|
if ( event.IsChecked() ) m_pPropGridManager->SetWindowStyleFlag( wsf|wxPG_STATIC_LAYOUT );
|
||||||
else m_pPropGridManager->SetWindowStyleFlag( wsf&~(wxPG_STATIC_LAYOUT) );
|
else m_pPropGridManager->SetWindowStyleFlag( wsf&~(wxPG_STATIC_LAYOUT) );
|
||||||
}
|
}
|
||||||
else if ( id == ID_CLEAR )
|
|
||||||
{
|
|
||||||
m_pPropGridManager->ClearPropertyValue(m_pPropGridManager->GetGrid()->GetSelection());
|
|
||||||
}
|
|
||||||
else if ( id == ID_COLLAPSEALL )
|
else if ( id == ID_COLLAPSEALL )
|
||||||
{
|
{
|
||||||
wxPGVIterator it;
|
wxPGVIterator it;
|
||||||
|
@@ -667,8 +667,8 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
|||||||
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Clear property value
|
// Test property default values
|
||||||
RT_START_TEST(ClearPropertyValue)
|
RT_START_TEST(Default_Values)
|
||||||
|
|
||||||
wxPGVIterator it;
|
wxPGVIterator it;
|
||||||
|
|
||||||
@@ -676,8 +676,8 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
|||||||
!it.AtEnd();
|
!it.AtEnd();
|
||||||
it.Next() )
|
it.Next() )
|
||||||
{
|
{
|
||||||
RT_MSG(wxString::Format(wxT("Clearing value of '%s'"),it.GetProperty()->GetLabel().c_str()));
|
wxPGProperty* p = it.GetProperty();
|
||||||
pgman->ClearPropertyValue(it.GetProperty());
|
pgman->SetPropertyValue(p, p->GetDefaultValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recreate grid
|
// Recreate grid
|
||||||
@@ -1126,28 +1126,6 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
|||||||
OnColourScheme(evt);
|
OnColourScheme(evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
// Test ClearPropertyValue
|
|
||||||
RT_START_TEST(ClearPropertyValue)
|
|
||||||
|
|
||||||
for ( i=0; i<3; i++ )
|
|
||||||
{
|
|
||||||
wxPropertyGridPage* page = pgman->GetPage(i);
|
|
||||||
|
|
||||||
// Iterate over all properties.
|
|
||||||
wxPropertyGridIterator it;
|
|
||||||
|
|
||||||
for ( it = page->GetIterator();
|
|
||||||
!it.AtEnd();
|
|
||||||
it++ )
|
|
||||||
{
|
|
||||||
wxLogDebug((*it)->GetLabel());
|
|
||||||
pgman->ClearPropertyValue( *it );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
RT_START_TEST(ManagerClear)
|
RT_START_TEST(ManagerClear)
|
||||||
pgman->Clear();
|
pgman->Clear();
|
||||||
|
Reference in New Issue
Block a user