OWLNext  7.0
Borland's Object Windows Library for the modern age
owl::TDialog Class Reference

#include <owl/dialog.h>

Inheritance diagram for owl::TDialog:
owl::TWindow owl::TEventHandler owl::TStreamableBase ocf::TOleDialog owl::TCommonDialog owl::TDelegatedTransferDialog owl::TDialogView owl::TInputDialog owl::TPickListDialog owl::TPrinterAbortDlg owl::TPropertyPage owl::TRollDialog owl::TTransferDialog< TDataSource, TDialogBase >

Public Types

enum  THow { Next, Previous }
 Enumeration to be used when invoking the 'SetControlFocus' method. More...
 
- Public Types inherited from owl::TWindow
typedef HWND THandle
 TWindow encapsulates an HWND. More...
 
using TChildrenIterator = TChildrenIteratorTemplate< TWindow >
 
using TConstChildrenIterator = TChildrenIteratorTemplate< const TWindow >
 
using TChildrenRange = TChildrenRangeTemplate< TWindow >
 
using TConstChildrenRange = TChildrenRangeTemplate< const TWindow >
 
typedef std::pair< int, int > TScrollRange
 
- Public Types inherited from owl::TEventHandler
typedef bool(* TEqualOperator) (const TGenericTableEntry &, const TEventInfo &)
 

Public Member Functions

 TDialog (TWindow *parent, TResId resId, TModule *module=0)
 Constructor for a TDialog object. More...
 
 TDialog (TWindow *parent, const DLGTEMPLATE &dlgTemplate, TAutoDelete=AutoDelete, TModule *module=0)
 Takes an pointer to dialog template. More...
 
 TDialog (HGLOBAL hTemplate, TWindow *parent, TAutoDelete=AutoDelete, TModule *module=0)
 Invokes a TWindow constructor, passing parent and module, and calls DisableAutoCreate to prevent TDialog from being automatically created and displayed along with its parent. More...
 
 ~TDialog ()
 Destructor for a TDialog. More...
 
virtual INT_PTR DialogFunction (TMsgId, TParam1, TParam2)
 Override this to process messages within the dialog function. More...
 
virtual bool EvInitDialog (HWND hWndFocus)
 Virtual handler for WM_INITDIALOG message, called from DialogFunction() More...
 
auto Create () -> bool override
 Creates a modeless dialog box interface element associated with the TDialog object. More...
 
auto Execute () -> int override
 Creates and executes a modal dialog box interface element associated with the TDialog object. More...
 
auto DoExecute () -> int override
 Overriden TWindow virtual to modaly execute this dialog & return the result. More...
 
auto PreProcessMsg (MSG &) -> bool override
 Preprocess posted messages to provide various accelerator translations. More...
 
void CloseWindow (int retValue=IDCANCEL) override
 Overrides the virtual function defined by TWindow and conditionally shuts down the dialog box. More...
 
void Destroy (int retValue=IDCANCEL) override
 Destroys the interface element associated with the TDialog object. More...
 
TDialogAttrGetDialogAttr ()
 Return the attributes data member of TDialog. More...
 
void SetDialogAttr (TDialogAttr attr)
 Set the attributes of the dialog. More...
 
bool GetIsModal () const
 Return true if the dialog is modal. More...
 
void SetIsModal (bool ismodal)
 Set the modal data member of TDialog. More...
 
void EnableModal (bool enable=true)
 Enables emulation of executing ModalDialog box by calling BeginModal()/EndModal() More...
 
uint GetDefaultId () const
 Return the ID of the default pushbutton. More...
 
void SetDefaultId (uint id)
 Set the id of the default push button. More...
 
bool MapDialogRect (TRect &rect) const
 Converts the coordinates of the given rect from dialog units into screen units. More...
 
auto MapDialogRectToScreen (const TRect &) const -> TRect
 Returns the rect, specified in screen coordinates, corresponding to the given rect, specified in dialog coordinates. More...
 
void Reposition ()
 Reposition the dialog to ensure it is fully visible. More...
 
void SetControlFocus (HWND hwnd)
 Sets focus within a dialog to a specific control. More...
 
void SetControlFocus (THow how)
 Sets the focus to either the previous control with WS_TABSTOP, or the next control with WS_TABSTOP. More...
 
bool SetMsgResult (TResult result)
 Sets the dialog procedure message result (DWLP_MSGRESULT) and returns true. More...
 
void EvClose ()
 Message response function for WM_CLOSE by unconditionally closing the window. More...
 
void EvPaint ()
 Handler for WM_PAINT. More...
 
uint EvGetDefId ()
 Return the default Id. More...
 
bool EvSetDefId (int id)
 Set the pushbutton with identifier id the default button for the dialog. More...
 
void EvReposition ()
 Reposition the dialog so that it fits within the desktop area. More...
 
void CmOk ()
 Responds to a click on the dialog box's OK button with the identifier IDOK. More...
 
void CmCancel ()
 Responds to an incoming notification message from a button with an Id equal to IDCANCEL. More...
 
auto IdleAction (long idleCount) -> bool override
 Handle enabling and disabling of child controls. More...
 
- 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. More...
 
 TWindow (TWindow *parent, const tstring &title, TModule *module=nullptr)
 String-aware overload. More...
 
 TWindow (HWND handle, TModule *module=nullptr)
 Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias. More...
 
virtual ~TWindow ()
 Destroys this window (unless this is an alias) and the children. More...
 
TApplicationGetApplication () const
 Gets a pointer to the TApplication object associated with this. More...
 
virtual bool Register ()
 Registers the Windows registration class of this window, if this window is not already registered. More...
 
TScrollerGetScroller ()
 Returns the associated scroller object for this window. More...
 
void SetScroller (TScroller *scroller)
 Sets the scroller object for this window. More...
 
TWindowAttrGetWindowAttr ()
 Returns the TWindowAttr structure, which contains the window's creation attributes. More...
 
const TWindowAttrGetWindowAttr () const
 Returns the TWindowAttr structure, which contains the window's creation attributes. More...
 
LPCTSTR GetCaption () const
 Returns the Title member of TWindow. More...
 
virtual bool CanClose ()
 Use this function to determine if it is okay to close a window. More...
 
void ChildBroadcastMessage (TMsgId, TParam1=0, TParam2=0)
 Sends the specified message to all immediate children using SendMessage. More...
 
TResult HandleMessage (TMsgId, TParam1=0, TParam2=0)
 Dispatches the given message using the response table. More...
 
virtual TResult EvCommand (uint id, HWND hWndCtl, uint notifyCode)
 WindowProc calls EvCommand to handle WM_COMMAND messages. More...
 
virtual TResult EvNotify (uint id, TNotify &notifyInfo)
 Handles WM_NOTIFY and subdispatch messages from child controls. More...
 
TResult DefaultProcessing ()
 Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications. More...
 
virtual void Paint (TDC &dc, bool erase, TRect &rect)
 Repaints the client area (the area you can use for drawing) of a window. More...
 
void SubclassWindowFunction ()
 Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc. More...
 
void SetFlag (uint mask)
 Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member. More...
 
void ClearFlag (uint mask)
 Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member. More...
 
bool IsFlagSet (uint mask)
 Returns the state of the bit flag in Attr.Flags whose mask is supplied. More...
 
void EnableAutoCreate ()
 Ensures that an associated child window interface element is created and displayed along with its parent window. More...
 
void DisableAutoCreate ()
 Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window. More...
 
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. More...
 
void DisableTransfer ()
 Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer. More...
 
TModuleGetModule () const
 Returns a pointer to the module object. More...
 
void SetModule (TModule *module)
 Sets the default module for this window. More...
 
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
 
bool CreateChildren ()
 Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set. More...
 
void AttachHandle (HWND handle)
 
void DetachHandle ()
 
virtual bool HoldFocusHWnd (HWND hLose, HWND hGain)
 Responds to a request by a child window to hold its HWND when it is losing focus. More...
 
int GetId () const
 Returns Attr.Id, the ID used to find the window in a specified parent's child list. More...
 
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. More...
 
HWND GetParentH () const
 Return the handle of the parent. More...
 
TWindowGetParentO () const
 Return the OWL's parent for this window. More...
 
TWindowGetParent () const
 Retrieves the OWL object of the parent window. If none exists, returns 0. More...
 
