Exemplo n.º 1
0
static void
combo_types_changed_cb (GtkComboBoxText *combo,
			GtkWidget **buttons)
{
  int i;
  GtkWidget *old_parent, *new_parent;
  GtkButtonBoxStyle style;

  gint active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));

  if (active == GTK_ORIENTATION_HORIZONTAL) {
    old_parent = vbbox;
    new_parent = hbbox;
  } else {
    old_parent = hbbox;
    new_parent = vbbox;
  }

  bbox = new_parent;

  for (i = 0; i < N_BUTTONS; i++) {
    reparent_widget (buttons[i], old_parent, new_parent);
  }
  
  gtk_widget_hide (old_parent);
  style = gtk_button_box_get_layout (GTK_BUTTON_BOX (old_parent));
  gtk_button_box_set_layout (GTK_BUTTON_BOX (new_parent), style);
  gtk_widget_show (new_parent);
}
Exemplo n.º 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_hbutton_box_get_properties (GtkWidget * widget, GbWidgetGetArgData * data)
{
    GtkButtonBoxStyle layout;
    gint i, spacing;
    gboolean spacing_visible = FALSE;

    if (data->action != GB_SAVING)
        gb_widget_output_int (data, Size, g_list_length (GTK_BOX (widget)->children));

    layout = gtk_button_box_get_layout (GTK_BUTTON_BOX (widget));
    for (i = 0; i < sizeof (GbLayoutValues) / sizeof (GbLayoutValues[0]); i++)
    {
        if (GbLayoutValues[i] == layout)
            gb_widget_output_choice (data, Layout, i, GbLayoutSymbols[i]);
    }

    if (!gb_hbutton_box_is_dialog_action_area (widget))
    {
        spacing_visible = TRUE;
        spacing = gtk_box_get_spacing (GTK_BOX (widget));
        gb_widget_output_int (data, Spacing, spacing);
    }

    if (data->action == GB_SHOWING)
    {
        property_set_visible (Spacing, spacing_visible);
    }
}
Exemplo n.º 3
0
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkButtonBox_gtk_1button_1box_1get_1layout
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	GtkButtonBoxStyle result;
	jint _result;
	GtkButtonBox* self;

	// convert parameter self
	self = (GtkButtonBox*) _self;

	// call function
	result = gtk_button_box_get_layout(self);

	// cleanup parameter self

	// translate return value to JNI type
	_result = (jint) result;

	// and finally
	return _result;
}
Exemplo n.º 4
0
/* Retrieves the method being used to arrange the buttons in a button box. */
int
clip_GTK_BUTTONBOXGETLAYOUT(ClipMachine * ClipMachineMemory)
{
   C_widget *cbbox = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(cbbox, GTK_IS_BUTTON_BOX);
   _clip_retni(ClipMachineMemory, gtk_button_box_get_layout(GTK_BUTTON_BOX(cbbox->widget)));
   return 0;
 err:
   return 1;
}
Exemplo n.º 5
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_vbutton_box_get_properties (GtkWidget * widget, GbWidgetGetArgData * data)
{
  GtkButtonBoxStyle layout;
  gint i, spacing, min_width, min_height, ipad_x, ipad_y;
  gint default_spacing;
  gint default_min_width, default_min_height, default_ipad_x, default_ipad_y;

  if (data->action != GB_SAVING)
    gb_widget_output_int (data, Size, g_list_length (GTK_BOX (widget)->children));

  layout = gtk_button_box_get_layout (GTK_BUTTON_BOX (widget));
  for (i = 0; i < sizeof (GbLayoutValues) / sizeof (GbLayoutValues[0]); i++)
    {
      if (GbLayoutValues[i] == layout)
	gb_widget_output_choice (data, Layout, i, GbLayoutSymbols[i]);
    }

  spacing = gtk_button_box_get_spacing (GTK_BUTTON_BOX (widget));
  default_spacing = gtk_vbutton_box_get_spacing_default ();
  if (spacing == GTK_BUTTONBOX_DEFAULT)
    spacing = default_spacing;
  gb_widget_output_int (data, Spacing, spacing);

  gtk_button_box_get_child_size_default (&default_min_width,
					 &default_min_height);
  gtk_button_box_get_child_size (GTK_BUTTON_BOX (widget), &min_width,
				 &min_height);
  if (min_width == GTK_BUTTONBOX_DEFAULT)
    min_width = default_min_width;
  if (min_height == GTK_BUTTONBOX_DEFAULT)
    min_height = default_min_height;
  gb_widget_output_int (data, Width, min_width);
  gb_widget_output_int (data, Height, min_height);

  gtk_button_box_get_child_ipadding_default (&default_ipad_x, &default_ipad_y);
  gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (widget), &ipad_x, &ipad_y);
  if (ipad_x == GTK_BUTTONBOX_DEFAULT)
    ipad_x = default_ipad_x;
  if (ipad_y == GTK_BUTTONBOX_DEFAULT)
    ipad_y = default_ipad_y;
  gb_widget_output_int (data, XPad, ipad_x);
  gb_widget_output_int (data, YPad, ipad_y);
}
Exemplo n.º 6
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_vbutton_box_get_properties (GtkWidget * widget, GbWidgetGetArgData * data)
{
  GtkButtonBoxStyle layout;
  gint i, spacing;

  if (data->action != GB_SAVING)
    gb_widget_output_int (data, Size, g_list_length (GTK_BOX (widget)->children));

  layout = gtk_button_box_get_layout (GTK_BUTTON_BOX (widget));
  for (i = 0; i < sizeof (GbLayoutValues) / sizeof (GbLayoutValues[0]); i++)
    {
      if (GbLayoutValues[i] == layout)
	gb_widget_output_choice (data, Layout, i, GbLayoutSymbols[i]);
    }

  spacing = gtk_box_get_spacing (GTK_BOX (widget));
  gb_widget_output_int (data, Spacing, spacing);
}