1 /* MikMod module player 2 (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for 3 complete list. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 18 02111-1307, USA. 19 */ 20 21 /*============================================================================== 22 23 $Id: mmenu.h,v 1.1.1.1 2004/01/16 02:07:38 raph Exp $ 24 25 Menu functions 26 27 ==============================================================================*/ 28 29 #ifndef MMENU_H 30 #define MMENU_H 31 32 #include "mwindow.h" 33 34 /* text metacharacters: 35 '&x': highlight 'x' 36 '&&' -> '&' 37 '%%' -> '%' 38 '%-' : separator, if at start of text 39 '%c': toggle menu 40 data: menu active yes|no 41 '%o...|opt0|opt1|...': option menu 42 data: active option 43 '%d...|label|min|max': int input 44 data: current value 45 '%s...|label|maxlength|length of inserted text': string input 46 data: current value 47 '%>': submenu, if at end of text 48 data: struct *MMENU, the sub menu 49 else: normal menu 50 data: unused 51 */ 52 typedef struct { 53 char *text; 54 void *data; 55 char *help; 56 } MENTRY; 57 58 typedef struct MMENU { 59 int cur; /* selected entry */ 60 int first; /* first line of menu which is displayed */ 61 int count; /* number of menu entries, -1 -> count is determined */ 62 /* by first NULL entry in entries[].text */ 63 BOOL key_left; /* can menu be closed with KEY_LEFT or KEY_ESC? */ 64 MENTRY *entries; 65 void (*handle_select) (struct MMENU *menu); /* called on menu selection */ 66 MWINDOW *win; /* the window for this menu */ 67 68 void *data; /* not used by menu functions */ 69 int id; /* not used by menu functions */ 70 } MMENU; 71 72 typedef void (*MenuSelectFunc) (MMENU *menu); 73 74 void menu_open(MMENU * menu, int x, int y); 75 void menu_close(MMENU * menu); 76 77 #endif /* MMENU_H */ 78 79 /* ex:set ts=4: */ 80