From cc397f8c71f2fa5da60876ce397c09751959dd99 Mon Sep 17 00:00:00 2001 From: SinghRajenM Date: Thu, 3 Aug 2017 23:55:17 +0530 Subject: [PATCH] Make double click work for language menu disabling/enabling in preference dialog Fixed issue and organized code Fixes #3589, closes #3594 --- .../WinControls/Preference/preferenceDlg.cpp | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index f99ac2cb..f9ab0dab 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1615,16 +1615,6 @@ INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP // Lang Menu if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG) { - HWND hEnableList = ::GetDlgItem(_hSelf, IDC_LIST_ENABLEDLANG); - HWND hDisableList = ::GetDlgItem(_hSelf, IDC_LIST_DISABLEDLANG); - if (HIWORD(wParam) == LBN_DBLCLK) - { - if (HWND(lParam) == hEnableList) - ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_REMOVE, 0); - else if (HWND(lParam) == hDisableList) - ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_RESTORE, 0); - return TRUE; - } int idButton2Enable; int idButton2Disable; @@ -1700,6 +1690,27 @@ INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP } + // Check if it is double click + else if (HIWORD(wParam) == LBN_DBLCLK) + { + // Lang Menu + if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG) + { + // On double click an item, the item should be moved + // from one list to other list + + HWND(lParam) == ::GetDlgItem(_hSelf, IDC_LIST_ENABLEDLANG) ? + ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_REMOVE, 0) : + ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_RESTORE, 0); + return TRUE; + } + + // Tab setting - Double click is not used at this moment + /*else if (LOWORD(wParam) == IDC_LIST_TABSETTNG) + { + }*/ + } + switch (wParam) { //