#include "wx/frame.h"
#include "wx/log.h"
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
+#include "wx/gtk/private.h"
#include <gdk/gdkkeysyms.h>
#include "wx/gtk/win_gtk.h"
// data
//-----------------------------------------------------------------------------
-extern bool g_blockEventsOnDrag;
+extern bool g_blockEventsOnDrag;
+extern wxWindowGTK *g_delayedFocus;
//-----------------------------------------------------------------------------
// "clicked"
wxNode *node = m_boxes.First();
while (node)
{
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ if (s == label->label)
+ return count;
- GtkLabel *label = GTK_LABEL( button->child );
- if (s == label->label) return count;
count++;
node = node->Next();
}
node = node->Next();
}
-
}
void wxRadioBox::SetSelection( int n )
wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") );
- GtkButton *button = GTK_BUTTON( node->Data() );
- GtkLabel *label = GTK_LABEL( button->child );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
return wxString( label->label );
}
-wxString wxRadioBox::GetLabel( int item ) const
-{
- wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
-
- return GetString( item );
-}
-
void wxRadioBox::SetLabel( const wxString& label )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxCHECK_RET( node, wxT("radiobox wrong index") );
- GtkButton *button = GTK_BUTTON( node->Data() );
- GtkLabel *g_label = GTK_LABEL( button->child );
+ GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
gtk_label_set( g_label, label.mbc_str() );
}
while (node)
{
GtkButton *button = GTK_BUTTON( node->Data() );
- GtkWidget *label = button->child;
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
+
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
- gtk_widget_set_sensitive( label, enable );
+ gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
node = node->Next();
}
wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
- GtkWidget *label = button->child;
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
+
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
- gtk_widget_set_sensitive( label, enable );
+ gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
}
void wxRadioBox::Show( int item, bool show )
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
if (button->active)
{
- GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+
return label->label;
}
node = node->Next();
GtkWidget *widget = GTK_WIDGET( node->Data() );
gtk_widget_set_style( widget, m_widgetStyle );
- GtkButton *button = GTK_BUTTON( node->Data() );
- gtk_widget_set_style( button->child, m_widgetStyle );
+ gtk_widget_set_style( BUTTON_CHILD(node->Data()), m_widgetStyle );
node = node->Next();
}
(void)GetEventHandler()->ProcessEvent( event );
}
+
+ if (g_delayedFocus == this)
+ {
+ if (GTK_WIDGET_REALIZED(m_widget))
+ {
+ g_delayedFocus = NULL;
+ SetFocus();
+ }
+ }
}
#endif // wxUSE_RADIOBOX