Пример #1
0
/* MainWindow::onHTMLLinkClicked
 * Called when a link is clicked on the HTML Window, so that
 * external (http) links are opened in the default browser
 *******************************************************************/
void MainWindow::onHTMLLinkClicked(wxHtmlLinkEvent &e) {
	string href = e.GetLinkInfo().GetHref();

	if (href.StartsWith("http://"))
		wxLaunchDefaultBrowser(e.GetLinkInfo().GetHref());
	else if (href.StartsWith("recent://")) {
		// Recent file
		string rs = href.Right(1);
		unsigned long index = 0;
		rs.ToULong(&index);
		index++;

		panel_archivemanager->handleAction(S_FMT("aman_recent%d", index));
	}
	else if (href.StartsWith("action://")) {
		// Action
		if (href.EndsWith("open"))
			theApp->doAction("aman_open");
		else if (href.EndsWith("newwad"))
			theApp->doAction("aman_newwad");
		else if (href.EndsWith("newzip"))
			theApp->doAction("aman_newzip");
		else if (href.EndsWith("reloadstartpage"))
			createStartPage();
	}
	else
		html_startpage->OnLinkClicked(e.GetLinkInfo());
}
Пример #2
0
void MainFrame::OnDescEdit(wxHtmlLinkEvent& evt)
{
	if (evt.GetLinkInfo().GetHref() == wxT("edit_key"))
	{
		OTL::ObjectPtr<Omega::Registry::IKey> ptrKey(m_strSelection.c_str());

		EditKeyDescDlg dialog(this,-1,wxT(""));
		dialog.m_strName = m_strSelection;
		dialog.m_strDesc = ptrKey->GetDescription().c_wstr();

		if (dialog.ShowModal() == wxID_OK)
		{
			ptrKey->SetDescription(Omega::string_t(dialog.m_strDesc.wc_str(),Omega::string_t::npos));

			SetKeyDescription(m_pTree->GetSelection());
		}
	}
	else if (evt.GetLinkInfo().GetHref() == wxT("edit_value"))
	{
		OTL::ObjectPtr<Omega::Registry::IKey> ptrKey(m_strSelection.c_str());

		EditValueDescDlg dialog(this,-1,wxT(""));
		dialog.m_strName = m_strSelection;
		dialog.m_strValue = evt.GetLinkInfo().GetTarget();
		dialog.m_strDesc = ptrKey->GetValueDescription(Omega::string_t(dialog.m_strValue.wc_str(),Omega::string_t::npos)).c_wstr();

		if (dialog.ShowModal() == wxID_OK)
		{
			ptrKey->SetValueDescription(Omega::string_t(dialog.m_strValue.wc_str(),Omega::string_t::npos),Omega::string_t(dialog.m_strDesc.wc_str(),Omega::string_t::npos));

			SetValueDescription(dialog.m_strValue,dialog.m_strDesc);
		}
	}
}
Пример #3
0
void frmScanforDevices::OnHtmlwindow3LinkClicked(wxHtmlLinkEvent& event)
{
    if (event.GetLinkInfo().GetHref().StartsWith(_("http://"))) {
        wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
        event.Skip(false);
        return;
    }

    event.Skip();
}
Пример #4
0
void S57QueryDialog::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
{
    S57ExtraQueryInfoDlg* ExtraObjInfoDlg = new S57ExtraQueryInfoDlg( GetParent(), wxID_ANY, _("Extra Object Info"), wxPoint(GetPosition().x+20, GetPosition().y+20 ), wxSize( g_S57_extradialog_sx, g_S57_extradialog_sy ) );
    ExtraObjInfoDlg->m_phtml->LoadPage(event.GetLinkInfo().GetHref());
    ExtraObjInfoDlg->SetColorScheme();
    ExtraObjInfoDlg->Show(true);
}
Пример #5
0
void moDirectorStartFrame::OnLinkClicked(wxHtmlLinkEvent& event) {

    wxHtmlLinkInfo link( event.GetLinkInfo());

    wxString href = link.GetHref();

    if (href.StartsWith(_T("MO_CMD_")))
    {
        wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MODIRECTOR_OPENPROJECT );
        wxString pathproject = href.SubString(  7, href.Length()-1);
        evt.SetString( pathproject );
        wxPostEvent( this->GetParent(), evt);
        //return true;
        return;
    }

    if(href.IsSameAs(_T("http://moldeo.computaciongrafica.com/"))
    || href.StartsWith(_T("http")))
    {
        //wxTextDataObject *data = new wxTextDataObject(revInfo);
        //wxTheClipboard->SetData(data);
        wxLaunchDefaultBrowser(link.GetHref());
    }

    if(href.IsSameAs(_T("rev")))
    {
        //wxTextDataObject *data = new wxTextDataObject(revInfo);
        //wxTheClipboard->SetData(data);
        //return true;
        return;
    }

    //return false;
}
/**
 * 左クリック時に起こるイベント
 */
