2016-08-08 20:30:36 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: input.dll
|
|
|
|
* FILE: dll/cpl/input/edit_dialog.c
|
|
|
|
* PURPOSE: input.dll
|
|
|
|
* PROGRAMMER: Dmitry Chapyshev (dmitry@reactos.org)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "input.h"
|
2016-08-09 18:26:43 +00:00
|
|
|
#include "locale_list.h"
|
|
|
|
#include "input_list.h"
|
2016-08-09 14:01:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
INT_PTR CALLBACK
|
2016-08-09 18:26:43 +00:00
|
|
|
EditDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
2016-08-09 14:01:52 +00:00
|
|
|
{
|
|
|
|
UNREFERENCED_PARAMETER(lParam);
|
|
|
|
|
|
|
|
switch (uMsg)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
2016-08-09 18:26:43 +00:00
|
|
|
{
|
|
|
|
LAYOUT_LIST_NODE *pCurrentLayout;
|
|
|
|
INPUT_LIST_NODE *pInput;
|
|
|
|
HWND hwndList;
|
|
|
|
|
|
|
|
pInput = (INPUT_LIST_NODE*) lParam;
|
|
|
|
|
|
|
|
if (pInput == NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR) pInput);
|
|
|
|
|
|
|
|
SetWindowTextW(GetDlgItem(hwndDlg, IDC_INPUT_LANG_STR), pInput->pLocale->pszName);
|
|
|
|
|
|
|
|
hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO);
|
|
|
|
|
|
|
|
for (pCurrentLayout = LayoutList_GetFirst();
|
|
|
|
pCurrentLayout != NULL;
|
|
|
|
pCurrentLayout = pCurrentLayout->pNext)
|
|
|
|
{
|
|
|
|
INT iItemIndex;
|
|
|
|
|
|
|
|
iItemIndex = ComboBox_AddString(hwndList, pCurrentLayout->pszName);
|
|
|
|
ComboBox_SetItemData(hwndList, iItemIndex, pCurrentLayout);
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox_SelectString(hwndList, 0, pInput->pLayout->pszName);
|
|
|
|
}
|
|
|
|
break;
|
2016-08-09 14:01:52 +00:00
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
{
|
|
|
|
switch (LOWORD(wParam))
|
|
|
|
{
|
|
|
|
case IDOK:
|
2016-08-09 18:26:43 +00:00
|
|
|
{
|
|
|
|
INPUT_LIST_NODE *pInput;
|
|
|
|
HWND hwndList;
|
|
|
|
|
|
|
|
hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO);
|
|
|
|
|
|
|
|
pInput = (INPUT_LIST_NODE*) GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
|
|
|
|
|
|
|
if (pInput != NULL)
|
|
|
|
{
|
|
|
|
LAYOUT_LIST_NODE *pNewLayout;
|
|
|
|
|
|
|
|
pNewLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndList,
|
|
|
|
ComboBox_GetCurSel(hwndList));
|
|
|
|
if (pNewLayout != NULL)
|
|
|
|
{
|
|
|
|
pInput->pLayout = pNewLayout;
|
|
|
|
pInput->wFlags |= INPUT_LIST_NODE_FLAG_EDITED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EndDialog(hwndDlg, LOWORD(wParam));
|
|
|
|
}
|
|
|
|
break;
|
2016-08-09 14:01:52 +00:00
|
|
|
|
|
|
|
case IDCANCEL:
|
2016-08-09 18:26:43 +00:00
|
|
|
{
|
|
|
|
EndDialog(hwndDlg, LOWORD(wParam));
|
|
|
|
}
|
|
|
|
break;
|
2016-08-09 14:01:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|