make a loop for scrolling lines in menu box
Hello, I want to make menu with 10 line size and scroll text line by line in menu from a list with text.
For this I wrote same command as:
Code:
menu_set_text /* set text a line position in menu */
get_line_text /* return text from list at line position specified */
list_size /* return number of list lines */
To display the top 10 lines from list:
Code:
for( i = 0; i < 10; i++ ) {
char text[ 50 ];
snprintf( text, sizeof (text), "%s", get_line_text( i ) );
menu_set_text( i, text );
}
I would like to create a loop to scroll up/down lines in menu all items from list
Code:
A
B
C
D
E
-----------------
Line 01 | F | /* <-- pozition of cursor stay in Line 1 if move up and exist item of list to be scrolled */
Line 02 | G |
Line 03 | H |
Line 04 | I |
Line 05 | J |
Line 06 | K | /* <-- pozition of cursor move up (from line 1 to 10) or down (from line 10 to 1) in menu */
Line 07 | L |
Line 08 | M |
Line 09 | N |
Line 10 | O | /* <-- pozition of cursor stay in line 10 if move down and exist item of list to be scrolled */
-----------------
P
Q
R
S
T
Thanks