///////////////////////////////////////////////////////////////////////////// // Name: artprov.h // Purpose: interface of wxArtProvider // Author: wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** This type identifies the client of the art objects requested to wxArtProvider. */ typedef wxString wxArtClient; /** This type identifies a specific art object which can be requested to wxArtProvider. */ typedef wxString wxArtID; const wxArtClient wxART_TOOLBAR; const wxArtClient wxART_MENU; const wxArtClient wxART_FRAME_ICON; const wxArtClient wxART_CMN_DIALOG; const wxArtClient wxART_HELP_BROWSER; const wxArtClient wxART_MESSAGE_BOX; const wxArtClient wxART_BUTTON; const wxArtClient wxART_LIST; const wxArtClient wxART_OTHER; const wxArtID wxART_ADD_BOOKMARK; const wxArtID wxART_DEL_BOOKMARK; const wxArtID wxART_HELP_SIDE_PANEL; const wxArtID wxART_HELP_SETTINGS; const wxArtID wxART_HELP_BOOK; const wxArtID wxART_HELP_FOLDER; const wxArtID wxART_HELP_PAGE; const wxArtID wxART_GO_BACK; const wxArtID wxART_GO_FORWARD; const wxArtID wxART_GO_UP; const wxArtID wxART_GO_DOWN; const wxArtID wxART_GO_TO_PARENT; const wxArtID wxART_GO_HOME; const wxArtID wxART_GOTO_FIRST; const wxArtID wxART_GOTO_LAST; const wxArtID wxART_FILE_OPEN; const wxArtID wxART_FILE_SAVE; const wxArtID wxART_FILE_SAVE_AS; const wxArtID wxART_PRINT; const wxArtID wxART_HELP; const wxArtID wxART_TIP; const wxArtID wxART_REPORT_VIEW; const wxArtID wxART_LIST_VIEW; const wxArtID wxART_NEW_DIR; const wxArtID wxART_HARDDISK; const wxArtID wxART_FLOPPY; const wxArtID wxART_CDROM; const wxArtID wxART_REMOVABLE; const wxArtID wxART_FOLDER; const wxArtID wxART_FOLDER_OPEN; const wxArtID wxART_GO_DIR_UP; const wxArtID wxART_EXECUTABLE_FILE; const wxArtID wxART_NORMAL_FILE; const wxArtID wxART_TICK_MARK; const wxArtID wxART_CROSS_MARK; const wxArtID wxART_ERROR; const wxArtID wxART_QUESTION; const wxArtID wxART_WARNING; const wxArtID wxART_INFORMATION; const wxArtID wxART_MISSING_IMAGE; const wxArtID wxART_COPY; const wxArtID wxART_CUT; const wxArtID wxART_PASTE; const wxArtID wxART_DELETE; const wxArtID wxART_NEW; const wxArtID wxART_UNDO; const wxArtID wxART_REDO; const wxArtID wxART_PLUS; const wxArtID wxART_MINUS; const wxArtID wxART_CLOSE; const wxArtID wxART_QUIT; const wxArtID wxART_FIND; const wxArtID wxART_FIND_AND_REPLACE; const wxArtID wxART_FULL_SCREEN; const wxArtID wxART_EDIT; /** @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 @c wxART_ERROR @li @c wxART_QUESTION @li @c wxART_WARNING @li @c wxART_INFORMATION @li @c wxART_ADD_BOOKMARK @li @c wxART_DEL_BOOKMARK @li @c wxART_HELP_SIDE_PANEL @li @c wxART_HELP_SETTINGS @li @c wxART_HELP_BOOK @li @c wxART_HELP_FOLDER @li @c wxART_HELP_PAGE @li @c wxART_GO_BACK @li @c wxART_GO_FORWARD @li @c wxART_GO_UP @li @c wxART_GO_DOWN @li @c wxART_GO_TO_PARENT @li @c wxART_GO_HOME @li @c wxART_GOTO_FIRST (since 2.9.2) | @li @c wxART_GOTO_LAST (since 2.9.2) @li @c wxART_PRINT @li @c wxART_HELP @li @c wxART_TIP @li @c wxART_REPORT_VIEW @li @c wxART_LIST_VIEW @li @c wxART_NEW_DIR @li @c wxART_FOLDER @li @c wxART_FOLDER_OPEN @li @c wxART_GO_DIR_UP @li @c wxART_EXECUTABLE_FILE @li @c wxART_NORMAL_FILE @li @c wxART_TICK_MARK @li @c wxART_CROSS_MARK @li @c wxART_MISSING_IMAGE @li @c wxART_NEW @li @c wxART_FILE_OPEN @li @c wxART_FILE_SAVE | @li @c wxART_FILE_SAVE_AS @li @c wxART_DELETE @li @c wxART_COPY @li @c wxART_CUT @li @c wxART_PASTE @li @c wxART_UNDO @li @c wxART_REDO @li @c wxART_PLUS (since 2.9.2) @li @c wxART_MINUS (since 2.9.2) @li @c wxART_CLOSE @li @c wxART_QUIT @li @c wxART_FIND @li @c wxART_FIND_AND_REPLACE @li @c wxART_FULL_SCREEN (since 3.1.0) @li @c wxART_EDIT (since 3.1.0) @li @c wxART_HARDDISK @li @c wxART_FLOPPY @li @c wxART_CDROM @li @c wxART_REMOVABLE |