3 * FILE: dll/cpl/input/edit_dialog.c
5 * PROGRAMMER: Dmitry Chapyshev (dmitry@reactos.org)
9 #include "locale_list.h"
10 #include "input_list.h"
14 EditDialogProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
16 UNREFERENCED_PARAMETER(lParam
);
22 LAYOUT_LIST_NODE
*pCurrentLayout
;
23 INPUT_LIST_NODE
*pInput
;
26 pInput
= (INPUT_LIST_NODE
*) lParam
;
31 SetWindowLongPtrW(hwndDlg
, GWLP_USERDATA
, (LONG_PTR
) pInput
);
33 SetWindowTextW(GetDlgItem(hwndDlg
, IDC_INPUT_LANG_STR
), pInput
->pLocale
->pszName
);
35 hwndList
= GetDlgItem(hwndDlg
, IDC_KB_LAYOUT_IME_COMBO
);
37 for (pCurrentLayout
= LayoutList_GetFirst();
38 pCurrentLayout
!= NULL
;
39 pCurrentLayout
= pCurrentLayout
->pNext
)
43 iItemIndex
= ComboBox_AddString(hwndList
, pCurrentLayout
->pszName
);
44 ComboBox_SetItemData(hwndList
, iItemIndex
, pCurrentLayout
);
47 ComboBox_SelectString(hwndList
, 0, pInput
->pLayout
->pszName
);
53 switch (LOWORD(wParam
))
57 INPUT_LIST_NODE
*pInput
;
60 hwndList
= GetDlgItem(hwndDlg
, IDC_KB_LAYOUT_IME_COMBO
);
62 pInput
= (INPUT_LIST_NODE
*) GetWindowLongPtrW(hwndDlg
, GWLP_USERDATA
);
66 LAYOUT_LIST_NODE
*pNewLayout
;
68 pNewLayout
= (LAYOUT_LIST_NODE
*)ComboBox_GetItemData(hwndList
,
69 ComboBox_GetCurSel(hwndList
));
70 if (pNewLayout
!= NULL
)
72 pInput
->pLayout
= pNewLayout
;
73 pInput
->wFlags
|= INPUT_LIST_NODE_FLAG_EDITED
;
77 EndDialog(hwndDlg
, LOWORD(wParam
));
83 EndDialog(hwndDlg
, LOWORD(wParam
));