Jump to content

Subpanels & "Make Panel Transparent" -- click through?


Recommended Posts

I've been thinking about a UI design that would involve stacking multiple -- maybe 4 or 5 -- subpanel controls, one overlapping the other, with the option "Make Panel Transparent" enabled so that you can see one panel through the other.

The problem I'm running into is that mouse clicks are not similarly transparent -- i.e., if I click on the stack of subpanels, the controls in the top panel are live, but the mouse click does not fall through to the panels behind it.

Does anyone have a solution to the problem? Anyone figured out a way to redispatch a mouse click to the next layer down?

post-5877-064935100 1285612932_thumb.png

Link to comment

I've been thinking about a UI design that would involve stacking multiple -- maybe 4 or 5 -- subpanel controls, one overlapping the other, with the option "Make Panel Transparent" enabled so that you can see one panel through the other.

The problem I'm running into is that mouse clicks are not similarly transparent -- i.e., if I click on the stack of subpanels, the controls in the top panel are live, but the mouse click does not fall through to the panels behind it.

Does anyone have a solution to the problem? Anyone figured out a way to redispatch a mouse click to the next layer down?

post-5877-064935100 1285612932_thumb.png

Not a good one but maybe inspiration...

Forget about using transparent but rather get the image and put it in a Picture control. Put an image of the control (the one rendered on this layer) in the right position and cache the bounds of the control so when a user clicks you can determine if the clcik get handled here or not. If not, pass (what does THAT mean Ben?) teh click to who ever owns the sub-panel.

I did something similar using all Picture controls and LVOOP to develop a "Controls on the Fly" app that used this basic idea. One object had mouse down etc events registered against a Picture Control and that object would then fire-off a queue message to the Active Object that realized the "widget". When the image of the widget changed it pushed a queue message back at the Picture Object who would update the region of the screen that needed changed. The active Object allowed the widget to update without being acted on by others (e.g. A scrolling marque).

I did not saty I had a good idea, only an idea.

Ben

Link to comment
Forget about using transparent but rather get the image and put it in a Picture control. Put an image of the control (the one rendered on this layer) in the right position and cache the bounds of the control so when a user clicks you can determine if the clcik get handled here or not. If not, pass (what does THAT mean Ben?) teh click to who ever owns the sub-panel.
That still runs into the question of how to pass the click along... I don't know of any VIs that let me say, "Tell VI that a mouse click just happened *here*. Do whatever it is you would've done had the click actually occurred on you."

[Later] The screen shot also runs into the problem of updating the visual for mouse move, or for things that are continuously updating as the VI executes. Dead end, but thanks for the idea.

Link to comment

I would avoid stacking SPs one over the other, especially because that means that each SP needs to know about the position of controls in the other SPs so it can avoid overlapping them. Instead, each SP could be the size of its content and you set its position dynamically based on the size of the other SPs.

But you already know that...

Link to comment

I would avoid stacking SPs one over the other, especially because that means that each SP needs to know about the position of controls in the other SPs so it can avoid overlapping them. Instead, each SP could be the size of its content and you set its position dynamically based on the size of the other SPs.

But you already know that...

Except that the goal is interleaving, not just concatenating. And if there's an ordering to the interface, the later plugins can dynamically adapt to the content of the earlier plugins.

Link to comment

Nothing is preventing you from using the position properties to interleave the SPs. They don't HAVE to be one under the other. Similarly, you can attach meta data to each one to determine its order.

Also, if you need dynamic adapting, then you WANT the SPs to auto-arrange, don't you? Otherwise you're locking each plugin to a specific size and all other plugins have to conform to that size and position.

Link to comment

I haven't used subpanels enough so this may sound like a stupid idea.

Can you dynamically change the levels of a subpanel? If this is the case and at run time you can change which is on top, then on option (another bad one probably) is you can get a reference to all controls in panel that's on top then store the coordinates of the controls. Then register a user event for a mouse click. If it was clicked and the mouse is not on a control (looking at coordinates of each control) then move the next subpanel to the top and simulate a mouse click at the same position with a Windows DLL. (assuming Windows). Then perform the same operation where you see if the coordinates of the mouse are on a control. If it is then good perform that event, if it is not then go through the subpanels until all have been moved to the top.

A problem that could occur is if you have too many subpanels it may take some time to go through them all moving them all to the top. Helping this would be to store all the coordinates of controls at the beginning instead of using control references and getting coordinates every time. Also I have no idea if you can move sub panel levels, or even how much time it may take to perform the operation. Good luck.

  • Like 1
Link to comment

Except that the goal is interleaving, not just concatenating. And if there's an ordering to the interface, the later plugins can dynamically adapt to the content of the earlier plugins.

Shaun's suggestion about the user event seems good.

Each sub-VI creates and register a user event.

The bottom-most passes a ref for the event to the next up the stack.

When a User clicks on the top level two options Click on its button or not. THe click on its button is handled by an event in the top. If a mouse down event occurs outside the registered control, teh location of the click is wrapped and passed to the next sub-VI down in the stack.

When the User event fires, it has to check if the coordinates match-up with its button and if so "Value Signalling to fire the event.

If not lining up with the button for the current sub-VI, fire the user event for the next on up.

But that seems like an approach that would work.

Ben

Link to comment

Not sure if this is what Yair was talking about (didn't really understand) but.....You can also load a sub-panel within a sub-panel and instead of overlapping, nest them vertically. This might achieve the same effect,, but you would handle the event in the top level vi by inspecting the ctrl reference.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.