.TH wxArtProvider 3erl "wx 2.2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxArtProvider \- Functions for wxArtProvider class .SH DESCRIPTION .LP \fIwxArtProvider\fR\& class is used to customize the look of wxWidgets application\&. .LP 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 \fIwxArtProvider\fR\& for it instead\&. This way users can plug in their own \fIwxArtProvider\fR\& class and easily replace standard art with their own version\&. .LP All that is needed is to derive a class from \fIwxArtProvider\fR\&, override either its \fIwxArtProvider::CreateBitmap()\fR\& (not implemented in wx) and/or its \fIwxArtProvider::CreateIconBundle()\fR\& (not implemented in wx) methods and register the provider with \fIwxArtProvider::Push()\fR\& (not implemented in wx): .LP If you need bitmap images (of the same artwork) that should be displayed at different sizes you should probably consider overriding \fIwxArtProvider::CreateIconBundle\fR\& (not implemented in wx) and supplying icon bundles that contain different bitmap sizes\&. .LP 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 \fIgetBitmap/2\fR\& or \fIgetIcon/2\fR\&\&. .LP Identifying art resources .LP Every bitmap and icon bundle are known to \fIwxArtProvider\fR\& 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 page_samples_artprov): .LP Additionally, any string recognized by custom art providers registered using \fIwxArtProvider::Push\fR\& (not implemented in wx) may be used\&. .LP Note: When running under GTK+ 2, GTK+ stock item IDs (e\&.g\&. \fI"gtk-cdrom"\fR\&) may be used as well: For a list of the GTK+ stock items please refer to the GTK+ documentation page\&. It is also possible to load icons from the current icon theme by specifying their name (without extension and directory components)\&. Icon themes recognized by GTK+ follow the freedesktop\&.org Icon Themes specification\&. Note that themes are not guaranteed to contain all icons, so \fIwxArtProvider\fR\& may return ?wxNullBitmap or ?wxNullIcon\&. The default theme is typically installed in \fI/usr/share/icons/hicolor\fR\&\&. .LP Clients .LP The \fIclient\fR\& is the entity that calls \fIwxArtProvider\fR\&\&'s \fIgetBitmap/2\fR\& or \fIgetIcon/2\fR\& function\&. It is represented by wxClientID type and can have one of these values: .LP Client ID serve as a hint to \fIwxArtProvider\fR\& that is supposed to help it to choose the best looking bitmap\&. For example it is often desirable to use slightly different icons in menus and toolbars even though they represent the same action (e\&.g\&. wxART_FILE_OPEN)\&. Remember that this is really only a hint for \fIwxArtProvider\fR\& - it is common that \fIgetBitmap/2\fR\& returns identical bitmap for different client values! .LP See: Examples, \fIwxArtProvider\fR\&, usage; stock ID list .LP wxWidgets docs: wxArtProvider .SH DATA TYPES .nf \fBwxArtProvider()\fR\& = wx:wx_object() .br .fi .SH EXPORTS .LP .nf .B getBitmap(Id) -> wxBitmap:wxBitmap() .br .fi .br .RS .LP Types: .RS 3 Id = unicode:chardata() .br .RE .RE .LP .nf .B getBitmap(Id, Options :: [Option]) -> wxBitmap:wxBitmap() .br .fi .br .RS .LP Types: .RS 3 Id = unicode:chardata() .br Option = .br {client, unicode:chardata()} | .br {size, {W :: integer(), H :: integer()}} .br .RE .RE .RS .LP Query registered providers for bitmap with given ID\&. .LP Return: The bitmap if one of registered providers recognizes the ID or wxNullBitmap otherwise\&. .RE .LP .nf .B getIcon(Id) -> wxIcon:wxIcon() .br .fi .br .RS .LP Types: .RS 3 Id = unicode:chardata() .br .RE .RE .LP .nf .B getIcon(Id, Options :: [Option]) -> wxIcon:wxIcon() .br .fi .br .RS .LP Types: .RS 3 Id = unicode:chardata() .br Option = .br {client, unicode:chardata()} | .br {size, {W :: integer(), H :: integer()}} .br .RE .RE .RS .LP Same as \fIgetBitmap/2\fR\&, but return a \fIwxIcon\fR\& object (or ?wxNullIcon on failure)\&. .RE