LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to implement toolbar like labview control palette

how to implement toolbar like labview control palette. refer to the following pic
 
i think every pop-up palette is a vi, the most important thing is:
  1. how mangage these vi
  2. what events we should process
  3. how to process these events

i am not sure it is right or not?

any ideas?

thanks in advance

0 Kudos
Message 1 of 10
(4,124 Views)

Hi

I don't see the problem, as you already have the idea for a solution.

You just need a control to open the "next" vi (maybe a button??).

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 10
(4,102 Views)

it is just an idea, actually, i dont know how to implement it, in this way,  you need to coordinate mouse events which belong to different vi, is different from handling events which belong to same vi.

i am not sure it is a right way?

any idea?

 

0 Kudos
Message 3 of 10
(4,094 Views)
Why mouse events? According to the screenshot of the LV palette, you want to open a "subpalette" by clicking a button. So you can react on a value change event of the button. There is no need to handle mouse events.
 
You never can say it's the right way. It just can be a "better" way.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 10
(4,091 Views)

not by click, but mouse move enter, then pop-up subpalette, when should we close subpalette, which subpalette to close if there are several popup subpalette?

0 Kudos
Message 5 of 10
(4,089 Views)

I assume you don't like it, but I think this is up to you, as it is the logic of your program.

By the way - there is the possibility to create runtime menus on controls. So you can have nice context menus in your app. Maybe this could also be a way to go.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 10
(4,079 Views)
i am trying to implement it by trace the current status, including current vi, current button, opened subpalette using a global cluster array, so i can process events and coordinate the behavior of all subpalette based on current status.
 
thanks
0 Kudos
Message 7 of 10
(4,072 Views)

Hi Brian,

I am not sure I understand what you mean by "trace the current status." Could you explain a little more your thought process?

I believe we might be over-thinking this. If you treat each sub-palette as it's own VI, you can pop them up with a mouse-enter event from a button on the "owning" parent palette. Then, when your mouse leaves the subpalette you can close it. VI Server is an easy way to accomplish this sort of behavior -- again, this depends on exactly what you want to do. As has already been stated, there are probably several ways you could make this menu system happen.

I have attached a VERY simple example below in LV 8.0. When you move your mouse into the button of the parent.vi, the child VI appears. The child VI will disappear when the mouse leaves it's front panel. I did not actually use VI server to implement any of this (just sub-vi node setup), but that's not to say that you couldn't. It's not a fancy VI by any means, but it at least demonstrates the concept.

Hope this helps!

Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
Download All
0 Kudos
Message 8 of 10
(4,040 Views)

i will use the grobal array to coordinate all vi. 

the behaviors of the control palette are different from your description.

for example, there are two buttons in parent vi, button1,button2, when you move mouse over the two buttons, what happen? if in control palette, have the following behavior

  1. pop up child1.vi
  2. close child1.vi
  3. pop up child2.vi
  4. close child2.vi

if use subvi, not dynamic vi, how can you do that?

moreover, we should not use mouse leave event to close vi window, observe the behavior of the control palette, even mouse leave out all pop-up winodw,  these windows remain same, window title changes only.

i want to know whether there is a "vi lost focus" event, when a vi lost focus, i will search the global array, if i find all of the current pop-up vis  have no focus, then close all pop-up vis.

any ideas?

thanks for reply

0 Kudos
Message 9 of 10
(4,029 Views)
Hi Brian,
 
Thanks for the clarification. I'll be the first to admit that the code I posted was not fantastic -- I was just illustrating a point. There is no vi "lost focus" event. However, there is a mouse enter event. Instead of thinking about it when the cursor leaves a pane, maybe think about it the other way around. When your cursor leaves a child panel, it could go back to the parent or off somewhere on the screen. If the parent panel is *looking* for a mouse enter event, the parent can close the child panel. If the parent never sees the cursor, the child panel stays open -- just like you would expect it to. This would not be possible to do with just subvi's (at least, I cannot think of an easy way at the moment)-- you would have to use VI server. All the parents and children could maintain a central global data space (either with a global variable or functional global) to coordinate.
 
Anyway, just some thoughts to get you thinking -- good luck!
Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 10 of 10
(3,990 Views)