X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef5c70f96f5e06e1c8f8119f51b99dd019583d2b..b8e3f1cfb7892a1144385bbbd94e9d4f02d887d5:/src/gtk/radiobox.cpp diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 9117e587ac..dba9c91702 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -27,8 +27,6 @@ #include "wx/gtk/private.h" #include -#include "wx/gtk/win_gtk.h" - //----------------------------------------------------------------------------- // wxGTKRadioButtonInfo //----------------------------------------------------------------------------- @@ -49,7 +47,7 @@ public: //----------------------------------------------------------------------------- #include "wx/listimpl.cpp" -WX_DEFINE_LIST( wxRadioBoxButtonsInfoList ); +WX_DEFINE_LIST( wxRadioBoxButtonsInfoList ) extern bool g_blockEventsOnDrag; @@ -60,8 +58,6 @@ extern bool g_blockEventsOnDrag; extern "C" { static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb ) { - if (g_isIdle) wxapp_install_idle_handler(); - if (!rb->m_hasVMT) return; if (g_blockEventsOnDrag) return; @@ -82,9 +78,6 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo extern "C" { static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb ) { - if (g_isIdle) - wxapp_install_idle_handler(); - if (!rb->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; @@ -120,8 +113,6 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_ return FALSE; } - g_signal_stop_emission_by_name (widget, "key_press_event"); - if ((gdk_event->keyval == GDK_Up) || (gdk_event->keyval == GDK_Left)) { @@ -196,12 +187,11 @@ static void gtk_radiobutton_size_allocate( GtkWidget *widget, GtkAllocation * alloc, wxRadioBox *win ) { - unsigned int n = 0; for ( wxRadioBoxButtonsInfoList::compatibility_iterator node = win->m_buttonsInfo.GetFirst(); node; - node = node->GetNext(), n++ ) + node = node->GetNext()) { - if( widget == GTK_WIDGET(node->GetData()->button) ) + if (widget == GTK_WIDGET(node->GetData()->button)) { const wxPoint origin = win->GetPosition(); wxRect rect = wxRect( alloc->x - origin.x, alloc->y - origin.y, @@ -223,7 +213,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl) void wxRadioBox::Init() { m_needParent = true; - m_acceptsFocus = true; m_hasFocus = m_lostFocus = false; @@ -257,6 +246,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, m_widget = GTKCreateFrame(title); wxControl::SetLabel(title); + if ( HasFlag(wxNO_BORDER) ) + { + // If we don't do this here, the wxNO_BORDER style is ignored in Show() + gtk_frame_set_shadow_type(GTK_FRAME(m_widget), GTK_SHADOW_NONE); + } + // majorDim may be 0 if all trailing parameters were omitted, so don't // assert here but just use the correct value for it @@ -691,7 +686,7 @@ int wxRadioBox::GetItemFromPoint(const wxPoint& point) const for ( wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst(); node; node = node->GetNext(), n++ ) { - if ( m_buttonsInfo[n]->rect.Inside(pt) ) + if ( m_buttonsInfo[n]->rect.Contains(pt) ) return n; }