Removed GetExpandedProperties() (used to act as poor man's GetEditableState())
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -266,16 +266,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool ExpandAll( bool expand = true );
|
bool ExpandAll( bool expand = true );
|
||||||
|
|
||||||
/** Returns list of expanded properties.
|
|
||||||
*/
|
|
||||||
wxArrayPGProperty GetExpandedProperties() const
|
|
||||||
{
|
|
||||||
wxArrayPGProperty array;
|
|
||||||
GetPropertiesWithFlag(&array, wxPG_PROP_COLLAPSED, true,
|
|
||||||
wxPG_ITERATE_ALL_PARENTS_RECURSIVELY|wxPG_ITERATE_HIDDEN);
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns id of first child of given property.
|
/** Returns id of first child of given property.
|
||||||
@remarks
|
@remarks
|
||||||
Does not return sub-properties!
|
Does not return sub-properties!
|
||||||
|
@@ -157,11 +157,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool ExpandAll( bool expand = true );
|
bool ExpandAll( bool expand = true );
|
||||||
|
|
||||||
/**
|
|
||||||
Returns list of expanded properties.
|
|
||||||
*/
|
|
||||||
wxArrayPGProperty GetExpandedProperties() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns id of first child of given property.
|
Returns id of first child of given property.
|
||||||
|
|
||||||
|
@@ -439,28 +439,6 @@ wxArrayPGProperty GetPropertiesInRandomOrder( wxPropertyGridInterface* props, in
|
|||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PropertiesToNames( wxPropertyGridInterface* WXUNUSED(iface),
|
|
||||||
wxArrayString* names,
|
|
||||||
const wxArrayPGProperty& properties )
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
for ( i=0; i<properties.size(); i++ )
|
|
||||||
names->Add( properties[i]->GetName() );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void NamesToProperties( wxPropertyGridInterface* iface,
|
|
||||||
wxArrayPGProperty* properties,
|
|
||||||
const wxArrayString& names )
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
for ( i=0; i<names.size(); i++ )
|
|
||||||
{
|
|
||||||
wxPGProperty* p = iface->GetPropertyByName(names[i]);
|
|
||||||
if ( p )
|
|
||||||
properties->push_back(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FormMain::RunTests( bool fullTest, bool interactive )
|
bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||||
{
|
{
|
||||||
wxString t;
|
wxString t;
|
||||||
@@ -594,50 +572,6 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
RT_START_TEST(GetPropertiesWithFlag)
|
|
||||||
|
|
||||||
//
|
|
||||||
// Get list of expanded properties
|
|
||||||
wxArrayPGProperty array = pgman->GetExpandedProperties();
|
|
||||||
|
|
||||||
// Make sure list only has items with children
|
|
||||||
for ( i=0; i<array.size(); i++ )
|
|
||||||
{
|
|
||||||
wxPGProperty* p = array[i];
|
|
||||||
if ( !p->IsKindOf(CLASSINFO(wxPGProperty)) )
|
|
||||||
RT_FAILURE_MSG(wxString::Format(wxT("'%s' was returned by GetExpandedProperties(), but was not a parent"),p->GetName().c_str()).c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
wxArrayString names;
|
|
||||||
PropertiesToNames( pgman, &names, array );
|
|
||||||
|
|
||||||
//
|
|
||||||
// ... and then collapse them
|
|
||||||
wxArrayPGProperty array2;
|
|
||||||
NamesToProperties( pgman, &array2, names );
|
|
||||||
|
|
||||||
for ( i=0; i<array2.size(); i++ )
|
|
||||||
{
|
|
||||||
wxPGProperty* p = array[i];
|
|
||||||
p->SetExpanded(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure everything is collapsed
|
|
||||||
wxPGVIterator it;
|
|
||||||
|
|
||||||
for ( it = pgman->GetVIterator(wxPG_ITERATE_ALL);
|
|
||||||
!it.AtEnd();
|
|
||||||
it.Next() )
|
|
||||||
{
|
|
||||||
wxPGProperty* p = it.GetProperty();
|
|
||||||
if ( p->IsExpanded() )
|
|
||||||
RT_FAILURE_MSG(wxString::Format(wxT("'%s.%s' was expanded"),p->GetParent()->GetName().c_str(),p->GetName().c_str()).c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
pgman->Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Delete everything in reverse order
|
// Delete everything in reverse order
|
||||||
|
Reference in New Issue
Block a user