]> git.saurik.com Git - wxWidgets.git/blame - src/generic/statbmpg.cpp
added EVT_HEADER_DRAGGING_CANCELLED event sent when either resizing or reordering...
[wxWidgets.git] / src / generic / statbmpg.cpp
CommitLineData
a30e7029
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: src/generic/statbmp.cpp
48e487e3 3// Purpose: wxGenericStaticBitmap
a30e7029
VZ
4// Author: Marcin Wojdyr, Stefan Csomor
5// Created: 2008-06-16
6// RCS-ID: $Id$
7// Copyright: wxWidgets developers
8// Licence: wxWindows licence
9///////////////////////////////////////////////////////////////////////////////
10
11#include "wx/wxprec.h"
12
13#if wxUSE_STATBMP
14
48e487e3
VZ
15#ifndef WX_PRECOMP
16 #include "wx/dcclient.h"
17#endif
a30e7029 18
48e487e3 19#include "wx/generic/statbmpg.h"
a30e7029
VZ
20
21IMPLEMENT_DYNAMIC_CLASS(wxGenericStaticBitmap, wxStaticBitmapBase)
22
48e487e3 23bool wxGenericStaticBitmap::Create(wxWindow *parent, wxWindowID id,
a30e7029
VZ
24 const wxBitmap& bitmap,
25 const wxPoint& pos, const wxSize& size,
26 long style, const wxString& name)
27{
48e487e3 28 if (! wxControl::Create(parent, id, pos, size, style,
a30e7029
VZ
29 wxDefaultValidator, name))
30 return false;
31 SetBitmap(bitmap);
32 Connect(wxEVT_PAINT, wxPaintEventHandler(wxGenericStaticBitmap::OnPaint));
33 return true;
34}
35
36void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event))
37{
38 wxPaintDC dc(this);
39 PrepareDC(dc);
40 if (m_bitmap.Ok())
41 dc.DrawBitmap(m_bitmap, 0, 0, true);
42}
43
44#endif // wxUSE_STATBMP
45