LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

rotating text

Solved!
Go to solution

Hi all,

 

I want to continuously move text in a string control like this during my entire program execution

 

"This is a text box."

"his is a text box T"

"is is a text box Th"

"s is a text box Thi"

" is a text box This"

" s a text box This i"

" a text box This is "

 

 

 I think timer will also be used to make the moving text visible. Can anyone show me how to do this?

 

 Any help will be greatly appreciated.

 

Regards,

mhs100

0 Kudos
Message 1 of 3
(3,103 Views)
Solution
Accepted by topic author mhs100

The idea of the timer is good for this; to rotate text you can use something along this line in the timer callback (not tested: I haven't CVI installed on this machine):

 

char    ch, string[512];

 

GetCtrlVal (panelH, controlID, string);

ch = string[0];

StringCopyMax (string, string + 1, strlen (string) - 1);

string[strlen (string) - 2] = ch;

SetCtrlVal (panelH, controlID, string);

 

I am using StringCopyMax because it is tolerant of overlaps on source and target string so I have no need to use an intermediate string to manipulate the text.



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?
Message 2 of 3
(3,099 Views)

Check out the example program in samples\apps\marquee.

 

It uses a child panel with a text message control and moves the text message control to the left on EVENT_IDLE. Instead of using EVENT_IDLE, you can use a timer control.

 

Hope this helps.

 

- jared

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