#ifndef MYWIN_MSGBOX_H__ #define MYWIN_MSGBOX_H__ #include "mywin_inc.h" //消息对话框,继承自MYWIN框架 //定义条目最大数目 #define MSGBOX_ITEM_MAXNUM 10 //定义条目最大长度 #define MSGBOX_ITEM_MAXLEN 50 typedef struct { WIN_WindowStruct win; u32 titleTxtColor; u32 titleRectColor; u32 tipRectColor; u32 butRectColor; int press; char *title; char *msg; char *key; char *key2; char items[MSGBOX_ITEM_MAXNUM][MSGBOX_ITEM_MAXLEN]; int itemNum; int index; int y_step; //选择框时的条目宽度 }WIN_MsgboxStruct; //在堆中创建一个消息对话框, WIN_MsgboxStruct *WIN_CreatMsgbox (WIN_WindowStruct *base, void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg), int x,int y,int x_size,int y_size); //消息对话框设置标题 void MSGBOX_SetTitle (WIN_MsgboxStruct *msgbox,char *title); //消息对话框设置内容 void MSGBOX_SetMsg (WIN_MsgboxStruct *msgbox,char *msg); //消息对话框设置按键 void MSGBOX_SetKey (WIN_MsgboxStruct *msgbox,char *key); void MSGBOX_SetKey2 (WIN_MsgboxStruct *msgbox,char *key); //添加条目 void MSGBOX_AddItem (WIN_MsgboxStruct *msgbox,char *item); //消息框的绘制函数 void MSGBOX_DefaultPaint (WIN_MsgboxStruct *msgbox); //消息框的消息处理函数 void MSGBOX_defaultMsgLoop (WIN_MsgboxStruct *msgbox,WIN_MsgStruct *msg); //弹出提示框 int MSGBOX_Tips (WIN_WindowStruct *base,char *title,char *msg,char *key); //弹出提示框,在一段时间后自动退出 int MSGBOX_TipsTime (WIN_WindowStruct *base,char *title,char *msg,char *key,u32 ms); //弹出询问框,按键确定返回0,取消返回1 int MSGBOX_Inquiry (WIN_WindowStruct *base,char *title,char *msg,char *key,char *key2); //弹出选择框,按键确定返回序号,取消返回-1 int MSGBOX_Select (WIN_WindowStruct *base,char *title,char **item,int itemNum,char *key,char *key2); #endif