1 #pragma once 2 #include "ColorConvert.h" 3 #include <afxeditbrowsectrl.h> 4 #include "CommonData.h" 5 6 #define WM_EDIT_BROWSE_CHANGED (WM_USER+126) //通过“浏览”按钮选择了一个文件或文件夹后发送此消息 7 // CBrowseEdit 8 9 class CBrowseEdit : public CMFCEditBrowseCtrl 10 { 11 DECLARE_DYNAMIC(CBrowseEdit) 12 13 public: 14 CBrowseEdit(); 15 virtual ~CBrowseEdit(); 16 17 //自定义的编辑模式 18 enum class EditBrowseMode 19 { 20 NONE, 21 RENAME, //重命名模式 22 LIST, //编辑列表模式 aa,bb,cc 23 LIST2 //编辑列表模式 "aa","bb","cc" 24 }; 25 26 virtual void OnDrawBrowseButton(CDC* pDC, CRect rect, BOOL bIsButtonPressed, BOOL bIsButtonHot) override; 27 virtual void OnChangeLayout() override; 28 virtual void OnBrowse() override; 29 virtual void OnAfterUpdate() override; 30 void SetEditBrowseMode(EditBrowseMode browse_mode); 31 void SetPopupDlgTitle(const wstring& popup_dlg_title); 32 33 protected: 34 DECLARE_MESSAGE_MAP() 35 36 private: 37 ColorTable& m_theme_color; 38 wstring m_btn_str; 39 EditBrowseMode m_browse_mode; //自定义的编辑模式,当基类的m_Mode设置为BrowseMode_Default时使用 40 CString m_poopup_dlg_title; //弹出对话框的标题 41 42 public: 43 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); 44 protected: 45 afx_msg LRESULT OnTabletQuerysystemgesturestatus(WPARAM wParam, LPARAM lParam); 46 }; 47