#include <wx/cursor.h>
A cursor bundle is a set of different versions of the same cursor at different sizes.
This class relationship with wxCursor is similar to that of wxBitmapBundle with wxBitmap, but it has a simpler interface because cursors are never scaled and always use the closest available size. It is typically used like the following:
Please see wxBitmapBundle documentation for more information about different ways of creating it.
Public Member Functions | |
wxCursorBundle () | |
Default ctor constructs an empty bundle. More... | |
wxCursorBundle (const wxBitmapBundle &bitmaps, const wxPoint &hotSpot) | |
Create a cursor bundle from the given bitmap bundle. More... | |
wxCursorBundle (const wxBitmapBundle &bitmaps, int hotSpotX=0, int hotSpotY=0) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
wxCursorBundle (const wxCursorBundle &other) | |
Copy constructor performs a shallow copy of the bundle. More... | |
wxCursorBundle & | operator= (const wxCursorBundle &other) |
Assignment operator performs a shallow copy of the bundle. More... | |
bool | IsOk () const |
Check if cursor bundle is non-empty. More... | |
void | Clear () |
Clear the bundle contents. More... | |
wxCursor | GetCursorFor (const wxWindow *window) const |
Get the cursor of the size suitable for the given window. More... | |
wxCursor | GetCursorForMainWindow () const |
Get the cursor of the default size. More... | |
bool | IsSameAs (const wxCursorBundle &other) const |
Check if two objects refer to the same bundle. More... | |
wxCursorBundle::wxCursorBundle | ( | ) |
Default ctor constructs an empty bundle.
Such bundle represents the absence of any custom cursor but not an empty cursor (wxCURSOR_BLANK can be used if this is really needed).
You can use the assignment operator to set the bundle contents later.
|
explicit |
Create a cursor bundle from the given bitmap bundle.
bitmaps | The bitmap bundle to use for the cursor, typically containing bitmap in at least two sizes. |
hotSpot | Hotspot coordinates (relative to the top left of the image). The coordinates are relative to the default size of the bitmap bundle and are scaled by wxWidgets for other sizes. |
|
explicit |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
wxCursorBundle::wxCursorBundle | ( | const wxCursorBundle & | other | ) |
Copy constructor performs a shallow copy of the bundle.
This operation is cheap as it doesn't copy any bitmaps.
void wxCursorBundle::Clear | ( | ) |
Clear the bundle contents.
IsOk() will return false after doing this.
Use the assignment operator to set the bundle contents later.
Get the cursor of the size suitable for the given window.
wxCursor wxCursorBundle::GetCursorForMainWindow | ( | ) | const |
Get the cursor of the default size.
Prefer to use GetCursorFor() instead if there is a suitable window available, this function only exists as last resort.
bool wxCursorBundle::IsOk | ( | ) | const |
Check if cursor bundle is non-empty.
bool wxCursorBundle::IsSameAs | ( | const wxCursorBundle & | other | ) | const |
Check if two objects refer to the same bundle.
Note that this compares the object identity, i.e. this function returns true only for copies of the same bundle, but false for two bundles created from the same bitmap bundle and same hotspot coordinates.
wxCursorBundle& wxCursorBundle::operator= | ( | const wxCursorBundle & | other | ) |
Assignment operator performs a shallow copy of the bundle.
This operation is cheap as it doesn't copy any bitmaps.