]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/colour.cpp
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     wxColour class 
   4 // Author:      Julian Smart 
   8 // Copyright:   (c) Julian Smart and Markus Holzem 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  13 #pragma implementation "colour.h" 
  16 // For compilers that support precompilation, includes "wx.h". 
  17 #include "wx/wxprec.h" 
  23 #include "wx/gdicmn.h" 
  24 #include "wx/msw/private.h" 
  29 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
) 
  37   m_red 
= m_blue 
= m_green 
= 0; 
  40 wxColour::wxColour (unsigned char r
, unsigned char g
, unsigned char b
) 
  46   m_pixel 
= PALETTERGB (m_red
, m_green
, m_blue
); 
  49 wxColour::wxColour (const wxColour
& col
) 
  52   m_green 
= col
.m_green
; 
  54   m_isInit 
= col
.m_isInit
; 
  55   m_pixel 
= col
.m_pixel
; 
  58 wxColour
& wxColour::operator =(const wxColour
& col
) 
  61   m_green 
= col
.m_green
; 
  63   m_isInit 
= col
.m_isInit
; 
  64   m_pixel 
= col
.m_pixel
; 
  68 void wxColour::InitFromName(const wxString
& col
) 
  70   wxColour 
*the_colour 
= wxTheColourDatabase
->FindColour (col
); 
  73       m_red 
= the_colour
->Red (); 
  74       m_green 
= the_colour
->Green (); 
  75       m_blue 
= the_colour
->Blue (); 
  85   m_pixel 
= PALETTERGB (m_red
, m_green
, m_blue
); 
  92 void wxColour::Set (unsigned char r
, unsigned char g
, unsigned char b
) 
  98   m_pixel 
= PALETTERGB (m_red
, m_green
, m_blue
); 
 102 #if WXWIN_COMPATIBILITY 
 103 void wxColour::Get (unsigned char *r
, unsigned char *g
, unsigned char *b
) const