OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TComboBox Class Reference

You can use TComboBox to create a combo box or a combo box control in a parent TWindow, or to facilitate communication between your application and the combo box controls of TDialog. More...

#include <owl/combobox.h>

Inheritance diagram for owl::TComboBox:
owl::TListBox owl::TControl owl::TWindow owl::TEventHandler owl::TStreamableBase owl::TComboBoxEx owl::TFlatComboBox owl::TMemComboBox owl::TGadgetComboBox

Public Member Functions

 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), position (x, y) relative to the origin of the parent window's client area, width (w), height (h), style (style), and text length (textLimit).
 
 TComboBox (TWindow *parent, int resourceId, uint textLimit=0, TModule *module=0)
 Constructs a default combo box with the given parent window control ID text length.
 
 TComboBox (THandle hWnd, TModule *module=0)
 Constructs a combo box object to encapsulate (alias) an existing control.
 
 ~TComboBox ()
 
auto GetInfo () const -> COMBOBOXINFO
 Returns a COMBOBOXINFO struct containing information about the combobox.
 
auto GetButtonRect () const -> TRect
 
auto GetButtonState () const -> uint
 
auto GetEditHandle () const -> THandle
 
auto GetEditRect () const -> TRect
 
int GetTextLen () const
 Returns the text length (excluding the terminating zero) of the edit control or static portion of the combo box.
 
int GetText (TCHAR *str, int maxChars) const
 Retrieves up to maxChars characters in the edit or static portion of the combo box.
 
tstring GetText () const
 
void SetText (LPCTSTR str)
 Selects the first string in the associated list box that begins with the supplied str.
 
void SetText (const tstring &str)
 
uint GetTextLimit ()
 Return the limit of new characters that can be entered into the edit control portion of the combobox.
 
void SetTextLimit (uint textlimit)
 Sets the text length limit member and associated control.
 
int GetEditSel (int &startPos, int &endPos)
 Returns, in the supplied reference parameters, the starting and ending positions of the text selected in the associated edit control.
 
std::pair< int, intGetEditSel ()
 Functional style overload.
 
int SetEditSel (int startPos, int endPos)
 Selects characters that are between startPos and endPos in the edit control of the combo box.
 
void Clear ()
 Clear the text.
 
auto GetListHandle () const -> THandle
 
void ShowList (bool show=true)
 Shows or hides the drop down or drop down list combo box depending on the value of show.
 
void HideList ()
 Hides the drop down list of a drop down or drop down list combo box.
 
void GetDroppedControlRect (TRect &Rect) const
 For combo boxes, gets the screen coordinates of the dropped down list box.
 
bool GetDroppedState () const
 For drop down combo boxes, determines if a list box is visible.
 
bool GetExtendedUI () const
 Determines if the combo box has the extended user interface, which differs from the default user interface in the following ways:
 
int SetExtendedUI (bool Extended)
 Specifies whether the combo box uses the extended user interface or the default user interface.
 
uint GetDroppedWidth () const
 Returns the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style on success; otherwise returns CB_ERR.
 
int SetDroppedWidth (uint width)
 Sets the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
 
virtual int AddString (LPCTSTR str)
 Adds a string to an associated list part of a combo box.
 
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 the string in the list A negative value is returned if an error occurs.
 
virtual int DeleteString (int index)
 Deletes the string at the passed index in the associated list part of a combo box.
 
virtual void ClearList ()
 Clear all the entries in list part of the associated combobox.
 
virtual int DirectoryList (uint attrs, LPCTSTR fileSpec)
 Fills the combo box with file names from a specified directory.
 
virtual int GetCount () const
 Return the number of entries in list part of the associated combobox.
 
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 passed string.
 
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 with the passed string.
 
virtual int SetSelStringExact (LPCTSTR find, int startIndex=-1)
 DLN added.
 
virtual int GetStringLen (int index) const
 Return the length of the string at the passed index in the associated combo list excluding the terminating 0.
 
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, returning the length of the string (in bytes excluding the terminating 0) as the value of the call.
 
virtual int GetTopIndex () const
 Returns the zero-based index of the first visible item in the list box portion of a combo box.
 
virtual int SetTopIndex (int index)
 The system scrolls the list box contents so that either the string specified by index appears at the top of the list box or the maximum scroll range has been reached.
 
virtual int GetHorizontalExtent () const
 Retrieves from a combo box the width, in pixels, by which the list box can be scrolled horizontally (the scrollable width).
 
virtual void SetHorizontalExtent (int horzExtent)
 Set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width).
 
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 int SetSelString (LPCTSTR findStr, int startIndex=-1)
 Selects a string of characters in the associated list box and sets the contents of the associated edit control to the supplied string.
 
virtual LPARAM GetItemData (int index) const
 Returns the 32-bit value associated with the combo box's item.
 
virtual int SetItemData (int index, LPARAM itemData)
 Sets the 32-bit value associated with the TComboBox's item.
 
int GetItemHeight (int index) const
 Returns the height in pixels of the Combo box's list items.
 
int SetItemHeight (int index, int height)
 Sets the height of the list items or the edit control portion in a combo box.
 
int InitStorage (int numItemsToAdd, uint32 memoryToAllocate)
 Allocates memory for storing combo box items.
 
void Transfer (TComboBoxData &data, TTransferDirection direction)
 
virtual int AddString (LPCTSTR str)
 Adds str to the list box, returning its position in the list (0 is the first position).
 
int AddString (const tstring &str)
 
virtual int InsertString (LPCTSTR str, int index)
 Inserts str in the list box at the position supplied in index, and returns the item's actual position (starting at 0) in the list.
 
int InsertString (const tstring &str, int index)
 
virtual int DirectoryList (uint attrs, LPCTSTR fileSpec)
 Adds a list of file names to a list box.
 
int DirectoryList (uint attrs, const tstring &fileSpec)
 
virtual int FindString (LPCTSTR str, int startIndex=-1) const
 Returns the index of the first string in the associated listbox which begins with the passed string.
 
int FindString (const tstring &str, int startIndex=-1) const
 
virtual int FindStringExact (LPCTSTR str, int startIndex=-1) const
 Return the index of the first string in the list part which is exactly same as the passed string.
 
int FindStringExact (const tstring &str, int startIndex=-1) const
 
virtual int SetSelStringExact (LPCTSTR str, int startIndex=-1)
 Selects the item that matches the given string exactly.
 
int SetSelStringExact (const tstring &str, int startIndex=-1)
 
virtual int GetString (TCHAR *str, int index) const
 Retrieves the contents of the string at the passed index of the associated listbox.
 
tstring GetString (int index) const
 String-aware overload.
 
virtual int SetSelString (LPCTSTR str, int startIndex=-1)
 For single-selection list boxes.
 
int SetSelString (const tstring &str, int startIndex=-1)
 
