]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/statbmp.cpp
412e6511a39c58a628d176d75cf906481a947b73
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticBitmap
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 #include "wx/window.h"
16 #include "wx/os2/private.h"
20 #include "wx/statbmp.h"
25 // ---------------------------------------------------------------------------
27 // ---------------------------------------------------------------------------
29 #if !USE_SHARED_LIBRARY
30 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
33 // ---------------------------------------------------------------------------
35 // ---------------------------------------------------------------------------
37 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
38 const wxBitmap
& bitmap
,
44 m_messageBitmap
= bitmap
;
46 if (parent
) parent
->AddChild(this);
49 m_windowId
= (int)NewControlId();
53 m_windowStyle
= style
;
55 // TODO: create static bitmap control
59 bool wxStaticBitmap::ImageIsOk() const
61 if ( m_isIcon
&& m_image
.icon
)
62 return m_image
.icon
->Ok();
63 else if ( m_image
.bitmap
)
64 return m_image
.bitmap
->Ok();
69 void wxStaticBitmap::Free()
74 delete m_image
.bitmap
;
79 wxSize
wxStaticBitmap::DoGetBestSize()
81 // reuse the current size (as wxWindow does) instead of using some
82 // arbitrary default size (as wxControl, our immediate base class, does)
83 return wxWindow::DoGetBestSize();
86 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
90 m_isIcon
= bitmap
.IsKindOf(CLASSINFO(wxIcon
));
92 m_image
.icon
= new wxIcon((const wxIcon
&)bitmap
);
94 m_image
.bitmap
= new wxBitmap(bitmap
);
101 // TODO: redraw bitmap