Fixes and Cleanup
This commit is contained in:
committed by
Vadim Zeitlin
parent
e7d21f6638
commit
84f68aa764
@@ -224,9 +224,12 @@ public:
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
|
||||
|
||||
// implementation:
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
// deprecated
|
||||
virtual void SetHeight(int height) = 0;
|
||||
virtual void SetWidth(int width) = 0;
|
||||
virtual void SetDepth(int depth) = 0;
|
||||
#endif
|
||||
|
||||
// Format handling
|
||||
static inline wxList& GetHandlers() { return sm_handlers; }
|
||||
|
@@ -175,13 +175,11 @@ public:
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetWidth(int w);
|
||||
void SetWidth(int width);
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetHeight(int h);
|
||||
void SetHeight(int height);
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetDepth(int d);
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetOk(bool isOk);
|
||||
void SetDepth(int depth);
|
||||
#endif
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
|
@@ -44,10 +44,14 @@ public:
|
||||
int GetWidth() const;
|
||||
int GetHeight() const;
|
||||
int GetDepth() const;
|
||||
void SetWidth(int w);
|
||||
void SetHeight(int h);
|
||||
void SetDepth(int d);
|
||||
void SetOk(bool isOk);
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetWidth(int width);
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetHeight(int height);
|
||||
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
|
||||
void SetDepth(int depth);
|
||||
#endif
|
||||
|
||||
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
|
||||
|
||||
|
@@ -24,22 +24,22 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxIcon, wxGDIObject);
|
||||
|
||||
#define M_ICONDATA ((wxIconRefData *)m_refData)
|
||||
|
||||
#define wxOSX_ICON_USE_NSIMAGE wxOSX_BITMAP_NATIVE_ACCESS
|
||||
|
||||
#if wxOSX_ICON_USE_NSIMAGE
|
||||
|
||||
// implementation based on NSImage
|
||||
|
||||
class WXDLLEXPORT wxIconRefData : public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
wxIconRefData() { Init(); }
|
||||
#if wxOSX_USE_ICONREF
|
||||
wxIconRefData( WXHICON iconref, int desiredWidth, int desiredHeight );
|
||||
#else
|
||||
wxIconRefData( WX_NSImage image, int desiredWidth, int desiredHeight );
|
||||
#endif
|
||||
wxIconRefData( WXHICON iconref, int desiredWidth, int desiredHeight );
|
||||
|
||||
virtual ~wxIconRefData() { Free(); }
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
virtual bool IsOk() const wxOVERRIDE { return m_iconRef != NULL; }
|
||||
#else
|
||||
virtual bool IsOk() const wxOVERRIDE { return m_nsImage != NULL; }
|
||||
#endif
|
||||
virtual void Free();
|
||||
|
||||
void SetWidth( int width ) { m_width = width; }
|
||||
@@ -48,22 +48,13 @@ public:
|
||||
int GetWidth() const { return m_width; }
|
||||
int GetHeight() const { return m_height; }
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
WXHICON GetHICON() const { return (WXHICON) m_iconRef; }
|
||||
#endif
|
||||
#if wxOSX_USE_COCOA
|
||||
WX_NSImage GetNSImage() const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void Create( NSImage* icon, int desiredWidth, int desiredHeight );
|
||||
NSImage* m_nsImage;
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
IconRef m_iconRef;
|
||||
#endif
|
||||
#if wxOSX_USE_COCOA
|
||||
mutable NSImage* m_nsImage;
|
||||
#endif
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
@@ -71,21 +62,24 @@ private:
|
||||
wxDECLARE_NO_COPY_CLASS(wxIconRefData);
|
||||
};
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
wxIconRefData::wxIconRefData( WXHICON icon, int desiredWidth, int desiredHeight )
|
||||
{
|
||||
Init();
|
||||
m_iconRef = (IconRef)( icon ) ;
|
||||
|
||||
// Standard sizes
|
||||
SetWidth( desiredWidth == -1 ? 32 : desiredWidth ) ;
|
||||
SetHeight( desiredHeight == -1 ? 32 : desiredHeight ) ;
|
||||
}
|
||||
#else
|
||||
wxIconRefData::wxIconRefData( NSImage* icon, int desiredWidth, int desiredHeight )
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(icon, desiredWidth, desiredHeight);
|
||||
}
|
||||
|
||||
wxIconRefData::wxIconRefData( WXHICON iconref, int desiredWidth, int desiredHeight )
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(wxOSXGetNSImageFromIconRef(iconref), desiredWidth, desiredHeight);
|
||||
ReleaseIconRef(iconref);
|
||||
}
|
||||
|
||||
void wxIconRefData::Create( NSImage* icon, int desiredWidth, int desiredHeight )
|
||||
{
|
||||
if ( icon )
|
||||
{
|
||||
m_nsImage = icon;
|
||||
@@ -96,53 +90,113 @@ wxIconRefData::wxIconRefData( NSImage* icon, int desiredWidth, int desiredHeight
|
||||
SetWidth( desiredWidth == -1 ? 32 : desiredWidth ) ;
|
||||
SetHeight( desiredHeight == -1 ? 32 : desiredHeight ) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxIconRefData::Init()
|
||||
{
|
||||
#if wxOSX_USE_ICONREF
|
||||
m_iconRef = NULL ;
|
||||
#endif
|
||||
#if wxOSX_USE_COCOA
|
||||
m_nsImage = NULL;
|
||||
#endif
|
||||
m_width =
|
||||
m_height = 0;
|
||||
}
|
||||
|
||||
void wxIconRefData::Free()
|
||||
{
|
||||
#if wxOSX_USE_ICONREF
|
||||
if ( m_nsImage )
|
||||
{
|
||||
wxMacCocoaRelease(m_nsImage);
|
||||
}
|
||||
}
|
||||
|
||||
WX_NSImage wxIconRefData::GetNSImage() const
|
||||
{
|
||||
wxASSERT( IsOk() );
|
||||
|
||||
return m_nsImage;
|
||||
}
|
||||
|
||||
#else // !wxOSX_ICON_USE_NSIMAGE
|
||||
|
||||
// implementation based on IconRef
|
||||
|
||||
class WXDLLEXPORT wxIconRefData : public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
wxIconRefData() { Init(); }
|
||||
wxIconRefData( WXHICON iconref, int desiredWidth, int desiredHeight );
|
||||
virtual ~wxIconRefData() { Free(); }
|
||||
|
||||
virtual bool IsOk() const wxOVERRIDE { return m_iconRef != NULL; }
|
||||
virtual void Free();
|
||||
|
||||
void SetWidth( int width ) { m_width = width; }
|
||||
void SetHeight( int height ) { m_height = height; }
|
||||
|
||||
int GetWidth() const { return m_width; }
|
||||
int GetHeight() const { return m_height; }
|
||||
|
||||
WXHICON GetHICON() const { return (WXHICON) m_iconRef; }
|
||||
|
||||
WX_NSImage GetNSImage() const;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
IconRef m_iconRef;
|
||||
|
||||
mutable NSImage* m_nsImage;
|
||||
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
// We can (easily) copy m_iconRef so we don't implement the copy ctor.
|
||||
wxDECLARE_NO_COPY_CLASS(wxIconRefData);
|
||||
};
|
||||
|
||||
wxIconRefData::wxIconRefData( WXHICON icon, int desiredWidth, int desiredHeight )
|
||||
{
|
||||
Init();
|
||||
m_iconRef = (IconRef)( icon ) ;
|
||||
|
||||
// Standard sizes
|
||||
SetWidth( desiredWidth == -1 ? 32 : desiredWidth ) ;
|
||||
SetHeight( desiredHeight == -1 ? 32 : desiredHeight ) ;
|
||||
}
|
||||
|
||||
void wxIconRefData::Init()
|
||||
{
|
||||
m_iconRef = NULL ;
|
||||
m_nsImage = NULL;
|
||||
|
||||
m_width =
|
||||
m_height = 0;
|
||||
}
|
||||
|
||||
void wxIconRefData::Free()
|
||||
{
|
||||
if ( m_iconRef )
|
||||
{
|
||||
ReleaseIconRef( m_iconRef ) ;
|
||||
m_iconRef = NULL ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
if ( m_nsImage )
|
||||
{
|
||||
wxMacCocoaRelease(m_nsImage);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
WX_NSImage wxIconRefData::GetNSImage() const
|
||||
{
|
||||
wxASSERT( IsOk() );
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
if ( m_nsImage == 0 )
|
||||
{
|
||||
m_nsImage = wxOSXGetNSImageFromIconRef(m_iconRef);
|
||||
CFRetain(m_nsImage);
|
||||
}
|
||||
#endif
|
||||
|
||||
return m_nsImage;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -182,6 +236,13 @@ wxIcon::wxIcon(WXHICON icon, const wxSize& size)
|
||||
|
||||
m_refData = new wxIconRefData( icon, size.x, size.y ) ;
|
||||
}
|
||||
|
||||
WXHICON wxIcon::GetHICON() const
|
||||
{
|
||||
wxASSERT( IsOk() ) ;
|
||||
|
||||
return (WXHICON) ((wxIconRefData*)m_refData)->GetHICON() ;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxIcon::~wxIcon()
|
||||
@@ -201,15 +262,6 @@ wxIcon::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const
|
||||
return new wxIconRefData;
|
||||
}
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
WXHICON wxIcon::GetHICON() const
|
||||
{
|
||||
wxASSERT( IsOk() ) ;
|
||||
|
||||
return (WXHICON) ((wxIconRefData*)m_refData)->GetHICON() ;
|
||||
}
|
||||
#endif
|
||||
|
||||
int wxIcon::GetWidth() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid icon") );
|
||||
@@ -229,15 +281,14 @@ int wxIcon::GetDepth() const
|
||||
return 32;
|
||||
}
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
WX_NSImage wxIcon::GetNSImage() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid icon") );
|
||||
|
||||
return M_ICONDATA->GetNSImage() ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
void wxIcon::SetDepth( int WXUNUSED(depth) )
|
||||
{
|
||||
}
|
||||
@@ -249,6 +300,7 @@ void wxIcon::SetWidth( int WXUNUSED(width) )
|
||||
void wxIcon::SetHeight( int WXUNUSED(height) )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
// Load an icon based on resource name or filel name
|
||||
// Return true on success, false otherwise
|
||||
@@ -279,7 +331,6 @@ bool wxIcon::LoadIconFromSystemResource(const wxString& resourceName, int desire
|
||||
{
|
||||
UnRef();
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
OSType theId = 0 ;
|
||||
|
||||
if ( resourceName == wxT("wxICON_INFORMATION") )
|
||||
@@ -368,13 +419,10 @@ bool wxIcon::LoadIconFromSystemResource(const wxString& resourceName, int desire
|
||||
IconRef iconRef = NULL ;
|
||||
__Verify_noErr(GetIconRef( kOnSystemDisk, kSystemIconsCreator, theId, &iconRef )) ;
|
||||
if ( iconRef )
|
||||
{
|
||||
m_refData = new wxIconRefData( (WXHICON) iconRef, desiredWidth, desiredHeight ) ;
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
|
||||
return IsOk();
|
||||
}
|
||||
|
||||
// Load an icon of type 'icns' by resource by name
|
||||
@@ -528,7 +576,9 @@ void wxIcon::CopyFromBitmap( const wxBitmap& bmp )
|
||||
{
|
||||
UnRef() ;
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
#if wxOSX_ICON_USE_NSIMAGE
|
||||
m_refData = new wxIconRefData( bmp.GetNSImage() , bmp.GetWidth(), bmp.GetHeight() ) ;
|
||||
#else
|
||||
// as the bitmap owns that ref, we have to acquire it as well
|
||||
|
||||
int w = bmp.GetWidth() ;
|
||||
@@ -544,8 +594,6 @@ void wxIcon::CopyFromBitmap( const wxBitmap& bmp )
|
||||
{
|
||||
m_refData = new wxIconRefData( (WXHICON) bmp.CreateIconRef() , bmp.GetWidth(), bmp.GetHeight() ) ;
|
||||
}
|
||||
#else
|
||||
m_refData = new wxIconRefData( bmp.GetNSImage() , bmp.GetWidth(), bmp.GetHeight() ) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -60,16 +60,22 @@ public:
|
||||
virtual bool IsOk() const wxOVERRIDE { return m_ok; }
|
||||
|
||||
void Free();
|
||||
void SetOk( bool isOk) { m_ok = isOk; }
|
||||
|
||||
#if wxOSX_BITMAP_NATIVE_ACCESS
|
||||
int GetWidth() const { return CGBitmapContextGetWidth(m_hBitmap); }
|
||||
int GetHeight() const { return CGBitmapContextGetHeight(m_hBitmap); }
|
||||
int GetDepth() const { return CGBitmapContextGetBitsPerPixel(m_hBitmap); }
|
||||
int GetBytesPerRow() const { return CGBitmapContextGetBytesPerRow(m_hBitmap); }
|
||||
bool HasAlpha() const {
|
||||
int GetWidth() const
|
||||
{ return CGBitmapContextGetWidth(m_hBitmap); }
|
||||
int GetHeight() const
|
||||
{ return CGBitmapContextGetHeight(m_hBitmap); }
|
||||
int GetDepth() const
|
||||
{ return CGBitmapContextGetBitsPerPixel(m_hBitmap); }
|
||||
int GetBytesPerRow() const
|
||||
{ return CGBitmapContextGetBytesPerRow(m_hBitmap); }
|
||||
bool HasAlpha() const
|
||||
{
|
||||
CGImageAlphaInfo alpha = CGBitmapContextGetAlphaInfo(m_hBitmap);
|
||||
return !( alpha == kCGImageAlphaNone || alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast) ;
|
||||
return !(alpha == kCGImageAlphaNone ||
|
||||
alpha == kCGImageAlphaNoneSkipFirst ||
|
||||
alpha == kCGImageAlphaNoneSkipLast);
|
||||
}
|
||||
#else
|
||||
void SetWidth( int width ) { m_width = width; }
|
||||
@@ -109,12 +115,10 @@ public:
|
||||
// rescaled to 16 x 16
|
||||
bool HasNativeSize();
|
||||
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
#if wxOSX_USE_ICONREF
|
||||
// caller should increase ref count if needed longer
|
||||
// than the bitmap exists
|
||||
IconRef GetIconRef();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CGContextRef GetBitmapContext() const;
|
||||
@@ -127,6 +131,7 @@ private :
|
||||
bool Create( CGImageRef image, double scale );
|
||||
bool Create( CGContextRef bitmapcontext);
|
||||
void Init();
|
||||
void FreeDerivedRepresentations();
|
||||
|
||||
#if !wxOSX_BITMAP_NATIVE_ACCESS
|
||||
int m_width;
|
||||
@@ -141,10 +146,8 @@ private :
|
||||
mutable CGImageRef m_cgImageRef;
|
||||
bool m_isTemplate;
|
||||
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
#if wxOSX_USE_ICONREF
|
||||
IconRef m_iconRef;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
wxCFRef<CGContextRef> m_hBitmap;
|
||||
@@ -190,10 +193,8 @@ void wxBitmapRefData::Init()
|
||||
m_cgImageRef = NULL ;
|
||||
m_isTemplate = false;
|
||||
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
#if wxOSX_USE_ICONREF
|
||||
m_iconRef = NULL ;
|
||||
#endif
|
||||
#endif
|
||||
m_hBitmap = NULL ;
|
||||
|
||||
@@ -391,7 +392,7 @@ void wxBitmapRefData::UseAlpha( bool use )
|
||||
#endif
|
||||
wxASSERT_MSG( hBitmap , wxT("Unable to create CGBitmapContext context") ) ;
|
||||
CGContextTranslateCTM( hBitmap, 0, GetHeight() );
|
||||
CGContextScaleCTM( hBitmap, 1*GetScaleFactor(), -1*GetScaleFactor() );
|
||||
CGContextScaleCTM( hBitmap, GetScaleFactor(), -GetScaleFactor() );
|
||||
|
||||
m_hBitmap.reset(hBitmap);
|
||||
}
|
||||
@@ -408,13 +409,7 @@ const void *wxBitmapRefData::GetRawAccess() const
|
||||
|
||||
void *wxBitmapRefData::GetRawAccess()
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), NULL , wxT("invalid bitmap") ) ;
|
||||
wxASSERT_MSG( m_rawAccessCount == 1, "Direct write access must be within Begin/EndRawAccess" ) ;
|
||||
#if !wxOSX_BITMAP_NATIVE_ACCESS
|
||||
return m_memBuf.GetData() ;
|
||||
#else
|
||||
return CGBitmapContextGetData(m_hBitmap);
|
||||
#endif
|
||||
return const_cast<void*>(const_cast<const wxBitmapRefData*>(this)->GetRawAccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -422,21 +417,17 @@ void *wxBitmapRefData::BeginRawAccess()
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ) ;
|
||||
wxASSERT( m_rawAccessCount == 0 ) ;
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
|
||||
#if wxOSX_USE_ICONREF
|
||||
wxASSERT_MSG( m_iconRef == NULL ,
|
||||
wxT("Currently, modifing bitmaps that are used in controls already is not supported") ) ;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
++m_rawAccessCount ;
|
||||
|
||||
// we must destroy an existing cached image, as
|
||||
// the bitmap data may change now
|
||||
if ( m_cgImageRef )
|
||||
{
|
||||
CGImageRelease( m_cgImageRef ) ;
|
||||
m_cgImageRef = NULL ;
|
||||
}
|
||||
FreeDerivedRepresentations();
|
||||
|
||||
return GetRawAccess() ;
|
||||
}
|
||||
@@ -458,7 +449,6 @@ bool wxBitmapRefData::HasNativeSize()
|
||||
return ( sz == 128 || sz == 48 || sz == 32 || sz == 16 );
|
||||
}
|
||||
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
#if wxOSX_USE_ICONREF
|
||||
IconRef wxBitmapRefData::GetIconRef()
|
||||
{
|
||||
@@ -671,8 +661,7 @@ IconRef wxBitmapRefData::GetIconRef()
|
||||
|
||||
return m_iconRef ;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // wxOSX_USE_ICONREF
|
||||
|
||||
CGImageRef wxBitmapRefData::CreateCGImage() const
|
||||
{
|
||||
@@ -821,25 +810,28 @@ wxDC *wxBitmapRefData::GetSelectedInto() const
|
||||
return m_selectedInto;
|
||||
}
|
||||
|
||||
|
||||
void wxBitmapRefData::Free()
|
||||
void wxBitmapRefData::FreeDerivedRepresentations()
|
||||
{
|
||||
wxASSERT_MSG( m_rawAccessCount == 0 , wxT("Bitmap still selected when destroyed") ) ;
|
||||
|
||||
if ( m_cgImageRef )
|
||||
{
|
||||
CGImageRelease( m_cgImageRef ) ;
|
||||
m_cgImageRef = NULL ;
|
||||
}
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
#if wxOSX_USE_ICONREF
|
||||
if ( m_iconRef )
|
||||
{
|
||||
ReleaseIconRef( m_iconRef ) ;
|
||||
m_iconRef = NULL ;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // wxOSX_USE_ICONREF
|
||||
}
|
||||
|
||||
void wxBitmapRefData::Free()
|
||||
{
|
||||
wxASSERT_MSG( m_rawAccessCount == 0 , wxT("Bitmap still selected when destroyed") ) ;
|
||||
|
||||
FreeDerivedRepresentations();
|
||||
|
||||
m_hBitmap.reset();
|
||||
wxDELETE(m_bitmapMask);
|
||||
}
|
||||
@@ -1479,6 +1471,7 @@ bool wxBitmap::HasAlpha() const
|
||||
return GetBitmapData()->HasAlpha() ;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
void wxBitmap::SetWidth(int w)
|
||||
{
|
||||
AllocExclusive();
|
||||
@@ -1496,12 +1489,7 @@ void wxBitmap::SetDepth(int d)
|
||||
AllocExclusive();
|
||||
wxASSERT_MSG( d == -1 || GetDepth() == d, "Changing the bitmap depth is not supported");
|
||||
}
|
||||
|
||||
void wxBitmap::SetOk(bool isOk)
|
||||
{
|
||||
AllocExclusive();
|
||||
GetBitmapData()->SetOk(isOk);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette *wxBitmap::GetPalette() const
|
||||
|
@@ -74,7 +74,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
||||
{
|
||||
wxASSERT_MSG( !bitmap.GetSelectedInto() ||
|
||||
(bitmap.GetSelectedInto() == GetOwner()),
|
||||
wxT("Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)") );
|
||||
"Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)" );
|
||||
|
||||
m_selected.SetSelectedInto(GetOwner());
|
||||
m_width = bitmap.GetScaledWidth();
|
||||
|
Reference in New Issue
Block a user