首页上一页 1 下一页尾页 8 条记录 1/1页
vc c++项目开发全程实录 第5章 餐饮管理系统中这段函数是什么功能
发表在C语言图书答疑
2010-07-18
是否精华
是
否
版块置顶:
是
否
CTime Time;
Time = CTime::GetCurrentTime();
CString Str = Time.Format("%Y-%m-%d");
m_Imagelist.Create(32,32,ILC_COLOR24|ILC_MASK,1,1);
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_login));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_open));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_add));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_pay));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_rishouru));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_reg));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_cancel));
UINT Array[7];
for(int i=0;i<7;i++)
{
Array[i]=9000+i;------------------------------------------1
}
m_Toolbar.Create(this);
m_Toolbar.SetButtons(Array,7);
m_Toolbar.SetButtonText(0,"系统登录");
m_Toolbar.SetButtonText(1,"开台");
m_Toolbar.SetButtonText(2,"加减菜");
m_Toolbar.SetButtonText(3,"顾客买单");
m_Toolbar.SetButtonText(4,"本日收入");
m_Toolbar.SetButtonText(5,"员工注册");
m_Toolbar.SetButtonText(6,"退出系统");
m_Toolbar.GetToolBarCtrl().SetButtonWidth(60,120);
m_Toolbar.GetToolBarCtrl().SetImageList(&m_Imagelist);
m_Toolbar.SetSizes(CSize(70,60),CSize(28,40));
for(i=0;i<4;i++)
{
Array[i]=10000+1;--------------------------------------2
}
m_Statusbar.Create(this);
m_Statusbar.SetIndicators(Array,4);
for(int n=0;n<3;n++)
{
m_Statusbar.SetPaneInfo(n,Array[n],0,80);
}
m_Statusbar.SetPaneInfo(1,Array[1],0,200);
m_Statusbar.SetPaneInfo(2,Array[2],0,800);
m_Statusbar.SetPaneText(2,"当前时间"+Str);
m_Statusbar.SetPaneText(0,"餐饮管理系统");
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_kaitai,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_pay,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_rishouru,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_reg,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_add,false);
CMenu* pMenu=GetMenu();
pMenu->GetSubMenu(1)->EnableMenuItem(0,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(1)->EnableMenuItem(1,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(2)->EnableMenuItem(0,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(2)->EnableMenuItem(1,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(2)->EnableMenuItem(2,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(3)->EnableMenuItem(0,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(3)->EnableMenuItem(1,MF_BYPOSITION | MF_GRAYED);
CString Sql;
Sql="select * from shouru where 时间='"+Str+"'";
m_pRs=theApp.m_pCon->Execute((_bstr_t)Sql,NULL,adCmdText);
if(m_pRs->adoEOF)
{
theApp.m_pCon->Execute((_bstr_t)("insert into shouru(时间)values('"+Str+"')"),NULL,adCmdText);
}
1@ 1处的消息响应能在resoure.h中查到、
请问这里的消息响应是人为添加的还是编译后生成的。
#define IDB_login 9000
#define IDB_kaitai 9001
#define IDB_add 9002
#define IDB_pay 9003
#define IDB_rishouru 9004
#define IDB_reg 9005
#define IDB_cancel 9006
2@ 但是2处的10001---10004是起什么作用的啊??
3@ 这里的消息响应函数怎么不用classwizard添加,而且这里的消息映射没有标号(数字的列入1001.。。等等)
ON_COMMAND(ID_MENU_login, OnMENUlogin)
ON_COMMAND(ID_MENU_kaitai, OnMENUkaitai)
ON_COMMAND(ID_MENU_jiezhang, OnMENUjiezhang)
ON_COMMAND(IDB_kaitai, OnBUTTONkaitai)
ON_COMMAND(IDB_pay, OnBUTTONjiezhang)
ON_COMMAND(ID_MENU_jiesuan, OnMENUjiesuan)
ON_COMMAND(IDB_rishouru, OnBUTTONrishouru)
ON_COMMAND(ID_MENU_yuangong, OnMENUyuangong)
ON_COMMAND(IDB_reg, OnBUTTONzhuce)
ON_COMMAND(ID_MENU_about, OnMENUabout)
Time = CTime::GetCurrentTime();
CString Str = Time.Format("%Y-%m-%d");
m_Imagelist.Create(32,32,ILC_COLOR24|ILC_MASK,1,1);
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_login));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_open));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_add));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_pay));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_rishouru));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_reg));
m_Imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_cancel));
UINT Array[7];
for(int i=0;i<7;i++)
{
Array[i]=9000+i;------------------------------------------1
}
m_Toolbar.Create(this);
m_Toolbar.SetButtons(Array,7);
m_Toolbar.SetButtonText(0,"系统登录");
m_Toolbar.SetButtonText(1,"开台");
m_Toolbar.SetButtonText(2,"加减菜");
m_Toolbar.SetButtonText(3,"顾客买单");
m_Toolbar.SetButtonText(4,"本日收入");
m_Toolbar.SetButtonText(5,"员工注册");
m_Toolbar.SetButtonText(6,"退出系统");
m_Toolbar.GetToolBarCtrl().SetButtonWidth(60,120);
m_Toolbar.GetToolBarCtrl().SetImageList(&m_Imagelist);
m_Toolbar.SetSizes(CSize(70,60),CSize(28,40));
for(i=0;i<4;i++)
{
Array[i]=10000+1;--------------------------------------2
}
m_Statusbar.Create(this);
m_Statusbar.SetIndicators(Array,4);
for(int n=0;n<3;n++)
{
m_Statusbar.SetPaneInfo(n,Array[n],0,80);
}
m_Statusbar.SetPaneInfo(1,Array[1],0,200);
m_Statusbar.SetPaneInfo(2,Array[2],0,800);
m_Statusbar.SetPaneText(2,"当前时间"+Str);
m_Statusbar.SetPaneText(0,"餐饮管理系统");
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_kaitai,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_pay,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_rishouru,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_reg,false);
m_Toolbar.GetToolBarCtrl().EnableButton(IDB_add,false);
CMenu* pMenu=GetMenu();
pMenu->GetSubMenu(1)->EnableMenuItem(0,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(1)->EnableMenuItem(1,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(2)->EnableMenuItem(0,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(2)->EnableMenuItem(1,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(2)->EnableMenuItem(2,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(3)->EnableMenuItem(0,MF_BYPOSITION | MF_GRAYED);
pMenu->GetSubMenu(3)->EnableMenuItem(1,MF_BYPOSITION | MF_GRAYED);
CString Sql;
Sql="select * from shouru where 时间='"+Str+"'";
m_pRs=theApp.m_pCon->Execute((_bstr_t)Sql,NULL,adCmdText);
if(m_pRs->adoEOF)
{
theApp.m_pCon->Execute((_bstr_t)("insert into shouru(时间)values('"+Str+"')"),NULL,adCmdText);
}
1@ 1处的消息响应能在resoure.h中查到、
请问这里的消息响应是人为添加的还是编译后生成的。
#define IDB_login 9000
#define IDB_kaitai 9001
#define IDB_add 9002
#define IDB_pay 9003
#define IDB_rishouru 9004
#define IDB_reg 9005
#define IDB_cancel 9006
2@ 但是2处的10001---10004是起什么作用的啊??
3@ 这里的消息响应函数怎么不用classwizard添加,而且这里的消息映射没有标号(数字的列入1001.。。等等)
ON_COMMAND(ID_MENU_login, OnMENUlogin)
ON_COMMAND(ID_MENU_kaitai, OnMENUkaitai)
ON_COMMAND(ID_MENU_jiezhang, OnMENUjiezhang)
ON_COMMAND(IDB_kaitai, OnBUTTONkaitai)
ON_COMMAND(IDB_pay, OnBUTTONjiezhang)
ON_COMMAND(ID_MENU_jiesuan, OnMENUjiesuan)
ON_COMMAND(IDB_rishouru, OnBUTTONrishouru)
ON_COMMAND(ID_MENU_yuangong, OnMENUyuangong)
ON_COMMAND(IDB_reg, OnBUTTONzhuce)
ON_COMMAND(ID_MENU_about, OnMENUabout)