- Public Member Functions inherited from owl::TListBox
 TListBox (TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
 Constructs a list box object with the supplied parent window (parent) library ID (module), position (x, y) relative to the origin of the parent window's client area, width (w), and height (h).
 
 TListBox (TWindow *parent, int resourceId, TModule *module=0)
 Constructs a TListBox object to be associated with a list box control of a TDialog object.
 
 TListBox (THandle hWnd, TModule *module=0)
 Constructs a TListBox object to encapsulate (alias) an existing control.
 
uint32 ItemFromPoint (TPoint &p)
 Retrieve the zero-based index of the item nearest the specified point in a list box.
 
int InitStorage (int numItemsToAdd, uint32 memoryToAllocate)
 Allocates memory for storing list box items.
 
void Transfer (TListBoxData &data, TTransferDirection direction)
 
int FindString (const tstring &str, int startIndex=-1) const
 
int FindStringExact (const tstring &str, int startIndex=-1) const
 
int SetSelStringExact (const tstring &str, int startIndex=-1)
 
bool SetTabStops (int numTabs, int *tabs)
 Sets tab stops.
 
void SetColumnWidth (int width)
 Sets the width in pixels of the items in the list box.
 
int GetCaretIndex () const
 Returns the index of the currently focused list-box item.
 
int SetCaretIndex (int index, bool partScrollOk)
 Sets the focus to the item specified at index.
 
bool IsSelected (int index) const
 Returns true if the index is selected.
 
bool SetSelected (int index, bool selected=true)
 Sets the selection state for the item at the specified index, and returns true if successful.
 
tstring GetString (int index) const
 String-aware overload.
 
int GetItemRect (int index, TRect &rect) const
 Returns the dimensions of the rectangle that surrounds a list-box item currently displayed in the list-box window.
 
int DirectoryList (uint attrs, const tstring &fileSpec)
 
int AddString (const tstring &str)
 
int InsertString (const tstring &str, int index)
 
virtual int ReplaceString (LPCTSTR str, int index)
 Replaces the item in the list at the position supplied in index, and returns that item's actual position (starting at 0) in the list.
 
int ReplaceString (const tstring &str, int index)
 
virtual int GetSelString (TCHAR *str, int maxChars) const
 For single-selection list boxes.
 
tstring GetSelString () const
 String-aware overload.
 
int SetSelString (const tstring &str, int startIndex=-1)
 
int GetSelCount () const
 Returns the number of selected items in the single- or multiple-selection list box or combo box.
 
int GetSelStrings (TCHAR **strs, int maxCount, int maxChars) const
 For multiple-selection list boxes, retrieves the total number of selected items for a multiselection list and copies them into the buffer.
 
TStringArray GetSelStrings () const
 Container-aware overload.
 
int SetSelStrings (LPCTSTR *prefixes, int numSelections, bool shouldSet)
 For multiple-selection list boxes, selects the strings in the associated list box that begin with the prefixes specified in the prefixes array.
 
int SetSelStrings (const TStringArray &prefixes, bool shouldSet)
 Container-aware overload.
 
int GetSelIndexes (int *indexes, int maxCount) const
 For multiple-selection list boxes.
 
TIntArray GetSelIndexes () const
 Container-aware overload.
 
int SetSelIndexes (int *indexes, int numSelections, bool shouldSet)
 For multiple-selection list boxes.
 
int SetSelIndexes (const TIntArray &, bool shouldSet)
 Container-aware overload.
 
bool GetSel (int index) const
 Returns the selection state of the list-box item at location index.
 
int SetSel (int index, bool select)
 For multiple-selection list boxes.
 
int SetSelItemRange (bool select, int first, int last)
 Selects the range of items specified from first to last.
 
int GetAnchorIndex () const
 Retrieve the index of the anchor item – that is, the item from which a multiple selection starts.
 
int SetAnchorIndex (int index)
 Set the anchor item – that is, the item from which a multiple selection starts.
 
- Public Member Functions inherited from owl::TControl
 TControl (TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
 Invokes TWindow's constructor, passing it parent (parent window), title (caption text), and module.
 
 TControl (TWindow *parent, int id, const tstring &title, int x, int y, int w, int h, TModule *module=nullptr)
 String-aware overload.
 
 TControl (TWindow *parent, int resourceId, TModule *module=nullptr)
 Constructs an object to be associated with an interface control of a TDialog object.
 
 TControl (TWindow *parent, int resourceId, const tstring &title, TModule *=nullptr)
 Overload for controls loaded from resource Allows the title specified in the resource data to be overridden.
 
 ~TControl () override
 
- Public Member Functions inherited from owl::TWindow
void TraceWindowPlacement ()
 
 TWindow (TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
 Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be created and displayed along with parent.
 
 TWindow (TWindow *parent, const tstring &title, TModule *module=nullptr)
 String-aware overload.
 
 TWindow (HWND handle, TModule *module=nullptr)
 Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias.
 
virtual ~TWindow () override
 Destroys this window (unless this is an alias) and the children.
 
TApplicationGetApplication () const
 Gets a pointer to the TApplication object associated with this.
 
virtual bool Register ()
 Registers the Windows registration class of this window, if this window is not already registered.
 
TScrollerGetScroller ()
 Returns the associated scroller object for this window.
 
void SetScroller (TScroller *scroller)
 Sets the scroller object for this window.
 
virtual void CloseWindow (int retVal=0)
 Determines if it is okay to close a window before actually closing the window.
 
TWindowAttrGetWindowAttr ()
 Returns the TWindowAttr structure, which contains the window's creation attributes.
 
const TWindowAttrGetWindowAttr () const
 Returns the TWindowAttr structure, which contains the window's creation attributes.
 
LPCTSTR GetCaption () const
 Returns the Title member of TWindow.
 
virtual bool CanClose ()
 Use this function to determine if it is okay to close a window.
 
void ChildBroadcastMessage (TMsgId, TParam1=0, TParam2=0)
 Sends the specified message to all immediate children using SendMessage.
 
TResult HandleMessage (TMsgId, TParam1=0, TParam2=0)
 Dispatches the given message using the response table.
 
virtual TResult EvCommand (uint id, HWND hWndCtl, uint notifyCode)
 WindowProc calls EvCommand to handle WM_COMMAND messages.
 
virtual TResult EvNotify (uint id, TNotify &notifyInfo)
 Handles WM_NOTIFY and subdispatch messages from child controls.
 
TResult DefaultProcessing ()
 Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications.
 
virtual void Paint (TDC &dc, bool erase, TRect &rect)
 Repaints the client area (the area you can use for drawing) of a window.
 
void SubclassWindowFunction ()
 Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc.
 
void SetFlag (uint mask)
 Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.
 
void ClearFlag (uint mask)
 Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.
 
bool IsFlagSet (uint mask)
 Returns the state of the bit flag in Attr.Flags whose mask is supplied.
 
void EnableAutoCreate ()
 Ensures that an associated child window interface element is created and displayed along with its parent window.
 
void DisableAutoCreate ()
 Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window.
 
virtual TTooltipGetTooltip () const
 
virtual void EnableTooltip (bool enable=true)
 
void SetTooltip (TTooltip *tooltip)
 
void EnableTransfer ()
 Enables the transfer mechanism, which allows state data to be transferred between the window and a transfer buffer.
 
void DisableTransfer ()
 Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer.
 
TModuleGetModule () const
 Returns a pointer to the module object.
 
void SetModule (TModule *module)
 Sets the default module for this window.
 
tstring LoadString (uint id) const
 
HBITMAP LoadBitmap (TResId id) const
 
HACCEL LoadAccelerators (TResId id) const
 
HMENU LoadMenu (TResId id) const
 
HCURSOR LoadCursor (TResId id) const
 
HICON LoadIcon (TResId id) const
 
std::string LoadHtml (TResId id) const
 
virtual bool Create ()
 Creates the window interface element to be associated with this ObjectWindows interface element.
 
bool CreateChildren ()
 Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set.
 
virtual void Destroy (int retVal=0)
 Destroys an MS-Windows element associated with the TWindow.
 
virtual int Execute ()
 Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
 
virtual int DoExecute ()
 Do actual modal execution using the Begin/End Modal support of TApplication.
 
void AttachHandle (HWND handle)
 
void DetachHandle ()
 
virtual bool PreProcessMsg (MSG &msg)
 Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message.
 
virtual bool IdleAction (long idleCount)
 Called when no messages are waiting to be processed, IdleAction performs idle processing as long as true is returned.
 
virtual bool HoldFocusHWnd (HWND hLose, HWND hGain)
 Responds to a request by a child window to hold its HWND when it is losing focus.
 
int GetId () const
 Returns Attr.Id, the ID used to find the window in a specified parent's child list.
 
auto ChildWithId (int id) const -> const TWindow *
 
auto ChildWithId (int id) -> TWindow *
 Returns a pointer to the window in the child window list that has the supplied id.
 
HWND GetParentH () const
 Return the handle of the parent.
 
TWindowGetParentO () const
 Return the OWL's parent for this window.
 
TWindowGetParent () const
 Retrieves the OWL object of the parent window. If none exists, returns 0.
 
virtual void SetParent (TWindow *newParent)
 Sets the parent for the specified window by setting Parent to the specified new Parent window object.
 
void SetNext (TWindow *next)
 Sets the next window in the sibling list.
 
virtual bool SetDocTitle (LPCTSTR docname, int index)
 Default behavior for updating document title is to pass it to parent frame.
 
bool SetDocTitle (const tstring &docname, int index)
 
void SetCaption (LPCTSTR title)
 Copies title to an allocated string pointed to by title.
 
void SetCaption (const tstring &title)
 
void SetCaption (uint resourceStringId)
 Sets the window title to the resource string identified by the given id.
 
bool SetCursor (TModule *module, TResId resId)
 Sets the mouse cursor for the window, loading the given resId from the given module.
 
auto GetBkgndColor () const -> TColor
 Returns the overriding background color set for the window.
 
void SetBkgndColor (TColor color, bool shouldUpdate=true)
 Sets the background color for the window.
 
auto GetTextColor () const -> TColor
 Returns the overriding text color set for the window.
 
void SetTextColor (TColor color, bool shouldUpdate=true)
 Sets the text color for the window.
 
void SetAcceleratorTable (TResId resId)
 
TResult ForwardMessage (HWND handle, bool send=true)
 Forwards the window's current message.
 
TResult ForwardMessage (bool send=true)
 Forwards the window's current message.
 
void SendNotification (int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
void SendNotification (HWND receiver, int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
TResult SendNotification (int id, NMHDR &, TMsgId=WM_NOTIFY)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
TResult SendNotification (HWND receiver, uint id, NMHDR &, TMsgId=WM_NOTIFY)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
virtual TResult WindowProc (TMsgId, TParam1, TParam2)
 First virtual function called to handling incoming messages to a TWindow.
 
virtual TResult DefWindowProc (TMsgId, TParam1, TParam2)
 Virtual function provides final default processing for an incoming message Calls original window proc that was subclassed, using ::CallWindowProc to make sure that registers get setup correctly.
 
virtual void EvCommandEnable (TCommandEnabler &ce)
 Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-handling function or calls DefaultProcessing to handle the incoming message.
 
void RouteCommandEnable (HWND hInitCmdTarget, TCommandEnabler &ce)
 Walks the chain of windows from the initial target window to this window.
 
void SetTransferBuffer (void *transferBuffer, uint size)
 Sets TransferBuffer and TransferBufferSize.
 
template<class TBuffer >
void SetTransferBuffer (TBuffer *transferBuffer)
 Sets TransferBuffer and TransferBufferSize.
 
template<class TElement , uint Count>
void SetTransferBuffer (TElement(&transferBuffer)[Count])
 Sets TransferBuffer and TransferBufferSize.
 
voidGetTransferBuffer () const
 
uint GetTransferBufferSize () const
 
virtual void TransferData (TTransferDirection direction)
 Transfers data between the TWindow's data buffer and the child windows in its ChildList (data is not transfered between any child windows whose wfTransfer flag is not set)
 
HWND GetHandle () const
 Returns the handle of the window.
 
 operator HWND () const
 Allows a TWindow& to be used as an HWND in Windows API calls by providing an implicit conversion from TWindow to HWND.
 
bool IsWindow () const
 Returns true if an HWND is being used.
 
auto GetClassName (TCHAR *className, int maxCount) const -> int
 Returns the Windows class name for this object's window handle.
 
long GetClassLong (int index) const
 Retrieves the 32-bit value containing information about the window class.
 
long SetClassLong (int index, long newLong)
 Sets the long value at the specified offset (index).
 
uint16 GetClassWord (int index) const
 Gets a 16-bit value containing information about the class or style of the window.
 
uint16 SetClassWord (int index, uint16 newWord)
 Sets the word value at the specified offset (index).
 
LONG_PTR GetWindowLongPtr (int index) const
 Retrieves information about the window depending on the value stored in index.
 
LONG_PTR SetWindowLongPtr (int index, LONG_PTR newLong)
 Changes information about the window. For a list of constants, see GetWindowLongPtr()
 
long GetWindowLong (int index) const
 Retrieves information about the window depending on the value stored in index.
 
long SetWindowLong (int index, long newLong)
 Changes information about the window.
 
uint16 GetWindowWord (int index) const
 Retrieves information about this window depending on the value of index.
 
uint16 SetWindowWord (int index, uint16 newWord)
 Changes information about the window.
 
WNDPROC GetWindowProc () const
 
WNDPROC SetWindowProc (WNDPROC wndProc)
 
int EnumProps (PROPENUMPROC proc)
 Enumerates all the items in the property list of the current window and passes them one by one to the callback function indicated in proc.
 
HANDLE GetProp (uint16 atom) const
 Returns a handle to the property list of the specified window.
 
HANDLE RemoveProp (uint16 atom) const
 Removes the property specified by atom from the application's property list.
 
bool SetProp (uint16 atom, HANDLE data) const
 Adds an item to the property list of the specified window.
 
HANDLE GetProp (LPCTSTR str) const
 Returns a handle to the property list of the specified window.
 
HANDLE GetProp (const tstring &str) const
 
HANDLE RemoveProp (LPCTSTR str) const
 Removes the property specified by str, a null-terminated string, from the application's property list.
 
HANDLE RemoveProp (const tstring &str) const
 
bool SetProp (LPCTSTR str, HANDLE data) const
 Adds an item to the property list of the specified window.
 
bool SetProp (const tstring &str, HANDLE data) const
 
uint32 GetStyle () const
 Gets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
 
uint32 SetStyle (uint32 style)
 Sets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
 
uint32 GetExStyle () const
 Gets the extra style bits of the window.
 
uint32 SetExStyle (uint32 style)
 Sets the extra style bits of the window.
 
bool ModifyStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window.
 
bool ModifyExStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window.
 
bool MoveWindow (int x, int y, int w, int h, bool repaint=false)
 Repositions the specified window.
 
bool MoveWindow (const TRect &rect, bool repaint=false)
 Repositions the window.
 
virtual bool ShowWindow (int cmdShow)
 Displays this TWindow in a given state.
 
void ShowOwnedPopups (bool show)
 Shows or hides all owned pop-up windows according to the value of show.
 
bool IsWindowVisible () const
 Returns true if the window is visible.
 
bool IsZoomed () const
 Returns true if window is zoomed or maximized.
 
bool IsIconic () const
 Returns true if window is iconic or minimized.
 
int GetWindowTextLength () const
 Returns the length, in characters, of the specified window's title.
 
int GetWindowText (TCHAR *str, int maxCount) const
 Copies the window's title into a buffer pointed to by string.
 
tstring GetWindowText () const
 String-aware overload.
 
void SetWindowText (LPCTSTR str)
 Sets the window's text to the given string (by copying).
 
void SetWindowText (const tstring &str)
 
void SetWindowText (uint resourceStringId)
 Sets the window title to the resource string identified by the given id.
 
WINDOWPLACEMENT GetWindowPlacement () const
 Wrapper for Windows API.
 
void SetWindowPlacement (const WINDOWPLACEMENT &place)
 Wrapper for Windows API.
 
virtual void Invalidate (bool erase=true)
 Invalidates (mark for painting) the entire client area of a window.
 
virtual void InvalidateRect (const TRect &rect, bool erase=true)
 Invalidates a specified client area.
 
void InvalidateRgn (HRGN hRgn, bool erase=true)
 Invalidates a client area within a region specified by the hRgn parameter when the application receives a WM_PAINT message.
 
void Validate ()
 Calls the function ValidateRect to validate (that is, remove from the area to be updated) the entire client area (the area you can use for drawing).
 
void ValidateRect (const TRect &rect)
 Validates a portion of the client area indicated by rect.
 
void ValidateRgn (HRGN hRgn)
 Validates the client area within a region of the current window.
 
void UpdateWindow ()
 Updates the client area of the specified window by immediately sending a WM_PAINT message.
 
bool FlashWindow (bool invert)
 Changes the window from active to inactive or vice versa.
 
bool GetUpdateRect (TRect &rect, bool erase=true) const
 Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window.
 
int GetUpdateRgn (TRegion &rgn, bool erase=true) const
 Copies a window's update region into a region specified by region.
 
bool LockWindowUpdate (bool lock=true)
 Prevents or enables window drawing for one window at a time.
 
bool RedrawWindow (TRect *update, HRGN hUpdateRgn, uint redrawFlags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 Redraws the rectangle specified by update and the region specified by hUpdateRgn.
 
auto GetWindowRgn (TRegion &) const -> int
 Obtains a copy of the region of the window within which the system permits drawing.
 
void ResetWindowRgn (bool repaint=false)
 Calls SetWindowRgn(nullptr, repaint).
 
auto SetWindowRgn (HRGN, bool repaint=false) -> bool
 Sets the area within the window where the system permits drawing.
 
auto SetWindowRgn (const TRegion &, bool repaint=false) -> bool=delete
 
auto SetWindowRgn (TRegion &&r, bool repaint=false) -> bool
 Overload for TRegion.
 
int GetDlgCtrlID () const
 Returns the ID of the control.
 
HWND GetDlgItem (int childId) const
 Retrieves the handle of a control specified by childId.
 
uint GetDlgItemInt (int childId, bool *translated=0, bool isSigned=true) const
 Translates the text of a specified control into an integer value and returns it.
 
void SetDlgItemInt (int childId, uint value, bool isSigned=true) const
 Sets the child window with the Id (childId) in the window to the integer value specified in value.
 
int GetDlgItemText (int childId, TCHAR *text, int maxValue) const
 Retrieves the text of a control specified by childId.
 
tstring GetDlgItemText (int childId) const
 String-aware overload.
 
void SetDlgItemText (int childId, LPCTSTR text) const
 Sets the title or text of a control in a dialog box.
 
void SetDlgItemText (int childId, const tstring &text) const
 
void SetDlgItemText (int childId, uint resourceStringId) const
 
uint IsDlgButtonChecked (int buttonId) const
 Indicates if the child button specified in the integer parameter, buttonId, is checked, or if a button is grayed, checked, or neither.
 
bool IsChild (HWND hWnd) const
 Returns true if the window is a child window or a descendant window of this window.
 
HWND GetNextDlgGroupItem (HWND hWndCtrl, bool previous=false) const
 Returns either the next or the previous control in the dialog box.
 
HWND GetNextDlgTabItem (HWND hWndCtrl, bool previous=false) const
 Returns the handle of the first control that lets the user press the Tab key to move to the next control (that is, the first control with the WS_TABSTOP style associated with it).
 
void CheckDlgButton (int buttonId, uint check)
 Places a check mark in (or removes a check mark from) the button specified in buttonId.
 
void CheckRadioButton (int firstButtonId, int lastButtonId, int checkButtonId)
 Checks the radio button specified by checkButtonId and removes the check mark from the other radio buttons in the group.
 
void SetDlgItemFont (int childId, HFONT f, bool redraw=false) const
 
HFONT GetDlgItemFont (int childId) const
 
TRect GetDlgItemRect (int childId) const
 Returns the window rectangle of the given child, specified in this window's client coordinates.
 
HMENU GetMenu () const
 Returns the handle to the menu of the indicated window.
 
HMENU GetSystemMenu (bool revert=false) const
 Returns a handle to the system menu so that an application can access the system menu.
 
bool SetMenu (HMENU hMenu)
 Sets the specified window's menu to the menu indicated by hMenu.
 
bool HiliteMenuItem (HMENU hMenu, uint idItem, uint hilite)
 Either highlights or removes highlighting from a top-level item in the menu.
 
void DrawMenuBar ()
 DrawMenuBar redraws the menu bar.
 
bool KillTimer (UINT_PTR timerId)
 Gets rid of the timer and removes any WM_TIMER messages from the message queue.
 
UINT_PTR SetTimer (UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
 Creates a timer object associated with this window.
 
bool RegisterHotKey (int idHotKey, uint modifiers, uint virtKey)
 Registers a hotkey ID with the current application.
 
bool UnregisterHotKey (int idHotKey)
 Unregisters a hotkey ID with the current application.
 
bool WinHelp (LPCTSTR helpFile, uint command, ULONG_PTR data) const
 Invokes a specified help system.
 
bool WinHelp (const tstring &helpFile, uint command, ULONG_PTR data) const
 
void AssignContextMenu (TPopupMenu *menu)
 Associates a pop-up menu with the window so that it can automatically handle a WM_CONTEXTMENU message.
 
TPopupMenuGetContextMenu () const
 Returns the associated popup menu used by the window.
 
int MessageBox (LPCTSTR text, LPCTSTR caption=0, uint flags=MB_OK) const
 Creates and displays a message box that contains a message (text), a title (caption), and icons or push buttons (type).
 
int MessageBox (const tstring &text, const tstring &caption=tstring(), uint flags=MB_OK) const
 
int MessageBox (uint resId, LPCTSTR caption=0, uint flags=MB_OK) const
 
int MessageBox (uint resId, const tstring &caption, uint flags=MB_OK) const
 
auto MessageBoxIndirect (HINSTANCE resourceModule, TResId text, TResId caption, uint flags, TResId icon, DWORD_PTR contextHelpId, MSGBOXCALLBACK, DWORD languageId) const -> int
 Displays a standard message box.
 
auto MessageBoxIndirect (TResId icon, const tstring &text, const tstring &caption, uint flags=MB_OK) const -> int
 Displays a standard message box using the given icon.
 
auto FormatMessageBox (const tstring &formatStr, const tstring &caption, uint flags,...) const -> int
 
auto FormatMessageBox (const tstring &, std::nullptr_t, uint,...) const -> int=delete
 
HTASK GetWindowTask () const
 Returns a handle to the task that created the specified window.
 
void DragAcceptFiles (bool accept)
 If a window can process dropped files, DragAcceptFiles sets accept to true.
 
TCurrentEventGetCurrentEvent ()
 Returns the current event to be processed in the message queue.
 
void SethAccel (HACCEL)
 
auto GetChildren ()
 Returns a TWindow::TChildrenRange that can be iterated by standard means.
 
auto GetChildren () const
 Const overload of TWindow::GetChildren.
 
TWindowNext ()
 Returns a pointer to the next sibling window in the window's sibling list.
 
auto Next () const -> const TWindow *
 
TWindowPrevious ()
 Returns a pointer to the TWindow's previous sibling (the window previous to the TWindow in its parent's child window list)
 
auto Previous () const -> const TWindow *
 
TWindowGetFirstChild ()
 Returns a pointer to the first child window, which is the first window created in the interface object's child list.
 
auto GetFirstChild () const -> const TWindow *
 
TWindowGetLastChild ()
 Returns a pointer to the last child window in the interface object's child list.
 
auto GetLastChild () const -> const TWindow *
 
uint NumChildren () const
 Returns the number of child windows of the window.
 
bool GetScrollInfo (int bar, SCROLLINFO *scrollInfo) const
 Retrieves the properties of the given scroll bar.
 
SCROLLINFO GetScrollInfo (int bar, uint mask=SIF_ALL) const
 Function-style overload Returns selected properties of the given scroll bar.
 
int SetScrollInfo (int bar, SCROLLINFO *scrollInfo, bool redraw=true)
 Sets the properties of the given scroll bar.
 
int GetScrollPos (int bar) const
 Returns the thumb position in the scroll bar.
 
int SetScrollPos (int bar, int pos, bool redraw=true)
 Sets the thumb position in the scroll bar.
 
int GetScrollTrackPos (int bar) const
 Returns the thumb track position in the scroll bar.
 
void GetScrollRange (int bar, int &minPos, int &maxPos) const
 Returns the minimum and maximum positions in the scroll bar.
 
TScrollRange GetScrollRange (int bar) const
 Function-style overload.
 
void SetScrollRange (int bar, int minPos, int maxPos, bool redraw=true)
 Sets the thumb position in the scroll bar.
 
void SetScrollRange (int bar, const TScrollRange &, bool redraw=true)
 Overload taking the range as a pair.
 
int GetScrollPage (int bar) const
 Returns the page property (SCROLLINFO::nPage) of the given scroll bar.
 
void SetScrollPage (int bar, int page, bool redraw=true)
 Sets the page property (SCROLLINFO::nPage) of the given scroll bar.
 
bool EnableScrollBar (uint sbFlags=SB_BOTH, uint arrowFlags=ESB_ENABLE_BOTH)
 Disables or enables one or both of the scroll bar arrows on the scroll bars associated with this window.
 
void ShowScrollBar (int bar, bool show=true)
 Displays or hides the scroll bar.
 
void ScrollWindow (int dx, int dy, const TRect *scroll=nullptr, const TRect *clip=nullptr)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions.
 
void ScrollWindowEx (int dx, int dy, const TRect *scroll=0, const TRect *clip=0, HRGN hUpdateRgn=nullptr, TRect *update=0, uint flags=0)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions.
 
void ShutDownWindow (int retVal=0)
 This inline version of ShutDownWindow calls the static version of ShutDownWindow.
 
TResult SendMessage (TMsgId, TParam1=0, TParam2=0) const
 Sends a message (msg) to a specified window or windows.
 
TResult SendDlgItemMessage (int childId, TMsgId, TParam1=0, TParam2=0)
 Sends a message (msg) to the control specified in childId.
 
bool PostMessage (TMsgId, TParam1=0, TParam2=0)
 Posts a message (msg) to the window in the application's message queue.
 
HWND SetCapture ()
 Sets the mouse capture to the current window.
 
HWND SetFocus ()
 Sets the keyboard focus to current window and activates the window that receives the focus by sending a WM_SETFOCUS message to the window.
 
bool IsWindowEnabled () const
 Returns true if the window is enabled.
 
virtual bool EnableWindow (bool enable)
 Allows the given window to receive input from the keyboard of mouse.
 
void SetRedraw (bool redraw)
 Sends a WM_SETREDRAW message to a window so that changes can be redrawn (redraw = true) or to prevent changes from being redrawn (redraw = false).
 
bool TrackMouseEvent (uint flags=TME_HOVER|TME_LEAVE, int hoverTime=HOVER_DEFAULT)
 Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time.
 
bool CancelMouseEvent (uint flags=TME_HOVER|TME_LEAVE)
 Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag.
 
TRACKMOUSEEVENT QueryMouseEventTracking () const
 Returns the current state of mouse event tracking initiated by TrackMouseEvent.
 
void ClientToScreen (TPoint &point) const
 Converts the client coordinates specified in point to screen coordinates for the new window.
 
TPoint MapClientToScreen (const TPoint &p) const
 Function-style version of ClientToScreen.
 
void MapClientToScreen (TPoint *p, int count) const
 Maps the given points, specified in client coordinates in this window, to screen coordinates.
 
template<size_t Count>
void MapClientToScreen (TPoint(&p)[Count]) const
 Overload for array See MapClientToScreen(TPoint*, int).
 
TRect MapClientToScreen (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
void ScreenToClient (TPoint &point) const
 Uses the screen coordinates specified in point to calculate the client window's coordinates and then places the new coordinates into point.
 
TPoint MapScreenToClient (const TPoint &p) const
 Functional-style version of ScreenToClient.
 
void MapScreenToClient (TPoint *p, int count) const
 Maps the given points, specified in screen coordinates, to client coordinates in this window.
 
template<size_t Count>
void MapScreenToClient (TPoint(&p)[Count]) const
 Overload for array See MapScreenToClient(TPoint*, int).
 
TRect MapScreenToClient (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
void MapWindowPoints (HWND hWndTo, TPoint *pts, int count) const
 Maps a set of points in one window to a relative set of points in another window.
 
void MapWindowPoints (const TWindow &wndTo, TPoint *p, int n) const
 Overload for TWindow See MapWindowPoints(HWND, TPoint*, int).
 
template<size_t Count>
void MapWindowPoints (HWND hWndTo, TPoint(&p)[Count]) const
 Overload for array See MapWindowPoints(HWND, TPoint*, int).
 
template<size_t Count>
void MapWindowPoints (const TWindow &wndTo, TPoint(&p)[Count]) const
 Overload for TWindow and array See MapWindowPoints(HWND, TPoint*, int).
 
TPoint MapWindowPoints (HWND hWndTo, const TPoint &p) const
 Functional-style overload for TPoint; converts the given point coordinates and returns the result.
 
TPoint MapWindowPoints (const TWindow &wndTo, const TPoint &p) const
 Overload for TWindow and TPoint See MapWindowPoints(HWND, const TPoint&).
 
TRect MapWindowPoints (HWND hWndTo, const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
TRect MapWindowPoints (const TWindow &wndTo, const TRect &r) const
 Overload for TWindow and TRect See MapWindowPoints(HWND, const TRect&).
 
TRect MapWindowRect (HWND hWndTo) const
 Maps the window's rectangle (GetWindowRect) to client coordinates in the given destination window.
 
TRect MapWindowRect (const TWindow &wndTo) const
 Overload for TWindow See MapWindowRect(HWND).
 
TRect MapClientRect (HWND hWndTo) const
 Maps the window's client rectangle (GetClientRect) to client coordinates in the given destination window.
 
TRect MapClientRect (const TWindow &wndTo) const
 Overload for TWindow See MapClientRect(HWND).
 
void GetClientRect (TRect &rect) const
 Gets the coordinates of the window's client area and then copies them into the object referred to by TRect.
 
TRect GetClientRect () const
 Gets the coordinates of the window's client area (the area in a window you can use for drawing).
 
HWND ChildWindowFromPoint (const TPoint &point) const
 Determines which of the child windows contains the point specified in TPoint.
 
void GetWindowRect (TRect &rect) const
 Gets the screen coordinates of the window's rectangle and copies them into rect.
 
TRect GetWindowRect () const
 Gets the screen coordinates of the window's rectangle.
 
TRect GetChildRect (HWND hWnd) const
 Returns the window rectangle of the given window, specified in this window's client coordinates.
 
TRect GetChildRect (const TWindow &wnd) const
 Overload for TWindow See GetChildRect(HWND).
 
void BringWindowToTop ()
 Brings a pop-up or child window to the top of the stack of overlapping windows and activates it.
 
HWND SetActiveWindow ()
 Activates a top-level window.
 
HWND GetLastActivePopup () const
 Returns the last active pop-up window in the list.
 
HWND GetNextWindow (uint dirFlag) const
 Finds the handle associated with either the next or previous window in the window manager's list.
 
HWND GetTopWindow () const
 Returns a handle to the top window currently owned by this parent window.
 
HWND GetWindow (uint cmd) const
 Returns the handle of the window that has the indicated relationship to this window.
 
bool SetWindowPos (HWND hWndInsertAfter, const TRect &rect, uint flags)
 Changes the size of the window pointed to by rect.
 
bool SetWindowPos (HWND hWndInsertAfter, int x, int y, int w, int h, uint flags)
 Set the new window position.
 
void CreateCaret (HBITMAP hBitmap)
 Creates a new caret for the system.
 
void CreateCaret (bool isGray, int width, int height)
 Create a new caret for the system with the specified shape, bitmap shade, width, and height.
 
void HideCaret ()
 Removes the caret from the specified display screen.
 
void ShowCaret ()
 Displays the caret in the specified shape in the active window at the current position.
 
void SetWindowFont (HFONT font, bool redraw=true)
 Sets the font that a control uses to draw text.
 
void SetWindowFont (const TFont &font, bool redraw=true)
 Sets the font that a control uses to draw text.
 
HFONT GetWindowFont ()
 Gets the font the control uses to draw text.
 
- Public Member Functions inherited from owl::TEventHandler
virtual bool Find (TEventInfo &info, TEqualOperator op=0)
 Searches the list of response table entries looking for a match.
 
TResult Dispatch (TEventInfo &info, TParam1, TParam2=0)
 Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function.
 
TResult DispatchMsg (TMsgId, uint id, TParam1, TParam2)
 Search for the event given the message and it and dispatch to the event handler if found.
 
- Public Member Functions inherited from owl::TStreamableBase
virtual ~TStreamableBase ()
 

Protected Member Functions

virtual uint Transfer (void *buffer, TTransferDirection direction)
 Transfers the items and selection of the combo box to or from a transfer buffer if tdSetData or tdGetData, respectively, is passed as the direction.
 
virtual auto GetWindowClassName () -> TWindowClassName
 Returns the name of TComboBox's registration class, "ComboBox.".
 
void SetupWindow ()
 Limits the amount of text that the user can enter in the combo box's edit control to the value of TextLimit minus 1.
 
void CleanupWindow ()
 Cleanup aliases created in SetupWindow.
 
- Protected Member Functions inherited from owl::TControl
 TControl (HWND hWnd, TModule *module=nullptr)
 Constructor to alias non-OWL control.
 
virtual int CompareItem (COMPAREITEMSTRUCT &compareInfo)
 Function called when a WM_COMPAREITEM is sent to parent on our behalf.
 
virtual void DeleteItem (DELETEITEMSTRUCT &deleteInfo)
 Function called when a WM_DELETEITEM is sent to parent on our behalf.
 
virtual void MeasureItem (MEASUREITEMSTRUCT &measureInfo)
 Function called when a WM_MEASUREITEM is sent to parent on our behalf.
 
virtual void DrawItem (DRAWITEMSTRUCT &drawInfo)
 Function called when a WM_DRAWITEM is sent to parent on our behalf.
 
virtual void ODADrawEntire (DRAWITEMSTRUCT &drawInfo)
 Responds to a notification message sent to a drawable control when the control needs to be drawn.
 
virtual void ODAFocus (DRAWITEMSTRUCT &drawInfo)
 Responds to a notification sent to a drawable control when the focus has shifted to or from the control.
 
virtual void ODASelect (DRAWITEMSTRUCT &drawInfo)
 Responds to a notification sent to a drawable control when the selection state of the control changes.
 
void EvPaint ()
 Intercept WM_PAINT to redirect from TWindow to the underlying control if this Owl object is just a wrapper for a predefined class.
 
auto EvEraseBkgnd (HDC) -> bool
 Provides special handling for predefined controls.
 
int EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &comp)
 Handles WM_COMPAREITEM message (for owner draw controls) by calling the corresponding virtual function.
 
void EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &del)
 Handles WM_DELETEITEM message (for owner draw controls) by calling the corresponding virtual function.
 
void EvDrawItem (uint ctrlId, const DRAWITEMSTRUCT &draw)
 Handles WM_DRAWITEM message (for owner draw controls) by calling the corresponding virtual function.
 
void EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &meas)
 Handles WM_MEASUREITEM message (for owner draw controls) by calling the corresponding virtual function.
 
- Protected Member Functions inherited from owl::TWindow
 TWindow ()
 Protected constructor for use by immediate virtually derived classes.
 
void Init (TWindow *parent, LPCTSTR title, TModule *module)
 Normal initialization of a default constructed TWindow.
 
void Init (TWindow *parent, const tstring &title, TModule *module)
 
void Init (HWND hWnd, TModule *module)
 Wrapper initialization of a default constructed TWindow.
 
virtual THandle PerformCreate ()
 Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow.
 
void SetHandle (THandle)
 Sets the window handle in a derived class.
 
void GetHWndState (bool forceStyleSync=false)
 Copies the style, coordinate, and the resource id (but not the title) from the existing HWnd into the TWindow members.
 
void GetWindowTextTitle ()
 Updates the TWindow internal caption (Title) from the current window's caption.
 
virtual void GetWindowClass (WNDCLASS &wndClass)
 Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered.
 
void PerformSetupAndTransfer ()
 Ensures that the window is fully set up; then transfers data into the window.
 
void DispatchScroll (uint scrollCode, uint thumbPos, HWND hWndCtrl)
 Called by EvHScroll and EvVScroll to dispatch messages from scroll bars.
 
void LoadAcceleratorTable ()
 Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable).
 
virtual void RemoveChild (TWindow *child)
 Removes a child window.
 
TWindowGetWindowPtr (HWND hWnd) const
 Calls TApplication:GetWindowPtr on the application associated with this window.
 
void EvClose ()
 The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted if the Handle was really destroyed.
 
bool EvCreate (CREATESTRUCT &)
 Response method for an incoming WM_CREATE message.
 
void EvDestroy ()
 Responds to an incoming WM_DESTROY message.
 
int EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &compareInfo)
 Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself.
 
void EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &deleteInfo)
 Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself.
 
void EvDrawItem (uint ctrlId, const DRAWITEMSTRUCT &drawInfo)
 
void EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &measureInfo)
 Handles WM_MEASUREITEM message (for owner draw controls & menus) by forwarding message to control itself.
 
void EvHScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_HSCROLL message.
 
void EvVScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_VSCROLL message.
 
void EvMove (const TPoint &clientOrigin)
 Save the normal position of the window.
 
void EvNCDestroy ()
 Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element.
 
bool EvQueryEndSession (uint flags)
 Respond to Windows attempt to close down.
 
void EvSize (uint sizeType, const TSize &size)
 Response method for an incoming WM_SIZE message.
 
void EvLButtonDown (uint modKeys, const TPoint &point)
 Response method for an incoming WM_LBUTTONDOWN message.
 
bool EvEraseBkgnd (HDC)
 Handler for WM_ERASEBKGND.
 
void EvPaint ()
 Response method for an incoming WM_PAINT message.
 
void EvSysColorChange ()
 Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.
 
void EvChildInvalid (HWND hWnd)
 Handle message posted to us by a control needing assistance in dealing with invalid inputs.
 
void EvCompacting (uint compactRatio)
 The default message handler for WM_COMPACTING.
 
void EvDevModeChange (LPCTSTR devName)
 The default message handler for WM_DEVMODECHANGE.
 
void EvEnable (bool enabled)
 The default message handler for WM_ENABLE.
 
void EvEndSession (bool endSession, uint flags)
 Provides default handling for WM_ENDSESSION.
 
void EvFontChange ()
 The default message handler for WM_FONTCHANGE.
 
void EvSysCommand (uint cmdType, const TPoint &point)
 Responds to a user-selected command from the System menu or when the user selects the maximize or minimize box.
 
void EvTimeChange ()
 The default message handler for WM_TIMECHANGE.
 
void EvTimer (uint timerId)
 The default message handler for WM_TIMER.
 
void EvSettingChange (uint flags, LPCTSTR section)
 
void EvActivate (uint active, bool minimized, HWND hWndOther)
 Default message handler for WM_ACTIVATE.
 
void EvActivateApp (bool active, DWORD threadId)
 The default message handler for WM_ACTIVATEAPP.
 
void EvCancelMode ()
 The default message handler for WM_CANCELMODE.
 
void EvGetMinMaxInfo (MINMAXINFO &minmaxinfo)
 The default message handler for WM_GETMINMAXINFO.
 
int EvGetText (int bufSize, TCHAR *buf)
 The default message handler for WM_GETTEXT.
 
int EvGetTextLength ()
 The default message handler for WM_GETTEXTLENGTH.
 
void EvKillFocus (HWND hWndGetFocus)
 Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later.
 
uint EvMouseActivate (HWND hTopLevel, uint hitCode, TMsgId)
 The default message handler for WM_MOUSEACTIVATE.
 
void EvHotKey (int idHotKey, uint modifiers, uint vk)
 
bool EvCopyData (HWND hwnd, const COPYDATASTRUCT &)
 
void EvNextDlgCtl (TParam1 handleOrDirectionFlag, bool isHandle)
 
void EvParentNotify (const TParentNotify &)
 The default message handler for WM_PARENTNOTIFY.
 
HICON EvQueryDragIcon ()
 The default message handler for WM_QUERYDRAGICON.
 
bool EvQueryOpen ()
 The default message handler for WM_QUERYOPEN.
 
void EvQueueSync ()
 The default message handler for WM_QUEUESYNC.
 
bool EvSetCursor (HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)
 Response method for an incoming WM_SETCURSOR message.
 
void EvSetFocus (HWND hWndLostFocus)
 The default message handler for WM_SETFOCUS.
 
HFONT EvGetFont ()
 The default message handler for WM_GETFONT.
 
void EvSetFont (HFONT hFont, bool redraw)
 The default message handler for WM_SETFONT.
 
void EvSetRedraw (bool redraw)
 The default message handler for WM_SETREDRAW.
 
void EvSetText (LPCTSTR text)
 The default message handler for WM_SETTEXT.
 
void EvShowWindow (bool show, uint status)
 The default message handler for WM_SHOWWINDOW.
 
void EvWindowPosChanged (const WINDOWPOS &windowPos)
 The default message handler for WM_WINDOWPOSCHANGED.
 
bool EvWindowPosChanging (WINDOWPOS &)
 The default message handler for WM_WINDOWPOSCHANGING.
 
HBRUSH EvCtlColor (HDC hDC, HWND hWndChild, uint ctlType)
 Handler for control color messages (WM_CTLCOLOR family).
 
void EvChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_CHAR.
 
void EvDeadChar (uint deadKey, uint repeatCount, uint flags)
 The default message handler for WM_DEADCHAR.
 
void EvKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYDOWN.
 
void EvKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYUP.
 
void EvSysChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSCHAR.
 
void EvSysDeadChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSDEADCHAR.
 
void EvSysKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYDOWN.
 
void EvSysKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYUP.
 
void EvLButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONDBLCLK.
 
void EvLButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONUP.
 
void EvMButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDBLCLK.
 
void EvMButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDOWN.
 
void EvMButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONUP.
 
void EvMouseMove (uint modKeys, const TPoint &point)
 The default message handler for WM_MOUSEMOVE.
 
void EvMouseHWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEHWHEEL.
 
void EvMouseWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEWHEEL.
 
void EvRButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDBLCLK.
 
void EvRButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDOWN.
 
void EvRButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONUP.
 
void EvInitMenu (HMENU hMenu)
 The default message handler for WM_INITMENU.
 
void EvInitMenuPopup (HMENU hPopupMenu, uint index, bool isSysMenu)
 Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items.
 
int32 EvMenuChar (uint nChar, uint menuType, HMENU hMenu)
 The default message handler for WM_MENUCHAR.
 
void EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu)
 The default message handler for WM_MENUSELECT.
 
void EvContextMenu (HWND childHwnd, int x, int y)
 The default message handler for WM_CONTEXTMENU.
 
uint EvGetDlgCode (const MSG *msg)
 The default message handler for WM_GETDLGCODE.
 
void EvEnterIdle (uint source, HWND hWndDlg)
 The default message handler for WM_ENTERIDLE.
 
void EvSpoolerStatus (uint jobStatus, uint jobsLeft)
 The default message handler for WM_SPOOLERSTATUS.
 
void EvAskCBFormatName (uint bufLen, TCHAR *buffer)
 The default message handler for WM_ASKCBFORMATNAME.
 
void EvChangeCBChain (HWND hWndRemoved, HWND hWndNext)
 The default message handler for WM_CHANGECBCHAIN.
 
void EvDrawClipboard ()
 The default message handler for WM_DRAWCLIPBOARD.
 
void EvDestroyClipboard ()
 The default message handler for WM_DESTROYCLIPBOARD.
 
void EvHScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_HSCROLLCLIPBOARD.
 
void EvPaintClipboard (HWND hWnd, const PAINTSTRUCT &)
 The default message handler for WM_PAINTCLIPBOARD.
 
void EvRenderAllFormats ()
 The default message handler for WM_RENDERALLFORMATS.
 
void EvRenderFormat (uint dataFormat)
 The default message handler for WM_RENDERFORMAT.
 
void EvSizeClipboard (HWND hWndViewer, const TRect &)
 The default message handler for WM_SIZECLIPBOARD.
 
void EvVScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_VSCROLLCLIPBOARD.
 
void EvPaletteChanged (HWND hWndPalChg)
 The default message handler for WM_PALETTECHANGED.
 
void EvPaletteIsChanging (HWND hWndPalChg)
 The default message handler for WM_PALETTEISCHANGING.
 
bool EvQueryNewPalette ()
 The default message handler for WM_QUERYNEWPALETTE.
 
void EvDropFiles (TDropInfo dropInfo)
 The default message handler for WM_DROPFILES.
 
int EvCharToItem (uint ch, HWND hWndListBox, int caretIndex)
 The default message handler for WM_CHARTOITEM.
 
int EvVKeyToItem (uint key, HWND hWndListBox, int caretIndex)
 The default message handler for WM_VKEYTOITEM.
 
bool EvNCActivate (bool active)
 The default message handler for WM_NCACTIVATE.
 
uint EvNCCalcSize (bool calcValidRects, NCCALCSIZE_PARAMS &)
 The default message handler for WM_NCCALCSIZE.
 
bool EvNCCreate (CREATESTRUCT &)
 The default message handler for WM_NCCREATE.
 
uint EvNCHitTest (const TPoint &)
 The default message handler for WM_NCHITTEST.
 
void EvNCLButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDBLCLK.
 
void EvNCLButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDOWN.
 
void EvNCLButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONUP.
 
void EvNCMButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDBLCLK.
 
void EvNCMButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDOWN.
 
void EvNCMButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONUP.
 
void EvNCMouseMove (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMOUSEMOVE.
 
void EvNCPaint (HRGN)
 The default message handler for WM_NCPAINT.
 
void EvNCRButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDBLCLK.
 
void EvNCRButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDOWN.
 
void EvNCRButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONUP.
 
HICON EvGetIcon (bool isBigIcon)
 
HICON EvSetIcon (bool isBigIcon, HICON)
 
- Protected Member Functions inherited from owl::TEventHandler
bool SearchEntries (const TGenericTableEntry *entries, TEventInfo &info, TEqualOperator op)
 Low-level response table search function.
 

Additional Inherited Members

- Public Types inherited from owl::TWindow
typedef HWND THandle
 TWindow encapsulates an HWND.
 
using TChildrenIterator = TChildrenIteratorTemplate<TWindow>
 
using TConstChildrenIterator = TChildrenIteratorTemplate<const TWindow>
 
using TChildrenRange = TChildrenRangeTemplate<TWindow>
 
using TConstChildrenRange = TChildrenRangeTemplate<const TWindow>
 
typedef std::pair< int, intTScrollRange
 
- Public Types inherited from owl::TEventHandler
typedef bool(* TEqualOperator) (const TGenericTableEntry &, const TEventInfo &)
 
- Static Public Member Functions inherited from owl::TWindow
static void ShutDownWindow (TWindow *win, int retVal=0)
 This version of ShutDownWindow unconditionally shuts down a given window, calls Destroy on the interface element, and then deletes the interface object.
 
static HWND GetCapture ()
 Returns the handle of the window that has captured the mouse.
 
static void ReleaseCapture ()
 Releases the mouse capture from this window.
 
static HWND GetFocus ()
 Gets a handle to the window that has the focus.
 
static HWND WindowFromPoint (const TPoint &point)
 Returns the handle of the window in which the specified point (point) lies.
 
static void AdjustWindowRect (TRect &rect, uint32 style, bool menu)
 Calculates the size of the window rectangle according to the indicated client-rectangle size.
 
static void AdjustWindowRectEx (TRect &rect, uint32 style, bool menu, uint32 exStyle)
 Calculates the size of a window rectangle that has an extended style.
 
static HWND GetActiveWindow ()
 Retrieves the handle of the active window.
 
static HWND GetDesktopWindow ()
 Returns a handle to the desktop window.
 
static uint GetCaretBlinkTime ()
 Retrieves the caret blink rate in milliseconds.
 
static void GetCaretPos (TPoint &point)
 Gets the position of the caret in the coordinates of the client window.
 
static TPoint GetCaretPos ()
 
static void SetCaretBlinkTime (uint16 milliSecs)
 Sets the caret blink rate in milliseconds.
 
static void SetCaretPos (int x, int y)
 Sets the position of the caret in the coordinates of the client window.
 
static void SetCaretPos (const TPoint &pos)
 Sets the position of the caret in the coordinates of the client window.
 
static void DestroyCaret ()
 DestroyCaret first checks the ownership of the caret.
 
static void GetCursorPos (TPoint &pos)
 Retrieves the cursor's current position (in window screen coordinates) and copies the values into the structure pointed to by pos.
 
static TPoint GetCursorPos ()
 
static TPoint GetMessagePos ()
 
- Static Protected Member Functions inherited from owl::TWindow
static LRESULT CALLBACK InitWndProc (HWND, UINT msg, WPARAM, LPARAM)
 Callback process for hooking TWindow to native window.
 

Detailed Description

You can use TComboBox to create a combo box or a combo box control in a parent TWindow, or to facilitate communication between your application and the combo box controls of TDialog.

TComboBox objects inherit most of their behavior from TListBox. This class is streamable.

There are three types of combo boxes: simple, drop down, and drop down list. These types are governed by the style constants CBS_SIMPLE, CBS_DROPDOWN, and CBS_DROPDOWNLIST. These constants, supplied to the constructor of a TComboBox, indicate the type of combo box element to create.

Todo
Add support for new Windows Vista messages CB_SETCUEBANNER and CB_GETCUEBANNER

Definition at line 45 of file combobox.h.

Constructor & Destructor Documentation

◆ TComboBox() [1/3]

owl::TComboBox::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), position (x, y) relative to the origin of the parent window's client area, width (w), height (h), style (style), and text length (textLimit).

Invokes the TListBox constructor with similar parameters. Then sets Attr.Style as follows:

One of the following combo box style constants must be among the styles set in style: CBS_SIMPLE, CBS_DROPDOWN, CBS_DROPDOWNLIST, CBS_OWNERDRAWFIXED, or CBS_OWNERDRAWVARIABLE.

By default, an MS-Windows combobox associated with the TComboBox will have a vertical scrollbar and will maintain its entries in alphabetical order

Definition at line 178 of file combobox.cpp.

References _T, OWL_CDLEVEL, and TRACEX.

◆ TComboBox() [2/3]

owl::TComboBox::TComboBox ( TWindow * parent,
int resourceId,
uint textLimit = 0,
TModule * module = 0 )

Constructs a default combo box with the given parent window control ID text length.

Definition at line 198 of file combobox.cpp.

References _T, OWL_CDLEVEL, and TRACEX.

◆ TComboBox() [3/3]

owl::TComboBox::TComboBox ( THandle hWnd,
TModule * module = 0 )

Constructs a combo box object to encapsulate (alias) an existing control.

Definition at line 212 of file combobox.cpp.

References _T, OWL_CDLEVEL, and TRACEX.

◆ ~TComboBox()

owl::TComboBox::~TComboBox ( )

Definition at line 224 of file combobox.cpp.

References _T, OWL_CDLEVEL, and TRACEX.

Member Function Documentation

◆ AddString() [1/3]

int owl::TListBox::AddString ( const tstring & str)
inline

Definition at line 94 of file listbox.h.

◆ AddString() [2/3]

int owl::TComboBox::AddString ( LPCTSTR str)
inlinevirtual

Adds a string to an associated list part of a combo box.

Returns the index of the string in the list. The first entry is at index zero. Returns a negative value if an error occurs.

Reimplemented from owl::TListBox.

Definition at line 356 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ AddString() [3/3]

int owl::TListBox::AddString ( LPCTSTR str)
inlinevirtual

Adds str to the list box, returning its position in the list (0 is the first position).

Returns a negative value if an error occurs. The list items are automatically sorted unless the style LBS_SORT is not used for list box creation.

Reimplemented from owl::TListBox.

Definition at line 93 of file listbox.h.

◆ CleanupWindow()

void owl::TComboBox::CleanupWindow ( )
protectedvirtual

Cleanup aliases created in SetupWindow.

Reimplemented from owl::TWindow.

Reimplemented in owl::TMemComboBox.

Definition at line 438 of file combobox.cpp.

References _T, owl::TWindow::CleanupWindow(), owl::TWindow::GetHandle(), owl::TWindow::GetWindow(), owl::GetWindowPtr(), and TRACEX.

◆ Clear()

void owl::TComboBox::Clear ( )
inline

Clear the text.

Definition at line 279 of file combobox.h.

References _T, and SetText().

◆ ClearList()

void owl::TComboBox::ClearList ( )
inlinevirtual

Clear all the entries in list part of the associated combobox.

Reimplemented from owl::TListBox.

Definition at line 410 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ DeleteString()

int owl::TComboBox::DeleteString ( int index)
inlinevirtual

Deletes the string at the passed index in the associated list part of a combo box.

Returns a count of the entries remaining in the list or a negative value if an error occurs.

Reimplemented from owl::TListBox.

Definition at line 376 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ DirectoryList() [1/3]

int owl::TListBox::DirectoryList ( uint attrs,
const tstring & fileSpec )
inline

Definition at line 88 of file listbox.h.

◆ DirectoryList() [2/3]

int owl::TComboBox::DirectoryList ( uint attrs,
LPCTSTR fileSpec )
inlinevirtual

Fills the combo box with file names from a specified directory.

fileSpec points to the null-terminated string that specifies the filename to add to the list. If the filename contains wildcards (for example, *.*), all files that match the wildcards and have the attributes specified by the uAttrs parameter are added to the list.

attrs can be any combination of:

  • DDL_ARCHIVE Includes archived files.
  • DDL_DIRECTORY Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]).
  • DDL_DRIVES Includes drives. Drives are listed in the form [-x-], where x is the drive letter.
  • DDL_EXCLUSIVE Includes only files with the specified attributes. By default, read-write files are listed even if DDL_READWRITE is not specified.
  • DDL_HIDDEN Includes hidden files.
  • DDL_READONLY Includes read-only files.
  • DDL_READWRITE Includes read-write files with no additional attributes.
  • DDL_SYSTEM Includes system files.

