56 *Strings = *
tCBD.Strings;
57 *ItemDatas = *
tCBD.ItemDatas;
58 Selection =
tCBD.Selection;
59 SelIndex =
tCBD.SelIndex;
110 if (index <
static_cast<int>(Strings->
Size()))
111 Selection = (*Strings)[index];
129 if (Selection != str)
139 return static_cast<int>(Selection.length());
180 int x,
int y,
int w,
int h,
239 if (!
ok)
throw TXOwl{
_T(
"::GetComboBoxInfo failed")};
301 std::pair<int, int>
r(0,0);
357 for (
int i = 0;
i !=
n; ++
i)
377 const int m =
d.GetItemsInContainer();
378 for (
int i = 0;
i !=
n; ++
i)
388 if (
i ==
data.GetSelIndex())
457#if OWL_PERSISTENT_STREAMS
466 is >> GetObject()->TextLimit;
474TComboBox::Streamer::Write(opstream&
os)
const
477 os << GetObject()->TextLimit;
#define PRECONDITION(condition)
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
uint GetItemsInContainer() const
An interface object that represents a transfer buffer for a TComboBox.
~TComboBoxData()
Destructor for TComboBoxData. Deletes Strings, ItemDatas, and Selection.
void AddStringItem(LPCTSTR str, LPARAM itemData, bool isSelected=false)
Adds a given string and uint32 item to the "Strings" and "ItemDatas" array and copies the string into...
TComboBoxData & operator=(const TComboBoxData &tCBD)
void Select(int index)
Selects an item at a given index.
void SelectString(LPCTSTR str)
Selects "str", marking the matching String entry (if any) as selected.
const tstring & GetSelString() const
int GetSelStringLength() const
Returns the length of the selection string excluding the terminating 0.
TComboBoxData()
Constructs a TComboBoxData object, initializes Strings and ItemDatas to empty arrays,...
void Clear()
Flushes the Strings and ItemDatas members.
void ResetSelections()
Resets the index of the selected item and the currently selected string.
void AddString(LPCTSTR str, bool isSelected=false)
Adds the specified string to the array of Strings.
You can use TComboBox to create a combo box or a combo box control in a parent TWindow,...
TComboBox(TWindow *parent, int id, int x, int y, int w, int h, uint32 style, uint textLimit, TModule *module=0)
Constructs a combo box object with the specified parent window (parent), control ID (Id),...
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.
virtual void ClearList()
Clear all the entries in list part of the associated combobox.
std::pair< int, int > GetEditSel()
Functional style overload.
auto GetInfo() const -> COMBOBOXINFO
Returns a COMBOBOXINFO struct containing information about the combobox.
void SetTextLimit(uint textlimit)
Sets the text length limit member and associated control.
int SetEditSel(int startPos, int endPos)
Selects characters that are between startPos and endPos in the edit control of the combo box.
void SetupWindow()
Limits the amount of text that the user can enter in the combo box's edit control to the value of Tex...
void GetDroppedControlRect(TRect &Rect) const
For combo boxes, gets the screen coordinates of the dropped down list box.
virtual int SetSelStringExact(LPCTSTR find, int startIndex=-1)
DLN added.
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.
void CleanupWindow()
Cleanup aliases created in SetupWindow.
virtual int GetCount() const
Return the number of entries in list part of the associated combobox.
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)
void SetText(LPCTSTR str)
Selects the first string in the associated list box that begins with the supplied str.
virtual auto GetWindowClassName() -> TWindowClassName
Returns the name of TComboBox's registration class, "ComboBox.".
virtual int GetDeviceCaps(int index) const
Used under WIN3.1 or later, GetDeviceCaps returns capability information about this DC.
A DC class that provides access to the desktop window's client area which is the window behind all ot...
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...
virtual void SetParent(TWindow *newParent)
Sets the parent for the specified window by setting Parent to the specified new Parent window object.
TWindow()
Protected constructor for use by immediate virtually derived classes.
HWND GetWindow(uint cmd) const
Returns the handle of the window that has the indicated relationship to this window.
long GetWindowLong(int index) const
Retrieves information about the window depending on the value stored in index.
virtual void CleanupWindow()
Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an ...
void SetWindowText(LPCTSTR str)
Sets the window's text to the given string (by copying).
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
TXOwl is root class of the ObjectWindows exception hierarchy.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition of class TComboBox and TComboBoxData the base class for all combobox controls.
void ReadBaseObject(Base *base, ipstream &in)
#define IMPLEMENT_STREAMABLE1(cls, base1)
void WriteBaseObject(Base *base, opstream &out)
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
@ tdSizeData
Return the size of data transferred by the class.
@ tdSetData
Set data from the buffer into the window.
@ tdGetData
Get data from the window into the buffer.
Object Windows Library (OWLNext Core)
TObjectArray< tstring > TStringArray
uint16 HiUint16(LRESULT r)
TWindow * GetWindowPtr(HWND, const TApplication *)
Raw function to retrieve a TWindow pointer given an HWND from the a given app, or any app (app==0).
LPARAM TParam2
Second parameter type.
uint16 LoUint16(LRESULT r)
TTypedArray< LPARAM, LPARAM, TStandardAllocator > TLParamArray
#define CONST_CAST(targetType, object)