From 1a4088e1c733e980d2f01b7da58545c804ac7e24 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Jun 2004 21:48:18 +0000 Subject: [PATCH] count the root item in wxTreeCtrl::GetCount() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/treectrl.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 698f24958d..e6a0a034f2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -119,6 +119,7 @@ wxGTK: - fixed wrong colour of tooltips under some themes - implemented wxColourDialog as native dialog +- wxTreeCtrl::GetCount() counts root as well now (compatible with MSW) wxMotif: diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 76964c950b..c2e063711f 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -963,7 +963,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) HWND hwndEdit = TreeView_GetEditControl(GetHwnd()); if ( hwndEdit ) { - if ( item == GetSelection() ) + if ( item == m_idEdited ) { ::SetWindowText(hwndEdit, text); } @@ -2016,6 +2016,8 @@ void wxTreeCtrl::DeleteTextCtrl() m_textCtrl->SetHWND(0); delete m_textCtrl; m_textCtrl = NULL; + + m_idEdited.Unset(); } } @@ -2026,6 +2028,7 @@ wxTextCtrl* wxTreeCtrl::EditLabel(const wxTreeItemId& item, DeleteTextCtrl(); + m_idEdited = item; m_textCtrl = (wxTextCtrl *)textControlClass->CreateObject(); HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), HITEM(item));