IMAGE img;
loadimage(&img, "./res/photos/d1.jpg", 960, 640);
putimage(0, 0, &img);
Tools tool;
struct Button* button7 = tool.createButton(50, 500, 100, 50, WHITE,
RGB(159, 252, 253), "返回", BLACK, 1);
peekmessage(&msg, EM_KEY | EM_MOUSE);
bool sign7 = tool.mouse(button7, msg);
tool.BUTTON(button7);
settextcolor(RGB(50, 130, 246));
settextstyle(45, 0, "宋体");
outtextxy(270, 130, "请输入你要添加的菜色");
settextstyle(25, 0, "宋体");
settextcolor(RGB(50, 130, 246));
outtextxy(320, 215, "格式为:菜名 配料表 价格 地点 窗口");
static char dish[128] = { 0 };
peekmessage(&msg, EM_KEY | EM_MOUSE);
struct Button* button1 = tool.createButton(300, 310, 350, 40, WHITE, RGB(192, 192, 192),
dish, BLACK, 1); //输入框
bool sign1 = tool.mouse(button1, msg);
tool.BUTTON(button1);
struct Button* button4 = tool.createButton(300 + 350 + 40, 310, 100, 50, WHITE,
RGB(159, 252, 253), "确定", BLACK, 1);
peekmessage(&msg, EM_KEY | EM_MOUSE);
bool sign4 = tool.mouse(button4, msg); //点击确定开始写入文件
tool.BUTTON(button4);
settextcolor(RED);
settextstyle(20, 0, "宋体");
outtextxy(300, 450, "注:以空格分隔!!!写完后点击确定进行保存");
if (sign1) //点击输入框
{
InputBox(dish, 128, "输入格式为:\n菜名 配料表 价格 地点 窗口", "管理员添加菜色");
//string str = dish;
//string s[5];
//int pos = 0;
//int i = 0;
//for (size_t pos = 0; pos != string::npos;)
//{
// pos = str.find(" ");
// string strL = str.substr(0, pos);//取出子串
// str = (str.c_str() + pos + 1);
// s[i] = strL;
// i++;
//}
//for (int i = 0; i < 5; i++)
//{
// cout << s[i] << " ";
//}
//cout << endl;
/*Dish d;
string str=d.fmoat(dish);
cout << str << endl;*/
//cout << dish << endl;
}
if (sign4)//点击确定
{
cout << "str" << endl;
}
if (sign7)
{
op = ManagerInterface; //返回到管理员界面
memset(dish, 0, 128); //清空
}