10#if !defined(OWL_COMBOBOX_H)
14#if defined(BI_HAS_PRAGMA_ONCE)
62 int GetTextLen()
const;
72 std::pair<int, int> GetEditSel();
80 void ShowList(
bool show =
true);
83 void GetDroppedControlRect(
TRect& Rect)
const;
84 bool GetDroppedState()
const;
85 bool GetExtendedUI()
const;
87 uint GetDroppedWidth()
const;
88 int SetDroppedWidth(
uint width);
92 virtual int AddString(
LPCTSTR str);
93 using TListBox::AddString;
94 virtual int InsertString(
LPCTSTR str,
int index);
95 using TListBox::InsertString;
96 virtual int DeleteString(
int index);
98 virtual void ClearList();
100 using TListBox::DirectoryList;
102 virtual int GetCount()
const;
104 using TListBox::FindString;
106 using TListBox::FindStringExact;
108 using TListBox::SetSelStringExact;
110 virtual int GetStringLen(
int index)
const;
111 virtual int GetString(
LPTSTR str,
int index)
const;
112 using TListBox::GetString;
114 virtual int GetTopIndex()
const;
115 virtual int SetTopIndex(
int index);
116 virtual int GetHorizontalExtent()
const;
117 virtual void SetHorizontalExtent(
int horzExtent);
119 virtual int GetSelIndex()
const;
120 virtual int SetSelIndex(
int index);
122 using TListBox::SetSelString;
123 virtual LPARAM GetItemData(
int index)
const;
126 int GetItemHeight(
int index)
const;
127 int SetItemHeight(
int index,
int height);
146 void CleanupWindow();
207 void Select(
int index);
208 void SelectString(
LPCTSTR str);
210 int GetSelCount()
const;
211 void ResetSelections();
212 int GetSelStringLength()
const;
688 return SelIndex ==
CB_ERR ? 0 : 1;
#define PRECONDITION(condition)
An interface object that represents a transfer buffer for a TComboBox.
int GetSelCount() const
Returns the number of items selected, either 0 or 1.
void SelectString(const tstring &str)
void AddStringItem(const tstring &str, LPARAM itemData, bool isSelected=false)
TStringArray & GetStrings()
Returns the array of strings (the Strings data member) to transfer to or from a combo box's associate...
int GetSelIndex()
Returns the index (the SelIndex data member) of the selected item in the strings array.
tstring & GetSelection()
Returns the currently selected string (the Selection data member) to transfer to or from a combo box.
const tstring & GetSelString() const
TLParamArray & GetItemDatas()
Returns the array of DWORDs to transfer to or from a combo box's associated list box.
void AddString(const tstring &str, bool isSelected=false)
void ResetSelections()
Resets the index of the selected item and the currently selected string.
You can use TComboBox to create a combo box or a combo box control in a parent TWindow,...
virtual int SetSelString(LPCTSTR findStr, int startIndex=-1)
Selects a string of characters in the associated list box and sets the contents of the associated edi...
int GetItemHeight(int index) const
Returns the height in pixels of the Combo box's list items.
virtual int GetString(TCHAR *str, int index) const
Retrieve the contents of the string at the passed index of list part of the associated combobox,...
void ShowList(bool show=true)
Shows or hides the drop down or drop down list combo box depending on the value of show.
int InitStorage(int numItemsToAdd, uint32 memoryToAllocate)
Allocates memory for storing combo box items.
virtual void SetHorizontalExtent(int horzExtent)
Set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width).
int SetItemHeight(int index, int height)
Sets the height of the list items or the edit control portion in a combo box.
void Clear()
Clear the text.
auto GetButtonRect() const -> TRect
virtual void ClearList()
Clear all the entries in list part of the associated combobox.
auto GetButtonState() const -> uint
int SetExtendedUI(bool Extended)
Specifies whether the combo box uses the extended user interface or the default user interface.
virtual int GetTopIndex() const
Returns the zero-based index of the first visible item in the list box portion of a combo box.
int SetEditSel(int startPos, int endPos)
Selects characters that are between startPos and endPos in the edit control of the combo box.
auto GetEditRect() const -> TRect
virtual int SetTopIndex(int index)
The system scrolls the list box contents so that either the string specified by index appears at the ...
uint GetDroppedWidth() const
Returns the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN ...
auto GetListHandle() const -> THandle
virtual int DeleteString(int index)
Deletes the string at the passed index in the associated list part of a combo box.
bool GetExtendedUI() const
Determines if the combo box has the extended user interface, which differs from the default user inte...
int GetTextLen() const
Returns the text length (excluding the terminating zero) of the edit control or static portion of the...
virtual int FindString(LPCTSTR find, int startIndex=-1) const
Return the index of the first string in list part of the associated combobox which begins with the pa...
virtual int InsertString(LPCTSTR str, int index)
Insert a string in list part of the associated combobox at the passed index, returning the index of t...
virtual int SetSelStringExact(LPCTSTR find, int startIndex=-1)
DLN added.
void SetText(const tstring &str)
void HideList()
Hides the drop down list of a drop down or drop down list combo box.
uint GetTextLimit()
Return the limit of new characters that can be entered into the edit control portion of the combobox.
int SetDroppedWidth(uint width)
Sets the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or ...
virtual int AddString(LPCTSTR str)
Adds a string to an associated list part of a combo box.
virtual int SetItemData(int index, LPARAM itemData)
Sets the 32-bit value associated with the TComboBox's item.
bool GetDroppedState() const
For drop down combo boxes, determines if a list box is visible.
auto GetEditHandle() const -> THandle
virtual int GetCount() const
Return the number of entries in list part of the associated combobox.
virtual int GetHorizontalExtent() const
Retrieves from a combo box the width, in pixels, by which the list box can be scrolled horizontally (...
virtual int GetSelIndex() const
Returns the index of the list selection or a negative value if none exists.
virtual int SetSelIndex(int index)
Selects a string of characters in a combo box.
virtual LPARAM GetItemData(int index) const
Returns the 32-bit value associated with the combo box's item.
void Transfer(TComboBoxData &data, TTransferDirection direction)
virtual int FindStringExact(LPCTSTR find, int startIndex=-1) const
Return the index of the first string in list part of the associated combobox which is exactly same wi...
virtual int DirectoryList(uint attrs, LPCTSTR fileSpec)
Fills the combo box with file names from a specified directory.
virtual int GetStringLen(int index) const
Return the length of the string at the passed index in the associated combo list excluding the termin...
void SetText(LPCTSTR str)
Selects the first string in the associated list box that begins with the supplied str.
An interface object that represents a corresponding list box element.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TRect is a mathematical class derived from tagRect.
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
tstring GetWindowText() const
String-aware overload.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
int GetWindowTextLength() const
Returns the length, in characters, of the specified window's title.
#define DECLARE_STREAMABLE_OWL(cls, ver)
#define DECLARE_STREAMABLE_INLINES(cls)
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition of class TListBox and TlistBoxData.
Object Windows Library (OWLNext Core)
LPARAM TParam2
Second parameter type.
TParam2 MkParam2(const T1 &lo, const T2 &hi)
#define CONST_CAST(targetType, object)