LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multicolumn listbox bug?

Hi
Trying to program a multicolumn listbox so that a character (x)
is written to cell when i click on that cell.  It works if i put a button to do it
but otherwise it writes to a cell that it should have written to previously.  The simple vi
below demonstates the problem. Put the curser in a cell and then click on and off the
button below and the x goes in correctly. Leave the button on all the time
and click on the cells and you will see the "X" always lagging a couple of cells behind.
Clicking on a cell continously does not work either. Wondering what the heck
is going on?
Thanx for looking
0 Kudos
Message 1 of 13
(4,993 Views)
amazed,
 
I think your problem might lie in the mechanical action of the button.  You have the button currently set to "Switch when Pressed".  That means that when you press the button it stays in that state until you press it again.  If you change the mechanical action to "Latch when Pressed", the button will revert to the previous state after the data is read.
 
You can change the mechanical action by right lcicking on the button control and navigating to Mechanical Action>>Latch when Pressed.  This should solve the issue.
 
I hope this helps.  Please repost if this does not work.
 
Thanks,
Stephen Meserve
National Instruments
0 Kudos
Message 2 of 13
(4,981 Views)
Just use an event structure for (1) mouse down on the listbox and for (2) a value change of the button.
 
On mouse down, place the cell coordinates in a shift register.
On button press, insert x at the above coordinates.
You could have a third event for value changes of the listbox, which you would then feed into the shift register too.
 
(This is all in LabVIEW 8.2. I am not sure how much of this is available in your 7.0 version, which I no longer have. Sorry).
 
(Don't use value properties to modify the cell data, they are very expensive, use shift registers instead. Also, you loop has no wait and once the button is down you'll write the same thing to the same location over and over again. Seems like a waste. 😉 Set the button to "latch when released")

Message Edited by altenbach on 06-14-2007 04:31 PM

Message 3 of 13
(4,983 Views)

Christian, you beat me to it.

Message Edited by MattH on 06-14-2007 04:49 PM

0 Kudos
Message 4 of 13
(4,977 Views)
Thanx Steve
I didn't really explain the problem well.  The button was put there to demonstrate the problem.  Shouldn't be any button at all. My intention is to read the
x's as enablers . 
john
0 Kudos
Message 5 of 13
(4,967 Views)

allittle unfamilliar with using events. I did try try using mouse down event before but ran into an annoying problem when i tried to operate the listboxes scroll bar(apparently a mouse down event as well). Hope don't mind i copy yours see what happens

Thanx so  much for checking out and idea's

j

0 Kudos
Message 6 of 13
(4,968 Views)

Hi John,

Sorry I misunderstood the problem a bit, but I hope that altenbach's reply is of some help to you.  He is a LabVIEW Champion for good reason...

Thanks so much,

Stephen Meserve
National Instruments
0 Kudos
Message 7 of 13
(4,957 Views)


@amazed wrote:
I did try try using mouse down event before but ran into an annoying problem when i tried to operate the listboxes scroll bar(apparently a mouse down event as well). Hope don't mind i copy yours see what happens

That's why I use the "InBounds" terminal, which is only true if the mouse coordinates are inside the listbox when the event occures. It is false if the mousedown occurrs elsewhere on the listbox, e.g. on one of the scrollbars.

As you can see in my code example, if InBounds is false, I don't change the coordinates stored in the shift register. The event still fires, but does not really do anything. 🙂

Message 8 of 13
(4,921 Views)

Apparently 7.0 does not have the funtionality of most recent labview so was unable to implement the suggested solution.  Got me thinking though and realized why putting a button and a case statement in my first example (which i definitly don't want) made the multilist box do what i wanted. ("X" on/off in last 4 columns) It was the focus.

Playing with the focus on the list box made it work correctly.  Pretty sure that it not the best way but have to move on to the primary purpose of the program and hopefully this solution won't bite me later.  Thanx all for the kick start. 

 

0 Kudos
Message 9 of 13
(4,808 Views)

Hi...

 

I have a similar problem with listbox mouse down event, the event is generated even if the mouse is clicked on the scroll bar (quite annoying).

I am using LV8.2.1.

 

I have seen your post and got interest, but unfortunately i could not find 'Inbounds' property in LV8.2.1.

 

Could you help me with any alternative?
0 Kudos
Message 10 of 13
(4,205 Views)