]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/brush.h
Added OnEraseBackground to wxNotebook on wxMSW to avoid black background;
[wxWidgets.git] / include / wx / msw / brush.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: brush.h
3// Purpose: wxBrush class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc
JS
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_BRUSH_H_
13#define _WX_BRUSH_H_
2bda0e17
KB
14
15#ifdef __GNUG__
16#pragma interface "brush.h"
17#endif
18
19#include "wx/gdicmn.h"
20#include "wx/gdiobj.h"
21#include "wx/bitmap.h"
22
23class WXDLLEXPORT wxBrush;
24
25class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
26{
27 friend class WXDLLEXPORT wxBrush;
28public:
29 wxBrushRefData(void);
b823f5a1 30 wxBrushRefData(const wxBrushRefData& data);
2bda0e17
KB
31 ~wxBrushRefData(void);
32
33protected:
34 int m_style;
35 wxBitmap m_stipple ;
36 wxColour m_colour;
37 WXHBRUSH m_hBrush;
38};
39
40#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
41
42// Brush
43class WXDLLEXPORT wxBrush: public wxGDIObject
44{
45 DECLARE_DYNAMIC_CLASS(wxBrush)
46
47public:
48 wxBrush(void);
debe6624 49 wxBrush(const wxColour& col, int style);
2bda0e17
KB
50 wxBrush(const wxBitmap& stipple);
51 inline wxBrush(const wxBrush& brush) { Ref(brush); }
b823f5a1 52 inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
2bda0e17
KB
53 ~wxBrush(void);
54
55 virtual void SetColour(const wxColour& col) ;
4d947517 56 virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
debe6624 57 virtual void SetStyle(int style) ;
2bda0e17
KB
58 virtual void SetStipple(const wxBitmap& stipple) ;
59
60 inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
61 inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
62 inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
63
64 inline wxColour& GetColour(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
65 inline int GetStyle(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
66 inline wxBitmap *GetStipple(void) const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
67
68 virtual bool Ok(void) const { return (m_refData != NULL) ; }
69
70 // Internal
71 bool RealizeResource(void);
72 WXHANDLE GetResourceHandle(void) ;
73 bool FreeResource(bool force = FALSE);
2bda0e17 74 bool IsFree(void);
b823f5a1 75 void Unshare();
2bda0e17
KB
76};
77
78#endif
bbcdf8bc 79 // _WX_BRUSH_H_