Пример #1
0
/*
 * Gets the properties of the widget. This is used for both displaying the
 * properties in the property editor, and also for saving the properties.
 */
static void
gb_combo_box_get_properties (GtkWidget *widget, GbWidgetGetArgData * data)
{
  gchar *items;
  gboolean add_tearoffs, focus_on_click;

  items = gtk_object_get_data (GTK_OBJECT (widget), Items);
  gb_widget_output_translatable_text_in_lines (data, Items, items);

  g_object_get (G_OBJECT (widget),
		"add_tearoffs", &add_tearoffs,
		"focus_on_click", &focus_on_click,
		NULL);

  gb_widget_output_bool (data, AddTearoffs, add_tearoffs);
  gb_widget_output_bool (data, FocusOnClick, focus_on_click);
}
Пример #2
0
/*
 * Gets the properties of the widget. This is used for both displaying the
 * properties in the property editor, and also for saving the properties.
 */
static void
gb_combo_get_properties (GtkWidget * widget, GbWidgetGetArgData * data)
{
  gb_widget_output_bool (data, ValueInList,
			 gtk_object_get_data (GTK_OBJECT (widget), ValueInList)
			 != NULL ? TRUE : FALSE);
  gb_widget_output_bool (data, OKIfEmpty,
			 gtk_object_get_data (GTK_OBJECT (widget), OKIfEmpty)
			 != NULL ? TRUE : FALSE);
  gb_widget_output_bool (data, Case, GTK_COMBO (widget)->case_sensitive);
  gb_widget_output_bool (data, Arrows, GTK_COMBO (widget)->use_arrows);
  gb_widget_output_bool (data, Always, GTK_COMBO (widget)->use_arrows_always);

  if (is_simple_combo (widget) >= 0)
    {
      GString *items;

      items = g_string_new ("");
      gtk_container_foreach (GTK_CONTAINER (GTK_COMBO (widget)->list),
			     (GtkCallback) add_label, items);
      gb_widget_output_translatable_text_in_lines (data, Items, items->str);
      g_string_free (items, TRUE);
    }
}
Пример #3
0
/*
 * Gets the properties of the widget. This is used for both displaying the
 * properties in the property editor, and also for saving the properties.
 */
static void
gb_option_menu_get_properties (GtkWidget * widget, GbWidgetGetArgData * data)
{
  GbAddLabelData add_label_data;
  gchar items[ITEMS_BUFFER_SIZE];

  /* Clear the buffer and make sure it's seen as valid */
  items[0] = '\0';
  add_label_data.items = items;
  add_label_data.option_menu = widget;
  add_label_data.buffer_overflow = FALSE;
  add_label_data.index = 0;
  add_label_data.selected_index = 0;
  gtk_container_foreach (GTK_CONTAINER (GTK_OPTION_MENU (widget)->menu),
			 (GtkCallback) add_label, &add_label_data);
  if (add_label_data.buffer_overflow)
    {
      gb_widget_output_text (data, Items, "");
      gb_widget_output_int (data, Choice, 0);
      if (data->action == GB_SHOWING)
	{
	  property_set_sensitive (Items, FALSE);
	  property_set_sensitive (Choice, FALSE);
	}
    }
  else
    {
      gb_widget_output_translatable_text_in_lines (data, Items, items);
      gb_widget_output_int (data, Choice, add_label_data.selected_index);
      if (data->action == GB_SHOWING)
	{
	  property_set_sensitive (Items, TRUE);
	  property_set_sensitive (Choice, TRUE);
	}
    }
}