![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
The Icon Dictionary manages a collection of icons. More...
#include <FXIconDict.h>
Public Member Functions | |
| FXIconDict (FXApp *app, const FXString &p=defaultIconPath) | |
| Construct icon dictionary, and set initial search path; also creates a default icon source object. | |
| void | setIconSource (FXIconSource *src) |
| Change icon source. | |
| FXIconSource * | getIconSource () const |
| Return icon source. | |
| void | setIconPath (const FXString &p) |
| Set icon search path. | |
| const FXString & | getIconPath () const |
| Return current icon search path. | |
| FXIcon * | insert (const FXchar *name) |
| Insert unique icon loaded from filename into dictionary. | |
| FXIcon * | replace (const FXchar *name) |
| Replace icon loaded from filename into dictionary. | |
| FXIcon * | remove (const FXchar *name) |
| Remove icon from dictionary. | |
| FXIcon * | find (const FXchar *name) |
| Find icon by name. | |
| FXIcon * | data (FXint pos) const |
| Return icon at position pos. | |
| virtual void | save (FXStream &store) const |
| Save to stream. | |
| virtual void | load (FXStream &store) |
| Load from stream. | |
| virtual | ~FXIconDict () |
| Destroy the icon dict as well as the icon source. | |
Static Public Attributes | |
| static const FXchar | defaultIconPath [] |
| Default icon search path. | |
Protected Member Functions | |
| virtual void * | createData (void *) |
| Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer. | |
| virtual void | deleteData (void *) |
| Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing. | |
The Icon Dictionary manages a collection of icons.
The icons are referenced by their file name. When first encountering a new file name, the icon is located by searching the icon search path for the icon file. If found, the services of the icon source object are used to load the icon from the file. A custom icon source may be installed to furnish support for additonal image file formats. Once the icon is loaded, an association between the icon name and the icon is entered into the icon dictionary. Subsequent searches for an icon with this name will be satisfied from the cached value. The lifetype of the icons is managed by the icon dictionary, and thus all icons will be deleted when the dictionary is deleted.
|
|