BargraphsDlg.cpp
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:2k
- // BargraphsDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ColorStatic.h"
- #include "barpropdlg.h"
- #include "BargraphsDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CBargraphsDlg dialog
- CBargraphsDlg::CBargraphsDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CBargraphsDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CBargraphsDlg)
- m_sParam = _T("");
- m_name = _T("");
- m_sNumber = _T("");
- //}}AFX_DATA_INIT
- m_nDirection = 0;
- m_nOne = 100;
- m_nTwo = 100;
- m_cBar = RGB(255,0,0);
- m_cOne = RGB(0,255,0);
- m_cTwo = RGB(255,255,0);
- }
- void CBargraphsDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CBargraphsDlg)
- DDX_Text(pDX, IDC_EDIT1, m_sParam);
- DDX_Text(pDX, IDC_BAR_NAME, m_name);
- DDX_Text(pDX, IDC_BAR_NUMBER, m_sNumber);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CBargraphsDlg, CDialog)
- //{{AFX_MSG_MAP(CBargraphsDlg)
- ON_BN_CLICKED(IDC_CONFIGRUE, OnConfigrue)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CBargraphsDlg message handlers
- void CBargraphsDlg::OnConfigrue()
- {
- CBarpropDlg barDlg;
- // Initialize the barDlg;
-
- barDlg.m_nDirection = m_nDirection;
- barDlg.m_nOne = m_nOne;
- barDlg.m_nTwo = m_nTwo;
- barDlg.m_cBar.SetColor( m_cBar );
- barDlg.m_cOne.SetColor( m_cOne );
- barDlg.m_cTwo.SetColor( m_cTwo );
- // End of the initialization
- //barDlg.UpdateData(FALSE);
- if( barDlg.DoModal() == IDOK)
- {
- // Get the value of the User setting
- m_nDirection = barDlg.m_nDirection;
- m_nOne = barDlg.m_nOne;
- m_nTwo = barDlg.m_nTwo;
- barDlg.m_cBar.GetColor( m_cBar) ;
- barDlg.m_cOne.GetColor( m_cOne );
- barDlg.m_cTwo.GetColor( m_cTwo );
- // Getting end;
- }
- UpdateData(FALSE); // Refresh the controls' values
- }