#pragma once #include "afxwin.h" #include "afxcmn.h" #include "MTerm1View.h" // CMyFormLog ´°ÌåÊÓͼ #define IDC_BUTTON_AND 33101 #define IDC_BUTTON_OR 33102 #define IDC_BUTTON_VLINE 33103 #define IDC_BUTTON_OUT 33104 #define IDC_BUTTON_TMCT 33105 #define IDC_BUTTON_FUN 33106 #define IDC_BUTTON_HLINE 33107 #define IDC_BUTTON_NOT 33108 #define IDC_BUTTON_INDEX 33109 #define IDC_BUTTON_MC 33110 #define IDC_BUTTON_MCE 33111 #define IDC_BUTTON_SET 33201 #define IDC_BUTTON_RESET 33202 #define IDC_BUTTON_DF 33203 #define IDC_BUTTON_END 33204 #define IDC_BUTTON_COMPARE 33205 #define IDC_BUTTON_PFUN 33206 #define IDC_BUTTON_UPDOWN 33207 #define IDC_BUTTON_BIT 33208 #define IDC_BUTTON_WORD 33209 #define IDC_BUTTON_INSTRUCTION1 33210 #define IDC_BUTTON_INSTRUCTION2 33211 #define IDC_BUTTON_PGCONVERT 33301 #define IDC_BUTTON_ONLINE 33302 #define IDC_BUTTON_OFFLINE 33303 #define IDC_BUTTON_COLSE 33304 #define IDC_BUTTON_FIND 33305 #define IDC_BUTTON_NEXTWIN 33306 #define IDC_BUTTON_MONITOR 33307 #define IDC_BUTTON_STATUS 33308 #define IDC_BUTTON_RUNPROG 33309 #define IDC_BUTTON_PLCREAD 33310 #define IDC_BUTTON_PLCWRITE 33311 #define IDC_BUTTON_X 33401 #define IDC_BUTTON_Y 33402 #define IDC_BUTTON_R 33403 #define IDC_BUTTON_L 33404 #define IDC_BUTTON_P 33405 #define IDC_BUTTON_COMPARE1 33406 #define IDC_BUTTON_NOT1 33408 #define IDC_BUTTON_T 33501 #define IDC_BUTTON_C 33502 #define IDC_BUTTON_E 33503 #define IDC_BUTTON_UPDOWN1 33507 #define IDC_BUTTON_D 33701 #define IDC_BUTTON_F 33702 #define IDC_BUTTON_NEQ 33706 #define IDC_BUTTON_GT 33707 #define IDC_BUTTON_LT 33708 #define IDC_BUTTON_TMX 34701 #define IDC_BUTTON_TMY 34702 #define IDC_BUTTON_TMR 34703 #define IDC_BUTTON_TML 34704 #define IDC_BUTTON_CT 34706 typedef struct tagStructButton { int nID; CString sCaption; }structButton; struct tagInputCell { char OP = CMTerm1View::typeNO; bool bnot = false; bool bpp = false; bool bpn = false; bool bcmpEq = false; bool bcmpLt = false; bool bcmpGt = false; bool bDouble = false; bool bDouble1 = false; //for -||-D and -||- turn bool bFloat = false; bool bFloat1 = false; bool bLeftLineUp = false; bool brightLineUp = false; int param = 0; CString sCellName; CString sParamName; CString num = _T(""); void clear() { OP = 0; bnot = 0; bpp = 0; bpn = 0; bcmpEq = 0; bcmpLt = 0; bcmpGt = 0; bDouble = 0; bDouble1 = 0; bFloat = 0; bFloat1 = 0; bLeftLineUp = 0; brightLineUp = 0; param = 0; sCellName.Empty(); num.Empty(); } }; class CMyFormInputShow : public CFormView { DECLARE_DYNCREATE(CMyFormInputShow) protected: CMyFormInputShow(); // ¶¯Ì¬´´½¨ËùʹÓõÄÊܱ£»¤µÄ¹¹Ô캯Êý virtual ~CMyFormInputShow(); public: enum { IDD = IDD_FORM_INPUTSHOW}; #ifdef _DEBUG virtual void AssertValid() const; #ifndef _WIN32_WCE virtual void Dump(CDumpContext& dc) const; #endif #endif CButton m_buttons[6][3][11]; CButton m_NumButtons[18]; CButton m_CmdButtons[4]; int m_Lines = 3; CFont font1; int current_btn_window = 0; tagInputCell m_InputCell; CEdit m_edit_input; // tagInputCell localInputCell; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö DECLARE_MESSAGE_MAP() public: virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnDestroy(); afx_msg void OnSize(UINT nType, int cx, int cy); virtual void OnInitialUpdate(); afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); // CEdit m_edit_log; // CRichEditCtrl m_richedit_log; afx_msg void OnTimer(UINT_PTR nIDEvent); // virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHandler); void SetBtnDisplay(int n = 0); void SetBtnDisplayESC(int n=0); afx_msg void OnBnClickedButton1(); afx_msg void OnBnClickedBtnAnd(); afx_msg void OnBnClickedBtnOr(); afx_msg void OnBnClickedBtnVline(); afx_msg void OnBnClickedBtnOut(); afx_msg void OnBnClickedBtnTmCt(); afx_msg void OnBnClickedBtnFun(); afx_msg void OnBnClickedBtnHLine(); afx_msg void OnBnClickedBtnNot(); afx_msg void OnBnClickedBtnIndex(); afx_msg void OnBnClickedBtnMc(); afx_msg void OnBnClickedBtnMce(); afx_msg void OnBnClickedBtnSet(); afx_msg void OnBnClickedBtnReset(); afx_msg void OnBnClickedBtnDf(); afx_msg void OnBnClickedBtnEnd(); afx_msg void OnBnClickedBtnCompare(); afx_msg void OnBnClickedBtnPFun(); afx_msg void OnBnClickedBtnUpDown(); afx_msg void OnBnClickedBtnBit(); afx_msg void OnBnClickedBtnWord(); afx_msg void OnBnClickedBtnInc1(); afx_msg void OnBnClickedBtnInc2(); afx_msg void OnBnClickedBtnPgConvert(); afx_msg void OnBnClickedBtnOnline(); afx_msg void OnBnClickedBtnOffline(); afx_msg void OnBnClickedBtnClose(); afx_msg void OnBnClickedBtnFind(); afx_msg void OnBnClickedBtnNextWin(); afx_msg void OnBnClickedBtnMonitor(); afx_msg void OnBnClickedBtnStatus(); afx_msg void OnBnClickedBtnRunProg(); afx_msg void OnBnClickedBtnPlcRead(); afx_msg void OnBnClickedBtnPlcWrite(); afx_msg void OnBnClickedBtnX(); afx_msg void OnBnClickedBtnY(); afx_msg void OnBnClickedBtnR(); afx_msg void OnBnClickedBtnL(); afx_msg void OnBnClickedBtnP(); afx_msg void OnBnClickedBtnCompare1(); afx_msg void OnBnClickedBtnT(); afx_msg void OnBnClickedBtnC(); afx_msg void OnBnClickedBtnE(); afx_msg void OnBnClickedBtnTmx(); afx_msg void OnBnClickedBtnTmy(); afx_msg void OnBnClickedBtnTmr(); afx_msg void OnBnClickedBtnTml(); afx_msg void OnBnClickedBtnCt(); afx_msg void OnBnClickedBtnD(); afx_msg void OnBnClickedBtnF(); afx_msg void OnBnClickedBtnNEQ(); afx_msg void OnBnClickedBtnGT(); afx_msg void OnBnClickedBtnLT(); afx_msg void OnBtn0(); afx_msg void OnBtn1(); afx_msg void OnBtn2(); afx_msg void OnBtn3(); afx_msg void OnBtn4(); afx_msg void OnBtn5(); afx_msg void OnBtn6(); afx_msg void OnBtn7(); afx_msg void OnBtn8(); afx_msg void OnBtn9(); afx_msg void OnBtnA(); afx_msg void OnBtnB(); afx_msg void OnBtnC(); afx_msg void OnBtnD(); afx_msg void OnBtnE(); afx_msg void OnBtnF(); afx_msg void OnBtnMinus(); afx_msg void OnBtnDot(); afx_msg void OnBtnRet(); afx_msg void OnBtnInsert(); afx_msg void OnBtnDelete(); afx_msg void OnBtnEsc(); int SetDisplay(int inputInfo); int SetDisplay1(int inputInfo); // int UpdateDisplay(); int display(tagInputCell stDisplayCell); int SetCurCellPos(int nRow, int nCol, CMTerm1View::stCell theCell); void stInit(); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); };