]> git.saurik.com Git - wxWidgets.git/blame - src/common/artstd.cpp
fixed the menu bug introduced by the previous commit
[wxWidgets.git] / src / common / artstd.cpp
CommitLineData
2aca4a98
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: artstd.cpp
3// Purpose: stock wxArtProvider instance with default wxWin art
4// Author: Vaclav Slavik
5// Modified by:
6// Created: 18/03/2002
7// RCS-ID: $Id$
8// Copyright: (c) Vaclav Slavik
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12// ---------------------------------------------------------------------------
13// headers
14// ---------------------------------------------------------------------------
15
2aca4a98
VS
16// For compilers that support precompilation, includes "wx.h".
17#include "wx/wxprec.h"
18
19#if defined(__BORLANDC__)
20 #pragma hdrstop
21#endif
22
23#include "wx/artprov.h"
24#include "wx/module.h"
25
e5f4aeb6
JS
26// For the purposes of forcing this module to link
27char g_ArtProviderModule = 0;
28
2aca4a98
VS
29// ----------------------------------------------------------------------------
30// wxDefaultArtProvider
31// ----------------------------------------------------------------------------
32
33class wxDefaultArtProvider : public wxArtProvider
34{
35protected:
57b0987b
VS
36 virtual wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client,
37 const wxSize& size);
2aca4a98
VS
38};
39
57b0987b
VS
40#define ART(artId, xpmRc) \
41 if ( id == artId ) return wxBitmap(xpmRc##_xpm);
42
2aca4a98
VS
43
44// ----------------------------------------------------------------------------
45// wxDefaultArtProviderModule
46// ----------------------------------------------------------------------------
47
48class wxDefaultArtProviderModule: public wxModule
49{
50public:
51 bool OnInit()
52 {
53 wxArtProvider::PushProvider(new wxDefaultArtProvider);
54 return TRUE;
55 }
56 void OnExit() {}
57
58 DECLARE_DYNAMIC_CLASS(wxDefaultArtProviderModule)
59};
60
61IMPLEMENT_DYNAMIC_CLASS(wxDefaultArtProviderModule, wxModule)
62
63
64// ----------------------------------------------------------------------------
65// XPMs with the art
66// ----------------------------------------------------------------------------
67
68// XPM hack: make the arrays const
69#define static static const
70
71#if wxUSE_HTML
57b0987b
VS
72 #include "../../art/htmsidep.xpm"
73 #include "../../art/htmoptns.xpm"
74 #include "../../art/htmbook.xpm"
75 #include "../../art/htmfoldr.xpm"
76 #include "../../art/htmpage.xpm"
2aca4a98
VS
77#endif // wxUSE_HTML
78
57b0987b
VS
79#include "../../art/addbookm.xpm"
80#include "../../art/delbookm.xpm"
81#include "../../art/back.xpm"
82#include "../../art/forward.xpm"
83#include "../../art/up.xpm"
84#include "../../art/down.xpm"
85#include "../../art/toparent.xpm"
86#include "../../art/fileopen.xpm"
87#include "../../art/print.xpm"
88#include "../../art/helpicon.xpm"
89#include "../../art/tipicon.xpm"
60d2cc25
VS
90#include "../../art/home.xpm"
91#include "../../art/repview.xpm"
92#include "../../art/listview.xpm"
93#include "../../art/new_dir.xpm"
94#include "../../art/folder.xpm"
95#include "../../art/dir_up.xpm"
96#include "../../art/exefile.xpm"
97#include "../../art/deffile.xpm"
00958db5
VS
98#include "../../art/tick.xpm"
99#include "../../art/cross.xpm"
2aca4a98
VS
100
101#undef static
102
103// ----------------------------------------------------------------------------
104// CreateBitmap routine
105// ----------------------------------------------------------------------------
106
57b0987b
VS
107wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
108 const wxArtClient& client,
2aca4a98
VS
109 const wxSize& size)
110{
111#if wxUSE_HTML
57b0987b
VS
112 ART(wxART_HELP_SIDE_PANEL, htmsidep)
113 ART(wxART_HELP_SETTINGS, htmoptns)
114 ART(wxART_HELP_BOOK, htmbook)
115 ART(wxART_HELP_FOLDER, htmfoldr)
116 ART(wxART_HELP_PAGE, htmpage)
2aca4a98 117#endif // wxUSE_HTML
57b0987b
VS
118 ART(wxART_ADD_BOOKMARK, addbookm)
119 ART(wxART_DEL_BOOKMARK, delbookm)
120 ART(wxART_GO_BACK, back)
121 ART(wxART_GO_FORWARD, forward)
122 ART(wxART_GO_UP, up)
123 ART(wxART_GO_DOWN, down)
124 ART(wxART_GO_TO_PARENT, toparent)
60d2cc25 125 ART(wxART_GO_HOME, home)
57b0987b
VS
126 ART(wxART_FILE_OPEN, fileopen)
127 ART(wxART_PRINT, print)
128 ART(wxART_HELP, helpicon)
129 ART(wxART_TIP, tipicon)
60d2cc25
VS
130 ART(wxART_REPORT_VIEW, repview)
131 ART(wxART_LIST_VIEW, listview)
132 ART(wxART_NEW_DIR, new_dir)
133 ART(wxART_FOLDER, folder)
134 ART(wxART_GO_DIR_UP, dir_up)
135 ART(wxART_EXECUTABLE_FILE, exefile)
136 ART(wxART_NORMAL_FILE, deffile)
00958db5
VS
137 ART(wxART_TICK_MARK, tick)
138 ART(wxART_CROSS_MARK, cross)
2aca4a98
VS
139
140 return wxNullBitmap;
141}