9#if !defined(OWL_DIALOG_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
66 void Enable(
bool enable =
true);
111 auto Create() ->
bool override;
113#if defined(OWL5_COMPAT)
115 virtual HWND DoCreate();
119 auto Execute() ->
int override;
125 void CloseWindow(
int retValue = IDCANCEL)
override;
126 void Destroy(
int retValue = IDCANCEL)
override;
153 void SetControlFocus(HWND hwnd);
154 void SetControlFocus(THow how);
159 bool SetMsgResult(
TResult result);
166 bool EvSetDefId(
int id);
174#if defined(OWL5_COMPAT)
183 static INT_PTR CALLBACK StdDlgProc(HWND, UINT, WPARAM, LPARAM)
noexcept;
187 auto IdleAction(
long idleCount) ->
bool override;
192 auto PerformCreate() -> THandle
override;
193 void SetupWindow()
override;
195 void GetWindowClass(WNDCLASS&)
override;
199 void RegisterChildObjects();
206 bool PerformDlgInit();
214#if defined(OWL5_COMPAT)
224 dfNoDeleteHandle = 0x010000L,
225 dfDeleteHandle = 0x020000L,
226 dfNoDeleteTemplate= 0x040000L,
227 dfDeleteTemplate = 0x080000L,
228 dfIsModal = 0x100000L,
229 dfModalWindow = 0x200000L,
235 TDialog(
const TDialog&);
236 TDialog& operator =(
const TDialog&);
251#if defined(OWL5_COMPAT)
332#if defined(OWL5_COMPAT)
365 return ::MapDialogRect(
GetHandle(), &rect) != FALSE;
#define PRECONDITION(condition)
virtual void SetText(LPCTSTR text)=0
Changes the text associated with a command sender; for example, text associated with a menu item or t...
TCommandEnabler(uint id, HWND hWndReceiver=0)
Constructs the TCommandEnabler object with the specified command ID.
void SetCheck(int check)
Use with only buttons!
void Enable(bool enable=true)
Enables/disables the control.
void SetText(LPCTSTR text)
Set the text of the control.
TControlEnabler(uint id, HWND hWndReceiver=0)
Constructor. Initializes the base class.
void EnableModal(bool enable=true)
Enables emulation of executing ModalDialog box by calling BeginModal()/EndModal().
void CloseWindow(int retValue=IDCANCEL) override
Overrides the virtual function defined by TWindow and conditionally shuts down the dialog box.
virtual bool EvInitDialog(HWND hWndFocus)
Virtual handler for WM_INITDIALOG message, called from DialogFunction().
auto Create() -> bool override
Creates a modeless dialog box interface element associated with the TDialog object.
auto PreProcessMsg(MSG &) -> bool override
Preprocess posted messages to provide various accelerator translations.
THow
Enumeration to be used when invoking the 'SetControlFocus' method.
@ Next
Set focus to the next sibling.
@ Previous
Set focus to the previous sibling.
bool SetMsgResult(TResult result)
Sets the dialog procedure message result (DWLP_MSGRESULT) and returns true.
auto Execute() -> int override
Creates and executes a modal dialog box interface element associated with the TDialog object.
TDialogAttr & GetDialogAttr()
Return the attributes data member of TDialog.
void SetDefaultId(uint id)
Set the id of the default push button.
void Reposition()
Reposition the dialog to ensure it is fully visible.
uint GetDefaultId() const
Return the ID of the default pushbutton.
auto PerformCreate() -> THandle override
Called from Create to perform the final step in creating an Windows interface element to be associate...
bool MapDialogRect(TRect &rect) const
Converts the coordinates of the given rect from dialog units into screen units.
void SetIsModal(bool ismodal)
Set the modal data member of TDialog.
bool GetIsModal() const
Return true if the dialog is modal.
void Destroy(int retValue=IDCANCEL) override
Destroys the interface element associated with the TDialog object.
virtual INT_PTR DialogFunction(TMsgId, TParam1, TParam2)
Override this to process messages within the dialog function.
void SetDialogAttr(TDialogAttr attr)
Set the attributes of the dialog.
auto DoExecute() -> int override
Overriden TWindow virtual to modaly execute this dialog & return the result.
auto MapDialogRectToScreen(const TRect &) const -> TRect
Returns the rect, specified in screen coordinates, corresponding to the given rect,...
TDialog(TWindow *parent, TResId resId, TModule *module=nullptr)
Constructor for a TDialog object.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TRect is a mathematical class derived from tagRect.
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
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 cre...
void SetFlag(uint mask)
Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
LONG_PTR SetWindowLongPtr(int index, LONG_PTR newLong)
Changes information about the window. For a list of constants, see GetWindowLongPtr().
TResult SendDlgItemMessage(int childId, TMsgId, TParam1=0, TParam2=0)
Sends a message (msg) to the control specified in childId.
void ClearFlag(uint mask)
Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
#define DECLARE_RESPONSE_TABLE(cls)
#define DECLARE_STREAMABLE_OWL(cls, ver)
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
#define DECLARE_STREAMABLE_INLINES(cls)
Object Windows Library (OWLNext Core).
UINT TMsgId
Message ID type.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
uint16 LoUint16(LRESULT r)
LRESULT TResult
Result type.
#define CONST_CAST(targetType, object)
Defines classes handling Windows resources.
Holds a TDialog object's creation attributes, which include the style, appearance,...
LPARAM Param
Param is used to pass initialization data to the dialog box when it is constructed.
TCHAR * Name
Name holds the identifier, which can be either a string or an integer resource identifier,...
Base window class TWindow definition, including HWND encapsulation.