]>
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 section
)
67 bool wxWinceHelpController::DisplayContextPopup(int contextId
)
72 bool wxWinceHelpController::DisplayTextPopup(const wxString
& text
, const wxPoint
& pos
)
77 bool wxWinceHelpController::DisplayBlock(long block
)
82 bool wxWinceHelpController::KeywordSearch(const wxString
& k
)
87 bool wxWinceHelpController::Quit()
92 // Append extension if necessary.
93 wxString
wxWinceHelpController::GetValidFilename(const wxString
& file
) const
95 wxString path
, name
, ext
;
96 wxSplitPath(file
, & path
, & name
, & ext
);
100 fullName
= name
+ wxT(".htm");
101 else if (path
.Last() == wxT('\\'))
102 fullName
= path
+ name
+ wxT(".htm");
104 fullName
= path
+ wxT("\\") + name
+ wxT(".htm");
109 bool wxWinceHelpController::ViewURL(const wxString
& topic
)
111 if (m_helpFile
.IsEmpty()) return FALSE
;
113 wxString
url( wxT("file:") + GetValidFilename(m_helpFile
) );
114 if (!topic
.IsEmpty())
115 url
= url
+ wxT("#") + topic
;
117 return CreateProcess(wxT("peghelp.exe"),
118 url
, NULL
, NULL
, FALSE
, 0, NULL
,
119 NULL
, NULL
, NULL
) != 0 ;