From: "Hao Peng" Subject: [PATCH] winecfg: Double click in dlls list to edit overides; fix indent. (try 2) Message-Id: Date: Fri, 6 Feb 2015 10:23:15 +0800 Add a feature to winecfg. User can double click in dlls list to edit overides of selected item. the indent of code here mixed with tabs, 4 spaces and 8 space. I formated it to match the style of the rest code. superseded patch 108935. --- programs/winecfg/libraries.c | 114 +++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 52 deletions(-)
Add a feature to winecfg. User can double click in dlls list to edit overides of selected item.

the indent of code here mixed with tabs, 4 spaces and 8 space. I formated it to match the style of the rest code.

superseded patch 108935.
---
 programs/winecfg/libraries.c | 114 +++++++++++++++++++++++--------------------
 1 file changed, 62 insertions(+), 52 deletions(-)


diff --git a/programs/winecfg/libraries.c b/programs/winecfg/libraries.c index 660737b..658c87d 100644 --- a/programs/winecfg/libraries.c +++ b/programs/winecfg/libraries.c @@ -588,57 +588,67 @@ static void on_remove_click(HWND dialog) INT_PTR CALLBACK LibrariesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - switch (uMsg) - { - case WM_INITDIALOG: - init_libsheet(hDlg); - break; - case WM_SHOWWINDOW: - set_window_title(hDlg); + switch (uMsg) + { + case WM_INITDIALOG: + init_libsheet(hDlg); + break; + case WM_SHOWWINDOW: + set_window_title(hDlg); + break; + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->code) { + case PSN_SETACTIVE: + load_library_settings(hDlg); + break; + } + break; + case WM_COMMAND: + switch(HIWORD(wParam)) { + /* FIXME: when the user hits enter in the DLL combo box we should invoke the add + * add button, rather than the propsheet OK button. But I don't know how to do that! + */ + case CBN_EDITCHANGE: + if(LOWORD(wParam) == IDC_DLLCOMBO) + { + on_add_combo_change(hDlg); + } + break; + case BN_CLICKED: + switch(LOWORD(wParam)) { + case IDC_DLLS_ADDDLL: + on_add_click(hDlg); + break; + case IDC_DLLS_EDITDLL: + on_edit_click(hDlg); break; - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->code) { - case PSN_SETACTIVE: - load_library_settings(hDlg); - break; - } - break; - case WM_COMMAND: - switch(HIWORD(wParam)) { - - /* FIXME: when the user hits enter in the DLL combo box we should invoke the add - * add button, rather than the propsheet OK button. But I don't know how to do that! - */ - - case CBN_EDITCHANGE: - if(LOWORD(wParam) == IDC_DLLCOMBO) - { - on_add_combo_change(hDlg); - break; - } - - case BN_CLICKED: - switch(LOWORD(wParam)) { - case IDC_DLLS_ADDDLL: - on_add_click(hDlg); - break; - case IDC_DLLS_EDITDLL: - on_edit_click(hDlg); - break; - case IDC_DLLS_REMOVEDLL: - on_remove_click(hDlg); - break; - } - break; - case LBN_SELCHANGE: - if(LOWORD(wParam) == IDC_DLLCOMBO) - on_add_combo_change(hDlg); - else - set_controls_from_selection(hDlg); - break; - } - break; - } - - return 0; + case IDC_DLLS_REMOVEDLL: + on_remove_click(hDlg); + break; + } + break; + case LBN_SELCHANGE: + if(LOWORD(wParam) == IDC_DLLCOMBO) + on_add_combo_change(hDlg); + else + set_controls_from_selection(hDlg); + break; + 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; + } + break; + } + + return 0; }