Reimplemented from owl::TListBox.

Definition at line 402 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ DirectoryList() [3/3]

int owl::TListBox::DirectoryList ( uint attrs,
LPCTSTR fileSpec )
inlinevirtual

Adds a list of file names to a list box.

fileSpec points to the null-terminated string that specifies the filename to add to the list. If the filename contains wildcards (for example, *.*), all files that match the wildcards and have the attributes specified by the uAttrs parameter are added to the list.

attrs can be any combination of:

  • DDL_ARCHIVE Includes archived files.
  • DDL_DIRECTORY Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]).
  • DDL_DRIVES Includes drives. Drives are listed in the form [-x-], where x is the drive letter.
  • DDL_EXCLUSIVE Includes only files with the specified attributes. By default, read-write files are listed even if DDL_READWRITE is not specified.
  • DDL_HIDDEN Includes hidden files.
  • DDL_READONLY Includes read-only files.
  • DDL_READWRITE Includes read-write files with no additional attributes.
  • DDL_SYSTEM Includes system files.

Reimplemented from owl::TListBox.

Definition at line 87 of file listbox.h.

◆ FindString() [1/3]

int owl::TListBox::FindString ( const tstring & str,
int startIndex = -1 ) const
inline

Definition at line 53 of file listbox.h.

◆ FindString() [2/3]

