]>
Commit | Line | Data |
---|---|---|
da0634c1 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cocoa/statbmp.mm | |
3 | // Purpose: wxStaticBitmap | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/02/15 | |
7 | // RCS-ID: $Id: | |
8 | // Copyright: (c) 2003 David Elliott | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
449c5673 DE |
12 | #include "wx/wxprec.h" |
13 | #ifndef WX_PRECOMP | |
14 | #include "wx/app.h" | |
15 | #include "wx/statbmp.h" | |
16 | #endif //WX_PRECOMP | |
9556c0f1 | 17 | #include "wx/cocoa/autorelease.h" |
da0634c1 | 18 | |
0ca6987d | 19 | #import <AppKit/NSImageView.h> |
a8c80eb1 | 20 | |
da0634c1 DE |
21 | IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) |
22 | BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl) | |
23 | END_EVENT_TABLE() | |
24 | // WX_IMPLEMENT_COCOA_OWNER(wxStaticBitmap,NSTextField,NSControl,NSView) | |
25 | ||
26 | bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid, | |
27 | const wxBitmap& bitmap, | |
28 | const wxPoint& pos, | |
29 | const wxSize& size, | |
30 | long style, | |
31 | const wxString& name) | |
32 | { | |
9556c0f1 | 33 | wxAutoNSAutoreleasePool pool; |
da0634c1 DE |
34 | if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name)) |
35 | return false; | |
36 | m_cocoaNSView = NULL; | |
0ca6987d | 37 | SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]); |
a8c80eb1 | 38 | [m_cocoaNSView release]; |
da0634c1 DE |
39 | if(m_parent) |
40 | m_parent->CocoaAddChild(this); | |
8d656ea9 DE |
41 | SetInitialFrameRect(pos,size); |
42 | ||
da0634c1 DE |
43 | return true; |
44 | } | |
45 | ||
46 | wxStaticBitmap::~wxStaticBitmap() | |
47 | { | |
da0634c1 DE |
48 | } |
49 | ||
50 | void wxStaticBitmap::SetIcon(const wxIcon& icon) | |
51 | { | |
52 | } | |
53 | ||
54 | void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) | |
55 | { | |
56 | } | |
57 | ||
58 | wxBitmap wxStaticBitmap::GetBitmap() const | |
59 | { | |
60 | return wxNullBitmap; | |
61 | } | |
62 |