2014-08-23 21:50:11 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/qt/colour.h
|
|
|
|
// Purpose: wxColour class implementation for wxQt
|
2014-12-09 20:04:11 -05:00
|
|
|
// Author: Kolya Kosenko
|
|
|
|
// Created: 2010-05-12
|
|
|
|
// Copyright: (c) 2010 Kolya Kosenko
|
2014-08-23 21:50:11 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_QT_COLOUR_H_
|
|
|
|
#define _WX_QT_COLOUR_H_
|
|
|
|
|
|
|
|
#include <QtGui/QColor>
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
|
|
|
wxColour(const QColor& color) : m_qtColor(color) {}
|
|
|
|
|
|
|
|
virtual bool IsOk() const { return m_qtColor.isValid(); }
|
|
|
|
|
2014-12-24 15:02:57 -05:00
|
|
|
unsigned char Red() const { return m_qtColor.red(); }
|
|
|
|
unsigned char Green() const { return m_qtColor.green(); }
|
|
|
|
unsigned char Blue() const { return m_qtColor.blue(); }
|
|
|
|
unsigned char Alpha() const { return m_qtColor.alpha(); }
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
bool operator==(const wxColour& color) const
|
|
|
|
{ return m_qtColor == color.m_qtColor; }
|
|
|
|
bool operator!=(const wxColour& color) const
|
|
|
|
{ return m_qtColor != color.m_qtColor; }
|
|
|
|
|
|
|
|
int GetPixel() const;
|
|
|
|
|
|
|
|
QColor GetHandle() const { return m_qtColor; };
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void
|
|
|
|
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a)
|
|
|
|
{ m_qtColor.setRgb(r, g, b, a); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
QColor m_qtColor;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxColour);
|
2014-08-23 21:50:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_QT_COLOUR_H_
|