X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c7789014106c9269b0f4ecc1a3071b14f351d3f..d67fc8b73514909eb198223333e11be4d900f431:/src/gtk/tglbtn.cpp diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 63fd5414cc..8e33e7f6d9 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -39,7 +39,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog } } -wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); // ------------------------------------------------------------------------ // wxBitmapToggleButton @@ -146,11 +146,18 @@ void wxBitmapToggleButton::OnSetBitmap() bool wxBitmapToggleButton::Enable(bool enable /*=true*/) { + bool isEnabled = IsEnabled(); + if (!wxControl::Enable(enable)) return false; gtk_widget_set_sensitive(GTK_BIN(m_widget)->child, enable); + if (!isEnabled && enable) + { + GTKFixSensitivity(); + } + return true; } @@ -273,16 +280,19 @@ void wxToggleButton::SetLabel(const wxString& label) gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(labelGTK)); - ApplyWidgetStyle( false ); + GTKApplyWidgetStyle( false ); } bool wxToggleButton::Enable(bool enable /*=true*/) { - if (!wxControl::Enable(enable)) + if (!base_type::Enable(enable)) return false; gtk_widget_set_sensitive(GTK_BIN(m_widget)->child, enable); + if (enable) + GTKFixSensitivity(); + return true; }