void CConfigurationDialog::OnTextURLEvent(wxTextUrlEvent& event) { if(event.GetMouseEvent().LeftIsDown()) { wxTextCtrl* pTextCtrl = (wxTextCtrl*)event.GetEventObject(); wxLaunchDefaultBrowser(pTextCtrl->GetRange(event.GetURLStart(), event.GetURLEnd())); } }
// 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(); } }