From: Vadim Zeitlin Date: Sun, 26 May 2002 10:53:23 +0000 (+0000) Subject: fix for the crash when pressing TAB in the edit control created by EditLabel() (bug... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6aaef1403eaefd3f0b919963d7f231efb045e50c?ds=inline 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 --- diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 219ca955d7..ff95a5ce0e 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -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; }