LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I import label/value pairs into a ring control from a text file?

I would like to know if there is a way to import label/value pairs into a ring control in the user interface of Labwindows/CVI.
0 Kudos
Message 1 of 3
(3,663 Views)
Is this what you mean?
It works in the interactive window.

/***************************************************/
#include
static int i,ring,panel;
static char Labels[3][12]={"Blue Dress","Yellow Tie","Brown Cigar"};

panel = NewPanel (0, "", 10, 10, 100, 100);
ring = NewCtrl (panel, CTRL_RECESSED_MENU_RING, "", 10, 10);
for(i=0;i<3;i++)
{
InsertListItem (panel, ring, -1, Labels[i], i);
}
DisplayPanel(panel);
RunUserInterface();
/***************************************************/

"zener" wrote in message
news:50650000000800000059170000-984280909000@quiq.com...
> I would like to know if there is a way to import label/value pairs
> into a ring control in the user interface of Labwindows/CVI.
0 Kudos
Message 2 of 3
(3,663 Views)

There is another possibility (tested with CVI 9.0):

Make an entry with a special label name (e.g.. "zener") which is used nowhere in your uir.

Save your uir as text (Options/Save in Text Format...). Use another file name than your uir. (e.g.. MyApp.uir --> MA.tui).

Open the saved tui with a text editor. Find your special label name:

 

...

Label000 = "zener"

Value000 = 1.00000000E0

...

 

Now you know where to insert the contents of your text file and in which format.

You can produce this format programmatically or using regular expressions in an advanced text editor.

The Label and Value numbers must be counted up for every entry. 

 

Open the modified tui in CVI. Check if the modifications are correct.

Copy the ring control from the MA.tui (which is opened as MA.uir) to clipboard. Paste it then to your uir.

0 Kudos
Message 3 of 3
(3,206 Views)