FLImaging 6.5.8.1
GUIComboBox.h
1#pragma once
2
11#include <afxwin.h>
12#include "GUIWndCtrlBase.h"
13
15namespace FLImaging
16{
18 namespace GUI
19 {
27 class FL_EXPORT CGUIComboBox : public CComboBox, public CGUIWndCtrlBase
28 {
29 public:
37
44 virtual ~CGUIComboBox();
45
46 public:
55 virtual void SetBtnSize(int32_t i32Size);
56
65 virtual int32_t GetBtnSize() const;
66
75 virtual void SetDropDownHeight(int itemsToShow);
76
85 virtual BOOL GetDroppedState()const;
86
95 virtual void SetDroppedState(BOOL bState);
96
107 virtual int SetPrevSel(int nSelect);
108
117 virtual int32_t GetPrevSel()const;
118
129 virtual int SetCurSel(int nSelect);
130
140 virtual void EnableToolTipOnListBox(bool bEnable = true);
141
150 virtual bool IsToolTipOnListBoxEnabled() const;
151
160 static void SetToolTipDelay(uint32_t u32Delay);
161
170 static uint32_t GetToolTipDelay();
171
182 virtual void SetToolTipText(int32_t i32Index, const wchar_t* pWCsTipText);
183
192 virtual CEdit* GetEditBox() const;
193
202 virtual CListBox* GetListBox() const;
203
204
205 static void SetBackgroundColor(COLORREF clr);
206 static COLORREF GetBackgroundColor();
207
208 static void SetBorderColorActive(COLORREF clr);
209 static COLORREF GetBorderColorActive();
210
211 protected:
212 virtual void PreSubclassWindow() override;
213 virtual void DrawBackground(Gdiplus::Graphics* pG);
214 virtual void DrawArrow(Gdiplus::Graphics* pG);
215 virtual void DrawText(Gdiplus::Graphics* pG);
216
217 void SetHookForListbox();
218 void DestroyToolTipWnd();
219 void CreateToolTipWnd();
220 static void HandleListboxMouseMove(CGUIComboBox* pCombo, CListBox* pList, UINT uFlag, CPoint point);
221 static void HandleOnTimer(UINT nIDEvent);
222 static void HandleOnPaint();
223 static BOOL OnTrackMouseEvent(HWND hWnd, DWORD dwFlags);
224
225 static LRESULT CALLBACK HookListboxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
226 static LRESULT CALLBACK HookTipWndProc(HWND hWnd, UINT message, WPARAM wp, LPARAM lp);
227
228 protected:
229 Gdiplus::Color m_crComboboxRect;
230 Gdiplus::Color m_crButtonRect;
231 Gdiplus::Color m_crArrow;
232 Gdiplus::Color m_crBorder;
233 Gdiplus::Color m_crText;
234 CBrush m_brBrush;
235
236 int32_t m_i32BtnSize;
237 int32_t m_i32PrevSel;
238
239 static COLORREF m_clrBk;
240 static COLORREF m_clrBorderActive;
241
242 BOOL m_bCursorOnComboBox;
243 BOOL m_bLButtonDown;
244 BOOL m_bDroppedState;
245 BOOL m_bDroppedStatePrev;
246 bool m_bEnableToolTipOnListBox;
247
248 CMap<int32_t, int32_t, CString, const wchar_t*> m_mapTipTexts;
249 CRect m_rcDropDownBtn;
250 COMBOBOXINFO m_cbi;
251 CUIntArray m_arrDisabledItems;
252
253 static int m_i32OriginalSel;
254 static CWnd m_tipWnd;
255 static CFont m_fontToolTip;
256 static uint32_t m_u32DelayTime;
257 static BOOL m_bMouseCursorEntered;
258
259 static CMap<HWND, HWND, WNDPROC, WNDPROC&> m_mapWndProc;
260 static CMap<HWND, HWND, CGUIComboBox*, CGUIComboBox*&> m_mapCombo;
261 static int32_t m_i32ComboBoxCreationCount;
262
263 public:
264 DECLARE_MESSAGE_MAP()
265 afx_msg void OnPaint();
266 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
267 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
268 afx_msg void OnMouseHover(UINT nFlags, CPoint point);
269 afx_msg void OnMouseLeave();
270 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
271 afx_msg BOOL OnCbnKillfocus();
272 afx_msg void OnSetFocus(CWnd* pOldWnd);
273 afx_msg void OnKillFocus(CWnd* pNewWnd);
274 afx_msg BOOL OnCbnDropdown();
275 afx_msg BOOL OnCbnCloseup();
276 afx_msg BOOL OnCbnSelchange();
277 afx_msg BOOL OnCbnEditChange();
278 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
279 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
280 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
281 afx_msg void OnSize(UINT nType, int cx, int cy);
282 afx_msg void OnEnable(BOOL bEnable);
283};
284 }
285}
콤보박스 클래스
Definition GUIComboBox.h:28
virtual int32_t GetBtnSize() const
콤보 박스의 버튼 사이즈를 얻어 오는 함수
virtual int SetCurSel(int nSelect)
현재 선택된 값을 지정하는 함수
virtual CEdit * GetEditBox() const
콤보박스의 에디트 박스 컨트롤을 반환합니다.
virtual int32_t GetPrevSel() const
이전에 선택된 값을 얻어 오는 함수
virtual bool IsToolTipOnListBoxEnabled() const
콤보박스의 리스트박스에 툴팁 기능이 활성화되어 있는지 확인합니다.
CGUIComboBox()
기본 생성자
virtual void SetBtnSize(int32_t i32Size)
콤보 박스의 버튼 사이즈를 지정하는 함수
virtual void SetDroppedState(BOOL bState)
콤보 박스의 드롭 다운 상태를 설정하는 함수
virtual ~CGUIComboBox()
기본 소멸자
static uint32_t GetToolTipDelay()
현재 설정된 툴팁 지연 시간을 반환합니다.
virtual void EnableToolTipOnListBox(bool bEnable=true)
콤보박스의 리스트박스에 툴팁 기능을 활성화하거나 비활성화합니다. 활성화되면 텍스트가 리스트박스에서 잘릴 경우 툴팁이 표시됩니다.
virtual void SetToolTipText(int32_t i32Index, const wchar_t *pWCsTipText)
특정 항목에 대한 툴팁 텍스트를 설정합니다.
virtual CListBox * GetListBox() const
콤보박스의 리스트박스 컨트롤을 반환합니다.
virtual BOOL GetDroppedState() const
콤보 박스의 드롭 다운 상태를 얻어 오는 함수
static void SetToolTipDelay(uint32_t u32Delay)
툴팁 창을 표시하기 위한 지연 시간을 설정합니다. CGUIComboBox 및 하위 클래스의 모든 콤보박스는 동일한 지연 시간을 사용합니다.
virtual int SetPrevSel(int nSelect)
이전에 선택된 값을 저장하는 함수
virtual void SetDropDownHeight(int itemsToShow)
콤보 박스의 드롭다운 높이를 지정하는 함수