void ThreadContentWindow::OnLeftClickHtmlWindow(wxHtmlLinkEvent& event) 
{     
     const wxHtmlLinkInfo linkInfo = event.GetLinkInfo();
     const wxString href = linkInfo.GetHref();
     const wxString target = linkInfo.GetTarget();
     wxString rest = wxEmptyString;
     long res = 0;
     
     // bmp,jpg,jpeg,png,gifなどの拡張子が末尾に付いている場合ダウンロードを行う
     if (regexImage.IsValid()) 
     {
	  // 正規表現のコンパイルにエラーがなければマッチさせる
	  if (regexImage.Matches(href)) 
	  {
	       // 画像ファイルをクリックしたのでダウンロードする
	       const wxString ext = regexImage.GetMatch(href, 3);
	       this->SetJaneCloneImageViewer(href, ext);

	  } 
	  else if (href.StartsWith(wxT("#"), &rest) && rest.ToLong(&res, 10)) 
	  {
	       if ( 0 < res && res <= 1000) 
	       {
		    OnLeftClickResponseNumber(event, href, res);
	       }
	  } 
	  else 
	  {
	       // 通常のリンクかどうか判定して処理
	       OnClickOrdinaryLink(href);
	  }
     }
}
Пример #7
0
void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
{
    wxString link = event.GetLinkInfo().GetHref();

    m_lastMarkerFound = NULL;

    long index;

    if( !link.ToLong( &index ) )
        return;

    const SCH_MARKER* marker = m_MarkersList->GetItem( index );

    if( marker == NULL )
        return;

    // Search for the selected marker
    SCH_SHEET_PATH* sheet;
    SCH_SHEET_LIST  SheetList;
    bool notFound = true;

    for( sheet = SheetList.GetFirst(); sheet; sheet = SheetList.GetNext() )
    {
        SCH_ITEM* item = (SCH_ITEM*) sheet->LastDrawList();

        for( ; item; item = item->Next() )
        {
            if( item == marker )
            {
                notFound = false;
                break;
            }
        }

        if( notFound == false )
            break;
    }

    if( notFound ) // Error
    {
        wxMessageBox( _( "Marker not found" ) );

        // The marker was deleted, so rebuild marker list
        DisplayERC_MarkersList();
        return;
    }

    if( *sheet != m_parent->GetCurrentSheet() )
    {
        sheet->LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
        m_parent->SetCurrentSheet( *sheet );
        m_parent->GetCurrentSheet().UpdateAllScreenReferences();
    }

    m_lastMarkerFound = marker;
    m_parent->SetCrossHairPosition( marker->m_Pos );
    m_parent->RedrawScreen( marker->m_Pos, false);
}
Пример #8
0
//リンクがクリックされたときの処理
void TweetList::onHtmlLinkClicked(wxHtmlLinkEvent &event){
	cout << "Html Click:" << event.GetId() << "(" <<  event.GetLinkInfo().GetHref() << ") pos(" << event.GetSelection() << ")" << endl;

	wxString hrefStr = event.GetLinkInfo().GetHref();

	if(hrefStr.StartsWith("#reply")){
		//返信イベントだった場合
		wxVector<wxString> items;
		wxStringUtil::split(&items, hrefStr, "\t");
		ReplyEvent* replyEvent = new ReplyEvent(
				items[1],
				atol(items[2].ToStdString().c_str())
		);

		//イベントを親に渡す
		wxQueueEvent(parentHandler_, replyEvent);
	}
}
Пример #9
0
void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
{
    wxLogMessage(wxT("The url '%s' has been clicked!"), event.GetLinkInfo().GetHref().c_str());

    if (GetMyBox())
    {
        GetMyBox()->m_linkClicked = true;
        GetMyBox()->RefreshRow(1);
    }
}
Пример #10
0
void CProjectListCtrl::OnLinkClicked( wxHtmlLinkEvent& event )
{
    // Fire Event 
    ProjectListCtrlEvent evt( 
        wxEVT_PROJECTLIST_ITEM_DISPLAY, 
        wxEmptyString,  
        event.GetLinkInfo().GetHref(), 
        true 
    ); 
    evt.SetEventObject(this); 

    GetParent()->AddPendingEvent( evt ); 
}
Пример #11
0
void kitchenFrame::OnUrlClick(wxHtmlLinkEvent& event)
{
    long templong;

    wxString link = event.GetLinkInfo().GetHref();

    link.Mid(0,link.Find(_T(":"))).ToLong(&templong);
    href=true;
    int num = templong;
    wxString temp;
    temp << num;

    mysqlpp::Query query = conn->query();
    wxString dishId = link.Mid(link.Find(_T(":"))+1);
    query <<"UPDATE `orders_dishes` SET `ready` = '1' \
   WHERE `orders_dishes`.`id` =" << wx2std(dishId, wxConvUI) << " LIMIT 1";
    query.execute(); //we just set to ready only one dish from order


    int orderId;
    query << "SELECT `order_id` FROM `orders_dishes` WHERE `id`="<< wx2std(dishId, wxConvUI);
    mysqlpp::StoreQueryResult res = query.store();
    if(res)
    {
        mysqlpp::Row row;
        row = res.at(0);
        orderId = int(row["order_id"]);
    }
    query << "SELECT `id` FROM `orders_dishes` WHERE `ready`=0 AND `order_id`="<< orderId;
    res = query.store();

    if(res)
    {
        if(!res.num_rows())  //no dishes to prepare
        {
            query << "UPDATE `orders` SET `status` = '4' WHERE `orders`.`id` ="<< orderId <<" LIMIT 1 ";
            query.execute(); //set the whole order to ready state
            //redo the pages to update status
            fillAll();
            wxString tem;
            tem << _T("r:") << orderId;
            sendMessageToServer(SocketClient1, tem);
        }
    }

    wxString prodName = StaticText9->GetLabel();
    fillDetails(prodName);
    fillMain();
}
Пример #12
0
//---------------------------------------------------------------------------------------
void BooksDlg::OnLinkClicked(wxHtmlLinkEvent& event)
{
    const wxHtmlLinkInfo& link = event.GetLinkInfo();
    wxString sLocation = link.GetHref();

    //study guide
    if (sLocation == "lenmus#study-guide")
    {
        HelpSystem* pHelp = m_appScope.get_help_controller();
        pHelp->display_section(10101);    //study-guide
        //show_html_document("study-guide.htm");
        return;
    }

    //verify if it is a LenMus command link
    int iPos = sLocation.Find("lenmus#");
    if (iPos == wxNOT_FOUND)
    {
        // external link
        ::wxLaunchDefaultBrowser(sLocation);
    }
    else
    {
        wxString filename = sLocation.substr(12);
        Paths* pPaths = m_appScope.get_paths();
        wxString sPath = pPaths->GetBooksPath();
        wxFileName oFile(sPath, filename, wxPATH_NATIVE);
        if (!oFile.FileExists())
        {
            //try to use the english version
            sPath = pPaths->GetLocaleRootPath();
            oFile.AssignDir(sPath);
            oFile.AppendDir("en");
            oFile.AppendDir("books");
            oFile.SetFullName(filename);
            if (!oFile.FileExists())
            {
                wxMessageBox(_("Sorry: File not found!"));
                LOMSE_LOG_WARN(str(boost::format("File '%s' not found!")
                               % oFile.GetFullPath().wx_str() ));
                return;
            }
        }

        m_fullName = oFile.GetFullPath();
        EndModal(wxID_OK);
    }
}
Пример #13
0
void MANFrame::OnLinkClicked(wxHtmlLinkEvent &event)
{
    wxString link = event.GetLinkInfo().GetHref();

    if (link.StartsWith(_T("man:"), &link))
    {
        if (link.Last() == _T(')'))
        {
            link.RemoveLast();
            wxString name = link.BeforeLast(_T('('));

            if (name.IsEmpty())
            {
                return;
            }

            wxString section = link.AfterLast(_T('('));

            if (!section.IsEmpty())
            {
                name += _T(".") + section;
            }

            SearchManPage(name);
        }
    }
    else if (link.StartsWith(_T("fman:"), &link))
    {
        wxString man_page = GetManPage(link);

        if (man_page.IsEmpty())
        {
            SetPage(ManPageNotFound);
            return;
        }

        SetPage(cbC2U(man2html_buffer(cbU2C(man_page))));
    }
    else if (wxFileName(link).GetExt().Mid(0, 3).CmpNoCase(_T("htm")) == 0)
    {
    	m_htmlWindow->LoadPage(link);
    }
}
Пример #14
0
/**
 * Follow a clicked URL using the default web browser.
 * @param event The click event.
 */
