don't check whether the window is shown and enabled in AcceptsFocus() itself
as it makes overriding it in derived classes problematic; provide a separate non virtual CanAcceptFocus() method checking whether the window accepts focus and if it can accept it now and use it instead of AcceptsFocus(); documented AcceptsFocus() and AcceptsFocusFromKeyboard() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2331,7 +2331,7 @@ bool wxWindowMSW::MSWShouldPreProcessMessage(WXMSG* msg)
|
||||
node = node->GetNext() )
|
||||
{
|
||||
wxWindow * const win = node->GetData();
|
||||
if ( win->AcceptsFocus() &&
|
||||
if ( win->CanAcceptFocus() &&
|
||||
!(::GetWindowLong(GetHwndOf(win), GWL_EXSTYLE) &
|
||||
WS_EX_CONTROLPARENT) )
|
||||
{
|
||||
@@ -2741,7 +2741,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
||||
// problems, so don't do it for them (unnecessary anyhow)
|
||||
if ( !win->IsOfStandardClass() )
|
||||
{
|
||||
if ( message == WM_LBUTTONDOWN && win->AcceptsFocus() )
|
||||
if ( message == WM_LBUTTONDOWN && win->CanAcceptFocus() )
|
||||
win->SetFocus();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user