]> git.saurik.com Git - wxWidgets.git/blob - include/wx/custombgwin.h
Make wxRichTextRectArray usable by other parts of wxRTC
[wxWidgets.git] / include / wx / custombgwin.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/custombgwin.h
3 // Purpose: Class adding support for custom window backgrounds.
4 // Author: Vadim Zeitlin
5 // Created: 2011-10-10
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_CUSTOMBGWIN_H_
11 #define _WX_CUSTOMBGWIN_H_
12
13 // ----------------------------------------------------------------------------
14 // wxCustomBackgroundWindow: Adds support for custom backgrounds to any
15 // wxWindow-derived class.
16 // ----------------------------------------------------------------------------
17
18 class wxCustomBackgroundWindowBase
19 {
20 public:
21 // Trivial default ctor.
22 wxCustomBackgroundWindowBase() { }
23
24 // Also a trivial but virtual -- to suppress g++ warnings -- dtor.
25 virtual ~wxCustomBackgroundWindowBase() { }
26
27 // Use the given bitmap to tile the background of this window. This bitmap
28 // will show through any transparent children.
29 //
30 // Notice that you must not prevent the base class EVT_ERASE_BACKGROUND
31 // handler from running (i.e. not to handle this event yourself) for this
32 // to work.
33 void SetBackgroundBitmap(const wxBitmap& bmp)
34 {
35 DoSetBackgroundBitmap(bmp);
36 }
37
38 protected:
39 virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0;
40
41 wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase);
42 };
43
44 #if defined(__WXUNIVERSAL__)
45 #include "wx/univ/custombgwin.h"
46 #elif defined(__WXMSW__)
47 #include "wx/msw/custombgwin.h"
48 #else
49 #include "wx/generic/custombgwin.h"
50 #endif
51
52 #endif // _WX_CUSTOMBGWIN_H_