4#include "GUIWndCtrlBase.h"
11 class CGUIViewImageBase;
12 class CGUIManagerView;
14 class FL_EXPORT CGUIViewToolBar :
public CMFCToolBar,
public CGUIWndCtrlBase
16 friend class CGUIChildFrameBase;
17 friend class CGUIViewImageBase;
21 CGUIViewToolBar(
const CGUIViewToolBar& rh);
22 virtual ~CGUIViewToolBar();
25 virtual void MakeToolBarBehaveLikeTitleBar(
bool bToolBarBehaveLikeTitleBar, UINT nCloseBtnID, UINT nMaximizeBtnID, UINT nMinimizeBtnID, UINT nRestoreBtnID);
26 virtual bool BehaveLikeTitleBar();
27 virtual void OnFillBackground(CDC* pDC);
28 virtual void SetText(Base::CFLString<wchar_t> strText);
30 virtual void SetCloseButtonID(UINT nID);
31 virtual void SetMaximizeButtonID(UINT nID);
32 virtual void SetMinimizeButtonID(UINT nID);
33 virtual void UpdateTheme();
34 void GetImageFromList(CImageList* lstImages,
int nImage, CBitmap* destBitmap);
36 virtual void SetToolBarMinWidth(int32_t i32Minwidth);
37 virtual int32_t GetToolBarMinWidth();
39 virtual void SetTitleRectMinWidth(int32_t i32Minwidth);
40 virtual int32_t GetTitleRectMinWidth();
42 virtual void SetLeftItemMinPosX(int32_t i32Min);
43 virtual int32_t GetLeftItemMinPosX();
45 virtual void SetButtonWidth(int32_t i32Width);
46 virtual int32_t GetButtonWidth();
48 virtual void SetDrawEllipsisDropdown(
bool bDraw);
49 virtual bool IsDrawEllipsisDropdown();
51 CRect GetTitleBarRect();
52 void SetTitleBarRect(CRect rtTitleBar);
55 void SetParentView(CGUIViewImageBase* pView);
56 CGUIViewImageBase* GetParentView();
58 CWnd* GetMovableParent();
60 void UpdateTitleBarRect();
65 virtual void UpdatePosition();
67 virtual CMFCToolBarButton* GetCloseButton();
68 virtual CMFCToolBarButton* GetMaximizeButton();
69 virtual CMFCToolBarButton* GetRestoreButton();
70 virtual CMFCToolBarButton* GetMinimizeButton();
73 virtual int HitTest(CPoint point)
override;
74 Base::CFLString<wchar_t> m_strTitle;
78 Gdiplus::Color m_crToolBarBackground;
79 Gdiplus::Color m_crText;
84 bool m_bLButtonDblClk;
86 CRect m_rtEllipsisDropdown;
88 int32_t m_i32ButtonWidth;
89 int32_t m_i32SeparatorWidth;
90 int32_t m_i32ButtonHeight;
91 int32_t m_i32MinWidth;
92 int32_t m_i32ItemWidthLeft;
93 int32_t m_i32LeftItemMinPosX;
94 int32_t m_i32TitleBarMinWidth;
95 int32_t m_i32ItemWidthRight;
96 int32_t m_i32ItemCountRight;
97 int32_t m_i32ItemCount;
98 int32_t m_i32LeftStartPos;
99 std::vector<int32_t>& m_vctStartPos;
101 int32_t m_iHitButton;
103 UINT m_nCloseButtonID;
104 UINT m_nMaximizeButtonID;
105 UINT m_nRestoreButtonID;
106 UINT m_nMinimizeButtonID;
107 UINT m_nCloseButtonIndex;
108 UINT m_nMaximizeButtonIndex;
109 UINT m_nRestoreButtonIndex;
110 UINT m_nMinimizeButtonIndex;
115 bool m_bFixedParentView;
118 CPoint m_ptPrevMouse;
119 double m_f64MoveThreshold;
120 double m_f64MoveDistance;
122 CGUIViewImageBase* m_pParentView;
124 bool m_bSyncWindowTitle;
125 bool m_bToolBarBehaveLikeTitleBar;
126 bool m_bDrawEllipsisDropdown;
130 CRect m_crPrevWindow;
131 bool m_bMouseDragMaximize;
133 Base::CPerformanceCounter m_pcLastUpdateCounter;
134 volatile bool m_bUpdateAvailable;
135 volatile bool m_bUpdateBlocked;
136 volatile bool m_bRemainingUpdateThread;
137 HANDLE m_hThreadRemainingUpdate;
139 bool m_bWindowSizeUpdated;
141 virtual void JudgeUpdateAvailable();
142 virtual bool IsUpdateAvailable();
143 static unsigned __stdcall InternalThreadRemainingUpdate(
void* pParam);
144 void InitializeThreadRemainingUpdate();
145 void TerminateThreadRemainingUpdate();
148 void DoPaint(CDC* pDCPaint);
149 BOOL DrawButton(CDC* pDC, CMFCToolBarButton* pButton, CMFCToolBarImages* pImages, BOOL bHighlighted, BOOL bDrawDisabledImages);
152 DECLARE_MESSAGE_MAP()
153 afx_msg
int OnCreate(LPCREATESTRUCT lpCreateStruct);
154 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
155 afx_msg
void OnLButtonDown(UINT nFlags, CPoint point);
156 afx_msg
void OnLButtonUp(UINT nFlags, CPoint point);
157 afx_msg
void OnMouseMove(UINT nFlags, CPoint point);
158 afx_msg
void OnKillFocus(CWnd* pNewWnd);
159 afx_msg
void OnLButtonDblClk(UINT nFlags, CPoint point);
160 afx_msg
void OnRButtonDown(UINT nFlags, CPoint point);
161 afx_msg
void OnMButtonDown(UINT nFlags, CPoint point);
162 afx_msg
void OnNcPaint();
163 afx_msg
void OnSize(UINT nType,
int cx,
int cy);
164 afx_msg
void OnDestroy();
166 friend class CGUIManagerView;
167 friend class CGUIViewGraph;