Ejemplo n.º 1
0
void ChatPanel::OnLinkEvent(wxTextUrlEvent& event)
{
	if (!event.GetMouseEvent().LeftDown())
		return;

	wxString url = m_chatlog_text->GetRange(event.GetURLStart(), event.GetURLEnd());
	OpenWebBrowser(url);
}
void CConfigurationDialog::OnTextURLEvent(wxTextUrlEvent& event)
{
	if(event.GetMouseEvent().LeftIsDown())
	{
		wxTextCtrl* pTextCtrl = (wxTextCtrl*)event.GetEventObject();
		wxLaunchDefaultBrowser(pTextCtrl->GetRange(event.GetURLStart(), event.GetURLEnd()));
	}
}
Ejemplo n.º 3
0
void ChangeLogPage::OnURL(wxTextUrlEvent& event)
{
	// we respond only for LeftDown event
	if(event.GetMouseEvent().LeftDown()) {
		int start = event.GetURLStart();
		int end   = event.GetURLEnd();

		wxString url = m_textCtrl->GetRange(start, end);
		wxLaunchDefaultBrowser(url);
	}
}
Ejemplo n.º 4
0
void szAboutDlg::OnLink(wxTextUrlEvent& event)
{
	if (!event.GetMouseEvent().LeftUp()) {
		return;
	}
	wxString link = m_textCtrl->GetValue().Mid(event.GetURLStart(), event.GetURLEnd() - event.GetURLStart());
	
#if __WXMSW__
	if (wxLaunchDefaultBrowser(link) == false)
#else
	if (wxExecute(wxString::Format(_T("xdg-open %s"), link.c_str())) == 0)
#endif
		wxMessageBox(_("I was not able to start default browser"), _("Error"), wxICON_ERROR | wxOK);
}
Ejemplo n.º 5
0
// wxTextCtrl doesn't provide a handler for urls, so we use an almost
// undocumented event handler provided by wx
void dlgAbout::OnTxtCtrlUrlClick(wxTextUrlEvent &event)
{
    wxString URL;
    wxTextCtrl *Control;
    wxMouseEvent MouseEvent;
       
    MouseEvent = event.GetMouseEvent();
    
    if (MouseEvent.LeftDown())
    {
        Control = wxDynamicCast(event.GetEventObject(), wxTextCtrl);
        
        URL = Control->GetRange(event.GetURLStart(), event.GetURLEnd());
    
        wxLaunchDefaultBrowser(URL);
    
        event.Skip();
    }
}
Ejemplo n.º 6
0
long bmx_wxtexturlevent_geturlend(wxTextUrlEvent & event) {
	return event.GetURLEnd();
}