1 ///////////////////////////////////////////////////////////////////////////// 
   4 // Author:      Stefan Csomor 
   8 // Copyright:   (c) Stefan Csomor 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  13 #pragma implementation "settings.h" 
  16 #include "wx/settings.h" 
  17 #include "wx/gdicmn.h" 
  20 #include "wx/mac/uma.h" 
  22 // ---------------------------------------------------------------------------- 
  23 // wxSystemSettingsNative 
  24 // ---------------------------------------------------------------------------- 
  26 // ---------------------------------------------------------------------------- 
  28 // ---------------------------------------------------------------------------- 
  30 wxColour 
wxSystemSettingsNative::GetColour(wxSystemColour index
) 
  33     wxGetOsVersion( &major
, &minor 
); 
  37         case wxSYS_COLOUR_SCROLLBAR 
: 
  38         case wxSYS_COLOUR_BACKGROUND
: 
  39         case wxSYS_COLOUR_ACTIVECAPTION
: 
  40         case wxSYS_COLOUR_INACTIVECAPTION
: 
  41         case wxSYS_COLOUR_MENU
: 
  42         case wxSYS_COLOUR_WINDOW
: 
  43         case wxSYS_COLOUR_WINDOWFRAME
: 
  44         case wxSYS_COLOUR_ACTIVEBORDER
: 
  45         case wxSYS_COLOUR_INACTIVEBORDER
: 
  46         case wxSYS_COLOUR_BTNFACE
: 
  47         case wxSYS_COLOUR_MENUBAR
: 
  48             return wxColor( 0xDD , 0xDD , 0xDD ) ; 
  51         case wxSYS_COLOUR_LISTBOX 
: 
  56                 return wxColor( 0xEE , 0xEE , 0xEE ) ; 
  59         case wxSYS_COLOUR_BTNSHADOW
: 
  61                 return wxColor( 0xBE , 0xBE , 0xBE ) ; 
  63                 return wxColor( 0x44 , 0x44 , 0x44 ) ; 
  66         case wxSYS_COLOUR_BTNTEXT
: 
  67         case wxSYS_COLOUR_MENUTEXT
: 
  68         case wxSYS_COLOUR_WINDOWTEXT
: 
  69         case wxSYS_COLOUR_CAPTIONTEXT
: 
  70         case wxSYS_COLOUR_INFOTEXT
: 
  71         case wxSYS_COLOUR_INACTIVECAPTIONTEXT
: 
  74         case wxSYS_COLOUR_HIGHLIGHT
: 
  77                 LMGetHiliteRGB(&hilite
) ; 
  78                 return wxColor( hilite
.red 
>> 8 , hilite
.green 
>> 8  , hilite
.blue 
>> 8  ) ; 
  81         case wxSYS_COLOUR_BTNHIGHLIGHT
: 
  82         case wxSYS_COLOUR_GRAYTEXT
: 
  83             return wxColor( 0xCC , 0xCC , 0xCC ) ; 
  86         case wxSYS_COLOUR_3DDKSHADOW
: 
  87             return wxColor( 0x44 , 0x44 , 0x44 ) ; 
  89         case wxSYS_COLOUR_3DLIGHT
: 
  90             return wxColor( 0xCC , 0xCC , 0xCC ) ; 
  92         case wxSYS_COLOUR_HIGHLIGHTTEXT 
: 
  95                 LMGetHiliteRGB(&hilite
) ; 
  96                 if ( ( hilite
.red 
+ hilite
.green 
+ hilite
.blue 
) == 0 ) 
 102         case wxSYS_COLOUR_INFOBK 
: 
 103         case wxSYS_COLOUR_APPWORKSPACE
:  
 107         case wxSYS_COLOUR_HOTLIGHT
: 
 108         case wxSYS_COLOUR_GRADIENTACTIVECAPTION
: 
 109         case wxSYS_COLOUR_GRADIENTINACTIVECAPTION
: 
 110         case wxSYS_COLOUR_MENUHILIGHT
: 
 114         case wxSYS_COLOUR_MAX
: 
 115             wxFAIL_MSG( _T("unknown system colour index") ); 
 121 // ---------------------------------------------------------------------------- 
 123 // ---------------------------------------------------------------------------- 
 125 wxFont 
wxSystemSettingsNative::GetFont(wxSystemFont index
) 
 129         case wxSYS_ANSI_VAR_FONT 
: 
 130         case wxSYS_SYSTEM_FONT 
: 
 131         case wxSYS_DEVICE_DEFAULT_FONT 
: 
 132         case wxSYS_DEFAULT_GUI_FONT 
: 
 134                 return *wxSMALL_FONT 
; 
 137         case wxSYS_OEM_FIXED_FONT 
: 
 138         case wxSYS_ANSI_FIXED_FONT 
: 
 139         case wxSYS_SYSTEM_FIXED_FONT 
: 
 142                 return *wxNORMAL_FONT 
; 
 147     return *wxNORMAL_FONT
; 
 150 // ---------------------------------------------------------------------------- 
 151 // system metrics/features 
 152 // ---------------------------------------------------------------------------- 
 154 // Get a system metric, e.g. scrollbar size 
 155 int wxSystemSettingsNative::GetMetric(wxSystemMetric index
) 
 161         case wxSYS_MOUSE_BUTTONS
: 
 162             // we emulate a two button mouse (ctrl + click = right button ) 
 194         case wxSYS_HSCROLL_ARROW_X
: 
 196         case wxSYS_HSCROLL_ARROW_Y
: 
 206         case wxSYS_ICONSPACING_X
: 
 209         case wxSYS_ICONSPACING_Y
: 
 212         case wxSYS_WINDOWMIN_X
: 
 215         case wxSYS_WINDOWMIN_Y
: 
 219             wxDisplaySize(&value
, NULL
); 
 222             wxDisplaySize(NULL
, &value
); 
 224         case wxSYS_FRAMESIZE_X
: 
 227         case wxSYS_FRAMESIZE_Y
: 
 230         case wxSYS_SMALLICON_X
: 
 233         case wxSYS_SMALLICON_Y
: 
 236         case wxSYS_HSCROLL_Y
: 
 238         case wxSYS_VSCROLL_X
: 
 240         case wxSYS_VSCROLL_ARROW_X
: 
 242         case wxSYS_VSCROLL_ARROW_Y
: 
 246         case wxSYS_CAPTION_Y
: 
 252         case wxSYS_NETWORK_PRESENT
: 
 255         case wxSYS_PENWINDOWS_PRESENT
: 
 257         case wxSYS_SHOW_SOUNDS
: 
 260         case wxSYS_SWAP_BUTTONS
: 
 268 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index
) 
 272         case wxSYS_CAN_ICONIZE_FRAME
:  
 273         case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: