]>
git.saurik.com Git - wxWidgets.git/blob - src/common/artstd.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: stock wxArtProvider instance with default wxWin art
4 // Author: Vaclav Slavik
8 // Copyright: (c) Vaclav Slavik
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ---------------------------------------------------------------------------
14 // ---------------------------------------------------------------------------
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
19 #if defined(__BORLANDC__)
24 #if WXWIN_COMPATIBILITY_2_2
29 #include "wx/artprov.h"
31 // ----------------------------------------------------------------------------
32 // wxDefaultArtProvider
33 // ----------------------------------------------------------------------------
35 class wxDefaultArtProvider
: public wxArtProvider
38 virtual wxBitmap
CreateBitmap(const wxArtID
& id
, const wxArtClient
& client
,
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 // Standard macro for getting a resource from XPM file:
47 #define ART(artId, xpmRc) \
48 if ( id == artId ) return wxBitmap(xpmRc##_xpm);
50 // There are two ways of getting the standard icon: either via XPMs or via
51 // wxIcon ctor. This depends on the platform:
52 #if defined(__WXUNIVERSAL__)
53 #define CREATE_STD_ICON(iconId, xpmRc) return wxNullBitmap;
54 #elif defined(__WXGTK__) || defined(__WXMOTIF__)
55 #define CREATE_STD_ICON(iconId, xpmRc) return wxBitmap(xpmRc##_xpm);
57 #define CREATE_STD_ICON(iconId, xpmRc) \
59 wxIcon icon(_T(iconId)); \
61 bmp.CopyFromIcon(icon); \
66 // Macro used in CreateBitmap to get wxICON_FOO icons:
67 #define ART_MSGBOX(artId, iconId, xpmRc) \
70 CREATE_STD_ICON(#iconId, xpmRc) \
73 // ----------------------------------------------------------------------------
74 // wxArtProvider::InitStdProvider
75 // ----------------------------------------------------------------------------
77 /*static*/ void wxArtProvider::InitStdProvider()
79 wxArtProvider::PushProvider(new wxDefaultArtProvider
);
82 #if !defined(__WXGTK20__) || defined(__WXUNIVERSAL__)
83 /*static*/ void wxArtProvider::InitNativeProvider()
89 // ----------------------------------------------------------------------------
91 // ----------------------------------------------------------------------------
93 // XPM hack: make the arrays const
94 #define static static const
96 #if defined(__WXGTK__)
97 #include "../../art/gtk/info.xpm"
98 #include "../../art/gtk/error.xpm"
99 #include "../../art/gtk/warning.xpm"
100 #include "../../art/gtk/question.xpm"
101 #elif defined(__WXMOTIF__)
102 #include "../../art/motif/info.xpm"
103 #include "../../art/motif/error.xpm"
104 #include "../../art/motif/warning.xpm"
105 #include "../../art/motif/question.xpm"
109 #include "../../art/htmsidep.xpm"
110 #include "../../art/htmoptns.xpm"
111 #include "../../art/htmbook.xpm"
112 #include "../../art/htmfoldr.xpm"
113 #include "../../art/htmpage.xpm"
116 #include "../../art/missimg.xpm"
117 #include "../../art/addbookm.xpm"
118 #include "../../art/delbookm.xpm"
119 #include "../../art/back.xpm"
120 #include "../../art/forward.xpm"
121 #include "../../art/up.xpm"
122 #include "../../art/down.xpm"
123 #include "../../art/toparent.xpm"
124 #include "../../art/fileopen.xpm"
125 #include "../../art/print.xpm"
126 #include "../../art/helpicon.xpm"
127 #include "../../art/tipicon.xpm"
128 #include "../../art/home.xpm"
129 #include "../../art/repview.xpm"
130 #include "../../art/listview.xpm"
131 #include "../../art/new_dir.xpm"
132 #include "../../art/folder.xpm"
133 #include "../../art/dir_up.xpm"
134 #include "../../art/exefile.xpm"
135 #include "../../art/deffile.xpm"
136 #include "../../art/tick.xpm"
137 #include "../../art/cross.xpm"
141 // ----------------------------------------------------------------------------
142 // CreateBitmap routine
143 // ----------------------------------------------------------------------------
145 wxBitmap
wxDefaultArtProvider::CreateBitmap(const wxArtID
& id
,
146 const wxArtClient
& WXUNUSED(client
),
147 const wxSize
& WXUNUSED(size
))
149 // wxMessageBox icons:
150 ART_MSGBOX(wxART_ERROR
, wxICON_ERROR
, error
)
151 ART_MSGBOX(wxART_INFORMATION
, wxICON_INFORMATION
, info
)
152 ART_MSGBOX(wxART_WARNING
, wxICON_WARNING
, warning
)
153 ART_MSGBOX(wxART_QUESTION
, wxICON_QUESTION
, question
)
157 ART(wxART_HELP_SIDE_PANEL
, htmsidep
)
158 ART(wxART_HELP_SETTINGS
, htmoptns
)
159 ART(wxART_HELP_BOOK
, htmbook
)
160 ART(wxART_HELP_FOLDER
, htmfoldr
)
161 ART(wxART_HELP_PAGE
, htmpage
)
163 ART(wxART_MISSING_IMAGE
, missimg
)
164 ART(wxART_ADD_BOOKMARK
, addbookm
)
165 ART(wxART_DEL_BOOKMARK
, delbookm
)
166 ART(wxART_GO_BACK
, back
)
167 ART(wxART_GO_FORWARD
, forward
)
169 ART(wxART_GO_DOWN
, down
)
170 ART(wxART_GO_TO_PARENT
, toparent
)
171 ART(wxART_GO_HOME
, home
)
172 ART(wxART_FILE_OPEN
, fileopen
)
173 ART(wxART_PRINT
, print
)
174 ART(wxART_HELP
, helpicon
)
175 ART(wxART_TIP
, tipicon
)
176 ART(wxART_REPORT_VIEW
, repview
)
177 ART(wxART_LIST_VIEW
, listview
)
178 ART(wxART_NEW_DIR
, new_dir
)
179 ART(wxART_FOLDER
, folder
)
180 ART(wxART_GO_DIR_UP
, dir_up
)
181 ART(wxART_EXECUTABLE_FILE
, exefile
)
182 ART(wxART_NORMAL_FILE
, deffile
)
183 ART(wxART_TICK_MARK
, tick
)
184 ART(wxART_CROSS_MARK
, cross
)