]> git.saurik.com Git - wxWidgets.git/blob - include/wx/custombgwin.h
latest private API usage complaint, right now most subclasses are using their own...
[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 // RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_CUSTOMBGWIN_H_
12 #define _WX_CUSTOMBGWIN_H_
13
14 // ----------------------------------------------------------------------------
15 // wxCustomBackgroundWindow: Adds support for custom backgrounds to any
16 // wxWindow-derived class.
17 // ----------------------------------------------------------------------------
18
19 class wxCustomBackgroundWindowBase
20 {
21 public:
22 // Trivial default ctor.
23 wxCustomBackgroundWindowBase() { }
24
25 // Use the given bitmap to tile the background of this window. This bitmap
26 // will show through any transparent children.
27 //
28 // Notice that you must not prevent the base class EVT_ERASE_BACKGROUND
29 // handler from running (i.e. not to handle this event yourself) for this
30 // to work.
31 void SetBackgroundBitmap(const wxBitmap& bmp)
32 {
33 DoSetBackgroundBitmap(bmp);
34 }
35
36 protected:
37 virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0;
38
39 wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase);
40 };
41
42 #if defined(__WXUNIVERSAL__)
43 #include "wx/univ/custombgwin.h"
44 #elif defined(__WXMSW__)
45 #include "wx/msw/custombgwin.h"
46 #else
47 #include "wx/generic/custombgwin.h"
48 #endif
49
50 #endif // _WX_CUSTOMBGWIN_H_