X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca65c0440a7163e4e37e48b1c4329709d722db47..7ea1c917764fb2588fe1aadc75c49ba300f8cb2f:/src/generic/helpext.cpp?ds=sidebyside diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp index 78a30c12ae..1bf7d2b43d 100644 --- a/src/generic/helpext.cpp +++ b/src/generic/helpext.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpext.cpp +// Name: src/generic/helpext.cpp // Purpose: an external help controller for wxWidgets // Author: Karsten Ballueder // Modified by: @@ -9,20 +9,15 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -# pragma implementation "wxexthlp.h" -#endif - #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif -#if wxUSE_HELP && !defined(__WXWINCE__) +#if wxUSE_HELP && !defined(__WXWINCE__) && (!defined(__WXMAC__) || defined(__WXMAC_OSX__)) #ifndef WX_PRECOMP - #include "wx/setup.h" #include "wx/string.h" #include "wx/utils.h" #include "wx/list.h" @@ -43,8 +38,13 @@ #include #endif +#ifdef __WINDOWS__ +#include "wx/msw/mslu.h" +#endif + #ifdef __WXMSW__ #include +#include "wx/msw/winundef.h" #endif // ---------------------------------------------------------------------------- @@ -73,7 +73,8 @@ IMPLEMENT_CLASS(wxExtHelpController, wxHelpControllerBase) and a file mapping numerical Section numbers to relative URLS. */ -wxExtHelpController::wxExtHelpController() +wxExtHelpController::wxExtHelpController(wxWindow* parentWindow): + wxHelpControllerBase(parentWindow) { m_MapList = (wxList*) NULL; m_NumOfEntries = 0; @@ -124,7 +125,7 @@ wxExtHelpController::DisplayHelp(const wxString &relativeURL) } return true; -#elif defined(__WXPM__) +#elif defined(__OS2__) wxString url; url << m_MapFile << '\\' << relativeURL.BeforeFirst('#'); @@ -231,14 +232,12 @@ bool wxExtHelpController::LoadFile(const wxString& ifile) wxBusyCursor b; // display a busy cursor - if(! ifile.IsEmpty()) + if(! ifile.empty()) { file = ifile; if(! wxIsAbsolutePath(file)) { - wxChar* f = wxGetWorkingDirectory(); - file = f; - delete[] f; // wxGetWorkingDirectory returns new memory + file = wxGetCwd(); #ifdef __WXMAC__ file << ifile; #else @@ -254,7 +253,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile) // set to be "de", then look in "/usr/local/myapp/help/de/" // first and fall back to "/usr/local/myapp/help" if that // doesn't exist. - if(wxGetLocale() && !wxGetLocale()->GetName().IsEmpty()) + if(wxGetLocale() && !wxGetLocale()->GetName().empty()) { wxString newfile; newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName(); @@ -346,7 +345,7 @@ wxExtHelpController::DisplayContents() file << m_MapFile << WXEXTHELP_SEPARATOR << contents; if(file.Contains(wxT('#'))) file = file.BeforeLast(wxT('#')); - if(contents.Length() && wxFileExists(file)) + if(contents.length() && wxFileExists(file)) rc = DisplaySection(CONTENTS_ID); // if not found, open homemade toc: @@ -401,7 +400,7 @@ wxExtHelpController::KeywordSearch(const wxString& k, int idx = 0, j; bool rc; - bool showAll = k.IsEmpty(); + bool showAll = k.empty(); wxList::compatibility_iterator node = m_MapList->GetFirst(); wxExtHelpMapEntry *entry; @@ -412,12 +411,12 @@ wxExtHelpController::KeywordSearch(const wxString& k, { entry = (wxExtHelpMapEntry *)node->GetData(); compB = entry->doc; compB.LowerCase(); - if((showAll || compB.Contains(k)) && ! compB.IsEmpty()) + if((showAll || compB.Contains(k)) && ! compB.empty()) { urls[idx] = entry->url; // doesn't work: // choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR)); - //if(choices[idx].IsEmpty()) // didn't contain the ';' + //if(choices[idx].empty()) // didn't contain the ';' // choices[idx] = (**i).doc; choices[idx] = wxEmptyString; for(j=0;entry->doc.c_str()[j] @@ -464,4 +463,3 @@ void wxExtHelpController::OnQuit() #endif // wxUSE_HELP -