Page 2 of 3

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:00 am
by Wolfgang
Did now manage to distinguish between left and right click,


But at the moment only possible if really clicked and not if holded down or double clicked. So any help there would be appreciated.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:06 am
by doublemax
With wxHtmlCellEvent::GetMouseEvent() you should be able to distinguish between different types o clicks.

https://docs.wxwidgets.org/trunk/classw ... event.html

BTW: wxHtmlWindow only understands HTML 1.0, so your styling options will be limited. It will also be quite slow if you have a table with thousands of rows when you resize the window. Consider wxWebView instead which uses the underlying native browser.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:14 am
by Wolfgang
Was thinking of not showing all at once and only show those which requested.
Must check if this is possible to generate the html on request just in memory.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:20 am
by doublemax
Must check if this is possible to generate the html on request just in memory.
That's the way to go anyway. Don't create temporary HTML files on disc.

However, this has no effect on the render speed.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:24 am
by Wolfgang
doublemax wrote: Thu Feb 21, 2019 8:06 am With wxHtmlCellEvent::GetMouseEvent() you should be able to distinguish between different types o clicks.

https://docs.wxwidgets.org/trunk/classw ... event.html

BTW: wxHtmlWindow only understands HTML 1.0, so your styling options will be limited. It will also be quite slow if you have a table with thousands of rows when you resize the window. Consider wxWebView instead which uses the underlying native browser.
Yes, made it like that:

Code: Select all

void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event)
{	wxMouseEvent testm = event.GetMouseEvent();
	if (testm.GetEventType() == wxEVT_RIGHT_UP) {
and wxEVT_LEFT_UP are working

wxEVT_LEFT_DCLICK not working
wxEVT_RIGHT_DOWN not working

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:26 am
by Wolfgang
doublemax wrote: Thu Feb 21, 2019 8:20 am
Must check if this is possible to generate the html on request just in memory.
That's the way to go anyway. Don't create temporary HTML files on disc.

However, this has no effect on the render speed.
Just rendering about 150 rows at once, that should be quick enough.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:27 am
by Wolfgang
Just in case you did not notice started c++ programming two weeks ago, and only 3 to 4 hours a day. So that is why I wrote I still have to check if it is possible.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:34 am
by doublemax
I just looked into the source code and yes, wxHtmlWindow does not handle these events, so you'll have to catch them yourself.

Check <wxdir>/src/html/htmlwin.cpp to see how to find the htmlcell where the click occurred.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:38 am
by Wolfgang
wxwebview

Can I also get the clicks like with wxhtml, in the sample this is not included, that is why I ask.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:40 am
by Wolfgang
doublemax wrote: Thu Feb 21, 2019 8:34 am I just looked into the source code and yes, wxHtmlWindow does not handle these events, so you'll have to catch them yourself.

Check <wxdir>/src/html/htmlwin.cpp to see how to find the htmlcell where the click occurred.
htmlwin.cpp sample I do not have, have to check on github and download it.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 8:41 am
by doublemax
htmlwin.cpp sample I do not have, have to check on github and download it.
It's not a sample, it's part of the wxWidgets source code.

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 7:10 pm
by Wolfgang
If I did see it right:
wxHTMLCtrl can only load from disc, does not accept File system handlers registration.
wxWEbview cannot handle cell clicks nativ like wxhtmlctrl can, right?
So basically both are only to work if I manage to get the missing part to work, or did I miss something?

Re: Database to show with changing column width

Posted: Thu Feb 21, 2019 7:20 pm
by doublemax
wxHTMLCtrl can only load from disc, does not accept File system handlers registration.
You can pass a string with HMTL code to wxHtmlWindow through wxHtmlWindow::SetPage(), which should be all you need for your task. In addition to that it does support loading files through wxFileSystem, e.g. wxMemoryFileSystem.

Re: Database to show with changing column width

Posted: Sat Feb 23, 2019 9:13 pm
by Wolfgang
So far htmlwindow working, I can get clicks, but the question is now, how can I find out the word which is under the mouse van clocked or by hoover event. And the next question is there a way, that I can somehow give a word or number to a woord, or can i catch the link, so it does not try to call the link. As I could write in there additional information.

Re: Database to show with changing column width

Posted: Sat Feb 23, 2019 9:21 pm
by Wolfgang
Another question, how to set part of the text right to left (for hebrew text)