int owl::TComboBox::FindString ( LPCTSTR find,
int startIndex = -1 ) const
inlinevirtual

Return the index of the first string in list part of the associated combobox which begins with the passed string.

Search for a match beginning at the passed startIndex. If a match is not found after the last string has been compared, the search continues from the beginning of the list until a match is found or until the list has been completely traversed. Search from beginning of list when -1 is passed as the startIndex. Return the index of the selected string. A negative value is returned if an error occurs.

Reimplemented from owl::TListBox.

Definition at line 438 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ FindString() [3/3]

int owl::TListBox::FindString ( LPCTSTR find,
int startIndex = -1 ) const
inlinevirtual

Returns the index of the first string in the associated listbox which begins with the passed string.

Searches for a match beginning at the passed startIndex. If a match is not found after the last string has been compared, the search continues from the beginning of the list until a match is found or until the list has been completely traversed

Searches from beginning of list when -1 is passed as the startIndex.

Returns the index of the selected string, a negative if an error occurs.

Reimplemented from owl::TListBox.

Definition at line 52 of file listbox.h.

◆ FindStringExact() [1/3]

int owl::TListBox::FindStringExact ( const tstring & str,
int startIndex = -1 ) const
inline

Definition at line 55 of file listbox.h.

◆ FindStringExact() [2/3]

