X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fctsim.cpp;h=fe9586754b741a0fcaaf3da6e77db9b817f28b13;hp=64f7119ef367a7fac84d73df8d55f724f1308f49;hb=9f29c8b32c972db1178d6f8551d5cd57ceb67083;hpb=475d51bff7ebb2ca46bd569de248287b28d1bd8a diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 64f7119..fe95867 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.50 2001/01/27 21:40:12 kevin Exp $ +** $Id: ctsim.cpp,v 1.54 2001/01/28 19:10:18 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 @@ -70,7 +70,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.50 2001/01/27 21:40:12 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.54 2001/01/28 19:10:18 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -166,13 +166,6 @@ CTSimApp::OnInit() if (m_pConfig) m_docManager->FileHistoryLoad(*m_pConfig); -#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"); - #ifdef CTSIM_MDI TextFileDocument* pLogDoc = newTextDoc(); if (pLogDoc) { @@ -191,6 +184,13 @@ CTSimApp::OnInit() #endif wxLog::SetActiveTarget (new wxLogTextCtrl(m_pLog)); +#ifdef CTSIM_WINHELP + if (! m_pFrame->getWinHelpController().Initialize("ctsim")) + *m_pLog << "Cannot initialize the Windows Help system" << "\n"; +#endif + if (! m_pFrame->getHtmlHelpController().Initialize(::wxGetCwd() + "/ctsim")) + *m_pLog << "Cannot initialize the HTML Help system" << "\n"; + return true; } @@ -371,6 +371,7 @@ MainFrame::~MainFrame() if (theApp->getConfig()) theApp->getDocManager()->FileHistorySave (*theApp->getConfig()); delete theApp->getDocManager(); + } void @@ -441,7 +442,7 @@ MainFrame::OnCreateFilter (wxCommandEvent& WXUNUSED(event)) << ", inputScale=" << m_dDefaultFilterInputScale << ", outputScale=" << m_dDefaultFilterOutputScale; *theApp->getLog() << os.str().c_str() << "\n"; wxString filename = "untitled.if"; - ImageFileDocument* pFilterDoc = dynamic_cast(theApp->getDocManager()->CreateDocument ("untitled.if", wxDOC_SILENT)); + ImageFileDocument* pFilterDoc = theApp->newImageDoc(); if (! pFilterDoc) { sys_error (ERR_SEVERE, "Unable to create filter image"); return; @@ -454,6 +455,8 @@ MainFrame::OnCreateFilter (wxCommandEvent& WXUNUSED(event)) pFilterDoc->Modify (true); pFilterDoc->UpdateAllViews(); pFilterDoc->GetFirstView()->OnUpdate (NULL, NULL); + pFilterDoc->getView()->getFrame()->SetClientSize(m_iDefaultFilterXSize, m_iDefaultFilterYSize); + pFilterDoc->getView()->getFrame()->Show(true); } }