2#include "ISearchTarget.h"
3#include "GUIEditCtrl.h"
5#include "GUIStaticText.h"
6#include "GUIComboBox.h"
7#include "GUICheckBoxPushLike.h"
8#include "GUIStyledCtrlBase.h"
14 namespace SearchBarLayout
16 const int32_t kMargin = 4;
17 const int32_t kPadding = 2;
18 const int32_t kEditHeight = 20;
19 const int32_t kToggleBtnSize = 18;
20 const int32_t kNavBtnSize = 18;
21 const int32_t kGap = 2;
22 const int32_t kSeparatorW = 1;
25 class CGUISearchBar :
public CWnd,
public CGUIStyledCtrlBase
27 DECLARE_DYNAMIC(CGUISearchBar)
30 virtual ~CGUISearchBar();
32 BOOL Create(CWnd* pParentWnd, ISearchTarget* pTargetEdit);
35 bool IsShowing()
const;
37 virtual BOOL PreTranslateMessage(MSG* pMsg);
38 virtual void SearchAllAndCount_Regex(
const CString& strPattern);
39 virtual void SetTargetEdit(ISearchTarget* pTargetEdit);
40 virtual CRect GetGripRect(CWnd* pWnd)
const;
41 virtual CRect GetOriginalRect()
const;
42 virtual void SetOriginalRect(
const CRect& rt);
43 virtual const CResult ClearResult();
46 void DoSearch(BOOL bDown, BOOL bResetFromCursor);
47 void SearchAllAndCount();
48 void ScrollToMatch(
const CHARRANGE& match);
49 void UpdateIndexLabel();
50 void ApplyHighlightAll();
51 void ApplyCurrentMatchHighlight();
52 void ClearHighlight();
53 void LayoutControls(
int cx,
int cy);
54 DWORD BuildFindFlags();
57 CGUIEditCtrl m_editSearch;
58 CGUICheckBoxPushLike m_btnMatchCase;
59 CGUICheckBoxPushLike m_btnWholeWord;
60 CGUICheckBoxPushLike m_btnRegex;
63 CGUIButton m_btnClose;
64 CGUIStaticText m_staticIndex;
66 ISearchTarget* m_pSearchTarget;
76 std::vector<CHARRANGE> m_matches;
77 int32_t m_i32CurrentMatch;
78 int32_t m_i32LastHighlightedMatch;
81 bool m_bUserWantsOpen;
85 CToolTipCtrl m_toolTip;
89 afx_msg
int OnCreate(LPCREATESTRUCT lpCreateStruct);
90 afx_msg
void OnDestroy();
91 afx_msg
void OnSize(UINT nType,
int cx,
int cy);
92 afx_msg
void OnPaint();
93 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
94 afx_msg
void OnSearchTextChanged();
95 afx_msg
void OnBtnPrev();
96 afx_msg
void OnBtnNext();
97 afx_msg
void OnBtnClose();
98 afx_msg
void OnBtnMatchCase();
99 afx_msg
void OnBtnWholeWord();
100 afx_msg
void OnBtnRegex();
101 afx_msg
void OnLButtonDown(UINT nFlags, CPoint point);
102 afx_msg
void OnLButtonUp(UINT nFlags, CPoint point);
103 afx_msg
void OnMouseMove(UINT nFlags, CPoint point);
Definition D2DObject.h:12