It is used within wxBitmap and is not normally seen by the application.
If you wish to extend the capabilities of wxBitmap, derive a class from
- wxBitmapHandler and add the handler using wxBitmap::AddHandler in your
+ wxBitmapHandler and add the handler using wxBitmap::AddHandler() in your
application initialisation.
@library{wxcore}
@returns @true if the call succeeded, @false otherwise (the default).
*/
virtual bool Create(wxBitmap* bitmap, const void* data, wxBitmapType type,
- int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
+ int width, int height, int depth = 1);
/**
Gets the file extension associated with this handler.
@see wxBitmap::LoadFile, wxBitmap::SaveFile, SaveFile()
*/
- virtual bool LoadFile(wxBitmap* bitmap, const wxString& name, wxBitmapType type);
+ virtual bool LoadFile(wxBitmap* bitmap, const wxString& name, wxBitmapType type,
+ int desiredWidth, int desiredHeight);
/**
Saves a bitmap in the named file.
@see wxBitmap::LoadFile, wxBitmap::SaveFile, LoadFile()
*/
- bool SaveFile(wxBitmap* bitmap, const wxString& name, wxBitmapType type,
- wxPalette* palette = NULL);
+ virtual bool SaveFile(const wxBitmap* bitmap, const wxString& name, wxBitmapType type,
+ wxPalette* palette = NULL) const;
/**
Sets the handler extension.
wxBitmap(const void* data, int type, int width, int height, int depth = -1);
- NOTE: this ctor is not implemented by all port, is somewhat useless
+ 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 a new bitmap. A depth of ::wxBITMAP_SCREEN_DEPTH indicates the
depth of the current screen or visual.
+
Some platforms only support 1 for monochrome and ::wxBITMAP_SCREEN_DEPTH for
the current colour setting.
mask information so that bitmaps and images can be converted back
and forth without loss in that respect.
*/
- wxImage ConvertToImage();
+ virtual wxImage ConvertToImage() const;
/**
Creates the bitmap from an icon.
*/
- bool CopyFromIcon(const wxIcon& icon);
+ virtual bool CopyFromIcon(const wxIcon& icon);
/**
Creates a fresh bitmap.
This overload works on all platforms.
*/
- bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
+ virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
/*
Creates a bitmap from the given data, which can be of arbitrary type.
Gets the colour depth of the bitmap.
A value of 1 indicates a monochrome bitmap.
*/
- int GetDepth() const;
+ virtual int GetDepth() const;
/**
Returns the static list of bitmap format handlers.
/**
Gets the height of the bitmap in pixels.
*/
- int GetHeight() const;
+ virtual int GetHeight() const;
/**
Gets the associated mask (if any) which may have been loaded from a file
@see SetMask(), wxMask
*/
- wxMask* GetMask() const;
+ virtual wxMask* GetMask() const;
/**
Gets the associated palette (if any) which may have been loaded from a file
@see wxPalette
*/
- wxPalette* GetPalette() const;
+ virtual wxPalette* GetPalette() const;
/**
Returns a sub bitmap of the current one as long as the rect belongs entirely to
the bitmap. This function preserves bit depth and mask information.
*/
- wxBitmap GetSubBitmap(const wxRect& rect) const;
+ virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
/**
Gets the width of the bitmap in pixels.
@see GetHeight()
*/
- int GetWidth() const;
+ virtual int GetWidth() const;
/**
Adds the standard bitmap format handlers, which, depending on wxWidgets
@see SaveFile()
*/
- bool LoadFile(const wxString& name, wxBitmapType type);
+ virtual bool LoadFile(const wxString& name, wxBitmapType type);
/**
Finds the handler with the given name, and removes it.
@see LoadFile()
*/
- bool SaveFile(const wxString& name, wxBitmapType type,
- const wxPalette* palette = NULL);
+ virtual bool SaveFile(const wxString& name, wxBitmapType type,
+ const wxPalette* palette = NULL) const;
/**
Sets the depth member (does not affect the bitmap data).
@param depth
Bitmap depth.
*/
- void SetDepth(int depth);
+ virtual void SetDepth(int depth);
/**
Sets the height member (does not affect the bitmap data).
@param height
Bitmap height in pixels.
*/
- void SetHeight(int height);
+ virtual void SetHeight(int height);
/**
Sets the mask for this bitmap.
@see GetMask(), wxMask
*/
- void SetMask(wxMask* mask);
+ virtual void SetMask(wxMask* mask);
/**
Sets the associated palette. (Not implemented under GTK+).
@see wxPalette
*/
- void SetPalette(const wxPalette& palette);
+ virtual void SetPalette(const wxPalette& palette);
/**
Sets the width member (does not affect the bitmap data).
@param width
Bitmap width in pixels.
*/
- void SetWidth(int width);
-
- /**
- Assignment operator, using @ref overview_refcount "reference counting".
-
- @param bitmap
- Bitmap to assign.
- */
- wxBitmap operator =(const wxBitmap& bitmap);
+ virtual void SetWidth(int width);
};
/**
*/
enum wxBrushStyle
{
+ wxBRUSHSTYLE_INVALID = -1,
+
wxBRUSHSTYLE_SOLID = wxSOLID,
/**< Solid. */
wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH,
wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH,
- wxBRUSHSTYLE_MAX
};
@param style
One of the ::wxBrushStyle enumeration values.
*/
- wxBrush(const wxColour& colour, wxBrushStyle style = wxSOLID);
-
- /**
- Constructs a brush from a colour name and @a style.
-
- @param colourName
- Colour name. The name will be looked up in the colour database.
- @param style
- One of the ::wxBrushStyle enumeration values.
-
- @see wxColourDatabase
- */
- wxBrush(const wxString& colourName, wxBrushStyle style);
+ wxBrush(const wxColour& colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
/**
Constructs a stippled brush using a bitmap.
@see SetStyle(), SetColour(), SetStipple()
*/
- wxBrushStyle GetStyle() const;
+ virtual wxBrushStyle GetStyle() const;
/**
Returns @true if the style of the brush is any of hatched fills.
*/
void SetColour(wxColour& colour);
void SetColour(const wxString& colourName);
- void SetColour(unsigned char red, unsigned char green,
- unsigned char blue);
+ void SetColour(unsigned char red, unsigned char green, unsigned char blue);
//@}
/**
Inequality operator.
See @ref overview_refcount_equality for more info.
*/
- bool operator !=(const wxBrush& brush);
-
- /**
- Assignment operator, using @ref overview_refcount "reference counting".
- */
- wxBrush operator =(const wxBrush& brush);
+ bool operator !=(const wxBrush& brush) const;
/**
Equality operator.
See @ref overview_refcount_equality for more info.
*/
- bool operator ==(const wxBrush& brush);
+ bool operator ==(const wxBrush& brush) const;
};
/**
A brush list is a list containing all brushes which have been created.
+ The application should not construct its own brush list: it should use the
+ object pointer ::wxTheBrushList.
+
@library{wxcore}
@category{gdi}
class wxBrushList : public wxList
{
public:
- /**
- Constructor. The application should not construct its own brush list:
- use the object pointer ::wxTheBrushList.
- */
- wxBrushList();
-
/**
Finds a brush with the specified attributes and returns it, else creates a new
brush, adds it to the brush list, and returns it.