1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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"
15 #include "wx/statbmp.h"
17 #include "wx/cocoa/autorelease.h"
19 #import <AppKit/NSImageView.h>
21 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
22 BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl)
24 // WX_IMPLEMENT_COCOA_OWNER(wxStaticBitmap,NSTextField,NSControl,NSView)
26 bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
27 const wxBitmap& bitmap,
33 wxAutoNSAutoreleasePool pool;
34 if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
37 SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]);
38 [m_cocoaNSView release];
40 m_parent->CocoaAddChild(this);
41 SetInitialFrameRect(pos,size);
46 wxStaticBitmap::~wxStaticBitmap()
50 void wxStaticBitmap::SetIcon(const wxIcon& icon)
54 void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
58 wxBitmap wxStaticBitmap::GetBitmap() const