We are using the Tab Strip component on our popups. We use this to show different tabs on the popup. I'd like to be able to put templates over the tab strip as a bread crumb/flag for issues on a tab. The issue comes, in that if this template has a mouseover text on the template, the tab strip doesn't detect the mouse over event in order to highlight the tab, and it doesn't seem to want to register clicks.
I've tried to take the mouse events for the template and pass it along to the Tab Strip, but that doesn't seem to work.
I've got a helper script that looks like this for passing events off to other components:
def mouseEventToObj(event,obj,**kwargs):
evt = MouseEvent(
obj,
event.getID(),
event.getWhen(),
event.getModifiers(),
event.x,
event.y,
event.clickCount,
event.popupTrigger,
event.button
)
obj.dispatchEvent(evt)
This works for other object, so I don't think it is this script.
In the mouseXXX script I'm calling the mouseEventToObj as such:
tabStrip = event.source.parent.getComponent('Tab Strip')
arrowPanel, tabHolderPanel = tabStrip.components
ESP.Standards.Vision.Templates.Common.mouseEventToObj(event, obj=tabHolderPanel)
ESP.Standards.Vision.Templates.Common.mouseEventToObj(event, obj=tabStrip)
Is there another component buried in the Tab Strip object I need to pass the mouse events to so that they play nicely? Or am I just out of luck and don't put a mouse over text on the template?
Probably not a helpful response, but I stopped using the Tab Strip component because I considered it lacking in some areas... I switched to buttons.
That might be easier than trying to figure this out lol. I don't mind the mental exercise.
Switching to buttons thought wouldn't be the end of the world. All our popup tab strips are templates. so it's just a handful anyhow.
We actually have the button strip as a template that gets loaded along with the other templates.
It then references the window to get to the other template(s) and set visible, not visible on the "tabs"(containers)
Keeps it simple and you can also do access level controls on the buttons easier too.
I had this issue about a year ago. As was explained to me, java swing works inside out on mouse events. So the mouseover in your template will kill any external mouse events. My solution at the time was to put the mouse event script and the mouseover on the external part of the template. Probably wont help you though if you have individual mouseovers on several widgets within the template.
Download and study the sample window and library scripts I included in this post:
Glass Pane Tutorial
The way mouse events are passed through the overlayed component works properly for all Vision components. The library script locates the deepest component under the mouse that actually has a mouse listener and dispatches the event there. Some Vision components contain inner subcomponents that actually handle the mouse events, so simply using the outer component itself fails since the outer component doesn't have the necessary listener.
3 Likes
I figured you would chime in on this. 
I appreciate your insight. I'll dig in and get back with you. I'm not 100% sure that we are going to keep the tab strips though as buttons seem to be the way forward on this.
2 Likes