Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cXStylePrefs.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cXStylePrefs_H
6 #define _INC_cXStylePrefs_H
7 #pragma once
8 #include "cXSpriteMap.h"
10 
11 namespace GrayGUI
12 {
14  {
15  // Relative size to the selected font size.
21  };
22 
23  struct cXStylePrefs
24  : public cSingletonStatic<cXStylePrefs>
25  {
26  cXStylePrefs();
27  ~cXStylePrefs();
28 
29  int m_DialogFontSize; // Avg size for the dialog font.
30 
31  cString m_sFontSmall; // CDXFONT_DEFAULT
32  cString m_sFontLarge; // IRTH_FONT_LARGE
33 
34  int GetFontSize(FONTSCALE_TYPE scale) const noexcept
35  {
36  int size = (m_DialogFontSize <= 0) ? 8 : m_DialogFontSize;
37  return (size * 10) / scale;
38  }
39 
40 #define cXStylePrefsProp(a,b,c,d,e) d m_##a;
41 #include "cXStylePrefsProps.tbl"
42 #undef cXStylePrefsProp
43 
44  };
45 
46  extern cXStylePrefs g_XStylePrefs;
47 }
48 #endif
Definition: cSingleton.h:30
Definition: GrayGUI.cpp:11
cXStylePrefs g_XStylePrefs
FONTSCALE_TYPE
Definition: cXStylePrefs.h:14
@ FONTSCALE_Medium
Definition: cXStylePrefs.h:18
@ FONTSCALE_Huge
Definition: cXStylePrefs.h:20
@ FONTSCALE_Tiny
Definition: cXStylePrefs.h:16
@ FONTSCALE_Small
Definition: cXStylePrefs.h:17
@ FONTSCALE_Large
Definition: cXStylePrefs.h:19
Definition: cXStylePrefs.h:25
int GetFontSize(FONTSCALE_TYPE scale) const noexcept
Definition: cXStylePrefs.h:34
int m_DialogFontSize
Definition: cXStylePrefs.h:29
~cXStylePrefs()
Definition: cXStylePrefs.cpp:20
cString m_sFontSmall
Definition: cXStylePrefs.h:31
cXStylePrefs()
Definition: cXStylePrefs.cpp:11
cString m_sFontLarge
Definition: cXStylePrefs.h:32