3#include <core/SMsgLoop.h>
7#define RC_INIT 0xcccccccc
10 : THostWndProxy<IHostDialog>(pszXmlName)
16 : THostWndProxy<IHostDialog>(pszXmlName)
34 hParent = ::GetActiveWindow();
37 BOOL bEnableParent = FALSE;
38 if (hParent && hParent != ::GetDesktopWindow() && ::IsWindowEnabled(hParent))
40 ::EnableWindow(hParent, FALSE);
48 ::EnableWindow(hParent, TRUE);
56 HWND hWndLastActive = ::SetActiveWindow(
m_hWnd);
58 if (GetExStyle() & WS_EX_TOOLWINDOW)
59 ::ShowWindow(
m_hWnd, SW_SHOWNOACTIVATE);
61 ::ShowWindow(
m_hWnd, SW_SHOWNORMAL);
69 ShowHostWnd(SW_HIDE, TRUE);
74 parentMsgLoop->Quit(nRet);
79 ::EnableWindow(hParent, TRUE);
82 ::SetActiveWindow(hWndLastActive);
95 SSLOGW() <<
"dialog is not show by DoModal";
98 SASSERT(nResult != RC_INIT);
127 if (SHostWnd::IsMsgHandled())
129 if (nChar == VK_ESCAPE || nChar == VK_RETURN)
IMessageLoop * GetMsgLoop(tid_t tid=::GetCurrentThreadId()) SCONST OVERRIDE
Get the message loop for a specific thread.
IMsgLoopFactory * GetMsgLoopFactory() OVERRIDE
Get the message loop factory.
Smart pointer class for managing COM-style reference-counted objects.
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
Handles the key down event.
SAutoRefPtr< IMessageLoop > m_MsgLoop
INT_PTR DoModal(HWND hParent=0, DWORD dwStyle=WS_POPUP|WS_CLIPCHILDREN, DWORD dwExStyle=0) OVERRIDE
Displays the dialog as a modal window.
void OnCancel()
Handles the Cancel button click event.
void EndDialog(INT_PTR nResult) OVERRIDE
Ends the dialog.
IMessageLoop * GetMsgLoop() OVERRIDE
Gets the message loop for the dialog.
~SHostDialog(void)
Destructor.
SHostDialog(LPCWSTR pszXmlName=NULL)
Constructor.
void OnOK()
Handles the OK button click event.
LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles key events.
SWindow * FindChildByID(int nID, int nDeep=-1)
Finds a child window by its ID.
IMessageLoop * GetMsgLoop() OVERRIDE
Gets the message loop interface.
HWND CreateEx(HWND hWndParent, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, IXmlNode *xmlInit=NULL) OVERRIDE
Creates the host window with extended styles.
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Sends a message to the window.
HWND m_hWnd
Handle to the window.
BOOL DestroyWindow() OVERRIDE
Destroys the window.
static SApplication & getSingleton(void)
static SApplication * getSingletonPtr(void)
Base class for SOUI DUI windows.
BOOL FireCommand() OVERRIDE
Fires a command event.
Interface for message loops.
HRESULT CreateMsgLoop(IMessageLoop **ppMsgLoop, IMessageLoop *pParentLoop=NULL) PURE
Creates a message loop.