improve cursor and color implementation in wxqt

This commit is contained in:
Sean D'Epagnier
2016-08-24 22:04:59 -04:00
committed by Vadim Zeitlin
parent 9f39eeb5e9
commit 88e134ef81
14 changed files with 141 additions and 71 deletions

View File

@@ -10,37 +10,35 @@
#ifndef _WX_QT_COLOUR_H_
#define _WX_QT_COLOUR_H_
#include <QtGui/QColor>
class QColor;
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
{
public:
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
wxColour(const QColor& color) : m_qtColor(color) {}
wxColour(const QColor& color);
virtual bool IsOk() const { return m_qtColor.isValid(); }
virtual bool IsOk() const;
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(); }
unsigned char Red() const;
unsigned char Green() const;
unsigned char Blue() const;
unsigned char Alpha() const;
bool operator==(const wxColour& color) const
{ return m_qtColor == color.m_qtColor; }
bool operator!=(const wxColour& color) const
{ return m_qtColor != color.m_qtColor; }
bool operator==(const wxColour& color) const;
bool operator!=(const wxColour& color) const;
int GetPixel() const;
QColor GetHandle() const { return m_qtColor; };
QColor GetQColor() const;
protected:
virtual void
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a)
{ m_qtColor.setRgb(r, g, b, a); }
void Init();
virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a);
private:
QColor m_qtColor;
unsigned char red, green, blue, alpha;
bool valid;
wxDECLARE_DYNAMIC_CLASS(wxColour);
};