virtual void SetParent (TWindow *newParent)
 Sets the parent for the specified window by setting Parent to the specified new Parent window object. More...
 
void SetNext (TWindow *next)
 Sets the next window in the sibling list. More...
 
virtual bool SetDocTitle (LPCTSTR docname, int index)
 Default behavior for updating document title is to pass it to parent frame. More...
 
bool SetDocTitle (const tstring &docname, int index)
 
void SetCaption (LPCTSTR title)
 Copies title to an allocated string pointed to by title. More...
 
void SetCaption (const tstring &title)
 
void SetCaption (uint resourceStringId)
 Sets the window title to the resource string identified by the given id. More...
 
bool SetCursor (TModule *module, TResId resId)
 Sets the mouse cursor for the window, loading the given resId from the given module. More...
 
auto GetBkgndColor () const -> TColor
 Returns the overriding background color set for the window. More...
 
void SetBkgndColor (TColor color, bool shouldUpdate=true)
 Sets the background color for the window. More...
 
auto GetTextColor () const -> TColor
 Returns the overriding text color set for the window. More...
 
void SetTextColor (TColor color, bool shouldUpdate=true)
 Sets the text color for the window. More...
 
void SetAcceleratorTable (TResId resId)
 
TResult ForwardMessage (HWND handle, bool send=true)
 Forwards the window's current message. More...
 
TResult ForwardMessage (bool send=true)
 Forwards the window's current message. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual TResult WindowProc (TMsgId, TParam1, TParam2)
 First virtual function called to handling incoming messages to a TWindow. More...
 
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. More...
 
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. More...
 
void RouteCommandEnable (HWND hInitCmdTarget, TCommandEnabler &ce)
 Walks the chain of windows from the initial target window to this window. More...
 
void SetTransferBuffer (void *transferBuffer, uint size)
 Sets TransferBuffer and TransferBufferSize. More...
 
template<class TBuffer >
void SetTransferBuffer (TBuffer *transferBuffer)
 Sets TransferBuffer and TransferBufferSize. More...
 
template<class TElement , uint Count>
void SetTransferBuffer (TElement(&transferBuffer)[Count])
 Sets TransferBuffer and TransferBufferSize. More...
 
void * GetTransferBuffer () const
 
uint GetTransferBufferSize () const
 
virtual uint Transfer (void *buffer, TTransferDirection direction)
 Transfers data to or from any window with or without children and returns the total size of the data transferred. More...
 
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) More...
 
HWND GetHandle () const
 Returns the handle of the window. More...
 
 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. More...
 
bool IsWindow () const
 Returns true if an HWND is being used. More...
 
auto GetClassName (TCHAR *className, int maxCount) const -> int
 Returns the Windows class name for this object's window handle. More...
 
long GetClassLong (int index) const
 Retrieves the 32-bit value containing information about the window class. More...
 
long SetClassLong (int index, long newLong)
 Sets the long value at the specified offset (index). More...
 
uint16 GetClassWord (int index) const
 Gets a 16-bit value containing information about the class or style of the window. More...
 
uint16 SetClassWord (int index, uint16 newWord)
 Sets the word value at the specified offset (index). More...
 
LONG_PTR GetWindowLongPtr (int index) const
 Retrieves information about the window depending on the value stored in index. More...
 
LONG_PTR SetWindowLongPtr (int index, LONG_PTR newLong)
 Changes information about the window. For a list of constants, see GetWindowLongPtr() More...
 
long GetWindowLong (int index) const
 Retrieves information about the window depending on the value stored in index. More...
 
long SetWindowLong (int index, long newLong)
 Changes information about the window. More...
 
uint16 GetWindowWord (int index) const
 Retrieves information about this window depending on the value of index. More...
 
uint16 SetWindowWord (int index, uint16 newWord)
 Changes information about the window. More...
 
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. More...
 
HANDLE GetProp (uint16 atom) const
 Returns a handle to the property list of the specified window. More...
 
HANDLE RemoveProp (uint16 atom) const
 Removes the property specified by atom from the application's property list. More...
 
bool SetProp (uint16 atom, HANDLE data) const
 Adds an item to the property list of the specified window. More...
 
HANDLE GetProp (LPCTSTR str) const
 Returns a handle to the property list of the specified window. More...
 
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. More...
 
HANDLE RemoveProp (const tstring &str) const
 
bool SetProp (LPCTSTR str, HANDLE data) const
 Adds an item to the property list of the specified window. More...
 
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. More...
 
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. More...
 
uint32 GetExStyle () const
 Gets the extra style bits of the window. More...
 
uint32 SetExStyle (uint32 style)
 Sets the extra style bits of the window. More...
 
bool ModifyStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window. More...
 
bool ModifyExStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window. More...
 
bool MoveWindow (int x, int y, int w, int h, bool repaint=false)
 Repositions the specified window. More...
 
bool MoveWindow (const TRect &rect, bool repaint=false)
 Repositions the window. More...
 
virtual bool ShowWindow (int cmdShow)
 Displays this TWindow in a given state. More...
 
void ShowOwnedPopups (bool show)
 Shows or hides all owned pop-up windows according to the value of show. More...
 
bool IsWindowVisible () const
 Returns true if the window is visible. More...
 
bool IsZoomed () const
 Returns true if window is zoomed or maximized. More...
 
bool IsIconic () const
 Returns true if window is iconic or minimized. More...
 
int GetWindowTextLength () const
 Returns the length, in characters, of the specified window's title. More...
 
int GetWindowText (TCHAR *str, int maxCount) const
 Copies the window's title into a buffer pointed to by string. More...
 
tstring GetWindowText () const
 String-aware overload. More...
 
void SetWindowText (LPCTSTR str)
 Sets the window's text to the given string (by copying). More...
 
void SetWindowText (const tstring &str)
 
void SetWindowText (uint resourceStringId)
 Sets the window title to the resource string identified by the given id. More...
 
WINDOWPLACEMENT GetWindowPlacement () const
 Wrapper for Windows API. More...
 
void SetWindowPlacement (const WINDOWPLACEMENT &place)
 Wrapper for Windows API. More...
 
virtual void Invalidate (bool erase=true)
 Invalidates (mark for painting) the entire client area of a window. More...
 
virtual void InvalidateRect (const TRect &rect, bool erase=true)
 Invalidates a specified client area. More...
 
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. More...
 
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). More...
 
void ValidateRect (const TRect &rect)
 Validates a portion of the client area indicated by rect. More...
 
void ValidateRgn (HRGN hRgn)
 Validates the client area within a region of the current window. More...
 
void UpdateWindow ()
 Updates the client area of the specified window by immediately sending a WM_PAINT message. More...
 
bool FlashWindow (bool invert)
 Changes the window from active to inactive or vice versa. More...
 
bool GetUpdateRect (TRect &rect, bool erase=true) const
 Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window. More...
 
int GetUpdateRgn (TRegion &rgn, bool erase=true) const
 Copies a window's update region into a region specified by region. More...
 
bool LockWindowUpdate (bool lock=true)
 Prevents or enables window drawing for one window at a time. More...
 
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. More...
 
auto GetWindowRgn (TRegion &) const -> int
 Obtains a copy of the region of the window within which the system permits drawing. More...
 
void ResetWindowRgn (bool repaint=false)
 Calls SetWindowRgn(nullptr, repaint). More...
 
auto SetWindowRgn (HRGN, bool repaint=false) -> bool
 Sets the area within the window where the system permits drawing. More...
 
auto SetWindowRgn (const TRegion &, bool repaint=false) -> bool=delete
 
auto SetWindowRgn (TRegion &&r, bool repaint=false) -> bool
 Overload for TRegion. More...
 
int GetDlgCtrlID () const
 Returns the ID of the control. More...
 
HWND GetDlgItem (int childId) const
 Retrieves the handle of a control specified by childId. More...
 
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. More...
 
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. More...
 
int GetDlgItemText (int childId, TCHAR *text, int maxValue) const
 Retrieves the text of a control specified by childId. More...
 
tstring GetDlgItemText (int childId) const
 String-aware overload. More...
 
void SetDlgItemText (int childId, LPCTSTR text) const
 Sets the title or text of a control in a dialog box. More...
 
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. More...
 
