settings.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/settings.h
  3. // Purpose: wxSystemSettings class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_SETTINGS_H_BASE_
  11. #define _WX_SETTINGS_H_BASE_
  12. #include "wx/colour.h"
  13. #include "wx/font.h"
  14. class WXDLLIMPEXP_FWD_CORE wxWindow;
  15. // possible values for wxSystemSettings::GetFont() parameter
  16. //
  17. // NB: wxMSW assumes that they have the same values as the parameters of
  18. // Windows GetStockObject() API, don't change the values!
  19. enum wxSystemFont
  20. {
  21. wxSYS_OEM_FIXED_FONT = 10,
  22. wxSYS_ANSI_FIXED_FONT,
  23. wxSYS_ANSI_VAR_FONT,
  24. wxSYS_SYSTEM_FONT,
  25. wxSYS_DEVICE_DEFAULT_FONT,
  26. // don't use: this is here just to make the values of enum elements
  27. // coincide with the corresponding MSW constants
  28. wxSYS_DEFAULT_PALETTE,
  29. // don't use: MSDN says that this is a stock object provided only
  30. // for compatibility with 16-bit Windows versions earlier than 3.0!
  31. wxSYS_SYSTEM_FIXED_FONT,
  32. wxSYS_DEFAULT_GUI_FONT,
  33. // this was just a temporary aberration, do not use it any more
  34. wxSYS_ICONTITLE_FONT = wxSYS_DEFAULT_GUI_FONT
  35. };
  36. // possible values for wxSystemSettings::GetColour() parameter
  37. //
  38. // NB: wxMSW assumes that they have the same values as the parameters of
  39. // Windows GetSysColor() API, don't change the values!
  40. enum wxSystemColour
  41. {
  42. wxSYS_COLOUR_SCROLLBAR,
  43. wxSYS_COLOUR_DESKTOP,
  44. wxSYS_COLOUR_ACTIVECAPTION,
  45. wxSYS_COLOUR_INACTIVECAPTION,
  46. wxSYS_COLOUR_MENU,
  47. wxSYS_COLOUR_WINDOW,
  48. wxSYS_COLOUR_WINDOWFRAME,
  49. wxSYS_COLOUR_MENUTEXT,
  50. wxSYS_COLOUR_WINDOWTEXT,
  51. wxSYS_COLOUR_CAPTIONTEXT,
  52. wxSYS_COLOUR_ACTIVEBORDER,
  53. wxSYS_COLOUR_INACTIVEBORDER,
  54. wxSYS_COLOUR_APPWORKSPACE,
  55. wxSYS_COLOUR_HIGHLIGHT,
  56. wxSYS_COLOUR_HIGHLIGHTTEXT,
  57. wxSYS_COLOUR_BTNFACE,
  58. wxSYS_COLOUR_BTNSHADOW,
  59. wxSYS_COLOUR_GRAYTEXT,
  60. wxSYS_COLOUR_BTNTEXT,
  61. wxSYS_COLOUR_INACTIVECAPTIONTEXT,
  62. wxSYS_COLOUR_BTNHIGHLIGHT,
  63. wxSYS_COLOUR_3DDKSHADOW,
  64. wxSYS_COLOUR_3DLIGHT,
  65. wxSYS_COLOUR_INFOTEXT,
  66. wxSYS_COLOUR_INFOBK,
  67. wxSYS_COLOUR_LISTBOX,
  68. wxSYS_COLOUR_HOTLIGHT,
  69. wxSYS_COLOUR_GRADIENTACTIVECAPTION,
  70. wxSYS_COLOUR_GRADIENTINACTIVECAPTION,
  71. wxSYS_COLOUR_MENUHILIGHT,
  72. wxSYS_COLOUR_MENUBAR,
  73. wxSYS_COLOUR_LISTBOXTEXT,
  74. wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT,
  75. wxSYS_COLOUR_MAX,
  76. // synonyms
  77. wxSYS_COLOUR_BACKGROUND = wxSYS_COLOUR_DESKTOP,
  78. wxSYS_COLOUR_3DFACE = wxSYS_COLOUR_BTNFACE,
  79. wxSYS_COLOUR_3DSHADOW = wxSYS_COLOUR_BTNSHADOW,
  80. wxSYS_COLOUR_BTNHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
  81. wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
  82. wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
  83. wxSYS_COLOUR_FRAMEBK = wxSYS_COLOUR_BTNFACE
  84. };
  85. // possible values for wxSystemSettings::GetMetric() index parameter
  86. //
  87. // NB: update the conversion table in msw/settings.cpp if you change the values
  88. // of the elements of this enum
  89. enum wxSystemMetric
  90. {
  91. wxSYS_MOUSE_BUTTONS = 1,
  92. wxSYS_BORDER_X,
  93. wxSYS_BORDER_Y,
  94. wxSYS_CURSOR_X,
  95. wxSYS_CURSOR_Y,
  96. wxSYS_DCLICK_X,
  97. wxSYS_DCLICK_Y,
  98. wxSYS_DRAG_X,
  99. wxSYS_DRAG_Y,
  100. wxSYS_EDGE_X,
  101. wxSYS_EDGE_Y,
  102. wxSYS_HSCROLL_ARROW_X,
  103. wxSYS_HSCROLL_ARROW_Y,
  104. wxSYS_HTHUMB_X,
  105. wxSYS_ICON_X,
  106. wxSYS_ICON_Y,
  107. wxSYS_ICONSPACING_X,
  108. wxSYS_ICONSPACING_Y,
  109. wxSYS_WINDOWMIN_X,
  110. wxSYS_WINDOWMIN_Y,
  111. wxSYS_SCREEN_X,
  112. wxSYS_SCREEN_Y,
  113. wxSYS_FRAMESIZE_X,
  114. wxSYS_FRAMESIZE_Y,
  115. wxSYS_SMALLICON_X,
  116. wxSYS_SMALLICON_Y,
  117. wxSYS_HSCROLL_Y,
  118. wxSYS_VSCROLL_X,
  119. wxSYS_VSCROLL_ARROW_X,
  120. wxSYS_VSCROLL_ARROW_Y,
  121. wxSYS_VTHUMB_Y,
  122. wxSYS_CAPTION_Y,
  123. wxSYS_MENU_Y,
  124. wxSYS_NETWORK_PRESENT,
  125. wxSYS_PENWINDOWS_PRESENT,
  126. wxSYS_SHOW_SOUNDS,
  127. wxSYS_SWAP_BUTTONS,
  128. wxSYS_DCLICK_MSEC
  129. };
  130. // possible values for wxSystemSettings::HasFeature() parameter
  131. enum wxSystemFeature
  132. {
  133. wxSYS_CAN_DRAW_FRAME_DECORATIONS = 1,
  134. wxSYS_CAN_ICONIZE_FRAME,
  135. wxSYS_TABLET_PRESENT
  136. };
  137. // values for different screen designs
  138. enum wxSystemScreenType
  139. {
  140. wxSYS_SCREEN_NONE = 0, // not yet defined
  141. wxSYS_SCREEN_TINY, // <
  142. wxSYS_SCREEN_PDA, // >= 320x240
  143. wxSYS_SCREEN_SMALL, // >= 640x480
  144. wxSYS_SCREEN_DESKTOP // >= 800x600
  145. };
  146. // ----------------------------------------------------------------------------
  147. // wxSystemSettingsNative: defines the API for wxSystemSettings class
  148. // ----------------------------------------------------------------------------
  149. // this is a namespace rather than a class: it has only non virtual static
  150. // functions
  151. //
  152. // also note that the methods are implemented in the platform-specific source
  153. // files (i.e. this is not a real base class as we can't override its virtual
  154. // functions because it doesn't have any)
  155. class WXDLLIMPEXP_CORE wxSystemSettingsNative
  156. {
  157. public:
  158. // get a standard system colour
  159. static wxColour GetColour(wxSystemColour index);
  160. // get a standard system font
  161. static wxFont GetFont(wxSystemFont index);
  162. // get a system-dependent metric
  163. static int GetMetric(wxSystemMetric index, wxWindow * win = NULL);
  164. // return true if the port has certain feature
  165. static bool HasFeature(wxSystemFeature index);
  166. };
  167. // ----------------------------------------------------------------------------
  168. // include the declaration of the real platform-dependent class
  169. // ----------------------------------------------------------------------------
  170. class WXDLLIMPEXP_CORE wxSystemSettings : public wxSystemSettingsNative
  171. {
  172. public:
  173. #ifdef __WXUNIVERSAL__
  174. // in wxUniversal we want to use the theme standard colours instead of the
  175. // system ones, otherwise wxSystemSettings is just the same as
  176. // wxSystemSettingsNative
  177. static wxColour GetColour(wxSystemColour index);
  178. // some metrics are toolkit-dependent and provided by wxUniv, some are
  179. // lowlevel
  180. static int GetMetric(wxSystemMetric index, wxWindow *win = NULL);
  181. #endif // __WXUNIVERSAL__
  182. // Get system screen design (desktop, pda, ..) used for
  183. // laying out various dialogs.
  184. static wxSystemScreenType GetScreenType();
  185. // Override default.
  186. static void SetScreenType( wxSystemScreenType screen );
  187. // Value
  188. static wxSystemScreenType ms_screen;
  189. };
  190. #endif
  191. // _WX_SETTINGS_H_BASE_