X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..d0fff5cb110810d3bee6fa255292f161f7752911:/include/wx/msw/colour.h?ds=sidebyside diff --git a/include/wx/msw/colour.h b/include/wx/msw/colour.h index 5bf97af25d..9e001f03e7 100644 --- a/include/wx/msw/colour.h +++ b/include/wx/msw/colour.h @@ -5,12 +5,12 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __COLOURH__ -#define __COLOURH__ +#ifndef _WX_COLOUR_H_ +#define _WX_COLOUR_H_ #ifdef __GNUG__ #pragma interface "colour.h" @@ -23,6 +23,7 @@ class WXDLLEXPORT wxColour: public wxObject public: wxColour(void); wxColour(const unsigned char r, const unsigned char g, const unsigned char b); + wxColour(unsigned long colRGB) { Set(colRGB); } wxColour(const wxColour& col); wxColour(const wxString& col); ~wxColour(void) ; @@ -31,6 +32,14 @@ public: inline int Ok(void) const { return (m_isInit) ; } void Set(unsigned char r, unsigned char g, unsigned char b); + void Set(unsigned long colRGB) + { + // we don't need to know sizeof(long) here because we assume that the three + // least significant bytes contain the R, G and B values + Set((unsigned char)colRGB, + (unsigned char)(colRGB >> 8), + (unsigned char)(colRGB >> 16)); + } // Let's remove this inelegant function #if WXWIN_COMPATIBILITY @@ -59,4 +68,4 @@ public: #define wxColor wxColour #endif - // __COLOURH__ + // _WX_COLOUR_H_