123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- // Curwin.cpp : implementation file
- //
- #include "stdafx.h"
- #include "newclient.h"
- #include "Curwin.h"
- #include ".\curwin.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CCurwin dialog
- extern HBRUSH hBrush;
- extern CLIENTPARAM ClientParam;
- CCurwin::CCurwin(CWnd* pParent /*=NULL*/)
- : CDialog(CCurwin::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CCurwin)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CCurwin::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CCurwin)
- DDX_Control(pDX, IDC_BLACK, m_black);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CCurwin, CDialog)
- //{{AFX_MSG_MAP(CCurwin)
- ON_WM_CREATE()
- ON_WM_MOVE()
- ON_WM_PAINT()
- ON_WM_CTLCOLOR()
- //}}AFX_MSG_MAP
- ON_STN_CLICKED(IDC_BLACK, OnStnClickedBlack)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CCurwin message handlers
- int CCurwin::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CDialog::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- // TODO: Add your specialized creation code here
-
- return 0;
- }
- void CCurwin::OnMove(int x, int y)
- {
- CDialog::OnMove(x, y);
-
- // TODO: Add your message handler code here
-
- }
- void CCurwin::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
-
- // TODO: Add your message handler code here
- CRect rcBounds;
- GetClientRect(&rcBounds);
- CPen penWhite;
- penWhite.CreatePen(PS_SOLID, 1, RGB(0,255,0));
- CPen* pOldPen = dc.SelectObject(&penWhite);
- dc.MoveTo(rcBounds.left, rcBounds.top);
- dc.LineTo(rcBounds.right-1,rcBounds.top);
- dc.LineTo(rcBounds.right-1,rcBounds.bottom-1);
- dc.LineTo(rcBounds.left, rcBounds.bottom-1);
- dc.LineTo(rcBounds.left, rcBounds.top);
- dc.SelectObject(pOldPen);
- m_black.MoveWindow(rcBounds.left+1,rcBounds.top+1,rcBounds.Width()-2,rcBounds.Height()-2);
- }
- HBRUSH CCurwin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
- // TODO: Change any attributes of the DC here
- if(ClientParam.m_bUseCard)
- {
- return hBrush;
- }
- // TODO: Return a different brush if the default is not desired
- return hbr;
- }
- void CCurwin::OnStnClickedBlack()
- {
- // TODO: 在此添加控件通知处理程序代码
- }
|