Add wxCursor ctor from XPM data to all ports

This just uses the existing wxImage ctor from XPM data and wxCursor ctor
from wxImage, but will allow the code creating cursors from XPM to still
work even when wxImage ctor from XPM is made explicit.

Add a trivial test just to check that the new ctor can be used.
This commit is contained in:
Vadim Zeitlin
2021-04-17 19:32:54 +01:00
parent 9c6e67cac0
commit 72500faf7c
16 changed files with 122 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ public:
wxCursor();
#if wxUSE_IMAGE
wxCursor(const wxImage& image);
wxCursor(const char* const* xpmData);
#endif // wxUSE_IMAGE
wxCursor(const wxString& name,
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
@@ -44,6 +45,10 @@ protected:
virtual wxGDIImageRefData *CreateData() const wxOVERRIDE;
private:
#if wxUSE_IMAGE
void InitFromImage(const wxImage& image);
#endif // wxUSE_IMAGE
wxDECLARE_DYNAMIC_CLASS(wxCursor);
};