Wondering if someone could help me with the following problem:
I'm using wxHtmlHelpController to show the help book for my app, however when clicking on an external link (http://...) in the help book the url won't open. What I would like to do is to get the default browser started and the url gets opened in the browser.
I used to have this working in windows by using the solution suggested here: https://trac.wxwidgets.org/ticket/12037#no1. However this solution needs a change in wxWidget code which isn't really possible on Linux as my installer package requests a wxWidgets dependency, i.e. original code.
So now I'm looking for a solution to 'catch' the link click in the wxHtmlHelpController to my main app, is that even possible?
The same trac ticket above has some suggestion to use Connect or PushEventHandler to hook into the HtmlWindow's event handler and handle EVT_HTML_LINK_CLICKED but I can't get my head around how this would work.
My 'help' code is fairly basic roughly like:
Code: Select all
wxHtmlHelpController *help;
Main:Main()
{
wxString helpFile = "emma_02.htb";
help = new wxHtmlHelpController(wxHF_TOOLBAR | wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH | wxHF_BOOKMARKS | wxHF_PRINT | wxHF_BOOKMARKS);
if (!help->AddBook(helpFile))
{
(void)wxMessageBox( "Failed adding book " + helpFile + "\n", "Emma 02", wxICON_ERROR | wxOK );
}
}
Main::~Main()
{
delete help;
}
void Main::onHelp(wxCommandEvent& WXUNUSED(event))
{
help->DisplayContents();
}
Code: Select all
Connect(wxID_ANY,
wxEVT_HTML_LINK_CLICKED,
wxHtmlLinkEventHandler(Main::linkClicked),
(wxObject*) NULL,
this);
Any help or advice would be much appreciated.
Cheers, Marcel.