]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/statbmp.cpp
wxMac (debug) builds and runs wxMinimal again
[wxWidgets.git] / src / mac / carbon / statbmp.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: statbmp.cpp
3// Purpose: wxStaticBitmap
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "statbmp.h"
14#endif
15
16#include "wx/statbmp.h"
17
18#if !USE_SHARED_LIBRARY
19IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
20#endif
21
22/*
23 * wxStaticBitmap
24 */
25
519cb848
SC
26BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl)
27 EVT_PAINT(wxStaticBitmap::OnPaint)
28END_EVENT_TABLE()
29
e9576ca5
SC
30bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
31 const wxBitmap& bitmap,
32 const wxPoint& pos,
33 const wxSize& size,
34 long style,
35 const wxString& name)
36{
37 m_messageBitmap = bitmap;
38 SetName(name);
39 if (parent) parent->AddChild(this);
40
41 if ( id == -1 )
42 m_windowId = (int)NewControlId();
43 else
44 m_windowId = id;
45
46 m_windowStyle = style;
47
519cb848
SC
48 bool ret = wxControl::Create( parent, id, pos, size, style , name );
49
50 return ret;
e9576ca5
SC
51}
52
53void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
54{
519cb848 55 wxControl::SetSize( x , y , width , height , sizeFlags ) ;
e9576ca5
SC
56}
57
58void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
59{
60 m_messageBitmap = bitmap;
61
519cb848
SC
62 Refresh() ;
63}
64void wxStaticBitmap::OnPaint( wxPaintEvent &event )
65{
66 wxPaintDC dc(this);
67 PrepareDC(dc);
68 dc.SetPalette( *m_messageBitmap.GetPalette() ) ;
69 dc.DrawBitmap( m_messageBitmap , 0 , 0 ) ;
e9576ca5
SC
70}
71