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)
wxGTK:
void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
+ Freeze();
// expand this item first, this might result in its children being added on
// the fly
if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
{
ExpandAllChildren(idCurr);
}
+ Thaw();
}
void wxTreeCtrlBase::CollapseAll()
void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
{
+ Freeze();
// first (recursively) collapse all the children
wxTreeItemIdValue cookie;
for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
// then collapse this element too
Collapse(item);
+ Thaw();
}
bool wxTreeCtrlBase::IsEmpty() const
}
item->Expand();
- CalculatePositions();
+ if ( !m_freezeCount )
+ {
+ CalculatePositions();
- RefreshSubtree(item);
+ RefreshSubtree(item);
+ }
+ else // frozen
+ {
+ m_dirty = true;
+ }
event.SetEventType(wxEVT_COMMAND_TREE_ITEM_EXPANDED);
GetEventHandler()->ProcessEvent( event );
if ( --m_freezeCount == 0 )
{
- Refresh();
+ if ( m_dirty )
+ DoDirtyProcessing();
+ else
+ Refresh();
}
}