For unspecified reasons, I want to be able to resolve which control has been clicked on from a pane mouse down event. Our application is somewhat large and makes extensive use of sub-panels, so registering every control individually, statically or dynamically, would be a lot of work, maybe not very efficient, and would require ongoing resource tracking once registered, so the pane mouse down event in a top level VI would be preferred.
I've written a VI that takes a pane reference and pane coordinates (hypothetically from a mouse down event) and resolves the first, if it exists, control that resides on that pane and contains those coordinates within its bounds. The VI also considers the control class, and if it is a subpanel, gets the inserted VI, it's panel, and any pane that contains the coordinates and recurses. In this manner, the VI traverses arbitrarily deep nested subpanels until it gets to the control that was clicked on.
This is where it gets (more) complicated. I also want to traverse xControls. When a control within an xcontrol is clicked on, I want the reference to the (sub?) control, not the xcontrol. It is simple enough to detect whether a control is in fact an xcontrol, but apparently more challenging to get any more information than that. So my questions are these:
From an control reference where IsXclt=T, is there a way to get a reference to the xcontrols panes or some owner (panel, facade vi, clone name)? I realize I could do this by setting a custom property of the xcontrol, but then it would not be generic to xcontrols and would again require sprawling coding effort.
or
Is there an entirely different and simpler way to achieve what I am proposing in the first paragraph?
This is in LV2012sp1 btw.
Thanks for reading; any help or suggestions would be appreciated!