1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/cocoa/statbmp.mm
3 // Purpose: wxStaticBitmap
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWidgets licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/statbmp.h"
20 #include "wx/cocoa/autorelease.h"
22 #import <AppKit/NSImageView.h>
24 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
26 BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl)
28 // WX_IMPLEMENT_COCOA_OWNER(wxStaticBitmap,NSTextField,NSControl,NSView)
30 bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
31 const wxBitmap& bitmap,
37 wxAutoNSAutoreleasePool pool;
38 if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
41 SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]);
42 [m_cocoaNSView release];
44 m_parent->CocoaAddChild(this);
45 SetInitialFrameRect(pos,size);
50 wxStaticBitmap::~wxStaticBitmap()
54 void wxStaticBitmap::SetIcon(const wxIcon& icon)
58 void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
62 wxBitmap wxStaticBitmap::GetBitmap() const