From 7009f411aac9aea4fd76b33dd55b1f4da3d60886 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 25 Aug 2001 12:06:53 +0000 Subject: [PATCH] refresh the tree ctrl when its back/foreground colour changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/treectlg.h | 5 ++++- src/generic/treectlg.cpp | 33 ++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 545ecd90fd..d10a4e7d42 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -222,7 +222,6 @@ public: // Only for internal use right now, but should probably be public wxTreeItemId GetNext(const wxTreeItemId& item) const; - wxTreeItemId GetPrev(const wxTreeItemId& item) const; // operations // ---------- @@ -329,6 +328,10 @@ public: // implementation only from now on + // overridden base class virtuals + virtual bool SetBackgroundColour(const wxColour& colour); + virtual bool SetForegroundColour(const wxColour& colour); + // callbacks void OnPaint( wxPaintEvent &event ); void OnSetFocus( wxFocusEvent &event ); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index cb51d15b54..deede8e3e2 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1032,15 +1032,6 @@ wxTreeItemId wxGenericTreeCtrl::GetNext(const wxTreeItemId& item) const } } -wxTreeItemId wxGenericTreeCtrl::GetPrev(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxFAIL_MSG(wxT("not implemented")); - - return wxTreeItemId(); -} - wxTreeItemId wxGenericTreeCtrl::GetFirstVisibleItem() const { wxTreeItemId id = GetRootItem(); @@ -2926,4 +2917,28 @@ void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item) } } +// ---------------------------------------------------------------------------- +// changing colours: we need to refresh the tree control +// ---------------------------------------------------------------------------- + +bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour) +{ + if ( !wxWindow::SetBackgroundColour(colour) ) + return FALSE; + + Refresh(); + + return TRUE; +} + +}bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour) +{ + if ( !wxWindow::SetForegroundColour(colour) ) + return FALSE; + + Refresh(); + + return TRUE; +} + #endif // wxUSE_TREECTRL