]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/helpwce.cpp
don't ask for bounding rectangle of a hidden root, this fixes a crash introduced...
[wxWidgets.git] / src / msw / wince / helpwce.cpp
index 32a0b7ef2e9bcd92b416c815a15715d3521dd859..10aed8a102d07d87d5528494971b17a4b6dc66b4 100644 (file)
@@ -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:    wxWidgets 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"
 
 #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)
 
 bool wxWinceHelpController::Initialize(const wxString& filename)
 {
     m_helpFile = filename;
-    return TRUE;
+    return true;
 }
 
 bool wxWinceHelpController::LoadFile(const wxString& file)
 {
-    if (!file.IsEmpty())
+    if (!file.empty())
         m_helpFile = file;
-    return TRUE;
+    return true;
 }
 
 bool wxWinceHelpController::DisplayContents()
@@ -59,35 +55,35 @@ bool wxWinceHelpController::DisplaySection(const wxString& section)
 }
 
 // Use context number
-bool wxWinceHelpController::DisplaySection(int section)
+bool wxWinceHelpController::DisplaySection(int WXUNUSED(section))
 {
-    return TRUE;
+    return true;
 }
 
-bool wxWinceHelpController::DisplayContextPopup(int contextId)
+bool wxWinceHelpController::DisplayContextPopup(int WXUNUSED(contextId))
 {
-    return TRUE;
+    return true;
 }
 
-bool wxWinceHelpController::DisplayTextPopup(const wxString& text, const wxPoint& pos)
+bool wxWinceHelpController::DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos))
 {
-    return TRUE;
+    return true;
 }
 
-bool wxWinceHelpController::DisplayBlock(long block)
+bool wxWinceHelpController::DisplayBlock(long WXUNUSED(block))
 {
-    return TRUE;
+    return true;
 }
 
-bool wxWinceHelpController::KeywordSearch(const wxString& k,
-                               wxHelpSearchMode mode)
+bool wxWinceHelpController::KeywordSearch(const wxString& WXUNUSED(k),
+                               wxHelpSearchMode WXUNUSED(mode))
 {
-    return TRUE;
+    return true;
 }
 
 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
-