- GtkWidget *entry = GTK_COMBO(m_widget)->entry;
- gtk_entry_set_editable( GTK_ENTRY(entry), editable );
-}
-
-void wxComboBox::OnChar( wxKeyEvent &event )
-{
- if ( event.GetKeyCode() == WXK_RETURN )
- {
- // GTK automatically selects an item if its in the list
- wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, GetId());
- event.SetString( GetValue() );
- event.SetInt( GetSelection() );
- event.SetEventObject( this );
-
- if (!GetEventHandler()->ProcessEvent( event ))
- {
- // This will invoke the dialog default action, such
- // as the clicking the default button.
-
- wxWindow *top_frame = m_parent;
- while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
- top_frame = top_frame->GetParent();
-
- if (top_frame && GTK_IS_WINDOW(top_frame->m_widget))
- {
- GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
-
- if (window->default_widget)
- gtk_widget_activate (window->default_widget);
- }
- }
-
- // Catch GTK event so that GTK doesn't open the drop
- // down list upon RETURN.
- return;
- }
-
- event.Skip();
-}
-
-void wxComboBox::DisableEvents()
-{
- gtk_signal_disconnect_by_func( GTK_OBJECT(GTK_COMBO(m_widget)->list),
- GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this );
- gtk_signal_disconnect_by_func( GTK_OBJECT(GTK_COMBO(m_widget)->entry),
- GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this );
-}
-
-void wxComboBox::EnableEvents()
-{
- gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->list), "select-child",
- GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this );
- gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
- GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this );
-}
-
-void wxComboBox::OnSize( wxSizeEvent &event )
-{
- // NB: In some situations (e.g. on non-first page of a wizard, if the
- // size used is default size), GtkCombo widget is resized correctly,
- // but it's look is not updated, it's rendered as if it was much wider.
- // No other widgets are affected, so it looks like a bug in GTK+.
- // Manually requesting resize calculation (as gtk_pizza_set_size does)
- // fixes it.
- if (GTK_WIDGET_VISIBLE(m_widget))
- gtk_widget_queue_resize(m_widget);
-
- event.Skip();
-}
-
-void wxComboBox::DoApplyWidgetStyle(GtkRcStyle *style)
-{
-// gtk_widget_modify_style( GTK_COMBO(m_widget)->button, syle );
-
- gtk_widget_modify_style( GTK_COMBO(m_widget)->entry, style );
- gtk_widget_modify_style( GTK_COMBO(m_widget)->list, style );
-
- GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
- GList *child = list->children;
- while (child)
- {
- gtk_widget_modify_style( GTK_WIDGET(child->data), style );
-
- GtkBin *bin = GTK_BIN(child->data);
- gtk_widget_modify_style( bin->child, style );
-
- child = child->next;
- }
-}
-
-GtkWidget* wxComboBox::GetConnectWidget()
-{
- return GTK_COMBO(m_widget)->entry;
-}
-
-bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
-{
- return ( (window == GTK_ENTRY( GTK_COMBO(m_widget)->entry )->text_area) ||
- (window == GTK_COMBO(m_widget)->button->window ) );