comctl32/listview: Add NM_HOVER notification.
This commit is contained in:
parent
5f191553e8
commit
ea058d22ba
|
@ -99,7 +99,6 @@
|
||||||
* -- LVN_GETINFOTIP
|
* -- LVN_GETINFOTIP
|
||||||
* -- LVN_HOTTRACK
|
* -- LVN_HOTTRACK
|
||||||
* -- LVN_SETDISPINFO
|
* -- LVN_SETDISPINFO
|
||||||
* -- NM_HOVER
|
|
||||||
* -- LVN_BEGINRDRAG
|
* -- LVN_BEGINRDRAG
|
||||||
*
|
*
|
||||||
* Messages:
|
* Messages:
|
||||||
|
@ -3654,18 +3653,22 @@ static inline BOOL LISTVIEW_IsHotTracking(const LISTVIEW_INFO *infoPtr)
|
||||||
*/
|
*/
|
||||||
static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
|
static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
|
||||||
{
|
{
|
||||||
|
NMHDR hdr;
|
||||||
|
|
||||||
|
if (notify_hdr(infoPtr, NM_HOVER, &hdr)) return 0;
|
||||||
|
|
||||||
if (LISTVIEW_IsHotTracking(infoPtr))
|
if (LISTVIEW_IsHotTracking(infoPtr))
|
||||||
{
|
{
|
||||||
LVITEMW item;
|
LVITEMW item;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
|
||||||
SetFocus(infoPtr->hwndSelf);
|
|
||||||
|
|
||||||
pt.x = x;
|
pt.x = x;
|
||||||
pt.y = y;
|
pt.y = y;
|
||||||
|
|
||||||
if (LISTVIEW_GetItemAtPt(infoPtr, &item, pt))
|
if (LISTVIEW_GetItemAtPt(infoPtr, &item, pt))
|
||||||
LISTVIEW_SetSelection(infoPtr, item.iItem);
|
LISTVIEW_SetSelection(infoPtr, item.iItem);
|
||||||
|
|
||||||
|
SetFocus(infoPtr->hwndSelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -46,7 +46,9 @@ static const WCHAR testparentclassW[] =
|
||||||
|
|
||||||
HWND hwndparent, hwndparentW;
|
HWND hwndparent, hwndparentW;
|
||||||
/* prevents edit box creation, LVN_BEGINLABELEDIT return value */
|
/* prevents edit box creation, LVN_BEGINLABELEDIT return value */
|
||||||
BOOL blockEdit;
|
static BOOL blockEdit;
|
||||||
|
/* return nonzero on NM_HOVER */
|
||||||
|
static BOOL g_block_hover;
|
||||||
/* dumps LVN_ITEMCHANGED message data */
|
/* dumps LVN_ITEMCHANGED message data */
|
||||||
static BOOL g_dump_itemchanged;
|
static BOOL g_dump_itemchanged;
|
||||||
/* format reported to control:
|
/* format reported to control:
|
||||||
|
@ -278,6 +280,12 @@ static const struct message edit_end_nochange[] = {
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct message hover_parent[] = {
|
||||||
|
{ WM_GETDLGCODE, sent }, /* todo_wine */
|
||||||
|
{ WM_NOTIFY, sent|id, 0, 0, NM_HOVER },
|
||||||
|
{ 0 }
|
||||||
|
};
|
||||||
|
|
||||||
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static LONG defwndproc_counter = 0;
|
static LONG defwndproc_counter = 0;
|
||||||
|
@ -344,6 +352,9 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
|
||||||
nmlv->iItem, nmlv->uNewState, nmlv->uOldState, nmlv->uChanged);
|
nmlv->iItem, nmlv->uNewState, nmlv->uOldState, nmlv->uChanged);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NM_HOVER:
|
||||||
|
if (g_block_hover) return 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4247,6 +4258,28 @@ static void test_LVS_EX_HEADERINALLVIEWS(void)
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_hover(void)
|
||||||
|
{
|
||||||
|
HWND hwnd;
|
||||||
|
DWORD r;
|
||||||
|
|
||||||
|
hwnd = create_custom_listview_control(LVS_ICON);
|
||||||
|
|
||||||
|
/* test WM_MOUSEHOVER forwarding */
|
||||||
|
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||||
|
r = SendMessage(hwnd, WM_MOUSEHOVER, 0, 0);
|
||||||
|
expect(0, r);
|
||||||
|
ok_sequence(sequences, PARENT_SEQ_INDEX, hover_parent, "NM_HOVER allow test", TRUE);
|
||||||
|
g_block_hover = TRUE;
|
||||||
|
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||||
|
r = SendMessage(hwnd, WM_MOUSEHOVER, 0, 0);
|
||||||
|
expect(0, r);
|
||||||
|
ok_sequence(sequences, PARENT_SEQ_INDEX, hover_parent, "NM_HOVER block test", TRUE);
|
||||||
|
g_block_hover = FALSE;
|
||||||
|
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(listview)
|
START_TEST(listview)
|
||||||
{
|
{
|
||||||
HMODULE hComctl32;
|
HMODULE hComctl32;
|
||||||
|
@ -4306,6 +4339,7 @@ START_TEST(listview)
|
||||||
test_getcolumnwidth();
|
test_getcolumnwidth();
|
||||||
test_approximate_viewrect();
|
test_approximate_viewrect();
|
||||||
test_finditem();
|
test_finditem();
|
||||||
|
test_hover();
|
||||||
|
|
||||||
if (!load_v6_module(&ctx_cookie, &hCtx))
|
if (!load_v6_module(&ctx_cookie, &hCtx))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue