void OnCloseWindow(wxCloseEvent& event);
void OnActivate(wxActivateEvent& event);
+#ifdef __WXMAC__
+ void OnQuit(wxCommandEvent& event);
+ void OnAbout(wxCommandEvent& event);
+#endif
+
// Images:
enum {
IMG_Book = 0,
SetIcon(wxArtProvider::GetIcon(wxART_HELP, wxART_HELP_BROWSER));
+ // On the Mac, each modeless frame must have a menubar.
+ // TODO: add more menu items, and perhaps add a style to show
+ // the menubar: compulsory on the Mac, optional elsewhere.
+#ifdef __WXMAC__
+ wxMenuBar* menuBar = new wxMenuBar;
+
+ wxMenu* fileMenu = new wxMenu;
+ fileMenu->Append(wxID_HTML_OPENFILE, _("&Open..."));
+ fileMenu->Append(wxID_ABOUT, _("&About..."));
+ fileMenu->AppendSeparator();
+ fileMenu->Append(wxID_CLOSE, _("&Close"));
+
+// wxMenu* helpMenu = new wxMenu;
+// helpMenu->Append(wxID_ABOUT, _("&About..."));
+
+ menuBar->Append(fileMenu);
+ SetMenuBar(menuBar);
+#endif
+
int notebook_page = 0;
CreateStatusBar();
evt.Skip();
}
+#ifdef __WXMAC__
+void wxHtmlHelpFrame::OnQuit(wxCommandEvent& event)
+{
+ Close(TRUE);
+}
+
+void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event)
+{
+ wxMessageBox(wxT("wxWindows HTML Help Viewer (c) 1998-2003, Vaclav Slavik et al"), wxT("HelpView"),
+ wxICON_INFORMATION|wxOK, this);
+}
+#endif
+
BEGIN_EVENT_TABLE(wxHtmlHelpFrame, wxFrame)
EVT_ACTIVATE(wxHtmlHelpFrame::OnActivate)
EVT_TOOL_RANGE(wxID_HTML_PANEL, wxID_HTML_OPTIONS, wxHtmlHelpFrame::OnToolbar)
EVT_BUTTON(wxID_HTML_INDEXBUTTONALL, wxHtmlHelpFrame::OnIndexAll)
EVT_COMBOBOX(wxID_HTML_BOOKMARKSLIST, wxHtmlHelpFrame::OnBookmarksSel)
EVT_CLOSE(wxHtmlHelpFrame::OnCloseWindow)
+#ifdef __WXMAC__
+ EVT_MENU(wxID_CLOSE, wxHtmlHelpFrame::OnQuit)
+ EVT_MENU(wxID_ABOUT, wxHtmlHelpFrame::OnAbout)
+#endif
+
END_EVENT_TABLE()
#endif // wxUSE_WXHTML_HELP
# Microsoft Developer Studio Project File - Name="jpeg" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
-Microsoft Developer Studio Workspace File, Format Version 6.00
+Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
-# Microsoft Developer Studio Project File - Name="png" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="png" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
-Microsoft Developer Studio Workspace File, Format Version 6.00
+Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
# Microsoft Developer Studio Project File - Name="tiff" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
-Microsoft Developer Studio Workspace File, Format Version 6.00
+Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
#include "wx/wx.h"
#endif
+#include "wx/filename.h"
#include "wx/image.h"
#include "wx/wxhtml.h"
#include "wx/fs_zip.h"
wxArtProvider::PushProvider(new AlternateArtProvider);
+#ifdef __WXMAC__
+ wxFileName::MacRegisterDefaultTypeAndCreator( "htb" , 'HTBD' , 'HTBA' ) ;
+#endif
+
int istyle = wxHF_DEFAULT_STYLE;
wxString service, windowName, book[10], titleFormat, argStr;
}
}
- //no book - query user
+ // No book - query user; but not on Mac, since there
+ // may be an AppleEvent to open a document on the way
+#ifndef __WXMAC__
if ( bookCount < 1 )
{
wxString s = wxFileSelector( wxT("Open help file"),
bookCount = 1;
}
}
-
+#endif
+
#if hvUSE_IPC
if ( createServer ) {
return FALSE;
}
+#ifdef __WXMAC__
+/// Respond to Apple Event for opening a document
+void hvApp::MacOpenFile(const wxString& filename)
+{
+ wxBusyCursor bcur;
+ wxFileName fileName(filename);
+ m_helpController->AddBook(fileName);
+ m_helpController->DisplayContents();
+}
+#endif
+
+
/*
* Art provider class
*/
#pragma interface "help.cpp"
#endif
-#define hvVERSION 1.02
+#define hvVERSION 1.03
// If 1, start a server to allow this to be used
// as an external help viewer.
/// Clean up the application's data.
virtual int OnExit();
-
+
+#ifdef __WXMAC__
+ /// Respond to Apple Event for opening a document
+ virtual void MacOpenFile(const wxString& filename);
+#endif
+
/// Prompt the user for a book to open
bool OpenBook(wxHtmlHelpController* controller);