Make double click work for language menu disabling/enabling in preference dialog

Fixed issue and organized code

Fixes #3589, closes #3594
This commit is contained in:
SinghRajenM 2017-08-03 23:55:17 +05:30 committed by Don HO
parent d5b01d61b8
commit cc397f8c71

View File

@ -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)
{
//