【VC开源代码栏目提醒】:网学会员VC开源代码为您提供bbbDlg.cpp参考,解决您在bbbDlg.cpp学习中工作中的难题,参考学习。
// bbbDlg.cpp : implementation file
//
#include "stdafx.h"
#include "bbb.h"
#include "bbbDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern BOOL Flag ;
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
extern CBbbApp theApp;
extern _ConnectionPtr m_pCon; //ADO连接对象
extern _RecordsetPtr m_pRs;
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBbbDlg dialog
CBbbDlg::CBbbDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBbbDlg::IDD, pParent)
{
pdlgBaseInfoM = NULL;
pdlgStoreInfoM = NULL;
pdlgQueryM = NULL;
bFlag = FALSE;
//{{AFX_DATA_INIT(CBbbDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);//IDR_MAINFRAME);
}
void CBbbDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBbbDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBbbDlg, CDialog)
//{{AFX_MSG_MAP(CBbbDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND(ID_EXIT, OnNew)
ON_WM_DRAWITEM()
ON_WM_MEASUREITEM()
ON_WM_MOUSEMOVE()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
ON_COMMAND(ID_OPERATOR_M, OnOperatorM)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_WM_TIMER()
ON_COMMAND(IDD_ABOUTBOX, OnAboutbox)
ON_COMMAND(ID_BOOK_INFO, OnBookInfo)
ON_COMMAND(ID_PROVIDER_INFO, OnProviderInfo)
ON_COMMAND(ID_BOOK_TYPE, OnBookType)
ON_COMMAND(ID_CK_INFO, OnCkInfo)
ON_COMMAND(ID_DESK_INFO, OnDeskInfo)
ON_COMMAND(ID_BOOK_INPUT, OnBookInput)
ON_COMMAND(ID_BOOK_PRICE, OnBookPrice)
ON_COMMAND(ID_BOOK_PRICE_ADJUST, OnBookPriceAdjust)
ON_COMMAND(ID_INPUT_BACK, OnInputBack)
ON_COMMAND(ID_BOOK_ADJUST, OnBookAdjust)
ON_COMMAND(ID_SALE_M, OnSaleM)
ON_COMMAND(ID_SALE_BACK, OnSaleBack)
ON_COMMAND(ID_INPUT_QUERY, OnInputQuery)
ON_COMMAND(ID_INPUT_BACK_QUERY, OnInputBackQuery)
ON_COMMAND(ID_SALE_QUERY, OnSaleQuery)
ON_COMMAND(ID_SALE_BACK_QUERY, OnSaleBackQuery)
ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBbbDlg message handlers
BOOL CBbbDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
AdoInit();
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_mnu.AttachMenu(GetMenu()->GetSafeHmenu(),IDR_TOOLBAR1,CSize(16,15));
GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BUTTON3)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BUTTON4)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BUTTON5)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BUTTON6)->ShowWindow(SW_HIDE);
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BUTTON8)->ShowWindow(SW_HIDE);
SetTimer(1, 1000, NULL);
return TRUE; // return TRUE unless you set the focus to a control
}
void CBbbDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CBbbDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CBbbDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CBbbDlg::OnNew()
{
exit(0);
}
void CBbbDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your message handler code here and/or call default
m_mnu.DrawItem(lpDrawItemStruct);
CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
}
void CBbbDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
// TODO: Add your message handler code here and/or call default
m_mnu.MeasureItem(lpMeasureItemStruct);
CDialog::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
}
void CBbbDlg::OnMouseMove(UINT nFlags, CPoint point)
{
x = point.x;
y = point.y;
if (x>=27 && y>=141 &&x<=56 &&y<=171)
{
HBITMAP hbmp;
hbmp = (HBITMAP)::LoadImage(AfxFindResourceHandle(MAKEINTRESOURCE(IDB_B
上一篇:
bbb.cpp
下一篇:
第1章 现在完成时和现在完成进行时