In the IDE you can choose whether a DesktopHTMLViewer should be “Enabled” or not. Just like you can for the other controls. But it doesn’t seem to have any effect on the HTMLViewer. At least not the effect I expect
When the DesktopHTMLViewer is “Disabled” in the IDE it is still active when the app is running.
Does “Enabled” work in a different way for the HTMLViewer than for other controls?
XOJO version 2021 Release 3
macOS Monterey version 12.1
The HtmlViewer always was a bit special. What do you want to show with an disabled HtmlViewer? You could show a custom html “No data to display” or something similar.
@Beatrix Willius
I would like to show a local hosted html text editor (https://vuejs.org) which communicates with the App. And therefore should only be active when certain conditions are met.
@Jean-Yves Pochez
I’m just in the process of trying it.
Is the conclusion that I can’t use the "Enabled” button in the IDE for a DesktopHTMLViewer?
You can “disable it” by yourself…
Add a boolean isDisabled
Set it to true when needed
In all your events, test isDisabled and code accordingly (if True, ignore clicks / Event, …, else let the code be executed).
How can I ignore mouse clicks?
I have tried both “Return True” and “Return False” in the “MouseDown” event for the Viewer. It makes no difference. The website responds to clicks no matter what
It’s no good doing anything like that. You have to have a javascript event listener which will intercept and then ignore things that you want to have no effect.
Thank you all for your contributions. I greatly appreciate your help and Anthony even delivers a ready to go solution. Although it feels a bit wrong to solve a problem in XOJO with JavaScript I will probably use this solution.
A small note on the solution.
It is possible to run the method multiple times and add more overlays. It might be an idea to create a boolean to check if an overlay is already placed on the HTMLViewer.