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

📄 infordlg.cpp

📁 书店销售管理系统 用c++写的
💻 CPP
字号:
// InforDlg.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "InforDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CInforDlg dialog


CInforDlg::CInforDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CInforDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CInforDlg)
	//}}AFX_DATA_INIT
}

CInforDlg::~CInforDlg()
{
}


void CInforDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInforDlg)
	DDX_Control(pDX, IDC_INFOTAB, m_InfoTab);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInforDlg, CDialog)
	//{{AFX_MSG_MAP(CInforDlg)
	ON_NOTIFY(TCN_SELCHANGE, IDC_INFOTAB, OnSelchangeInfotab)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInforDlg message handlers

BOOL CInforDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CRect rect;

	m_InfoTab.InsertItem(0,_T("出售信息"));
	m_InfoTab.InsertItem(1,_T("进货信息"));
	m_InfoTab.InsertItem(2,_T("库存信息"));
	m_InfoTab.InsertItem(3,_T("营业信息"));

	sellinfor.pConn = pConn;
	buyinfor.pConn = pConn;
	stockinfor.pConn = pConn;
	runinfor.pConn = pConn;

	sellinfor.Create(MAKEINTRESOURCE(IDD_SELLINFO),this);
	buyinfor.Create(MAKEINTRESOURCE(IDD_BUYINFO),this);
	stockinfor.Create(MAKEINTRESOURCE(IDD_STOCKINFO),this);
	runinfor.Create(MAKEINTRESOURCE(IDD_RUNINFO),this);

		
	sellinfor.GetClientRect(&rect);
	m_InfoTab.AdjustRect(FALSE,&rect);
	rect.top+=10;
	rect.bottom+=30;
	sellinfor.MoveWindow(&rect);

	buyinfor.GetClientRect(&rect);
	m_InfoTab.AdjustRect(FALSE,&rect);
	rect.top+=10;
	rect.bottom+=30;
	buyinfor.MoveWindow(&rect);

	stockinfor.GetClientRect(&rect);
	m_InfoTab.AdjustRect(FALSE,&rect);
	rect.top+=10;
	rect.bottom+=30;
	stockinfor.MoveWindow(&rect);

	runinfor.GetClientRect(&rect);
	m_InfoTab.AdjustRect(FALSE,&rect);
	rect.top+=10;
	rect.bottom+=30;
	runinfor.MoveWindow(&rect);

	m_InfoTab.SetCurSel(0);
	sellinfor.ShowWindow(SW_SHOW);
	return TRUE;
}


void CInforDlg::HideAllTabWindow()
{
	sellinfor.ShowWindow(SW_HIDE);
	buyinfor.ShowWindow(SW_HIDE);
	stockinfor.ShowWindow(SW_HIDE);
	runinfor.ShowWindow(SW_HIDE);
}

void CInforDlg::OnSelchangeInfotab(NMHDR* pNMHDR, LRESULT* pResult) 
{
	HideAllTabWindow();
	switch(m_InfoTab.GetCurSel())
	{
	case 0:
		sellinfor.ShowWindow(SW_SHOW);
		break;
	case 1:
		buyinfor.ShowWindow(SW_SHOW);
		break;
	case 2:
		stockinfor.ShowWindow(SW_SHOW);
		break;
	case 3:
		runinfor.ShowWindow(SW_SHOW);
		break;
	}
	*pResult = 0;
}

⌨️ 快捷键说明

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