int owl::TComboBox::FindStringExact ( LPCTSTR find,
int indexStart = -1 ) const
inlinevirtual

Return the index of the first string in list part of the associated combobox which is exactly same with the passed string.

Search for a exact match at the passed SearchIndex. If a match is not found after the last string has been compared, the search continues from the beginning of the list until a match is found or until the list has been completely traversed. Search from beginning of list when -1 is passed as the index Return the index of the selected string. A negative value is returned if an error occurs

Note
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, what FindStringExact does depends on whether your application uses the CBS_SORT style. If you use the CBS_SORT style, WM_COMPAREITEM messages are sent to the owner of the combo box to determine which item matches the specified string. If you do not use the CBS_SORT style, FindStringExact searches for a list item that matches the value of the find parameter.

Reimplemented from owl::TListBox.

Definition at line 465 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ FindStringExact() [3/3]

int owl::TListBox::FindStringExact ( LPCTSTR find,
int startIndex = -1 ) const
inlinevirtual

Return the index of the first string in the list part which is exactly same as the passed string.

Search for a exact match at the passed startIndex. If a match is not found after the last string has been compared, the search continues from the beginning of the list until a match is found or until the list has been completely traversed. Search from beginning of list when -1 is passed as the startIndex Return the index of the selected string. A negative value is returned if an error occurs

