ReginSet.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // ReginSet.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "eastdraw.h"
  5. #include "ReginSet.h"
  6. #include "TextEdit.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CReginSet dialog
  14. CReginSet::CReginSet(CWnd* pParent /*=NULL*/)
  15. : CDialog(CReginSet::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(CReginSet)
  18. m_Length = 0;
  19. m_Width = 0;
  20. m_X = 0;
  21. m_Y = 0;
  22. //}}AFX_DATA_INIT
  23. m_bIsViewReign=false;
  24. this->brush.CreateSolidBrush(RGB(255,0,0));
  25. }
  26. void CReginSet::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CReginSet)
  30. DDX_Control(pDX, IDC_EDIT4, m_Edit_Y);
  31. DDX_Control(pDX, IDC_EDIT3, m_Edit_X);
  32. DDX_Text(pDX, IDC_EDIT_Length, m_Length);
  33. DDX_Text(pDX, IDC_EDIT_Width, m_Width);
  34. DDX_Text(pDX, IDC_EDIT3, m_X);
  35. DDX_Text(pDX, IDC_EDIT4, m_Y);
  36. //}}AFX_DATA_MAP
  37. }
  38. BEGIN_MESSAGE_MAP(CReginSet, CDialog)
  39. //{{AFX_MSG_MAP(CReginSet)
  40. ON_WM_CTLCOLOR()
  41. //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CReginSet message handlers
  45. HBRUSH CReginSet::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  46. {
  47. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  48. // TODO: Change any attributes of the DC here
  49. pDC->SetTextColor(RGB(0,100,255));
  50. pDC->SetBkColor(RGB(0,0,200));
  51. pDC->SelectObject(&brush);
  52. pDC->SetBkMode(TRANSPARENT);
  53. // TODO: Return a different brush if the default is not desired
  54. return hbr;
  55. }
  56. BOOL CReginSet::OnInitDialog()
  57. {
  58. CDialog::OnInitDialog();
  59. // TODO: Add extra initialization here
  60. if(this->m_bIsViewReign)
  61. {
  62. this->m_Edit_X.EnableWindow();
  63. this->m_Edit_Y.EnableWindow();
  64. }
  65. return TRUE; // return TRUE unless you set the focus to a control
  66. // EXCEPTION: OCX Property Pages should return FALSE
  67. }