1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/custombgwin.h
3 // Purpose: Class adding support for custom window backgrounds.
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_CUSTOMBGWIN_H_
11 #define _WX_CUSTOMBGWIN_H_
13 // ----------------------------------------------------------------------------
14 // wxCustomBackgroundWindow: Adds support for custom backgrounds to any
15 // wxWindow-derived class.
16 // ----------------------------------------------------------------------------
18 class wxCustomBackgroundWindowBase
21 // Trivial default ctor.
22 wxCustomBackgroundWindowBase() { }
24 // Also a trivial but virtual -- to suppress g++ warnings -- dtor.
25 virtual ~wxCustomBackgroundWindowBase() { }
27 // Use the given bitmap to tile the background of this window. This bitmap
28 // will show through any transparent children.
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
33 void SetBackgroundBitmap(const wxBitmap
& bmp
)
35 DoSetBackgroundBitmap(bmp
);
39 virtual void DoSetBackgroundBitmap(const wxBitmap
& bmp
) = 0;
41 wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase
);
44 #if defined(__WXUNIVERSAL__)
45 #include "wx/univ/custombgwin.h"
46 #elif defined(__WXMSW__)
47 #include "wx/msw/custombgwin.h"
49 #include "wx/generic/custombgwin.h"
52 #endif // _WX_CUSTOMBGWIN_H_