예제 #1
0
static WIDGET *
charprop_get_widget(CharProperty *prop, PropDialog *dialog) 
{ 
  GtkWidget *ret = gtk_entry_new();  
  prophandler_connect(&prop->common, G_OBJECT(ret), "changed");
  return ret;
}
예제 #2
0
static WIDGET *
enumprop_get_widget(EnumProperty *prop, PropDialog *dialog) 
{ 
  GtkWidget *ret;

  if (prop->common.descr->extra_data) {
    PropEnumData *enumdata = prop->common.descr->extra_data;
    guint i;

#if GTK_CHECK_VERSION(2,24,0)
    ret = gtk_combo_box_text_new ();
#else
    ret = gtk_combo_box_new_text ();
#endif
    for (i = 0; enumdata[i].name != NULL; i++)
#if GTK_CHECK_VERSION(2,24,0)
      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (ret), _(enumdata[i].name)); 
#else
      gtk_combo_box_append_text (GTK_COMBO_BOX (ret), _(enumdata[i].name)); 
#endif
    prophandler_connect(&prop->common, G_OBJECT (ret), "changed");
  } else {
    ret = gtk_entry_new(); /* should use spin button/option menu */
  }  
  return ret;
}
예제 #3
0
static GtkWidget *
stringprop_get_widget(StringProperty *prop, PropDialog *dialog) 
{ 
  GtkWidget *ret = gtk_entry_new();
  gtk_entry_set_activates_default(GTK_ENTRY(ret), TRUE);
  prophandler_connect(&prop->common, G_OBJECT(ret), "changed");
  return ret;
}
예제 #4
0
static GtkWidget *
fileprop_get_widget(StringProperty *prop, PropDialog *dialog) 
{ 
  GtkWidget *ret = dia_file_selector_new();
  if (prop->common.descr->extra_data)
    dia_file_selector_set_extensions (DIAFILESELECTOR(ret), prop->common.descr->extra_data);
  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
  return ret;
}
예제 #5
0
static WIDGET *
boolprop_get_widget(BoolProperty *prop, PropDialog *dialog) 
{ 
  GtkWidget *ret = gtk_toggle_button_new_with_label(_("No"));
  g_signal_connect(G_OBJECT(ret), "toggled",
                   G_CALLBACK (bool_toggled), NULL);
  prophandler_connect(&prop->common, G_OBJECT(ret), "toggled");
  return ret;
}
예제 #6
0
파일: prop_geomtypes.c 프로젝트: mpuels/dia
static WIDGET *
fontsizeprop_get_widget(FontsizeProperty *prop, PropDialog *dialog) 
{ 
  GtkAdjustment *adj = GTK_ADJUSTMENT(gtk_adjustment_new(prop->fontsize_data,
                                                         G_MINFLOAT, 
                                                         G_MAXFLOAT,
                                                         0.1, 1.0, 0));
  GtkWidget *ret = dia_unit_spinner_new(adj, prefs_get_fontsize_unit());
  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
  return ret;
}
예제 #7
0
파일: prop_widgets.c 프로젝트: GNOME/dia
static WIDGET *
buttonprop_get_widget(ButtonProperty *prop, PropDialog *dialog)
{
  GtkWidget *ret = NULL;
  if (!prop->common.descr) return NULL;

  ret = gtk_button_new_with_label(_(prop->common.descr->tooltip));
  prophandler_connect(&prop->common, G_OBJECT(ret), "clicked");

  return ret;
}
예제 #8
0
static WIDGET *
intprop_get_widget(IntProperty *prop, PropDialog *dialog) 
{ 
  GtkAdjustment *adj = GTK_ADJUSTMENT(gtk_adjustment_new(prop->int_data,
                                                         G_MININT, G_MAXINT,
                                                         1.0, 10.0, 0));
  GtkWidget *ret = gtk_spin_button_new(adj, 1.0, 0);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ret),TRUE);
  prophandler_connect(&prop->common, G_OBJECT(ret), "value_changed");
  
  return ret;
}
예제 #9
0
파일: prop_geomtypes.c 프로젝트: mpuels/dia
static WIDGET *
lengthprop_get_widget(LengthProperty *prop, PropDialog *dialog) 
{ 
  GtkAdjustment *adj = GTK_ADJUSTMENT(gtk_adjustment_new(prop->length_data,
                                                         G_MINFLOAT, 
                                                         G_MAXFLOAT,
                                                         0.1, 1.0, 0));
  GtkWidget *ret = dia_unit_spinner_new(adj, prefs_get_length_unit());
  /*  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ret),TRUE);*/
  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
  
  return ret;
}
예제 #10
0
static GtkWidget *
multistringprop_get_widget(StringProperty *prop, PropDialog *dialog) 
{ 
  GtkWidget *ret = gtk_text_view_new();
  GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(ret));
  GtkWidget *frame = gtk_frame_new(NULL);
  gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
  gtk_container_add(GTK_CONTAINER(frame), ret);
  g_signal_connect(G_OBJECT(ret), "key-release-event", 
		   G_CALLBACK(multistringprop_handle_key), NULL);
  gtk_widget_show(ret);
  prophandler_connect(&prop->common, G_OBJECT(buffer), "changed");
  return frame;
}
예제 #11
0
파일: prop_widgets.c 프로젝트: GNOME/dia
static WIDGET *
listprop_get_widget(ListProperty *prop, PropDialog *dialog)
{
  GtkWidget *ret = gtk_list_new();

  gtk_list_set_selection_mode(GTK_LIST(ret),GTK_SELECTION_BROWSE);
  gtk_list_unselect_all(GTK_LIST(ret));

  g_signal_connect(G_OBJECT(ret), "select-child",
                   G_CALLBACK (listprop_select_child_signal), prop);

  prophandler_connect(&prop->common, G_OBJECT(ret), "selection-changed");
  return ret;
}