예제 #1
0
void MyFrame::ShowLinks()
{
    // make sure the DOM content is loaded
    if (!m_dom_contentloaded)
        return;

    // get the DOM Document
    wxArrayString arr;
    wxDOMDocument doc = m_browser->GetDOMDocument();

    // get the child links
    GetChildLinks(doc, arr);

    // create a temporary file listing the links
    wxTextFile file;    
    wxString temp_file = wxFileName::CreateTempFileName(wxT("web"));
    file.Create(temp_file);

    int i, count = arr.Count();
    for (i = 0; i < count; ++i)
    {
        wxString href = arr.Item(i);
        file.AddLine(href);
    }

    file.Write();

    // open the temporary file with the links in
    // the browser
    m_browser->OpenURI(temp_file);
}
예제 #2
0
void MyFrame::OnGoAbout(wxCommandEvent& evt)
{
    wxArrayString arr;

    arr.Add(wxT("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""));
    arr.Add(wxT("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"));
    arr.Add(wxT("<?xml version=\"1.0\" encoding=\"utf-8\"?>"));
    arr.Add(wxT("<html>"));
    arr.Add(wxT("<head>"));
    arr.Add(wxT("	<title id=\"title\">About the wxWebConnect Test Application</title>"));
    arr.Add(wxT("	<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso8859-1\" />"));
    arr.Add(wxT("	<style type=\"text/css\"><!--"));
    arr.Add(wxT("		body         { background: #eee; }"));
    arr.Add(wxT("		div#main     { width: 540px; padding: 40px 40px 20px 40px; margin: 50px auto; background: #fff; border: 1px solid #bbb; -moz-border-radius: 10px; }"));
    arr.Add(wxT("       h3, p        { padding: 0; margin: 0; font-family: Arial, Helvetica, sans-serif; clear: left }"));
    arr.Add(wxT("       h5, p        { padding: 0; margin: 0; font-family: Arial, Helvetica, sans-serif; clear: left }"));
    arr.Add(wxT("		p            { font-size: 11px; padding: 0; margin: 20px 0; line-height: 16px; }"));
    arr.Add(wxT("		p.gray       { color: #999; padding-top: 20px; margin-bottom: 0; clear: both;  }"));
    arr.Add(wxT("		p.copyright  { float: left; text-align: left; clear: left                      }"));
    arr.Add(wxT("	//--></style>"));
    arr.Add(wxT("</head>"));
    arr.Add(wxT("<body>"));
    arr.Add(wxT("	<div id=\"main\">"));
    arr.Add(wxT("		<h3>wxWebConnect Test Application<br/></h3>"));
    arr.Add(wxT("		<h5>Version 1.0<br/></h5>"));
    arr.Add(wxT("		<p class=\"copyright\">Copyright (c) 2009-2013, Kirix Research, LLC.  All rights reserved.<br/>"));
    arr.Add(wxT("		                       Licence:     wxWindows Library Licence, Version 3.1</p>"));
    arr.Add(wxT("		<p class=\"gray\">This software contains an unmodified binary version of the open-source XULRunner"));
    arr.Add(wxT("                         engine as provided by the Mozilla Foundation. Please read the"));
    arr.Add(wxT("                         <a href=\"http://www.mozilla.org/MPL/\">license terms and notices"));
    arr.Add(wxT("                         </a> for the XULRunner engine. This software uses XULRunner version 1.8.1.3.</p>"));
    arr.Add(wxT("	</div>"));
    arr.Add(wxT("</body>"));
    arr.Add(wxT("</html>"));

    // create a temporary file listing the links
    wxTextFile file;    
    wxString temp_file = wxFileName::CreateTempFileName(wxT("web"));
    file.Create(temp_file);

    int i, count = arr.Count();
    for (i = 0; i < count; ++i)
    {
        wxString html = arr.Item(i);
        file.AddLine(html);
    }

    file.Write();

    // open the temporary file with the links in
    // the browser
    m_browser->OpenURI(temp_file);
}
예제 #3
0
void MyFrame::OnOpenLocation(wxCommandEvent& evt)
{
    wxTextEntryDialog dlg(this,
                          wxT("Please enter the URL you wish to open:"),
                          wxT("Open URL"),
                          wxT(""));

    int res = dlg.ShowModal();
    if (res != wxID_OK)
        return;

    m_browser->OpenURI(dlg.GetValue());
}
예제 #4
0
void MyFrame::OnGoForums(wxCommandEvent& evt)
{
    m_browser->OpenURI(m_uri_forums);
}
예제 #5
0
void MyFrame::OnGoHelp(wxCommandEvent& evt)
{
    m_browser->OpenURI(m_uri_help);
}
예제 #6
0
void MyFrame::OnGoHome(wxCommandEvent& evt)
{
    m_browser->OpenURI(m_uri_home);
}
예제 #7
0
void MyFrame::OnOpenHref(wxCommandEvent& evt)
{
    m_browser->OpenURI(m_uri_href);
}
예제 #8
0
void MyFrame::OnUrlItemSelected(wxCommandEvent& evt)
{
    m_browser->OpenURI(evt.GetString());
}
예제 #9
0
void MyFrame::OnUrlTextEntered(wxCommandEvent& evt)
{
    m_browser->OpenURI(evt.GetString());
}