bool IsChild (HWND hWnd) const
 Returns true if the window is a child window or a descendant window of this window. More...
 
HWND GetNextDlgGroupItem (HWND hWndCtrl, bool previous=false) const
 Returns either the next or the previous control in the dialog box. More...
 
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). More...
 
void CheckDlgButton (int buttonId, uint check)
 Places a check mark in (or removes a check mark from) the button specified in buttonId. More...
 
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. More...
 
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. More...
 
HMENU GetMenu () const
 Returns the handle to the menu of the indicated window. More...
 
HMENU GetSystemMenu (bool revert=false) const
 Returns a handle to the system menu so that an application can access the system menu. More...
 
bool SetMenu (HMENU hMenu)
 Sets the specified window's menu to the menu indicated by hMenu. More...
 
bool HiliteMenuItem (HMENU hMenu, uint idItem, uint hilite)
 Either highlights or removes highlighting from a top-level item in the menu. More...
 
void DrawMenuBar ()
 DrawMenuBar redraws the menu bar. More...
 
bool KillTimer (UINT_PTR timerId)
 Gets rid of the timer and removes any WM_TIMER messages from the message queue. More...
 
UINT_PTR SetTimer (UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
 Creates a timer object associated with this window. More...
 
bool RegisterHotKey (int idHotKey, uint modifiers, uint virtKey)
 Registers a hotkey ID with the current application. More...
 
bool UnregisterHotKey (int idHotKey)
 Unregisters a hotkey ID with the current application. More...
 
bool WinHelp (LPCTSTR helpFile, uint command, ULONG_PTR data) const
 Invokes a specified help system. More...
 
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. More...
 
TPopupMenuGetContextMenu () const
 Returns the associated popup menu used by the window. More...
 
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). More...
 
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. More...
 
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. More...
 
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. More...
 
void DragAcceptFiles (bool accept)
 If a window can process dropped files, DragAcceptFiles sets accept to true. More...
 
TCurrentEventGetCurrentEvent ()
 Returns the current event to be processed in the message queue. More...
 
void SethAccel (HACCEL)
 
auto GetChildren ()
 Returns a TWindow::TChildrenRange that can be iterated by standard means. More...
 
auto GetChildren () const
 Const overload of TWindow::GetChildren. More...
 
TWindowNext ()
 Returns a pointer to the next sibling window in the window's sibling list. More...
 
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) More...
 
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. More...
 
auto GetFirstChild () const -> const TWindow *
 
TWindowGetLastChild ()
 Returns a pointer to the last child window in the interface object's child list. More...
 
auto GetLastChild () const -> const TWindow *
 
uint NumChildren () const
 Returns the number of child windows of the window. More...
 
bool GetScrollInfo (int bar, SCROLLINFO *scrollInfo) const
 Retrieves the properties of the given scroll bar. More...
 
SCROLLINFO GetScrollInfo (int bar, uint mask=SIF_ALL) const
 Function-style overload Returns selected properties of the given scroll bar. More...
 
int SetScrollInfo (int bar, SCROLLINFO *scrollInfo, bool redraw=true)
 Sets the properties of the given scroll bar. More...
 
int GetScrollPos (int bar) const
 Returns the thumb position in the scroll bar. More...
 
int SetScrollPos (int bar, int pos, bool redraw=true)
 Sets the thumb position in the scroll bar. More...
 
int GetScrollTrackPos (int bar) const
 Returns the thumb track position in the scroll bar. More...
 
void GetScrollRange (int bar, int &minPos, int &maxPos) const
 Returns the minimum and maximum positions in the scroll bar. More...
 
TScrollRange GetScrollRange (int bar) const
 Function-style overload. More...
 
void SetScrollRange (int bar, int minPos, int maxPos, bool redraw=true)
 Sets the thumb position in the scroll bar. More...
 
void SetScrollRange (int bar, const TScrollRange &, bool redraw=true)
 Overload taking the range as a pair. More...
 
int GetScrollPage (int bar) const
 Returns the page property (SCROLLINFO::nPage) of the given scroll bar. More...
 
void SetScrollPage (int bar, int page, bool redraw=true)
 Sets the page property (SCROLLINFO::nPage) of the given scroll bar. More...
 
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. More...
 
void ShowScrollBar (int bar, bool show=true)
 Displays or hides the scroll bar. More...
 
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. More...
 
void ScrollWindowEx (int dx, int dy, const TRect *scroll=0, const TRect *clip=0, HRGN hUpdateRgn=0, TRect *update=0, uint flags=0)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions. More...
 
void ShutDownWindow (int retVal=0)
 This inline version of ShutDownWindow calls the static version of ShutDownWindow. More...
 
TResult SendMessage (TMsgId, TParam1=0, TParam2=0) const
 Sends a message (msg) to a specified window or windows. More...
 
TResult SendDlgItemMessage (int childId, TMsgId, TParam1=0, TParam2=0)
 Sends a message (msg) to the control specified in childId. More...
 
bool PostMessage (TMsgId, TParam1=0, TParam2=0)
 Posts a message (msg) to the window in the application's message queue. More...
 
HWND SetCapture ()
 Sets the mouse capture to the current window. More...
 
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. More...
 
bool IsWindowEnabled () const
 Returns true if the window is enabled. More...
 
virtual bool EnableWindow (bool enable)
 Allows the given window to receive input from the keyboard of mouse. More...
 
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). More...
 
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. More...
 
bool CancelMouseEvent (uint flags=TME_HOVER|TME_LEAVE)
 Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag. More...
 
TRACKMOUSEEVENT QueryMouseEventTracking () const
 Returns the current state of mouse event tracking initiated by TrackMouseEvent. More...
 
void ClientToScreen (TPoint &point) const
 Converts the client coordinates specified in point to screen coordinates for the new window. More...
 
TPoint MapClientToScreen (const TPoint &p) const
 Function-style version of ClientToScreen. More...
 
void MapClientToScreen (TPoint *p, int count) const
 Maps the given points, specified in client coordinates in this window, to screen coordinates. More...
 
template<size_t Count>
void MapClientToScreen (TPoint(&p)[Count]) const
 Overload for array See MapClientToScreen(TPoint*, int). More...
 
