ReactOS 0.4.16-dev-38-g96c65e9
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:1924
#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:1964
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:1921

◆ 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 64 of file effappdlg.c.

65{
66 INT iElement;
67 TCHAR tstrText[80];
68
69 for (iElement = From; iElement <= To; iElement++)
70 {
71 LoadString(hApplet, iElement, (LPTSTR)tstrText, _countof(tstrText));
72 SendDlgItemMessage(hwndDlg, Combo, CB_ADDSTRING, 0, (LPARAM)tstrText);
73 }
74}
HINSTANCE hApplet
Definition: access.c:17
#define _countof(array)
Definition: sndvol32.h:70
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ADDSTRING
Definition: winuser.h:1939
#define LoadString
Definition: winuser.h:5831
#define SendDlgItemMessage
Definition: winuser.h:5854
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 78 of file effappdlg.c.

79{
81
82 /* Copy the current theme values */
83 g->SchemeAdv = g->Scheme;
84
85#define INIT_CHECKBOX(__CONTROL_ID, __MEMBER) \
86do { \
87 state = /* Do a XOR of both the conditions */ \
88 ((g->SchemeAdv.Effects.__MEMBER) != (__CONTROL_ID == IDC_EFFAPPEARANCE_KEYBOARDCUES)) \
89 ? BST_CHECKED : BST_UNCHECKED; \
90 SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_SETCHECK, state, 0); \
91} while(0)
92
93#define INIT_CHECKBOX_SCH(__CONTROL_ID, __MEMBER) \
94do { \
95 state = /* Do a XOR of both the conditions */ \
96 ((g->SchemeAdv.__MEMBER) == TRUE) \
97 ? BST_CHECKED : BST_UNCHECKED; \
98 SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_SETCHECK, state, 0); \
99} while(0)
100
101#define FILL_COMBOBOX(__CONTROL_ID, __FIRST_STR, __LAST_STR) \
102 AddToCombobox(__CONTROL_ID, hwndDlg, __FIRST_STR, __LAST_STR)
103
104 /* Animated menu transitions section (checkbox + combo) */
108
109 /* Font antialiasing section (checkbox + combo) */
113
114 /* Other checkboxes */
119
120#undef INIT_CHECKBOX
121#undef FILL_COMBOBOX
122
123 /* Update the controls */
125}
#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:13

Referenced by EffAppearanceDlgProc().

◆ EffAppearanceDlgProc()

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

Definition at line 128 of file effappdlg.c.

129{
130 GLOBALS* g;
131
132 g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
133
134 switch (uMsg)
135 {
136 case WM_INITDIALOG:
137 g = (GLOBALS*)lParam;
139 EffAppearanceDlg_Init(hwndDlg, g);
140 break;
141
142 case WM_DESTROY:
143 break;
144
145 case WM_COMMAND:
146 switch(LOWORD(wParam))
147 {
148 case IDOK:
150 EndDialog(hwndDlg, IDOK);
151 break;
152
153 case IDCANCEL:
154 g->SchemeAdv = g->Scheme;
155 EndDialog(hwndDlg, IDCANCEL);
156 break;
157
164 if (HIWORD(wParam) == BN_CLICKED)
166 break;
167
171 {
172 INT Index =
174 CB_GETCURSEL, 0, 0);
175
176 g->SchemeAdv.Effects.bMenuFade =
178 CB_GETCURSEL, 0, 0);
179 g->SchemeAdv.Effects.uiFontSmoothingType = (Index == CB_ERR) ? 0 : (Index + 1);
180
182 }
183 break;
184
185 default:
186 return FALSE;
187 }
188 break;
189
190 default:
191 return FALSE;
192 }
193
194 return TRUE;
195}
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:78
static VOID EffAppearanceDlgSaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:57
__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:875
#define IDCANCEL
Definition: winuser.h:834
#define WM_COMMAND
Definition: winuser.h:1743
#define CB_ERR
Definition: winuser.h:2438
#define WM_INITDIALOG
Definition: winuser.h:1742
#define IDOK
Definition: winuser.h:833
#define CBN_SELCHANGE
Definition: winuser.h:1982
#define BN_CLICKED
Definition: winuser.h:1928
#define WM_DESTROY
Definition: winuser.h:1612
#define CB_GETCURSEL
Definition: winuser.h:1946
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by AppearancePageProc().

◆ EffAppearanceDlgSaveCurrentValues()

static VOID EffAppearanceDlgSaveCurrentValues ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 57 of file effappdlg.c.

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

Referenced by EffAppearanceDlgProc().

◆ EffAppearanceDlgUpdateControls()

static VOID EffAppearanceDlgUpdateControls ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 13 of file effappdlg.c.

14{
16
17#define SAVE_CHECKBOX(__CONTROL_ID, __MEMBER) \
18do { \
19 state = SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_GETCHECK, 0, 0); \
20 g->SchemeAdv.Effects.__MEMBER = /* Do a XOR of both the conditions */ \
21 ((state == BST_CHECKED) != (__CONTROL_ID == IDC_EFFAPPEARANCE_KEYBOARDCUES)); \
22} while(0)
23
24#define SAVE_CHECKBOX_SCH(__CONTROL_ID, __MEMBER) \
25do { \
26 state = SendDlgItemMessageW(hwndDlg, __CONTROL_ID, BM_GETCHECK, 0, 0); \
27 g->SchemeAdv.__MEMBER = (state == BST_CHECKED); \
28} while(0)
29
30#define RSET_COMBOBOX(__CONTROL_ID, __PARENT_MEMBER, __MEMBER) \
31do { \
32 SendDlgItemMessageW(hwndDlg, __CONTROL_ID, CB_SETCURSEL, (WPARAM)g->SchemeAdv.Effects.__MEMBER, 0); \
33 EnableWindow(GetDlgItem(hwndDlg, __CONTROL_ID), g->SchemeAdv.Effects.__PARENT_MEMBER); \
34} while(0)
35
36 /* Animated menu transitions section (checkbox + combo) */
38 RSET_COMBOBOX(IDC_EFFAPPEARANCE_ANIMATIONTYPE, bMenuAnimation, bMenuFade);
39
40 /* Font antialiasing section (checkbox + combo) */
42 RSET_COMBOBOX(IDC_EFFAPPEARANCE_SMOOTHINGTYPE, bFontSmoothing, uiFontSmoothingType - 1);
43
44 /* Other checkboxes */
49
50#undef SAVE_CHECKBOX
51#undef RSET_COMBOBOX
52
53 g->bSchemeChanged = TRUE;
54}
#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().