]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/cocoa/statbmp.mm
Store property name and value in wxPropertyGridEvent, keep track of live event instan...
[wxWidgets.git] / src / cocoa / statbmp.mm
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/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: wxWidgets licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include "wx/wxprec.h"
13
14#include "wx/statbmp.h"
15
16#ifndef WX_PRECOMP
17 #include "wx/app.h"
18#endif //WX_PRECOMP
19
20#include "wx/cocoa/autorelease.h"
21
22#import <AppKit/NSImageView.h>
23
24IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
25
26BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl)
27END_EVENT_TABLE()
28// WX_IMPLEMENT_COCOA_OWNER(wxStaticBitmap,NSTextField,NSControl,NSView)
29
30bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
31 const wxBitmap& bitmap,
32 const wxPoint& pos,
33 const wxSize& size,
34 long style,
35 const wxString& name)
36{
37 wxAutoNSAutoreleasePool pool;
38 if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
39 return false;
40 SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]);
41 [m_cocoaNSView release];
42
43 [GetNSImageView() setImage:bitmap.GetNSImage(true)];
44 m_bitmap = bitmap;
45
46 if(m_parent)
47 m_parent->CocoaAddChild(this);
48 SetInitialFrameRect(pos,size);
49
50 return true;
51}
52
53wxStaticBitmap::~wxStaticBitmap()
54{
55}
56
57void wxStaticBitmap::SetIcon(const wxIcon& icon)
58{
59}
60
61void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
62{
63 [GetNSImageView() setImage:bitmap.GetNSImage(true)];
64 m_bitmap = bitmap;
65}
66
67wxBitmap wxStaticBitmap::GetBitmap() const
68{
69 return m_bitmap;
70}