git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26499
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- wxHtmlWindow now delays image scaling until rendering,
resulting in much better display of scaled images
- wxHtmlWindow now delays image scaling until rendering,
resulting in much better display of scaled images
-- Added UpdateSize to wxSplitterWindow to allow layout
- while hidden
+- Added UpdateSize to wxSplitterWindow to allow layout while hidden
+- implemented Freeze/Thaw() for wxGenericTreeCtrl (Kevin Hock)
virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
+ virtual void Freeze();
+ virtual void Thaw();
+
// callbacks
void OnPaint( wxPaintEvent &event );
void OnSetFocus( wxFocusEvent &event );
// callbacks
void OnPaint( wxPaintEvent &event );
void OnSetFocus( wxFocusEvent &event );
*m_imageListState,
*m_imageListButtons;
*m_imageListState,
*m_imageListButtons;
int m_dragCount;
wxPoint m_dragStart;
wxGenericTreeItem *m_dropTarget;
int m_dragCount;
wxPoint m_dragStart;
wxGenericTreeItem *m_dropTarget;
m_textCtrl = NULL;
m_renameTimer = NULL;
m_textCtrl = NULL;
m_renameTimer = NULL;
m_findTimer = NULL;
m_lastOnSame = FALSE;
m_findTimer = NULL;
m_lastOnSame = FALSE;
* we actually redraw the tree when everything is over */
if (!m_dirty) return;
* we actually redraw the tree when everything is over */
if (!m_dirty) return;
+ if (m_freezeCount) return;
+
m_dirty = FALSE;
CalculatePositions();
m_dirty = FALSE;
CalculatePositions();
void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
{
if (m_dirty) return;
void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
{
if (m_dirty) return;
+ if (m_freezeCount) return;
wxSize client = GetClientSize();
wxSize client = GetClientSize();
void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
{
if (m_dirty) return;
void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
{
if (m_dirty) return;
+ if (m_freezeCount) return;
wxRect rect;
CalcScrolledPosition(0, item->GetY(), NULL, &rect.y);
wxRect rect;
CalcScrolledPosition(0, item->GetY(), NULL, &rect.y);
void wxGenericTreeCtrl::RefreshSelected()
{
void wxGenericTreeCtrl::RefreshSelected()
{
+ if (m_freezeCount) return;
+
// TODO: this is awfully inefficient, we should keep the list of all
// selected items internally, should be much faster
if ( m_anchor )
// TODO: this is awfully inefficient, we should keep the list of all
// selected items internally, should be much faster
if ( m_anchor )
void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
{
void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
{
+ if (m_freezeCount) return;
+
if ( item->IsSelected() )
RefreshLine(item);
if ( item->IsSelected() )
RefreshLine(item);
+void wxGenericTreeCtrl::Freeze()
+{
+ m_freezeCount++;
+}
+
+void wxGenericTreeCtrl::Thaw()
+{
+ wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen tree control?") );
+
+ if ( !--m_freezeCount )
+ {
+ Refresh();
+ }
+}
+
// ----------------------------------------------------------------------------
// changing colours: we need to refresh the tree control
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// changing colours: we need to refresh the tree control
// ----------------------------------------------------------------------------
if ( !wxWindow::SetBackgroundColour(colour) )
return FALSE;
if ( !wxWindow::SetBackgroundColour(colour) )
return FALSE;
+ if (m_freezeCount) return TRUE;
+
if ( !wxWindow::SetForegroundColour(colour) )
return FALSE;
if ( !wxWindow::SetForegroundColour(colour) )
return FALSE;
+ if (m_freezeCount) return TRUE;
+