【VC开源代码栏目提醒】:网学会员--在 VC开源代码编辑为广大网友搜集整理了: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();
img.Create(22, 22, ILC_COLOR24|ILC_MASK,2,2);
img.SetBkColor(::GetSysColor(COLOR_BTNFACE));
img.Add(AfxGetApp()->LoadIcon(IDI_ICON5)); //0
img.Add(AfxGetApp()->LoadIcon(IDI_ICON5)); //1
img.Add(AfxGetApp()->LoadIcon(IDI_ICON5)); //3
m_wndToolBar.GetToolBarCtrl().SetHotImageList(&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
}
上一篇:
cjxgtempunit.pas
下一篇:
女人七种行为逼男人想离婚