コード例 #1
0
ファイル: enhance_widget.c プロジェクト: playya/Enlightenment
static E_Widget *
_e_widget_spinner_handle(Enhance *en, EXML_Node *node)
{
    E_Widget   *spinner;
    char       *id;
    Ecore_List *props;
    EXML_Node  *prop;
    double      value;
    double      min       = 0;
    double      max       = 0;
    double      step_inc  = 1;
    double      page_inc  = 1;
    double      page_size = 1;

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

    props = node->children;
    ecore_list_first_goto(props);
    prop = ecore_list_current(props);
    while(prop != NULL)
    {
        if(!strcmp(prop->tag, "property"))
        {
            char *name;

            name = ecore_hash_get(prop->attributes, "name");
            if(!name) {
                prop = ecore_list_next(props);
                continue;
            }

            if(!strcmp(name, "adjustment"))
            {
                if(prop->value)
                {
                    char *adj;

                    adj = strdup(prop->value);
                    sscanf(adj, "%lf %lf %lf %lf %lf %lf", &value, &min, &max,
                           &step_inc, &page_inc, &page_size);
                    E_FREE(adj);
                }
            }
        }
        prop = ecore_list_next(props);
    }

    ecore_list_first_goto(props);

    spinner = _e_widget_new(en, node, etk_spinner_new(min, max,
                            value,
                            step_inc,
                            page_inc), id);

    return spinner;
}
コード例 #2
0
ファイル: mux_midi.c プロジェクト: eriser/ayemux
void show_midi_window_control(void *data){
	Etk_Widget *vbox, *vbox1, *hbox;
	Etk_Widget *frame;
	Etk_Widget *button;
	Etk_Widget *label;
	Etk_Combobox_Item *item;
	control_port_t * control_port;
	control_port = (control_port_t *)data;
	mydata = data;
	midi_t * midibinding;
	printf("tenative midi connection to ** %s \n", control_port->control_port_name);

	if (midi_win_control){
		etk_widget_show(ETK_WIDGET(midi_win_control));
		return;
	}

	midi_win_control = etk_window_new();

	etk_window_title_set(ETK_WINDOW(midi_win_control), "Set this controls Midi Properties");
	etk_window_resize(ETK_WINDOW(midi_win_control), 200, 0);
	etk_signal_connect("delete-event", ETK_OBJECT(midi_win_control), ETK_CALLBACK(etk_window_hide_on_delete), NULL);

	vbox = etk_vbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(midi_win_control), vbox);

	frame = etk_frame_new("Set Midi Binding for Control");
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5);

	hbox = etk_hbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(frame), hbox);
	label = etk_label_new("select control change ch#");
	etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 3);	
	
	spinnerControl = etk_spinner_new(1.0, 16.0, 1, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinnerControl, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinnerControl), ETK_CALLBACK(_ex_changed_value_control), 3);

	button = etk_button_new_with_label("Add Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Binding_Control, mydata);
	
	button = etk_button_new_with_label("Remove Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Remove_Binding_Control, mydata);
	
	etk_widget_show_all(midi_win_control);   
}
コード例 #3
0
/***   Implementation   ***/
Etk_Widget*
image_frame_create(void)
{
   Etk_Widget *label;
   Etk_Widget *table;
   Etk_Tree_Col *col1;

   //table
   table = etk_table_new(6, 5, ETK_TABLE_NOT_HOMOGENEOUS);

   //AddImageButton
   UI_ImageAddButton = etk_button_new_from_stock(ETK_STOCK_IMAGE_X_GENERIC);
   etk_object_properties_set(ETK_OBJECT(UI_ImageAddButton), "label", "Choose Image", NULL);
   etk_table_attach_default(ETK_TABLE(table), UI_ImageAddButton, 0, 2, 0, 0);

   //ImageName
   UI_ImageNameLabel = etk_label_new("none");
   etk_object_properties_set(ETK_OBJECT(UI_ImageNameLabel), "xalign", 0.5, NULL);
   etk_table_attach_default(ETK_TABLE(table), UI_ImageNameLabel, 3, 5, 0, 0);

   //ImageTweenVBox
   UI_ImageTweenVBox = etk_vbox_new(ETK_TRUE, 0);
   etk_table_attach_default(ETK_TABLE(table), UI_ImageTweenVBox, 0, 1, 1, 1);

   //AddTweenButton
   UI_AddTweenButton = etk_button_new_from_stock(ETK_STOCK_LIST_ADD);
   etk_button_style_set(ETK_BUTTON(UI_AddTweenButton), ETK_BUTTON_ICON);
   etk_signal_connect("clicked", ETK_OBJECT(UI_AddTweenButton),
      ETK_CALLBACK(_window_all_button_click_cb), (void*)IMAGE_TWEEN_ADD);
   etk_box_append(ETK_BOX(UI_ImageTweenVBox), UI_AddTweenButton,
                     ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //DeleteTweenButton
   UI_DeleteTweenButton = etk_button_new_from_stock(ETK_STOCK_LIST_REMOVE);
   etk_button_style_set(ETK_BUTTON(UI_DeleteTweenButton), ETK_BUTTON_ICON);
   etk_signal_connect("clicked", ETK_OBJECT(UI_DeleteTweenButton),
      ETK_CALLBACK(_window_all_button_click_cb), (void*)IMAGE_TWEEN_DELETE);
   etk_box_append(ETK_BOX(UI_ImageTweenVBox), UI_DeleteTweenButton,
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //MoveUpTweenButton
   UI_MoveUpTweenButton = etk_button_new_from_stock(ETK_STOCK_GO_UP);
   etk_button_style_set(ETK_BUTTON(UI_MoveUpTweenButton),  ETK_BUTTON_ICON);
   etk_signal_connect("clicked", ETK_OBJECT(UI_MoveUpTweenButton),
      ETK_CALLBACK(_window_all_button_click_cb), (void*)IMAGE_TWEEN_UP);
   etk_box_append(ETK_BOX(UI_ImageTweenVBox), UI_MoveUpTweenButton, 
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //MoveDownTweenButton
   UI_MoveDownTweenButton = etk_button_new_from_stock(ETK_STOCK_GO_DOWN);
   etk_button_style_set(ETK_BUTTON(UI_MoveDownTweenButton),  ETK_BUTTON_ICON);
   etk_signal_connect("clicked", ETK_OBJECT(UI_MoveDownTweenButton),
      ETK_CALLBACK(_window_all_button_click_cb), (void*)IMAGE_TWEEN_DOWN);
   etk_box_append(ETK_BOX(UI_ImageTweenVBox), UI_MoveDownTweenButton,
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   //ImageTweenList
   UI_ImageTweenList = etk_tree_new();
   etk_tree_mode_set(ETK_TREE(UI_ImageTweenList), ETK_TREE_MODE_LIST);
   etk_tree_headers_visible_set(ETK_TREE(UI_ImageTweenList), FALSE);
  // etk_tree_multiple_select_set(ETK_TREE(UI_ImageTweenList), ETK_TRUE);
   col1 = etk_tree_col_new(ETK_TREE(UI_ImageTweenList), "Tween", 130, 0.0);
   etk_tree_col_model_add(col1, etk_tree_model_image_new());
   etk_tree_col_model_add(col1, etk_tree_model_text_new());
   etk_tree_build(ETK_TREE(UI_ImageTweenList));
   etk_table_attach_default(ETK_TABLE(table),UI_ImageTweenList, 2, 5, 1, 1);

   label = etk_label_new("Alpha");
   etk_table_attach_default(ETK_TABLE(table),label, 0, 0, 2, 2);

   //ImageAlphaSlider
   UI_ImageAlphaSlider = etk_hslider_new(0, 255, 15, 1,20);
   etk_slider_label_set(ETK_SLIDER(UI_ImageAlphaSlider), "%.0f");
   etk_table_attach_default(ETK_TABLE(table),UI_ImageAlphaSlider, 1, 5, 2, 2);

   label = etk_label_new("Left");
   etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL);
   etk_table_attach_default(ETK_TABLE(table),label, 1, 1, 3, 3);

   label = etk_label_new("Right");
   etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL);
   etk_table_attach_default(ETK_TABLE(table),label, 2, 2, 3, 3);

   label = etk_label_new("Top");
   etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL);
   etk_table_attach_default(ETK_TABLE(table),label, 3, 3, 3, 3);

   label = etk_label_new("Bottom");
   etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL);
   etk_table_attach_default(ETK_TABLE(table),label, 4, 4, 3, 3);

   label = etk_label_new("Border");
   //etk_object_properties_set(ETK_OBJECT(label), "xalign", 0.5, NULL);
   etk_table_attach_default(ETK_TABLE(table),label, 0, 0, 4, 4);

   //UI_BorderLeftSpinner
   UI_BorderLeftSpinner = etk_spinner_new(0, 500, 0, 1, 10);
   etk_widget_size_request_set(UI_BorderLeftSpinner,45, 20);
   etk_table_attach_default(ETK_TABLE(table),UI_BorderLeftSpinner, 1, 1, 4, 4);

   //UI_BorderRightSpinner
   UI_BorderRightSpinner = etk_spinner_new(0, 500, 0, 1, 10);
   etk_widget_size_request_set(UI_BorderRightSpinner,45, 20);
   etk_table_attach_default(ETK_TABLE(table),UI_BorderRightSpinner, 2, 2, 4, 4);

   //UI_BorderTopSpinner
   UI_BorderTopSpinner = etk_spinner_new(0, 500, 0, 1, 10);
   etk_widget_size_request_set(UI_BorderTopSpinner,45, 20);
   etk_table_attach_default(ETK_TABLE(table),UI_BorderTopSpinner, 3, 3, 4, 4);

   //UI_BorderBottomSpinner
   UI_BorderBottomSpinner = etk_spinner_new(0, 500, 0, 1, 10);
   etk_widget_size_request_set(UI_BorderBottomSpinner,45, 20);
   etk_table_attach_default(ETK_TABLE(table),UI_BorderBottomSpinner, 4, 4, 4, 4);
   
   //UI_BorderMiddleCheck
   UI_BorderMiddleCheck = etk_check_button_new_with_label("Mid");
   etk_table_attach_default(ETK_TABLE(table),UI_BorderMiddleCheck, 5, 5, 4, 4);
   

   etk_signal_connect("row-selected", ETK_OBJECT(UI_ImageTweenList),
            ETK_CALLBACK(_image_TweenList_row_selected_cb), NULL);
   etk_signal_connect("clicked", ETK_OBJECT(UI_ImageAddButton),
            ETK_CALLBACK(_window_all_button_click_cb), (void*)IMAGE_BROWSER_SHOW);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_ImageAlphaSlider),
            ETK_CALLBACK(_image_AlphaSlider_value_changed_cb), NULL);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_BorderLeftSpinner),
                      ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                      (void *)BORDER_LEFT);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_BorderRightSpinner),
                      ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                      (void *)BORDER_RIGHT);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_BorderTopSpinner),
                      ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                      (void *)BORDER_TOP);
   etk_signal_connect("value-changed", ETK_OBJECT(UI_BorderBottomSpinner),
                      ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                      (void *)BORDER_BOTTOM);
   etk_signal_connect("toggled", ETK_OBJECT(UI_BorderMiddleCheck),
                      ETK_CALLBACK(_image_BorderMiddleCheck_toggled_cb), NULL);

   return table;
}
コード例 #4
0
ファイル: mux_midi.c プロジェクト: eriser/ayemux
void show_midi_window(void *data){
	Etk_Widget *vbox, *vbox1, *hbox;
	Etk_Widget *frame;
	Etk_Widget *button;
	Etk_Widget *label;
	Etk_Combobox_Item *item;
	midi_t * midibinding;
	
	if (midi_win){
		etk_widget_show(ETK_WIDGET(midi_win));
		return;
	}
	
	midibinding = (midi_t *)evas_list_nth(live_plugin->midi_data, (int)etk_tree_row_data_get(etk_tree_selected_row_get(rack_tree))-1);
	if(midibinding->channel != 0){
		spinner_data = midibinding->channel;
	}else{
		spinner_data = 1;
	}
	spinner1_data = midibinding->program;
		
	midi_win = etk_window_new();
	etk_window_title_set(ETK_WINDOW(midi_win), "Set Midi Properties");
	etk_window_resize(ETK_WINDOW(midi_win), 200, 0);
	etk_signal_connect("delete-event", ETK_OBJECT(midi_win), ETK_CALLBACK(etk_window_hide_on_delete), NULL);
	vbox = etk_vbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(midi_win), vbox);

	frame = etk_frame_new("Set Midi Binding for Rack State");
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5);
	
	hbox = etk_hbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(frame), hbox);
	label = etk_label_new("ch#");
	etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 3);	
	
	spinner = etk_spinner_new(1.0, 16.0, midibinding->channel, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinner, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinner), ETK_CALLBACK(_ex_changed_value), 1);

	combobox = etk_combobox_new_default();
	etk_box_append(ETK_BOX(hbox), combobox, ETK_BOX_START, ETK_BOX_NONE, 2);
	item = etk_combobox_item_append(ETK_COMBOBOX(combobox), "Program Change");
	etk_combobox_item_data_set(item, 1);
	if(midibinding->type==1){
		etk_combobox_active_item_set(combobox, item);
	}	
	item = etk_combobox_item_append(ETK_COMBOBOX(combobox), "Control Change");
	etk_combobox_item_data_set(item, 2);
	if(midibinding->type==2){
		etk_combobox_active_item_set(combobox, item);
	}

	spinner1 = etk_spinner_new(0.0, 127.0, midibinding->program, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinner1, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinner1), ETK_CALLBACK(_ex_changed_value), 2);

	/*
	button = etk_button_new_with_label("Learn");
	etk_box_append(ETK_BOX(hbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);	
	*/

	button = etk_button_new_with_label("Add Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Binding, data);
	
	
	
	etk_widget_show_all(midi_win);   
}
コード例 #5
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);      
}
コード例 #6
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;
}