]> git.saurik.com Git - wxWidgets.git/blame - include/wx/custombgwin.h
synchronize GTK2 minimum version in docs
[wxWidgets.git] / include / wx / custombgwin.h
CommitLineData
bbcf2821
VZ
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
19class wxCustomBackgroundWindowBase
20{
21public:
22 // Trivial default ctor.
23 wxCustomBackgroundWindowBase() { }
24
ecb35373
VZ
25 // Also a trivial but virtual -- to suppress g++ warnings -- dtor.
26 virtual ~wxCustomBackgroundWindowBase() { }
27
bbcf2821
VZ
28 // Use the given bitmap to tile the background of this window. This bitmap
29 // will show through any transparent children.
30 //
31 // Notice that you must not prevent the base class EVT_ERASE_BACKGROUND
32 // handler from running (i.e. not to handle this event yourself) for this
33 // to work.
34 void SetBackgroundBitmap(const wxBitmap& bmp)
35 {
36 DoSetBackgroundBitmap(bmp);
37 }
38
39protected:
40 virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0;
41
42 wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase);
43};
44
45#if defined(__WXUNIVERSAL__)
46 #include "wx/univ/custombgwin.h"
47#elif defined(__WXMSW__)
48 #include "wx/msw/custombgwin.h"
49#else
50 #include "wx/generic/custombgwin.h"
51#endif
52
53#endif // _WX_CUSTOMBGWIN_H_