LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

\033 escape codes don't work for ring items

In the documentation, it says that rings are the same as list items and can be programmed exactly the same way.  When I try to use InsertListItem to insert a label that has "\033m-" or "\033p200", I see the item as a small square and the letters "m-" or "p200".
 
That is, the escape didn't escape!
 
What am I doing wrong?  What is the magical incantation to get this to work? :mansurprised:
 
Thanks in advance for any help.
0 Kudos
Message 1 of 9
(4,847 Views)

Up to CVI 7.1 the only escape code managed by rings is the separator bar ( \033m- ). Here a snippet from the documentation:

You can create columns in a list box control by embedding escape codes in the itemLabel parameter. Use \033 to indicate an escape code (...)

To insert a separator bar into a ring control (ring, menu ring, recessed menu ring, or pop-up menu ring), embed the escape code \033m- in the itemLabel parameter.

The separator bar is correctly handled by the ring control if it is the only constituent of the item lable as in the following code:
  InsertListItem (panelHandle, controlID, -1, "\033m-", i);
if it is embedded in a more complex string it produces what you are seeing, a small box and the "m-" string shown in the item label.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 9
(4,830 Views)
Thank you for your reply.
 
1. Your reply contradicts the help which does not state any such limitations, but no big deal.
 
2. Your example does not work for me at all.  My line is:
 InsertListItem (validPanelHandle, VALID_CONTROL_ID, -1, "\033m-", 0);
 
... which still shows only "[]m-" and no separator line.
0 Kudos
Message 3 of 9
(4,793 Views)
> 1. Your reply contradicts the help which does not state any such limitations, but no big deal.
 
Sorry, what I meant to say was that the documentation says that ring controls should be the same as list controls, especially where escape codes are concerned.  I see where the other sentences you quoted came from.
 
However, I am using version 8.0.1 and even a bare \033m- doesn't work for me.
 
Any help appreciated.
 
0 Kudos
Message 4 of 9
(4,784 Views)

Hi SBSB,

I going to take a wild guess but one rule you must abide by when using the "\033m-" escape code for separator bars, is that the first item in a list cannot be a separator bar. For example if you said

InsertListItem (handle, ctrlID, 0, "\033m-", 0);
InsertListItem (handle, ctrlID, 1, "Item1", 1);
InsertListItem (handle, ctrlID, 2, "Item2", 2);

Then you would get the small square (see attached First Item.jpg snapshot).

However if you said:

InsertListItem (handle, ctrlID, 0, "Item1", 0);
InsertListItem (handle, ctrlID, 1, "\033m-", 1);
InsertListItem (handle, ctrlID, 2, "Item2", 2);

Then you would receive good results with a separator bar as shown in the attached Good Escape Code.jpg

Hope this helps and if you are still having issues, let me know.

Best Regards,

Jonathan N.
National Instruments
Download All
Message 5 of 9
(4,773 Views)
Hello Jonathan,

Thank you for your reply.

I have ended up doing this a different way that doesn't need separators in the pull-down list.

Thanks for the help.
0 Kudos
Message 6 of 9
(4,680 Views)

Hi Pal,

 

I wonder if there is a seperator bar for the ring control in LabVIEW


Feel Good Inc. Love forever love is free. Let's turn forever you and me.
0 Kudos
Message 7 of 9
(4,228 Views)

Hi NangSgi,

I'm not aware of a method to do so, but you may find a better help asking this question in the LabVIEW forum.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 9
(4,215 Views)

Thanks a lot!

I find it.

Add seperator to ring control by using"_" symbol.


Feel Good Inc. Love forever love is free. Let's turn forever you and me.
0 Kudos
Message 9 of 9
(4,182 Views)