2#include "DefinitionsGUI.h"
9 class CGUIMainFrameTabCtrl;
10 class CGUIMenuBarUserDefinedInfo;
11 class CGUIMenuBarMDITab;
13 typedef std::function<void(
void*)> CMenuBarCallback;
14 #define MakeMenuBarCallback [=](void* pItem) -> void
16 class FL_EXPORT CGUIMenuBar :
public CMFCMenuBar,
public Base::CFLBase
20 virtual ~CGUIMenuBar();
23 virtual void OnFillBackground(CDC* pDC);
24 virtual void DrawLogo(Gdiplus::Graphics& memG,
const CRect& rcDst, COLORREF clrBg);
26 virtual void SetMinWidth(int32_t i32Minwidth);
27 virtual int32_t GetMinWidth()
const;
29 virtual void SetTitleRectMinWidth(int32_t i32Minwidth);
30 virtual int32_t GetTitleRectMinWidth()
const;
32 virtual void SetLeftItemMinPosX(int32_t i32Min);
33 virtual int32_t GetLeftItemMinPosX()
const;
35 virtual void SetButtonWidth(int32_t i32Width);
36 virtual int32_t GetButtonWidth()
const;
38 virtual CRect GetTitleBarRect()
const;
39 virtual void SetTitleBarRect(CRect rtTitleBar);
40 virtual int GetHitButton()
const;
42 virtual CWnd* GetMovableParent();
44 virtual int HitTest(CPoint point)
override;
46 virtual void SetHitArea(EGUIMenuBarHitArea eHitArea);
49 virtual CGUIMenuBarUserDefinedInfo* GetHitUserDefinedInfo(CPoint ptClient)
const;
51 virtual CGUIMenuBarMDITab* GetHitMDITab()
const;
53 virtual void SetToolTipText(
const Base::CFLString<wchar_t>& strToolTipText);
56 virtual void SetCurrentModelNameBkColor(COLORREF clrBk);
57 virtual COLORREF GetCurrentModelNameBkColor()
const;
59 virtual void SetCurrentModelNameTextColor(COLORREF clrText);
60 virtual COLORREF GetCurrentModelNameTextColor()
const;
62 virtual void SetCurrentModelNameRect(CRect rtTitleBar);
63 virtual CRect GetCurrentModelNameRect()
const;
65 virtual void ShowCurrentModelName(
bool bShow);
66 virtual bool IsCurrentModelNameVisible()
const;
69 virtual void SetCurrentUserIDBkColor(COLORREF clrBk);
70 virtual COLORREF GetCurrentUserIDBkColor()
const;
72 virtual void SetCurrentUserIDTextColor(COLORREF clrText);
73 virtual COLORREF GetCurrentUserIDTextColor()
const;
75 virtual void SetCurrentUserIDRect(CRect rtTitleBar);
76 virtual CRect GetCurrentUserIDRect()
const;
78 virtual void ShowCurrentUserID(
bool bShow);
79 virtual bool IsCurrentUserIDVisible()
const;
81 virtual void ShowLogo(
bool bShow);
82 virtual bool IsLogoVisible()
const;
85 virtual void PushBackUserDefinedInfo(
const Base::CFLString<wchar_t>& strInfo, COLORREF clrBackground =
RGB(80, 80, 80), COLORREF clrText =
RGB(255, 255, 255),
bool bShow =
true, EGUIAlignment eAlign = EGUIAlignment_CENTER_CENTER, EGUIStringTrimming eStringTrimming = EGUIStringTrimming_EllipsisCharacter);
86 virtual void PushBackUserDefinedInfo(
const CGUIMenuBarUserDefinedInfo& refUDI);
88 virtual void PushFrontUserDefinedInfo(
const Base::CFLString<wchar_t>& strInfo, COLORREF clrBackground =
RGB(80, 80, 80), COLORREF clrText =
RGB(255, 255, 255),
bool bShow =
true, EGUIAlignment eAlign = EGUIAlignment_CENTER_CENTER, EGUIStringTrimming eStringTrimming = EGUIStringTrimming_EllipsisCharacter);
89 virtual void PushFrontUserDefinedInfo(
const CGUIMenuBarUserDefinedInfo& refUDI);
91 virtual int32_t GetUserDefinedInfoCount()
const;
92 virtual CGUIMenuBarUserDefinedInfo* PopBackUserDefinedInfo();
93 virtual CGUIMenuBarUserDefinedInfo* GetBackUserDefinedInfo()
const;
94 virtual CGUIMenuBarUserDefinedInfo* PopFrontUserDefinedInfo();
95 virtual CGUIMenuBarUserDefinedInfo* GetFrontUserDefinedInfo()
const;
97 virtual CGUIMenuBarUserDefinedInfo* GetUserDefinedInfoAt(int32_t i32Index)
const;
98 virtual int32_t GetUserDefinedInfoIndex(
const CGUIMenuBarUserDefinedInfo* pUDI)
const;
100 virtual const CResult SetUserDefinedInfoAt(int32_t i32Index,
const Base::CFLString<wchar_t>& strInfo, COLORREF clrBackground =
RGB(80, 80, 80), COLORREF clrText =
RGB(255, 255, 255),
bool bShow =
true, EGUIAlignment eAlign = EGUIAlignment_CENTER_CENTER, EGUIStringTrimming eStringTrimming = EGUIStringTrimming_EllipsisCharacter);
101 virtual const CResult SetUserDefinedInfoAt(int32_t i32Index,
const CGUIMenuBarUserDefinedInfo& refUDI);
103 virtual const CResult InsertUserDefinedInfoAt(int32_t i32Index,
const Base::CFLString<wchar_t>& strInfo, COLORREF clrBackground =
RGB(80, 80, 80), COLORREF clrText =
RGB(255, 255, 255),
bool bShow =
true, EGUIAlignment eAlign = EGUIAlignment_CENTER_CENTER, EGUIStringTrimming eStringTrimming = EGUIStringTrimming_EllipsisCharacter);
104 virtual const CResult InsertUserDefinedInfoAt(int32_t i32Index,
const CGUIMenuBarUserDefinedInfo& refUDI);
106 virtual const CResult RemoveUserDefinedInfoAt(int32_t i32Index);
107 virtual const CResult ClearUserDefinedInfo();
109 virtual void OnReceiveBroadcast(
const Base::CBroadcastMessage* pMessage)
override;
111 DeclareGetClassType();
115 Gdiplus::Color m_crBackground;
116 Gdiplus::Color m_crText;
117 COLORREF m_clrBackgroundCurrentModel;
118 COLORREF m_clrTextCurrentModel;
119 COLORREF m_clrBackgroundCurrentUserID;
120 COLORREF m_clrTextCurrentUserID;
124 Base::CFLString<wchar_t> m_strTitle;
126 bool m_bLButtonDblClk;
127 bool m_bMouseDragMaximize;
128 CPoint m_ptDragStart;
132 int32_t m_i32ButtonWidth;
133 int32_t m_i32ButtonHeight;
134 int32_t m_i32MinWidth;
135 int32_t m_i32ItemWidthLeft;
136 int32_t m_i32LeftItemMinPosX;
137 int32_t m_i32TitleBarMinWidth;
138 int32_t m_i32ItemWidthRight;
139 int32_t m_i32ItemCountRight;
140 int32_t m_i32ItemCount;
141 int32_t m_i32LeftStartPos;
143 int32_t m_i32HitButton;
146 int32_t m_i32AnimationIdx;
147 int32_t m_i32AnimationIdxDirection;
148 unsigned char m_crTitleBk;
149 Gdiplus::Bitmap* m_pLogoImage;
150 int32_t m_i32BmpWidth, m_i32BmpHeight;
152 CRect m_rtTitleBarPrev;
153 CRect m_rtClose, m_rtRestore, m_rtMinimize;
154 CRect m_rtInfoCurrentModelName;
155 CRect m_rtInfoCurrentUserID;
159 bool m_bAboutToMaximize;
161 CPoint m_ptPrevMouse;
162 double m_f64MoveThreshold;
163 double m_f64MoveDistance;
166 std::vector<unsigned char> m_vctLogoBkClr;
168 CGUIMainFrameTabCtrl* m_pMainFrameTabCtrl;
171 CToolTipCtrl m_ToolTip;
172 Base::CFLString<wchar_t> m_strToolTipText;
174 bool m_bHitTimerInstalled;
178 void DoPaint(CDC* pDCPaint);
179 void DrawTitle(CDC* pDCPaint);
180 void UpdateAnimation();
181 void LoadLogoImage(
const Base::CFLString<wchar_t>& strLogoPath);
184 afx_msg
int OnCreate(LPCREATESTRUCT lpCreateStruct);
185 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
186 afx_msg
void OnLButtonDown(UINT nFlags, CPoint point);
187 afx_msg
void OnLButtonUp(UINT nFlags, CPoint point);
188 afx_msg
void OnMouseMove(UINT nFlags, CPoint point);
189 afx_msg
void OnMouseLeave();
190 afx_msg
void OnLButtonDblClk(UINT nFlags, CPoint point);
191 afx_msg
void OnKillFocus(CWnd* pNewWnd);
192 afx_msg
void OnSize(UINT nType,
int cx,
int cy);
193 afx_msg
void OnMButtonUp(UINT nFlags, CPoint point);
194 afx_msg
void OnRButtonUp(UINT nFlags, CPoint point);
195 afx_msg
void OnDestroy();
196 afx_msg
void OnTimer(UINT_PTR nIDEvent);
197 DECLARE_MESSAGE_MAP()
198 virtual BOOL PreTranslateMessage(MSG* pMsg)override;
200 friend class CGUIMainFrame;
201 friend class CGUIMenuItemLogIn;
Definition D2DObject.h:12
EGUIMenuBarHitArea
The area where the mouse is located on the menu bar.
Definition DefinitionsGUI.h:4713
@ RGB
Definition DefinitionsBase.h:2630