Moved SetPropertyAttributeAll() to wxPropertyGridInterface

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-09-21 15:42:08 +00:00
parent bba3f9b5bc
commit 3c26d11be9
9 changed files with 39 additions and 48 deletions

View File

@@ -595,12 +595,6 @@ public:
/** Sets y coordinate of the description box splitter. */
void SetDescBoxHeight( int ht, bool refresh = true );
/** Sets property attribute for all applicapple properties.
Be sure to use this method after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( const wxString& name, wxVariant value );
/** Moves splitter as left as possible, while still allowing all
labels to be shown in full.
@param subProps

View File

@@ -966,12 +966,6 @@ public:
/** Sets background colour of margin. */
void SetMarginColour(const wxColour& col);
/** Sets property attribute for all applicapple properties.
Be sure to use this method only after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( const wxString& attrName, wxVariant value );
/** Sets background colour of property and all its children. Colours of
captions are not affected. Background brush cache is optimized for often
set colours to be set last.

View File

@@ -908,6 +908,12 @@ public:
DoSetPropertyAttribute(id,attrName,value,argFlags);
}
/** Sets property attribute for all applicapple properties.
Be sure to use this method only after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( const wxString& attrName, wxVariant value );
/** Sets attributes from a wxPGAttributeStorage.
*/
void SetPropertyAttributes( wxPGPropArg id,

View File

@@ -483,12 +483,6 @@ public:
/** Sets y coordinate of the description box splitter. */
void SetDescBoxHeight( int ht, bool refresh = true );
/** Sets property attribute for all applicapple properties.
Be sure to use this method after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( const wxString& name, wxVariant value );
/** Moves splitter as left as possible, while still allowing all
labels to be shown in full.
@param subProps

View File

@@ -647,12 +647,6 @@ public:
/** Sets background colour of margin. */
void SetMarginColour(const wxColour& col);
/** Sets property attribute for all applicapple properties.
Be sure to use this method only after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( const wxString& attrName, wxVariant value );
/** Sets background colour of property and all its children. Colours of
captions are not affected. Background brush cache is optimized for often
set colours to be set last.

View File

@@ -665,6 +665,12 @@ public:
DoSetPropertyAttribute(id,attrName,value,argFlags);
}
/** Sets property attribute for all applicapple properties.
Be sure to use this method only after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( const wxString& attrName, wxVariant value );
/** Sets attributes from a wxPGAttributeStorage.
*/
void SetPropertyAttributes( wxPGPropArg id, const wxPGAttributeStorage& attributes )

View File

@@ -703,19 +703,6 @@ void wxPropertyGridManager::SetColumnCount( int colCount, int page )
}
// -----------------------------------------------------------------------
void wxPropertyGridManager::SetPropertyAttributeAll( const wxString& attrName, wxVariant value )
{
size_t i;
for ( i=0; i<GetPageCount(); i++ )
{
wxPropertyGridPage* page = (wxPropertyGridPage*)m_arrPages.Item(i);
DoSetPropertyAttribute(page->GetStatePtr()->m_properties, attrName, value, wxPG_RECURSE);
}
}
// -----------------------------------------------------------------------
size_t wxPropertyGridManager::GetPageCount() const
{
if ( !(m_iFlags & wxPG_MAN_FL_PAGE_INSERTED) )

View File

@@ -6016,11 +6016,6 @@ wxEvent* wxPropertyGridEvent::Clone() const
return new wxPropertyGridEvent( *this );
}
void wxPropertyGrid::SetPropertyAttributeAll( const wxString& attrName, wxVariant value )
{
DoSetPropertyAttribute(GetRoot(), attrName, value, wxPG_RECURSE);
}
// -----------------------------------------------------------------------
// wxPropertyGridPopulator
// -----------------------------------------------------------------------

View File

@@ -549,6 +549,24 @@ void wxPropertyGridInterface::DoSetPropertyAttribute( wxPGPropArg id, const wxSt
// -----------------------------------------------------------------------
void wxPropertyGridInterface::SetPropertyAttributeAll( const wxString& attrName,
wxVariant value )
{
unsigned int pageIndex = 0;
for (;;)
{
wxPropertyGridPageState* page = GetPageState(pageIndex);
if ( !page ) break;
DoSetPropertyAttribute(page->DoGetRoot(), attrName, value, wxPG_RECURSE);
pageIndex++;
}
}
// -----------------------------------------------------------------------
void wxPropertyGridInterface::GetPropertiesWithFlag( wxArrayPGProperty* targetArr,
wxPGProperty::FlagType flags,
bool inverse,
@@ -874,14 +892,17 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const
//
// Save state on page basis
size_t pageIndex = 0;
wxPropertyGridPageState* pageState = GetPageState(pageIndex);
unsigned int pageIndex = 0;
wxArrayPtrVoid pageStates;
while ( pageState )
for (;;)
{
pageStates.Add(pageState);
pageIndex += 1;
pageState = GetPageState(pageIndex);
wxPropertyGridPageState* page = GetPageState(pageIndex);
if ( !page ) break;
pageStates.Add(page);
pageIndex++;
}
for ( pageIndex=0; pageIndex < pageStates.size(); pageIndex++ )