⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chinaandwestfood.cpp

📁 开发的,食物管理软件,可以在智能家电的终端上直接应用
💻 CPP
字号:
// ChinaAndWestFood.cpp : implementation file
//

#include "stdafx.h"
#include "FoodMenu.h"
#include "ChinaAndWestFood.h"
#include "LookUp1Dlg.h"//add

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChinaAndWestFood dialog


CChinaAndWestFood::CChinaAndWestFood(CWnd* pParent /*=NULL*/)
	: CDialog(CChinaAndWestFood::IDD, pParent)
{
	//{{AFX_DATA_INIT(CChinaAndWestFood)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CChinaAndWestFood::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChinaAndWestFood)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChinaAndWestFood, CDialog)
	//{{AFX_MSG_MAP(CChinaAndWestFood)
	ON_BN_CLICKED(IDC_YUE_BUTTON1, OnYueButton1)
	ON_BN_CLICKED(IDC_CUAN_BUTTON4, OnCuanButton4)
	ON_BN_CLICKED(IDC_WEST_BUTTON5, OnWestButton5)
	ON_BN_CLICKED(IDC_HUAIYAN_BUTTON2, OnHuaiyanButton2)
	ON_BN_CLICKED(IDC_LU_BUTTON3, OnLuButton3)
	ON_BN_CLICKED(IDC_HOME, OnHome)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChinaAndWestFood message handlers

void CChinaAndWestFood::OnYueButton1() 
{
	// TODO: Add your control notification handler code here
	CLookUp1Dlg LookUp1Dlg;
 	HANDLE isExistfile;
	WIN32_FIND_DATA lpFileData;
	LookUp1Dlg.strComboPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\粤菜\\";
	LookUp1Dlg.strMaterialPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\粤菜\\原料.txt";
	isExistfile=FindFirstFile(LookUp1Dlg.strMaterialPath,&lpFileData);
    if(isExistfile==INVALID_HANDLE_VALUE)
	{
		MessageBox(TEXT("没有粤菜的资料"),TEXT("出错啦!"),MB_ICONASTERISK |MB_OK);	
		FindClose(isExistfile);
		return;
	}
	FindClose(isExistfile);
	LookUp1Dlg.DoModal();
}

void CChinaAndWestFood::OnCuanButton4() 
{
	// TODO: Add your control notification handler code here
	CLookUp1Dlg LookUp1Dlg;
 	HANDLE isExistfile;
	WIN32_FIND_DATA lpFileData;
	LookUp1Dlg.strComboPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\川菜\\";
	LookUp1Dlg.strMaterialPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\川菜\\原料.txt";
	isExistfile=FindFirstFile(LookUp1Dlg.strMaterialPath,&lpFileData);
    if(isExistfile==INVALID_HANDLE_VALUE)
	{
		MessageBox(TEXT("没有川菜的资料"),TEXT("出错啦!"),MB_ICONASTERISK |MB_OK);	
		FindClose(isExistfile);
		return;
	}
	FindClose(isExistfile);
	LookUp1Dlg.DoModal();
}

void CChinaAndWestFood::OnWestButton5() 
{
	// TODO: Add your control notification handler code here
	CLookUp1Dlg LookUp1Dlg;
 	HANDLE isExistfile;
	WIN32_FIND_DATA lpFileData;
	LookUp1Dlg.strComboPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\西式菜\\";
	LookUp1Dlg.strMaterialPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\西式菜\\原料.txt";
	isExistfile=FindFirstFile(LookUp1Dlg.strMaterialPath,&lpFileData);
    if(isExistfile==INVALID_HANDLE_VALUE)
	{
		MessageBox(TEXT("没有西式菜的资料"),TEXT("出错啦!"),MB_ICONASTERISK |MB_OK);	
		FindClose(isExistfile);
		return;
	}
	FindClose(isExistfile);
	LookUp1Dlg.DoModal();
}

void CChinaAndWestFood::OnHuaiyanButton2() 
{
	// TODO: Add your control notification handler code here
	CLookUp1Dlg LookUp1Dlg;
 	HANDLE isExistfile;
	WIN32_FIND_DATA lpFileData;
	LookUp1Dlg.strComboPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\淮阳菜\\";
	LookUp1Dlg.strMaterialPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\淮阳菜\\原料.txt";
	isExistfile=FindFirstFile(LookUp1Dlg.strMaterialPath,&lpFileData);
    if(isExistfile==INVALID_HANDLE_VALUE)
	{
		MessageBox(TEXT("没有淮阳菜的资料"),TEXT("出错啦!"),MB_ICONASTERISK |MB_OK);	
		FindClose(isExistfile);
		return;
	}
	FindClose(isExistfile);
	LookUp1Dlg.DoModal();
}

void CChinaAndWestFood::OnLuButton3() 
{
	// TODO: Add your control notification handler code here
	CLookUp1Dlg LookUp1Dlg;
	HANDLE isExistfile;
	WIN32_FIND_DATA lpFileData;
	LookUp1Dlg.strComboPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\鲁菜\\";
	LookUp1Dlg.strMaterialPath=L"\\Storage Card\\foodMenuData\\中西菜谱\\鲁菜\\原料.txt";
	isExistfile=FindFirstFile(LookUp1Dlg.strMaterialPath,&lpFileData);
    if(isExistfile==INVALID_HANDLE_VALUE)
	{
		MessageBox(TEXT("没有鲁菜的资料"),TEXT("出错啦!"),MB_ICONASTERISK |MB_OK);	
		FindClose(isExistfile);
		return;
	}
	FindClose(isExistfile);
	LookUp1Dlg.DoModal();
}


BOOL CChinaAndWestFood::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	 	/////////////////////////////////////////////////////////////////////////
    yue_cai.LoadBitmaps(IDB_yue_cai,IDB_yue_cai);
	cuan_cai.LoadBitmaps(IDB_cuan_cai,IDB_cuan_cai);
     lu_cai.LoadBitmaps(IDB_lu_cai,IDB_lu_cai);
    huai_yan_cai.LoadBitmaps(IDB_huaiyan_cai,IDB_huaiyan_cai);
    xi_si_cai.LoadBitmaps(IDB_west_cai,IDB_west_cai);
	home.LoadBitmaps(IDB_home,IDB_home);
	back.LoadBitmaps(IDB_return,IDB_return);

	VERIFY(yue_cai.SubclassDlgItem(IDC_YUE_BUTTON1, this));
    VERIFY(cuan_cai.SubclassDlgItem(IDC_CUAN_BUTTON4, this));
	VERIFY(lu_cai.SubclassDlgItem(IDC_LU_BUTTON3, this));
	VERIFY(huai_yan_cai.SubclassDlgItem(IDC_HUAIYAN_BUTTON2, this));
	VERIFY(xi_si_cai.SubclassDlgItem(IDC_WEST_BUTTON5, this));
	VERIFY(home.SubclassDlgItem(IDC_HOME, this));
    VERIFY(back.SubclassDlgItem(IDC_BACK, this));


	yue_cai.SizeToContent();
	cuan_cai.SizeToContent();
	lu_cai.SizeToContent();
	huai_yan_cai.SizeToContent();
	xi_si_cai.SizeToContent();
    home.SizeToContent();
	back.SizeToContent();
	//////////////////////////////////////////////////////////////////////////////////
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}



void CChinaAndWestFood::OnHome() 
{
	CDialog::OnOK();	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -