]>
Commit | Line | Data |
---|---|---|
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 | |
a30e7029 VZ |
6 | // Copyright: wxWidgets developers |
7 | // Licence: wxWindows licence | |
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #include "wx/wxprec.h" | |
11 | ||
12 | #if wxUSE_STATBMP | |
13 | ||
48e487e3 VZ |
14 | #ifndef WX_PRECOMP |
15 | #include "wx/dcclient.h" | |
16 | #endif | |
a30e7029 | 17 | |
48e487e3 | 18 | #include "wx/generic/statbmpg.h" |
a30e7029 | 19 | |
48e487e3 | 20 | bool wxGenericStaticBitmap::Create(wxWindow *parent, wxWindowID id, |
a30e7029 VZ |
21 | const wxBitmap& bitmap, |
22 | const wxPoint& pos, const wxSize& size, | |
23 | long style, const wxString& name) | |
24 | { | |
48e487e3 | 25 | if (! wxControl::Create(parent, id, pos, size, style, |
a30e7029 VZ |
26 | wxDefaultValidator, name)) |
27 | return false; | |
28 | SetBitmap(bitmap); | |
29 | Connect(wxEVT_PAINT, wxPaintEventHandler(wxGenericStaticBitmap::OnPaint)); | |
30 | return true; | |
31 | } | |
32 | ||
33 | void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event)) | |
34 | { | |
35 | wxPaintDC dc(this); | |
e75390d4 | 36 | if (m_bitmap.IsOk()) |
a30e7029 VZ |
37 | dc.DrawBitmap(m_bitmap, 0, 0, true); |
38 | } | |
39 | ||
65918917 SC |
40 | // under OSX_cocoa is a define, avoid duplicate info |
41 | #ifndef wxGenericStaticBitmap | |
42 | ||
43 | IMPLEMENT_DYNAMIC_CLASS(wxGenericStaticBitmap, wxStaticBitmapBase) | |
44 | ||
45 | #endif | |
46 | ||
a30e7029 VZ |
47 | #endif // wxUSE_STATBMP |
48 |