Note
If you create the list box with an owner-drawn style but without the LBS_HASSTRINGS style, what FindStringExact does depends on whether your application uses the LBS_SORT style. If you use the LBS_SORT style, WM_COMPAREITEM messages are sent to the owner of the combo box to determine which item matches the specified string. If you do not use the LBS_SORT style, FindStringExact searches for a list item that matches the value of the find parameter.

Reimplemented from owl::TListBox.

Definition at line 54 of file listbox.h.

◆ GetButtonRect()

auto owl::TComboBox::GetButtonRect ( ) const -> TRect
inline

Definition at line 55 of file combobox.h.

◆ GetButtonState()

auto owl::TComboBox::GetButtonState ( ) const -> uint
inline

Definition at line 56 of file combobox.h.

◆ GetCount()

int owl::TComboBox::GetCount ( ) const
inlinevirtual

Return the number of entries in list part of the associated combobox.

A negative value is returned if an error occurs

Reimplemented from owl::TListBox.

Definition at line 419 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetDroppedControlRect()

void owl::TComboBox::GetDroppedControlRect ( TRect & Rect) const

For combo boxes, gets the screen coordinates of the dropped down list box.

Definition at line 323 of file combobox.cpp.

References CONST_CAST, owl::TDC::GetDeviceCaps(), owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ GetDroppedState()

