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

Message Box Implementation. More...

#include <SMessageBox.h>

Inheritance diagram for SMessageBoxImpl:
SHostDialog SDpiHandler< SMessageBoxImpl >

Public Member Functions

 SMessageBoxImpl ()
 Constructor.
 
INT_PTR MessageBox (HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)
 Display a message box.
 
BOOL IsMsgHandled () const
 
void SetMsgHandled (BOOL bHandled)
 
BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
 Processes a window message.
 
BOOL _ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)
 
- Public Member Functions inherited from SHostDialog
 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.
 
- Public Member Functions inherited from SDpiHandler< SMessageBoxImpl >
BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
 处理窗口消息
 

Public Attributes

BOOL m_bMsgHandled
 

Protected Member Functions

SXmlNode OnGetInitXmlNode (SXmlDoc &xmlDoc) override
 Get the initialization XML node.
 
BOOL OnInitDialog (HWND wnd, LPARAM lInitParam)
 Initialize the dialog.
 
virtual BOOL OnSetIcon (UINT uType)
 Set the icon.
 
virtual SStringT OnGetButtonText (int nBtnID) const
 Get the button text.
 
void OnBtnClick (int uID)
 Handle button click event.
 
- Protected Member Functions inherited from SHostDialog
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 Member Functions inherited from SDpiHandler< SMessageBoxImpl >
virtual bool IsDpiAware () const
 检查是否支持DPI感知
 
void OnDpiChanged (WORD dpi, const RECT *desRect)
 处理DPI变化事件
 
virtual void HandleScaleChange (WORD nScale, const RECT *desRect)
 处理缩放变化
 
void ScaleHost (HWND hWnd)
 根据DPI缩放窗口
 

Additional Inherited Members

- Protected Attributes inherited from SHostDialog
INT_PTR m_nRetCode
 
SAutoRefPtr< IMessageLoopm_MsgLoop
 

Detailed Description

Message Box Implementation.

Implementation class for message boxes. If more personalized message boxes are needed, derive from this class.

Definition at line 24 of file SMessageBox.h.

Constructor & Destructor Documentation

◆ SMessageBoxImpl()

SNSBEGIN SMessageBoxImpl::SMessageBoxImpl ( )

Constructor.

Definition at line 10 of file SMessageBox.cpp.

Member Function Documentation

◆ _ProcessWindowMessage()

BOOL SMessageBoxImpl::_ProcessWindowMessage ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT & lResult,
DWORD dwMsgMapID )
inline

Definition at line 88 of file SMessageBox.h.

◆ IsMsgHandled()

BOOL SMessageBoxImpl::IsMsgHandled ( ) const
inline

Definition at line 88 of file SMessageBox.h.

◆ MessageBox()

INT_PTR SMessageBoxImpl::MessageBox ( HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType )

Display a message box.

Parameters
hWndParent window handle
lpTextMessage content
lpCaptionWindow title
uTypeWindow type
Returns
Result of the message box

Definition at line 22 of file SMessageBox.cpp.

◆ OnBtnClick()

void SMessageBoxImpl::OnBtnClick ( int uID)
inlineprotected

Handle button click event.

Parameters
uIDControl ID

Message handler for button clicks.

Definition at line 79 of file SMessageBox.h.

◆ OnGetButtonText()

SStringT SMessageBoxImpl::OnGetButtonText ( int nBtnID) const
protectedvirtual

Get the button text.

Parameters
nBtnIDButton ID
Returns
Button text

Definition at line 87 of file SMessageBox.cpp.

◆ OnGetInitXmlNode()

SXmlNode SMessageBoxImpl::OnGetInitXmlNode ( SXmlDoc & xmlDoc)
overrideprotectedvirtual

Get the initialization XML node.

Parameters
xmlDocXML document
Returns
XML node for initialization

Reimplemented from SHostWnd.

Definition at line 92 of file SMessageBox.cpp.

◆ OnInitDialog()

BOOL SMessageBoxImpl::OnInitDialog ( HWND wnd,
LPARAM lInitParam )
protected

Initialize the dialog.

Parameters
wndHost window handle
lInitParamInitialization parameter (not used)
Returns
TRUE if successful, FALSE otherwise

Definition at line 97 of file SMessageBox.cpp.

◆ OnSetIcon()

BOOL SMessageBoxImpl::OnSetIcon ( UINT uType)
protectedvirtual

Set the icon.

Parameters
uTypeIcon type
Returns
TRUE if successful, FALSE otherwise

Set the icon. This method can be overridden to display custom icons.

Definition at line 33 of file SMessageBox.cpp.

◆ ProcessWindowMessage()

BOOL SMessageBoxImpl::ProcessWindowMessage ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT & lResult,
DWORD dwMsgMapID = 0 )
inlinevirtual

Processes a window message.

Parameters
hWndHandle to the window.
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
lResultResult of the message processing.
dwMsgMapIDMessage map ID.
Returns
BOOL TRUE if the message was handled, FALSE otherwise.

Reimplemented from SNativeWnd.

Definition at line 88 of file SMessageBox.h.

◆ SetMsgHandled()

void SMessageBoxImpl::SetMsgHandled ( BOOL bHandled)
inline

Definition at line 88 of file SMessageBox.h.

Member Data Documentation

◆ m_bMsgHandled

BOOL SMessageBoxImpl::m_bMsgHandled

Definition at line 88 of file SMessageBox.h.


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