that is needed is to derive a class from wxArtProvider, override its
\helpref{CreateBitmap}{wxartprovidercreatebitmap} method and register the
provider with
-\helpref{wxArtProvider::PushProvider}{wxartproviderpushprovider}:
+\helpref{wxArtProvider::Push}{wxartproviderpush}:
\begin{verbatim}
class MyProvider : public wxArtProvider
{ ... }
};
...
- wxArtProvider::PushProvider(new MyProvider);
+ wxArtProvider::Push(new MyProvider);
\end{verbatim}
There's another way of taking advantage of this class: you can use it in your code and use
possible as of wxWidgets 2.3.3, the set of wxArtProvider bitmaps is too
small).
+
\membersection{Identifying art resources}\label{artprovideridentifying}
Every bitmap is known to wxArtProvider under an unique ID that is used by when
have one of these predefined values (you can see bitmaps represented by these
constants in the \helpref{artprov}{sampleartprovider} sample):
\begin{itemize}\itemsep=0pt
-\item wxART\_ADD\_BOOKMARK
-\item wxART\_DEL\_BOOKMARK
-\item wxART\_HELP\_SIDE\_PANEL
-\item wxART\_HELP\_SETTINGS
-\item wxART\_HELP\_BOOK
-\item wxART\_HELP\_FOLDER
-\item wxART\_HELP\_PAGE
-\item wxART\_GO\_BACK
-\item wxART\_GO\_FORWARD
-\item wxART\_GO\_UP
-\item wxART\_GO\_DOWN
-\item wxART\_GO\_TO\_PARENT
-\item wxART\_GO\_HOME
-\item wxART\_FILE\_OPEN
-\item wxART\_PRINT
-\item wxART\_HELP
-\item wxART\_TIP
-\item wxART\_REPORT\_VIEW
-\item wxART\_LIST\_VIEW
-\item wxART\_NEW\_DIR
-\item wxART\_FOLDER
-\item wxART\_GO\_DIR\_UP
-\item wxART\_EXECUTABLE\_FILE
-\item wxART\_NORMAL\_FILE
-\item wxART\_TICK\_MARK
-\item wxART\_CROSS\_MARK
-\item wxART\_ERROR
-\item wxART\_QUESTION
-\item wxART\_WARNING
-\item wxART\_INFORMATION
-\item wxART\_MISSING\_IMAGE
+
+\item wxART\_ERROR
+\item wxART\_QUESTION
+\item wxART\_WARNING
+\item wxART\_INFORMATION
+\item wxART\_ADD\_BOOKMARK
+\item wxART\_DEL\_BOOKMARK
+\item wxART\_HELP\_SIDE\_PANEL
+\item wxART\_HELP\_SETTINGS
+\item wxART\_HELP\_BOOK
+\item wxART\_HELP\_FOLDER
+\item wxART\_HELP\_PAGE
+\item wxART\_GO\_BACK
+\item wxART\_GO\_FORWARD
+\item wxART\_GO\_UP
+\item wxART\_GO\_DOWN
+\item wxART\_GO\_TO\_PARENT
+\item wxART\_GO\_HOME
+\item wxART\_PRINT
+\item wxART\_HELP
+\item wxART\_TIP
+\item wxART\_REPORT\_VIEW
+\item wxART\_LIST\_VIEW
+\item wxART\_NEW\_DIR
+\item wxART\_FOLDER
+\item wxART\_FOLDER\_OPEN
+\item wxART\_GO\_DIR\_UP
+\item wxART\_EXECUTABLE\_FILE
+\item wxART\_NORMAL\_FILE
+\item wxART\_TICK\_MARK
+\item wxART\_CROSS\_MARK
+\item wxART\_MISSING\_IMAGE
+\item wxART\_NEW
+\item wxART\_FILE\_OPEN
+\item wxART\_FILE\_SAVE
+\item wxART\_FILE\_SAVE\_AS
+\item wxART\_DELETE
+\item wxART\_COPY
+\item wxART\_CUT
+\item wxART\_PASTE
+\item wxART\_UNDO
+\item wxART\_REDO
+\item wxART\_QUIT
+\item wxART\_FIND
+\item wxART\_FIND\_AND\_REPLACE
+\item wxART\_HARDDISK
+\item wxART\_FLOPPY
+\item wxART\_CDROM
+\item wxART\_REMOVABLE
+
\end{itemize}
-Additionally, any string recognized by custom art providers registered using
-\helpref{PushProvider}{wxartproviderpushprovider} may be used.
+Additionally, any string recognized by custom art providers registered using
+\helpref{Push}{wxartproviderpush} may be used.
\wxheading{GTK+ Note}
icons, so wxArtProvider may return {\tt wxNullBitmap} or {\tt wxNullIcon}.
Default theme is typically installed in {\tt /usr/share/icons/hicolor}.
+
\membersection{Clients}\label{artproviderclients}
Client is the entity that calls wxArtProvider's GetBitmap or GetIcon
\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxArtProvider::\destruct{wxArtProvider}}\label{wxartproviderdtor}
+
+\func{}{\destruct{wxArtProvider}}{\void}
+
+The destructor automatically removes the provider from the provider stack used
+by \helpref{GetBitmap}{wxartprovidergetbitmap}.
+
+
\membersection{wxArtProvider::CreateBitmap}\label{wxartprovidercreatebitmap}
\func{wxBitmap}{CreateBitmap}{\param{const wxArtID\& }{id}, \param{const wxArtClient\& }{client}, \param{const wxSize\& }{size}}
\helpref{wxArtProvider::GetIcon}{wxartprovidergeticon}
to query wxArtProvider for a resource.
+
+\membersection{wxArtProvider::Delete}\label{wxartproviderdelete}
+
+\func{static bool}{Delete}{\param{wxArtProvider* }{provider}}
+
+Delete the given \arg{provider}.
+
+
\membersection{wxArtProvider::GetBitmap}\label{wxartprovidergetbitmap}
\func{static wxBitmap}{GetBitmap}{\param{const wxArtID\& }{id}, \param{const wxArtClient\& }{client = wxART\_OTHER}, \param{const wxSize\& }{size = wxDefaultSize}}
The bitmap if one of registered providers recognizes the ID or wxNullBitmap otherwise.
+
\membersection{wxArtProvider::GetIcon}\label{wxartprovidergeticon}
\func{static wxIcon}{GetIcon}{\param{const wxArtID\& }{id}, \param{const wxArtClient\& }{client = wxART\_OTHER}, \param{const wxSize\& }{size = wxDefaultSize}}
otherwise return the size from the topmost wxArtProvider. {\it wxDefaultSize} may be
returned if the client doesn't have a specified size, like wxART\_OTHER for example.
-\membersection{wxArtProvider::PopProvider}\label{wxartproviderctor}
-\func{static bool}{PopProvider}{\void}
+\membersection{wxArtProvider::Insert}\label{wxartproviderinsert}
+
+\func{static void}{Insert}{\param{wxArtProvider* }{provider}}
+
+Register new art provider and add it to the bottom of providers stack (i.e.
+it will be queried as the last one).
+
+\wxheading{See also}
+
+\helpref{Push}{wxartproviderpush}
+
+
+\membersection{wxArtProvider::Pop}\label{wxartproviderctor}
+
+\func{static bool}{Pop}{\void}
Remove latest added provider and delete it.
-\membersection{wxArtProvider::PushProvider}\label{wxartproviderpushprovider}
-\func{static void}{PushProvider}{\param{wxArtProvider* }{provider}}
+\membersection{wxArtProvider::Push}\label{wxartproviderpush}
+
+\func{static void}{Push}{\param{wxArtProvider* }{provider}}
+
+Register new art provider and add it to the top of providers stack (i.e. it
+will be queried as the first provider).
+
+\wxheading{See also}
+
+\helpref{Insert}{wxartproviderinsert}
-Register new art provider (add it to the top of providers stack).
-\membersection{wxArtProvider::RemoveProvider}\label{wxartproviderremoveprovider}
+\membersection{wxArtProvider::Remove}\label{wxartproviderremove}
-\func{static bool}{RemoveProvider}{\param{wxArtProvider* }{provider}}
+\func{static bool}{Remove}{\param{wxArtProvider* }{provider}}
-Remove a provider from the stack. The provider must have been added previously
-and is {\it not} deleted.
+Remove a provider from the stack if it is on it. The provider is {\emph not}
+deleted, unlike when using \helpref{Delete()}{wxartproviderdelete}.