Disable focus out events during menu popup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -494,6 +494,27 @@ au_delete_range_callback(GtkTextBuffer * WXUNUSED(buffer),
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "populate_popup" from text control and "unmap" from its poup menu
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
static void
|
||||
gtk_textctrl_popup_unmap( GtkMenu *WXUNUSED(menu), wxTextCtrl* win )
|
||||
{
|
||||
win->GTKEnableFocusOutEvent();
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
static void
|
||||
gtk_textctrl_populate_popup( GtkEntry *WXUNUSED(entry), GtkMenu *menu, wxTextCtrl *win )
|
||||
{
|
||||
win->GTKDisableFocusOutEvent();
|
||||
|
||||
g_signal_connect (menu, "unmap", G_CALLBACK (gtk_textctrl_popup_unmap), win );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "changed"
|
||||
@@ -712,6 +733,11 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
G_CALLBACK (gtk_text_changed_callback), this);
|
||||
}
|
||||
|
||||
// Catch to disable focus out handling
|
||||
g_signal_connect (m_text, "populate_popup",
|
||||
G_CALLBACK (gtk_textctrl_populate_popup),
|
||||
this);
|
||||
|
||||
if (!value.empty())
|
||||
{
|
||||
SetValue( value );
|
||||
|
Reference in New Issue
Block a user