** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.37 2001/01/19 22:53:57 kevin Exp $
+** $Id: ctsim.cpp,v 1.38 2001/01/20 02:25:45 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#endif
#endif
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.37 2001/01/19 22:53:57 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.38 2001/01/20 02:25:45 kevin Exp $";
struct option CTSimApp::ctsimOptions[] =
{
setIconForFrame (m_pFrame);
- if (! m_pFrame->getHelpController().Initialize("ctsim"))
+#ifdef CTSIM_WINHELP
+ if (! m_pFrame->getWinHelpController().Initialize("ctsim"))
+ ::wxMessageBox ("Cannot initialize the help system", "Error");
+#endif
+ if (! m_pFrame->getHtmlHelpController().Initialize(::wxGetCwd() + "/ctsim"))
::wxMessageBox ("Cannot initialize the help system", "Error");
-
return true;
}
EVT_MENU(MAINMENU_HELP_ABOUT, MainFrame::OnAbout)
EVT_MENU(MAINMENU_HELP_CONTENTS, MainFrame::OnHelpContents)
EVT_MENU(MAINMENU_HELP_TOPICS, MainFrame::OnHelpTopics)
+#if defined(CTSIM_WINHELP) && (defined(DEBUG) || defined(_DEBUG))
+EVT_MENU(MAINMENU_HELP_SECONDARY, MainFrame::OnHelpSecondary)
+#endif
EVT_MENU(MAINMENU_FILE_CREATE_PHANTOM, MainFrame::OnCreatePhantom)
EVT_MENU(MAINMENU_FILE_CREATE_FILTER, MainFrame::OnCreateFilter)
EVT_MENU(MAINMENU_FILE_EXIT, MainFrame::OnExit)
wxMenu* help_menu = new wxMenu;
help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents\tF1");
help_menu->Append(MAINMENU_HELP_TOPICS, "&Topics\tCtrl-T");
+#if defined(CTSIM_WINHELP) && (defined(DEBUG) || defined(_DEBUG))
+ help_menu->Append(MAINMENU_HELP_SECONDARY, "&Secondary Help");
+#endif
help_menu->Append(MAINMENU_HELP_ABOUT, "&About");
wxMenuBar* menu_bar = new wxMenuBar;
showHelp (event.GetId());
}
+#if defined(CTSIM_WINHELP) && (defined(DEBUG) || defined(_DEBUG))
+void
+MainFrame::OnHelpSecondary (wxCommandEvent& event)
+{
+ m_htmlHelp.DisplayContents();
+}
+#endif
+
void
MainFrame::showHelp (int commandID)
{
- m_help.LoadFile();
+#ifdef CTSIM_WINHELP
+ m_winHelp.LoadFile();
+#else
+ m_htmlHelp.LoadFile();
+#endif
switch (commandID) {
+
case MAINMENU_HELP_CONTENTS:
- m_help.DisplayContents ();
+#ifdef CTSIM_WINHELP
+ m_winHelp.DisplayContents ();
+#else
+ m_htmlHelp.DisplayContents ();
+#endif
break;
+
case MAINMENU_HELP_TOPICS:
- m_help.DisplaySection (introduction);
+#ifdef CTSIM_WINHELP
+ m_winHelp.DisplaySection (introduction);
+#else
+ m_htmlHelp.DisplayIndex();
+#endif
break;
-
+
default:
*getLog() << "Unknown help command # " << commandID << "\n";
break;
BitmapControl* m_pBitmapCtrl;
public:
- BitmapDialog (wxBitmap* pBitmap);
+ BitmapDialog (wxBitmap* pBitmap, char const* pszTitle);
virtual ~BitmapDialog();
};
-BitmapDialog::BitmapDialog (wxBitmap* pBitmap)
-: wxDialog(theApp->getMainFrame(), -1, wxString("About"), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL)
+BitmapDialog::BitmapDialog (wxBitmap* pBitmap, char const* pszTitle)
+: wxDialog(theApp->getMainFrame(), -1, wxString(pszTitle), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
BitmapDialog::~BitmapDialog()
{}
-#include "./splash.xpm"
+#include "./splash.xpm"
void
MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- //
- // wxImage image;
- // if (wxFile::image.LoadFile ("/splash.png")) {
wxBitmap bmp (splash);
if (bmp.Ok()) {
- BitmapDialog dlg (&bmp);
+ BitmapDialog dlg (&bmp, "About CTSim");
dlg.Show(true);
} else {
wxString msg = "CTSim\nThe Open Source Computed Tomography Simulator\n";