2004-03-23 12:38:49 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: brush.h
|
|
|
|
// Purpose: wxBrush class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Stefan Csomor
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 12:38:49 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_BRUSH_H_
|
|
|
|
#define _WX_BRUSH_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
|
|
|
#pragma interface "brush.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxBrush;
|
|
|
|
|
2004-11-30 13:46:20 -05:00
|
|
|
typedef enum
|
2004-03-23 12:38:49 -05:00
|
|
|
{
|
2004-11-30 13:46:20 -05:00
|
|
|
kwxMacBrushColour ,
|
|
|
|
kwxMacBrushTheme ,
|
|
|
|
kwxMacBrushThemeBackground
|
2004-03-23 12:38:49 -05:00
|
|
|
} wxMacBrushKind ;
|
|
|
|
|
|
|
|
// Brush
|
2004-12-03 10:31:31 -05:00
|
|
|
class WXDLLEXPORT wxBrush: public wxBrushBase
|
2004-03-23 12:38:49 -05:00
|
|
|
{
|
2004-11-30 13:46:20 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
2004-03-23 12:38:49 -05:00
|
|
|
|
|
|
|
public:
|
2004-11-30 13:46:20 -05:00
|
|
|
wxBrush();
|
|
|
|
wxBrush(short macThemeBrush ) ;
|
|
|
|
wxBrush(const wxColour& col, int style = wxSOLID);
|
|
|
|
wxBrush(const wxBitmap& stipple);
|
|
|
|
wxBrush(const wxBrush& brush)
|
2004-12-03 10:31:31 -05:00
|
|
|
: wxBrushBase()
|
2004-11-30 13:46:20 -05:00
|
|
|
{ Ref(brush); }
|
|
|
|
~wxBrush();
|
|
|
|
|
|
|
|
virtual void SetColour(const wxColour& col) ;
|
|
|
|
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
|
|
|
virtual void SetStyle(int style) ;
|
|
|
|
virtual void SetStipple(const wxBitmap& stipple) ;
|
|
|
|
virtual void SetMacTheme(short macThemeBrush) ;
|
|
|
|
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
|
|
|
|
|
|
|
|
wxBrush& operator = (const wxBrush& brush)
|
|
|
|
{ if (*this == brush) return (*this); Ref(brush); return *this; }
|
|
|
|
bool operator == (const wxBrush& brush)
|
|
|
|
{ return m_refData == brush.m_refData; }
|
|
|
|
bool operator != (const wxBrush& brush)
|
|
|
|
{ return m_refData != brush.m_refData; }
|
|
|
|
|
|
|
|
wxMacBrushKind MacGetBrushKind() const ;
|
|
|
|
|
|
|
|
unsigned long GetMacThemeBackground(WXRECTPTR extent) const ;
|
|
|
|
short GetMacTheme() const ;
|
|
|
|
wxColour& GetColour() const ;
|
2004-12-03 10:31:31 -05:00
|
|
|
virtual int GetStyle() const ;
|
2004-11-30 13:46:20 -05:00
|
|
|
wxBitmap *GetStipple() const ;
|
|
|
|
|
|
|
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
2004-03-23 12:38:49 -05:00
|
|
|
|
|
|
|
// Implementation
|
|
|
|
|
2004-11-30 13:46:20 -05:00
|
|
|
// Useful helper: create the brush resource
|
|
|
|
bool RealizeResource();
|
2004-03-23 12:38:49 -05:00
|
|
|
|
2004-11-30 13:46:20 -05:00
|
|
|
// When setting properties, we must make sure we're not changing
|
|
|
|
// another object
|
|
|
|
void Unshare();
|
2004-03-23 12:38:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_BRUSH_H_
|