ReactOS  0.4.14-dev-115-g4576127
advappdlg.c File Reference
#include "desk.h"
Include dependency graph for advappdlg.c:

Go to the source code of this file.

Classes

struct  ASSIGNMENT
 

Functions

static VOID UpdateButtonColor (HWND hwndDlg, GLOBALS *g, INT ID, INT nButton, INT nColor)
 
static VOID InitColorButtons (HWND hwndDlg, GLOBALS *g)
 
static int CALLBACK EnumFontFamExProc (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam)
 
static VOID UpdateControls (HWND hwndDlg, GLOBALS *g)
 
static VOID SaveCurrentValues (HWND hwndDlg, GLOBALS *g)
 
static BOOL GetColor (HWND hwndDlg, GLOBALS *g, INT nButton)
 
static VOID AdvAppearanceDlg_Init (HWND hwndDlg, GLOBALS *g)
 
static VOID AdvAppearanceDlg_CleanUp (HWND hwndDlg, GLOBALS *g)
 
static VOID SelectComboByElement (HWND hwnd, INT id, LPARAM lParam)
 
static VOID GetSelectedComboText (HWND hwnd, INT id, LPWSTR lpStr)
 
static INT GetSelectedComboInt (HWND hwnd, INT id)
 
INT_PTR CALLBACK AdvAppearanceDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

const ASSIGNMENT g_Assignment [NUM_ELEMENTS]
 

Function Documentation

◆ AdvAppearanceDlg_CleanUp()

static VOID AdvAppearanceDlg_CleanUp ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 438 of file advappdlg.c.

439 {
440  DeleteObject(g->hBoldFont);
441  DeleteObject(g->hItalicFont);
442 }
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLboolean GLboolean g
Definition: glext.h:6204

Referenced by AdvAppearanceDlgProc().

◆ AdvAppearanceDlg_Init()

static VOID AdvAppearanceDlg_Init ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 344 of file advappdlg.c.

345 {
346  INT i, iElement, iListIndex, iDeskIndex = 0;
347  TCHAR tstrText[80];
348  LOGFONT lfFont;
349  LOGFONT lfButtonFont;
350  HFONT hMyFont;
351  HDC hScreenDC;
352  TCHAR Size[4];
353 
354  /* Copy the current theme values */
355  g->SchemeAdv = g->Scheme;
356 
358 
359  /* Add the elements to the combo */
360  for (iElement = 0; iElement < NUM_ELEMENTS; iElement++)
361  {
362  LoadString(hApplet, IDS_ELEMENT_0 + iElement, (LPTSTR)&tstrText, 79);
363  iListIndex = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_ADDSTRING, 0, (LPARAM)&tstrText);
364  SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_SETITEMDATA, (WPARAM)iListIndex, (LPARAM)iElement);
365  }
366 
367  /* Get the list index of the desktop element */
368  for (iListIndex = 0; iListIndex < NUM_ELEMENTS; iListIndex++)
369  {
370  iElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, (WPARAM)iListIndex, 0);
371  if (iElement == 0)
372  {
373  iDeskIndex = iListIndex;
374  break;
375  }
376  }
377 
379 
380  /* Create font for bold button */
381  lfButtonFont = g->Scheme.ncMetrics.lfMessageFont;
382  lfButtonFont.lfWeight = FW_BOLD;
383  lfButtonFont.lfItalic = FALSE;
384  hMyFont = CreateFontIndirect(&lfButtonFont);
385  if (hMyFont)
386  {
387  if (g->hBoldFont)
388  DeleteObject(g->hBoldFont);
389 
390  g->hBoldFont = hMyFont;
391  }
392 
393  /* Create font for italic button */
394  lfButtonFont.lfWeight = FW_REGULAR;
395  lfButtonFont.lfItalic = TRUE;
396  hMyFont = CreateFontIndirect(&lfButtonFont);
397  if (hMyFont)
398  {
399  if (g->hItalicFont)
400  DeleteObject(g->hItalicFont);
401 
402  g->hItalicFont = hMyFont;
403  }
404 
405  /* Set the fonts for the font style buttons */
408 
409  /* Draw Bitmaps for the colorbuttons */
410  InitColorButtons(hwndDlg, g);
411 
412  /* Make the UpDown control count correctly */
414 
415  /* Fill font selection combo */
416  lfFont.lfCharSet = DEFAULT_CHARSET;
417  lfFont.lfFaceName[0] = (TCHAR)0;
418  lfFont.lfPitchAndFamily = 0;
419  hScreenDC = GetDC(0);
421  ReleaseDC(0, hScreenDC);
422 
423  /* Fill font size combo */
424  for (i = 6; i <= 24; i++)
425  {
426  StringCbPrintf(Size, sizeof(Size), TEXT("%d"), i);
428  }
429 
430  /* Update the controls */
431  iListIndex = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETCURSEL, 0, 0);
432  g->CurrentElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, (WPARAM)iListIndex, 0);
433  UpdateControls(hwndDlg, g);
434 }
BYTE lfItalic
Definition: dimm.idl:47
#define CB_SETITEMDATA
Definition: winuser.h:1948
#define TRUE
Definition: types.h:120
HDC WINAPI GetDC(_In_opt_ HWND)
#define CB_GETITEMDATA
Definition: winuser.h:1932
static VOID UpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:206
static HDC
Definition: imagelist.c:92
#define IDS_ELEMENT_0
Definition: resource.h:125
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HINSTANCE hApplet
Definition: access.c:17
BYTE lfCharSet
Definition: dimm.idl:50
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
#define DEFAULT_CHARSET
Definition: wingdi.h:383
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1925
CHAR * LPTSTR
Definition: xmlstorage.h:192
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FW_REGULAR
Definition: wingdi.h:373
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CB_ADDSTRING
Definition: winuser.h:1918
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define IDC_ADVAPPEARANCE_FONT_C
Definition: resource.h:117
LONG lfWeight
Definition: dimm.idl:46
LONG_PTR LPARAM
Definition: windef.h:208
#define UDM_SETRANGE
Definition: commctrl.h:2113
BYTE lfPitchAndFamily
Definition: dimm.idl:54
#define IDC_ADVAPPEARANCE_FONTBOLD
Definition: resource.h:122
static VOID InitColorButtons(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:100
char TCHAR
Definition: xmlstorage.h:189
GLboolean GLboolean g
Definition: glext.h:6204
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define NUM_ELEMENTS(array)
Definition: cache.c:27
#define StringCbPrintf
Definition: strsafe.h:544
#define PVM_UPDATETHEME
Definition: preview.h:33
static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam)
Definition: advappdlg.c:188
static const WCHAR L[]
Definition: oid.c:1250
#define IDC_ADVAPPEARANCE_FONTITALIC
Definition: resource.h:123
#define CB_SETCURSEL
Definition: winuser.h:1943
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define IDC_APPEARANCE_PREVIEW
Definition: resource.h:86
#define IDC_ADVAPPEARANCE_SIZE_UD
Definition: resource.h:111
#define TEXT(s)
Definition: k32.h:26
#define FW_BOLD
Definition: wingdi.h:377
#define CreateFontIndirect
Definition: wingdi.h:4439
#define EnumFontFamiliesEx
Definition: wingdi.h:4446
#define IDC_ADVAPPEARANCE_ELEMENT
Definition: resource.h:108
#define WM_SETFONT
Definition: winuser.h:1632
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
FONTENUMPROCA FONTENUMPROC
Definition: wingdi.h:2897
#define SendMessage
Definition: winuser.h:5744
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define IDC_ADVAPPEARANCE_FONTSIZE_E
Definition: resource.h:119
#define LoadString
Definition: winuser.h:5720

