Author: ekohl
Date: Sun Feb 28 17:01:35 2016
New Revision: 70799
URL:
http://svn.reactos.org/svn/reactos?rev=70799&view=rev
Log:
[INPUT]
Prevent removal of all languages from the language list by disabling the 'Remove'
button when only one item remains. Enable the 'Remove' button when there is more
than one item in the list.
CORE-3587 #resolve
Modified:
trunk/reactos/dll/cpl/input/settings.c
Modified: trunk/reactos/dll/cpl/input/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/settings.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/input/settings.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/settings.c [iso-8859-1] Sun Feb 28 17:01:35 2016
@@ -743,8 +743,13 @@
hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 0, 1);
InitLangList(hwndDlg, hImgList);
(VOID) ListView_SetImageList(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST),
hImgList, LVSIL_SMALL);
+
+ /* Disable the Remove button if there is only one layout in the layout list
*/
+ if (ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST)) <= 1)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE_BUTTON), FALSE);
}
break;
+
case WM_NOTIFY:
{
switch (LOWORD(wParam))
@@ -753,11 +758,16 @@
}
}
break;
+
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_REMOVE_BUTTON:
DeleteLayout();
+
+ /* Disable the Remove button if there is only one layout in the
layout list */
+ if (ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST))
<= 1)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE_BUTTON), FALSE);
break;
case IDC_KEY_SET_BTN:
@@ -772,6 +782,10 @@
MAKEINTRESOURCE(IDD_ADD),
hwndDlg,
AddDlgProc);
+
+ /* Enable the Remove button if there is more than one layout in the
layout list */
+ if (ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST))
> 1)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE_BUTTON), TRUE);
break;
case IDC_PROP_BUTTON:
@@ -788,6 +802,7 @@
break;
}
break;
+
case WM_DESTROY:
break;
}