git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19941
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-#define M_ICONDATA ((wxBitmapRefData *)m_refData)
-#define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
-
// Icon
class WXDLLEXPORT wxIcon: public wxBitmap
{
// Icon
class WXDLLEXPORT wxIcon: public wxBitmap
{
- DECLARE_DYNAMIC_CLASS(wxIcon)
+ DECLARE_DYNAMIC_CLASS(wxIcon);
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
- inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
- inline bool operator == (const wxIcon& icon) const { return m_refData == icon.m_refData; }
- inline bool operator != (const wxIcon& icon) const { return m_refData != icon.m_refData; }
-
- virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); }
+ inline wxIcon& operator = (const wxIcon& icon)
+ { if (*this == icon) return (*this); Ref(icon); return *this; }
+ inline bool operator == (const wxIcon& icon) const
+ { return m_refData == icon.m_refData; }
+ inline bool operator != (const wxIcon& icon) const
+ { return m_refData != icon.m_refData; }
int WXUNUSED(desiredHeight))
{
// M_BITMAPHANDLERDATA->m_freePixmap = TRUE;
int WXUNUSED(desiredHeight))
{
// M_BITMAPHANDLERDATA->m_freePixmap = TRUE;
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
int hotX, hotY;
unsigned int w, h;
int hotX, hotY;
unsigned int w, h;
long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth))
{
long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth))
{
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
+
M_BITMAPHANDLERDATA->m_width = width;
M_BITMAPHANDLERDATA->m_height = height;
M_BITMAPHANDLERDATA->m_depth = 1;
M_BITMAPHANDLERDATA->m_width = width;
M_BITMAPHANDLERDATA->m_height = height;
M_BITMAPHANDLERDATA->m_depth = 1;
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight) )
{
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight) )
{
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
+
Display *dpy = (Display*) wxGetDisplay();
M_BITMAPHANDLERDATA->m_display = (WXDisplay*) dpy;
Display *dpy = (Display*) wxGetDisplay();
M_BITMAPHANDLERDATA->m_display = (WXDisplay*) dpy;
long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth))
{
long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth))
{
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
+
M_BITMAPHANDLERDATA->m_width = width;
M_BITMAPHANDLERDATA->m_height = height;
M_BITMAPHANDLERDATA->m_depth = 1;
M_BITMAPHANDLERDATA->m_width = width;
M_BITMAPHANDLERDATA->m_height = height;
M_BITMAPHANDLERDATA->m_depth = 1;
#endif
#include "wx/icon.h"
#endif
#include "wx/icon.h"
-#ifdef __VMS__
-#pragma message disable nosimpint
-#endif
-#include <Xm/Xm.h>
-#include <X11/cursorfont.h>
-#ifdef __VMS__
-#pragma message enable nosimpint
-#endif
-
-#include "wx/motif/private.h"
-
-IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
+IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap);
+// ============================================================================
+// Icons
+// ============================================================================
int desiredWidth, int desiredHeight)
{
UnRef();
int desiredWidth, int desiredHeight)
{
UnRef();
-
- m_refData = new wxBitmapRefData;
-
wxBitmapHandler *handler = FindHandler(type);
if ( handler )
wxBitmapHandler *handler = FindHandler(type);
if ( handler )