Referenced by AdvAppearanceDlgProc().

◆ AdvAppearanceDlgProc()

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

Definition at line 504 of file advappdlg.c.

505 {
506  INT iSelection, iProperty;
507  GLOBALS* g;
508  PLOGFONTW plfFont;
509 
510  g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
511 
512  switch (uMsg)
513  {
514  case WM_INITDIALOG:
515  g = (GLOBALS*)lParam;
516  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g);
517  AdvAppearanceDlg_Init(hwndDlg, g);
518  break;
519 
520  case WM_DESTROY:
521  AdvAppearanceDlg_CleanUp(hwndDlg, g);
522  break;
523 
524  case WM_COMMAND:
525  if (g == NULL)
526  return TRUE;
527 
528  switch(LOWORD(wParam))
529  {
530  case IDOK:
531  SaveCurrentValues(hwndDlg, g);
532  EndDialog(hwndDlg, IDOK);
533  break;
534 
535  case IDCANCEL:
536  g->SchemeAdv = g->Scheme;
537  EndDialog(hwndDlg, IDCANCEL);
538  break;
539 
541  SaveCurrentValues(hwndDlg, g);
543  g->CurrentElement = (INT)lParam;
544  UpdateControls(hwndDlg, g);
545  break;
546 
548  if (HIWORD(wParam) == CBN_SELCHANGE)
549  {
550  SaveCurrentValues(hwndDlg, g);
551  iSelection = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETCURSEL, 0, 0);
552  g->CurrentElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, iSelection, 0);
553  UpdateControls(hwndDlg, g);
554  }
555  break;
556 
558  if (HIWORD(wParam) == EN_CHANGE)
559  {
560  iProperty = g_Assignment[g->CurrentElement].Size;
561  if (iProperty == -1)
562  return TRUE;
563 
564  iSelection = LOWORD(SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD, UDM_GETPOS,0,0L));
565  SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
566  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETSIZE, iProperty, iSelection);
567 
568  iProperty = g_Assignment[g->CurrentElement].Size2;
569  if (iProperty != -1)
570  SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
571  }
572  break;
573 
575  if (HIWORD(wParam) == CBN_SELCHANGE)
576  {
577  iProperty = g_Assignment[g->CurrentElement].Font;
578  if (iProperty == -1)
579  return TRUE;
580 
581  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
583  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
584  }
585  break;
586 
589  {
590  HDC hdcDlg;
591 
592  iProperty = g_Assignment[g->CurrentElement].Font;
593  if (iProperty == -1)
594  return TRUE;
595 
596  hdcDlg = GetDC(hwndDlg);
597 
598  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
599  iSelection = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E);
600  plfFont->lfHeight = -MulDiv(iSelection , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
602 
603  ReleaseDC(hwndDlg, hdcDlg);
604  }
605  break;
606 
608  if (HIWORD(wParam) == BN_CLICKED)
609  {
610  iProperty = g_Assignment[g->CurrentElement].Font;
611  if (iProperty == -1)
612  return TRUE;
613 
614  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
615  iSelection = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0);
616  plfFont->lfWeight = (iSelection == BST_CHECKED) ? FW_BOLD : FW_NORMAL;
617  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
618  }
619  break;
620 
622  if (HIWORD(wParam) == BN_CLICKED)
623  {
624  iProperty = g_Assignment[g->CurrentElement].Font;
625  if (iProperty == -1)
626  return TRUE;
627 
628  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
629  iSelection = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0);
630  plfFont->lfItalic = (iSelection == BST_CHECKED) ? TRUE : FALSE;
631  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
632  }
633  break;
634 
636  GetColor(hwndDlg, g, 0);
637  break;
638 
640  GetColor(hwndDlg, g, 1);
641  break;
642 
644  GetColor(hwndDlg, g, 2);
645  break;
646 
647  default:
648  return FALSE;
649  }
650  break;
651 
652  default:
653  return FALSE;
654  }
655 
656  return TRUE;
657 }
#define PVM_SETSIZE
Definition: preview.h:26
#define TRUE
Definition: types.h:120
#define UDM_GETPOS
Definition: commctrl.h:2116
#define IDOK
Definition: winuser.h:824
HDC WINAPI GetDC(_In_opt_ HWND)
static INT GetSelectedComboInt(HWND hwnd, INT id)
Definition: advappdlg.c:487
#define CB_GETITEMDATA
Definition: winuser.h:1932
#define PVM_SETFONT
Definition: preview.h:28
static VOID UpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:206
#define INT
Definition: polytest.cpp:20
static HDC
Definition: imagelist.c:92
#define IDC_ADVAPPEARANCE_COLOR1_B
Definition: resource.h:113
#define SendDlgItemMessage
Definition: winuser.h:5743
int Size
Definition: advappdlg.c:17
const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Definition: advappdlg.c:28
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1925
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDC_ADVAPPEARANCE_COLOR2_B
Definition: resource.h:115
static VOID SaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:261
#define IDC_ADVAPPEARANCE_FONTCOLOR_B
Definition: resource.h:121
BYTE lfItalic
Definition: wingdi.h:1897
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define IDC_ADVAPPEARANCE_FONT_C
Definition: resource.h:117
LONG lfHeight
Definition: wingdi.h:1892
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1900
#define IDC_ADVAPPEARANCE_FONTBOLD
Definition: resource.h:122
static VOID AdvAppearanceDlg_CleanUp(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:438
#define IDC_ADVAPPEARANCE_SIZE_E
Definition: resource.h:110
#define WM_DESTROY
Definition: winuser.h:1591
int Size2
Definition: advappdlg.c:18
GLboolean GLboolean g
Definition: glext.h:6204
#define CBN_EDITCHANGE
Definition: winuser.h:1957
#define BN_CLICKED
Definition: winuser.h:1907
#define PVM_UPDATETHEME
Definition: preview.h:33
static VOID GetSelectedComboText(HWND hwnd, INT id, LPWSTR lpStr)
Definition: advappdlg.c:467
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define IDC_ADVAPPEARANCE_FONTITALIC
Definition: resource.h:123
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_APPEARANCE_PREVIEW
Definition: resource.h:86
#define IDC_ADVAPPEARANCE_SIZE_UD
Definition: resource.h:111
#define FW_BOLD
Definition: wingdi.h:377
static VOID SelectComboByElement(HWND hwnd, INT id, LPARAM lParam)
Definition: advappdlg.c:446
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
PLOGFONTW SchemeGetFont(COLOR_SCHEME *scheme, int id)
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define IDC_ADVAPPEARANCE_ELEMENT
Definition: resource.h:108
#define BST_CHECKED
Definition: winuser.h:197
#define FW_NORMAL
Definition: wingdi.h:372
LONG lfWeight
Definition: wingdi.h:1896
VOID SchemeSetMetric(COLOR_SCHEME *scheme, int id, int value)
#define HIWORD(l)
Definition: typedefs.h:246
#define LOGPIXELSY
Definition: wingdi.h:718
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL GetColor(HWND hwndDlg, GLOBALS *g, INT nButton)
Definition: advappdlg.c:286
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1905
#define IDCANCEL
Definition: winuser.h:825
#define IDC_ADVAPPEARANCE_FONTSIZE_E
Definition: resource.h:119
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
int Font
Definition: advappdlg.c:21
static VOID AdvAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:344
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by AppearancePageProc().

◆ EnumFontFamExProc()

static int CALLBACK EnumFontFamExProc ( ENUMLOGFONTEX lpelfe,
NEWTEXTMETRICEX lpntme,
DWORD  dwFontType,
LPARAM  lParam 
)
static

Definition at line 188 of file advappdlg.c.

189 {
190  /* Don't enumerate more than 100 fonts */
191  if (SendMessage((HWND)lParam, CB_GETCOUNT, 0, 0) >= 100)
192  return 0;
193 
194  /* Only add the string once */
196  return 2;
197 
199 
200  return 1;
201 }
UINT_PTR WPARAM
Definition: windef.h:207
#define CB_ADDSTRING
Definition: winuser.h:1918
#define CB_ERR
Definition: winuser.h:2410
#define SendMessage
Definition: winuser.h:5744
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define CB_GETCOUNT
Definition: winuser.h:1924
LPARAM lParam
Definition: combotst.c:139
LOGFONTA elfLogFont
Definition: wingdi.h:2691
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

Referenced by AdvAppearanceDlg_Init().

◆ GetColor()

static BOOL GetColor ( HWND  hwndDlg,
GLOBALS g,
INT  nButton 
)
static

Definition at line 286 of file advappdlg.c.

287 {
288  CHOOSECOLOR cc;
289  COLORREF crCustom[16] = { 0 };
290  COLORREF crColor;
291  INT ID = 0;
292  INT ColorIndex = 0;
293 
294  /* Get the color index from the element index and button number */
295  switch (nButton)
296  {
297  case 0:
298  ColorIndex = g_Assignment[g->CurrentElement].Color1;
300  break;
301 
302  case 1:
303  ColorIndex = g_Assignment[g->CurrentElement].Color2;
305  break;
306 
307  case 2:
308  ColorIndex = g_Assignment[g->CurrentElement].FontColor;
310  break;
311  }
312 
313  crColor = g->SchemeAdv.crColor[ColorIndex];
314 
315  /* Prepare cc structure */
316  cc.lStructSize = sizeof(CHOOSECOLOR);
317  cc.hwndOwner = hwndDlg;
318  cc.hInstance = NULL;
319  cc.rgbResult = crColor;
320  cc.lpCustColors = crCustom;
321  cc.Flags = CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT;
322  cc.lCustData = 0;
323  cc.lpfnHook = NULL;
324  cc.lpTemplateName = NULL;
325 
326  /* Create the colorpicker */
327  if (ChooseColor(&cc))
328  {
329  g->SchemeAdv.crColor[ColorIndex] = cc.rgbResult;
330  if (crColor != cc.rgbResult)
331  {
332  UpdateButtonColor(hwndDlg, g, ID, nButton, ColorIndex);
334  return TRUE;
335  }
336  }
337 
338  return FALSE;
339 }
#define TRUE
Definition: types.h:120
#define CC_ANYCOLOR
Definition: commdlg.h:58
#define ChooseColor
Definition: commdlg.h:661
CHOOSECOLORA CHOOSECOLOR
Definition: commdlg.h:654
#define CC_RGBINIT
Definition: commdlg.h:50
#define IDC_ADVAPPEARANCE_COLOR1_B
Definition: resource.h:113
#define SendDlgItemMessage
Definition: winuser.h:5743
const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Definition: advappdlg.c:28
int32_t INT
Definition: typedefs.h:56
#define IDC_ADVAPPEARANCE_COLOR2_B
Definition: resource.h:115
#define IDC_ADVAPPEARANCE_FONTCOLOR_B
Definition: resource.h:121
static VOID UpdateButtonColor(HWND hwndDlg, GLOBALS *g, INT ID, INT nButton, INT nColor)
Definition: advappdlg.c:55
int Color1
Definition: advappdlg.c:19
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLboolean GLboolean g
Definition: glext.h:6204
DWORD COLORREF
Definition: windef.h:285
#define PVM_UPDATETHEME
Definition: preview.h:33
#define ID
Definition: ruserpass.c:36
#define IDC_APPEARANCE_PREVIEW
Definition: resource.h:86
uint32_t cc
Definition: isohybrid.c:75
int Color2
Definition: advappdlg.c:20
#define CC_FULLOPEN
Definition: commdlg.h:51
int FontColor
Definition: advappdlg.c:22

Referenced by AdvAppearanceDlgProc(), and DECLARE_INTERFACE_().

◆ GetSelectedComboInt()

static INT GetSelectedComboInt ( HWND  hwnd,
INT  id 
)
static

Definition at line 487 of file advappdlg.c.

488 {
489  TCHAR szBuffer[80];
490  INT nCount;
491 
492  nCount = SendDlgItemMessage(hwnd, id, CB_GETCURSEL, 0, 0);
493  if (nCount == CB_ERR)
494  return 0;
495 
496  nCount = SendDlgItemMessage(hwnd, id, CB_GETLBTEXT, (WPARAM)nCount, (LPARAM)szBuffer);
497  if (nCount == CB_ERR)
498  return 0;
499 
500  return _ttoi(szBuffer);
501 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CB_GETLBTEXT
Definition: winuser.h:1934
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1925
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ERR
Definition: winuser.h:2410
char TCHAR
Definition: xmlstorage.h:189
int CDECL _ttoi(const _TCHAR *str)
Definition: atoi.c:10

Referenced by AdvAppearanceDlgProc().

◆ GetSelectedComboText()

static VOID GetSelectedComboText ( HWND  hwnd,
INT  id,
LPWSTR  lpStr 
)
static

Definition at line 467 of file advappdlg.c.

468 {
469  INT nCount;
470 
471  nCount = SendDlgItemMessage(hwnd, id, CB_GETCURSEL, 0, 0);
472  if (nCount == CB_ERR)
473  {
474  *lpStr = 0;
475  return;
476  }
477 
478  nCount = SendDlgItemMessage(hwnd, id, CB_GETLBTEXT, (WPARAM)nCount, (LPARAM)lpStr);
479  if (nCount == CB_ERR)
480  {
481  *lpStr = 0;
482  }
483 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CB_GETLBTEXT
Definition: winuser.h:1934
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1925
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ERR
Definition: winuser.h:2410

Referenced by AdvAppearanceDlgProc().

◆ InitColorButtons()

static VOID InitColorButtons ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 100 of file advappdlg.c.

101 {
102  INT i;
103  HDC hdcColorButton, hdcCompat;
104  RECT rect;
105  HBRUSH hbrush;
106  HPEN hPen;
107  HWND hwndColorButton;
108  HGDIOBJ hgdiTemp;
109  COLOR_SCHEME *scheme = &g->SchemeAdv;
110 
111  const POINT Points[3] = {{29,6},{33,6},{31,8}};
112 
113  hwndColorButton = GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_COLOR1_B);
114  hdcColorButton = GetDC(hwndColorButton);
115  for (i = 0; i <= 2; i++)
116  {
117  /* Create a DC to draw on */
118  hdcCompat = CreateCompatibleDC(hdcColorButton);
119 
120  /* Create the button image */
121  g->hbmpColor[i] = CreateCompatibleBitmap(hdcColorButton, 36, 15);
122 
123  /* Select the button image to the DC */
124  hgdiTemp = SelectObject(hdcCompat, g->hbmpColor[i]);
125 
126  /* Draw the buttons background color */
127  rect.left = 0;
128  rect.top = 0;
129  rect.right = 36;
130  rect.bottom = 15;
132  FillRect(hdcCompat, &rect, hbrush);
134 
135  /* Draw the rectangle */
136  rect.left = 1;
137  rect.top = 1;
138  rect.right = 23;
139  rect.bottom = 14;
141  FillRect(hdcCompat, &rect, hbrush);
143 
144  /* Draw left side of line */
145  hPen = CreatePen(PS_SOLID, 1, scheme->crColor[COLOR_BTNSHADOW]);
146  SelectObject(hdcCompat, hPen);
147  MoveToEx(hdcCompat, 26, 1, NULL);
148  LineTo(hdcCompat, 26, 14);
150  DeleteObject(hPen);
151 
152  /* Draw right side of line */
153  hPen = CreatePen(PS_SOLID, 1, scheme->crColor[COLOR_BTNHIGHLIGHT]);
154  SelectObject(hdcCompat,hPen);
155  MoveToEx(hdcCompat, 27, 1, NULL);
156  LineTo(hdcCompat, 27, 14);
158  DeleteObject(hPen);
159 
160  /* Draw triangle */
161  hPen = CreatePen(PS_SOLID, 1, scheme->crColor[COLOR_BTNTEXT]);
163  SelectObject(hdcCompat, hPen);
164  SelectObject(hdcCompat, hbrush);
165  SetPolyFillMode(hdcCompat, WINDING);
166 
167  /* FIXME: HACK, see Points definition */
168  Polygon(hdcCompat, Points, 3);
169 
170  /* Cleanup */
171  SelectObject(hdcCompat,hgdiTemp);
172  DeleteDC(hdcCompat);
173  DeleteObject(hPen);
175  }
176 
177  ReleaseDC(hwndColorButton, hdcColorButton);
178 
179  /* Set the images of the buttons */
183 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WINDING
Definition: constants.h:279
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
static HBRUSH hbrush
BOOL Polygon(CONST PPOINT UnsafePoints, int Count, int polyFillMode)
Definition: polytest.cpp:730
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
static HDC
Definition: imagelist.c:92
DWORD scheme
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define COLOR_BTNHIGHLIGHT
Definition: winuser.h:925
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define IDC_ADVAPPEARANCE_COLOR1_B
Definition: resource.h:113
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
#define BM_SETIMAGE
Definition: winuser.h:1904
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define PS_SOLID
Definition: wingdi.h:585
#define IDC_ADVAPPEARANCE_COLOR2_B
Definition: resource.h:115
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IDC_ADVAPPEARANCE_FONTCOLOR_B
Definition: resource.h:121
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLboolean GLboolean g
Definition: glext.h:6204
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
int WINAPI SetPolyFillMode(_In_ HDC, _In_ int)
Definition: dc.c:1143
#define COLOR_BTNFACE
Definition: winuser.h:918
BOOL WINAPI DeleteDC(_In_ HDC)
#define BLACK_PEN
Definition: wingdi.h:902
#define COLOR_BTNSHADOW
Definition: winuser.h:920
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define IMAGE_BITMAP
Definition: winuser.h:211
#define COLOR_BTNTEXT
Definition: winuser.h:923
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

Referenced by AdvAppearanceDlg_Init().

◆ SaveCurrentValues()

static VOID SaveCurrentValues ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 261 of file advappdlg.c.

262 {
263  BOOL bTranslated;
264  HDC hdcDlg = GetDC(hwndDlg);
265 
266  if (g_Assignment[g->CurrentElement].Size != -1)
267  {
268  SchemeSetMetric(&g->SchemeAdv, g_Assignment[g->CurrentElement].Size, GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, &bTranslated, FALSE));
269  }
270 
271  if (g_Assignment[g->CurrentElement].Font != -1)
272  {
273  PLOGFONTW plfFont = SchemeGetFont(&g->SchemeAdv, g_Assignment[g->CurrentElement].Font);
274  plfFont->lfHeight = -MulDiv(GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, &bTranslated, FALSE), GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
278  }
279 
280  ReleaseDC(hwndDlg, hdcDlg);
281 }
#define LF_FACESIZE
Definition: dimm.idl:39
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
#define SendDlgItemMessage
Definition: winuser.h:5743
int Size
Definition: advappdlg.c:17
const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Definition: advappdlg.c:28
unsigned int BOOL
Definition: ntddk_ex.h:94
BYTE lfItalic
Definition: wingdi.h:1897
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define IDC_ADVAPPEARANCE_FONT_C
Definition: resource.h:117
LONG lfHeight
Definition: wingdi.h:1892
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
#define BM_GETCHECK
Definition: winuser.h:1900
#define IDC_ADVAPPEARANCE_FONTBOLD
Definition: resource.h:122
#define IDC_ADVAPPEARANCE_SIZE_E
Definition: resource.h:110
GLboolean GLboolean g
Definition: glext.h:6204
#define GetDlgItemText
Definition: winuser.h:5686
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define IDC_ADVAPPEARANCE_FONTITALIC
Definition: resource.h:123
unsigned char BYTE
Definition: mem.h:68
#define FW_BOLD
Definition: wingdi.h:377
PLOGFONTW SchemeGetFont(COLOR_SCHEME *scheme, int id)
#define FW_NORMAL
Definition: wingdi.h:372
LONG lfWeight
Definition: wingdi.h:1896
VOID SchemeSetMetric(COLOR_SCHEME *scheme, int id, int value)
#define LOGPIXELSY
Definition: wingdi.h:718
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1905
#define IDC_ADVAPPEARANCE_FONTSIZE_E
Definition: resource.h:119
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
int Font
Definition: advappdlg.c:21

Referenced by AdvAppearanceDlgProc().

◆ SelectComboByElement()

static VOID SelectComboByElement ( HWND  hwnd,
INT  id,
LPARAM  lParam 
)
static

Definition at line 446 of file advappdlg.c.

447 {
448  INT nCount;
449  INT i;
450 
451  nCount = SendDlgItemMessage(hwnd, id, CB_GETCOUNT, 0, 0);
452  if (nCount == CB_ERR)
453  return;
454 
455  for (i = 0; i < nCount; i++)
456  {
458  {
460  break;
461  }
462  }
463 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CB_GETITEMDATA
Definition: winuser.h:1932
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define CB_ERR
Definition: winuser.h:2410
#define CB_SETCURSEL
Definition: winuser.h:1943
#define CB_GETCOUNT
Definition: winuser.h:1924
LPARAM lParam
Definition: combotst.c:139

Referenced by AdvAppearanceDlgProc().

◆ UpdateButtonColor()

static VOID UpdateButtonColor ( HWND  hwndDlg,
GLOBALS g,
INT  ID,
INT  nButton,
INT  nColor 
)
static

Definition at line 55 of file advappdlg.c.

56 {
57  HDC hdcColorButton, hdcCompat;
58  RECT rect;
59  HBRUSH hbrush;
60  HWND hwndColorButton;
61  HGDIOBJ hgdiTmp;
62 
63  if (nColor != -1)
64  {
65  /* Create a DC to draw on */
66  hwndColorButton = GetDlgItem(hwndDlg, ID);
67  hdcColorButton = GetDC(hwndColorButton);
68  hdcCompat = CreateCompatibleDC(hdcColorButton);
69  ReleaseDC(hwndColorButton, hdcColorButton);
70 
71  /* Select the button image to it */
72  hgdiTmp = SelectObject(hdcCompat, g->hbmpColor[nButton]);
73 
74  /* Create a brush and draw the rectangle */
75  rect.left = 2;
76  rect.top = 2;
77  rect.right = 22;
78  rect.bottom = 13;
79  hbrush = CreateSolidBrush(g->SchemeAdv.crColor[nColor]);
80  FillRect(hdcCompat, &rect, hbrush);
82 
83  /* hdcCompat is not needed anymore */
84  SelectObject(hdcCompat,hgdiTmp);
85  DeleteDC(hdcCompat);
86 
87  SendDlgItemMessage(hwndDlg, ID, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)g->hbmpColor[nButton]);
88  EnableWindow(GetDlgItem(hwndDlg, ID), TRUE);
89  }
90  else
91  {
93  EnableWindow(GetDlgItem(hwndDlg, ID), FALSE);
94  }
95 }
#define TRUE
Definition: types.h:120
static HBRUSH hbrush
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
#define BM_SETIMAGE
Definition: winuser.h:1904
& rect
Definition: startmenu.cpp:1413
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLboolean GLboolean g
Definition: glext.h:6204
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define ID
Definition: ruserpass.c:36
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI DeleteDC(_In_ HDC)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define IMAGE_BITMAP
Definition: winuser.h:211
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

Referenced by GetColor(), and UpdateControls().

◆ UpdateControls()

static VOID UpdateControls ( HWND  hwndDlg,
GLOBALS g 
)
static

Definition at line 206 of file advappdlg.c.

207 {
208  INT iElement;
209  HDC hdcDlg;
210 
211  iElement = g->CurrentElement;
212 
213  /* First enable / disable the controls */
214  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E), (g_Assignment[iElement].Size != -1));
215  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD), (g_Assignment[iElement].Size != -1));
216  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_SIZE_T), (g_Assignment[iElement].Size != -1));
217  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_COLOR1_T), (g_Assignment[iElement].Color1 != -1));
218  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_COLOR2_T), (g_Assignment[iElement].Color2 != -1));
219  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_FONT_T), (g_Assignment[iElement].Font != -1));
220  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_FONT_C), (g_Assignment[iElement].Font != -1));
223  EnableWindow(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_FONTCOLOR_T), (g_Assignment[iElement].FontColor != -1));
226 
227  /* Update the colors of the color buttons */
228  UpdateButtonColor(hwndDlg, g, IDC_ADVAPPEARANCE_COLOR1_B, 0, g_Assignment[iElement].Color1);
229  UpdateButtonColor(hwndDlg, g, IDC_ADVAPPEARANCE_COLOR2_B, 1, g_Assignment[iElement].Color2);
230  UpdateButtonColor(hwndDlg, g, IDC_ADVAPPEARANCE_FONTCOLOR_B, 2, g_Assignment[iElement].FontColor);
231 
232  if (g_Assignment[iElement].Size != -1)
233  SetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, SchemeGetMetric(&g->SchemeAdv, g_Assignment[iElement].Size), FALSE);
234  else
236 
237  hdcDlg = GetDC(hwndDlg);
238  if (g_Assignment[iElement].Font != -1)
239  {
240  PLOGFONTW plfFont = SchemeGetFont(&g->SchemeAdv, g_Assignment[iElement].Font);
241 
247  }
248  else
249  {
254  }
255 
256  ReleaseDC(hwndDlg, hdcDlg);
257 }
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
#define IDC_ADVAPPEARANCE_COLOR1_B
Definition: resource.h:113
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
int Size
Definition: advappdlg.c:17
#define IDC_ADVAPPEARANCE_FONTCOLOR_T
Definition: resource.h:120
const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Definition: advappdlg.c:28
int32_t INT
Definition: typedefs.h:56
int SchemeGetMetric(COLOR_SCHEME *scheme, int id)
#define IDC_ADVAPPEARANCE_COLOR2_B
Definition: resource.h:115
#define IDC_ADVAPPEARANCE_COLOR2_T
Definition: resource.h:114
#define IDC_ADVAPPEARANCE_FONTCOLOR_B
Definition: resource.h:121
BYTE lfItalic
Definition: wingdi.h:1897
static VOID UpdateButtonColor(HWND hwndDlg, GLOBALS *g, INT ID, INT nButton, INT nColor)
Definition: advappdlg.c:55
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define IDC_ADVAPPEARANCE_FONT_C
Definition: resource.h:117
LONG lfHeight
Definition: wingdi.h:1892
smooth NULL
Definition: ftsmooth.c:416
#define IDC_ADVAPPEARANCE_FONTBOLD
Definition: resource.h:122
#define IDC_ADVAPPEARANCE_SIZE_E
Definition: resource.h:110
GLboolean GLboolean g
Definition: glext.h:6204
#define BM_SETCHECK
Definition: winuser.h:1903
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SetDlgItemText
Definition: winuser.h:5750
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define IDC_ADVAPPEARANCE_FONTITALIC
Definition: resource.h:123
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define IDC_ADVAPPEARANCE_SIZE_UD
Definition: resource.h:111
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define TEXT(s)
Definition: k32.h:26
#define FW_BOLD
Definition: wingdi.h:377
#define IDC_ADVAPPEARANCE_FONTSIZE_T
Definition: resource.h:118
PLOGFONTW SchemeGetFont(COLOR_SCHEME *scheme, int id)
#define IDC_ADVAPPEARANCE_FONT_T
Definition: resource.h:116
LONG lfWeight
Definition: wingdi.h:1896
#define IDC_ADVAPPEARANCE_COLOR1_T
Definition: resource.h:112
#define IDC_ADVAPPEARANCE_SIZE_T
Definition: resource.h:109
#define LOGPIXELSY
Definition: wingdi.h:718
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1905
#define IDC_ADVAPPEARANCE_FONTSIZE_E
Definition: resource.h:119
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
int Font
Definition: advappdlg.c:21
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

