end label edit patch from Ricky Gonzales <gonzales@pyramid3.net>

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-11-02 16:05:25 +00:00
parent 1dddf8389f
commit 1ee4ead5af
2 changed files with 29 additions and 12 deletions

View File

@ -1256,9 +1256,9 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{
eventType = wxEVT_COMMAND_LIST_END_LABEL_EDIT;
LV_DISPINFO *info = (LV_DISPINFO *)lParam;
wxConvertFromMSWListItem(this, event.m_item, info->item, GetHwnd());
wxConvertFromMSWListItem(this, event.m_item, info->item);
if ( info->item.pszText == NULL || info->item.iItem == -1 )
event.m_cancelled = TRUE;
return FALSE;
break;
}
case LVN_GETDISPINFO:
@ -1341,7 +1341,11 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
}
// else translate it into wxEVT_COMMAND_LIST_ITEM_ACTIVATED event
{
eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
event.m_itemIndex = hdr->iItem;
}
break;
case NM_RCLICK:
@ -1417,7 +1421,9 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
if ( !GetEventHandler()->ProcessEvent(event) )
return FALSE;
if ( (int)hdr1->code == LVN_GETDISPINFO)
switch ((int)hdr1->code)
{
case LVN_GETDISPINFO:
{
LV_DISPINFO *info = (LV_DISPINFO *)lParam;
if ( info->item.mask & LVIF_TEXT )
@ -1429,6 +1435,15 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
}
}
// wxConvertToMSWListItem(this, event.m_item, info->item);
break;
}
case LVN_ENDLABELEDIT:
{
*result = event.IsAllowed();
return TRUE;
}
default:
break;
}
*result = !event.IsAllowed();

View File

@ -1409,6 +1409,8 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
event.m_item = (WXHTREEITEM)info->item.hItem;
event.m_label = info->item.pszText;
if (info->item.pszText == NULL)
return FALSE;
break;
}