Example #1
0
bool wxBestHelpController::Initialize( const wxString& filename )
{
    // try wxCHMHelpController
    wxCHMHelpController* chm = new wxCHMHelpController;

    m_helpControllerType = wxUseChmHelp;
    // do not warn upon failure
    wxLogNull dontWarnOnFailure;

    if( chm->Initialize( GetValidFilename( filename ) ) )
    {
        m_helpController = chm;
        return true;
    }

    // failed
    delete chm;

    // try wxHtmlHelpController
    wxHtmlHelpController* html = new wxHtmlHelpController;

    m_helpControllerType = wxUseHtmlHelp;
    if( html->Initialize( GetValidFilename( filename ) ) )
    {
        m_helpController = html;
        return true;
    }

    // failed
    delete html;

    return false;
}
Example #2
0
bool wxWinHelpController::DisplayContextPopup(int contextId)
{
    if (m_helpFile.IsEmpty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return (WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXTPOPUP, (DWORD) contextId) != 0);
}
Example #3
0
bool wxWinHelpController::DisplayContextPopup(int contextId)
{
    if (m_helpFile.empty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_CONTEXTPOPUP, (DWORD) contextId) != 0);
}
Example #4
0
bool wxWinHelpController::DisplayContents(void)
{
    if (m_helpFile.empty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_FINDER, 0L) != 0);
}
Example #5
0
bool wxCHMHelpController::DisplayContents()
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_DISPLAY_TOPIC, 0L);
}
Example #6
0
bool wxWinHelpController::DisplaySection(int section)
{
    // Use context number
    if (m_helpFile.IsEmpty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return (WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section) != 0);
}
Example #7
0
bool wxWinHelpController::KeywordSearch(const wxString& k,
                                        wxHelpSearchMode WXUNUSED(mode))
{
    if (m_helpFile.IsEmpty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return (WinHelp(GetSuitableHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
}
Example #8
0
bool wxWinHelpController::DisplaySection(int section)
{
    // Use context number
    if (m_helpFile.empty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_CONTEXT, (DWORD)section) != 0);
}
Example #9
0
// Use context number
bool wxCHMHelpController::DisplaySection(int section)
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_HELP_CONTEXT,
                                (DWORD)section);
}
Example #10
0
bool wxWinHelpController::KeywordSearch(const wxString& k,
                                        wxHelpSearchMode WXUNUSED(mode))
{
    if (m_helpFile.empty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    return WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_PARTIALKEY,
                   (ULONG_PTR)k.wx_str()) != 0;
}
Example #11
0
// View URL
bool wxWinceHelpController::ViewURL(const wxString& topic)
{
    if (m_helpFile.IsEmpty()) return false;

    wxString url( wxT("file:") + GetValidFilename(m_helpFile) );
    if (!topic.IsEmpty())
        url = url + wxT("#") + topic;

    return CreateProcess(wxT("peghelp.exe"),
        url, NULL, NULL, FALSE, 0, NULL,
        NULL, NULL, NULL) != 0 ;
}
Example #12
0
bool wxWinHelpController::DisplayContents(void)
{
    if (m_helpFile.IsEmpty()) return false;

    wxString str = GetValidFilename(m_helpFile);

#if defined(__WIN95__)
    return (WinHelp(GetSuitableHWND(), (const wxChar*) str, HELP_FINDER, 0L) != 0);
#else
    return (WinHelp(GetSuitableHWND(), (const wxChar*) str, HELP_CONTENTS, 0L) != 0);
#endif
}
Example #13
0
// Use topic or HTML filename
bool wxCHMHelpController::DisplaySection(const wxString& section)
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    // Is this an HTML file or a keyword?
    if ( section.Find(wxT(".htm")) != wxNOT_FOUND )
    {
        // interpret as a file name
        return CallHtmlHelpFunction(GetParentWindow(), str, HH_DISPLAY_TOPIC,
                                    wxPtrToUInt(section.c_str()));
    }

    return KeywordSearch(section);
}
Example #14
0
bool wxCHMHelpController::KeywordSearch(const wxString& k,
                                        wxHelpSearchMode WXUNUSED(mode))
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    HH_AKLINK link;
    link.cbStruct =     sizeof(HH_AKLINK) ;
    link.fReserved =    FALSE ;
    link.pszKeywords =  k.c_str() ;
    link.pszUrl =       NULL ;
    link.pszMsgText =   NULL ;
    link.pszMsgTitle =  NULL ;
    link.pszWindow =    NULL ;
    link.fIndexOnFail = TRUE ;

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_KEYWORD_LOOKUP,
                                wxPtrToUInt(&link));
}
Example #15
0
bool wxCHMHelpController::DisplayContextPopup(int contextId)
{
    if (m_helpFile.IsEmpty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    // We also have to specify the popups file (default is cshelp.txt).
    // str += wxT("::/cshelp.txt");

    HH_POPUP popup;
    popup.cbStruct = sizeof(popup);
    popup.hinst = (HINSTANCE) wxGetInstance();
    popup.idString = contextId ;

    GetCursorPos(& popup.pt);
    popup.clrForeground = ::GetSysColor(COLOR_INFOTEXT);
    popup.clrBackground = ::GetSysColor(COLOR_INFOBK);
    popup.rcMargins.top = popup.rcMargins.left = popup.rcMargins.right = popup.rcMargins.bottom = -1;
    popup.pszFont = NULL;
    popup.pszText = NULL;

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_DISPLAY_TEXT_POPUP,
                                wxPtrToUInt(&popup));
}