TRect MapClientToScreen (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result. More...
 
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. More...
 
TPoint MapScreenToClient (const TPoint &p) const
 Functional-style version of ScreenToClient. More...
 
void MapScreenToClient (TPoint *p, int count) const
 Maps the given points, specified in screen coordinates, to client coordinates in this window. More...
 
template<size_t Count>
void MapScreenToClient (TPoint(&p)[Count]) const
 Overload for array See MapScreenToClient(TPoint*, int). More...
 
TRect MapScreenToClient (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result. More...
 
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. More...
 
void MapWindowPoints (const TWindow &wndTo, TPoint *p, int n) const
 Overload for TWindow See MapWindowPoints(HWND, TPoint*, int). More...
 
template<size_t Count>
void MapWindowPoints (HWND hWndTo, TPoint(&p)[Count]) const
 Overload for array See MapWindowPoints(HWND, TPoint*, int). More...
 
template<size_t Count>
void MapWindowPoints (const TWindow &wndTo, TPoint(&p)[Count]) const
 Overload for TWindow and array See MapWindowPoints(HWND, TPoint*, int). More...
 
TPoint MapWindowPoints (HWND hWndTo, const TPoint &p) const
 Functional-style overload for TPoint; converts the given point coordinates and returns the result. More...
 
TPoint MapWindowPoints (const TWindow &wndTo, const TPoint &p) const
 Overload for TWindow and TPoint See MapWindowPoints(HWND, const TPoint&). More...
 
TRect MapWindowPoints (HWND hWndTo, const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result. More...
 
TRect MapWindowPoints (const TWindow &wndTo, const TRect &r) const
 Overload for TWindow and TRect See MapWindowPoints(HWND, const TRect&). More...
 
TRect MapWindowRect (HWND hWndTo) const
 Maps the window's rectangle (GetWindowRect) to client coordinates in the given destination window. More...
 
TRect MapWindowRect (const TWindow &wndTo) const
 Overload for TWindow See MapWindowRect(HWND). More...
 
TRect MapClientRect (HWND hWndTo) const
 Maps the window's client rectangle (GetClientRect) to client coordinates in the given destination window. More...
 
TRect MapClientRect (const TWindow &wndTo) const
 Overload for TWindow See MapClientRect(HWND). More...
 
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. More...
 
TRect GetClientRect () const
 Gets the coordinates of the window's client area (the area in a window you can use for drawing). More...
 
HWND ChildWindowFromPoint (const TPoint &point) const
 Determines which of the child windows contains the point specified in TPoint. More...
 
void GetWindowRect (TRect &rect) const
 Gets the screen coordinates of the window's rectangle and copies them into rect. More...
 
TRect GetWindowRect () const
 Gets the screen coordinates of the window's rectangle. More...
 
TRect GetChildRect (HWND hWnd) const
 Returns the window rectangle of the given window, specified in this window's client coordinates. More...
 
TRect GetChildRect (const TWindow &wnd) const
 Overload for TWindow See GetChildRect(HWND). More...
 
void BringWindowToTop ()
 Brings a pop-up or child window to the top of the stack of overlapping windows and activates it. More...
 
HWND SetActiveWindow ()
 Activates a top-level window. More...
 
HWND GetLastActivePopup () const
 Returns the last active pop-up window in the list. More...
 
HWND GetNextWindow (uint dirFlag) const
 Finds the handle associated with either the next or previous window in the window manager's list. More...
 
HWND GetTopWindow () const
 Returns a handle to the top window currently owned by this parent window. More...
 
HWND GetWindow (uint cmd) const
 Returns the handle of the window that has the indicated relationship to this window. More...
 
bool SetWindowPos (HWND hWndInsertAfter, const TRect &rect, uint flags)
 Changes the size of the window pointed to by rect. More...
 
bool SetWindowPos (HWND hWndInsertAfter, int x, int y, int w, int h, uint flags)
 Set the new window position. More...
 
void CreateCaret (HBITMAP hBitmap)
 Creates a new caret for the system. More...
 
void CreateCaret (bool isGray, int width, int height)
 Create a new caret for the system with the specified shape, bitmap shade, width, and height. More...
 
void HideCaret ()
 Removes the caret from the specified display screen. More...
 
void ShowCaret ()
 Displays the caret in the specified shape in the active window at the current position. More...
 
void SetWindowFont (HFONT font, bool redraw=true)
 Sets the font that a control uses to draw text. More...
 
void SetWindowFont (const TFont &font, bool redraw=true)
 Sets the font that a control uses to draw text. More...
 
HFONT GetWindowFont ()
 Gets the font the control uses to draw text. More...
 
- 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. More...
 
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. More...
 
TResult DispatchMsg (TMsgId, uint id, TParam1, TParam2)
 Search for the event given the message and it and dispatch to the event handler if found. More...
 
- Public Member Functions inherited from owl::TStreamableBase
virtual ~TStreamableBase ()
 

Static Public Member Functions

static INT_PTR CALLBACK StdDlgProc (HWND, UINT, WPARAM, LPARAM) noexcept
 Callback procs for hooking TDialog to native window. More...
 
- 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. More...
 
static HWND GetCapture ()
 Returns the handle of the window that has captured the mouse. More...
 
static void ReleaseCapture ()
 Releases the mouse capture from this window. More...
 
static HWND GetFocus ()
 Gets a handle to the window that has the focus. More...
 
static HWND WindowFromPoint (const TPoint &point)
 Returns the handle of the window in which the specified point (point) lies. More...
 
static void AdjustWindowRect (TRect &rect, uint32 style, bool menu)
 Calculates the size of the window rectangle according to the indicated client-rectangle size. More...
 
static void AdjustWindowRectEx (TRect &rect, uint32 style, bool menu, uint32 exStyle)
 Calculates the size of a window rectangle that has an extended style. More...
 
static HWND GetActiveWindow ()
 Retrieves the handle of the active window. More...
 
static HWND GetDesktopWindow ()
 Returns a handle to the desktop window. More...
 
static uint GetCaretBlinkTime ()
 Retrieves the caret blink rate in milliseconds. More...
 
static void GetCaretPos (TPoint &point)
 Gets the position of the caret in the coordinates of the client window. More...
 
static TPoint GetCaretPos ()
 
static void SetCaretBlinkTime (uint16 milliSecs)
 Sets the caret blink rate in milliseconds. More...
 
static void SetCaretPos (int x, int y)
 Sets the position of the caret in the coordinates of the client window. More...
 
static void SetCaretPos (const TPoint &pos)
 Sets the position of the caret in the coordinates of the client window. More...
 
static void DestroyCaret ()
 DestroyCaret first checks the ownership of the caret. More...
 
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. More...
 
static TPoint GetCursorPos ()
 
static TPoint GetMessagePos ()
 

Protected Member Functions

auto PerformCreate () -> THandle override
 Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow. More...
 
void SetupWindow () override
 Overrides the virtual function defined in TWindow. More...
 
auto GetWindowClassName () -> TWindowClassName override
 Overrides the virtual function defined in TWindow and returns the name of the dialog box's default Windows class, which must be used for a modal dialog box. More...
 
void GetWindowClass (WNDCLASS &) override
 Overrides the virtual function defined in TWindow. More...
 
void RegisterChildObjects ()
 Registers WINDOW class(es) of Children. More...
 
void Init (TWindow *parent, LPCTSTR title, TModule *module)
 Common initialization in constructor. More...
 
bool PerformDlgInit ()
 Initialize dialog controls with contents of DLGINIT resources, if any. More...
 
- Protected Member Functions inherited from owl::TWindow
 TWindow ()
 Protected constructor for use by immediate virtually derived classes. More...
 
void Init (TWindow *parent, LPCTSTR title, TModule *module)
 Normal initialization of a default constructed TWindow. More...
 
void Init (TWindow *parent, const tstring &title, TModule *module)
 
void Init (HWND hWnd, TModule *module)
 Wrapper initialization of a default constructed TWindow. More...
 
void SetHandle (THandle)
 Sets the window handle in a derived class. More...
 
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. More...
 
void GetWindowTextTitle ()
 Updates the TWindow internal caption (Title) from the current window's caption. More...
 
void PerformSetupAndTransfer ()
 Ensures that the window is fully set up; then transfers data into the window. More...
 
virtual void CleanupWindow ()
 Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an opportunity to clean up HWND related resources. More...
 
void DispatchScroll (uint scrollCode, uint thumbPos, HWND hWndCtrl)
 Called by EvHScroll and EvVScroll to dispatch messages from scroll bars. More...
 
void LoadAcceleratorTable ()
 Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable). More...
 
virtual void RemoveChild (TWindow *child)
 Removes a child window. More...
 
TWindowGetWindowPtr (HWND hWnd) const
 Calls TApplication:GetWindowPtr on the application associated with this window. More...
 
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. More...
 
bool EvCreate (CREATESTRUCT &)
 Response method for an incoming WM_CREATE message. More...
 
void EvDestroy ()
 Responds to an incoming WM_DESTROY message. More...
 
int EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &compareInfo)
 Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself. More...
 
void EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &deleteInfo)
 Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself. More...
 
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. More...
 
void EvHScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_HSCROLL message. More...
 
void EvVScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_VSCROLL message. More...
 
void EvMove (const TPoint &clientOrigin)
 Save the normal position of the window. More...
 
void EvNCDestroy ()
 Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element. More...
 
bool EvQueryEndSession (uint flags)
 Respond to Windows attempt to close down. More...
 
void EvSize (uint sizeType, const TSize &size)
 Response method for an incoming WM_SIZE message. More...
 
void EvLButtonDown (uint modKeys, const TPoint &point)
 Response method for an incoming WM_LBUTTONDOWN message. More...
 
bool EvEraseBkgnd (HDC)
 Handler for WM_ERASEBKGND. More...
 
void EvPaint ()
 Response method for an incoming WM_PAINT message. More...
 
void EvSysColorChange ()
 Respond to WM_SYSCOLORCHANGE by broadcasting it to all children. More...
 
void EvChildInvalid (HWND hWnd)
 Handle message posted to us by a control needing assistance in dealing with invalid inputs. More...
 
void EvCompacting (uint compactRatio)
 The default message handler for WM_COMPACTING. More...
 
