1 #pragma once 2 #include "ColorConvert.h" 3 4 5 // CSearchEditCtrl 6 #define WM_SEARCH_EDIT_BTN_CLICKED (WM_USER+125) 7 8 class CSearchEditCtrl : public CMFCEditBrowseCtrl 9 { 10 DECLARE_DYNAMIC(CSearchEditCtrl) 11 12 public: 13 CSearchEditCtrl(); 14 virtual ~CSearchEditCtrl(); 15 16 virtual void OnBrowse() override; 17 virtual void OnDrawBrowseButton(CDC* pDC, CRect rect, BOOL bIsButtonPressed, BOOL bIsButtonHot) override; 18 virtual void OnChangeLayout()override; 19 void SetBigIcon(bool big_icon); 20 21 protected: 22 void UpdateToolTipPosition(); //更新鼠标提示的位置 23 24 DECLARE_MESSAGE_MAP() 25 26 private: 27 ColorTable& m_theme_color; 28 CToolTipCtrl m_tool_tip; 29 bool m_draw_clear_btn{}; //如果为true,则显示“清除搜索结果”按钮,否则,显示“搜索”按钮 30 bool m_big_icon{}; 31 32 private: 33 virtual void PreSubclassWindow(); 34 public: 35 virtual BOOL PreTranslateMessage(MSG* pMsg); 36 afx_msg void OnSize(UINT nType, int cx, int cy); 37 afx_msg BOOL OnEnChange(); 38 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); 39 protected: 40 afx_msg LRESULT OnTabletQuerysystemgesturestatus(WPARAM wParam, LPARAM lParam); 41 }; 42 43 44