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));