]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/colour.h
Made toolbars sticky, i.e. you need to drag them
[wxWidgets.git] / include / wx / mac / carbon / colour.h
CommitLineData
8cf73271 1/////////////////////////////////////////////////////////////////////////////
edc536d3 2// Name: wx/mac/carbon/colour.h
8cf73271
SC
3// Purpose: wxColour class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
8cf73271
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COLOUR_H_
13#define _WX_COLOUR_H_
14
8cf73271
SC
15#include "wx/object.h"
16#include "wx/string.h"
17
18// Colour
ee19674c 19class WXDLLEXPORT wxColour: public wxColourBase
8cf73271
SC
20{
21public:
edc536d3
WS
22 // constructors
23 // ------------
24
8cf73271 25 // default
edc536d3 26 wxColour() { Init(); }
ee19674c 27 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
8cf73271 28
8cf73271 29 // dtor
edc536d3
WS
30 ~wxColour();
31
edc536d3
WS
32 // accessors
33 bool Ok() const {return m_isInit; }
34
35 unsigned char Red() const { return m_red; }
36 unsigned char Green() const { return m_green; }
37 unsigned char Blue() const { return m_blue; }
fa8bc37b 38 unsigned char Alpha() const { return m_alpha; }
edc536d3
WS
39
40 // comparison
41 bool operator == (const wxColour& colour) const
42 {
43 return (m_isInit == colour.m_isInit
44 && m_red == colour.m_red
45 && m_green == colour.m_green
fa8bc37b
SC
46 && m_blue == colour.m_blue
47 && m_alpha == colour.m_alpha);
edc536d3
WS
48 }
49 bool operator != (const wxColour& colour) const { return !(*this == colour); }
50
51 const WXCOLORREF& GetPixel() const { return m_pixel; };
8cf73271 52
8cf73271
SC
53protected :
54
55 // Helper function
56 void Init();
57
fa8bc37b
SC
58 void InitWith( unsigned char red, unsigned char green, unsigned char blue )
59 {
a69aabc3 60 InitWith( red, green, blue , wxALPHA_OPAQUE ) ;
fa8bc37b
SC
61 }
62
63 void InitWith( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha );
ee19674c 64
8cf73271 65private:
edc536d3
WS
66 bool m_isInit;
67 unsigned char m_red;
68 unsigned char m_blue;
69 unsigned char m_green;
fa8bc37b 70 unsigned char m_alpha;
8cf73271
SC
71
72public:
edc536d3 73 WXCOLORREF m_pixel ;
f61ed7ee
SC
74 void FromRGBColor( const WXCOLORREF* color ) ;
75
8cf73271
SC
76
77private:
edc536d3 78 DECLARE_DYNAMIC_CLASS(wxColour)
8cf73271
SC
79};
80
81#endif
82 // _WX_COLOUR_H_