資源簡介
VC++6.0下開發的,數據寫在本地文件中,可直接運行。
主要功能有前臺菜單點選(點菜結果,點菜統計,菜單修改,刪除,發送);廚房數據接收(菜單顯示,刪除,保存,數據統計,返回消息);后臺數據管理(增刪改);界面美化,啟動動畫等。
應用技術有TCP/IP的Socket(解決了粘包,接收不全問題),數據結構(CPtrList等),STL(string, vector等),CFile,多線程,控件重構,界面美化等。
代碼片段和文件信息
//?Amend.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“EateryMenu.h“
#include?“Amend.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CAmend?dialog
CString?g_strType?=?““;//菜大類
CString?g_strName?=?““;//菜名稱
CString?g_strPrice?=?““;//單價
CString?g_strUnit?=?““;//單位
CAmend::CAmend(CWnd*?pParent?/*=NULL*/)
:?CDialog(CAmend::IDD?pParent)
{
//{{AFX_DATA_INIT(CAmend)
//?NOTE:?the?ClassWizard?will?add?member?initialization?here
//}}AFX_DATA_INIT
}
CAmend::~CAmend()//釋放內存
{
if?(m_menuList.GetCount()?>?0)//清空鏈表
{
m_menuList.RemoveAll();
}
int?nCount3?=?m_categoryArray.GetSize();
for?(int?i=0;?i {
delete?m_categoryArray.GetAt(i);
}
m_categoryArray.RemoveAll();
int?nCount2?=?m_unitArray.GetSize();
for?(int?j=0;?j {
delete?m_unitArray.GetAt(j);
}
m_unitArray.RemoveAll();
int?nCount1?=?m_listCategory.GetSize();
for?(int?k=0;?k {
delete?m_listCategory.GetAt(k);
}
m_listCategory.RemoveAll();
}
void?CAmend::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAmend)
DDX_Control(pDX?IDC_BTN_DEL?m_btDel);
DDX_Control(pDX?IDC_BTN_SAVE?m_btSave);
DDX_Control(pDX?IDC_BTN_CLOSE?m_btClose);
DDX_Control(pDX?IDC_LIST_DISH?m_listCtlDish);
DDX_Control(pDX?IDC_TREE_DISH?m_treeDish);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAmend?CDialog)
//{{AFX_MSG_MAP(CAmend)
ON_WM_SHOWWINDOW()
ON_NOTIFY(NM_DBLCLK?IDC_TREE_DISH?OnDblclkTreeDish)
ON_NOTIFY(NM_DBLCLK?IDC_LIST_DISH?OnDblclkListDish)
ON_BN_CLICKED(IDC_BTN_SAVE?OnBtnSave)
ON_WM_TIMER()
ON_BN_CLICKED(IDC_BTN_DEL?OnBtnDel)
ON_BN_CLICKED(IDC_BTN_CLOSE?OnBtnClose)
//}}AFX_MSG_MAP
ON_NOTIFY(NM_CUSTOMDRAW?IDC_LIST_DISH?OnCustomdrawDishList)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CAmend?message?handlers
void?CAmend::OnShowWindow(BOOL?bShow?UINT?nStatus)?
{
CDialog::OnShowWindow(bShow?nStatus);
if?(bShow)
{
ShowTree();
AddToCateCom();//初始化大類列表框
AddToUnitCom();//初始化單位列表框
ClearWdTxt();
}
//?TODO:?Add?your?message?handler?code?here
}
void?CAmend::ShowTree()
{
ListCategoryAdd(&m_menuList?&m_listCategory);//加載數據
m_treeDish.DeleteAllItems();
for?(int?i=0;?i {
char?*parentStr?=?(char?*)m_listCategory.GetAt(i);
TV_INSERTSTRUCT?tvinsert;????//創建待加入的TV_INSERTSTRUCT的結構
tvinsert.hParent?=?NULL;???????//無父節點
tvinsert.hInsertAfter?=?TVI_LAST;??//插入到本層最后
tvinsert.item.mask?=?TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT;
//掩碼,圖標、選選中圖標、文字
tvinsert.item.hItem?=?NULL;//句柄為空
tvinsert.item.state?=?0;???//狀態
tvinsert.item.stateMask?=?0;//狀態為掩碼
tvinsert.item.cchTextMax?=?6;//最大文字長度
tvinsert.item.cChildren?=?0
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-04-17?15:21??EateryMenu\
?????文件???????20265??2013-12-23?23:12??EateryMenu\Amend.cpp
?????文件????????2933??2013-12-23?23:11??EateryMenu\Amend.h
?????文件????????5078??2013-12-23?23:42??EateryMenu\ba
?????文件????????1770??2002-02-01?11:16??EateryMenu\ba
?????文件???????22620??2013-12-22?21:07??EateryMenu\BtnST.cpp
?????文件????????6690??2013-12-23?23:42??EateryMenu\BtnST.h
?????文件????????7244??2013-12-23?21:03??EateryMenu\DishAddData.cpp
?????文件????????1742??2013-12-23?21:03??EateryMenu\DishAddData.h
?????文件???????19737??2013-12-24?09:04??EateryMenu\DISHCHOOSE.cpp
?????文件????????2602??2013-12-24?06:39??EateryMenu\DISHCHOOSE.h
?????文件????????2336??2013-12-23?15:41??EateryMenu\DISHMANAGER.cpp
?????文件????????1466??2013-12-23?15:39??EateryMenu\DISHMANAGER.h
?????文件????????2552??2013-12-23?22:37??EateryMenu\DishMenuData.txt
?????文件?????????130??2013-12-09?09:39??EateryMenu\DishTaste.txt
?????文件??????????96??2013-12-07?16:36??EateryMenu\DishTyList.txt
?????文件??????????22??2013-12-17?10:55??EateryMenu\DishUnitList.txt
?????文件????????6299??2013-12-17?15:54??EateryMenu\DlgNumChange.cpp
?????文件????????1919??2013-12-17?16:09??EateryMenu\DlgNumChange.h
?????文件??????137164??2014-02-26?11:36??EateryMenu\EateryMenu.aps
?????文件????????6568??2014-03-12?16:19??EateryMenu\EateryMenu.clw
?????文件????????2980??2013-12-25?20:21??EateryMenu\EateryMenu.cpp
?????文件????????6595??2013-12-25?20:24??EateryMenu\EateryMenu.dsp
?????文件?????????545??2013-12-02?15:33??EateryMenu\EateryMenu.dsw
?????文件????????1465??2013-12-25?15:16??EateryMenu\EateryMenu.h
?????文件??????377856??2014-03-12?16:23??EateryMenu\EateryMenu.ncb
?????文件???????68608??2014-03-12?16:23??EateryMenu\EateryMenu.opt
?????文件????????1694??2013-12-25?20:21??EateryMenu\EateryMenu.plg
?????文件???????13229??2013-12-25?20:20??EateryMenu\EateryMenu.rc
?????文件???????11133??2013-12-25?20:21??EateryMenu\EateryMenuDlg.cpp
?????文件????????2192??2013-12-25?15:29??EateryMenu\EateryMenuDlg.h
............此處省略26個文件信息
- 上一篇:用c++解決金剛坐飛機問題
- 下一篇:Windows課程設計報告與源碼
評論
共有 條評論