introduced wxICON_DEFAULT_TYPE and wxBITMAP_DEFAULT_TYPE; documented these default argument values; matched the wxBitmap and wxIcon interfaces to their real implementations; revised icon.h interface header
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -226,27 +226,41 @@ protected:
|
|||||||
|
|
||||||
#endif // wxUSE_BITMAP_BASE
|
#endif // wxUSE_BITMAP_BASE
|
||||||
|
|
||||||
|
|
||||||
|
// the wxBITMAP_DEFAULT_TYPE constant defines the default argument value
|
||||||
|
// for wxBitmap's ctor and wxBitmap::LoadFile() functions.
|
||||||
#if defined(__WXPALMOS__)
|
#if defined(__WXPALMOS__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
|
||||||
#include "wx/palmos/bitmap.h"
|
#include "wx/palmos/bitmap.h"
|
||||||
#elif defined(__WXMSW__)
|
#elif defined(__WXMSW__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
|
||||||
#include "wx/msw/bitmap.h"
|
#include "wx/msw/bitmap.h"
|
||||||
#elif defined(__WXMOTIF__)
|
#elif defined(__WXMOTIF__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
|
||||||
#include "wx/x11/bitmap.h"
|
#include "wx/x11/bitmap.h"
|
||||||
#elif defined(__WXGTK20__)
|
#elif defined(__WXGTK20__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
|
||||||
#include "wx/gtk/bitmap.h"
|
#include "wx/gtk/bitmap.h"
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
|
||||||
#include "wx/gtk1/bitmap.h"
|
#include "wx/gtk1/bitmap.h"
|
||||||
#elif defined(__WXX11__)
|
#elif defined(__WXX11__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
|
||||||
#include "wx/x11/bitmap.h"
|
#include "wx/x11/bitmap.h"
|
||||||
#elif defined(__WXMGL__)
|
#elif defined(__WXMGL__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE
|
||||||
#include "wx/mgl/bitmap.h"
|
#include "wx/mgl/bitmap.h"
|
||||||
#elif defined(__WXDFB__)
|
#elif defined(__WXDFB__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE
|
||||||
#include "wx/dfb/bitmap.h"
|
#include "wx/dfb/bitmap.h"
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_PICT_RESOURCE
|
||||||
#include "wx/osx/bitmap.h"
|
#include "wx/osx/bitmap.h"
|
||||||
#elif defined(__WXCOCOA__)
|
#elif defined(__WXCOCOA__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
|
||||||
#include "wx/cocoa/bitmap.h"
|
#include "wx/cocoa/bitmap.h"
|
||||||
#elif defined(__WXPM__)
|
#elif defined(__WXPM__)
|
||||||
|
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
|
||||||
#include "wx/os2/bitmap.h"
|
#include "wx/os2/bitmap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
// Initialize with XPM data
|
// Initialize with XPM data
|
||||||
wxBitmap(const char* const* bits);
|
wxBitmap(const char* const* bits);
|
||||||
// Load a file or resource
|
// Load a file or resource
|
||||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
// Construct from Cocoa's NSImage
|
// Construct from Cocoa's NSImage
|
||||||
wxBitmap(NSImage* cocoaNSImage);
|
wxBitmap(NSImage* cocoaNSImage);
|
||||||
// Construct from Cocoa's NSBitmapImageRep
|
// Construct from Cocoa's NSBitmapImageRep
|
||||||
@@ -104,7 +104,7 @@ public:
|
|||||||
bool Create(NSImage* cocoaNSImage);
|
bool Create(NSImage* cocoaNSImage);
|
||||||
bool Create(NSBitmapImageRep* cocoaNSBitmapImageRep);
|
bool Create(NSBitmapImageRep* cocoaNSBitmapImageRep);
|
||||||
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
||||||
|
|
||||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||||
|
@@ -28,7 +28,7 @@ public:
|
|||||||
wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); }
|
wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); }
|
||||||
wxBitmap(int width, int height, int depth = -1);
|
wxBitmap(int width, int height, int depth = -1);
|
||||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
|
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
wxBitmap(const char* const* bits);
|
wxBitmap(const char* const* bits);
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
wxBitmap(const wxImage& image, int depth = -1);
|
wxBitmap(const wxImage& image, int depth = -1);
|
||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
|
|
||||||
virtual bool SaveFile(const wxString &name, wxBitmapType type,
|
virtual bool SaveFile(const wxString &name, wxBitmapType type,
|
||||||
const wxPalette *palette = (wxPalette *) NULL) const;
|
const wxPalette *palette = (wxPalette *) NULL) const;
|
||||||
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
|
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
virtual wxPalette *GetPalette() const;
|
virtual wxPalette *GetPalette() const;
|
||||||
|
@@ -18,10 +18,6 @@
|
|||||||
// wxIcon
|
// wxIcon
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef wxICON_DEFAULT_BITMAP_TYPE
|
|
||||||
#define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_XPM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
|
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -35,7 +31,7 @@ public:
|
|||||||
// For compatibility with wxMSW where desired size is sometimes required to
|
// For compatibility with wxMSW where desired size is sometimes required to
|
||||||
// distinguish between multiple icons in a resource.
|
// distinguish between multiple icons in a resource.
|
||||||
wxIcon( const wxString& filename,
|
wxIcon( const wxString& filename,
|
||||||
wxBitmapType type = wxICON_DEFAULT_BITMAP_TYPE,
|
wxBitmapType type = wxICON_DEFAULT_TYPE,
|
||||||
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
|
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
|
||||||
wxBitmap(filename, type)
|
wxBitmap(filename, type)
|
||||||
{
|
{
|
||||||
@@ -46,6 +42,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LoadFile(const wxString& name, wxBitmapType flags = wxICON_DEFAULT_TYPE,
|
||||||
|
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1)
|
||||||
|
{ return LoadFile(name, flags); }
|
||||||
|
|
||||||
// create from bitmap (which should have a mask unless it's monochrome):
|
// create from bitmap (which should have a mask unless it's monochrome):
|
||||||
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
||||||
// ctors, assignment operators...), but it's ok to have such function
|
// ctors, assignment operators...), but it's ok to have such function
|
||||||
|
@@ -59,7 +59,7 @@ public:
|
|||||||
wxBitmap(char** data)
|
wxBitmap(char** data)
|
||||||
{ *this = wxBitmap(wx_const_cast(const char* const*, data)); }
|
{ *this = wxBitmap(wx_const_cast(const char* const*, data)); }
|
||||||
#endif
|
#endif
|
||||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
wxBitmap( const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH )
|
wxBitmap( const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH )
|
||||||
{ (void)CreateFromImage(image, depth); }
|
{ (void)CreateFromImage(image, depth); }
|
||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
|
|
||||||
bool SaveFile(const wxString &name, wxBitmapType type,
|
bool SaveFile(const wxString &name, wxBitmapType type,
|
||||||
const wxPalette *palette = (wxPalette *)NULL) const;
|
const wxPalette *palette = (wxPalette *)NULL) const;
|
||||||
bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
wxPalette *GetPalette() const;
|
wxPalette *GetPalette() const;
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
*this = wxBitmap(wx_const_cast(const char* const*, data));
|
*this = wxBitmap(wx_const_cast(const char* const*, data));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
|
||||||
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
||||||
virtual ~wxBitmap();
|
virtual ~wxBitmap();
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ public:
|
|||||||
|
|
||||||
bool SaveFile(const wxString &name, wxBitmapType type,
|
bool SaveFile(const wxString &name, wxBitmapType type,
|
||||||
const wxPalette *palette = (wxPalette *)NULL) const;
|
const wxPalette *palette = (wxPalette *)NULL) const;
|
||||||
bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
wxPalette *GetPalette() const;
|
wxPalette *GetPalette() const;
|
||||||
|
@@ -14,6 +14,23 @@
|
|||||||
|
|
||||||
#include "wx/iconloc.h"
|
#include "wx/iconloc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// the wxICON_DEFAULT_TYPE (the wxIcon equivalent of wxBITMAP_DEFAULT_TYPE)
|
||||||
|
// constant defines the default argument value for wxIcon ctor and wxIcon::LoadFile()
|
||||||
|
// functions.
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE
|
||||||
|
#elif defined(__WXMGL__)
|
||||||
|
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE
|
||||||
|
#elif defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON
|
||||||
|
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICON_RESOURCE
|
||||||
|
#else
|
||||||
|
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// a more readable way to tell
|
||||||
|
#define wxICON_SCREEN_DEPTH (-1)
|
||||||
|
|
||||||
#if defined(__WXPALMOS__)
|
#if defined(__WXPALMOS__)
|
||||||
#include "wx/generic/icon.h"
|
#include "wx/generic/icon.h"
|
||||||
#elif defined(__WXMSW__)
|
#elif defined(__WXMSW__)
|
||||||
@@ -27,7 +44,6 @@
|
|||||||
#elif defined(__WXX11__)
|
#elif defined(__WXX11__)
|
||||||
#include "wx/generic/icon.h"
|
#include "wx/generic/icon.h"
|
||||||
#elif defined(__WXMGL__)
|
#elif defined(__WXMGL__)
|
||||||
#define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_ICO_RESOURCE
|
|
||||||
#include "wx/generic/icon.h"
|
#include "wx/generic/icon.h"
|
||||||
#elif defined(__WXDFB__)
|
#elif defined(__WXDFB__)
|
||||||
#include "wx/generic/icon.h"
|
#include "wx/generic/icon.h"
|
||||||
|
@@ -30,7 +30,7 @@ public:
|
|||||||
wxBitmap(int width, int height, int depth = -1);
|
wxBitmap(int width, int height, int depth = -1);
|
||||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||||
wxBitmap(const char* const* bits);
|
wxBitmap(const char* const* bits);
|
||||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
|
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
wxBitmap(const wxImage& image, int depth = -1);
|
wxBitmap(const wxImage& image, int depth = -1);
|
||||||
virtual ~wxBitmap() {}
|
virtual ~wxBitmap() {}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
|
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
|
||||||
|
|
||||||
virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
|
virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
|
||||||
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
|
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
virtual wxPalette *GetPalette() const;
|
virtual wxPalette *GetPalette() const;
|
||||||
virtual void SetPalette(const wxPalette& palette);
|
virtual void SetPalette(const wxPalette& palette);
|
||||||
|
@@ -63,7 +63,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Load a file or resource
|
// Load a file or resource
|
||||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
// New constructor for generalised creation from data
|
// New constructor for generalised creation from data
|
||||||
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||||
|
|
||||||
// NB: This should not be called from user code. It is for wx internal
|
// NB: This should not be called from user code. It is for wx internal
|
||||||
// use only.
|
// use only.
|
||||||
wxBitmap GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const;
|
wxBitmap GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const;
|
||||||
|
|
||||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||||
@@ -139,7 +139,7 @@ public:
|
|||||||
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
|
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
|
||||||
virtual bool Create(int width, int height, const wxDC& dc);
|
virtual bool Create(int width, int height, const wxDC& dc);
|
||||||
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
||||||
|
|
||||||
wxBitmapRefData *GetBitmapData() const
|
wxBitmapRefData *GetBitmapData() const
|
||||||
|
@@ -54,7 +54,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
// from resource/file
|
// from resource/file
|
||||||
wxIcon(const wxString& name,
|
wxIcon(const wxString& name,
|
||||||
wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE,
|
wxBitmapType type = wxICON_DEFAULT_TYPE,
|
||||||
int desiredWidth = -1, int desiredHeight = -1);
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
wxIcon(const wxIconLocation& loc);
|
wxIcon(const wxIconLocation& loc);
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
virtual ~wxIcon();
|
virtual ~wxIcon();
|
||||||
|
|
||||||
virtual bool LoadFile(const wxString& name,
|
virtual bool LoadFile(const wxString& name,
|
||||||
wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE,
|
wxBitmapType type = wxICON_DEFAULT_TYPE,
|
||||||
int desiredWidth = -1, int desiredHeight = -1);
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
// implementation only from now on
|
// implementation only from now on
|
||||||
|
@@ -97,7 +97,7 @@ public:
|
|||||||
|
|
||||||
// Load a resource
|
// Load a resource
|
||||||
wxBitmap( int nId
|
wxBitmap( int nId
|
||||||
,wxBitmapType lType = wxBITMAP_TYPE_BMP_RESOURCE
|
,wxBitmapType lType = wxBITMAP_DEFAULT_TYPE
|
||||||
);
|
);
|
||||||
|
|
||||||
// For compatiability with other ports, under OS/2 does same as default ctor
|
// For compatiability with other ports, under OS/2 does same as default ctor
|
||||||
@@ -161,10 +161,10 @@ public:
|
|||||||
,int nDepth = 1
|
,int nDepth = 1
|
||||||
);
|
);
|
||||||
virtual bool LoadFile( int nId
|
virtual bool LoadFile( int nId
|
||||||
,wxBitmapType lType = wxBITMAP_TYPE_BMP_RESOURCE
|
,wxBitmapType lType = wxBITMAP_DEFAULT_TYPE
|
||||||
);
|
);
|
||||||
virtual bool LoadFile( const wxString& rName
|
virtual bool LoadFile( const wxString& rName
|
||||||
,wxBitmapType lType = wxBITMAP_TYPE_XPM
|
,wxBitmapType lType = wxBITMAP_DEFAULT_TYPE
|
||||||
);
|
);
|
||||||
virtual bool SaveFile( const wxString& rName
|
virtual bool SaveFile( const wxString& rName
|
||||||
,wxBitmapType lType
|
,wxBitmapType lType
|
||||||
|
@@ -96,7 +96,7 @@ public:
|
|||||||
wxBitmap(const char* const* bits);
|
wxBitmap(const char* const* bits);
|
||||||
|
|
||||||
// Load a file or resource
|
// Load a file or resource
|
||||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE);
|
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
// Constructor for generalised creation from data
|
// Constructor for generalised creation from data
|
||||||
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
virtual bool Create(int width, int height, int depth = -1);
|
virtual bool Create(int width, int height, int depth = -1);
|
||||||
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
// virtual bool Create( WXHICON icon) ;
|
// virtual bool Create( WXHICON icon) ;
|
||||||
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
||||||
|
|
||||||
wxBitmapRefData *GetBitmapData() const
|
wxBitmapRefData *GetBitmapData() const
|
||||||
|
@@ -22,8 +22,8 @@ public:
|
|||||||
|
|
||||||
wxIcon(const char* const* data);
|
wxIcon(const char* const* data);
|
||||||
wxIcon(const char bits[], int width , int height );
|
wxIcon(const char bits[], int width , int height );
|
||||||
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
wxIcon(const wxString& name, int flags = wxICON_DEFAULT_TYPE,
|
||||||
int desiredWidth = -1, int desiredHeight = -1);
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
wxIcon(const wxIconLocation& loc)
|
wxIcon(const wxIconLocation& loc)
|
||||||
{
|
{
|
||||||
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
|
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
|
||||||
@@ -33,10 +33,8 @@ public:
|
|||||||
|
|
||||||
virtual ~wxIcon();
|
virtual ~wxIcon();
|
||||||
|
|
||||||
bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
|
bool LoadFile(const wxString& name, wxBitmapType flags = wxICON_DEFAULT_TYPE,
|
||||||
int desiredWidth /* = -1 */ , int desiredHeight = -1);
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
|
|
||||||
{ return LoadFile( name , flags , -1 , -1 ) ; }
|
|
||||||
|
|
||||||
|
|
||||||
// create from bitmap (which should have a mask unless it's monochrome):
|
// create from bitmap (which should have a mask unless it's monochrome):
|
||||||
|
@@ -48,7 +48,7 @@ public:
|
|||||||
wxBitmap(const char* const* data);
|
wxBitmap(const char* const* data);
|
||||||
|
|
||||||
// Load a file or resource
|
// Load a file or resource
|
||||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
// New constructor for generalised creation from data
|
// New constructor for generalised creation from data
|
||||||
wxBitmap(const void* data, long type, int width, int height, int depth = 1);
|
wxBitmap(const void* data, long type, int width, int height, int depth = 1);
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
virtual bool Create(int width, int height, int depth = -1);
|
virtual bool Create(int width, int height, int depth = -1);
|
||||||
virtual bool Create(int width, int height, const wxDC& dc);
|
virtual bool Create(int width, int height, const wxDC& dc);
|
||||||
virtual bool Create(const void* data, long type, int width, int height, int depth = 1);
|
virtual bool Create(const void* data, long type, int width, int height, int depth = 1);
|
||||||
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_DEFAULT_TYPE);
|
||||||
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||||
|
|
||||||
wxBitmapRefData *GetBitmapData() const
|
wxBitmapRefData *GetBitmapData() const
|
||||||
|
@@ -76,7 +76,7 @@ public:
|
|||||||
*this = wxBitmap(wx_const_cast(const char* const*, data));
|
*this = wxBitmap(wx_const_cast(const char* const*, data));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
|
||||||
virtual ~wxBitmap();
|
virtual ~wxBitmap();
|
||||||
|
|
||||||
static void InitStandardHandlers();
|
static void InitStandardHandlers();
|
||||||
@@ -106,7 +106,7 @@ public:
|
|||||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||||
|
|
||||||
bool SaveFile( const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL ) const;
|
bool SaveFile( const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL ) const;
|
||||||
bool LoadFile( const wxString &name, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
bool LoadFile( const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
|
||||||
|
|
||||||
wxPalette *GetPalette() const;
|
wxPalette *GetPalette() const;
|
||||||
wxPalette *GetColourMap() const
|
wxPalette *GetColourMap() const
|
||||||
|
@@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
This class encapsulates the concept of a platform-dependent bitmap,
|
This class encapsulates the concept of a platform-dependent bitmap,
|
||||||
either monochrome or colour or colour with alpha channel support.
|
either monochrome or colour or colour with alpha channel support.
|
||||||
|
|
||||||
If you need direct access the bitmap data instead going through
|
If you need direct access the bitmap data instead going through
|
||||||
drawing to it using wxMemoryDC you need to use the wxPixelData
|
drawing to it using wxMemoryDC you need to use the wxPixelData
|
||||||
class (either wxNativePixelData for RGB bitmaps or wxAlphaPixelData
|
class (either wxNativePixelData for RGB bitmaps or wxAlphaPixelData
|
||||||
@@ -279,10 +279,13 @@ public:
|
|||||||
@param type
|
@param type
|
||||||
May be one of the ::wxBitmapType values and indicates which type of
|
May be one of the ::wxBitmapType values and indicates which type of
|
||||||
bitmap should be loaded. See the note in the class detailed description.
|
bitmap should be loaded. See the note in the class detailed description.
|
||||||
|
Note that the wxBITMAP_DEFAULT_TYPE constant has different value under
|
||||||
|
different wxWidgets ports. See the bitmap.h header for the value it takes
|
||||||
|
for a specific port.
|
||||||
|
|
||||||
@see LoadFile()
|
@see LoadFile()
|
||||||
*/
|
*/
|
||||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM);
|
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates this bitmap object from the given image.
|
Creates this bitmap object from the given image.
|
||||||
@@ -500,6 +503,9 @@ public:
|
|||||||
@param type
|
@param type
|
||||||
One of the ::wxBitmapType values; see the note in the class
|
One of the ::wxBitmapType values; see the note in the class
|
||||||
detailed description.
|
detailed description.
|
||||||
|
Note that the wxBITMAP_DEFAULT_TYPE constant has different value under
|
||||||
|
different wxWidgets ports. See the bitmap.h header for the value it takes
|
||||||
|
for a specific port.
|
||||||
|
|
||||||
@return @true if the operation succeeded, @false otherwise.
|
@return @true if the operation succeeded, @false otherwise.
|
||||||
|
|
||||||
@@ -510,7 +516,7 @@ public:
|
|||||||
|
|
||||||
@see SaveFile()
|
@see SaveFile()
|
||||||
*/
|
*/
|
||||||
virtual bool LoadFile(const wxString& name, wxBitmapType type);
|
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Finds the handler with the given name, and removes it.
|
Finds the handler with the given name, and removes it.
|
||||||
|
@@ -6,19 +6,40 @@
|
|||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
In wxIcon context this value means: "use the screen depth".
|
||||||
|
*/
|
||||||
|
#define wxICON_SCREEN_DEPTH (-1)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxIcon
|
@class wxIcon
|
||||||
|
|
||||||
An icon is a small rectangular bitmap usually used for denoting a
|
An icon is a small rectangular bitmap usually used for denoting a minimized
|
||||||
minimized application. It differs from a wxBitmap in always
|
application.
|
||||||
having a mask associated with it for transparent drawing. On some platforms,
|
|
||||||
icons and bitmaps are implemented identically, since there is no real
|
It differs from a wxBitmap in always having a mask associated with it for
|
||||||
distinction between
|
transparent drawing. On some platforms, icons and bitmaps are implemented
|
||||||
a wxBitmap with a mask and an icon; and there is no specific icon format on
|
identically, since there is no real distinction between a wxBitmap with a
|
||||||
some platforms (X-based applications usually standardize on XPMs for small
|
mask and an icon; and there is no specific icon format on some platforms
|
||||||
bitmaps
|
(X-based applications usually standardize on XPMs for small bitmaps and icons).
|
||||||
and icons). However, some platforms (such as Windows) make the distinction, so
|
However, some platforms (such as Windows) make the distinction, so a
|
||||||
a separate class is provided.
|
separate class is provided.
|
||||||
|
|
||||||
|
@remarks
|
||||||
|
It is usually desirable to associate a pertinent icon with a frame.
|
||||||
|
Icons can also be used for other purposes, for example with wxTreeCtrl and wxListCtrl.
|
||||||
|
Icons have different formats on different platforms therefore separate icons
|
||||||
|
will usually be created for the different environments.
|
||||||
|
Platform-specific methods for creating a wxIcon structure are catered for,
|
||||||
|
and this is an occasion where conditional compilation will probably be required.
|
||||||
|
Note that a new icon must be created for every time the icon is to be used
|
||||||
|
for a new window. In Windows, the icon will not be reloaded if it has already
|
||||||
|
been used.
|
||||||
|
An icon allocated to a frame will be deleted when the frame is deleted.
|
||||||
|
For more information please see @ref overview_bitmap.
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{gdi}
|
@category{gdi}
|
||||||
@@ -26,165 +47,159 @@
|
|||||||
@stdobjects
|
@stdobjects
|
||||||
::wxNullIcon
|
::wxNullIcon
|
||||||
|
|
||||||
@see @ref overview_wxbitmapoverview "Bitmap and icon overview", @ref
|
@see @ref overview_bitmap, @ref overview_bitmap_supportedformats,
|
||||||
overview_supportedbitmapformats "supported bitmap file formats", wxDC::DrawIcon, wxCursor
|
wxDC::DrawIcon, wxCursor
|
||||||
*/
|
*/
|
||||||
class wxIcon : public wxBitmap
|
class wxIcon : public wxBitmap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Loads an icon from the specified location().
|
Default ctor.
|
||||||
|
|
||||||
|
Constructs an icon object with no data; an assignment or another member
|
||||||
|
function such as LoadFile() must be called subsequently.
|
||||||
|
*/
|
||||||
|
wxIcon();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Copy ctor.
|
||||||
|
*/
|
||||||
|
wxIcon(const wxIcon& icon);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Creates an icon from the given data, which can be of arbitrary type.
|
||||||
|
|
||||||
|
wxIcon(void* data, int type, int width, int height, int depth = -1);
|
||||||
|
|
||||||
|
NOTE: this ctor is not implemented by all ports, is somewhat useless
|
||||||
|
without further description of the "data" supported formats and
|
||||||
|
uses 'int type' instead of wxBitmapType, so don't document it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates an icon from an array of bits.
|
||||||
|
You should only use this function for monochrome bitmaps (depth 1) in
|
||||||
|
portable programs: in this case the bits parameter should contain an XBM image.
|
||||||
|
|
||||||
|
For other bit depths, the behaviour is platform dependent: under Windows,
|
||||||
|
the data is passed without any changes to the underlying CreateBitmap() API.
|
||||||
|
Under other platforms, only monochrome bitmaps may be created using this
|
||||||
|
constructor and wxImage should be used for creating colour bitmaps from
|
||||||
|
static data.
|
||||||
|
|
||||||
@param bits
|
@param bits
|
||||||
Specifies an array of pixel values.
|
Specifies an array of pixel values.
|
||||||
@param width
|
@param width
|
||||||
Specifies the width of the icon.
|
Specifies the width of the bitmap.
|
||||||
@param height
|
@param height
|
||||||
Specifies the height of the icon.
|
Specifies the height of the bitmap.
|
||||||
@param desiredWidth
|
|
||||||
Specifies the desired width of the icon. This
|
|
||||||
parameter only has an effect in Windows (32-bit) where icon resources can
|
|
||||||
contain
|
|
||||||
several icons of different sizes.
|
|
||||||
@param desiredWidth
|
|
||||||
Specifies the desired height of the icon. This
|
|
||||||
parameter only has an effect in Windows (32-bit) where icon resources can
|
|
||||||
contain
|
|
||||||
several icons of different sizes.
|
|
||||||
@param depth
|
@param depth
|
||||||
Specifies the depth of the icon. If this is omitted, the display depth of
|
Specifies the depth of the bitmap.
|
||||||
the
|
If this is omitted, then a value of 1 (monochrome bitmap) is used.
|
||||||
screen is used.
|
*/
|
||||||
@param name
|
wxIcon(const char bits[], int width, int height, int depth = 1);
|
||||||
This can refer to a resource name under MS Windows, or a filename under MS
|
|
||||||
Windows and X.
|
|
||||||
Its meaning is determined by the flags parameter.
|
/**
|
||||||
@param loc
|
Creates a new icon. A depth of ::wxICON_SCREEN_DEPTH indicates the
|
||||||
The object describing the location of the native icon, see
|
depth of the current screen or visual.
|
||||||
wxIconLocation.
|
|
||||||
@param type
|
Some platforms only support 1 for monochrome and ::wxICON_SCREEN_DEPTH for
|
||||||
May be one of the following:
|
the current colour setting.
|
||||||
|
*/
|
||||||
|
wxIcon(int width, int height, int depth = wxICON_SCREEN_DEPTH);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates a bitmap from XPM data.
|
||||||
|
To use this constructor, you must first include an XPM file.
|
||||||
|
For example, assuming that the file mybitmap.xpm contains an XPM array
|
||||||
wxBITMAP_TYPE_ICO
|
of character pointers called @e mybitmap:
|
||||||
|
|
||||||
|
@code
|
||||||
|
#include "mybitmap.xpm"
|
||||||
|
...
|
||||||
Load a Windows icon file.
|
wxIcon *icon = new wxIcon(mybitmap);
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
A macro, wxICON, is available which creates an icon using an XPM on
|
||||||
|
the appropriate platform, or an icon resource on Windows.
|
||||||
|
|
||||||
wxBITMAP_TYPE_ICO_RESOURCE
|
@code
|
||||||
|
wxIcon icon(wxICON(mondrian));
|
||||||
|
|
||||||
|
// Equivalent to:
|
||||||
|
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||||
Load a Windows icon from the resource database.
|
wxIcon icon(mondrian_xpm);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
wxIcon icon("mondrian");
|
||||||
|
#endif
|
||||||
wxBITMAP_TYPE_GIF
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load a GIF bitmap file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxBITMAP_TYPE_XBM
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load an X bitmap file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxBITMAP_TYPE_XPM
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load an XPM bitmap file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
The validity of these flags depends on the platform and wxWidgets
|
|
||||||
configuration.
|
|
||||||
If all possible wxWidgets settings are used, the Windows platform supports
|
|
||||||
ICO file, ICO resource,
|
|
||||||
XPM data, and XPM file. Under wxGTK, the available formats are BMP file,
|
|
||||||
XPM data, XPM file, and PNG file.
|
|
||||||
Under wxMotif, the available formats are XBM data, XBM file, XPM data, XPM
|
|
||||||
file.
|
|
||||||
|
|
||||||
@remarks The first form constructs an icon object with no data; an
|
|
||||||
assignment or another member function such as Create or
|
|
||||||
LoadFile must be called subsequently.
|
|
||||||
*/
|
*/
|
||||||
wxIcon();
|
|
||||||
wxIcon(const wxIcon& icon);
|
|
||||||
wxIcon(void* data, int type, int width, int height,
|
|
||||||
int depth = -1);
|
|
||||||
wxIcon(const char bits[], int width, int height,
|
|
||||||
int depth = 1);
|
|
||||||
wxIcon(int width, int height, int depth = -1);
|
|
||||||
wxIcon(const char* const* bits);
|
wxIcon(const char* const* bits);
|
||||||
wxIcon(const wxString& name, wxBitmapType type,
|
|
||||||
int desiredWidth = -1,
|
/**
|
||||||
int desiredHeight = -1);
|
Loads an icon from a file or resource.
|
||||||
|
|
||||||
|
@param name
|
||||||
|
This can refer to a resource name or a filename under MS Windows and X.
|
||||||
|
Its meaning is determined by the @a type parameter.
|
||||||
|
@param type
|
||||||
|
May be one of the ::wxBitmapType values and indicates which type of
|
||||||
|
bitmap should be loaded. See the note in the class detailed description.
|
||||||
|
Note that the wxICON_DEFAULT_TYPE constant has different value under
|
||||||
|
different wxWidgets ports. See the icon.h header for the value it takes
|
||||||
|
for a specific port.
|
||||||
|
@param desiredWidth
|
||||||
|
Specifies the desired width of the icon. This parameter only has
|
||||||
|
an effect in Windows where icon resources can contain several icons
|
||||||
|
of different sizes.
|
||||||
|
@param desiredHeight
|
||||||
|
Specifies the desired height of the icon. This parameter only has
|
||||||
|
an effect in Windows where icon resources can contain several icons
|
||||||
|
of different sizes.
|
||||||
|
|
||||||
|
@see LoadFile()
|
||||||
|
*/
|
||||||
|
wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Loads an icon from the specified location.
|
||||||
|
*/
|
||||||
wxIcon(const wxIconLocation& loc);
|
wxIcon(const wxIconLocation& loc);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor.
|
Destructor.
|
||||||
See @ref overview_refcountdestruct "reference-counted object destruction" for
|
See @ref overview_refcount_destruct for more info.
|
||||||
more info.
|
|
||||||
If the application omits to delete the icon explicitly, the icon will be
|
If the application omits to delete the icon explicitly, the icon will be
|
||||||
destroyed automatically by wxWidgets when the application exits.
|
destroyed automatically by wxWidgets when the application exits.
|
||||||
|
|
||||||
|
@warning
|
||||||
Do not delete an icon that is selected into a memory device context.
|
Do not delete an icon that is selected into a memory device context.
|
||||||
*/
|
*/
|
||||||
~wxIcon();
|
~wxIcon();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copies @a bmp bitmap to this icon. Under MS Windows the bitmap
|
Copies @a bmp bitmap to this icon.
|
||||||
must have mask colour set.
|
Under MS Windows the bitmap must have mask colour set.
|
||||||
|
|
||||||
LoadFile()
|
@see LoadFile()
|
||||||
|
|
||||||
Wx::Icon-new( width, height, depth = -1 )
|
|
||||||
Wx::Icon-new( name, type, desiredWidth = -1, desiredHeight = -1 )
|
|
||||||
Wx::Icon-newFromBits( bits, width, height, depth = 1 )
|
|
||||||
Wx::Icon-newFromXPM( data )
|
|
||||||
*/
|
*/
|
||||||
void CopyFromBitmap(const wxBitmap& bmp);
|
void CopyFromBitmap(const wxBitmap& bmp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the colour depth of the icon. A value of 1 indicates a
|
Gets the colour depth of the icon.
|
||||||
monochrome icon.
|
A value of 1 indicates a monochrome icon.
|
||||||
*/
|
*/
|
||||||
int GetDepth() const;
|
int GetDepth() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the height of the icon in pixels.
|
Gets the height of the icon in pixels.
|
||||||
|
|
||||||
|
@see GetWidth()
|
||||||
*/
|
*/
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
|
|
||||||
@@ -205,79 +220,26 @@ public:
|
|||||||
|
|
||||||
@param name
|
@param name
|
||||||
Either a filename or a Windows resource name.
|
Either a filename or a Windows resource name.
|
||||||
The meaning of name is determined by the type parameter.
|
The meaning of name is determined by the @a type parameter.
|
||||||
@param type
|
@param type
|
||||||
One of the following values:
|
One of the ::wxBitmapType values; see the note in the class
|
||||||
|
detailed description.
|
||||||
|
Note that the wxICON_DEFAULT_TYPE constant has different value under
|
||||||
|
different wxWidgets ports. See the icon.h header for the value it takes
|
||||||
|
for a specific port.
|
||||||
|
@param desiredWidth
|
||||||
|
Specifies the desired width of the icon. This parameter only has
|
||||||
|
an effect in Windows where icon resources can contain several icons
|
||||||
wxBITMAP_TYPE_ICO
|
of different sizes.
|
||||||
|
@param desiredHeight
|
||||||
|
Specifies the desired height of the icon. This parameter only has
|
||||||
|
an effect in Windows where icon resources can contain several icons
|
||||||
|
of different sizes.
|
||||||
Load a Windows icon file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxBITMAP_TYPE_ICO_RESOURCE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load a Windows icon from the resource database.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxBITMAP_TYPE_GIF
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load a GIF bitmap file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxBITMAP_TYPE_XBM
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load an X bitmap file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxBITMAP_TYPE_XPM
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Load an XPM bitmap file.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
The validity of these flags depends on the platform and wxWidgets
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
@return @true if the operation succeeded, @false otherwise.
|
@return @true if the operation succeeded, @false otherwise.
|
||||||
|
|
||||||
@see wxIcon()
|
|
||||||
*/
|
*/
|
||||||
bool LoadFile(const wxString& name, wxBitmapType type);
|
bool LoadFile(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the depth member (does not affect the icon data).
|
Sets the depth member (does not affect the icon data).
|
||||||
@@ -304,7 +266,7 @@ public:
|
|||||||
void SetWidth(int width);
|
void SetWidth(int width);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assignment operator, using @ref overview_trefcount "reference counting".
|
Assignment operator, using @ref overview_refcount.
|
||||||
|
|
||||||
@param icon
|
@param icon
|
||||||
Icon to assign.
|
Icon to assign.
|
||||||
|
@@ -74,6 +74,19 @@ fi
|
|||||||
# can be passed to ifacecheck to aid the comparison
|
# can be passed to ifacecheck to aid the comparison
|
||||||
echo "Running gccxml's preprocessor on the $allheaders file... results in $preprocoutput"
|
echo "Running gccxml's preprocessor on the $allheaders file... results in $preprocoutput"
|
||||||
gccxml -E -dM $flags >$preprocoutput
|
gccxml -E -dM $flags >$preprocoutput
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
echo "Errors running gccxml preprocessor... aborting."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# FIX for IFACECHECK
|
||||||
|
# ==================
|
||||||
|
|
||||||
|
# these fixes are needed to avoid false warnings/errors by ifacecheck
|
||||||
|
|
||||||
|
if [[ "@TOOLKIT@" == "GTK" ]]; then
|
||||||
|
sed -i -e 's/default="wxBITMAP_TYPE_XPM"/default="wxBITMAP_DEFAULT_TYPE"/g' $gccxmloutput
|
||||||
|
fi
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
rm $allheaders
|
rm $allheaders
|
||||||
|
Reference in New Issue
Block a user