void EvDevModeChange (LPCTSTR devName)
 The default message handler for WM_DEVMODECHANGE. More...
 
void EvEnable (bool enabled)
 The default message handler for WM_ENABLE. More...
 
void EvEndSession (bool endSession, uint flags)
 Provides default handling for WM_ENDSESSION. More...
 
void EvFontChange ()
 The default message handler for WM_FONTCHANGE. More...
 
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. More...
 
void EvTimeChange ()
 The default message handler for WM_TIMECHANGE. More...
 
void EvTimer (uint timerId)
 The default message handler for WM_TIMER. More...
 
void EvSettingChange (uint flags, LPCTSTR section)
 
void EvActivate (uint active, bool minimized, HWND hWndOther)
 Default message handler for WM_ACTIVATE. More...
 
void EvActivateApp (bool active, DWORD threadId)
 The default message handler for WM_ACTIVATEAPP. More...
 
void EvCancelMode ()
 The default message handler for WM_CANCELMODE. More...
 
void EvGetMinMaxInfo (MINMAXINFO &minmaxinfo)
 The default message handler for WM_GETMINMAXINFO. More...
 
int EvGetText (int bufSize, TCHAR *buf)
 The default message handler for WM_GETTEXT. More...
 
int EvGetTextLength ()
 The default message handler for WM_GETTEXTLENGTH. More...
 
void EvKillFocus (HWND hWndGetFocus)
 Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later. More...
 
uint EvMouseActivate (HWND hTopLevel, uint hitCode, TMsgId)
 The default message handler for WM_MOUSEACTIVATE. More...
 
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. More...
 
HICON EvQueryDragIcon ()
 The default message handler for WM_QUERYDRAGICON. More...
 
bool EvQueryOpen ()
 The default message handler for WM_QUERYOPEN. More...
 
void EvQueueSync ()
 The default message handler for WM_QUEUESYNC. More...
 
bool EvSetCursor (HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)
 Response method for an incoming WM_SETCURSOR message. More...
 
void EvSetFocus (HWND hWndLostFocus)
 The default message handler for WM_SETFOCUS. More...
 
HFONT EvGetFont ()
 The default message handler for WM_GETFONT. More...
 
void EvSetFont (HFONT hFont, bool redraw)
 The default message handler for WM_SETFONT. More...
 
void EvSetRedraw (bool redraw)
 The default message handler for WM_SETREDRAW. More...
 
void EvSetText (LPCTSTR text)
 The default message handler for WM_SETTEXT. More...
 
void EvShowWindow (bool show, uint status)
 The default message handler for WM_SHOWWINDOW. More...
 
void EvWindowPosChanged (const WINDOWPOS &windowPos)
 The default message handler for WM_WINDOWPOSCHANGED. More...
 
bool EvWindowPosChanging (WINDOWPOS &)
 The default message handler for WM_WINDOWPOSCHANGING. More...
 
HBRUSH EvCtlColor (HDC hDC, HWND hWndChild, uint ctlType)
 Handler for control color messages (WM_CTLCOLOR family). More...
 
void EvChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_CHAR. More...
 
void EvDeadChar (uint deadKey, uint repeatCount, uint flags)
 The default message handler for WM_DEADCHAR. More...
 
void EvKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYDOWN. More...
 
void EvKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYUP. More...
 
void EvSysChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSCHAR. More...
 
void EvSysDeadChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSDEADCHAR. More...
 
void EvSysKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYDOWN. More...
 
void EvSysKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYUP. More...
 
void EvLButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONDBLCLK. More...
 
void EvLButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONUP. More...
 
void EvMButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDBLCLK. More...
 
void EvMButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDOWN. More...
 
void EvMButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONUP. More...
 
void EvMouseMove (uint modKeys, const TPoint &point)
 The default message handler for WM_MOUSEMOVE. More...
 
void EvMouseHWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEHWHEEL. More...
 
void EvMouseWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEWHEEL. More...
 
void EvRButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDBLCLK. More...
 
void EvRButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDOWN. More...
 
void EvRButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONUP. More...
 
void EvInitMenu (HMENU hMenu)
 The default message handler for WM_INITMENU. More...
 
void EvInitMenuPopup (HMENU hPopupMenu, uint index, bool isSysMenu)
 Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items. More...
 
int32 EvMenuChar (uint nChar, uint menuType, HMENU hMenu)
 The default message handler for WM_MENUCHAR. More...
 
void EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu)
 The default message handler for WM_MENUSELECT. More...
 
void EvContextMenu (HWND childHwnd, int x, int y)
 The default message handler for WM_CONTEXTMENU. More...
 
uint EvGetDlgCode (const MSG *msg)
 The default message handler for WM_GETDLGCODE. More...
 
void EvEnterIdle (uint source, HWND hWndDlg)
 The default message handler for WM_ENTERIDLE. More...
 
void EvSpoolerStatus (uint jobStatus, uint jobsLeft)
 The default message handler for WM_SPOOLERSTATUS. More...
 
void EvAskCBFormatName (uint bufLen, TCHAR *buffer)
 The default message handler for WM_ASKCBFORMATNAME. More...
 
void EvChangeCBChain (HWND hWndRemoved, HWND hWndNext)
 The default message handler for WM_CHANGECBCHAIN. More...
 
void EvDrawClipboard ()
 The default message handler for WM_DRAWCLIPBOARD. More...
 
void EvDestroyClipboard ()
 The default message handler for WM_DESTROYCLIPBOARD. More...
 
void EvHScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_HSCROLLCLIPBOARD. More...
 
void EvPaintClipboard (HWND hWnd, const PAINTSTRUCT &)
 The default message handler for WM_PAINTCLIPBOARD. More...
 
void EvRenderAllFormats ()
 The default message handler for WM_RENDERALLFORMATS. More...
 
void EvRenderFormat (uint dataFormat)
 The default message handler for WM_RENDERFORMAT. More...
 
void EvSizeClipboard (HWND hWndViewer, const TRect &)
 The default message handler for WM_SIZECLIPBOARD. More...
 
void EvVScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_VSCROLLCLIPBOARD. More...
 
void EvPaletteChanged (HWND hWndPalChg)
 The default message handler for WM_PALETTECHANGED. More...
 
void EvPaletteIsChanging (HWND hWndPalChg)
 The default message handler for WM_PALETTEISCHANGING. More...
 
bool EvQueryNewPalette ()
 The default message handler for WM_QUERYNEWPALETTE. More...
 
void EvDropFiles (TDropInfo dropInfo)
 The default message handler for WM_DROPFILES. More...
 
int EvCharToItem (uint ch, HWND hWndListBox, int caretIndex)
 The default message handler for WM_CHARTOITEM. More...
 
int EvVKeyToItem (uint key, HWND hWndListBox, int caretIndex)
 The default message handler for WM_VKEYTOITEM. More...
 
bool EvNCActivate (bool active)
 The default message handler for WM_NCACTIVATE. More...
 
uint EvNCCalcSize (bool calcValidRects, NCCALCSIZE_PARAMS &)
 The default message handler for WM_NCCALCSIZE. More...
 
bool EvNCCreate (CREATESTRUCT &)
 The default message handler for WM_NCCREATE. More...
 
uint EvNCHitTest (const TPoint &)
 The default message handler for WM_NCHITTEST. More...
 
void EvNCLButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDBLCLK. More...
 
void EvNCLButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDOWN. More...
 
void EvNCLButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONUP. More...
 
void EvNCMButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDBLCLK. More...
 
void EvNCMButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDOWN. More...
 
void EvNCMButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONUP. More...
 
