ReactOS 0.4.16-dev-112-g52265ae
edit_dialog.c File Reference
#include "input.h"
#include "locale_list.h"
#include "input_list.h"
Include dependency graph for edit_dialog.c:

Go to the source code of this file.

Functions

INT_PTR CALLBACK EditDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ EditDialogProc()

INT_PTR CALLBACK EditDialogProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 14 of file edit_dialog.c.

15{
17
18 switch (uMsg)
19 {
20 case WM_INITDIALOG:
21 {
22 LAYOUT_LIST_NODE *pCurrentLayout;
23 INPUT_LIST_NODE *pInput;
24 HWND hwndList;
25
26 pInput = (INPUT_LIST_NODE*) lParam;
27
28 if (pInput == NULL)
29 return TRUE;
30
31 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR) pInput);
32
34
35 hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO);
36
37 for (pCurrentLayout = LayoutList_GetFirst();
38 pCurrentLayout != NULL;
39 pCurrentLayout = pCurrentLayout->pNext)
40 {
41 INT iItemIndex;
42
43 iItemIndex = ComboBox_AddString(hwndList, pCurrentLayout->pszName);
44 ComboBox_SetItemData(hwndList, iItemIndex, pCurrentLayout);
45 }
46
47 ComboBox_SelectString(hwndList, 0, pInput->pLayout->pszName);
48 return TRUE;
49 }
50
51 case WM_COMMAND:
52 {
53 switch (LOWORD(wParam))
54 {
55 case IDOK:
56 {
57 INPUT_LIST_NODE *pInput;
58 HWND hwndList;
59
60 hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO);
61
63
64 if (pInput != NULL)
65 {
66 LAYOUT_LIST_NODE *pNewLayout;
67
68 pNewLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndList,
69 ComboBox_GetCurSel(hwndList));
70 if (pNewLayout != NULL)
71 {
72 pInput->pLayout = pNewLayout;
74 }
75 }
76
77 EndDialog(hwndDlg, LOWORD(wParam));
78 }
79 break;
80
81 case IDCANCEL:
82 {
83 EndDialog(hwndDlg, LOWORD(wParam));
84 }
85 break;
86 }
87 }
88 break;
89 }
90
91 return FALSE;
92}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_KB_LAYOUT_IME_COMBO
Definition: resource.h:34
#define IDC_INPUT_LANG_STR
Definition: resource.h:35
#define INPUT_LIST_NODE_FLAG_EDITED
Definition: input_list.h:11
LAYOUT_LIST_NODE * LayoutList_GetFirst(VOID)
Definition: layout_list.c:249
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:37
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
struct _LAYOUT_LIST_NODE * pNext
Definition: layout_list.h:14
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT
Definition: typedefs.h:58
#define ComboBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:54
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:49
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:41
#define ComboBox_SetItemData(hwndCtl, index, data)
Definition: windowsx.h:69
#define ComboBox_SelectString(hwndCtl, indexStart, lpszSelect)
Definition: windowsx.h:65
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define IDCANCEL
Definition: winuser.h:834
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:833
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define SetWindowLongPtrW
Definition: winuser.h:5358
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by OnCommandSettingsPage().