bool owl::TComboBox::GetDroppedState ( ) const
inline

For drop down combo boxes, determines if a list box is visible.

Definition at line 286 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetDroppedWidth()

uint owl::TComboBox::GetDroppedWidth ( ) const
inline

Returns the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style on success; otherwise returns CB_ERR.

By default, the minimum allowable width of the drop-down list box is 0. The width of the list box is either the minimum allowable width or the combo box width, whichever is larger.

Definition at line 331 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetEditHandle()

auto owl::TComboBox::GetEditHandle ( ) const -> THandle
inline

Definition at line 60 of file combobox.h.

◆ GetEditRect()

auto owl::TComboBox::GetEditRect ( ) const -> TRect
inline

Definition at line 61 of file combobox.h.

◆ GetEditSel() [1/2]

std::pair< int, int > owl::TComboBox::GetEditSel ( )

Functional style overload.

Definition at line 299 of file combobox.cpp.

References GetEditSel().

◆ GetEditSel() [2/2]

int owl::TComboBox::GetEditSel ( int & startPos,
int & endPos )

Returns, in the supplied reference parameters, the starting and ending positions of the text selected in the associated edit control.

Returns CB_ERR is the combo box has no edit control

Definition at line 285 of file combobox.cpp.

References owl::HiUint16(), owl::LoUint16(), and owl::TWindow::SendMessage().

◆ GetExtendedUI()

bool owl::TComboBox::GetExtendedUI ( ) const
inline

Determines if the combo box has the extended user interface, which differs from the default user interface in the following ways:

  • Displays the list box if the user clicks the static text field.
  • Displays the list box if the user presses the Down key.
  • Disables scrolling in the static text field if the item list is not visible.

Returns true if the combo box has the extended user interface; otherwise returns false.

Definition at line 302 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetHorizontalExtent()

int owl::TComboBox::GetHorizontalExtent ( ) const
inlinevirtual

Retrieves from a combo box the width, in pixels, by which the list box can be scrolled horizontally (the scrollable width).

This is applicable only if the list box has a horizontal scroll bar.

Reimplemented from owl::TListBox.

Definition at line 524 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetInfo()

auto owl::TComboBox::GetInfo ( ) const -> COMBOBOXINFO

Returns a COMBOBOXINFO struct containing information about the combobox.

Wrapper for Windows API function GetComboBoxInfo. http://msdn.microsoft.com/en-us/library/windows/desktop/bb775939.aspx

Definition at line 234 of file combobox.cpp.

References _T, CHECK, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetItemData()

LPARAM owl::TComboBox::GetItemData ( int index) const
inlinevirtual

Returns the 32-bit value associated with the combo box's item.

Reimplemented from owl::TListBox.

Definition at line 584 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ GetItemHeight()

int owl::TComboBox::GetItemHeight ( int index) const
inlinevirtual

Returns the height in pixels of the Combo box's list items.

If an error occurs, returns a negative value.

Reimplemented from owl::TListBox.

Definition at line 602 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ GetListHandle()

auto owl::TComboBox::GetListHandle ( ) const -> THandle
inline

Definition at line 79 of file combobox.h.

◆ GetSelIndex()

int owl::TComboBox::GetSelIndex ( ) const
inlinevirtual

Returns the index of the list selection or a negative value if none exists.

Reimplemented from owl::TListBox.

Definition at line 544 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetString() [1/3]

tstring owl::TListBox::GetString ( int index) const

String-aware overload.

Definition at line 75 of file listbox.cpp.

References owl::TMObjectArray< T, A >::Add(), owl::TListBoxData::Select(), and owl::TArrayBase::Size().

◆ GetString() [2/3]

int owl::TComboBox::GetString ( TCHAR * str,
int index ) const
inlinevirtual

Retrieve the contents of the string at the passed index of list part of the associated combobox, returning the length of the string (in bytes excluding the terminating 0) as the value of the call.

A negative value is returned if the passed index is not valid The buffer must be large enough for the string and the terminating 0

Reimplemented from owl::TListBox.

Definition at line 480 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ GetString() [3/3]

int owl::TListBox::GetString ( TCHAR * str,
int index ) const
inlinevirtual

Retrieves the contents of the string at the passed index of the associated listbox.

Returns the length of the string (in bytes excluding the terminating 0), a negative if the passed index is not valid

Note
The buffer must be large enough for the string and the terminating 0

Reimplemented from owl::TListBox.

Definition at line 74 of file listbox.h.

◆ GetStringLen()

int owl::TComboBox::GetStringLen ( int index) const
inlinevirtual

Return the length of the string at the passed index in the associated combo list excluding the terminating 0.

A negative value is returned if an error occurs

Reimplemented from owl::TListBox.

Definition at line 492 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ GetText() [1/2]

tstring owl::TComboBox::GetText ( ) const
inline

Definition at line 64 of file combobox.h.

◆ GetText() [2/2]

int owl::TComboBox::GetText ( TCHAR * str,
int maxChars ) const
inline

Retrieves up to maxChars characters in the edit or static portion of the combo box.

The number of characters retrieved is returned

Definition at line 262 of file combobox.h.

References owl::TWindow::GetHandle(), owl::TWindow::GetWindowText(), and PRECONDITION.

◆ GetTextLen()

int owl::TComboBox::GetTextLen ( ) const
inline

Returns the text length (excluding the terminating zero) of the edit control or static portion of the combo box.

Definition at line 238 of file combobox.h.

References owl::TWindow::GetHandle(), owl::TWindow::GetWindowTextLength(), and PRECONDITION.

◆ GetTextLimit()

uint owl::TComboBox::GetTextLimit ( )
inline

Return the limit of new characters that can be entered into the edit control portion of the combobox.

Definition at line 247 of file combobox.h.

◆ GetTopIndex()

int owl::TComboBox::GetTopIndex ( ) const
inlinevirtual

Returns the zero-based index of the first visible item in the list box portion of a combo box.

