]> git.saurik.com Git - wxWidgets.git/blame - src/generic/statbmpg.cpp
Make callback names consistent
[wxWidgets.git] / src / generic / statbmpg.cpp
CommitLineData
a30e7029 1///////////////////////////////////////////////////////////////////////////////
b4715d08 2// Name: src/generic/statbmpg.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 20
48e487e3 21bool wxGenericStaticBitmap::Create(wxWindow *parent, wxWindowID id,
a30e7029
VZ
22 const wxBitmap& bitmap,
23 const wxPoint& pos, const wxSize& size,
24 long style, const wxString& name)
25{
48e487e3 26 if (! wxControl::Create(parent, id, pos, size, style,
a30e7029
VZ
27 wxDefaultValidator, name))
28 return false;
29 SetBitmap(bitmap);
30 Connect(wxEVT_PAINT, wxPaintEventHandler(wxGenericStaticBitmap::OnPaint));
31 return true;
32}
33
34void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event))
35{
36 wxPaintDC dc(this);
e75390d4 37 if (m_bitmap.IsOk())
a30e7029
VZ
38 dc.DrawBitmap(m_bitmap, 0, 0, true);
39}
40
65918917
SC
41// under OSX_cocoa is a define, avoid duplicate info
42#ifndef wxGenericStaticBitmap
43
44IMPLEMENT_DYNAMIC_CLASS(wxGenericStaticBitmap, wxStaticBitmapBase)
45
46#endif
47
a30e7029
VZ
48#endif // wxUSE_STATBMP
49