I am displaying an array of WebContainers (each with a WebImageViewer Picture) on a Flex Layout WebPage and I want to have the Container currently under the mouse to indicate it is available to be clicked. WebButtons do this automatically.
As there is no WebStyle Hover property and no MouseEnter/Exit Event, how could this be achieved?
Via some JavaScript magic?
Use a large transparent WebButton on the Container (assuming I can assign it a Picture)
I can get you the mouse events but it’s a hack. Fair warning about hacks and framework support and all that. I stopped selling TP_WebKit publicly, but you can send a private message if still interested.
The less Xojo-code-y way is to use CSS which will give a better response, but I’m not sure if you can use classes as designed or if you’ll have to use a Javascript injection for each container.
Any way you approach the problem it seems that this isn’t in the framework
If you just need to change how the cursor looks like, then it’s easy.
Opening event:
Me.Style.Cursor = WebStyle.Cursors.Pointer
If you want to change a background color, for example, then you’ll have to either create a hover CSS class and assign it with JS, or use some JS. Combined with AddTransition it will look great.
This is an example using jQuery (place it in a constant, replace the IDs and colors, then call it using ExecuteJavascript):
Please notice the “controlID” could be something different to the “targetID”, for example if you just need to modify the background of a specific child element.
The same example, but using CSS instead, would be adding the following code to the App → HTML Header: