FLImaging 7.3.20.1
GUIComboBox.h
1#pragma once
2
10
11#include <afxwin.h>
12#include "GUIWndCtrlBase.h"
13#include "GUIStyledCtrlBase.h"
14
16namespace FLImaging
17{
19 namespace GUI
20 {
28 class FL_EXPORT CGUIComboBox : public CComboBox, public CGUIWndCtrlBase, public CGUIStyledCtrlBase
29 {
30 public:
38
45 virtual ~CGUIComboBox();
46
47 public:
56 virtual void SetBtnSize(int32_t i32Size);
57
66 virtual int32_t GetBtnSize() const;
67
76 virtual void SetDropDownHeight(int itemsToShow);
77
86 virtual BOOL GetDroppedState()const;
87
96 virtual void SetDroppedState(BOOL bState);
97
108 virtual int SetPrevSel(int nSelect);
109
118 virtual int32_t GetPrevSel()const;
119
130 virtual int SetCurSel(int nSelect);
131
141 virtual void EnableToolTipOnListBox(bool bEnable = true);
142
151 virtual bool IsToolTipOnListBoxEnabled() const;
152
161 static void SetToolTipDelay(uint32_t u32Delay);
162
171 static uint32_t GetToolTipDelay();
172
183 virtual void SetToolTipText(int32_t i32Index, const wchar_t* pWCsTipText);
184
193 virtual CEdit* GetEditBox() const;
194
203 virtual CListBox* GetListBox() const;
204
205 protected:
206 virtual void PreSubclassWindow() override;
207 virtual void DrawBackground(CDC* pDC, CRect rect);
208 virtual void DrawBorder(CDC* pDC, CRect rect);
209 virtual void DrawArrow(CDC* pDC, CRect rect);
210 virtual void DrawText(CDC* pDC, CRect rect);
211
212 void SetHookForListbox();
213 void DestroyToolTipWnd();
214 void CreateToolTipWnd();
215 static void HandleListboxMouseMove(CGUIComboBox* pCombo, CListBox* pList, UINT uFlag, CPoint point);
216 static void HandleOnTimer(UINT nIDEvent);
217 static void HandleOnPaint();
218 static BOOL OnTrackMouseEvent(HWND hWnd, DWORD dwFlags);
219
220 static LRESULT CALLBACK HookListboxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
221 static LRESULT CALLBACK HookTipWndProc(HWND hWnd, UINT message, WPARAM wp, LPARAM lp);
222
223 protected:
224 CBrush m_brBrush;
225 int32_t m_i32BtnSize;
226 int32_t m_i32PrevSel;
227
228 BOOL m_bCursorOnComboBox;
229 BOOL m_bLButtonDown;
230 BOOL m_bDroppedState;
231 BOOL m_bDroppedStatePrev;
232 bool m_bEnableToolTipOnListBox;
233
234 CMap<int32_t, int32_t, CString, const wchar_t*> m_mapTipTexts;
235 CRect m_rcDropDownBtn;
236 COMBOBOXINFO m_cbi;
237 CUIntArray m_arrDisabledItems;
238
239 static int m_i32OriginalSel;
240 static CWnd* m_pTipWnd;
241 static CFont m_fontToolTip;
242 static uint32_t m_u32DelayTime;
243 static BOOL m_bMouseCursorEntered;
244
245 static CMap<HWND, HWND, WNDPROC, WNDPROC&> m_mapWndProc;
246 static CMap<HWND, HWND, CGUIComboBox*, CGUIComboBox*&> m_mapCombo;
247 static int32_t m_i32ComboBoxCreationCount;
248
249 public:
250 DECLARE_MESSAGE_MAP()
251 afx_msg void OnPaint();
252 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
253 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
254 afx_msg void OnMouseHover(UINT nFlags, CPoint point);
255 afx_msg void OnMouseLeave();
256 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
257 afx_msg BOOL OnCbnKillfocus();
258 afx_msg void OnSetFocus(CWnd* pOldWnd);
259 afx_msg void OnKillFocus(CWnd* pNewWnd);
260 afx_msg BOOL OnCbnDropdown();
261 afx_msg BOOL OnCbnCloseup();
262 afx_msg BOOL OnCbnSelchange();
263 afx_msg BOOL OnCbnEditChange();
264 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
265 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
266 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
267 afx_msg void OnSize(UINT nType, int cx, int cy);
268 afx_msg void OnEnable(BOOL bEnable);
269 afx_msg void OnDestroy();
270};
271 }
272}
virtual int32_t GetBtnSize() const
Gets the button size of the combo box.
virtual int SetCurSel(int nSelect)
Specifies the currently selected value.
virtual CEdit * GetEditBox() const
Retrieves the edit box control of the combo box.
virtual int32_t GetPrevSel() const
Gets previously selected values.
virtual bool IsToolTipOnListBoxEnabled() const
Checks whether tooltips are currently enabled for the list box of the combo box.
CGUIComboBox()
Default constructor.
virtual void SetBtnSize(int32_t i32Size)
Specify the button size of the combo box.
virtual void SetDroppedState(BOOL bState)
Function to set drop-down status of combo box.
virtual ~CGUIComboBox()
Default destructor.
static uint32_t GetToolTipDelay()
Returns the currently set tooltip delay time.
virtual void EnableToolTipOnListBox(bool bEnable=true)
Enables or disables the tooltip functionality for the list box of the combo box. When enabled,...
virtual void SetToolTipText(int32_t i32Index, const wchar_t *pWCsTipText)
Sets the tooltip text for a specific item.
virtual CListBox * GetListBox() const
Retrieves the list box control of the combo box.
virtual BOOL GetDroppedState() const
Function to get drop-down status of combo box.
static void SetToolTipDelay(uint32_t u32Delay)
Sets the delay time before the tooltip is displayed.
virtual int SetPrevSel(int nSelect)
Functions that store previously selected values.
virtual void SetDropDownHeight(int itemsToShow)
Specify drop-down height of combo box.
Definition D2DObject.h:12