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::InsertProvider}\label{wxartproviderinsertprovider}
+
+\func{static void}{InsertProvider}{\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{PushProvider}{wxartproviderpushprovider}
+
\membersection{wxArtProvider::PopProvider}\label{wxartproviderctor}
\func{static bool}{PopProvider}{\void}
\func{static void}{PushProvider}{\param{wxArtProvider* }{provider}}
-Register new art provider (add it to the top of providers stack).
+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{InsertProvider}{wxartproviderinsertprovider}
\membersection{wxArtProvider::RemoveProvider}\label{wxartproviderremoveprovider}
class WXDLLEXPORT wxArtProvider : public wxObject
{
public:
- // Add new provider to the top of providers stack.
+ // Add new provider to the top of providers stack (i.e. the provider will
+ // be querier first of all).
static void PushProvider(wxArtProvider *provider);
+ // Add new provider to the bottom of providers stack (i.e. the provider
+ // will be queried as the last one).
+ static void InsertProvider(wxArtProvider *provider);
+
// Remove latest added provider and delete it.
static bool PopProvider();
{
return GetSizeHint(client, true);
}
-
+
// Derived classes must override this method to create requested
// art resource. This method is called only once per instance's
// lifetime for each requested wxArtID.
const wxArtClient& WXUNUSED(client),
const wxSize& WXUNUSED(size)) = 0;
+private:
+ static void InitProvidersList();
+
private:
// list of providers:
static wxArtProvidersList *sm_providers;
wxArtProvidersList *wxArtProvider::sm_providers = NULL;
wxArtProviderCache *wxArtProvider::sm_cache = NULL;
-/*static*/ void wxArtProvider::PushProvider(wxArtProvider *provider)
+/*static*/ void wxArtProvider::CommonAddingProvider()
{
if ( !sm_providers )
{
sm_cache = new wxArtProviderCache;
}
- sm_providers->Insert(provider);
sm_cache->Clear();
}
+/*static*/ void wxArtProvider::PushProvider(wxArtProvider *provider)
+{
+ CommonAddingProvider();
+ sm_providers->Insert(provider);
+}
+
+/*static*/ void wxArtProvider::InsertProvider(wxArtProvider *provider)
+{
+ CommonAddingProvider();
+ sm_providers->Append(provider);
+}
+
/*static*/ bool wxArtProvider::PopProvider()
{
wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") );