next up previous contents
Next: Define the enabled keys Up: Menu engine Previous: Menu engine   Contents


Initialisation

To specify the behaviour of the menu, you have to fill the !h_Menu! structure:


\begin{lstlisting}
typedef struct st_h_Menu h_Menu;
\par
struct st_h_Menu {
//th...
... variables
short no_choice;
unsigned char top;
char move;
};
\end{lstlisting}

Desciption of the !h_Menu! structure:

!nb! the number of entries
!size_item! the size of one item: for example, if you have a table of pointer on strings, you should enter !sizeof(char *)!
!tab! the table of item: by default, it's a table of pointer of string, but we will be able to force the cast (see [*])
!level_tab! the table of the levels of the entries
!key_able! the keys that should be accepted while browsing the menu (see [*])
!font! the font which will be used for drawing the entries
!pos_x! and !pos_y! defines the top left position of the menu
!width! defines the width of the menu
!nb_draw! defines the number of entry to draw on the screen
!fct_draw! defines the drawing function used to draw the entries
!no_choice! it is the current choice of the user
!top! it is the number of the entru drawn on the top of the menu
!move! it can have the values 0 (false) or 1 (true): it describes if it is in a "move mode" or not (enabled with the !HMENU_ENABLE_MOVE! see [*])


next up previous contents
Next: Define the enabled keys Up: Menu engine Previous: Menu engine   Contents
2006-02-19