X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/665b71b17c8eb8f2586a8c84f8d9cf0d8559bf35..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/msw/wince/helpwce.cpp diff --git a/src/msw/wince/helpwce.cpp b/src/msw/wince/helpwce.cpp index 1e6a0b19a8..10aed8a102 100644 --- a/src/msw/wince/helpwce.cpp +++ b/src/msw/wince/helpwce.cpp @@ -1,18 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpwce.h +// Name: src/msw/wince/helpwce.cpp // Purpose: Help system: Windows CE help implementation // Author: Julian Smart // Modified by: // Created: 2003-07-12 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "helpwce.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -26,11 +22,11 @@ #include "wx/msw/wince/helpwce.h" #ifndef WX_PRECOMP + #include "wx/msw/missing.h" #include "wx/intl.h" #endif #include "wx/msw/private.h" -#include "wx/msw/missing.h" IMPLEMENT_DYNAMIC_CLASS(wxWinceHelpController, wxHelpControllerBase) @@ -42,7 +38,7 @@ bool wxWinceHelpController::Initialize(const wxString& filename) bool wxWinceHelpController::LoadFile(const wxString& file) { - if (!file.IsEmpty()) + if (!file.empty()) m_helpFile = file; return true; } @@ -87,7 +83,7 @@ bool wxWinceHelpController::KeywordSearch(const wxString& WXUNUSED(k), bool wxWinceHelpController::Quit() { - return TRUE; + return true; } // Append extension if necessary. @@ -97,22 +93,26 @@ wxString wxWinceHelpController::GetValidFilename(const wxString& file) const wxSplitPath(file, & path, & name, & ext); wxString fullName; - if (path.IsEmpty()) + if (path.empty()) fullName = name + wxT(".htm"); else if (path.Last() == wxT('\\')) fullName = path + name + wxT(".htm"); else fullName = path + wxT("\\") + name + wxT(".htm"); + + if (!wxFileExists(fullName)) + fullName = wxT("\\Windows\\") + name + wxT(".htm"); + return fullName; } // View URL bool wxWinceHelpController::ViewURL(const wxString& topic) { - if (m_helpFile.IsEmpty()) return FALSE; - + if (m_helpFile.empty()) return false; + wxString url( wxT("file:") + GetValidFilename(m_helpFile) ); - if (!topic.IsEmpty()) + if (!topic.empty()) url = url + wxT("#") + topic; return CreateProcess(wxT("peghelp.exe"), @@ -121,4 +121,3 @@ bool wxWinceHelpController::ViewURL(const wxString& topic) } #endif // wxUSE_HELP -