]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/wince/helpwce.cpp
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     Help system: Windows CE help implementation 
   4 // Author:      Julian Smart 
   8 // Copyright:   (c) Julian Smart 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 
  13     #pragma implementation "helpwce.h" 
  16 // For compilers that support precompilation, includes "wx.h". 
  17 #include "wx/wxprec.h" 
  25 #include "wx/filefn.h" 
  26 #include "wx/msw/wince/helpwce.h" 
  32 #include "wx/msw/private.h" 
  33 #include "wx/msw/missing.h" 
  35 IMPLEMENT_DYNAMIC_CLASS(wxWinceHelpController
, wxHelpControllerBase
) 
  37 bool wxWinceHelpController::Initialize(const wxString
& filename
) 
  39     m_helpFile 
= filename
; 
  43 bool wxWinceHelpController::LoadFile(const wxString
& file
) 
  50 bool wxWinceHelpController::DisplayContents() 
  56 bool wxWinceHelpController::DisplaySection(const wxString
& section
) 
  58     return ViewURL(section
); 
  62 bool wxWinceHelpController::DisplaySection(int WXUNUSED(section
)) 
  67 bool wxWinceHelpController::DisplayContextPopup(int WXUNUSED(contextId
)) 
  72 bool wxWinceHelpController::DisplayTextPopup(const wxString
& WXUNUSED(text
), const wxPoint
& WXUNUSED(pos
)) 
  77 bool wxWinceHelpController::DisplayBlock(long WXUNUSED(block
)) 
  82 bool wxWinceHelpController::KeywordSearch(const wxString
& WXUNUSED(k
), 
  83                                wxHelpSearchMode 
WXUNUSED(mode
)) 
  88 bool wxWinceHelpController::Quit() 
  93 // Append extension if necessary. 
  94 wxString 
wxWinceHelpController::GetValidFilename(const wxString
& file
) const 
  96     wxString path
, name
, ext
; 
  97     wxSplitPath(file
, & path
, & name
, & ext
); 
 101         fullName 
= name 
+ wxT(".htm"); 
 102     else if (path
.Last() == wxT('\\')) 
 103         fullName 
= path 
+ name 
+ wxT(".htm"); 
 105         fullName 
= path 
+ wxT("\\") + name 
+ wxT(".htm"); 
 110 bool wxWinceHelpController::ViewURL(const wxString
& topic
) 
 112     if (m_helpFile
.IsEmpty()) return false; 
 114     wxString 
url( wxT("file:") + GetValidFilename(m_helpFile
) ); 
 115     if (!topic
.IsEmpty()) 
 116         url 
= url 
+ wxT("#") + topic
; 
 118     return CreateProcess(wxT("peghelp.exe"), 
 119         url
, NULL
, NULL
, FALSE
, 0, NULL
, 
 120         NULL
, NULL
, NULL
) != 0 ;