]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/colour.h
Small changes after Robert's edits
[wxWidgets.git] / include / wx / msw / colour.h
index 5bf97af25d5babd79d07f0b7e8f31c3ffef5dcf1..9e001f03e7a13494dfbf233dcb94efe79dca7302 100644 (file)
@@ -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_