Page 1 of 1
wxWebView - Mouse event
Posted: Sun Nov 17, 2019 10:57 pm
by saifcoder
How to catch wxWebView mouse click event ?! it's not working.
Code: Select all
MyWEBVIEW = wxWebView::New(...);
MyWEBVIEW->Bind(wxEVT_LEFT_DOWN, &MyWindow::OnMouseLeftDown, this);
// OR
Bind( wxEVT_LEFT_DOWN, &MyWindow::OnMouseLeftDown, this, MyWEBVIEW_ID );
void MyWindow::OnMouseLeftDown(wxMouseEvent& evt){ ... }
Compile fine but I don't receive any events!, did wxWebView support mouse events ?
Re: wxWebView - Mouse event
Posted: Sun Nov 17, 2019 11:00 pm
by doublemax
wxWebView is a wrapper around the native web browser control on each platform, which probably consume the mouse (and maybe other) events.
Re: wxWebView - Mouse event
Posted: Mon Nov 18, 2019 5:54 am
by evstevemd
Hi,
saifcoder wrote: ↑Sun Nov 17, 2019 10:57 pm
How to catch wxWebView mouse click event ?! it's not working.
Code: Select all
MyWEBVIEW = wxWebView::New(...);
MyWEBVIEW->Bind(wxEVT_LEFT_DOWN, &MyWindow::OnMouseLeftDown, this);
// OR
Bind( wxEVT_LEFT_DOWN, &MyWindow::OnMouseLeftDown, this, MyWEBVIEW_ID );
void MyWindow::OnMouseLeftDown(wxMouseEvent& evt){ ... }
Compile fine but I don't receive any events!, did wxWebView support mouse events ?
I assume you want to change context menu. The procedure would be to disable the current context menu (the default) and create your own. There were issues which I tried to fix in pull request[1] but got no time to finish it. You might want to take from where I ended and finish with VZ review comments
1.
https://github.com/wxWidgets/wxWidgets/pull/401
Re: wxWebView - Mouse event
Posted: Sat Nov 23, 2019 12:21 pm
by saifcoder
Got it, thank you guys
Re: wxWebView - Mouse event
Posted: Sat Nov 23, 2019 3:56 pm
by evstevemd
As questions serve as references for the future, it is a good thing to say how you solved it
Re: wxWebView - Mouse event
Posted: Sun Nov 24, 2019 3:31 pm
by saifcoder
evstevemd wrote: ↑Sat Nov 23, 2019 3:56 pm
As questions serve as references for the future, it is a good thing to say how you solved it
I love sharing solutions so much, I know how important is, it's just I didn't fix it yet!
but I just completely disable the wxWebView to skip all events
MyWebView->Enable(false);
I would like catch mouse event click to allow user mouse hover on the WebView but the control eat all events :/
Sincerely,
Re: wxWebView - Mouse event
Posted: Sun Nov 24, 2019 3:34 pm
by saifcoder
by the way, I'm looking if wxWidgets will support Microsoft Web View 2 in the future?
https://docs.microsoft.com/en-us/micros ... ingstarted
Re: wxWebView - Mouse event
Posted: Sun Nov 24, 2019 3:43 pm
by doublemax
There is a wxWebView backend for Edge, but development has stopped as it's unclear what happens with regards to Microsoft's switch to Chrome.
https://github.com/wxWidgets/wxWidgets/pull/807
Re: wxWebView - Mouse event
Posted: Sun Nov 24, 2019 3:57 pm
by saifcoder
Oh!, everything made by Microsoft was wonderful,
Windows, XBOX, Kinet, Azure, Live, Bing.. except two things that stupidly down to low level! Windows Phone and there web browsers (
IE/Edge)
Re: wxWebView - Mouse event
Posted: Sun Nov 24, 2019 8:44 pm
by ONEEYEMAN
Hi,
You probably never worked under Unix/Linux?
Thank you.