]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/wince/helpwce.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/wince/helpwce.cpp
3 // Purpose: Help system: Windows CE help implementation
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
20 #include "wx/filefn.h"
21 #include "wx/msw/wince/helpwce.h"
24 #include "wx/msw/missing.h"
28 #include "wx/msw/private.h"
30 IMPLEMENT_DYNAMIC_CLASS(wxWinceHelpController
, wxHelpControllerBase
)
32 bool wxWinceHelpController::Initialize(const wxString
& filename
)
34 m_helpFile
= filename
;
38 bool wxWinceHelpController::LoadFile(const wxString
& file
)
45 bool wxWinceHelpController::DisplayContents()
51 bool wxWinceHelpController::DisplaySection(const wxString
& section
)
53 return ViewURL(section
);
57 bool wxWinceHelpController::DisplaySection(int WXUNUSED(section
))
62 bool wxWinceHelpController::DisplayContextPopup(int WXUNUSED(contextId
))
67 bool wxWinceHelpController::DisplayTextPopup(const wxString
& WXUNUSED(text
), const wxPoint
& WXUNUSED(pos
))
72 bool wxWinceHelpController::DisplayBlock(long WXUNUSED(block
))
77 bool wxWinceHelpController::KeywordSearch(const wxString
& WXUNUSED(k
),
78 wxHelpSearchMode
WXUNUSED(mode
))
83 bool wxWinceHelpController::Quit()
88 // Append extension if necessary.
89 wxString
wxWinceHelpController::GetValidFilename(const wxString
& file
) const
91 wxString path
, name
, ext
;
92 wxFileName::SplitPath(file
, & path
, & name
, & ext
);
96 fullName
= name
+ wxT(".htm");
97 else if (path
.Last() == wxT('\\'))
98 fullName
= path
+ name
+ wxT(".htm");
100 fullName
= path
+ wxT("\\") + name
+ wxT(".htm");
102 if (!wxFileExists(fullName
))
103 fullName
= wxT("\\Windows\\") + name
+ wxT(".htm");
109 bool wxWinceHelpController::ViewURL(const wxString
& topic
)
111 if (m_helpFile
.empty()) return false;
113 wxString
url( wxT("file:") + GetValidFilename(m_helpFile
) );
115 url
= url
+ wxT("#") + topic
;
117 return CreateProcess(wxT("peghelp.exe"),
118 url
, NULL
, NULL
, FALSE
, 0, NULL
,
119 NULL
, NULL
, NULL
) != 0 ;