Esempio n. 1
0
void wxHtmlHelpController::CreateHelpWindow()
{
    if (m_helpFrame)
    {
        m_helpFrame->Raise();
        return ;
    }

    if (m_Config == NULL)
    {
        m_Config = wxConfigBase::Get(false);
        if (m_Config != NULL)
            m_ConfigRoot = _T("wxWindows/wxHtmlHelpController");
    }

    m_helpFrame = CreateHelpFrame(&m_helpData);
    m_helpFrame->SetController(this);

    if (m_Config)
        m_helpFrame->UseConfig(m_Config, m_ConfigRoot);

    m_helpFrame->Create(NULL, wxID_HTML_HELPFRAME, wxEmptyString, m_FrameStyle);
    m_helpFrame->SetTitleFormat(m_titleFormat);

    m_helpFrame->Show(true);
}
Esempio n. 2
0
void wxStEditApp::OnMenuEvent(wxCommandEvent& event)
{
    switch (event.GetId())
    {
        case ID_SHOW_HELP:
        {
            CreateHelpFrame(wxString::Format(_("Help for %s"), STE_APPDISPLAYNAME), (const char*)wxstedit_htm);
            break;
        }
        case ID_SHOW_README:
        {
            CreateHelpFrame(wxString::Format(_("Programming help for %s"), STE_APPDISPLAYNAME), (const char*)readme_htm);
            break;
        }

#if (wxVERSION_NUMBER >= 2900) || defined(__WXMSW__)
        case ID_SHOW_USAGE:
        {
            ::wxCommandLineUsage(m_frame);
            break;
        }
#endif
        case ID_TEST_STESHELL :
        {
            CreateShell();
            break;
        }
        case ID_NEW_STEFRAME :
        {
            wxFrame* frame = CreateMainFrame();
            if (frame)
                frame->Show();

            break;
        }
        default:
        {
            event.Skip();
            break;
        }
    }
}
Esempio n. 3
0
wxWindow* wxHtmlHelpController::CreateHelpWindow()
{
    if (m_helpWindow)
    {
        if (m_FrameStyle & wxHF_EMBEDDED)
            return m_helpWindow;

        wxWindow* topLevelWindow = FindTopLevelWindow();
        if (topLevelWindow)
            topLevelWindow->Raise();
        return m_helpWindow;
    }

#if wxUSE_CONFIG
    if (m_Config == NULL)
    {
        m_Config = wxConfigBase::Get(false);
        if (m_Config != NULL)
            m_ConfigRoot = wxT("wxWindows/wxHtmlHelpController");
    }
#endif // wxUSE_CONFIG

    if (m_FrameStyle & wxHF_DIALOG)
    {
        wxHtmlHelpDialog* dialog = CreateHelpDialog(&m_helpData);
        m_helpWindow = dialog->GetHelpWindow();
    }
    else if ((m_FrameStyle & wxHF_EMBEDDED) && m_parentWindow)
    {
        m_helpWindow = new wxHtmlHelpWindow(m_parentWindow, -1, wxDefaultPosition, wxDefaultSize,
            wxTAB_TRAVERSAL|wxNO_BORDER, m_FrameStyle, &m_helpData);
    }
    else // wxHF_FRAME
    {
        wxHtmlHelpFrame* frame = CreateHelpFrame(&m_helpData);
        m_helpWindow = frame->GetHelpWindow();
        frame->Show(true);
    }

    return m_helpWindow;
}
Esempio n. 4
0
wxWindow* wxHtmlHelpControllerEx::CreateHelpWindow()
{
    if (m_helpWindow)
    {
        if (m_FrameStyle & wxHF_EMBEDDED)
            return m_helpWindow;

        wxWindow* topLevelWindow = FindTopLevelWindow();
        if (topLevelWindow)
            topLevelWindow->Raise();
        return m_helpWindow;
    }

    if (m_Config == NULL)
    {
        m_Config = wxConfigBase::Get(FALSE);
        if (m_Config != NULL)
            m_ConfigRoot = _T("wxWindows/wxHtmlHelpControllerEx");
    }

    if (m_FrameStyle & wxHF_FRAME)
    {
        wxHtmlHelpFrameEx* frame = CreateHelpFrame(&m_helpData);
        m_helpWindow = frame->GetHelpWindow();
        frame->Show(TRUE);
    }
    else if (m_FrameStyle & wxHF_DIALOG)
    {
        wxHtmlHelpDialogEx* dialog = CreateHelpDialog(&m_helpData);
        m_helpWindow = dialog->GetHelpWindow();
    }
    else
    {
        m_helpWindow = new wxHtmlHelpWindowEx(m_ParentWindow, -1, wxDefaultPosition, wxDefaultSize,
            wxTAB_TRAVERSAL|wxNO_BORDER, m_FrameStyle, &m_helpData);
    }

    return m_helpWindow;
}