Hi, I used the wxWebconnect. It's cool. Currently, I need to intercept the navigation event for clicking onthe hyperlinks or submit button to generate content dynamically in the local side. Any idea which event I should add event handler to? I tried the wxEVT_WEB_LOCATIONCHANGE event. But it seems to be generated after the navigation is performed. So when I add a handler for it and call the OpenURI method inside the handler, it ends up in endless loop.
Thanks~
Kirix Support Forums
Navigation event
4 posts
• Page 1 of 1
Re: Navigation event
Have you tried hooking onto the wxEVT_WEB_OPENURI event? You can intercept this event and, if you want, reject the URI the user clicked on, and then redirect the user using wxWebControl::OpenUri() to the page with your local content.
All the best,
Ben
All the best,
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Re: Navigation event
Hi, Ben
Thanks for your reply. I tried the wxEVT_WEB_OPENURI event. If I use the OpenURI in the event handler, it's also an endless lopp and a stack overflow. Here is my code:
Thanks for your reply. I tried the wxEVT_WEB_OPENURI event. If I use the OpenURI in the event handler, it's also an endless lopp and a stack overflow. Here is my code:
- Code: Select all
m_browser = new wxWebControl(this, -1, wxPoint(-1,-1), wxSize(800,600));
Connect(m_browser->GetId(),wxEVT_WEB_OPENURI,wxCommandEventHandler(MyPanel::OnOpenURI));
void MyPanel::OnOpenURI(wxCommandEvent& evt)
{
...
m_browser->OpenURI(wxT("http://www.kirix.com"));
}
Ben wrote:Have you tried hooking onto the wxEVT_WEB_OPENURI event? You can intercept this event and, if you want, reject the URI the user clicked on, and then redirect the user using wxWebControl::OpenUri() to the page with your local content.
All the best,
Ben
- ryanstd
- Registered User
- Posts: 2
- Joined: Thu Mar 04, 2010 11:24 pm
Re: Navigation event
You can use wxEVT_WEB_LEFTDOWN to detect the mouse click. You will then need to check the node to make sure it is a button or link that was clicked. This method allows you to handle the event before you leave the current page.
Regards,
Robin
Regards,
Robin
- rbalean
- Registered User
- Posts: 4
- Joined: Thu Sep 13, 2012 3:12 am
4 posts
· Page 1 of 1
Return to wxWebConnect Questions, Thoughts & Feedback