Don't send a focus event if the window is a wxTextCtrl, since it sends
it's own focus event later on. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -38,6 +38,10 @@
|
||||
#include "wx/caret.h"
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/menu.h"
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/intl.h"
|
||||
@@ -1708,6 +1712,16 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
// If it's a wxTextCtrl don't send the event as it will be done
|
||||
// after the control gets to process it.
|
||||
wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl);
|
||||
if ( ctrl )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (win->IsTopLevel())
|
||||
{
|
||||
wxActivateEvent event( wxEVT_ACTIVATE, TRUE, win->GetId() );
|
||||
@@ -1776,6 +1790,16 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
// If it's a wxTextCtrl don't send the event as it will be done
|
||||
// after the control gets to process it.
|
||||
wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl);
|
||||
if ( ctrl )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (win->IsTopLevel())
|
||||
{
|
||||
wxActivateEvent event( wxEVT_ACTIVATE, FALSE, win->GetId() );
|
||||
|
@@ -38,6 +38,10 @@
|
||||
#include "wx/caret.h"
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/menu.h"
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/intl.h"
|
||||
@@ -1708,6 +1712,16 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
// If it's a wxTextCtrl don't send the event as it will be done
|
||||
// after the control gets to process it.
|
||||
wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl);
|
||||
if ( ctrl )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (win->IsTopLevel())
|
||||
{
|
||||
wxActivateEvent event( wxEVT_ACTIVATE, TRUE, win->GetId() );
|
||||
@@ -1776,6 +1790,16 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
// If it's a wxTextCtrl don't send the event as it will be done
|
||||
// after the control gets to process it.
|
||||
wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl);
|
||||
if ( ctrl )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (win->IsTopLevel())
|
||||
{
|
||||
wxActivateEvent event( wxEVT_ACTIVATE, FALSE, win->GetId() );
|
||||
|
@@ -3132,6 +3132,16 @@ bool wxWindowMSW::HandleSetFocus(WXHWND hwnd)
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
// If it's a wxTextCtrl don't send the event as it will be done
|
||||
// after the control gets to process it.
|
||||
wxTextCtrl *ctrl = wxDynamicCastThis(wxTextCtrl);
|
||||
if ( ctrl )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
|
||||
event.SetEventObject(this);
|
||||
|
||||
@@ -3151,6 +3161,16 @@ bool wxWindowMSW::HandleKillFocus(WXHWND hwnd)
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
// If it's a wxTextCtrl don't send the event as it will be done
|
||||
// after the control gets to process it.
|
||||
wxTextCtrl *ctrl = wxDynamicCastThis(wxTextCtrl);
|
||||
if ( ctrl )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxFocusEvent event(wxEVT_KILL_FOCUS, m_windowId);
|
||||
event.SetEventObject(this);
|
||||
|
||||
|
Reference in New Issue
Block a user