Applied [ 1394785 ] wxListCtrl::EndEditLabel implementation

By troelsk


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-02-11 15:16:35 +00:00
parent d5ea3919a3
commit 4496eadc93

View File

@@ -1372,11 +1372,25 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
}
// End label editing, optionally cancelling the edit
bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel))
bool wxListCtrl::EndEditLabel(bool cancel)
{
wxFAIL_MSG( _T("not implemented") );
return false;
// m_textCtrl is not always ready, ie. in EVT_LIST_BEGIN_LABEL_EDIT
HWND hwnd = ListView_GetEditControl(GetHwnd());
bool b = (hwnd != NULL);
if (b)
{
if (cancel)
::SetWindowText(hwnd, wxEmptyString); // dubious but better than nothing
if (m_textCtrl)
{
m_textCtrl->UnsubclassWin();
m_textCtrl->SetHWND(0);
delete m_textCtrl;
m_textCtrl = NULL;
}
::DestroyWindow(hwnd);
}
return b;
}
// Ensures this item is visible