예제 #1
0
static E_Widget *
_e_widget_entry_handle(Enhance *en, EXML_Node *node)
{
    E_Widget  *entry;
    char      *id;

    id = ecore_hash_get(node->attributes, "id");
    if(!id) return NULL;

    entry = _e_widget_new(en, node, etk_entry_new(), id);

    return entry;
}
void etk_directory_add_dialog_create(entropy_generic_file* parent) 
{
	Etk_Widget* vbox;
	Etk_Widget* hbox;
	Etk_Widget* label;
	Etk_Widget* button;
	etk_directory_add_dialog* dialog = calloc(1, sizeof(etk_directory_add_dialog));

	dialog->parent = parent;

	dialog->window = etk_window_new();
	etk_window_title_set(ETK_WINDOW(dialog->window), "Create Directory..");
	etk_window_wmclass_set(ETK_WINDOW(dialog->window), "dirdialog", "dirdialog");
	etk_widget_size_request_set(ETK_WIDGET(dialog->window), 250, 80);

	vbox =etk_vbox_new(ETK_FALSE,0);
	etk_container_add(ETK_CONTAINER(dialog->window), vbox);
	
	hbox = etk_hbox_new(ETK_FALSE,0);
	etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_NONE, 0);
	
	label = etk_label_new("Directory Name");
	etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

	dialog->entry = etk_entry_new();
	etk_box_append(ETK_BOX(hbox), dialog->entry, ETK_BOX_START, ETK_BOX_NONE, 0);

	hbox = etk_hbox_new(ETK_FALSE,0);
	etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_NONE, 0);



	button = etk_button_new_with_label("Create");
	etk_box_append(ETK_BOX(hbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_directory_add_dialog_create_cb), dialog);

	button = etk_button_new_with_label("Cancel");
	etk_box_append(ETK_BOX(hbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_directory_add_dialog_cancel_cb), dialog);

	

	etk_widget_show_all(dialog->window);
	
}
예제 #3
0
/* theme preview widget */
static Etk_Widget *_etk_prefs_theme_preview_get(const char *theme)
{
   char file[PATH_MAX];
   static Etk_Widget *box = NULL;
   Etk_Widget *widget;
   Etk_Widget *vbox;
   Etk_Widget *frame;
   
   snprintf(file, sizeof(file), PACKAGE_DATA_DIR"/themes/%s.edj", theme);
   if (!ecore_file_exists(file))
   {
      char *home;
      
      home = getenv("HOME");
      if (!home)
	return NULL;
      
      snprintf(file, sizeof(file), "%s/.e/etk/themes/%s.edj", home, theme);
      if (!ecore_file_exists(file))
	return NULL;
   }
   
   free(_etk_prefs_widget_theme);
   _etk_prefs_widget_theme = strdup(theme);
   
   if (box)
   {
      etk_widget_theme_file_set(box, file);
      return box;
   }
   
   box = etk_vbox_new(ETK_FALSE, 0);   
   etk_widget_theme_file_set(box, file);
   
   frame = etk_frame_new(_("Buttons"));
   etk_box_append(ETK_BOX(box), frame, ETK_BOX_START, ETK_BOX_NONE, 0);
   vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_container_add(ETK_CONTAINER(frame), vbox);
   widget = etk_button_new_with_label(_("Regular Button"));
   etk_box_append(ETK_BOX(vbox), widget, ETK_BOX_START, ETK_BOX_NONE, 0);   
   widget = etk_check_button_new_with_label(_("Check Button"));
   etk_box_append(ETK_BOX(vbox), widget, ETK_BOX_START, ETK_BOX_NONE, 0);   
   widget = etk_radio_button_new_with_label(_("Radio Button"), NULL);
   etk_box_append(ETK_BOX(vbox), widget, ETK_BOX_START, ETK_BOX_NONE, 0);   
   
   frame = etk_frame_new(_("Text"));
   etk_box_append(ETK_BOX(box), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
   vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_container_add(ETK_CONTAINER(frame), vbox);
   widget = etk_entry_new();
   etk_entry_text_set(ETK_ENTRY(widget), _("Sample text..."));
   etk_box_append(ETK_BOX(vbox), widget, ETK_BOX_START, ETK_BOX_NONE, 0);
   widget = etk_text_view_new();
   etk_textblock_text_set(etk_text_view_textblock_get(ETK_TEXT_VIEW(widget)),
			  _("Multi-line text widget!\nHow about that! (="),
			  ETK_TRUE);
   etk_widget_size_request_set(widget, 320, 50);
   etk_box_append(ETK_BOX(vbox), widget, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
         
   return box;
}
예제 #4
0
void evolve_gui_general_table_populate(Evolve_Widget *widget)
{
   Etk_Widget *label;
   Etk_Widget *entry;
   Etk_Type *type;
   Eina_List *l, *list = NULL;
   char *str;
   int i = 2;
   
   if (!widget || !widget->type || !(type = evolve_widget_type_to_etk(widget->type)))
     return;

   etk_type_property_list(type, &list);
   
   etk_table_resize(ETK_TABLE(_evolve_gui_gen_table), 0, 0);
   etk_table_resize(ETK_TABLE(_evolve_gui_gen_table), 2, eina_list_count(list) + 2);
   
   label = etk_label_new("Class:");
   entry = etk_entry_new();
   etk_entry_text_set(ETK_ENTRY(entry), type->name);
   etk_widget_disabled_set(entry, ETK_TRUE);   
   etk_table_attach_default(ETK_TABLE(_evolve_gui_gen_table), label,
			    0, 0, 0, 0);
   etk_table_attach_default(ETK_TABLE(_evolve_gui_gen_table), entry,
			    1, 1, 0, 0);
   
   label = etk_label_new("Name:");
   entry = etk_entry_new();
   etk_entry_text_set(ETK_ENTRY(entry), widget->name);
   etk_table_attach_default(ETK_TABLE(_evolve_gui_gen_table), label,
			    0, 0, 1, 1);
   etk_table_attach_default(ETK_TABLE(_evolve_gui_gen_table), entry,
			    1, 1, 1, 1);   

   for (l = list; l; l = l->next)
     {
	Evolve_Property *prop;
	Evolve_Property *eprop;
	Evolve_Property *p;
	Etk_String *value;
	Etk_Widget *vwidget;
	
	if (!(prop = l->data))
	  continue;
	
	str = evolve_util_string_humanize(prop->name);	
	label = etk_label_new(str);
	free(str);
	
	eprop = evolve_widget_property_get(widget, prop->name);
	if (eprop && eprop->default_value)	  
	  p = eprop;	  
	else
	  p = prop;
	
	switch(prop->type)
	  {
	   case EVOLVE_PROPERTY_INT:
	     value = etk_string_new_printf("%d", evolve_property_value_int_get(p->default_value));
	     vwidget = etk_spinner_new(0, 9999, evolve_property_value_int_get(p->default_value), 1, 10);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "widget", widget, NULL);
	     etk_signal_connect("value-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_spinner_value_changed_cb),
				NULL);
	     break;
	   case EVOLVE_PROPERTY_BOOL:
	     value = etk_string_new_printf("%d", evolve_property_value_bool_get(p->default_value));
	     vwidget = etk_combobox_new_default();
	       {
		  Etk_Combobox_Item *item;
		  
		  item = etk_combobox_item_append(ETK_COMBOBOX(vwidget), "True");
		  if (evolve_property_value_bool_get(p->default_value))
		    etk_combobox_active_item_set(ETK_COMBOBOX(vwidget), item);
		  item = etk_combobox_item_append(ETK_COMBOBOX(vwidget), "False");
		  if (!evolve_property_value_bool_get(p->default_value))
		    etk_combobox_active_item_set(ETK_COMBOBOX(vwidget), item);		  
	       }
	     break;
	   case EVOLVE_PROPERTY_CHAR:
	     value = etk_string_new_printf("%c", evolve_property_value_char_get(p->default_value));
	     vwidget = etk_entry_new();
	     etk_entry_text_set(ETK_ENTRY(vwidget), etk_string_get(value));
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_signal_connect("text-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_entry_text_changed_cb),
				widget);
	     break;		  
	   case EVOLVE_PROPERTY_FLOAT:
	     value = etk_string_new_printf("%f", evolve_property_value_float_get(p->default_value));
	     vwidget = etk_spinner_new(0.0, 9999.0, evolve_property_value_float_get(p->default_value), 0.1, 1.0);
	     etk_spinner_digits_set(ETK_SPINNER(vwidget), 1);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "widget", widget, NULL);
	     etk_signal_connect("value-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_spinner_value_changed_cb),
				NULL);
	     break;
	   case EVOLVE_PROPERTY_DOUBLE:
	     value = etk_string_new_printf("%g", evolve_property_value_double_get(p->default_value));
	     vwidget = etk_spinner_new(0.0, 9999.0, evolve_property_value_double_get(p->default_value), 0.1, 1.0);
	     etk_spinner_digits_set(ETK_SPINNER(vwidget), 1);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "widget", widget, NULL);
	     etk_signal_connect("value-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_spinner_value_changed_cb),
				NULL);
	     break;
	   case EVOLVE_PROPERTY_SHORT:
	     value = etk_string_new_printf("%d", evolve_property_value_short_get(p->default_value));
	     vwidget = etk_spinner_new(0, 9999, evolve_property_value_short_get(p->default_value), 1, 10);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "widget", widget, NULL);
	     etk_signal_connect("value-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_spinner_value_changed_cb),
				NULL);	     
	     break;
	   case EVOLVE_PROPERTY_LONG:
	     value = etk_string_new_printf("%li", evolve_property_value_long_get(p->default_value));
	     vwidget = etk_spinner_new(0, 9999, evolve_property_value_long_get(p->default_value), 1, 10);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "widget", widget, NULL);
	     etk_signal_connect("value-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_spinner_value_changed_cb),
				NULL);
	     break;
	   case EVOLVE_PROPERTY_POINTER:
	     value = etk_string_new_printf("cant cast PROPERTY_POINTER");
	     vwidget = etk_entry_new();
	     etk_entry_text_set(ETK_ENTRY(vwidget), etk_string_get(value));
	     etk_widget_disabled_set(vwidget, ETK_TRUE);
	     break;		  
	   case EVOLVE_PROPERTY_STRING:
	     value = etk_string_new_printf("%s", evolve_property_value_string_get(p->default_value));
	     vwidget = etk_entry_new();
	     etk_entry_text_set(ETK_ENTRY(vwidget), etk_string_get(value));
	     etk_entry_text_set(ETK_ENTRY(vwidget), etk_string_get(value));
	     etk_object_data_set_full(ETK_OBJECT(vwidget), "prop", p, NULL);
	     etk_signal_connect("text-changed", ETK_OBJECT(vwidget),
				ETK_CALLBACK(evolve_gui_property_entry_text_changed_cb),
				widget);	     
	     break;
	   default:
	     value = etk_string_new_printf("cant determine value");
	     vwidget = etk_entry_new();
	     etk_entry_text_set(ETK_ENTRY(vwidget), etk_string_get(value));
	     break;
	  }	
	
	if (p == prop)
	  {
	     int type;
	     
	     type = prop->type;	     
	     evolve_widget_property_set(widget, prop->name, etk_string_get(value), type);
	     eprop = evolve_widget_property_get(widget, prop->name);	     
	  }
	
	etk_object_destroy(ETK_OBJECT(value));
	
	etk_table_attach_default(ETK_TABLE(_evolve_gui_gen_table), label,
				  0, 0, i, i);
	etk_table_attach_default(ETK_TABLE(_evolve_gui_gen_table), vwidget,
				  1, 1, i, i);
	++i;
     }

   etk_widget_show_all(_evolve_gui_gen_table);      
}
예제 #5
0
/***   Implementation   ***/
Etk_Widget*
state_frame_create(void)
{
   Etk_Widget *vbox;
   Etk_Widget *hbox;
   Etk_Widget *label;
   Etk_Combobox_Item *ComboItem;

   //vbox
   vbox = etk_vbox_new(ETK_FALSE, 0);
  // etk_container_add(ETK_CONTAINER(UI_DescriptionFrame), vbox);

   //hbox
   hbox = etk_hbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   label = etk_label_new("<b>Name</b>");
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //StateEntry
   UI_StateEntry = etk_entry_new();
   UI_StateEntryImage = etk_image_new_from_stock(ETK_STOCK_DIALOG_OK,
                                                   ETK_STOCK_SMALL);
   etk_entry_image_set(ETK_ENTRY(UI_StateEntry), ETK_ENTRY_IMAGE_SECONDARY,
                       ETK_IMAGE(UI_StateEntryImage));
   etk_box_append(ETK_BOX(hbox), UI_StateEntry, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //UI_StateIndexSpinner
   //~ UI_StateIndexSpinner = etk_spinner_new(0.0, 1.0, 0.0, 0.1, 1.0);
   //~ etk_spinner_digits_set(ETK_SPINNER(UI_StateIndexSpinner), 1);
   //~ etk_widget_size_request_set(UI_StateIndexSpinner,45, 20);
   //~ etk_box_append(ETK_BOX(hbox),UI_StateIndexSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   //hbox
   hbox = etk_hbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   label = etk_label_new("<b>Aspect</b>");
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   label = etk_label_new("min:");
   etk_object_properties_set(ETK_OBJECT(label), "xalign", 1.0, NULL);
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_AspectMinSpinner
   UI_AspectMinSpinner = etk_spinner_new(0.0, 100.0, 0.0, 0.1, 1.0);
   etk_spinner_digits_set(ETK_SPINNER(UI_AspectMinSpinner), 1);
   etk_widget_size_request_set(UI_AspectMinSpinner,45, 20);
   etk_box_append(ETK_BOX(hbox), UI_AspectMinSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("max:");
   etk_object_properties_set(ETK_OBJECT(label), "xalign", 1.0, NULL);
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_AspectMaxSpinner
   UI_AspectMaxSpinner = etk_spinner_new(0.0, 100.0, 0.0, 0.1, 1.0);
   etk_spinner_digits_set(ETK_SPINNER(UI_AspectMaxSpinner), 1);
   etk_widget_size_request_set(UI_AspectMaxSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_AspectMaxSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_AspectCombo
   UI_AspectComboBox = etk_combobox_new();
   etk_combobox_column_add(ETK_COMBOBOX(UI_AspectComboBox), ETK_COMBOBOX_LABEL, 30, ETK_COMBOBOX_NONE, 0.0);
   etk_combobox_build(ETK_COMBOBOX(UI_AspectComboBox));
   etk_box_append(ETK_BOX(hbox), UI_AspectComboBox, ETK_BOX_START, ETK_BOX_NONE, 0);

   ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_AspectComboBox), "None");
   etk_combobox_item_data_set(ComboItem, (void*)EDJE_ASPECT_PREFER_NONE);

   ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_AspectComboBox), "Vertical");
   etk_combobox_item_data_set(ComboItem, (void*)EDJE_ASPECT_PREFER_VERTICAL);

   ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_AspectComboBox), "Horizontal");
   etk_combobox_item_data_set(ComboItem, (void*)EDJE_ASPECT_PREFER_HORIZONTAL);

   ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_AspectComboBox), "Both");
   etk_combobox_item_data_set(ComboItem, (void*)EDJE_ASPECT_PREFER_BOTH);
   
   //hbox
   hbox = etk_hbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("<b>Size</b> min");
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_StateMinWSpinner
   UI_StateMinWSpinner = etk_spinner_new(0, 2000, 0, 1, 10);
   etk_widget_size_request_set(UI_StateMinWSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_StateMinWSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("x");
   etk_object_properties_set(ETK_OBJECT(label), "xalign", 0.5, NULL);
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_StateMinHSpinner
   UI_StateMinHSpinner = etk_spinner_new(0, 2000, 0, 1, 10);
   etk_widget_size_request_set(UI_StateMinHSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_StateMinHSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("max");
   etk_object_properties_set(ETK_OBJECT(label), "xalign", 1.0, NULL);
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //UI_StateMaxWSpinner
   UI_StateMaxWSpinner = etk_spinner_new(0, 2000, 0, 1, 10);
   etk_widget_size_request_set(UI_StateMaxWSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_StateMaxWSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("x");
   etk_object_properties_set(ETK_OBJECT(label), "xalign", 0.5, NULL);
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_StateMaxHspinner
   UI_StateMaxHSpinner = etk_spinner_new(0, 2000, 0, 1, 10);
   etk_widget_size_request_set(UI_StateMaxHSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_StateMaxHSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   //hbox
   hbox = etk_hbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_NONE, 0);
   
   //UI_StateAlignHSpinner
   label = etk_label_new("<b>Align</b> H");
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   UI_StateAlignHSpinner = etk_spinner_new(0, 1, 0, 0.01, 0.1);
   etk_spinner_digits_set(ETK_SPINNER(UI_StateAlignHSpinner), 2);
   etk_widget_size_request_set(UI_StateAlignHSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_StateAlignHSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_StateAlignVSpinner
   label = etk_label_new("V");
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   UI_StateAlignVSpinner = etk_spinner_new(0, 1, 0, 0.01, 0.1);
   etk_spinner_digits_set(ETK_SPINNER(UI_StateAlignVSpinner), 2);
   etk_widget_size_request_set(UI_StateAlignVSpinner, 45, 20);
   etk_box_append(ETK_BOX(hbox), UI_StateAlignVSpinner, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_StateVisibleCheck
   UI_StateVisibleCheck = etk_check_button_new_with_label("Visible");
   etk_widget_padding_set(UI_StateVisibleCheck, 20, 0, 0, 0);
   etk_box_append(ETK_BOX(hbox), UI_StateVisibleCheck, ETK_BOX_START, ETK_BOX_NONE, 0);

   //hbox
   hbox = etk_hbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_NONE, 0);

   //UI_StateCCEntry
   label = etk_label_new("Color Class");
   etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   UI_StateCCEntry = etk_entry_new();
   etk_box_append(ETK_BOX(hbox), UI_StateCCEntry, ETK_BOX_START, ETK_BOX_NONE, 0);

   etk_signal_connect("key-down", ETK_OBJECT(UI_StateEntry),
                      ETK_CALLBACK(_state_Entry_key_down_cb), NULL);
   etk_signal_connect("mouse-click", ETK_OBJECT(UI_StateEntryImage),
                      ETK_CALLBACK(_state_EntryImage_clicked_cb), NULL);
   etk_signal_connect("text-changed", ETK_OBJECT(UI_StateEntry),
                      ETK_CALLBACK(_group_NamesEntry_text_changed_cb), NULL);

   etk_signal_connect("value-changed", ETK_OBJECT(UI_AspectMinSpinner),
                      ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_AspectMaxSpinner),
                      ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL);
   etk_signal_connect("active-item-changed", ETK_OBJECT(UI_AspectComboBox),
                      ETK_CALLBACK(_state_AspectComboBox_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_StateMinWSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_StateMinHSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_StateMaxWSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_StateMaxHSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_StateAlignVSpinner),
                      ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb),
                      (void*)STATE_ALIGNV_SPINNER);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_StateAlignHSpinner),
                      ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb),
                      (void*)STATE_ALIGNH_SPINNER);
   etk_signal_connect("toggled", ETK_OBJECT(UI_StateVisibleCheck),
                      ETK_CALLBACK(_state_VisibleCheck_toggled_cb), NULL);
   etk_signal_connect("text-changed", ETK_OBJECT(UI_StateCCEntry),
                      ETK_CALLBACK(_state_CCEntry_text_changed_cb), NULL);

   return vbox;
}
예제 #6
0
/***   Implementation   ***/
Etk_Widget*
data_window_create(void)
{
   Etk_Widget *hbox, *vbox, *hbox2, *vbox2, *vbox3;
   Etk_Tree_Col *col;
   Etk_Widget *button;
   Etk_Widget *frame;
   Etk_Widget *label;

   //DataWin
   UI_DataWin = etk_window_new();
   etk_window_title_set(ETK_WINDOW(UI_DataWin), "Data Browser");
   etk_window_resize(ETK_WINDOW(UI_DataWin), 400, 370);
   etk_signal_connect("delete-event", ETK_OBJECT(UI_DataWin),
                      ETK_CALLBACK(etk_window_hide_on_delete), NULL);
   etk_container_border_width_set(ETK_CONTAINER(UI_DataWin), 5);

   vbox = etk_vbox_new(ETK_FALSE, 5);
   etk_container_add(ETK_CONTAINER(UI_DataWin), vbox);

   //Description label
   label = etk_label_new("Data stored inside the edje file that can be accessed by the application.");
   etk_object_properties_set(ETK_OBJECT(label), "xalign", 0.5, NULL);
   etk_box_append(ETK_BOX(vbox), label, ETK_BOX_START, ETK_BOX_NONE, 7);

   hbox = etk_hbox_new(ETK_TRUE, 5);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   vbox2 = etk_vbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(hbox), vbox2, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //UI_DataList
   UI_DataList = etk_tree_new();
   etk_tree_mode_set(ETK_TREE(UI_DataList), ETK_TREE_MODE_LIST);
   etk_widget_size_request_set(UI_DataList, 225, 200);
   etk_tree_headers_visible_set(ETK_TREE(UI_DataList), ETK_TRUE);
   etk_tree_column_separators_visible_set(ETK_TREE(UI_DataList), ETK_TRUE);
   etk_tree_alternating_row_colors_set(ETK_TREE(UI_DataList), ETK_TRUE);
   col = etk_tree_col_new(ETK_TREE(UI_DataList), "Name", 100, 0.0);
   etk_tree_col_model_add(col, etk_tree_model_text_new());
   col = etk_tree_col_new(ETK_TREE(UI_DataList), "Value", 120, 0.0);
   etk_tree_col_model_add(col, etk_tree_model_text_new());
   etk_tree_build(ETK_TREE(UI_DataList));
   etk_box_append(ETK_BOX(vbox2), UI_DataList, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
   etk_signal_connect("row-selected", ETK_OBJECT(UI_DataList),
                      ETK_CALLBACK(_data_list_row_selected_cb), NULL);

   hbox2 = etk_hbox_new(ETK_TRUE, 0);
   etk_box_append(ETK_BOX(vbox2), hbox2, ETK_BOX_START, ETK_BOX_NONE, 0);

   //AddDataButton
   button = etk_button_new_from_stock(ETK_STOCK_LIST_ADD);
   etk_button_style_set(ETK_BUTTON(button), ETK_BUTTON_ICON);
   etk_signal_connect("clicked", ETK_OBJECT(button), 
                      ETK_CALLBACK(_data_add_button_click_cb), NULL);
   etk_box_append(ETK_BOX(hbox2), button, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //DelDataButton
   button = etk_button_new_from_stock(ETK_STOCK_LIST_REMOVE);
   etk_button_style_set(ETK_BUTTON(button), ETK_BUTTON_ICON);
   etk_signal_connect("clicked", ETK_OBJECT(button), 
                      ETK_CALLBACK(_data_del_button_click_cb), NULL);
   etk_box_append(ETK_BOX(hbox2), button, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   vbox2 = etk_vbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(hbox), vbox2, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //Data Editor
   frame = etk_frame_new("Data Editor");
   etk_box_append(ETK_BOX(vbox2), frame, ETK_BOX_START, ETK_BOX_FILL, 0);

   vbox3 = etk_vbox_new(ETK_FALSE, 0);
   etk_container_add(ETK_CONTAINER(frame), vbox3);

   //Name Entry
   label = etk_label_new("<b>Name</b>");
   etk_box_append(ETK_BOX(vbox3), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   UI_DataNameEntry = etk_entry_new();
   //etk_widget_disabled_set(UI_DataNameEntry, ETK_TRUE);
   etk_box_append(ETK_BOX(vbox3), UI_DataNameEntry,
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //Value Entry
   label = etk_label_new("<b>Value</b>");
   etk_box_append(ETK_BOX(vbox3), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   UI_DataValueEntry = etk_entry_new();
   etk_box_append(ETK_BOX(vbox3), UI_DataValueEntry,
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //Apply button
   UI_DataApplyButton =etk_button_new_from_stock(ETK_STOCK_DIALOG_APPLY);
   etk_signal_connect("clicked", ETK_OBJECT(UI_DataApplyButton),
                      ETK_CALLBACK(_data_apply_button_click_cb), NULL);
   etk_box_append(ETK_BOX(vbox3), UI_DataApplyButton,
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   return UI_DataWin;
}