Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
①BUG修复:修复按一次ESC导致多个窗口关闭的问题 ②上次提交不小心在UIManager里面引入了一个新的BUG,已修复
Browse files Browse the repository at this point in the history
  • Loading branch information
movsb committed Jul 1, 2014
1 parent 470efa8 commit 5927b28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Duilib/Core/UIManager.cpp
Expand Up @@ -1330,7 +1330,8 @@ void CPaintManagerUI::SetFocus(CControlUI* pControl)
if( pControl == m_pFocus ) return;

HWND hFocusWnd = ::GetFocus();
if( hFocusWnd != m_hWndPaint && !pControl->GetInterface("HWND")) ::SetFocus(m_hWndPaint);
if( hFocusWnd != m_hWndPaint && (!pControl || !pControl->GetInterface("HWND")))
::SetFocus(m_hWndPaint);

// Remove focus from old control
if( m_pFocus != NULL )
Expand Down
5 changes: 3 additions & 2 deletions Duilib/Utils/WinImplBase.cpp
Expand Up @@ -76,15 +76,16 @@ CControlUI* WindowImplBase::CreateControl(LPCTSTR pstrClass)
return NULL;
}

LRESULT WindowImplBase::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, bool& /*bHandled*/)
LRESULT WindowImplBase::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, bool& bHandled)
{
if (uMsg == WM_KEYDOWN)
{
switch (wParam)
{
case VK_RETURN:
case VK_ESCAPE:
return ResponseDefaultKeyEvent(wParam);
bHandled = !!ResponseDefaultKeyEvent(wParam);
return 0;
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Duilib/Utils/WinImplBase.h
Expand Up @@ -49,7 +49,7 @@ namespace DuiLib
virtual CDuiString GetZIPFileName() const;
virtual LPCTSTR GetResourceID() const;
virtual CControlUI* CreateControl(LPCTSTR pstrClass);
virtual LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, bool& /*bHandled*/);
virtual LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, bool& bHandled);
virtual LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
virtual LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);

Expand Down

0 comments on commit 5927b28

Please sign in to comment.