fix for the crash when pressing TAB in the edit control created by EditLabel() (bug 555749)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-05-26 10:53:23 +00:00
parent d4380aafdd
commit 6aaef1403e

View File

@ -1241,21 +1241,21 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
{
wxASSERT( (textControlClass->IsKindOf(CLASSINFO(wxTextCtrl))) );
// VS: ListView_EditLabel requires that the list has focus.
// ListView_EditLabel requires that the list has focus.
SetFocus();
HWND hWnd = (HWND) ListView_EditLabel(GetHwnd(), item);
WXHWND hWnd = (WXHWND) ListView_EditLabel(GetHwnd(), item);
if (m_textCtrl)
{
m_textCtrl->SetHWND(0);
m_textCtrl->UnsubclassWin();
delete m_textCtrl;
m_textCtrl = NULL;
}
m_textCtrl = (wxTextCtrl*) textControlClass->CreateObject();
m_textCtrl->SetHWND((WXHWND) hWnd);
m_textCtrl->SubclassWin((WXHWND) hWnd);
m_textCtrl->SetHWND(hWnd);
m_textCtrl->SubclassWin(hWnd);
m_textCtrl->SetParent(this);
return m_textCtrl;
}