From f92722960b2a15f813cc62a23ecb321bc0555099 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 21 Jul 1999 16:35:18 +0000 Subject: [PATCH] Mini-fix for wxStaticBitmap switched on reports after changing text ctrl be hand again git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/statbmp.cpp | 4 ++-- src/gtk/textctrl.cpp | 42 ------------------------------------------ src/gtk1/statbmp.cpp | 4 ++-- src/gtk1/textctrl.cpp | 42 ------------------------------------------ 4 files changed, 4 insertions(+), 88 deletions(-) diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp index ac1b7529b8..8027044d5a 100644 --- a/src/gtk/statbmp.cpp +++ b/src/gtk/statbmp.cpp @@ -70,10 +70,10 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi else { m_widget = gtk_label_new( "Bitmap" ); - - PostCreation(); } + PostCreation(); + m_parent->DoAddChild( this ); Show( TRUE ); diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 9739c45681..ccb6dce12b 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -298,9 +298,6 @@ void wxTextCtrl::SetValue( const wxString &value ) { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - wxString tmp = _T(""); if (!value.IsNull()) tmp = value; if (m_windowStyle & wxTE_MULTILINE) @@ -319,9 +316,6 @@ void wxTextCtrl::SetValue( const wxString &value ) { gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() ); } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::WriteText( const wxString &text ) @@ -330,9 +324,6 @@ void wxTextCtrl::WriteText( const wxString &text ) if (text.IsEmpty()) return; - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - if (m_windowStyle & wxTE_MULTILINE) { /* this moves the cursor pos to behind the inserted text */ @@ -365,9 +356,6 @@ void wxTextCtrl::WriteText( const wxString &text ) /* bring entry's cursor uptodate. bug in GTK. */ gtk_entry_set_position( GTK_ENTRY(m_text), GTK_EDITABLE(m_text)->current_pos ); } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::AppendText( const wxString &text ) @@ -376,9 +364,6 @@ void wxTextCtrl::AppendText( const wxString &text ) if (text.IsEmpty()) return; - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - if (m_windowStyle & wxTE_MULTILINE) { bool hasSpecialAttributes = m_font.Ok() || @@ -412,9 +397,6 @@ void wxTextCtrl::AppendText( const wxString &text ) { gtk_entry_append_text( GTK_ENTRY(m_text), text.mbc_str() ); } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } wxString wxTextCtrl::GetLineText( long lineNo ) const @@ -645,22 +627,13 @@ void wxTextCtrl::Remove( long from, long to ) { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to ); - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::Replace( long from, long to, const wxString &value ) { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to ); if (!value.IsEmpty()) @@ -673,26 +646,17 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value ) gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos ); #endif } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::Cut() { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - #if (GTK_MINOR_VERSION > 0) gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) ); #else gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 ); #endif - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::Copy() @@ -710,17 +674,11 @@ void wxTextCtrl::Paste() { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - #if (GTK_MINOR_VERSION > 0) gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) ); #else gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 ); #endif - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } bool wxTextCtrl::CanCopy() const diff --git a/src/gtk1/statbmp.cpp b/src/gtk1/statbmp.cpp index ac1b7529b8..8027044d5a 100644 --- a/src/gtk1/statbmp.cpp +++ b/src/gtk1/statbmp.cpp @@ -70,10 +70,10 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi else { m_widget = gtk_label_new( "Bitmap" ); - - PostCreation(); } + PostCreation(); + m_parent->DoAddChild( this ); Show( TRUE ); diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 9739c45681..ccb6dce12b 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -298,9 +298,6 @@ void wxTextCtrl::SetValue( const wxString &value ) { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - wxString tmp = _T(""); if (!value.IsNull()) tmp = value; if (m_windowStyle & wxTE_MULTILINE) @@ -319,9 +316,6 @@ void wxTextCtrl::SetValue( const wxString &value ) { gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() ); } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::WriteText( const wxString &text ) @@ -330,9 +324,6 @@ void wxTextCtrl::WriteText( const wxString &text ) if (text.IsEmpty()) return; - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - if (m_windowStyle & wxTE_MULTILINE) { /* this moves the cursor pos to behind the inserted text */ @@ -365,9 +356,6 @@ void wxTextCtrl::WriteText( const wxString &text ) /* bring entry's cursor uptodate. bug in GTK. */ gtk_entry_set_position( GTK_ENTRY(m_text), GTK_EDITABLE(m_text)->current_pos ); } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::AppendText( const wxString &text ) @@ -376,9 +364,6 @@ void wxTextCtrl::AppendText( const wxString &text ) if (text.IsEmpty()) return; - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - if (m_windowStyle & wxTE_MULTILINE) { bool hasSpecialAttributes = m_font.Ok() || @@ -412,9 +397,6 @@ void wxTextCtrl::AppendText( const wxString &text ) { gtk_entry_append_text( GTK_ENTRY(m_text), text.mbc_str() ); } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } wxString wxTextCtrl::GetLineText( long lineNo ) const @@ -645,22 +627,13 @@ void wxTextCtrl::Remove( long from, long to ) { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to ); - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::Replace( long from, long to, const wxString &value ) { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to ); if (!value.IsEmpty()) @@ -673,26 +646,17 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value ) gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos ); #endif } - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::Cut() { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - #if (GTK_MINOR_VERSION > 0) gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) ); #else gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 ); #endif - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } void wxTextCtrl::Copy() @@ -710,17 +674,11 @@ void wxTextCtrl::Paste() { wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); - gtk_signal_disconnect_by_func( GTK_OBJECT(m_text), - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); - #if (GTK_MINOR_VERSION > 0) gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) ); #else gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 ); #endif - - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } bool wxTextCtrl::CanCopy() const