Referenced by AdvAppearanceDlg_Init(), and AdvAppearanceDlgProc().

Variable Documentation

◆ g_Assignment

const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Initial value:
=
{
{-1, -1, COLOR_DESKTOP, -1, -1, -1},
{-1, -1, COLOR_WINDOW, -1 , -1, COLOR_WINDOWTEXT},
{-1, -1, COLOR_3DFACE, -1, -1, COLOR_BTNTEXT},
{SIZE_CAPTION_HEIGHT, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, FONT_MESSAGE, COLOR_WINDOWTEXT},
{-1, -1, COLOR_APPWORKSPACE, -1, -1, -1},
{SIZE_ICON_SPACE_X, -1, -1, -1, -1, -1},
{SIZE_ICON_SPACE_Y, -1, -1, -1, -1, -1},
{SIZE_ICON, -1, -1, -1, FONT_ICON, -1},
}
#define SIZE_MENU_WIDTH
Definition: appearance.h:11
#define COLOR_HIGHLIGHT
Definition: winuser.h:916
#define SIZE_SM_CAPTION_HEIGHT
Definition: appearance.h:10
#define SIZE_CAPTION_HEIGHT
Definition: appearance.h:8
#define COLOR_INACTIVEBORDER
Definition: winuser.h:914
#define COLOR_INACTIVECAPTION
Definition: winuser.h:906
#define COLOR_CAPTIONTEXT
Definition: winuser.h:912
#define FONT_STATUS
Definition: appearance.h:21
#define COLOR_APPWORKSPACE
Definition: winuser.h:915
#define COLOR_DESKTOP
Definition: winuser.h:904
#define COLOR_WINDOW
Definition: winuser.h:908
#define FONT_SMCAPTION
Definition: appearance.h:19
#define COLOR_INFOBK
Definition: winuser.h:932
#define SIZE_ICON
Definition: appearance.h:16
#define COLOR_3DFACE
Definition: winuser.h:919
#define COLOR_GRADIENTINACTIVECAPTION
Definition: winuser.h:935
#define COLOR_SCROLLBAR
Definition: winuser.h:902
#define COLOR_MENU
Definition: winuser.h:907
#define SIZE_SCROLL_HEIGHT
Definition: appearance.h:6
#define COLOR_ACTIVECAPTION
Definition: winuser.h:905
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:917
#define SIZE_ICON_SPACE_X
Definition: appearance.h:14
#define SIZE_MENU_HEIGHT
Definition: appearance.h:12
#define FONT_ICON
Definition: appearance.h:23
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
#define COLOR_ACTIVEBORDER
Definition: winuser.h:913
#define COLOR_MENUTEXT
Definition: winuser.h:910
#define FONT_CAPTION
Definition: appearance.h:18
#define COLOR_GRADIENTACTIVECAPTION
Definition: winuser.h:934
#define COLOR_INACTIVECAPTIONTEXT
Definition: winuser.h:924
#define COLOR_INFOTEXT
Definition: winuser.h:931
#define FONT_MENU
Definition: appearance.h:20
#define SIZE_BORDER_WIDTH
Definition: appearance.h:4
#define SIZE_ICON_SPACE_Y
Definition: appearance.h:15
#define COLOR_BTNTEXT
Definition: winuser.h:923
#define FONT_MESSAGE
Definition: appearance.h:22
#define SIZE_SCROLL_WIDTH
Definition: appearance.h:5

Definition at line 28 of file advappdlg.c.

Referenced by AdvAppearanceDlgProc(), GetColor(), SaveCurrentValues(), and UpdateControls().