-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGUI_admin_operate.cpp
89 lines (80 loc) · 2 KB
/
GUI_admin_operate.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "book.h"
void GUI_admin_operate(MYSQL *sock) {
start:;
initgraph(800, 450);
IMAGE img;
loadimage(&img, L".\\5.jpg", 800, 450);//先把图片放在工程项目下,使用L+"绝对路径"
putimage(0, 0, &img);
setbkcolor(CYAN);
settextcolor(BLUE);
settextstyle(22, 0, _T("黑体"));
setfillcolor(CYAN);
fillroundrect(100, 50, 300, 100, 10, 10);
fillroundrect(100, 150, 300, 200, 10, 10);
fillroundrect(100, 250, 300, 300, 10, 10);
fillroundrect(500, 50, 700, 100, 10, 10);
fillroundrect(500, 150, 700, 200, 10, 10);
fillroundrect(500, 250, 700, 300, 10, 10);
fillroundrect(300, 350, 500, 400, 10, 10);
outtextxy(125, 65, _T(" 添加用户"));
outtextxy(125, 165, _T(" 删除用户"));
outtextxy(105, 265, _T(" 查询所有用户"));
outtextxy(525, 65, _T(" 添加图书"));
outtextxy(525, 165, _T(" 删除图书"));
outtextxy(505, 265, _T(" 查询所有图书"));
outtextxy(325, 365, _T(" 退出"));
MOUSEMSG k;
while (true)
{
k = GetMouseMsg();
if (k.x >= 100 && k.y >= 50 && k.x <= 300 && k.y <= 100)
{
if (k.uMsg == WM_LBUTTONDOWN) {
add_user(sock);
goto start;
}
}
if (k.x >= 100 && k.y >= 150 && k.x <= 300 && k.y <= 200)
{
if (k.uMsg == WM_LBUTTONDOWN){
del_user(sock);
goto start;
}
}
if (k.x >= 100 && k.y >= 250 && k.x <= 300 && k.y <= 300)
{
if (k.uMsg == WM_LBUTTONDOWN){
show_users(sock);
goto start;
}
}
if (k.x >= 500 && k.y >= 50 && k.x <= 700 && k.y <= 100)
{
if (k.uMsg == WM_LBUTTONDOWN){
add_book(sock);
goto start;
}
}
if (k.x >= 500 && k.y >= 150 && k.x <= 700 && k.y <= 200)
{
if (k.uMsg == WM_LBUTTONDOWN){
del_book(sock);
goto start;
}
}
if (k.x >= 500 && k.y >= 250 && k.x <= 700 && k.y <= 300)
{
if (k.uMsg == WM_LBUTTONDOWN){
show_books(sock);
goto start;
}
}
if (k.x >= 300 && k.y >= 350 && k.x <= 500 && k.y <= 400)
{
if (k.uMsg == WM_LBUTTONDOWN) {
return;
}
}
}
//这里没有closegraph
}