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:
Robert Roebling
2008-10-27 14:19:18 +00:00
parent 36a845fe5b
commit 5edfb38495

View File

@@ -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" // "changed"
@@ -501,7 +522,7 @@ au_delete_range_callback(GtkTextBuffer * WXUNUSED(buffer),
extern "C" { extern "C" {
static void static void
gtk_text_changed_callback( GtkWidget * WXUNUSED(widget), wxTextCtrl *win ) gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{ {
if ( win->IgnoreTextUpdate() ) if ( win->IgnoreTextUpdate() )
return; return;
@@ -712,6 +733,11 @@ bool wxTextCtrl::Create( wxWindow *parent,
G_CALLBACK (gtk_text_changed_callback), this); 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()) if (!value.empty())
{ {
SetValue( value ); SetValue( value );