56 class CODComboBox :
public CWindowImpl<CODComboBox, CComboBox>
57 ,
public COwnerDraw<CODComboBox>
74 CODComboItem() noexcept;
75 CODComboItem(std::basic_string<TCHAR> text, COLORREF text_color, COLORREF back_color, HFONT font,
int height,
78 virtual ~CODComboItem();
100 DECLARE_WND_SUPERCLASS(_T(
"CODComboBox"), CComboBox::GetWndClassName())
123 bool ODAddItem(std::basic_string<TCHAR> text, COLORREF text_color, COLORREF back_color, HFONT font,
int height,
127 bool ODInsertItem(
int index, std::basic_string<TCHAR> text, COLORREF text_color, COLORREF back_color, HFONT font,
int height,
132 void SetODItemText(
int index, std::basic_string<TCHAR> text);
160 void DeleteItem( LPDELETEITEMSTRUCT lpDeleteItemStruct);
161 int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
162 void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
163 void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
169 bool m_bAutoAdjustDropWidth;
170 int m_iMaxDropDownWidth;
175 CWindow m_ControlWnd;
178 CODComboItem* GetAndVerifyItemData(
int index)
const;
180 UINT GetTextFormat(CODComboItem* item);
184 CHAIN_MSG_MAP_ALT(COwnerDraw<CODComboBox>, 1)
185 DEFAULT_REFLECTION_HANDLER()
bool GetAutoAdjustDropRectWidth() const
Default: true.
int GetODItemHeight(int index) const
Default: The height of the control portion of the combobox at the time the CODComboItem is instantiat...
void SetODItemUseEllipsis(int index, bool ellipsis)
Modify the UseEllipsis state of the selected combobox item.
CVertAlignment GetODItemVertAlignment(int index) const
DefaultL: vaMiddle.
void SetODItemBackColor(int index, COLORREF color)
Modify the background color of the selected combobox item.
HFONT GetODItemFont(int index) const
Default: The font assigned to the combo box when the CODComboItem object is instantiated.
void SetMaxDropDownWidth(int value)
Sets the upper limit to the width of the dropdown list, if it is being automatically adjusted...
CHorzAlignment GetODItemHorzAlignment(int index) const
Default: haLeft.
CVertAlignment
Control vertical placement of text in control window.
void SetODItemHeight(int index, int height)
Modify the height of the selected combobox item.
bool ODAddItem()
Add new item to the end of the list box.
bool GetODItemWordWrap(int index) const
Default: false.
void SubclassComboBox(HWND wnd)
Subclass a combobox control.
void SetODItemFont(int index, HFONT font)
Modify the font assigned to the selected combobox item.
COLORREF GetODItemBackColor(int index) const
Default: COLOR_WINDOW.
void UpdateDropDownWidth()
Force an update of the width of the drop down list.
void SetODItemVertAlignment(int index, CVertAlignment value)
Modify the vertical text aligment of the selected combobox item.
bool ODInsertItem(int index)
Insert an item.
void SetODItemText(int index, std::basic_string< TCHAR > text)
Modify the text associated with a combobox item.
int GetMaxDropDownWidth() const
Default: 400 pixels.
void SetODItemHorzAlignment(int index, CHorzAlignment value)
Modify the horizontal text alignment of the selected combobox item.
CHorzAlignment
Control horizontal placement of text in control window.
void UnSubclassComboBox()
Un-subclass main and component windows; free GDI resources.
An owner-drawn combo box featuring textual content with per-item colors and fonts.
void SetODItemWordWrap(int index, bool wrap)
Modify the WordWrap state of the selected combobox item.
COLORREF GetODItemTextColor(int index) const
Default: COLOR_WINDOWTEXT.
std::basic_string< TCHAR > GetODItemText(int index) const
Default: "".
bool ODRemoveItem(int index)
Deletes an item from the drop-down list.
bool GetODItemUseEllipsis(int index) const
Default: true.
void UpdateControlHeight()
Update the combobox height to accomodate all content.
void SetAutoAdjustDropRectWidth(bool value)
Change the AutoAdjustRectWidth state.
void SetODItemTextColor(int index, COLORREF color)
Modify the text color of the selected combobox item.