Erich Hoover : hhctrl.ocx: Allow ListView navigation with the Return/ Enter key.
Alexandre Julliard
julliard at winehq.org
Mon Feb 8 11:06:08 CST 2010
Module: wine
Branch: master
Commit: 6ab9812450f8b8fcf05dbd60dc566cea892d05e4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6ab9812450f8b8fcf05dbd60dc566cea892d05e4
Author: Erich Hoover <ehoover at mines.edu>
Date: Sun Feb 7 10:08:38 2010 -0700
hhctrl.ocx: Allow ListView navigation with the Return/Enter key.
---
dlls/hhctrl.ocx/help.c | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c
index e8121e7..e115da1 100644
--- a/dlls/hhctrl.ocx/help.c
+++ b/dlls/hhctrl.ocx/help.c
@@ -487,8 +487,20 @@ static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LP
case TVN_SELCHANGEDW:
return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam);
case NM_DBLCLK:
- if(info->current_tab == TAB_INDEX)
+ if(info && info->current_tab == TAB_INDEX)
return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
+ case NM_RETURN:
+ if(info && info->current_tab == TAB_INDEX)
+ {
+ HWND hwndList = info->tabs[TAB_INDEX].hwnd;
+ LVITEMW lvItem;
+
+ lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
+ lvItem.mask = TVIF_PARAM;
+ ListView_GetItemW(hwndList, &lvItem);
+ OnTopicChange(info, (void*) lvItem.lParam);
+ }
+ return 0;
}
break;
}
@@ -910,7 +922,9 @@ static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wPara
{
case WM_NOTIFY: {
NMHDR *nmhdr = (NMHDR*)lParam;
- if(nmhdr->code == NM_DBLCLK) {
+ switch(nmhdr->code)
+ {
+ case NM_DBLCLK: {
HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA);
IndexSubItem *iter;
@@ -923,6 +937,23 @@ static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wPara
ShowWindow(info->popup.hwndPopup, SW_HIDE);
return 0;
}
+ case NM_RETURN: {
+ HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA);
+ IndexSubItem *iter;
+ LVITEMW lvItem;
+
+ if(info == 0)
+ return 0;
+
+ lvItem.iItem = (int) SendMessageW(info->popup.hwndList, LVM_GETSELECTIONMARK, 0, 0);
+ lvItem.mask = TVIF_PARAM;
+ ListView_GetItemW(info->popup.hwndList, &lvItem);
+ iter = (IndexSubItem*) lvItem.lParam;
+ NavigateToChm(info, info->index->merge.chm_file, iter->local);
+ ShowWindow(info->popup.hwndPopup, SW_HIDE);
+ return 0;
+ }
+ }
break;
}
default:
More information about the wine-cvs
mailing list