1 #ifndef _TEXT_SCROLL_WHEEL_EDIT_DLG_ 2 #define _TEXT_SCROLL_WHEEL_EDIT_DLG_ 3 #include "afxwin.h" 4 #include "express_combobox.h" 5 6 #define VISIBLE_VALUE_ROWS 7 7 8 // scroll_wheel_edit_dlg dialog 9 10 class value_list_row : public express_table_row 11 { 12 public: 13 value_list_row(int row_id); 14 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 15 afx_msg BOOL OnEraseBkgnd(CDC* pDC); 16 virtual BOOL PreTranslateMessage(MSG* pMsg); 17 GetRowId()18 int GetRowId() { return mRowId; } 19 void SetData(CString id, CString string); 20 void InsertStringId(CString id_name, GX_RESOURCE_ID res_id); GetTextEdit()21 CWnd *GetTextEdit(){ return (CWnd *)&mStringTextEdit; }; GetIdCombo()22 CWnd *GetIdCombo(){ return (CWnd *)&mStringIdCombo; }; 23 24 protected: 25 void OnChangeStringText(); 26 void OnChangeStringId(); 27 BOOL PreTranslateKeyDown(WPARAM keyvalue); 28 29 private: 30 int mRowId; 31 CStatic mIndexPrompt; 32 express_combobox mStringIdCombo; 33 CRichEditCtrl mStringTextEdit; 34 CString mStringId; 35 CString mStringText; 36 DECLARE_MESSAGE_MAP() 37 }; 38 39 class value_list_frame :public CWnd 40 { 41 public: 42 value_list_frame(CArray<GX_RESOURCE_ID> *string_id_list, string_table *table); 43 ~value_list_frame(); 44 45 DECLARE_MESSAGE_MAP() 46 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 47 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* bar); 48 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); 49 afx_msg void OnDestroy(); 50 afx_msg void OnSetFocus(CWnd* pOldWnd); 51 52 public: 53 void NotifyStringIdAdded(CString id_name, GX_RESOURCE_ID res_id); 54 void NotifyStringIdChanged(int index, GX_RESOURCE_ID id); GetStringTable()55 string_table* GetStringTable() { return mpTable; } 56 BOOL Scroll(int delta); GetRowHeight()57 int GetRowHeight() { return mRowHeight; } 58 59 private: 60 CArray<GX_RESOURCE_ID>* mpStringIdList; 61 string_table* mpTable; 62 CScrollHelper* m_scroll_helper; 63 int mRowHeight; 64 }; 65 66 class string_scroll_wheel_edit_dlg : public express_dialog 67 { 68 DECLARE_DYNAMIC(string_scroll_wheel_edit_dlg) 69 70 public: 71 string_scroll_wheel_edit_dlg(int display_index, CArray<GX_RESOURCE_ID> *list_array, CWnd* pParent = NULL); // standard constructor 72 virtual ~string_scroll_wheel_edit_dlg(); 73 74 // Dialog Data 75 enum { IDD = IDD_TEXT_SCROLL_WHEEL_EDIT }; 76 77 protected: 78 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 79 virtual BOOL OnInitDialog(); 80 void TestSetRowData(int row_id, CString string); 81 LRESULT OnTestMessage(WPARAM wParam, LPARAM lParam); 82 83 private: 84 CArray<GX_RESOURCE_ID> mOldStringIdList; 85 CArray<GX_RESOURCE_ID>* mpStringIdList; 86 string_table* mpTable; 87 studiox_project *mpProject; 88 int mDisplayIndex; 89 value_list_frame *mpValueListFrame; 90 91 DECLARE_MESSAGE_MAP() 92 }; 93 94 #endif 95