Initially the item with index 0 is at the top of the list box, but if the list box contents have been scrolled, another item may be at the top. CB_ERR is returned on failure.

Reimplemented from owl::TListBox.

Definition at line 504 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), and PRECONDITION.

◆ GetWindowClassName()

auto owl::TComboBox::GetWindowClassName ( ) -> TWindowClassName
protectedvirtual

Returns the name of TComboBox's registration class, "ComboBox.".

Reimplemented from owl::TListBox.

Reimplemented in owl::TComboBoxEx.

Definition at line 405 of file combobox.cpp.

References _T.

◆ HideList()

void owl::TComboBox::HideList ( )
inline

Hides the drop down list of a drop down or drop down list combo box.

Definition at line 254 of file combobox.h.

References ShowList().

◆ InitStorage()

int owl::TComboBox::InitStorage ( int numItemsToAdd,
uint32 memoryToAllocate )
inline

Allocates memory for storing combo box items.

An application sends this message before adding a large number of items to a combo box.

numItemsToAdd specifies the number of items to add. Windows 95: The wParam parameter is limited to 16-bit values. This means combo boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size in bytes of the items in a combo box is limited only by available memory.

memoryToAllocate specifies the amount of memory, in bytes, to allocate for item strings.

The return value is the maximum number of items that the memory object can store before another memory reallocation is needed, if successful. It is LB_ERRSPACE if not enough memory is available.

LB_INITSTORAGE Remarks:

Windows 95: This message helps speed up the initialization of list boxes that have a large number of items (more than 100). It reserves the specified amount of memory so that subsequent CB_ADDSTRING, CB_INSERTSTRING, CB_DIR, and CB_ADDFILE messages take the shortest possible time. You can use estimates for the cItems and cb parameters. If you overestimate, the extra memory is allocated; if you underestimate, the normal allocation is used for items that exceed the requested amount.

Windows NT: This message is not needed on Windows NT. It does not reserve the specified amount of memory, because available memory is virtually unlimited. The return value is always the value specified in the numItemsToAdd parameter.

Definition at line 647 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ InsertString() [1/3]

int owl::TListBox::InsertString ( const tstring & str,
int index )
inline

Definition at line 96 of file listbox.h.

◆ InsertString() [2/3]

int owl::TComboBox::InsertString ( LPCTSTR str,
int index )
inlinevirtual

Insert a string in list part of the associated combobox at the passed index, returning the index of the string in the list A negative value is returned if an error occurs.

Reimplemented from owl::TListBox.

Definition at line 366 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ InsertString() [3/3]

int owl::TListBox::InsertString ( LPCTSTR str,
int index )
inlinevirtual

Inserts str in the list box at the position supplied in index, and returns the item's actual position (starting at 0) in the list.

A negative value is returned if an error occurs. The list is not resorted. If index is -1, the string is appended to the end of the list.

Reimplemented from owl::TListBox.

Definition at line 95 of file listbox.h.

◆ SetDroppedWidth()

int owl::TComboBox::SetDroppedWidth ( uint width)
inline

Sets the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.

Returns the new width of the box on success; otherwise returns CB_ERR.

By default, the minimum allowable width of the drop-down list box is 0. The width of the list box is either the minimum allowable width or the combo box width, whichever is larger.

Definition at line 346 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetEditSel()

int owl::TComboBox::SetEditSel ( int startPos,
int endPos )
inline

Selects characters that are between startPos and endPos in the edit control of the combo box.

Returns CB_ERR if the combo box does not have an edit control.

Definition at line 271 of file combobox.h.

References owl::TWindow::GetHandle(), owl::MkParam2(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetExtendedUI()

int owl::TComboBox::SetExtendedUI ( bool extended)
inline

Specifies whether the combo box uses the extended user interface or the default user interface.

A value of true selects the extended user interface; a value of false selects the standard user interface. If the operation succeeds, the return value is CB_OKAY. If an error occurs, it is CB_ERR.

By default, the F4 key opens or closes the list and the DOWN ARROW changes the current selection. In the extended user interface, the F4 key is disabled and the DOWN ARROW key opens the drop-down list.

Definition at line 317 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetHorizontalExtent()

void owl::TComboBox::SetHorizontalExtent ( int horzExtent)
inlinevirtual

Set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width).

If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled.

Reimplemented from owl::TListBox.

Definition at line 536 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetItemData()

int owl::TComboBox::SetItemData ( int index,
LPARAM itemData )
inlinevirtual

Sets the 32-bit value associated with the TComboBox's item.

If an error occurs, returns a negative value.

Reimplemented from owl::TListBox.

Definition at line 593 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetItemHeight()

int owl::TComboBox::SetItemHeight ( int index,
int height )
inlinevirtual

Sets the height of the list items or the edit control portion in a combo box.

If the index or height is invalid, returns a negative value.

Reimplemented from owl::TListBox.

Definition at line 612 of file combobox.h.

References owl::TWindow::GetHandle(), owl::MkParam2(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetSelIndex()

int owl::TComboBox::SetSelIndex ( int index)
inlinevirtual

Selects a string of characters in a combo box.

index specifies the index of the string of characters in the list box to select. If the index is 0, the first line in the list box is selected. If the index is -1, the current selection is removed. If an error occurs, a negative value is returned.

Reimplemented from owl::TListBox.

Definition at line 555 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetSelString() [1/3]

int owl::TListBox::SetSelString ( const tstring & str,
int startIndex = -1 )
inline

Definition at line 109 of file listbox.h.

◆ SetSelString() [2/3]

int owl::TComboBox::SetSelString ( LPCTSTR findStr,
int startIndex = -1 )
inlinevirtual

Selects a string of characters in the associated list box and sets the contents of the associated edit control to the supplied string.

Reimplemented from owl::TListBox.

Definition at line 564 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetSelString() [3/3]

int owl::TListBox::SetSelString ( LPCTSTR findStr,
int startIndex = -1 )
virtual

For single-selection list boxes.

Forces the selection of the first item beginning with the text supplied in str that appears beyond the position (starting at 0) supplied in SearchIndex. If startIndex is -1, the entire list is searched, beginning with the first item. SetSelString returns the position of the newly selected item, or a negative value in the case of an error.

Reimplemented from owl::TListBox.

Definition at line 108 of file listbox.cpp.

References owl::TListBoxData::Select().

◆ SetSelStringExact() [1/3]

int owl::TListBox::SetSelStringExact ( const tstring & str,
int startIndex = -1 )
inline

Definition at line 57 of file listbox.h.

◆ SetSelStringExact() [2/3]

int owl::TComboBox::SetSelStringExact ( LPCTSTR find,
int startIndex = -1 )
inlinevirtual

DLN added.

Reimplemented from owl::TListBox.

Definition at line 572 of file combobox.h.

References CONST_CAST, owl::TWindow::GetHandle(), PRECONDITION, owl::TWindow::SendMessage(), and SetSelIndex().

◆ SetSelStringExact() [3/3]

int owl::TListBox::SetSelStringExact ( LPCTSTR find,
int startIndex = -1 )
inlinevirtual

Selects the item that matches the given string exactly.

DLN added

Reimplemented from owl::TListBox.

Definition at line 56 of file listbox.h.

◆ SetText() [1/2]

void owl::TComboBox::SetText ( const tstring & str)
inline

Definition at line 66 of file combobox.h.

References SetText().

◆ SetText() [2/2]

void owl::TComboBox::SetText ( LPCTSTR str)

Selects the first string in the associated list box that begins with the supplied str.

If there is no match, SetText sets the contents of the associated edit control to the supplied string and selects it.

Definition at line 249 of file combobox.cpp.

References _T, _tcslen, SetEditSel(), SetSelStringExact(), and owl::TWindow::SetWindowText().

◆ SetTextLimit()

void owl::TComboBox::SetTextLimit ( uint textlimit)

Sets the text length limit member and associated control.

Definition at line 270 of file combobox.cpp.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

◆ SetTopIndex()

int owl::TComboBox::SetTopIndex ( int index)
inlinevirtual

The system scrolls the list box contents so that either the string specified by index appears at the top of the list box or the maximum scroll range has been reached.

On success 0 is returned; on failure CB_ERR is returned.

Reimplemented from owl::TListBox.

Definition at line 514 of file combobox.h.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ SetupWindow()

void owl::TComboBox::SetupWindow ( )
protectedvirtual

Limits the amount of text that the user can enter in the combo box's edit control to the value of TextLimit minus 1.

Creates plain TWindow aliases for the children in the combo box so that TWindow can handle kill focus messages for focus support.

Reimplemented from owl::TWindow.

Reimplemented in owl::TComboBoxEx, owl::TFlatComboBox, and owl::TMemComboBox.

Definition at line 418 of file combobox.cpp.

References owl::TWindow::TWindow(), _T, owl::TWindow::GetHandle(), owl::TWindow::GetWindow(), owl::GetWindowPtr(), owl::TWindow::SetParent(), SetTextLimit(), owl::TWindow::SetupWindow(), and TRACEX.

◆ ShowList()

void owl::TComboBox::ShowList ( bool show = true)

Shows or hides the drop down or drop down list combo box depending on the value of show.

If show is true, shows the list; if show is false, hides the list.

Definition at line 312 of file combobox.cpp.

References owl::TWindow::GetWindowLong(), and owl::TWindow::SendMessage().

◆ Transfer() [1/2]

void owl::TComboBox::Transfer ( TComboBoxData & data,
TTransferDirection direction )
inline

Definition at line 133 of file combobox.h.

References Transfer().

◆ Transfer() [2/2]

uint owl::TComboBox::Transfer ( void * buffer,
TTransferDirection direction )
protectedvirtual

Transfers the items and selection of the combo box to or from a transfer buffer if tdSetData or tdGetData, respectively, is passed as the direction.

buffer is expected to point to a TComboBoxData structure.

Transfer returns the size of the TComboBoxData structure. To retrieve the size without transferring data, your application must pass tdSizeData as the direction.

Reimplemented from owl::TListBox.

Reimplemented in owl::TComboBoxEx, and owl::TMemComboBox.

Definition at line 346 of file combobox.cpp.

References AddString(), ClearList(), GetCount(), GetItemData(), owl::TArrayBase::GetItemsInContainer(), GetSelIndex(), GetString(), GetText(), SetItemData(), SetSelIndex(), SetText(), owl::tdGetData, owl::tdSetData, and owl::tdSizeData.


The documentation for this class was generated from the following files: