/* WARNING: This file was generated by dkct. Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: DkWxHelpController.cpt */ /* Copyright (C) 2011-2017, Dirk Krause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above opyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file DkWxHelpController.cpp The DkWxHelpController module. */ #line 91 "DkWxHelpController.cpt" #include "dk3all.h" #include "DkWxAppHelper.h" #include "DkWxHelpController.h" #include "dk3wxs.h" #line 101 "DkWxHelpController.cpt" DkWxHelpController::DkWxHelpController( DkWxAppHelper *ah, wxChar const *chmName, wxChar const *htbName ) #ifdef __WXMSW__ #else : hc(wxHF_DEFAULT_STYLE | wxHF_MERGE_BOOKS) #endif { wxChar fnb[DK3_MAX_PATH]; appHelper = ah; bFileFound = false; #line 120 "DkWxHelpController.cpt" #ifdef __WXMSW__ #line 122 "DkWxHelpController.cpt" if((appHelper) && (chmName)) { if(appHelper->findDataFile(chmName, fnb, DK3_SIZEOF(fnb,wxChar))) { hc.Initialize(fnb); bFileFound = true; } } #else wxZipFSHandler *zfsh; #line 131 "DkWxHelpController.cpt" if((ah) && (htbName)) { if(appHelper->findDataFile(htbName, fnb, DK3_SIZEOF(fnb,wxChar))) { zfsh = new wxZipFSHandler(); if(zfsh) { wxFileSystem::AddHandler(zfsh); hc.AddBook(fnb); bFileFound = true; } } } #endif #line 143 "DkWxHelpController.cpt" } void DkWxHelpController::openHelp(wxFrame *wxf) { wxChar const *titleString; wxChar const *msgString; #line 153 "DkWxHelpController.cpt" if(bFileFound) { hc.DisplayContents(); } else { if(appHelper) { titleString = appHelper->getBasicString(3); msgString = appHelper->getBasicString(10); wxMessageBox(msgString, titleString, wxOK, wxf); } } #line 162 "DkWxHelpController.cpt" } void DkWxHelpController::openHelpSectionByName(wxFrame *wxf, wxString const & name) { wxChar const *titleString; wxChar const *msgString; #line 172 "DkWxHelpController.cpt" if (bFileFound) { hc.DisplaySection(name); } else { if (appHelper) { titleString = appHelper->getBasicString(3); msgString = appHelper->getBasicString(10); wxMessageBox(msgString, titleString, wxOK, wxf); } } #line 182 "DkWxHelpController.cpt" } void DkWxHelpController::openHelpSectionByNumber(wxFrame *wxf, int number) { wxChar const *titleString; wxChar const *msgString; #line 192 "DkWxHelpController.cpt" if (bFileFound) { hc.DisplaySection(number); } else { titleString = appHelper->getBasicString(3); msgString = appHelper->getBasicString(10); wxMessageBox(msgString, titleString, wxOK, wxf); } #line 200 "DkWxHelpController.cpt" }