void EvNCMouseMove (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMOUSEMOVE. More...
 
void EvNCPaint (HRGN)
 The default message handler for WM_NCPAINT. More...
 
void EvNCRButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDBLCLK. More...
 
void EvNCRButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDOWN. More...
 
void EvNCRButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONUP. More...
 
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. More...
 

Additional Inherited Members

- 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. More...
 

Detailed Description

Typically used to obtain information from a user, a dialog box is a window inside of which other controls such as buttons and scroll bars can appear. Unlike actual child windows which can only be displayed in the parent window's client area, dialog boxes can be moved anywhere on the screen. TDialog objects represent both modal and modeless dialog box interface elements. (A modal dialog box disables operations in its parent window while it is open, and, thus, lets you function in only one window "mode.")

A TDialog object has a corresponding resource definition that describes the placement and appearance of its controls. The identifier of this resource definition is supplied to the constructor of the TDialog object. A TDialog object is associated with a modal interface element by calling its Execute member function and with a modeless interface element by calling its Create member function.

You can use TDialog to build an application that uses a dialog as its main window by constructing your dialog as a TDialog and passing it as the client of a TFrameWindow. Your code might look something like this:

SetMainWindow(new TFrameWindow(0, "title" new TDialog(0, IDD_MYDIALOG)));

TDialog is a streamable class.

ObjectWindows also encapsulates common dialog boxes that let the user select font, file name, color, print options, and so on. TCommonDialog is the parent class for this group of common dialog box classes.

Definition at line 85 of file dialog.h.

Member Enumeration Documentation

◆ THow

Enumeration to be used when invoking the 'SetControlFocus' method.

It specifies whether focus should be set to the next or previous sibling of the current control with focus.

Enumerator
Next 

Set focus to the next sibling.

Previous 

Set focus to the previous sibling.

Definition at line 149 of file dialog.h.

Constructor & Destructor Documentation

◆ TDialog() [1/3]

owl::TDialog::TDialog ( TWindow parent,
TResId  resId,
TModule module = 0 
)

Constructor for a TDialog object.

Takes an TResId for its template name or numeric Id Invokes a TWindow constructor, passing parent and module, and calls DisableAutoCreate to prevent TDialog from being automatically created and displayed along with its parent. TDialog then initializes the caption to 0 and sets TDialogAttr.Name using the dialog box's integer or string resource identifier which must correspond to a dialog resource definition in the resource file. Note that resId may be 0, e.g. when TDialog encapsulates a common dialog.

Finally, it initializes TDialogAttr.Param to 0 and clear the flag dfIsModal, and if OWL5_COMPAT is defined IsModal is set to false.

Definition at line 103 of file dialog.cpp.

References DialogAttr, Init(), owl::TResIdT< T >::IsString(), owl::TDialogAttr::Name, and strnewdup().

◆ TDialog() [2/3]

owl::TDialog::TDialog ( TWindow parent,
const DLGTEMPLATE &  dlgTemplate,
TAutoDelete  del = AutoDelete,
TModule module = 0 
)
explicit

Takes an pointer to dialog template.

Invokes a TWindow constructor, passing parent and module, and calls DisableAutoCreate to prevent TDialog from being automatically created and displayed along with its parent. TDialog then initializes the caption to 0 and sets TDialogAttr.Name using DLGTEMPLATE*.

Finally, it initializes TDialogAttr.Param to 0 and clear the flag dfIsModal, and if OWL5_COMPAT is defined IsModal is set to false.

Definition at line 124 of file dialog.cpp.

References owl::AutoDelete, DialogAttr, Init(), owl::TDialogAttr::Name, and owl::TWindow::SetFlag().

◆ TDialog() [3/3]

owl::TDialog::TDialog ( HGLOBAL  hTemplate,
TWindow parent,
TAutoDelete  del = AutoDelete,
TModule module = 0 
)
explicit

Invokes a TWindow constructor, passing parent and module, and calls DisableAutoCreate to prevent TDialog from being automatically created and displayed along with its parent.

TDialog then initializes the caption to 0 and sets TDialogAttr.Name using DLGTEMPLATE*.

Finally, it initializes TDialogAttr.Param to 0 and clear the flag dfIsModal, and if OWL5_COMPAT is defined IsModal is set to false.

Definition at line 141 of file dialog.cpp.

References owl::AutoDelete, DialogAttr, Init(), owl::TDialogAttr::Name, PRECONDITION, and owl::TWindow::SetFlag().

◆ ~TDialog()

owl::TDialog::~TDialog ( )

Destructor for a TDialog.

If DialogAttr.Name is a string and not an integer resource identifier, this destructor frees memory allocated to DialogAttr.Name, which holds the name of the dialog box.

Definition at line 187 of file dialog.cpp.

References dfTmplDelMask, dfTmplMask, DialogAttr, owl::TWindow::IsFlagSet(), owl::TResIdT< T >::IsString(), and owl::TDialogAttr::Name.

Member Function Documentation

◆ CloseWindow()

void owl::TDialog::CloseWindow ( int  retValue = IDCANCEL)
overridevirtual

Overrides the virtual function defined by TWindow and conditionally shuts down the dialog box.

If the dialog box is modeless, it calls TWindow::CloseWindow(), passing retValue.

If the dialog box is modal, it calls CanClose(). If CanClose() returns true, CloseWindow() calls TransferData() to transfer dialog box data, and shuts down, passing retValue.

Note
The default value of retValue is IDCANCEL.

Reimplemented from owl::TWindow.

Definition at line 853 of file dialog.cpp.

References owl::TWindow::CanClose(), owl::TWindow::CloseWindow(), Destroy(), owl::TWindow::IsFlagSet(), owl::tdGetData, and owl::TWindow::TransferData().

◆ CmCancel()

void owl::TDialog::CmCancel ( )

Responds to an incoming notification message from a button with an Id equal to IDCANCEL.

Unconditionally destroys the window.

Definition at line 923 of file dialog.cpp.

References EvClose().

◆ CmOk()

void owl::TDialog::CmOk ( )

Responds to a click on the dialog box's OK button with the identifier IDOK.

Calls CloseWindow, passing IDOK.

Definition at line 910 of file dialog.cpp.

References CloseWindow(), owl::TApplication::Condemn(), owl::TWindow::GetApplication(), owl::TWindow::GetHandle(), owl::TWindow::IsFlagSet(), and owl::wfDeleteOnClose.

◆ Create()

bool owl::TDialog::Create ( ) -> bool
overridevirtual

Creates a modeless dialog box interface element associated with the TDialog object.

Registers all the dialog's child windows for custom control support. Calls PerformCreate to perform the actual creation of the dialog box. Create returns true if successful. If unsuccessful, Create throws a TXInvalidWindow exception.

Reimplemented from owl::TWindow.

Reimplemented in owl::TPropertyPage.

Definition at line 490 of file dialog.cpp.

References _T, CHECK, owl::TWindow::ClearFlag(), owl::TWindow::GetApplication(), owl::TWindow::GetHandle(), owl::TWindow::GetHWndState(), owl::TWindow::LoadAcceleratorTable(), PerformCreate(), PRECONDITION, owl::TXWindow::Raise(), owl::TWindow::Register(), RegisterChildObjects(), owl::TApplication::ResumeThrow(), owl::TWindow::SetHandle(), and WARNX.

◆ Destroy()

void owl::TDialog::Destroy ( int  retValue = IDCANCEL)
overridevirtual

Destroys the interface element associated with the TDialog object.

If the element is a modeless dialog box or enabled Emulation of ModlaDialog , Destroy calls TWindow::Destroy. If the element is a modal dialog box, Destroy calls EnableAutoCreate on all child windows. Then Destroy calls the Windows function ::EndDialog, passing retValue as the value returned to indicate the result of the dialog's execution. The default retValue is IDCANCEL.

Reimplemented from owl::TWindow.

Definition at line 887 of file dialog.cpp.

References owl::TWindow::Destroy(), owl::TWindow::GetChildren(), owl::TWindow::GetHandle(), and owl::TWindow::IsFlagSet().

◆ DialogFunction()

INT_PTR owl::TDialog::DialogFunction ( TMsgId  msg,
TParam1  param1,
TParam2  param2 
)
virtual

Override this to process messages within the dialog function.

The default dialog function.

For most messages, 1 should be returned if the message is handled, and 0 if it is not. Some special messages require a message-specific return value other than this: WM_CHARTOITEM, WM_COMPAREITEM, WM_CTL*, WM_INITDIALOG, WM_QUERYDRAGICON and WM_VKEYTOITEM. See the Windows API documentation for details.

Handles the two mesages, WM_INITDIALOG and WM_SETFONT that may be passed to us without sending, or sent before we get a chance to thunk DIALOG's window proc. EvInitDialog() is called as a virtual function, while EvSetFont() is dispatched to. To process messages within the dialog function, your application must override this function. DialogFunction returns true if the message is handled and false if the message is not handled.

Reimplemented in owl::TPrintDialog, owl::TOpenSaveDialog, owl::TChooseFontDialog, owl::TFindReplaceDialog, owl::TChooseColorDialog, owl::TPropertyPage, owl::TDvFileSaveDialog, and owl::TDvFileOpenDialog.

Definition at line 353 of file dialog.cpp.

References _T, owl::TEventHandler::Dispatch(), EvInitDialog(), owl::TEventHandler::Find(), owl::TWindow::GetApplication(), owl::TWindow::GetCurrentEvent(), owl::TWindow::GetHandle(), owl::TWindow::IsFlagSet(), owl::TCurrentEvent::Message, owl::TCurrentEvent::Param1, owl::TCurrentEvent::Param2, Previous, SetMsgResult(), TRACEX, owl::wfFullyCreated, and owl::TCurrentEvent::Win.

◆ DoExecute()

int owl::TDialog::DoExecute ( ) -> int
overridevirtual

Overriden TWindow virtual to modaly execute this dialog & return the result.

DoExecute is called by Execute() to perform the actual execution of a modal dialog box. If enabled Emulation of ModalDialog it calls TWindow::DoExecute().

Reimplemented from owl::TWindow.

Reimplemented in owl::TOpenSaveDialog, owl::TPrintDialog, owl::TFileSaveDialog, and owl::TFileOpenDialog.

Definition at line 632 of file dialog.cpp.

References _T, dfTmplMask, DialogAttr, owl::TWindow::DoExecute(), owl::TModule::GetHandle(), owl::TWindow::GetHandle(), owl::TWindow::GetModule(), owl::TWindow::GetParent(), owl::TWindow::IsFlagSet(), owl::TDialogAttr::Name, owl::TDialogAttr::Param, StdDlgProc(), and WARN.

◆ EnableModal()

void owl::TDialog::EnableModal ( bool  enable = true)
inline

Enables emulation of executing ModalDialog box by calling BeginModal()/EndModal()

Definition at line 343 of file dialog.h.

References owl::TWindow::ClearFlag(), and owl::TWindow::SetFlag().

◆ EvClose()

void owl::TDialog::EvClose ( )

Message response function for WM_CLOSE by unconditionally closing the window.

Definition at line 933 of file dialog.cpp.

References owl::TApplication::Condemn(), owl::TWindow::DefaultProcessing(), Destroy(), owl::TWindow::GetApplication(), owl::TWindow::GetHandle(), owl::TWindow::IsFlagSet(), owl::wfAlias, and owl::wfDeleteOnClose.

◆ EvGetDefId()

uint owl::TDialog::EvGetDefId ( )

Return the default Id.

High word must be DC_HASDEFID. Calls the DefaultProcessing() function. Returns the result.

Definition at line 315 of file dialog.cpp.

References owl::TWindow::DefaultProcessing().

◆ EvInitDialog()

bool owl::TDialog::EvInitDialog ( HWND  hWndFocus)
virtual

Virtual handler for WM_INITDIALOG message, called from DialogFunction()

Virtual handler for WM_INITDIALOG message, called from DialogFunction() just before the dialog box is displayed.

Performs any setup required for the dialog box or its controls.

Definition at line 803 of file dialog.cpp.

References DialogAttr, owl::TWindow::GetHWndState(), owl::TDialogAttr::Name, PerformDlgInit(), owl::TWindow::PerformSetupAndTransfer(), and owl::TXWindow::Raise().

◆ EvPaint()

void owl::TDialog::EvPaint ( )

Handler for WM_PAINT.

Rerout this message back to the underlying dialog to keep TWindow::EvPaint from eating it. EvPaint calls TWindow's general-purpose default processing function, DefaultProcessing, for Windows-supplied painting.

Definition at line 303 of file dialog.cpp.

References owl::TWindow::DefaultProcessing().

◆ EvReposition()

void owl::TDialog::EvReposition ( )

Reposition the dialog so that it fits within the desktop area.

Definition at line 335 of file dialog.cpp.

References owl::TWindow::DefaultProcessing().

◆ EvSetDefId()

bool owl::TDialog::EvSetDefId ( int  id)

Set the pushbutton with identifier id the default button for the dialog.

Calls the DefaultProcessing function. Returns the result (type cast to boolean).

Definition at line 326 of file dialog.cpp.

References owl::TWindow::DefaultProcessing().

◆ Execute()

int owl::TDialog::Execute ( ) -> int
overridevirtual

Creates and executes a modal dialog box interface element associated with the TDialog object.

If the element is successfully associated, Execute does not return until the TDialog is closed.

Execute performs the following tasks:

  1. Registers this dialog's window class and all of the dialog's child windows.
  2. Calls TDialog::DoExecute to execute the dialog box.

Execute returns an integer value that indicates how the user closed the modal dialog box. This will normally be IDOK or IDCANCEL, but the value may be customized by derived dialog classes.

If the dialog class cannot be registered (TWindow::Register returns false), or the execution of the dialog fails (TDialog::DoExecute returns -1), then Execute throws the TXWindow exception.

Note
Derived dialog classes may need to communicate errors apart from window creation failure. The derived class may throw other exceptions, return other error codes, or set custom error states. For example, the classes TFileOpenDialog and TFileSaveDialog will set the associated TOpenSaveDialog::TData::Error state to indicate any errors, such as buffer overflow. In general, client code should be aware of any error handling defined by the derived class. Do not assume that a return value of IDOK means success.

For example:

TOpenSaveDialog::TData data{...};
TFileOpenDialog dlg{this, data};
const auto r = dlg.Execute();
if (data.Error != 0)
{
// ...Handle error...
}
else if (r == IDOK)
{
// ...Open file...
}

Reimplemented from owl::TWindow.

Definition at line 595 of file dialog.cpp.

References DoExecute(), owl::TWindow::GetApplication(), owl::TWindow::GetHandle(), PRECONDITION, owl::TXWindow::Raise(), owl::TWindow::Register(), RegisterChildObjects(), owl::TApplication::ResumeThrow(), and owl::TWindow::SetFlag().

◆ GetDefaultId()

uint owl::TDialog::GetDefaultId ( ) const
inline

Return the ID of the default pushbutton.

Definition at line 293 of file dialog.h.

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

◆ GetDialogAttr()

TDialogAttr & owl::TDialog::GetDialogAttr ( )
inline

Return the attributes data member of TDialog.

Definition at line 303 of file dialog.h.

References DialogAttr.

◆ GetIsModal()

bool owl::TDialog::GetIsModal ( ) const
inline

Return true if the dialog is modal.

Definition at line 321 of file dialog.h.

References CONST_CAST.

◆ GetWindowClass()

void owl::TDialog::GetWindowClass ( WNDCLASS &  wndClass)
overrideprotectedvirtual

Overrides the virtual function defined in TWindow.

Fills WndClass with TDialog registration attributes obtained from an existing TDialog window

If the class style is registered with CS_GLOBALCLASS, you must unregister the class style. You can do this by turning off the style bit. For example:

{
baseclass::GetWindowClass(wndClass);
....
WndClass.style &= ~CS_GLOBALCLASS:
...
}

Reimplemented from owl::TWindow.

Definition at line 271 of file dialog.cpp.

References CHECK, owl::TWindow::GetApplication(), owl::TModule::GetClassInfo(), owl::TUser::GetClassInfo(), owl::TWindow::GetModule(), and GetWindowClassName().

◆ GetWindowClassName()

auto owl::TDialog::GetWindowClassName ( ) -> TWindowClassName
overrideprotectedvirtual

Overrides the virtual function defined in TWindow and returns the name of the dialog box's default Windows class, which must be used for a modal dialog box.

For a modeless dialog box, GetWindowClassName returns the name of the default TWindow.

Reimplemented from owl::TWindow.

Definition at line 245 of file dialog.cpp.

◆ IdleAction()

bool owl::TDialog::IdleAction ( long  idleCount) -> bool
overridevirtual

Handle enabling and disabling of child controls.

If idleCount is 0, iterates over each child control and routes the command enabler.

Does not rely on an OWL interface object to work. Returns false.

Reimplemented from owl::TWindow.

Reimplemented in ocf::TOleDialog.

Definition at line 995 of file dialog.cpp.

References owl::TWindow::GetWindow(), owl::TWindow::GetWindowLong(), owl::TWindow::IdleAction(), owl::TWindow::IsWindow(), and owl::TWindow::RouteCommandEnable().

◆ Init()

void owl::TDialog::Init ( TWindow parent,
LPCTSTR  title,
TModule module 
)
protected

Common initialization in constructor.

Common initialization in constructoe.

Definition at line 156 of file dialog.cpp.

References owl::TWindow::ClearFlag(), DialogAttr, owl::TWindow::DisableAutoCreate(), owl::TWindow::Init(), owl::TDialogAttr::Name, owl::TDialogAttr::Param, owl::TWindow::SetFlag(), owl::wfDeleteOnClose, and owl::wfFromResource.

◆ MapDialogRect()

bool owl::TDialog::MapDialogRect ( TRect rect) const
inline

Converts the coordinates of the given rect from dialog units into screen units.

Definition at line 362 of file dialog.h.

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

◆ MapDialogRectToScreen()

auto owl::TDialog::MapDialogRectToScreen ( const TRect rDialog) const -> TRect

Returns the rect, specified in screen coordinates, corresponding to the given rect, specified in dialog coordinates.

Throws TXOWl on failure.

Definition at line 1016 of file dialog.cpp.

References _T.

◆ PerformCreate()

TWindow::THandle owl::TDialog::PerformCreate ( ) -> THandle
overrideprotectedvirtual

Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow.

Creates the dialgo using either a resource id or dialog template.

Reimplemented from owl::TWindow.

Reimplemented in owl::TReplaceDialog, owl::TFindDialog, and owl::TFindReplaceDialog.

Definition at line 533 of file dialog.cpp.

References dfTmplMask, DialogAttr, owl::TWindow::GetHandle(), owl::TWindow::GetModule(), owl::TWindow::GetParentO(), owl::TWindow::IsFlagSet(), owl::TDialogAttr::Name, owl::TDialogAttr::Param, PRECONDITION, and StdDlgProc().

◆ PerformDlgInit()

bool owl::TDialog::PerformDlgInit ( )
protected

Initialize dialog controls with contents of DLGINIT resources, if any.

Performs resource-directed initialization of controls.

Uses the DLGINIT resource with an id matching this dialog's as structured message packets to send to controls. Initializes the dialog box controls with the contents of DLGINIT, the dialog box resource identifier, which describes the appearance and location of the controls (buttons, group boxes, and so on). Returns true if successful, or no DLGINIT resource was found; otherwise returns false.

Definition at line 659 of file dialog.cpp.

References _A2W, _T, _USES_CONVERSION, dfTmplMask, DialogAttr, owl::TModule::FindResource(), owl::TModule::FindResourceEx(), owl::TWindow::GetApplication(), owl::TWindow::GetDlgItemText(), owl::TWindow::GetModule(), IFDIAG, owl::TWindow::IsFlagSet(), owl::TModule::LoadResource(), owl::TDialogAttr::Name, owl::TApplication::ResumeThrow(), owl::TWindow::SendDlgItemMessage(), owl::TWindow::SetDlgItemText(), TRACE, and WARNX.

◆ PreProcessMsg()

bool owl::TDialog::PreProcessMsg ( MSG &  msg) -> bool
overridevirtual

Preprocess posted messages to provide various accelerator translations.

Overrides the virtual function defined by TWindow in order to perform preprocessing of window messages. If the child window has requested keyboard navigation, PreProcessMsg handles any accelerator key messages and then processes any other keyboard messages.

Reimplemented from owl::TWindow.

Reimplemented in ocf::TOleDialog.

Definition at line 217 of file dialog.cpp.

References owl::TWindow::GetHandle(), owl::TWindow::GetParent(), owl::TWindow::GetParentH(), owl::TWindow::PreProcessMsg(), and owl::TWindow::SendMessage().

◆ RegisterChildObjects()

void owl::TDialog::RegisterChildObjects ( )
protected

Registers WINDOW class(es) of Children.

Register all the dialog's child objects (for custom control support)

Definition at line 475 of file dialog.cpp.

References owl::TWindow::GetChildren().

◆ Reposition()

void owl::TDialog::Reposition ( )
inline

Reposition the dialog to ensure it is fully visible.

Definition at line 372 of file dialog.h.

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

◆ SetControlFocus() [1/2]

void owl::TDialog::SetControlFocus ( HWND  hwnd)

Sets focus within a dialog to a specific control.

Definition at line 1028 of file dialog.cpp.

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

◆ SetControlFocus() [2/2]

void owl::TDialog::SetControlFocus ( THow  how)

Sets the focus to either the previous control with WS_TABSTOP, or the next control with WS_TABSTOP.

Definition at line 1040 of file dialog.cpp.

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

◆ SetDefaultId()

void owl::TDialog::SetDefaultId ( uint  id)
inline

Set the id of the default push button.

Definition at line 352 of file dialog.h.

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

◆ SetDialogAttr()

void owl::TDialog::SetDialogAttr ( TDialogAttr  attr)
inline

Set the attributes of the dialog.

Definition at line 312 of file dialog.h.

References DialogAttr.

◆ SetIsModal()

void owl::TDialog::SetIsModal ( bool  ismodal)
inline

Set the modal data member of TDialog.

Definition at line 330 of file dialog.h.

References owl::TWindow::ClearFlag(), and owl::TWindow::SetFlag().

◆ SetMsgResult()

bool owl::TDialog::SetMsgResult ( TResult  result)
inline

Sets the dialog procedure message result (DWLP_MSGRESULT) and returns true.

Set the result of the message for the dialog's WndProc.

Definition at line 282 of file dialog.h.

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

◆ SetupWindow()

void owl::TDialog::SetupWindow ( )
overrideprotectedvirtual

Overrides the virtual function defined in TWindow.

Sets up the dialog box by calling SetCaption and TWindow::SetupWindow.

Calling SetCaption here allows us to override the dialog caption (specified in the dialog resource) by calling SetCaption prior to this point. If the caption is not yet initialised, and the dialog is created from a resource, we sync the caption with the window text title.

Reimplemented from owl::TWindow.

Reimplemented in owl::TPickListDialog, ocf::TOleDialog, owl::TPrinterAbortDlg, owl::TRollDialog, and owl::TInputDialog.

Definition at line 825 of file dialog.cpp.

References owl::TWindow::GetApplication(), owl::TWindow::GetCaption(), owl::TWindow::GetWindowTextTitle(), owl::TWindow::IsFlagSet(), owl::TWindow::SetCaption(), owl::TWindow::SetupWindow(), and owl::wfFromResource.

◆ StdDlgProc()

INT_PTR CALLBACK owl::TDialog::StdDlgProc ( HWND  hDlg,
UINT  msg,
WPARAM  param1,
LPARAM  param2 
)
staticnoexcept

Callback procs for hooking TDialog to native window.

Handles messages that come from the window procedure of dialogs (WC_DIALOG's wndProc).

If DlgCreationWindow is not 0, then msg is destined for DlgCreationWindow. When StdDlgProc first receives a message, it checks to see if it needs to associate the global C++ variable DlgCreationWindow with the one passed in HWND. If it needs to do that, it will then subclass the window procedure. It calls the virtual DialogFunction() to handle specific messages, mostly for the startup sequence. Any exception within this function is suspended by TApplication::SuspendThrow.

Definition at line 440 of file dialog.cpp.

References _T, DialogFunction(), owl::TAppDictionary::GetApplication(), owl::GetWindowPtr(), owl::OWLGetAppDictionary(), owl::TWindow::SetHandle(), owl::TWindow::SubclassWindowFunction(), owl::TApplication::SuspendThrow(), and TRACEX.

Member Data Documentation

◆ Attr

TDialogAttr owl::TDialog::Attr

Old name.

Definition at line 210 of file dialog.h.

◆ DialogAttr

TDialogAttr owl::TDialog::DialogAttr

New name.

Definition at line 211 of file dialog.h.


The documentation for this class was generated from the following files:
owl::TDialog::TDialog
TDialog(TWindow *parent, TResId resId, TModule *module=0)
Constructor for a TDialog object.
Definition: dialog.cpp:103