ReactOS 0.4.15-dev-5669-g09dde2c
effappdlg.c File Reference
#include "desk.h"
Include dependency graph for effappdlg.c:

Go to the source code of this file.

Macros

#define SAVE_CHECKBOX(__CONTROL_ID, __MEMBER)
 
#define SAVE_CHECKBOX_SCH(__CONTROL_ID, __MEMBER)
 
#define RSET_COMBOBOX(__CONTROL_ID, __PARENT_MEMBER, __MEMBER)
 
#define INIT_CHECKBOX(__CONTROL_ID, __MEMBER)
 
#define INIT_CHECKBOX_SCH(__CONTROL_ID, __MEMBER)
 
#define FILL_COMBOBOX(__CONTROL_ID, __FIRST_STR, __LAST_STR)    AddToCombobox(__CONTROL_ID, hwndDlg, __FIRST_STR, __LAST_STR)
 

Functions

static VOID EffAppearanceDlgUpdateControls (HWND hwndDlg, GLOBALS *g)
 
static VOID EffAppearanceDlgSaveCurrentValues (HWND hwndDlg, GLOBALS *g)
 
static VOID AddToCombobox (INT Combo, HWND hwndDlg, INT From, INT To)
 
static VOID EffAppearanceDlg_Init (HWND hwndDlg, GLOBALS *g)
 
INT_PTR CALLBACK EffAppearanceDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Macro Definition Documentation

◆ FILL_COMBOBOX

#define FILL_COMBOBOX (   __CONTROL_ID,
  __FIRST_STR,
  __LAST_STR 
)     AddToCombobox(__CONTROL_ID, hwndDlg, __FIRST_STR, __LAST_STR)

◆ INIT_CHECKBOX

#define INIT_CHECKBOX (   __CONTROL_ID,
  __MEMBER 
)
Value:
do { \
state = /* Do a XOR of both the conditions */ \
((g->SchemeAdv.Effects.__MEMBER) != (__CONTROL_ID == IDC_EFFAPPEARANCE_KEYBOARDCUES)) \
SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_SETCHECK, state, 0); \
} while(0)
static int state
Definition: maze.c:121
#define IDC_EFFAPPEARANCE_KEYBOARDCUES
Definition: resource.h:167
GLboolean GLboolean g
Definition: glext.h:6204
#define BST_UNCHECKED
Definition: winuser.h:199
#define BM_SETCHECK
Definition: winuser.h:1911
#define BST_CHECKED
Definition: winuser.h:197

◆ INIT_CHECKBOX_SCH

#define INIT_CHECKBOX_SCH (   __CONTROL_ID,
  __MEMBER 
)
Value:
do { \
state = /* Do a XOR of both the conditions */ \
((g->SchemeAdv.__MEMBER) == TRUE) \
SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_SETCHECK, state, 0); \
} while(0)
#define TRUE
Definition: types.h:120

◆ RSET_COMBOBOX

#define RSET_COMBOBOX (   __CONTROL_ID,
  __PARENT_MEMBER,
  __MEMBER 
)
Value:
do { \
SendDlgItemMessageW(hwndDlg, __CONTROL_ID, CB_SETCURSEL, (WPARAM)g->SchemeAdv.Effects.__MEMBER, 0); \
EnableWindow(GetDlgItem(hwndDlg, __CONTROL_ID), g->SchemeAdv.Effects.__PARENT_MEMBER); \
} while(0)
UINT_PTR WPARAM
Definition: windef.h:207
#define CB_SETCURSEL
Definition: winuser.h:1951
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)

◆ SAVE_CHECKBOX

#define SAVE_CHECKBOX (   __CONTROL_ID,
  __MEMBER 
)
Value:
do { \
state = SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_GETCHECK, 0, 0); \
g->SchemeAdv.Effects.__MEMBER = /* Do a XOR of both the conditions */ \
((state == BST_CHECKED) != (__CONTROL_ID == IDC_EFFAPPEARANCE_KEYBOARDCUES)); \
} while(0)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BM_GETCHECK
Definition: winuser.h:1908

◆ SAVE_CHECKBOX_SCH

#define SAVE_CHECKBOX_SCH (   __CONTROL_ID,
  __MEMBER 
)
Value:
do { \
state = SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_GETCHECK, 0, 0); \
g->SchemeAdv.__MEMBER = (state == BST_CHECKED); \
} while(0)

Function Documentation

◆ AddToCombobox()

static VOID AddToCombobox ( INT  Combo,
HWND  hwndDlg,
INT  From,
INT  To 
)
static

Definition at line 66 of file effappdlg.c.

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}
HINSTANCE hApplet
Definition: access.c:17
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ADDSTRING
Definition: winuser.h:1926
#define LoadString
Definition: winuser.h:5809
#define SendDlgItemMessage
Definition: winuser.h:5832
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192

◆ EffAppearanceDlg_Init()

static VOID EffAppearanceDlg_Init ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 80 of file effappdlg.c.

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}
#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_ANIMATION
Definition: resource.h:168
#define IDC_EFFAPPEARANCE_SMOOTHINGTYPE
Definition: resource.h:171
#define FILL_COMBOBOX(__CONTROL_ID, __FIRST_STR, __LAST_STR)
#define INIT_CHECKBOX_SCH(__CONTROL_ID, __MEMBER)
#define INIT_CHECKBOX(__CONTROL_ID, __MEMBER)
static VOID EffAppearanceDlgUpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:15

Referenced by EffAppearanceDlgProc().

◆ EffAppearanceDlgProc()

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

Definition at line 130 of file effappdlg.c.

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}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define FALSE
Definition: types.h:117
static VOID EffAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:80
static VOID EffAppearanceDlgSaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:59
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define HIWORD(l)
Definition: typedefs.h:247
_In_ WDFCOLLECTION _In_ ULONG Index
#define DWLP_USER
Definition: winuser.h:866
#define IDCANCEL
Definition: winuser.h:825
#define WM_COMMAND
Definition: winuser.h:1730
#define CB_ERR
Definition: winuser.h:2425
#define WM_INITDIALOG
Definition: winuser.h:1729
#define IDOK
Definition: winuser.h:824
#define CBN_SELCHANGE
Definition: winuser.h:1969
#define BN_CLICKED
Definition: winuser.h:1915
#define WM_DESTROY
Definition: winuser.h:1599
#define CB_GETCURSEL
Definition: winuser.h:1933
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by AppearancePageProc().

◆ EffAppearanceDlgSaveCurrentValues()

static VOID EffAppearanceDlgSaveCurrentValues ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 59 of file effappdlg.c.

60{
61 /* The settings get saved at the end of ApplyScheme() in theme.c,
62 * when clicking Apply in the main dialog. */
63}

Referenced by EffAppearanceDlgProc().

◆ EffAppearanceDlgUpdateControls()

static VOID EffAppearanceDlgUpdateControls ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 15 of file effappdlg.c.

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}
#define SAVE_CHECKBOX(__CONTROL_ID, __MEMBER)
#define SAVE_CHECKBOX_SCH(__CONTROL_ID, __MEMBER)
#define RSET_COMBOBOX(__CONTROL_ID, __PARENT_MEMBER, __MEMBER)

Referenced by EffAppearanceDlg_Init(), and EffAppearanceDlgProc().