count the root item in wxTreeCtrl::GetCount()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-06-09 21:48:18 +00:00
parent d07096ad61
commit 1a4088e1c7
2 changed files with 5 additions and 1 deletions

View File

@ -119,6 +119,7 @@ wxGTK:
- fixed wrong colour of tooltips under some themes - fixed wrong colour of tooltips under some themes
- implemented wxColourDialog as native dialog - implemented wxColourDialog as native dialog
- wxTreeCtrl::GetCount() counts root as well now (compatible with MSW)
wxMotif: wxMotif:

View File

@ -963,7 +963,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
HWND hwndEdit = TreeView_GetEditControl(GetHwnd()); HWND hwndEdit = TreeView_GetEditControl(GetHwnd());
if ( hwndEdit ) if ( hwndEdit )
{ {
if ( item == GetSelection() ) if ( item == m_idEdited )
{ {
::SetWindowText(hwndEdit, text); ::SetWindowText(hwndEdit, text);
} }
@ -2016,6 +2016,8 @@ void wxTreeCtrl::DeleteTextCtrl()
m_textCtrl->SetHWND(0); m_textCtrl->SetHWND(0);
delete m_textCtrl; delete m_textCtrl;
m_textCtrl = NULL; m_textCtrl = NULL;
m_idEdited.Unset();
} }
} }
@ -2026,6 +2028,7 @@ wxTextCtrl* wxTreeCtrl::EditLabel(const wxTreeItemId& item,
DeleteTextCtrl(); DeleteTextCtrl();
m_idEdited = item;
m_textCtrl = (wxTextCtrl *)textControlClass->CreateObject(); m_textCtrl = (wxTextCtrl *)textControlClass->CreateObject();
HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), HITEM(item)); HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), HITEM(item));