1 #ifndef _TRIGGER_LIST_EDIT_DLG_ 2 #define _TRIGGER_LIST_EDIT_DLG_ 3 4 #define VISIBLE_TRIGGER_ROWS 8 5 #define TRIGGER_ROW_HEIGHT 40 6 7 class trigger_list_edit_dlg; 8 class trigger_frame; 9 10 class trigger_row : public CWnd 11 { 12 public: 13 trigger_row(CWnd *parent, int Id, CArray<trigger_info *> *trigger_list); 14 afx_msg void OnPaint(); 15 afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 16 afx_msg void OnKillFocus(CWnd* pNewWnd); 17 18 private: 19 int mRowId; 20 CArray<trigger_info *> *mpTriggerList; 21 trigger_frame *frame; 22 DECLARE_MESSAGE_MAP() 23 }; 24 25 class trigger_frame : public CWnd 26 { 27 public: 28 trigger_frame(CWnd *parent, CArray<trigger_info *> *trigger_list); 29 ~trigger_frame(); 30 afx_msg void OnDestroy(); 31 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 32 afx_msg void OnPaint(); 33 afx_msg void OnSize(UINT nType, int cx, int cy); 34 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 35 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); 36 afx_msg void OnSetFocus(CWnd* pOldWnd); 37 virtual BOOL PreTranslateMessage(MSG* pMsg); 38 void AssignFocus(int rowId); 39 void SetSelectedRow(int rowId, bool assign_focus = FALSE); GetSelectedRow()40 int GetSelectedRow(){ return mSelectedRow; }; 41 void SelectedVisible(); 42 void CreateTriggerRows(); 43 void PositionChildren(); 44 DECLARE_MESSAGE_MAP() 45 46 private: 47 CArray<trigger_info *> *mpTriggerList; 48 int mSelectedRow; 49 int mRowHeight; 50 CScrollHelper *m_scroll_helper; 51 }; 52 53 // trigger_list_edit_dlg dialog 54 55 class trigger_list_edit_dlg : public express_dialog 56 { 57 DECLARE_DYNAMIC(trigger_list_edit_dlg) 58 59 public: 60 trigger_list_edit_dlg(int display_index, screen_flow *flow, flow_item *item, CWnd* pParent = NULL); // standard constructor 61 virtual ~trigger_list_edit_dlg(); 62 virtual BOOL OnInitDialog(); 63 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 64 afx_msg void OnDestroy(); 65 virtual void OnOK(); 66 virtual void OnCancel(); 67 afx_msg void OnAddTrigger(); 68 afx_msg void OnDeleteTrigger(); 69 afx_msg void OnEditTrigger(); 70 afx_msg void OnEditTriggerAction(); 71 virtual BOOL PreTranslateMessage(MSG* pMsg); 72 afx_msg LRESULT OnTestMessage(WPARAM wParam, LPARAM lParam); GetRowCount()73 int GetRowCount(){ return mTriggerList.GetCount(); }; 74 75 protected: 76 void EnableDisableTriggerEditControls(); 77 78 // Dialog Data 79 enum { IDD = IDD_TRIGGER_LIST_EDIT_DLG }; 80 81 protected: 82 screen_flow *mpOldFlow; 83 //trigger_connection *mpOldConnection; 84 flow_item mItem; 85 CArray<trigger_info *> mTriggerList; 86 trigger_frame *mpTriggerFrame; 87 int mDisplayIndex; 88 89 DECLARE_MESSAGE_MAP() 90 }; 91 92 #endif