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:
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "wx/anidecod.h" // wxImageArray
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/url.h"
|
||||
#include "wx/log.h"
|
||||
@@ -2164,6 +2166,40 @@ TEST_CASE("wxImage::InitAlpha", "[image][initalpha]")
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("wxImage::XPM", "[image][xpm]")
|
||||
{
|
||||
static const char * dummy_xpm[] = {
|
||||
"16 16 2 1",
|
||||
"@ c Black",
|
||||
" c None",
|
||||
"@ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @ ",
|
||||
" @"
|
||||
};
|
||||
|
||||
wxImage image(dummy_xpm);
|
||||
CHECK( image.IsOk() );
|
||||
|
||||
// The goal here is mostly just to check that this code compiles, i.e. that
|
||||
// creating all these classes from XPM works.
|
||||
CHECK( wxBitmap(dummy_xpm).IsOk() );
|
||||
CHECK( wxCursor(dummy_xpm).IsOk() );
|
||||
CHECK( wxIcon(dummy_xpm).IsOk() );
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: add lots of more tests to wxImage functions
|
||||
*/
|
||||
|
Reference in New Issue
Block a user