12-28-2014 01:18 PM - edited 12-28-2014 01:24 PM
Hello all,
I was trying out Thermometer Xcontrol example that comes with LV2014 Professional and I noticed that if move one of the Xcontrol in that main VI close to the other Xcontrol (such that transparent portion of the first slider Xcontrol overlaps slider of the second copy of that Xcontrol on the right), the Xcontrol on bottom does not get mouse events (such as clicks/etc)! Please take a look at the attached image to see if it clarifies what I'm trying to explain. Is that a bug or an intentional behavior? Is there anyway to change that behavior such that any transparent portion of Xcontrols passes mouse clicks to the Xcontrol (or any other control) that are behind it? (I also tried the same with two "xcontrol-controls" overlapping each other instead of an "xcontrol-indicator" overlapping a "xcontrol-control", it had the same issue.) I have also tried the above in Edit-mode as well as Run-time, same problem.
If I customize a round boolean control and overlap two copies of it similarly, I do get click even on the bottom boolean control, so the above behavior happens only in Xcontrols? Please advice if you have much knowledge on this topic.
Thank you!
-Desi
12-28-2014 01:48 PM
I'm not sure if that specific behavior is expected. I wouldn't be surprised. XControls are essentially Vis being run as controls/indicators. It's not surprising any transparent area still consumes events as you're clicking within that VI.
Here's the real problem. You make a habit of overlapping things on your Front Panel. Stop that. It's terrible design. If you have a need to overlap, you're not doing something you should be doing. You're also creating a performance mess. LabVIEW doesn't handle overlapping objects well. Whether the behavior you're seeing is intended or not, it's certainly not intended for you to overlap the controls.
12-28-2014 02:51 PM - edited 12-28-2014 02:56 PM
The real problem is that I seek a reasoning or solution on above topic from anyone who had the knowledge and you assumed that I'm a terrible LabVIEW designer/developer. YOU stop that, I didn't become a CLA with over a decade of LabVIEW experience with terrible designs, do not assume the worst about others when they simply ask a technical question.
I have perfectly fine reason in wanting custom shaped controls very close to each other such that transparent area from one ends up overlapping clickable area of the other. That Thermometer vi was just an example to show the same effect as an application I'm developing.
12-28-2014 03:27 PM - edited 12-28-2014 03:33 PM
Close, maybe. Overlapping, no. CLA or not, overlapping controls is bad design. It's no different that pointing out it's bad design for a CLA to rely on the Abort button.
You focused on this while ignoring what is the likely reason for the behavior you explain. XControls are STILL dressed up VIs. It would make sense they'd take control of the mouse clicks in their area. Imagine having two Front Panels on top of each other.
I didn't assume you were a terrible designer. I observed you're using a terrible design practice. We all do it from time to time. Just because you CAN do things the way you're wanting to doesn't mean it's a "perfectly fine reason." By that logic, it's "perfectly fine" to avoid passing clusters into subVIs because you have a "perfectly fine" reason to pass in 20 similar wires instead.
For reference: http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/vi_execution_speed/
12-28-2014 04:13 PM - edited 12-28-2014 04:24 PM
One of the sliders is a control and one is an indicator.
You can change the Z order so the control is on top (=frontmost) using the reorder tool in the toolbar. (An indicator cannot be operated anyway, so it does not matter it is is partially covered). You can customize the controls/indicators so they have less of a frame.
I would say that the current tools are sufficient to achieve almost anything you want.
12-28-2014 05:09 PM - edited 12-28-2014 05:10 PM
Hello Altenbach:
Please take a look at attached VI (front-panel image included too), I have quickly put together small/relevant part of what I'm trying to do. Each of those diamond-shaped controls (all are controls, no indicators) clickable area is so close to each other that transparent part in them overlap the controls next to it. I can mostly get away with doing this using custom shaped controls, but so far no luck doing it using Xcontrols. I need extra logic in each control which is the reason for xcontrol (for example, one requirement is that when any control is clicked to have logic TRUE, all adjecent controls have to be disabled/not greyed). Furthermore, I don't know at design time how many controls need to be on the panel as it is chosen by a user during run-time depending on number of wafers. Also adding to the complexity, a user might create a VI from a template I provide, add/remove tiles on it, and load it dynamically.
If I create xcontrol using this diamond-shaped boolean controls on its facade vi, it doesn't click on adjecent tiles which are lower on z-order - I'm not sure how I would change z-order on the fly at run-time.. possible to do so based on mouse location? Unfortunately I can't use square/rectangular controls in this project.
12-29-2014 02:03 AM
I would probably use a picture control instead and calculate the position from the mouse-down coordinates.