CurveDlg.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // CurvePage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "IDE.h"
  5. #include "CurveDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. extern void DrawColorButton(LPDRAWITEMSTRUCT lpDIS,COLORREF clrButton);
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CCurveDlg dialog
  14. IMPLEMENT_DYNCREATE(CurvePage, CPropertyPage)
  15. CurvePage::CurvePage(): CPropertyPage(CurvePage::IDD)
  16. {
  17. //{{AFX_DATA_INIT(CurvePage)
  18. m_strVar1 = _T("");
  19. m_strVar2 = _T("");
  20. m_strVar3 = _T("");
  21. m_nLowwer = 0;
  22. m_nUpper = 0;
  23. //}}AFX_DATA_INIT
  24. }
  25. CurvePage::~CurvePage()
  26. {
  27. }
  28. void CurvePage::DoDataExchange(CDataExchange* pDX)
  29. {
  30. CPropertyPage::DoDataExchange(pDX);
  31. //{{AFX_DATA_MAP(CurvePage)
  32. DDX_Text(pDX, IDC_VAR1, m_strVar1);
  33. DDX_Text(pDX, IDC_VAR2, m_strVar2);
  34. DDX_Text(pDX, IDC_VAR3, m_strVar3);
  35. DDX_Text(pDX, IDC_LOWWER, m_nLowwer);
  36. DDX_Text(pDX, IDC_UPPER, m_nUpper);
  37. //}}AFX_DATA_MAP
  38. }
  39. BEGIN_MESSAGE_MAP(CurvePage, CPropertyPage)
  40. //{{AFX_MSG_MAP(CurvePage)
  41. ON_WM_DRAWITEM()
  42. ON_BN_CLICKED(IDC_CURVE1COLOR, OnCurve1color)
  43. ON_BN_CLICKED(IDC_CURVE2COLOR, OnCurve2color)
  44. ON_BN_CLICKED(IDC_CURVE3COLOR, OnCurve3color)
  45. ON_BN_CLICKED(IDC_SELVAR1, OnSelvar1)
  46. ON_BN_CLICKED(IDC_SELVAR2, OnSelvar2)
  47. ON_BN_CLICKED(IDC_SELVAR3, OnSelvar3)
  48. //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CurvePage message handlers
  52. void CurvePage::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
  53. {
  54. switch(nIDCtl)
  55. {
  56. case IDC_CURVE1COLOR:
  57. DrawColorButton(lpDrawItemStruct,m_clrCurve1);
  58. break;
  59. case IDC_CURVE2COLOR:
  60. DrawColorButton(lpDrawItemStruct,m_clrCurve2);
  61. break;
  62. case IDC_CURVE3COLOR:
  63. DrawColorButton(lpDrawItemStruct,m_clrCurve3);
  64. break;
  65. }
  66. CPropertyPage::OnDrawItem(nIDCtl, lpDrawItemStruct);
  67. }
  68. void CurvePage::OnCurve1color()
  69. {
  70. CColorDialog dlg(m_clrCurve1);
  71. if(dlg.DoModal()==IDOK)
  72. {
  73. m_clrCurve1 = dlg.GetColor();
  74. CButton* pButton = (CButton *)GetDlgItem(IDC_CURVE1COLOR);
  75. pButton->ShowWindow(SW_HIDE);
  76. pButton->ShowWindow(SW_SHOW);
  77. }
  78. }
  79. void CurvePage::OnCurve2color()
  80. {
  81. CColorDialog dlg(m_clrCurve2);
  82. if(dlg.DoModal()==IDOK)
  83. {
  84. m_clrCurve2 = dlg.GetColor();
  85. CButton* pButton = (CButton *)GetDlgItem(IDC_CURVE2COLOR);
  86. pButton->ShowWindow(SW_HIDE);
  87. pButton->ShowWindow(SW_SHOW);
  88. }
  89. }
  90. void CurvePage::OnCurve3color()
  91. {
  92. CColorDialog dlg(m_clrCurve3);
  93. if(dlg.DoModal()==IDOK)
  94. {
  95. m_clrCurve3 = dlg.GetColor();
  96. CButton* pButton = (CButton *)GetDlgItem(IDC_CURVE3COLOR);
  97. pButton->ShowWindow(SW_HIDE);
  98. pButton->ShowWindow(SW_SHOW);
  99. }
  100. }
  101. void CurvePage::OnSelvar1()
  102. {
  103. }
  104. void CurvePage::OnSelvar2()
  105. {
  106. }
  107. void CurvePage::OnSelvar3()
  108. {
  109. }