Send the right notification code (A/W) depending on the Unicode
setting.
This commit is contained in:
parent
011fc645a3
commit
02af550a2a
|
@ -412,6 +412,16 @@ TREEVIEW_GetListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
||||||
|
|
||||||
/* Notifications ************************************************************/
|
/* Notifications ************************************************************/
|
||||||
|
|
||||||
|
static INT get_notifycode(TREEVIEW_INFO *infoPtr, INT code)
|
||||||
|
{
|
||||||
|
if (infoPtr->bNtfUnicode) {
|
||||||
|
if ( code >= (TVN_FIRST + TVN_LAST) / 2) code -= (TVN_FIRST - TVN_LAST) / 2;
|
||||||
|
} else {
|
||||||
|
if ( code < (TVN_FIRST + TVN_LAST) / 2) code += (TVN_FIRST - TVN_LAST) / 2;
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TREEVIEW_SendRealNotify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
TREEVIEW_SendRealNotify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -429,10 +439,10 @@ TREEVIEW_SendSimpleNotify(TREEVIEW_INFO *infoPtr, UINT code)
|
||||||
NMHDR nmhdr;
|
NMHDR nmhdr;
|
||||||
HWND hwnd = infoPtr->hwnd;
|
HWND hwnd = infoPtr->hwnd;
|
||||||
|
|
||||||
TRACE("%x\n", code);
|
TRACE("%d\n", code);
|
||||||
nmhdr.hwndFrom = hwnd;
|
nmhdr.hwndFrom = hwnd;
|
||||||
nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
||||||
nmhdr.code = code;
|
nmhdr.code = get_notifycode(infoPtr, code);
|
||||||
|
|
||||||
return (BOOL)TREEVIEW_SendRealNotify(infoPtr,
|
return (BOOL)TREEVIEW_SendRealNotify(infoPtr,
|
||||||
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
|
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
|
||||||
|
@ -476,14 +486,14 @@ TREEVIEW_SendTreeviewNotify(TREEVIEW_INFO *infoPtr, UINT code, UINT action,
|
||||||
NMTREEVIEWA nmhdr;
|
NMTREEVIEWA nmhdr;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
TRACE("code:%x action:%x olditem:%p newitem:%p\n",
|
TRACE("code:%d action:%x olditem:%p newitem:%p\n",
|
||||||
code, action, oldItem, newItem);
|
code, action, oldItem, newItem);
|
||||||
|
|
||||||
ZeroMemory(&nmhdr, sizeof(NMTREEVIEWA));
|
ZeroMemory(&nmhdr, sizeof(NMTREEVIEWA));
|
||||||
|
|
||||||
nmhdr.hdr.hwndFrom = hwnd;
|
nmhdr.hdr.hwndFrom = hwnd;
|
||||||
nmhdr.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
nmhdr.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
||||||
nmhdr.hdr.code = code;
|
nmhdr.hdr.code = get_notifycode(infoPtr, code);
|
||||||
nmhdr.action = action;
|
nmhdr.action = action;
|
||||||
|
|
||||||
if (oldItem)
|
if (oldItem)
|
||||||
|
@ -512,11 +522,11 @@ TREEVIEW_SendTreeviewDnDNotify(TREEVIEW_INFO *infoPtr, UINT code,
|
||||||
HWND hwnd = infoPtr->hwnd;
|
HWND hwnd = infoPtr->hwnd;
|
||||||
NMTREEVIEWA nmhdr;
|
NMTREEVIEWA nmhdr;
|
||||||
|
|
||||||
TRACE("code:%x dragitem:%p\n", code, dragItem);
|
TRACE("code:%d dragitem:%p\n", code, dragItem);
|
||||||
|
|
||||||
nmhdr.hdr.hwndFrom = hwnd;
|
nmhdr.hdr.hwndFrom = hwnd;
|
||||||
nmhdr.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
nmhdr.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
||||||
nmhdr.hdr.code = code;
|
nmhdr.hdr.code = get_notifycode(infoPtr, code);
|
||||||
nmhdr.action = 0;
|
nmhdr.action = 0;
|
||||||
nmhdr.itemNew.mask = TVIF_STATE | TVIF_PARAM | TVIF_HANDLE;
|
nmhdr.itemNew.mask = TVIF_STATE | TVIF_PARAM | TVIF_HANDLE;
|
||||||
nmhdr.itemNew.hItem = dragItem;
|
nmhdr.itemNew.hItem = dragItem;
|
||||||
|
@ -623,7 +633,7 @@ TREEVIEW_BeginLabelEditNotify(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editItem)
|
||||||
|
|
||||||
tvdi.hdr.hwndFrom = hwnd;
|
tvdi.hdr.hwndFrom = hwnd;
|
||||||
tvdi.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
tvdi.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
||||||
tvdi.hdr.code = TVN_BEGINLABELEDITA;
|
tvdi.hdr.code = get_notifycode(infoPtr, TVN_BEGINLABELEDITA);
|
||||||
|
|
||||||
tvdi.item.mask = TVIF_HANDLE | TVIF_STATE | TVIF_PARAM | TVIF_TEXT;
|
tvdi.item.mask = TVIF_HANDLE | TVIF_STATE | TVIF_PARAM | TVIF_TEXT;
|
||||||
tvdi.item.hItem = editItem;
|
tvdi.item.hItem = editItem;
|
||||||
|
@ -3628,7 +3638,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
|
||||||
|
|
||||||
tvdi.hdr.hwndFrom = hwnd;
|
tvdi.hdr.hwndFrom = hwnd;
|
||||||
tvdi.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
tvdi.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
|
||||||
tvdi.hdr.code = TVN_ENDLABELEDITA;
|
tvdi.hdr.code = get_notifycode(infoPtr, TVN_ENDLABELEDITA);
|
||||||
tvdi.item.mask = 0;
|
tvdi.item.mask = 0;
|
||||||
tvdi.item.hItem = editedItem;
|
tvdi.item.hItem = editedItem;
|
||||||
tvdi.item.state = editedItem->state;
|
tvdi.item.state = editedItem->state;
|
||||||
|
|
Loading…
Reference in New Issue