www.pudn.com > 6433624505.rar > Other.cpp
// Other.cpp : implementation file
//
#include "stdafx.h"
#include "Browser.h"
#include "Other.h"
#include "AllUser.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COther dialog
COther::COther(CWnd* pParent /*=NULL*/)
: CDialog(COther::IDD, pParent)
{
//{{AFX_DATA_INIT(COther)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void COther::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COther)
DDX_Control(pDX, IDC_INDEX, m_Index);
DDX_Control(pDX, IDC_PROCEDURE, m_Procedure);
DDX_Control(pDX, IDC_SEQUENCE, m_Sequence);
DDX_Control(pDX, IDC_TRIGGER, m_Trigger);
DDX_Control(pDX, IDCANCEL, m_Close);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COther, CDialog)
//{{AFX_MSG_MAP(COther)
ON_BN_CLICKED(IDC_TRIGGER, OnTrigger)
ON_BN_CLICKED(IDC_PROCEDURE, OnProcedure)
ON_BN_CLICKED(IDC_INDEX, OnIndex)
ON_BN_CLICKED(IDC_SEQUENCE, OnSequence)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COther message handlers
BOOL COther::OnInitDialog()
{
CDialog::OnInitDialog();
m_bitmapground.LoadBitmap(IDB_SONBACK);
m_Close.LoadBitmaps(IDB_CLOSEONE,IDB_CLOSETWO);
m_Trigger.LoadBitmaps(IDB_TRIGGERONE,IDB_TRIGGERTWO);
m_Procedure.LoadBitmaps(IDB_PROONE,IDB_PROTWO);
m_Index.LoadBitmaps(IDB_INDEXONE,IDB_INDEXTWO);
m_Sequence.LoadBitmaps(IDB_SEQONE,IDB_SEQTWO);
return TRUE;
}
void COther::OnTrigger()
{
CAllUser user;
user.pConn = pConn;
user.select = 2;
user.DoModal();
}
void COther::OnProcedure()
{
CAllUser user;
user.pConn = pConn;
user.select = 3;
user.DoModal();
}
void COther::OnIndex()
{
CAllUser user;
user.pConn = pConn;
user.select = 4;
user.DoModal();
}
void COther::OnSequence()
{
CAllUser user;
user.pConn = pConn;
user.select = 5;
user.DoModal();
}
void COther::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect(&rect);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
BITMAP bitMap;
m_bitmapground.GetBitmap(&bitMap);
CBitmap *pbmpOld=dcMem.SelectObject(&m_bitmapground);
dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,bitMap.bmWidth,bitMap.bmHeight,SRCCOPY);
CDialog::OnPaint();
}
void COther::OnLButtonDown(UINT nFlags, CPoint point)
{
if(point.x >=5 && point.x <= 65 && point.y >= 2 && point.y <=30)
PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(point.x, point.y));
CDialog::OnLButtonDown(nFlags, point);
}