fixed flicker in wxTreeCtrl::SetItemXXX()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-12-15 22:20:54 +00:00
parent 2e351786c5
commit d00407b2c6
3 changed files with 25 additions and 4 deletions

View File

@ -60,6 +60,13 @@ Unix ports:
and the compiler flags for C++ files only, CFLAGS should still be used and the compiler flags for C++ files only, CFLAGS should still be used
to compile pure C files. to compile pure C files.
2.3.3
-----
wxMSW:
- fixed flicker in wxTreeCtrl::SetItemXXX()
2.3.2 2.3.2
----- -----

View File

@ -400,6 +400,9 @@ protected:
// SetImageList helper // SetImageList helper
void SetAnyImageList(wxImageList *imageList, int which); void SetAnyImageList(wxImageList *imageList, int which);
// refresh a single item
void RefreshItem(const wxTreeItemId& item);
wxTextCtrl *m_textCtrl; // used while editing the item label wxTextCtrl *m_textCtrl; // used while editing the item label
wxImageList *m_imageListNormal, // images for tree elements wxImageList *m_imageListNormal, // images for tree elements
*m_imageListState; // special images for app defined states *m_imageListState; // special images for app defined states

View File

@ -1032,6 +1032,15 @@ void wxTreeCtrl::SetItemDropHighlight(const wxTreeItemId& item, bool highlight)
DoSetItem(&tvItem); DoSetItem(&tvItem);
} }
void wxTreeCtrl::RefreshItem(const wxTreeItemId& item)
{
wxRect rect;
if ( GetBoundingRect(item, rect) )
{
RefreshRect(rect);
}
}
void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item, void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item,
const wxColour& col) const wxColour& col)
{ {
@ -1046,7 +1055,8 @@ void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item,
} }
attr->SetTextColour(col); attr->SetTextColour(col);
Refresh();
RefreshItem(item);
} }
void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item, void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item,
@ -1063,7 +1073,8 @@ void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item,
} }
attr->SetBackgroundColour(col); attr->SetBackgroundColour(col);
Refresh();
RefreshItem(item);
} }
void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font) void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
@ -1079,7 +1090,8 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
} }
attr->SetFont(font); attr->SetFont(font);
Refresh();
RefreshItem(item);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -1097,7 +1109,6 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
// FALSE means get item rect for the whole item, not only text // FALSE means get item rect for the whole item, not only text
return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, (LPARAM)&rect) != 0; return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, (LPARAM)&rect) != 0;
} }
bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const