ReactOS 0.4.15-dev-7918-g2a2556c
effappdlg.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Display Control Panel
4 * FILE: dll/cpl/desk/effappdlg.c
5 * PURPOSE: Effects appearance dialog
6 *
7 * PROGRAMMERS: Jan Roeloffzen (jroeloffzen[at]hotmail[dot]com)
8 * Ismael Ferreras Morezuelas (swyterzone+reactos@gmail.com)
9 */
10
11#include "desk.h"
12
13/* Update all the controls with the current values for the selected screen element */
14static VOID
16{
18
19#define SAVE_CHECKBOX(__CONTROL_ID, __MEMBER) \
20do { \
21 state = SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_GETCHECK, 0, 0); \
22 g->SchemeAdv.Effects.__MEMBER = /* Do a XOR of both the conditions */ \
23 ((state == BST_CHECKED) != (__CONTROL_ID == IDC_EFFAPPEARANCE_KEYBOARDCUES)); \
24} while(0)
25
26#define SAVE_CHECKBOX_SCH(__CONTROL_ID, __MEMBER) \
27do { \
28 state = SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_GETCHECK, 0, 0); \
29 g->SchemeAdv.__MEMBER = (state == BST_CHECKED); \
30} while(0)
31
32#define RSET_COMBOBOX(__CONTROL_ID, __PARENT_MEMBER, __MEMBER) \
33do { \
34 SendDlgItemMessageW(hwndDlg, __CONTROL_ID, CB_SETCURSEL, (WPARAM)g->SchemeAdv.Effects.__MEMBER, 0); \
35 EnableWindow(GetDlgItem(hwndDlg, __CONTROL_ID), g->SchemeAdv.Effects.__PARENT_MEMBER); \
36} while(0)
37
38 /* Animated menu transitions section (checkbox + combo) */
40 RSET_COMBOBOX(IDC_EFFAPPEARANCE_ANIMATIONTYPE, bMenuAnimation, bMenuFade);
41
42 /* Font antialiasing section (checkbox + combo) */
44 RSET_COMBOBOX(IDC_EFFAPPEARANCE_SMOOTHINGTYPE, bFontSmoothing, uiFontSmoothingType - 1);
45
46 /* Other checkboxes */
51
52#undef SAVE_CHECKBOX
53#undef RSET_COMBOBOX
54
55 g->bSchemeChanged = TRUE;
56}
57
58static VOID
60{
61 /* The settings get saved at the end of ApplyScheme() in theme.c,
62 * when clicking Apply in the main dialog. */
63}
64
65static VOID
66AddToCombobox(INT Combo, HWND hwndDlg, INT From, INT To)
67{
68 INT iElement;
69 TCHAR tstrText[80];
70
71 for (iElement = From; iElement <= To; iElement++)
72 {
73 LoadString(hApplet, iElement, (LPTSTR)tstrText, ARRAYSIZE(tstrText));
74 SendDlgItemMessage(hwndDlg, Combo, CB_ADDSTRING, 0, (LPARAM)tstrText);
75 }
76}
77
78/* Initialize the effects appearance dialog from the scheme populated in LoadCurrentScheme(), in theme.c */
79static VOID
81{
83
84 /* Copy the current theme values */
85 g->SchemeAdv = g->Scheme;
86
87#define INIT_CHECKBOX(__CONTROL_ID, __MEMBER) \
88do { \
89 state = /* Do a XOR of both the conditions */ \
90 ((g->SchemeAdv.Effects.__MEMBER) != (__CONTROL_ID == IDC_EFFAPPEARANCE_KEYBOARDCUES)) \
91 ? BST_CHECKED : BST_UNCHECKED; \
92 SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_SETCHECK, state, 0); \
93} while(0)
94
95#define INIT_CHECKBOX_SCH(__CONTROL_ID, __MEMBER) \
96do { \
97 state = /* Do a XOR of both the conditions */ \
98 ((g->SchemeAdv.__MEMBER) == TRUE) \
99 ? BST_CHECKED : BST_UNCHECKED; \
100 SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_SETCHECK, state, 0); \
101} while(0)
102
103#define FILL_COMBOBOX(__CONTROL_ID, __FIRST_STR, __LAST_STR) \
104 AddToCombobox(__CONTROL_ID, hwndDlg, __FIRST_STR, __LAST_STR)
105
106 /* Animated menu transitions section (checkbox + combo) */
110
111 /* Font antialiasing section (checkbox + combo) */
115
116 /* Other checkboxes */
121
122#undef INIT_CHECKBOX
123#undef FILL_COMBOBOX
124
125 /* Update the controls */
127}
128
131{
132 GLOBALS* g;
133
134 g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
135
136 switch (uMsg)
137 {
138 case WM_INITDIALOG:
139 g = (GLOBALS*)lParam;
141 EffAppearanceDlg_Init(hwndDlg, g);
142 break;
143
144 case WM_DESTROY:
145 break;
146
147 case WM_COMMAND:
148 switch(LOWORD(wParam))
149 {
150 case IDOK:
152 EndDialog(hwndDlg, IDOK);
153 break;
154
155 case IDCANCEL:
156 g->SchemeAdv = g->Scheme;
157 EndDialog(hwndDlg, IDCANCEL);
158 break;
159
166 if (HIWORD(wParam) == BN_CLICKED)
167 {
169 }
170 break;
171
175 {
176 INT Index =
178 CB_GETCURSEL, 0, 0);
179
180 g->SchemeAdv.Effects.bMenuFade =
182 CB_GETCURSEL, 0, 0);
183 g->SchemeAdv.Effects.uiFontSmoothingType = (Index == CB_ERR) ? 0 : (Index + 1);
184
186 }
187 break;
188
189 default:
190 return FALSE;
191 }
192 break;
193
194 default:
195 return FALSE;
196 }
197
198 return TRUE;
199}
static int state
Definition: maze.c:121
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDS_CLEARTYPEEFFECT
Definition: resource.h:181
#define IDS_SLIDEEFFECT
Definition: resource.h:177
#define IDC_EFFAPPEARANCE_SETDROPSHADOW
Definition: resource.h:173
#define IDC_EFFAPPEARANCE_DRAGFULLWINDOWS
Definition: resource.h:174
#define IDS_STANDARDEFFECT
Definition: resource.h:180
#define IDC_EFFAPPEARANCE_FLATMENUS
Definition: resource.h:175
#define IDC_EFFAPPEARANCE_SMOOTHING
Definition: resource.h:170
#define IDS_FADEEFFECT
Definition: resource.h:178
#define IDC_EFFAPPEARANCE_ANIMATIONTYPE
Definition: resource.h:169
#define IDC_EFFAPPEARANCE_KEYBOARDCUES
Definition: resource.h:167
#define IDC_EFFAPPEARANCE_ANIMATION
Definition: resource.h:168
#define IDC_EFFAPPEARANCE_SMOOTHINGTYPE
Definition: resource.h:171
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define CALLBACK
Definition: compat.h:35
#define SAVE_CHECKBOX(__CONTROL_ID, __MEMBER)
static VOID EffAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:80
static VOID AddToCombobox(INT Combo, HWND hwndDlg, INT From, INT To)
Definition: effappdlg.c:66
#define SAVE_CHECKBOX_SCH(__CONTROL_ID, __MEMBER)
#define FILL_COMBOBOX(__CONTROL_ID, __FIRST_STR, __LAST_STR)
#define RSET_COMBOBOX(__CONTROL_ID, __PARENT_MEMBER, __MEMBER)
#define INIT_CHECKBOX_SCH(__CONTROL_ID, __MEMBER)
static VOID EffAppearanceDlgSaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:59
INT_PTR CALLBACK EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: effappdlg.c:130
#define INIT_CHECKBOX(__CONTROL_ID, __MEMBER)
static VOID EffAppearanceDlgUpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:15
GLboolean GLboolean g
Definition: glext.h:6204
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_In_ WDFCOLLECTION _In_ ULONG Index
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define DWLP_USER
Definition: winuser.h:872
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define CB_ERR
Definition: winuser.h:2435
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
#define CBN_SELCHANGE
Definition: winuser.h:1979
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_ADDSTRING
Definition: winuser.h:1936
#define LoadString
Definition: winuser.h:5819
#define BN_CLICKED
Definition: winuser.h:1925
#define WM_DESTROY
Definition: winuser.h:1609
#define CB_GETCURSEL
Definition: winuser.h:1943
#define SendDlgItemMessage
Definition: winuser.h:5842
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192