LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make software select on UI

 

May I know how to make software select. just click down the mouse and drag, then there will be a dot line square. After release the mouse,
the things selected will change color to red.
When move mouse over one object on UI, the mouse icon with change to the one with 4 arrow to 4 direction. If click down, the object will change to red color, other red
color object will back to normal color.
Any suggestion, thanks.

 

0 Kudos
Message 1 of 8
(2,909 Views)
0 Kudos
Message 2 of 8
(2,898 Views)

Are these 'objects' in a picture control? If so, look at the examples - i.e. Pen Attributes And Image subsetting.vi.

0 Kudos
Message 3 of 8
(2,885 Views)

I may want to select some buttons. To select picture control I may also need to select outside these controls, not inside them.

 

Is the second post blank? Thanks.

0 Kudos
Message 4 of 8
(2,868 Views)

Please give some more information here on what you are trying to do.

 

Is this something you are trying to do in a VI while you are editing?  Or something while a VI is running?  And why?  Post a VI so we can see what you are trying to work with.

0 Kudos
Message 5 of 8
(2,863 Views)

As the attached vi, when in runtime, the selected 4 object need to change color. Or the click one need to change color. Thanks.

0 Kudos
Message 6 of 8
(2,857 Views)

You are going to need to use an event structure with the mouse down and mouse up events on the pane.  You are going to need to use the mouse coordinates at the down and up events to determine the rectangle you have dragged, then figure out which buttons are within that rectangle.  Doable, but not necessarily easy.  One thing I don't have an answer for is how to draw the box around them while dragging.

 

For doing one button at a time, then you can use the mouse down, mouse up, or value change event for the button.

0 Kudos
Message 7 of 8
(2,848 Views)

To draw a rectangle like that you'd need to draw right on the window's pane using operating system calls (not trivial), or you'd need to manipulate some LabVIEW object, like a decoration to resize as you move the mouse. The latter is doable, but I'm not sure it would be worth the effort. I would suggest an alternative approach, such as allowing the user to use the Control and/or Shift key as click modifiers to select/deselect objects. You can easily check if these keys were held down at the time of a MouseDown event with the event structure.

0 Kudos
Message 8 of 8
(2,833 Views)