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

📄 operatordlg.cpp

📁 酒店管理系统的毕业设计,用VC编的,功能有限
💻 CPP
字号:
// operatorDlg.cpp : implementation file
//

#include "stdafx.h"

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

/////////////////////////////////////////////////////////////////////////////
// operatorDlg dialog


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


void operatorDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(operatorDlg)
	DDX_Control(pDX, IDC_TAB5, m_tabctrl);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(operatorDlg, CDialog)
	//{{AFX_MSG_MAP(operatorDlg)
	ON_NOTIFY(TCN_SELCHANGE, IDC_TAB5, OnSelchangeTab5)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// operatorDlg message handlers


BOOL operatorDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    TCITEM     item;   
    item.mask     =     TCIF_TEXT;   
    item.pszText  =     "入住";  
	m_tabctrl.InsertItem(0,&item);   
	RRdlg.Create(IDD_reserveroom,&m_tabctrl);
    
	item.pszText =     "预约";
    m_tabctrl.InsertItem(1,&item); 
	BkDlg.Create(IDD_BOOKROOM,&m_tabctrl);
    
	item.pszText =     "退房";
    m_tabctrl.InsertItem(2,&item); 
	ABDlg.Create(IDD_ABANDONROOM,&m_tabctrl);
    
	item.pszText =     "预约入房";
    m_tabctrl.InsertItem(3,&item); 
	BTRDlg.Create(IDD_BOOKTORESIDE,&m_tabctrl);

	item.pszText =     "预约退房";
    m_tabctrl.InsertItem(4,&item); 
	BTADlg.Create(IDD_BOOKTOABANDON,&m_tabctrl);

	//获得IDC_TABTEST客户区大小
	CRect rs;
	m_tabctrl.GetClientRect(&rs);
	//调整子对话框在父窗口中的位置
	rs.top+=30; 
	rs.bottom-=30; 
	rs.left+=1; 
	rs.right-=2; 
	RRdlg.MoveWindow(&rs);
	BkDlg.MoveWindow(&rs);
	ABDlg.MoveWindow(&rs);
    BTRDlg.MoveWindow(&rs);
    BTADlg.MoveWindow(&rs);

	RRdlg.ShowWindow(TRUE);
    BkDlg.ShowWindow(FALSE);
	ABDlg.ShowWindow(FALSE);
	BTRDlg.ShowWindow(FALSE);
    BTADlg.ShowWindow(FALSE);
    m_tabctrl.SetCurSel(0);
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void operatorDlg::OnSelchangeTab5(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
    CRect     r;   
    m_tabctrl.GetClientRect     (&r);   
    
    switch(m_tabctrl.GetCurSel())   
    {   
    case     0:   
		RRdlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_SHOWWINDOW);   
		BkDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		ABDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BTRDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BTADlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BkDlg.clear();
        ABDlg.clear();
		BTRDlg.clear();
		BTRDlg.clear();
		break;   
    case     1:   
		RRdlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BkDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_SHOWWINDOW); 
		ABDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BTRDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BTADlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		RRdlg.clear();
		ABDlg.clear();
		BTRDlg.clear();
		BTRDlg.clear();
		break;   
	case     2:
		RRdlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BkDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		ABDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_SHOWWINDOW); 
		BTRDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BTADlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BkDlg.clear();
		RRdlg.clear();
		BTRDlg.clear();
		BTRDlg.clear();
		break;   
	case     3:
		RRdlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BkDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		ABDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BTRDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_SHOWWINDOW);
		BTADlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BkDlg.clear();
		RRdlg.clear();
		ABDlg.clear();
		BTRDlg.clear();
		break;
	case     4:
		RRdlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BkDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		ABDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW); 
		BTRDlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_HIDEWINDOW);
		BTADlg.SetWindowPos     (NULL,10,30,r.right     -20,r.bottom     -40,SWP_SHOWWINDOW);
		BkDlg.clear();
		RRdlg.clear();
		ABDlg.clear();
		BTRDlg.clear();
		break;
    }   	
	*pResult = 0;
}

void operatorDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnOK();
}

⌨️ 快捷键说明

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