///////////////////////////////////////////////////////////////////////////// // Name: artprov.h // Purpose: interface of wxArtProvider // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** This type identifies the client of the art objects requested to wxArtProvider. */ typedef class wxString wxArtClient; /** This type identifies a specific art object which can be requested to wxArtProvider. */ typedef class wxString wxArtID; /** @class wxArtProvider wxArtProvider class is used to customize the look of wxWidgets application. When wxWidgets needs to display an icon or a bitmap (e.g. in the standard file dialog), it does not use a hard-coded resource but asks wxArtProvider for it instead. This way users can plug in their own wxArtProvider class and easily replace standard art with their own version. All that is needed is to derive a class from wxArtProvider, override either its wxArtProvider::CreateBitmap() and/or its wxArtProvider::CreateIconBundle() methods and register the provider with wxArtProvider::Push(): @code class MyProvider : public wxArtProvider { protected: wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client, const wxSize size) // optionally override this one as well wxIconBundle CreateIconBundle(const wxArtID& id, const wxArtClient& client) { ... } }; ... wxArtProvider::Push(new MyProvider); @endcode If you need bitmap images (of the same artwork) that should be displayed at different sizes you should probably consider overriding wxArtProvider::CreateIconBundle and supplying icon bundles that contain different bitmap sizes. There's another way of taking advantage of this class: you can use it in your code and use platform native icons as provided by wxArtProvider::GetBitmap or wxArtProvider::GetIcon. @section artprovider_identify Identifying art resources Every bitmap and icon bundle are known to wxArtProvider under an unique ID that is used when requesting a resource from it. The ID is represented by the ::wxArtID type and can have one of these predefined values (you can see bitmaps represented by these constants in the @ref page_samples_artprov):
@li wxART_ERROR @li wxART_QUESTION @li wxART_WARNING @li wxART_INFORMATION @li wxART_ADD_BOOKMARK @li wxART_DEL_BOOKMARK @li wxART_HELP_SIDE_PANEL @li wxART_HELP_SETTINGS @li wxART_HELP_BOOK @li wxART_HELP_FOLDER @li wxART_HELP_PAGE @li wxART_GO_BACK @li wxART_GO_FORWARD @li wxART_GO_UP @li wxART_GO_DOWN @li wxART_GO_TO_PARENT @li wxART_GO_HOME @li wxART_GOTO_FIRST (since 2.9.2) | @li wxART_GOTO_LAST (since 2.9.2) @li wxART_PRINT @li wxART_HELP @li wxART_TIP @li wxART_REPORT_VIEW @li wxART_LIST_VIEW @li wxART_NEW_DIR @li wxART_FOLDER @li wxART_FOLDER_OPEN @li wxART_GO_DIR_UP @li wxART_EXECUTABLE_FILE @li wxART_NORMAL_FILE @li wxART_TICK_MARK @li wxART_CROSS_MARK @li wxART_MISSING_IMAGE @li wxART_NEW @li wxART_FILE_OPEN @li wxART_FILE_SAVE | @li wxART_FILE_SAVE_AS @li wxART_DELETE @li wxART_COPY @li wxART_CUT @li wxART_PASTE @li wxART_UNDO @li wxART_REDO @li wxART_PLUS (since 2.9.2) @li wxART_MINUS (since 2.9.2) @li wxART_CLOSE @li wxART_QUIT @li wxART_FIND @li wxART_FIND_AND_REPLACE @li wxART_HARDDISK @li wxART_FLOPPY @li wxART_CDROM @li wxART_REMOVABLE |