Add wxHAS_IMAGE_RESOURCES defined under MSW and Mac

Unlike the existing wxHAS_IMAGES_IN_RESOURCES constant defined only
under MSW, the new one is also defined under Mac and could be defined
for the other platforms/ports later (e.g. wxQt could probably support it
too).

It's unfortunate that two very similar constants are needed, but it
doesn't seem wise to change the meaning of the existing constant, as
this would change how the commonly used wxICON() and wxBITMAP() macros
behave and would break all our own samples that use them for their frame
icon but don't embed this icon into the bundle resources under Mac.

Do change the toolbar sample to use the new constant however, as this
one does include the bitmaps it uses in its bundle under Mac.
This commit is contained in:
Vadim Zeitlin
2021-09-22 23:18:16 +01:00
parent 19002a54ad
commit 7043963831
3 changed files with 23 additions and 6 deletions

View File

@@ -44,12 +44,15 @@
// resources
// ----------------------------------------------------------------------------
// Under Windows, PNG files are embedded as resources, see toolbar.rc, but
// elsewhere we embed them in the program itself. We could also load them
// during run-time.
// We don't embed this item in the resources under Mac, so we need to still use
// the XPM there.
#ifndef wxHAS_IMAGES_IN_RESOURCES
#include "../sample.xpm"
#endif // !wxHAS_IMAGES_IN_RESOURCES
// If PNG files are not available in resources, we need to embed them in the
// program itself. We could also load them during run-time.
#ifndef wxHAS_IMAGE_RESOURCES
#include "bitmaps/new_png.c"
#include "bitmaps/open_png.c"
#include "bitmaps/save_png.c"
@@ -67,7 +70,7 @@
#include "bitmaps/paste_2x_png.c"
#include "bitmaps/print_2x_png.c"
#include "bitmaps/help_2x_png.c"
#endif // !wxHAS_IMAGES_IN_RESOURCES
#endif // !wxHAS_IMAGE_RESOURCES
enum Positions
{