soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SHostDialog Class Reference

Dialog host window class. More...

#include <SHostDialog.h>

Inheritance diagram for SHostDialog:
SMessageBoxImpl

Public Member Functions

 SHostDialog (LPCWSTR pszXmlName=NULL)
 Constructor.
 
 SHostDialog (LPCSTR pszXmlName)
 Constructor.
 
 ~SHostDialog (void)
 Destructor.
 
IMessageLoopGetMsgLoop () OVERRIDE
 Gets the message loop for the dialog.
 
INT_PTR DoModal (HWND hParent=0, DWORD dwStyle=WS_POPUP|WS_CLIPCHILDREN, DWORD dwExStyle=0) OVERRIDE
 Displays the dialog as a modal window.
 
void EndDialog (INT_PTR nResult) OVERRIDE
 Ends the dialog.
 
SHostWndtoSHostWnd ()
 Casts the object to SHostWnd.
 

Protected Member Functions

void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handles the key down event.
 
void OnOK ()
 Handles the OK button click event.
 
void OnCancel ()
 Handles the Cancel button click event.
 

Protected Attributes

INT_PTR m_nRetCode
 
SAutoRefPtr< IMessageLoopm_MsgLoop
 

Detailed Description

Dialog host window class.

This class manages dialog windows in the SOUI framework. It inherits from THostWndProxy<IHostDialog> and provides methods for handling dialog messages and events.

Definition at line 30 of file SHostDialog.h.

Constructor & Destructor Documentation

◆ SHostDialog() [1/2]

SHostDialog::SHostDialog ( LPCWSTR pszXmlName = NULL)

Constructor.

Parameters
pszXmlNameName of the XML file for the dialog layout (wide character version)

Initializes the dialog with the specified XML layout file.

Definition at line 9 of file SHostDialog.cpp.

◆ SHostDialog() [2/2]

SHostDialog::SHostDialog ( LPCSTR pszXmlName)

Constructor.

Parameters
pszXmlNameName of the XML file for the dialog layout (narrow character version)

Initializes the dialog with the specified XML layout file.

Definition at line 15 of file SHostDialog.cpp.

◆ ~SHostDialog()

SHostDialog::~SHostDialog ( void )

Destructor.

Cleans up the dialog object.

Definition at line 21 of file SHostDialog.cpp.

Member Function Documentation

◆ DoModal()

INT_PTR SHostDialog::DoModal ( HWND hParent = 0,
DWORD dwStyle = WS_POPUP | WS_CLIPCHILDREN,
DWORD dwExStyle = 0 )

Displays the dialog as a modal window.

Parameters
hParentHandle to the parent window
dwStyleWindow style
dwExStyleExtended window style
Returns
Result code of the dialog

Displays the dialog as a modal window and returns the result code.

Definition at line 26 of file SHostDialog.cpp.

◆ EndDialog()

void SHostDialog::EndDialog ( INT_PTR nResult)

Ends the dialog.

Parameters
nResultResult code to return from the dialog

Ends the dialog and sets the result code.

Definition at line 91 of file SHostDialog.cpp.

◆ GetMsgLoop()

IMessageLoop * SHostDialog::GetMsgLoop ( )

Gets the message loop for the dialog.

Returns
Pointer to the message loop

Returns the message loop associated with the dialog.

Definition at line 106 of file SHostDialog.cpp.

◆ OnCancel()

void SHostDialog::OnCancel ( )
protected

Handles the Cancel button click event.

Handles the click event for the Cancel button, typically ending the dialog with a result code. Maps the IDOK command to the OnOK method. Maps the IDCANCEL command to the OnCancel method. Maps the WM_CLOSE message to the OnCancel method. Maps the WM_KEYDOWN message to the OnKeyDown method. Chains message map to the base class SHostWnd. Reflects notifications to the dialog.

Definition at line 119 of file SHostDialog.cpp.

◆ OnKeyDown()

void SHostDialog::OnKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handles the key down event.

Parameters
nCharVirtual key code
nRepCntRepeat count
nFlagsFlags associated with the key event

Handles the key down event for the dialog.

Definition at line 124 of file SHostDialog.cpp.

◆ OnOK()

void SHostDialog::OnOK ( )
protected

Handles the OK button click event.

Handles the click event for the OK button, typically ending the dialog with a result code.

Definition at line 114 of file SHostDialog.cpp.

◆ toSHostWnd()

SHostWnd * SHostDialog::toSHostWnd ( )
inline

Casts the object to SHostWnd.

Returns
Pointer to the SHostWnd object

Casts the SHostDialog object to an SHostWnd object.

Definition at line 89 of file SHostDialog.h.

Member Data Documentation

◆ m_MsgLoop

SAutoRefPtr<IMessageLoop> SHostDialog::m_MsgLoop
protected

Message loop for the dialog.

Definition at line 133 of file SHostDialog.h.

◆ m_nRetCode

INT_PTR SHostDialog::m_nRetCode
protected

Result code of the dialog.

Definition at line 132 of file SHostDialog.h.


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