LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

vertical text orientation

I need to vertically orient a text box in my CVi GUI.  This is easy to do in LabView.  How can I do it in LabWindows?
 
Josh
0 Kudos
Message 1 of 11
(3,892 Views)

jmoses,

I don't know if there is a way to do it using CVI, but there is a way to programatically do it.  See the code sample below:

 char Str1[10] = "HELLO";
 char Str2[10] = "WORLD";

char temp_Str[4] = ""

for (index = 0; index < 6; index ++)
{
    temp_Str[0] = Str1[index];    
    temp_Str[1] = 32;                    //ASCII space character
    temp_Str[2] = Str2[index];
    InsertTextBoxLine (panel, PANEL_TEXTBOX, index, temp_Str); 

}

P.S. please excuse my other posts, I hit the TAB key and then SPACE BAR really quickly causing my message to be posted a bunch of times

Message Edited by DaveC on 07-12-2005 02:53 PM

0 Kudos
Message 2 of 11
(3,889 Views)

Duplicate post by accident

Message Edited by DaveC on 07-12-2005 02:53 PM

0 Kudos
Message 3 of 11
(3,888 Views)

Duplicate post by accident

Message Edited by DaveC on 07-12-2005 02:53 PM

0 Kudos
Message 4 of 11
(3,778 Views)
DaveC,
 
Thank you, this is interesting, but I would prefer to have the letters oriented 90 degrees, like on the spine of a book, or the Y-axis label of a graph.
 
Josh
 
0 Kudos
Message 5 of 11
(3,880 Views)

Hello JMoses,

You can generate vertical text with a text massage control by putting new line characters between each letter in the message.  On the UIR, you should place the text message control on top of your graph where you want the Y-Axis label to be.  Then you can change the Z-Order so the text message appears on top of the graph (Arrange >> Control ZPlane Order).  Then when you edit the value of the text message, press <CTRL-Enter> between each letter to create vertical text. 

Likewise, you can print vertical text programmatically by doing something like: SetCtrlVal (panelHandle, PANEL_TEXTMSG, "T\nE\nS\nT\nI\nN\nG")

Thanks.

Wendy L
LabWindows/CVI Developer Newsletter
Message 6 of 11
(3,872 Views)

Dear Wendy L,

Thanks.  Your suggestion is similar to DaveC's suggestion.  But apparantly I have not been clear about what I need.  I want the letters rotated 90 degrees.  So when you turn you head 90 degrees, you read the text normally.  Most books, including the NI catalog, have their titles printed on the spine in this way.  And CVI's built-in Y-axis graph label is printed this way.  I want to make my own labels like this.

Josh

0 Kudos
Message 7 of 11
(3,869 Views)

Hello jmoses,

Got it.  Check out the following example program which demonstrates how to rotate text using the canvas control.

Thanks.

Wendy L
LabWindows/CVI Developer Newsletter
Message 8 of 11
(3,867 Views)

This will work.  Thank you very much.

If I had only used the keyword, "rotate," instead of "vertical orientation," in my search, I would have found the example myself.

Thanks,

Josh

 

0 Kudos
Message 9 of 11
(3,860 Views)

Hello JMoses,

I did some further research and came across another way to do vertical labels.  Check out the following KnowledgeBase.

Thanks.

Wendy L
LabWindows/CVI Developer Newsletter
Message 10 of 11
(3,858 Views)