• 大小: 397KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: C/C++
  • 标签: VC++6.0  MFC  

资源简介

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\baseTabCtrl.cpp
     文件        1770  2002-02-01 11:16  EateryMenu\baseTabCtrl.h
     文件       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个文件信息

评论

共有 条评论