LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Menu ok button with listbox

Good Morning.

 

I'm working in a "simulation" of the LCD of a digital radio, using multicolumn listbox and Ok buttons, and I'm having problems with some things..

 

The code hide the cells (changing the width size to 0) of a array of strings, and to hightlight the cells, I changed the color of the cell, and when the cell with "MENU 1" is highlighted and is pressed "RIGHT" button, The menu should change to "Sub 1.1, Sub 2.2....", and so on with the other menus.. But the problem occurs when I press the "DOWN" button, the highlight is going to menu 1.. 

 

I attached the vi..

 

 

If anyone has any program to serve me an example or light me to solve my problem, would be very grateful, save my life! lol

 

Thanks, 

 

Alexandra.

 

Download All
0 Kudos
Message 1 of 7
(3,752 Views)

a quick suggestion for your code:

 

take the property node out of your case-structure (in "RIGHT": Value Change Event) and only set the vars inside

 

make sure you know in which order all the floating property nodes are executed

(use the out- and ingoing error terminals and connect them in order)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 2 of 7
(3,741 Views)

so sorry, but I don't understand you.. (I don't speak English, It can be so).. You can explain me otherwise?

 

Thanks.

0 Kudos
Message 3 of 7
(3,710 Views)

i try to:

 

Labview executes things in parallel, except when you connect cables between things,

then it executes from the leftmost to the rightmost

 

If you have things not connected to anything, then they will execute in ANY order.

 

Almost everything in Labview has Terminals (the connectorpoints for the cables), Incoming and Outgoing,

and very many have incoming and outgoing ERROR terminals.

 

Use these to make things execute in line (order)

 

 

the comment for your Case Structure in your Event Structure meant: don't repeat yourself

if you do the same thing in every Case, then take it out of the cases.

 

 

 

lastly: try to clean up your code .. make lines not zig-zag around,

programming in labview becomes very fast a fight between you and all your cables 😉


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 4 of 7
(3,702 Views)

Thanks for your suggestions, I'll consider them.

0 Kudos
Message 5 of 7
(3,620 Views)

Rather than changing the column width, you might consider using the "top left visible cell" property. This will greatly simplify your code and make this more extensible to using more colums.

 

Your cell highlighting isn't working because you are highlighting only the first column. To hilight the entire row (so that this works for whatever column you are viewing), you can right-click on hte listbox and select Selection Mode>Highlight Entire Row.

 

You can also set you booleans (left right up down) to "latch when pressed" and place the terminals inside theevent structure. This will allow them to be reset when pressed. (This was the problem with you "Right button" not working properly.)

 

You also need to wire your shift registers through every event in your event structure, or else the shift register value will revert to the default value for the data type for the unwired event cases.

 

Your subroutine needs only one input for the listbox reference.

 

You are also not handling a click on thelistbox.I have shown how you can detect the row that was clicked for you.

 

I've made some changes to your code and attached them here. It doesn't all work. For example, your coloring scheme doesn't reset the cells to the original colors, so you get a green trail all over the place. You could also determine hte limits for the up-down selection wrapping by how many items are in that column's rows. 

 

 

 

Cheers!

 

 

_____________
Creator of the BundleMagic plugin for LabVIEW!
Download All
Message 6 of 7
(3,597 Views)

Thanks!, you have given me several ideas, the rest will be able to fix me, thanks!

0 Kudos
Message 7 of 7
(3,478 Views)