00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef COOLMENU_H
00016 #define COOLMENU_H
00017
00018
00019 #define MAX_MENU_LENGTH 400
00020 #define MAX_MENU_WIDTH 240
00021 #define MENU_CHAR_WIDTH 78
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #define CM_ONE 0x001
00037 #define CM_TWO 0x002
00038 #define CM_THREE 0x004
00039 #define CM_FOUR 0x008
00040 #define CM_CENTER 0x010
00041 #define CM_TOGGLE 0x020
00042 #define CM_NUMBER 0x040
00043 #define CM_LINE 0x080
00044 #define CM_STRING 0x100
00045 #define CM_NO_HILITE 0x200
00046 #define CM_NOTOG 0x400
00047 #define CM_NORIGHT 0x800
00048 #define CM_NOCUT 0x1000
00049
00050 #define LETTERFIRST (CM_TOGGLE|CM_NUMBER|CM_STRING)
00051 #define RIGHTEDGES (CM_TOGGLE|CM_NUMBER)
00052
00053 typedef struct coolmenu_type {
00054 int id;
00055 char *text;
00056 int value;
00057 int maxvalue;
00058 char letter;
00059 int flags;
00060 struct coolmenu_type *next;
00061 } coolmenu;
00062
00063 #define CreateMenuEntry_VSimple(c,text) \
00064 CreateMenuEntry_Normal(c, text, CM_ONE, 0, 999)
00065 #define CreateMenuEntry_Simple(c,text,flag) \
00066 CreateMenuEntry_Normal(c, text, flag, 0, 999)
00067 #define CreateMenuEntry_Normal(c,text,flag,id,mv) \
00068 CreateMenuEntry_Killer(c, text, flag, id, 0, mv)
00069 void CreateMenuEntry_Killer(coolmenu ** c, char *text, int flag, int id,
00070 int value, int maxvalue);
00071
00072 void KillCoolMenu(coolmenu * c);
00073 void ShowCoolMenu(dbref player, coolmenu * c);
00074 char **MakeCoolMenuText(coolmenu * c);
00075 int CoolMenu_FPWBit(int number, int maxlen);
00076
00077
00078 coolmenu *SelCol_Menu(int columns, char *heading, char **strings, int type,
00079 int max);
00080
00081
00082 coolmenu *SelCol_FunStringMenuK(int columns, char *heading,
00083 char *(*fun) (), int last);
00084
00085
00086 coolmenu *SelCol_FunStringMenu(int columns, char *heading,
00087 char *(*fun) ());
00088
00089 #define AutoCol_Menu(hea,stri,typ) SelCol_Menu(-1,hea,stri,typ,0)
00090 #define AutoCol_StringMenu(head,str) AutoCol_Menu(head,str,0)
00091 #define AutoCol_FunStringMenuK(hea,fun,las) \
00092 SelCol_FunStringMenuK(-1,hea,fun,las)
00093 #define AutoCol_FunStringMenu(hea,fun) \
00094 SelCol_FunStringMenuK(-1,hea,fun)
00095 #define SelCol_StringMenu(col,head,str) SelCol_Menu(col,head,str,0,0)
00096
00097 #endif