Implement wxStaticBitmap.
Copyright 2007 Software 2000 Ltd. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
#ifndef __WX_COCOA_STATBMP_H__
|
#ifndef __WX_COCOA_STATBMP_H__
|
||||||
#define __WX_COCOA_STATBMP_H__
|
#define __WX_COCOA_STATBMP_H__
|
||||||
|
|
||||||
// #include "wx/cocoa/NSxxx.h"
|
DECLARE_WXCOCOA_OBJC_CLASS(NSImageView);
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
// wxStaticBitmap
|
// wxStaticBitmap
|
||||||
@@ -46,6 +46,9 @@ public:
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Cocoa specifics
|
// Cocoa specifics
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
WX_NSImageView GetNSImageView() { return (WX_NSImageView)m_cocoaNSView; }
|
||||||
|
wxBitmap m_bitmap;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Implementation
|
// Implementation
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
@@ -37,9 +37,12 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
|
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
|
||||||
return false;
|
return false;
|
||||||
m_cocoaNSView = NULL;
|
|
||||||
SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
[m_cocoaNSView release];
|
[m_cocoaNSView release];
|
||||||
|
|
||||||
|
[GetNSImageView() setImage:bitmap.GetNSImage(true)];
|
||||||
|
m_bitmap = bitmap;
|
||||||
|
|
||||||
if(m_parent)
|
if(m_parent)
|
||||||
m_parent->CocoaAddChild(this);
|
m_parent->CocoaAddChild(this);
|
||||||
SetInitialFrameRect(pos,size);
|
SetInitialFrameRect(pos,size);
|
||||||
@@ -57,9 +60,11 @@ void wxStaticBitmap::SetIcon(const wxIcon& icon)
|
|||||||
|
|
||||||
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
||||||
{
|
{
|
||||||
|
[GetNSImageView() setImage:bitmap.GetNSImage(true)];
|
||||||
|
m_bitmap = bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBitmap wxStaticBitmap::GetBitmap() const
|
wxBitmap wxStaticBitmap::GetBitmap() const
|
||||||
{
|
{
|
||||||
return wxNullBitmap;
|
return m_bitmap;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user