+ Refresh(true, &rect);
+}
+
+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 )
+ RefreshSelectedUnder(m_anchor);
+}
+
+void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
+{
+ if (m_freezeCount) return;
+
+ if ( item->IsSelected() )
+ RefreshLine(item);
+
+ const wxArrayGenericTreeItems& children = item->GetChildren();
+ size_t count = children.GetCount();
+ for ( size_t n = 0; n < count; n++ )
+ {
+ RefreshSelectedUnder(children[n]);
+ }
+}
+
+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
+// ----------------------------------------------------------------------------
+
+bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour)
+{
+ if ( !wxWindow::SetBackgroundColour(colour) )
+ return false;
+
+ if (m_freezeCount) return true;
+
+ Refresh();
+
+ return true;
+}
+
+bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour)
+{
+ if ( !wxWindow::SetForegroundColour(colour) )
+ return false;
+
+ if (m_freezeCount) return true;
+
+ Refresh();
+
+ return true;
+}
+
+// Process the tooltip event, to speed up event processing.
+// Doesn't actually get a tooltip.
+void wxGenericTreeCtrl::OnGetToolTip( wxTreeEvent &event )
+{
+ event.Veto();
+}
+
+
+wxSize wxGenericTreeCtrl::DoGetBestSize() const
+{
+ // something is better than nothing...
+ // 100x80 is what the MSW version will get from the default
+ // wxControl::DoGetBestSize
+ return wxSize(100,80);
+}
+
+
+// NOTE: If using the wxListBox visual attributes works everywhere then this can
+// be removed, as well as the #else case below.
+#define _USE_VISATTR 0
+
+#if _USE_VISATTR
+#include "wx/listbox.h"
+#endif
+
+//static
+wxVisualAttributes
+#if _USE_VISATTR
+wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
+#else
+wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+#endif
+{
+#if _USE_VISATTR
+ // Use the same color scheme as wxListBox
+ return wxListBox::GetClassDefaultAttributes(variant);
+#else
+ wxVisualAttributes attr;
+ attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+ attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
+ attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+ return attr;
+#endif