git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49262
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
behaviour of GetNextSibling() consistent between wxMSW and generic versions.
- Merged wxRichTextAttr and wxTextAttrEx into wxTextAttr, and added a font table
to wxRichTextBuffer to reduce wxFont consumption and increase performance.
behaviour of GetNextSibling() consistent between wxMSW and generic versions.
- Merged wxRichTextAttr and wxTextAttrEx into wxTextAttr, and added a font table
to wxRichTextBuffer to reduce wxFont consumption and increase performance.
+- Optimize wxGenericTreeCtrl::Collapse/ExpandAllChildren() (Szczepan Holyszewski)
void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
// expand this item first, this might result in its children being added on
// the fly
if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
// expand this item first, this might result in its children being added on
// the fly
if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
{
ExpandAllChildren(idCurr);
}
{
ExpandAllChildren(idCurr);
}
}
void wxTreeCtrlBase::CollapseAll()
}
void wxTreeCtrlBase::CollapseAll()
void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
{
void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
{
// first (recursively) collapse all the children
wxTreeItemIdValue cookie;
for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
// first (recursively) collapse all the children
wxTreeItemIdValue cookie;
for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
// then collapse this element too
Collapse(item);
// then collapse this element too
Collapse(item);
}
bool wxTreeCtrlBase::IsEmpty() const
}
bool wxTreeCtrlBase::IsEmpty() const
+ if ( !m_freezeCount )
+ {
+ CalculatePositions();
+ RefreshSubtree(item);
+ }
+ else // frozen
+ {
+ m_dirty = true;
+ }
event.SetEventType(wxEVT_COMMAND_TREE_ITEM_EXPANDED);
GetEventHandler()->ProcessEvent( event );
event.SetEventType(wxEVT_COMMAND_TREE_ITEM_EXPANDED);
GetEventHandler()->ProcessEvent( event );
if ( --m_freezeCount == 0 )
{
if ( --m_freezeCount == 0 )
{
+ if ( m_dirty )
+ DoDirtyProcessing();
+ else
+ Refresh();