X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..3d55f45e94a243fef267d466f249fbb18835ecdc:/src/osx/artmac.cpp diff --git a/src/osx/artmac.cpp b/src/osx/artmac.cpp index 6b49934787..267516cb7a 100644 --- a/src/osx/artmac.cpp +++ b/src/osx/artmac.cpp @@ -25,7 +25,7 @@ #include "wx/image.h" #endif -#if wxOSX_USE_COCOA_OR_CARBON +#include "wx/osx/private.h" // ---------------------------------------------------------------------------- // wxMacArtProvider @@ -34,8 +34,18 @@ class wxMacArtProvider : public wxArtProvider { protected: +#if wxOSX_USE_COCOA_OR_CARBON virtual wxIconBundle CreateIconBundle(const wxArtID& id, const wxArtClient& client); +#endif +#if wxOSX_USE_COCOA_OR_IPHONE + virtual wxBitmap CreateBitmap(const wxArtID& id, + const wxArtClient& client, + const wxSize& size) + { + return wxOSXCreateSystemBitmap(id, client, size); + } +#endif }; /* static */ void wxArtProvider::InitNativeProvider() @@ -43,6 +53,8 @@ protected: wxArtProvider::Push(new wxMacArtProvider); } +#if wxOSX_USE_COCOA_OR_CARBON + // ---------------------------------------------------------------------------- // helper macros // ---------------------------------------------------------------------------- @@ -103,6 +115,7 @@ wxIconBundle wxMacArtProvider::CreateIconBundle(const wxArtID& id, const wxArtCl return wxMacArtProvider_CreateIconBundle(id); } +#endif // ---------------------------------------------------------------------------- // wxArtProvider::GetNativeSizeHint() @@ -117,8 +130,15 @@ wxSize wxArtProvider::GetNativeSizeHint(const wxArtClient& client) // "32 x 32 pixels is the recommended size" return wxSize(32, 32); } + else if ( client == wxART_BUTTON || client == wxART_MENU ) + { + // Mac UI doesn't use any images in neither buttons nor menus in + // general but the code using wxArtProvider can use wxART_BUTTON to + // find the icons of a roughly appropriate size for the buttons and + // 16x16 seems to be the best choice for this kind of use + return wxSize(16, 16); + } return wxDefaultSize; } -#endif // wxOSX_USE_COCOA_CARBON