123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- // DynamicProPage.cpp : implementation file
- //
- #include "stdafx.h"
- //#include <afxtempl.h>
- #include "IDE.h"
- #include "DrawObj.h"
- #include "DynamicProPage.h"
- #include "DynColorDlg.h"
- #include "ActionDlg.h"
- #include "SelectVariantDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //const CString actionType[] =
- //{
- // g_strControl, g_strSet, g_strAdjust, g_strPictureLink, g_strExit, g_strExLink
- //};
- /////////////////////////////////////////////////////////////////////////////
- // CDynamicProPage property page
- IMPLEMENT_DYNCREATE(CDynamicProPage, CPropertyPage)
- CDynamicProPage::CDynamicProPage() : CPropertyPage(CDynamicProPage::IDD)
- {
- //{{AFX_DATA_INIT(CDynamicProPage)
- m_bVertiSize = FALSE;
- m_bVertiPos = FALSE;
- m_bOnMove = FALSE;
- m_bLineColor = FALSE;
- m_bHorizSize = FALSE;
- m_bHorizPos = FALSE;
- m_bForeColor = FALSE;
- m_bOnButtonUp = FALSE;
- m_bOnButtonDown = FALSE;
- m_bBackColor = FALSE;
- m_strHoriPos = _T("");
- m_strHoriSize = _T("");
- m_strVertiPos = _T("");
- m_strVertiSize = _T("");
- m_nHorAlign = -1;
- m_nVerAlign = -1;
- m_arrayActionType[0] = g_strControl;
- m_arrayActionType[1] = g_strSet;
- m_arrayActionType[2] = g_strAdjust;
- m_arrayActionType[3] = g_strPictureLink;
- m_arrayActionType[4] = g_strExit;
- m_arrayActionType[5] = g_strExLink;
- m_arrayActionType[6] = g_strTestAlarm;
- m_arrayActionType[7] = g_strAlarmRed;
- m_arrayActionType[8] = g_strNoticeRed;
- m_arrayActionType[9] = g_strDeviceLog;
- m_arrayActionType[10] = g_strSystemLog;
- m_arrayActionType[11] = g_strVarManage;
- m_arrayActionType[12] = g_strUserManage;
- m_arrayActionType[13] = g_strPwdManage;
- m_arrayActionType[14] = g_strFirstPage;
- m_arrayActionType[15] = g_strNativageTree;
- //}}AFX_DATA_INIT
- }
- CDynamicProPage::~CDynamicProPage()
- {
- }
- void CDynamicProPage::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDynamicProPage)
- DDX_Check(pDX, IDC_CHECKVERTISIZE, m_bVertiSize);
- DDX_Check(pDX, IDC_CHECKVERTIPOSITION, m_bVertiPos);
- DDX_Check(pDX, IDC_CHECKMOUSEMOVE, m_bOnMove);
- DDX_Check(pDX, IDC_CHECKLINECOLOR, m_bLineColor);
- DDX_Check(pDX, IDC_CHECKHORIZSIZE, m_bHorizSize);
- DDX_Check(pDX, IDC_CHECKHORIZPOSITION, m_bHorizPos);
- DDX_Check(pDX, IDC_CHECKFORECOLOR, m_bForeColor);
- DDX_Check(pDX, IDC_CHECKBUTTONUP, m_bOnButtonUp);
- DDX_Check(pDX, IDC_CHECKBUTTONDOWN, m_bOnButtonDown);
- DDX_Check(pDX, IDC_CHECKBACKCOLOR, m_bBackColor);
- DDX_Text(pDX, IDC_HORIPOSITION, m_strHoriPos);
- DDX_Text(pDX, IDC_HORISIZE, m_strHoriSize);
- DDX_Text(pDX, IDC_VERTIPOSITION, m_strVertiPos);
- DDX_Text(pDX, IDC_VERTISIZE, m_strVertiSize);
- DDX_Radio(pDX, IDC_HORALIGN, m_nHorAlign);
- DDX_Radio(pDX, IDC_VERALIGN, m_nVerAlign);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDynamicProPage, CPropertyPage)
- //{{AFX_MSG_MAP(CDynamicProPage)
- ON_BN_CLICKED(IDC_SETFORECOLOR, OnSetforecolor)
- ON_BN_CLICKED(IDC_SETLINECOLOR, OnSetlinecolor)
- ON_BN_CLICKED(IDC_SETBACKCOLOR, OnSetbackcolor)
- ON_BN_CLICKED(IDC_SETBUTTONDOWN, OnSetbuttondown)
- ON_BN_CLICKED(IDC_SETBUTTONUP, OnSetbuttonup)
- ON_BN_CLICKED(IDC_SETMOUSEMOVE, OnSetmousemove)
- ON_BN_CLICKED(IDC_HSIZECONEDIT, OnHsizeconedit)
- ON_BN_CLICKED(IDC_VSIZECONEDIT, OnVsizeconedit)
- ON_BN_CLICKED(IDC_HPOSCONEDIT, OnHposconedit)
- ON_BN_CLICKED(IDC_VPOSCONEDIT, OnVposconedit)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDynamicProPage message handlers
- void CDynamicProPage::OnSetforecolor()
- {
- CDynColorDlg dlg;
- dlg.m_clr = m_clrForeColor;
- dlg.m_strCon = m_strForeColorCondition;
- if (dlg.DoModal() == IDOK)
- {
- m_clrForeColor = dlg.m_clr;
- m_strForeColorCondition = dlg.m_strCon;
- }
- }
- void CDynamicProPage::OnSetlinecolor()
- {
- CDynColorDlg dlg;
- dlg.m_clr = m_clrLineColor;
- dlg.m_strCon = m_strFLineColorCondition;
- if (dlg.DoModal() == IDOK)
- {
- m_clrLineColor = dlg.m_clr;
- m_strFLineColorCondition = dlg.m_strCon;
- }
- }
- void CDynamicProPage::OnSetbackcolor()
- {
- CDynColorDlg dlg;
- dlg.m_clr = m_clrBackColor;
- dlg.m_strCon = m_strBackColorCondition;
- if (dlg.DoModal() == IDOK)
- {
- m_clrBackColor = dlg.m_clr;
- m_strBackColorCondition = dlg.m_strCon;
- }
- }
- void CDynamicProPage::OnSetbuttondown()
- {
- CActionDlg dlg;
- dlg.m_strActionType = m_arrayActionType[m_downAction.m_nActionType];
- dlg.m_strActionValue = m_downAction.m_strActionValue;
- dlg.m_strVariant = m_downAction.m_strVariant;
- //dlg.m_strPicPath = m_downAction.m_strPicPath;
- char picDir[_MAX_PATH] = {0};
- strcpy(picDir, g_strDirectory);
- strcat(picDir, "\\");
- strcat(picDir, _PICTUREDIR);
- strcat(picDir, m_downAction.m_strVariant);
- dlg.m_strPicPath = picDir;
- if (dlg.DoModal() == IDOK)
- {
- for (int i = 0; i<16; i++)
- {
- if ( m_arrayActionType[i] == dlg.m_strActionType )
- {
- m_downAction.m_nActionType = i;
- break;
- }
- }
- m_downAction.m_strActionValue = dlg.m_strActionValue;
- m_downAction.m_strVariant = dlg.m_strVariant;
- m_downAction.m_strPicPath = dlg.m_strPicPath;
- }
- }
- void CDynamicProPage::OnSetbuttonup()
- {
- CActionDlg dlg;
- dlg.m_strActionType = m_arrayActionType[m_upAction.m_nActionType];
- dlg.m_strActionValue = m_upAction.m_strActionValue;
- dlg.m_strVariant = m_upAction.m_strVariant;
- //dlg.m_strPicPath = m_upAction.m_strPicPath;
- char picDir[_MAX_PATH] = {0};
- strcpy(picDir, g_strDirectory);
- strcat(picDir, "\\");
- strcat(picDir, _PICTUREDIR);
- strcat(picDir, m_downAction.m_strVariant);
- dlg.m_strPicPath = picDir;
- if (dlg.DoModal() == IDOK)
- {
- for (int i = 0; i<16; i++)
- {
- if ( m_arrayActionType[i] == dlg.m_strActionType )
- {
- m_upAction.m_nActionType = i;
- }
- }
- m_upAction.m_strActionValue = dlg.m_strActionValue;
- m_upAction.m_strVariant = dlg.m_strVariant;
- m_upAction.m_strPicPath = dlg.m_strPicPath;
- }
- }
- void CDynamicProPage::OnSetmousemove()
- {
- CActionDlg dlg;
- dlg.m_strActionType = m_arrayActionType[m_moveAction.m_nActionType];
- dlg.m_strActionValue = m_moveAction.m_strActionValue;
- dlg.m_strVariant = m_moveAction.m_strVariant;
- //dlg.m_strPicPath = m_moveAction.m_strPicPath;
- char picDir[_MAX_PATH] = {0};
- strcpy(picDir, g_strDirectory);
- strcat(picDir, "\\");
- strcat(picDir, _PICTUREDIR);
- strcat(picDir, m_downAction.m_strVariant);
- dlg.m_strPicPath = picDir;
- if (dlg.DoModal() == IDOK)
- {
- for (int i = 0; i<16; i++)
- {
- if ( m_arrayActionType[i] == dlg.m_strActionType )
- {
- m_moveAction.m_nActionType = i;
- }
- }
- m_moveAction.m_strActionValue = dlg.m_strActionValue;
- m_moveAction.m_strVariant = dlg.m_strVariant;
- m_moveAction.m_strPicPath = dlg.m_strPicPath;
- }
- }
- void CDynamicProPage::OnHsizeconedit()
- {
- CFormatEditDlg dlg;
- dlg.m_strFormat = m_strHoriSize;
- if ( dlg.DoModal() == IDOK )
- {
- m_strHoriSize = dlg.m_strFormat;
- UpdateData(false);
- }
- }
- void CDynamicProPage::OnVsizeconedit()
- {
- CFormatEditDlg dlg;
- dlg.m_strFormat = m_strVertiSize;
- if ( dlg.DoModal() == IDOK )
- {
- m_strVertiSize = dlg.m_strFormat;
- UpdateData(false);
- }
- }
- void CDynamicProPage::OnHposconedit()
- {
- CFormatEditDlg dlg;
- dlg.m_strFormat = m_strHoriPos;
- if ( dlg.DoModal() == IDOK )
- {
- m_strHoriPos = dlg.m_strFormat;
- UpdateData(false);
- }
- }
- void CDynamicProPage::OnVposconedit()
- {
- CFormatEditDlg dlg;
- dlg.m_strFormat = m_strVertiPos;
- if ( dlg.DoModal() == IDOK )
- {
- m_strVertiPos = dlg.m_strFormat;
- UpdateData(false);
- }
- }
|