?? dlgstoragem.cpp
字號:
// DlgStorageM.cpp : implementation file
//
#include "stdafx.h"
#include "aaa.h"
#include "DlgStorageM.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgStorageM dialog
CDlgStorageM::CDlgStorageM(CWnd* pParent /*=NULL*/)
: CDialog(CDlgStorageM::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgStorageM)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
nSelect = -1;
}
CDlgStorageM::CDlgStorageM(int iSelect, CWnd* pParent /*=NULL*/)
: CDialog(CDlgStorageM::IDD, pParent)
{
nSelect = iSelect;
}
void CDlgStorageM::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgStorageM)
DDX_Control(pDX, IDC_TAB1, m_tab);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgStorageM, CDialog)
//{{AFX_MSG_MAP(CDlgStorageM)
ON_COMMAND(IDC_SHUTDOWN, OnShut)
ON_COMMAND(IDC_ADD, AddOperate)
ON_COMMAND(IDC_MODIFY,CancelOperate)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgStorageM message handlers
BOOL CDlgStorageM::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_TOOLTIPS |CBRS_FLYBY | CBRS_SIZE_DYNAMIC))
{
return FALSE;
}
if(!m_wndReBar.Create(this,TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP|RBS_VERTICALGRIPPER
| CBRS_TOOLTIPS | CBRS_FLYBY| CBRS_SIZE_DYNAMIC))
{
return FALSE;
}
m_wndToolBar.GetToolBarCtrl().SetButtonWidth(40, 80); //設置按鈕的寬度和長度
CImageList img; //圖標列表
//設置"熱"圖標
img.Create(19, 19, ILC_COLOR24|ILC_MASK,2,2);
img.SetBkColor(::GetSysColor(COLOR_BTNFACE));
img.Add(AfxGetApp()->LoadIcon(IDI_ICON11)); //0
img.Add(AfxGetApp()->LoadIcon(IDI_ICON12)); //1
img.Add(AfxGetApp()->LoadIcon(IDI_SHUT_DOWN)); //3
m_wndToolBar.GetToolBarCtrl().SetImageList(&img);
img.Detach();
m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT |CBRS_TOOLTIPS | TBSTYLE_TRANSPARENT|TBBS_CHECKBOX); //改變工具欄屬性
m_wndToolBar.SetButtons(NULL, 3); //共九個按鈕
// 設置每個工具按鈕文字//IDC_WRITEMSGIDC_GETALLSIMIDC_MSG_BUTTONSPLIIDC_SCHOOL_REPORT_CARDIDC_MSG_BUTTONSPLI
//IDC_TELBOOKIDC_MSG_RECIEVEDIDC_MSG_SENDED
m_wndToolBar.SetButtonInfo(0, IDC_ADD, TBSTYLE_BUTTON, 0);
m_wndToolBar.SetButtonText(0, "增加");
m_wndToolBar.SetButtonInfo(1, IDC_MODIFY, TBSTYLE_BUTTON , 1);
m_wndToolBar.SetButtonText(1, "取消");
m_wndToolBar.SetButtonInfo(2, IDC_SHUTDOWN, TBSTYLE_BUTTON , 2);
m_wndToolBar.SetButtonText(2, "退出");
CRect rectToolBar;
m_wndToolBar.GetItemRect(0, &rectToolBar); //得到按鈕的大小
rectToolBar.right = 55;
rectToolBar.bottom= 42;
m_wndToolBar.SetSizes(rectToolBar.Size(), CSize(20,20)); //設置按鈕的大小
//在Rebar中加入ToolBar
m_wndReBar.AddBar(&m_wndToolBar);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
m_tab.AddPage("庫存盤點打印", &m_dlg0, IDD_CHECKPRINT_DIALOG);
m_tab.AddPage("庫存盤點", &m_dlg1, IDD_STORE_PD3);
m_tab.AddPage("庫存調撥", &m_dlg2, IDD_STORE_ADJUST3);
//m_tab.AddPage("商品出庫", &m_dlg2, IDD_STORE_ADJUST3);
m_tab.AddPage("商品出庫", &m_dlg3, IDD_PRODUCTOR_OUT);
m_tab.AddPage("庫存上下限", &m_dlg4, IDD_STORE_UP_DOWN3);
if (nSelect >=0)
{
m_tab.Show(nSelect);
}
else
{
m_tab.Show();
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgStorageM::OnShut()
{
m_tab.DestroyWindow();
CDlgStorageM::OnCancel();
}
BOOL CDlgStorageM::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message== WM_KEYDOWN)
if (pMsg->wParam ==13)
pMsg->wParam =9;
else if (pMsg->wParam ==VK_ESCAPE)
pMsg->wParam =0;
return CDialog::PreTranslateMessage(pMsg);
}
void CDlgStorageM::AddOperate()
{
int iCur = m_tab.GetCurSel();
switch (iCur)
{
case 1:
{
m_dlg1.CheckOporate();
break;
}
case 2:
{
m_dlg2.AddOperator();
break;
}
case 3:
{
m_dlg3.AddOperator();
break;
}
case 4:
{
m_dlg4.AddOperate();
break;
}
}
}
void CDlgStorageM::CancelOperate()
{
int iCur = m_tab.GetCurSel();
switch (iCur)
{
case 1:
{
m_dlg1.CancelOperate();
break;
}
case 2:
{
m_dlg2.CancelOperate();
break;
}
case 3:
{
m_dlg3.CancelOperate();
break;
}
case 4:
{
m_dlg4.CancelOperate();
break;
}
}
}
void CDlgStorageM::OnPaint()
{
CPaintDC dc(this); // device context for painting
// Do not call CDialog::OnPaint() for painting messages
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -