Implemented input disabling for disabled windows since MicroWindows doesn't do it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9aa80360d1
commit
98363307d3
@ -43,6 +43,7 @@ public:
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
protected:
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
@ -2155,12 +2155,6 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
|
||||
#endif
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
// set focus to this window
|
||||
if (AcceptsFocus())
|
||||
SetFocus();
|
||||
|
||||
// fall through
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
case WM_LBUTTONDBLCLK:
|
||||
case WM_RBUTTONDOWN:
|
||||
@ -2169,12 +2163,69 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
|
||||
case WM_MBUTTONDOWN:
|
||||
case WM_MBUTTONUP:
|
||||
case WM_MBUTTONDBLCLK:
|
||||
processed = HandleMouseEvent(message,
|
||||
{
|
||||
processed = FALSE;
|
||||
#ifdef __WXMICROWIN__
|
||||
// MicroWindows seems to ignore the fact that a window
|
||||
// is disabled. So catch mouse events and throw them away if necessary.
|
||||
wxWindowMSW* win = this;
|
||||
while (win)
|
||||
{
|
||||
if (!win->IsEnabled())
|
||||
{
|
||||
processed = TRUE;
|
||||
break;
|
||||
}
|
||||
win = win->GetParent();
|
||||
if (win && win->IsTopLevel())
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (!processed)
|
||||
{
|
||||
if (message == WM_LBUTTONDOWN && AcceptsFocus())
|
||||
SetFocus();
|
||||
processed = HandleMouseEvent(message,
|
||||
GET_X_LPARAM(lParam),
|
||||
GET_Y_LPARAM(lParam),
|
||||
wParam);
|
||||
break;
|
||||
wParam);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __WXMICROWIN__
|
||||
case WM_NCLBUTTONDOWN:
|
||||
case WM_NCLBUTTONUP:
|
||||
case WM_NCLBUTTONDBLCLK:
|
||||
case WM_NCRBUTTONDOWN:
|
||||
case WM_NCRBUTTONUP:
|
||||
case WM_NCRBUTTONDBLCLK:
|
||||
#if 0
|
||||
case WM_NCMBUTTONDOWN:
|
||||
case WM_NCMBUTTONUP:
|
||||
case WM_NCMBUTTONDBLCLK:
|
||||
#endif
|
||||
{
|
||||
// MicroWindows seems to ignore the fact that a window
|
||||
// is disabled. So catch mouse events and throw them away if necessary.
|
||||
processed = FALSE;
|
||||
wxWindowMSW* win = this;
|
||||
while (win)
|
||||
{
|
||||
if (!win->IsEnabled())
|
||||
{
|
||||
processed = TRUE;
|
||||
break;
|
||||
}
|
||||
win = win->GetParent();
|
||||
if (win && win->IsTopLevel())
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MM_JOY1MOVE // __WXMICROWIN__
|
||||
case MM_JOY1MOVE:
|
||||
case MM_JOY2MOVE:
|
||||
|
@ -108,3 +108,13 @@ wxPoint wxFrame::GetClientAreaOrigin() const
|
||||
return pt;
|
||||
}
|
||||
|
||||
bool wxFrame::Enable( bool enable )
|
||||
{
|
||||
if (!wxFrameNative::Enable(enable))
|
||||
return FALSE;
|
||||
#ifdef __WXMICROWIN__
|
||||
if (m_frameMenuBar)
|
||||
m_frameMenuBar->Enable(enable);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user