void HelpFrame::followLink(wxHtmlLinkEvent& event) {
    wxString theURL = event.GetLinkInfo().GetHref();
    if ( ! wxLaunchDefaultBrowser(theURL)) {
        Tools::log(_T("An error occurred while trying to start the default web browser."));
    }
}
Пример #15
0
void mmAboutDialog::OnLinkClicked(wxHtmlLinkEvent& event)
{
    wxHtmlLinkInfo link_info = event.GetLinkInfo();
    wxString sURL = link_info.GetHref();
    wxLaunchDefaultBrowser(sURL);
}
Пример #16
0
void AboutDialog::OnLink(wxHtmlLinkEvent & event)
{
    wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
}
Пример #17
0
void ExtensionsDialog::OnClickLink(wxHtmlLinkEvent& evt)
{
	::wxLaunchDefaultBrowser(evt.GetLinkInfo().GetHref(), wxBROWSER_NEW_WINDOW);
}
Пример #18
0
void slHtmlWindow::OnLinkClicked( wxHtmlLinkEvent& evt )
{
    wxString url = evt.GetLinkInfo().GetHref();
    OpenWebBrowser( url );
}
Пример #19
0
void DIALOG_ABOUT::onHtmlLinkClicked( wxHtmlLinkEvent& event )
{
    ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
}
void PluginsConfigurationDlg::OnLinkClicked(wxHtmlLinkEvent& event)
{
    wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
}
void DIALOG_TEMPLATE_SELECTOR::OnHtmlLinkActivated( wxHtmlLinkEvent& event )
{
    wxString url = event.GetLinkInfo().GetHref();
    wxLaunchDefaultBrowser( url );
}
Пример #22
0
 void onLicenseHyperlink(wxHtmlLinkEvent& e) {
     LaunchUrl(e.GetLinkInfo().GetHref());
 }
Пример #23
0
void fwknop_guiFrame::OnLink(wxHtmlLinkEvent &event)
{
    wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());

}
void EmbeddedHtmlPanel::OnLinkClicked(wxHtmlLinkEvent &event)
{
    Open(event.GetLinkInfo().GetHref());
}
Пример #25
0
void FeedPanel::OnLinkClicked(wxHtmlLinkEvent &evt)
{
	wxGetApp().OpenUrl(evt.GetLinkInfo().GetHref());
}
Пример #26
0
void AboutDialog::onLinkClicked(wxHtmlLinkEvent &event)
{
    wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
    event.Skip(false);
}
Пример #27
0
void NewVersionDialog::OnLinkClicked(wxHtmlLinkEvent& event)
{
	wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
}
Пример #28
0
void dialog_about::OnHtmlLinkClicked( wxHtmlLinkEvent& event )
{
    ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
}