+bool MyApp::OpenBook(wxHtmlHelpController* controller)
+{
+ wxString s = wxFileSelector(_("Open help file"),
+ wxGetCwd(),
+ wxEmptyString,
+ wxEmptyString,
+ _(
+"Help books (*.htb)|*.htb|Help books (*.zip)|*.zip|\
+HTML Help Project (*.hhp)|*.hhp"),
+ wxOPEN | wxFILE_MUST_EXIST,
+ NULL);
+
+ if (!s.IsEmpty())
+ {
+ wxString ext = s.Right(4).Lower();
+ if (ext == _T(".zip") || ext == _T(".htb") || ext == _T(".hhp"))
+ {
+ wxBusyCursor bcur;
+ controller->AddBook(s);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+#if USE_ALTERNATE_UI
+
+/*
+ * Art provider class
+ */
+
+// ---------------------------------------------------------------------
+// helper macros
+// ---------------------------------------------------------------------
+
+// Standard macro for getting a resource from XPM file:
+#define ART(artId, xpmRc) \
+ if ( id == artId ) return wxBitmap(xpmRc##_xpm);
+
+// Compatibility hack to use wxApp::GetStdIcon of overriden by the user
+#if WXWIN_COMPATIBILITY_2_2
+ #define GET_STD_ICON_FROM_APP(iconId) \
+ if ( client == wxART_MESSAGE_BOX ) \
+ { \
+ wxIcon icon = wxTheApp->GetStdIcon(iconId); \
+ if ( icon.Ok() ) \
+ { \
+ wxBitmap bmp; \
+ bmp.CopyFromIcon(icon); \
+ return bmp; \
+ } \
+ }
+#else
+ #define GET_STD_ICON_FROM_APP(iconId)
+#endif
+
+// There are two ways of getting the standard icon: either via XPMs or via
+// wxIcon ctor. This depends on the platform:
+#if defined(__WXUNIVERSAL__)
+ #define CREATE_STD_ICON(iconId, xpmRc) return wxNullBitmap;
+#elif defined(__WXGTK__) || defined(__WXMOTIF__)
+ #define CREATE_STD_ICON(iconId, xpmRc) return wxBitmap(xpmRc##_xpm);
+#else
+ #define CREATE_STD_ICON(iconId, xpmRc) \
+ { \
+ wxIcon icon(_T(iconId)); \
+ wxBitmap bmp; \
+ bmp.CopyFromIcon(icon); \
+ return bmp; \
+ }
+#endif
+
+// Macro used in CreateBitmap to get wxICON_FOO icons:
+#define ART_MSGBOX(artId, iconId, xpmRc) \
+ if ( id == artId ) \
+ { \
+ GET_STD_ICON_FROM_APP(iconId) \
+ CREATE_STD_ICON(#iconId, xpmRc) \
+ }
+
+// ---------------------------------------------------------------------
+// XPMs with the art
+// ---------------------------------------------------------------------
+
+// XPM hack: make the arrays const
+//#define static static const
+
+#include "bitmaps/helpback.xpm"
+#include "bitmaps/helpbook.xpm"
+#include "bitmaps/helpdown.xpm"
+#include "bitmaps/helpforward.xpm"
+#include "bitmaps/helpoptions.xpm"
+#include "bitmaps/helppage.xpm"
+#include "bitmaps/helpsidepanel.xpm"
+#include "bitmaps/helpup.xpm"
+#include "bitmaps/helpuplevel.xpm"
+#include "bitmaps/helpicon.xpm"
+#include "bitmaps/helpopen.xpm"
+
+//#undef static
+
+// ---------------------------------------------------------------------
+// CreateBitmap routine
+// ---------------------------------------------------------------------
+
+wxBitmap AlternateArtProvider::CreateBitmap(const wxArtID& id,
+ const wxArtClient& client,
+ const wxSize& WXUNUSED(size))
+{
+ ART(wxART_HELP_SIDE_PANEL, helpsidepanel)
+ ART(wxART_HELP_SETTINGS, helpoptions)
+ ART(wxART_HELP_BOOK, helpbook)
+ ART(wxART_HELP_FOLDER, helpbook)
+ ART(wxART_HELP_PAGE, helppage)
+ //ART(wxART_ADD_BOOKMARK, addbookm)
+ //ART(wxART_DEL_BOOKMARK, delbookm)
+ ART(wxART_GO_BACK, helpback)
+ ART(wxART_GO_FORWARD, helpforward)
+ ART(wxART_GO_UP, helpup)
+ ART(wxART_GO_DOWN, helpdown)
+ ART(wxART_GO_TO_PARENT, helpuplevel)
+ ART(wxART_FILE_OPEN, helpopen)
+ if (client == wxART_HELP_BROWSER)
+ {
+ ART(wxART_FRAME_ICON, helpicon)
+ }
+
+ //ART(wxART_GO_HOME, home)
+
+ // Any wxWindows icons not implemented here
+ // will be provided by the default art provider.
+ return wxNullBitmap;
+}
+
+#endif
\ No newline at end of file