Re: [PATCH]winecfg: Double click in dlls list to edit overides. (try 4)
On 29.06.2015 12:35, Hao Peng wrote:
Add a feature to winecfg. User can double click in dlls list to edit overides of selected item.
superseded all earlier patches.
--- programs/winecfg/libraries.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
+ case CBN_DBLCLK: + if (LOWORD(wParam) == IDC_DLLS_LIST) + { + int index; + POINT p; + if (GetCursorPos(&p) && ScreenToClient((HWND)lParam, &p)) + { + index = SendDlgItemMessageW(hDlg, IDC_DLLS_LIST, + LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y)); + if (!HIWORD(index)) + on_edit_click(hDlg); + } + } + break;
Correct me if I'm wrong, but I don't think you get CBN_DBLCLK unless clicked on an item. Quick test with ControlSpy on Windows confirms that. And by the time you get CBN_DBLCLK something is always selected I think, which makes all that cursor complexity redundant.
Hi, Nikolay Sivov Thanks for your review. I have tested so many times and I'm pretty sure that if user double click on the blank area of the list, we will always receive a CBN_CLICK message. So I have to use LB_ITEMFROMPOINT to know whether a use really clicked on a list item, Otherwise it's wacky that user click on the blank area and the edit window pops out. ------------------ Original ------------------ From: "Nikolay Sivov"<bunglehead(a)gmail.com>; Date: Mon, Jun 29, 2015 04:09 AM To: "wine-devel"<wine-devel(a)winehq.org>; Cc: "Hao Peng"<penghao(a)linuxdeepin.com>; Subject: Re: [PATCH]winecfg: Double click in dlls list to edit overides. (try4) On 29.06.2015 12:35, Hao Peng wrote:
Add a feature to winecfg. User can double click in dlls list to edit overides of selected item.
superseded all earlier patches.
--- programs/winecfg/libraries.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
+ case CBN_DBLCLK: + if (LOWORD(wParam) == IDC_DLLS_LIST) + { + int index; + POINT p; + if (GetCursorPos(&p) && ScreenToClient((HWND)lParam, &p)) + { + index = SendDlgItemMessageW(hDlg, IDC_DLLS_LIST, + LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y)); + if (!HIWORD(index)) + on_edit_click(hDlg); + } + } + break;
Correct me if I'm wrong, but I don't think you get CBN_DBLCLK unless clicked on an item. Quick test with ControlSpy on Windows confirms that. And by the time you get CBN_DBLCLK something is always selected I think, which makes all that cursor complexity redundant.
On 30.06.2015 12:18, Hao Peng wrote:
Hi, Nikolay Sivov
Thanks for your review. I have tested so many times and I'm pretty sure that if user double click on the blank area of the list, we will always receive a CBN_CLICK message. So I have to use LB_ITEMFROMPOINT to know whether a use really clicked on a list item, Otherwise it's wacky that user click on the blank area and the edit window pops out.
Sounds like a Listbox bug, I can confirm that ControlSpy on wine shows LBN_DBLCLK notification when double clicking on blank area. By the way you should use LBN_DBLCLK instead of CBN_DBLCLK.
participants (2)
-
Hao Peng -
Nikolay Sivov