Ejemplo n.º 1
0
void etk_test_evas_object_window_create(void *data)
{
	Evas *evas;
	Evas_Object *edje_object;
	Evas_Object *evas_object;
	static Etk_Widget *window = NULL;
	Etk_Widget *vbox;
	Etk_Widget *frame;
	Etk_Widget *etk_evas_object;
	int w, h;

	if (window)
	{
		etk_widget_show_all(window);
		return;
	}

	window = etk_window_new();
  etk_signal_connect_by_code(ETK_WINDOW_DELETE_EVENT_SIGNAL, ETK_OBJECT(window), ETK_CALLBACK(etk_window_hide_on_delete), NULL);
	etk_window_title_set(ETK_WINDOW(window), "Etk-Evas Object Test");

	evas = etk_toplevel_evas_get(ETK_TOPLEVEL(window));

	vbox = etk_vbox_new(ETK_FALSE, 5);

	/* Add an edje object */
	frame = etk_frame_new("Edje Object");
	edje_object = edje_object_add(evas);
	edje_object_file_set(edje_object, PACKAGE_DATA_DIR"/test/clock.edj", "icon"); 
	edje_object_size_min_get(edje_object, &w, &h);
	edje_extern_object_min_size_set(edje_object, w, h);
	evas_object_resize(edje_object, w, h);
	etk_evas_object = etk_evas_object_new();
	etk_evas_object_set_object(ETK_EVAS_OBJECT(etk_evas_object), edje_object);
	etk_container_add(ETK_CONTAINER(frame), etk_evas_object);
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	/* Add an evas rectangle */
	frame = etk_frame_new("Evas Object");
	evas_object = evas_object_rectangle_add(evas);
	evas_object_resize(evas_object, 150, 150);
	evas_object_color_set(evas_object, 150, 100, 100, 255);
	etk_evas_object = etk_evas_object_new();
	etk_evas_object_set_object(ETK_EVAS_OBJECT(etk_evas_object), evas_object);
	etk_container_add(ETK_CONTAINER(frame), etk_evas_object);
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_END, ETK_BOX_EXPAND_FILL, 0);

	etk_container_add(ETK_CONTAINER(window), vbox);
	etk_widget_show_all(window);
}
Ejemplo n.º 2
0
Entrance_Widget
ew_group_new(const char *title, int direction)
{
	Entrance_Widget ew = ew_new();
	if(!ew)
	{
		return NULL;
	}

	ew_title_set(ew, title);
	if(title)
	{
		ew->owner = etk_frame_new(title);
	}
	else
	  ew->owner = etk_vbox_new(ETK_FALSE, 0);

	if(direction) /*HORIZONTAL*/
	  ew->box = etk_hbox_new(ETK_FALSE, 0);
	else
	  ew->box = etk_vbox_new(ETK_FALSE, 0);

	etk_container_add(ETK_CONTAINER(ew->owner), ew->box);

	return ew;
}
Ejemplo n.º 3
0
boot_panel* bootpanel_create(main_window *win)
{
    boot_panel* pnl;
    Etk_Widget *scroll,*vbox, *hbox,*text,*frame;

    pnl = malloc(sizeof(boot_panel));
    pnl->win = win;

    vbox = etk_vbox_new(ETK_FALSE, 5);
    hbox = etk_hbox_new(ETK_FALSE, 5);

    pnl->frame = hbox;
    etk_box_append(ETK_BOX(hbox), vbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

    scroll = etk_scrolled_view_new ();
    etk_box_append(ETK_BOX(vbox), scroll, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
    etk_widget_show(scroll);

    pnl->eth_list = etk_tree_new();
    pnl->eth_col0 = etk_tree_col_new(ETK_TREE(pnl->eth_list), _("Interfaces"), 80, 0.0);
    etk_tree_col_model_add(pnl->eth_col0, etk_tree_model_checkbox_new());
    etk_tree_col_model_add(pnl->eth_col0, etk_tree_model_text_new());

    etk_signal_connect_by_code(ETK_TREE_COL_CELL_VALUE_CHANGED_SIGNAL,
            ETK_OBJECT(pnl->eth_col0),
            ETK_CALLBACK(bootpanel_ethlist_checkbox_change_cb), pnl);

    etk_tree_mode_set(ETK_TREE(pnl->eth_list), ETK_TREE_MODE_LIST);
    etk_tree_build(ETK_TREE(pnl->eth_list));
    etk_container_add(ETK_CONTAINER(scroll), pnl->eth_list);

    text = etk_text_view_new();
    etk_widget_size_request_set(text, -1, 150);
    etk_object_properties_set(ETK_OBJECT(text), "focusable", ETK_FALSE, NULL);
    etk_textblock_text_set(ETK_TEXT_VIEW(text)->textblock,
            _("<p align=\"center\"><style effect=glow color1=#fa14 color2=#fe87><b>Help!</b></style>"
                "\n<p>When your computer boot, exalt starts and configure yours networks interfaces in the background. If you use the DHCP, your interface will get a IP address after a while.</p>"
                "\n<p>You can have a problem if you use a daemon as nfs-client. If the daemon need a network connection when it starts and your interface has no IP address, the daemon will not work. To avoid this problem Exalt can configure your interface in the foreground. If you select the interface in the list, Exalt will wait until your interface gets a IP address.</p>"
                "\n<p>If the interface doesn't get a IP address before the timeout, your computer will continue the boot process.</p>"
             ),
            ETK_TRUE);
    etk_box_append(ETK_BOX(hbox), text, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);


    frame=etk_frame_new(_("Timeout"));
    etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_FILL, 0);

    hbox = etk_hbox_new(ETK_FALSE, 5);
    etk_container_add(ETK_CONTAINER(frame), hbox);

    pnl->slider = etk_hslider_new(1,60,30,1,5);
    etk_box_append(ETK_BOX(hbox), pnl->slider, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
    etk_slider_label_set(ETK_SLIDER(pnl->slider), "%.0f");
    etk_signal_connect_by_code(ETK_RANGE_VALUE_CHANGED_SIGNAL, ETK_OBJECT(pnl->slider), ETK_CALLBACK(bootpanel_slider_value_changed_cb), pnl);
    etk_slider_update_policy_set(ETK_SLIDER(pnl->slider), ETK_SLIDER_DELAYED);

    bootpanel_update_timeout(pnl);

    return pnl;
}
Ejemplo n.º 4
0
static Etk_Widget *_etk_prefs_other_tab_create()
{
   Eina_List *engines;
   Eina_List *l;   
   char *engine;
   
   Etk_Widget *engine_list;
   
   Etk_Widget *frame;
   Etk_Widget *vbox;
   Etk_Tree_Col *col1;
   Etk_Tree_Row *row;
      
   /* main vbox */
   vbox = etk_vbox_new(ETK_FALSE, 0);
   
   /* tree to hold the engines list */
   engine_list = etk_tree_new();
   etk_widget_size_request_set(engine_list, 180, 240);
   etk_tree_mode_set(ETK_TREE(engine_list), ETK_TREE_MODE_LIST);
   etk_tree_multiple_select_set(ETK_TREE(engine_list), ETK_FALSE);
   etk_tree_rows_height_set(ETK_TREE(engine_list), 45);   
   etk_tree_headers_visible_set(ETK_TREE(engine_list), ETK_FALSE);
   etk_signal_connect("row-selected", ETK_OBJECT(engine_list), ETK_CALLBACK(_etk_prefs_engine_row_selected_cb), NULL);
   
   col1 = etk_tree_col_new(ETK_TREE(engine_list), "Engines", 150, 0.0);
   etk_tree_col_model_add(col1, etk_tree_model_text_new());
   etk_tree_build(ETK_TREE(engine_list));   
   
   /* scan for engines and add them to the list */
   engines = etk_engine_list_get();
   for(l = engines; l; l = l->next)
     {
        const char *engine_current = etk_config_engine_get();
	
	engine = l->data;
        row = etk_tree_row_append(ETK_TREE(engine_list), NULL, col1, engine,  NULL);
	if (engine_current)
        if (!strcmp(engine, engine_current))
	    etk_tree_row_select(row);
     }
   
   /* pack tree */
   etk_box_append(ETK_BOX(vbox), engine_list, ETK_BOX_START, ETK_BOX_NONE, 0);
      
   etk_container_border_width_set(ETK_CONTAINER(vbox), 5);

   frame = etk_frame_new(_("Engines"));
   etk_container_add(ETK_CONTAINER(frame), vbox);
   
   return frame;
}
Ejemplo n.º 5
0
static E_Widget *
_e_widget_frame_handle(Enhance *en, EXML_Node *node)
{
    E_Widget   *frame;
    char       *id;

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

    frame = _e_widget_new(en, node, etk_frame_new(NULL), id);

    return frame;
}
Ejemplo n.º 6
0
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);   
}
Ejemplo n.º 7
0
Etk_Widget*
image_browser_create(void)
{
   Etk_Widget *hbox, *vbox, *vbox2;
   Etk_Widget *button;
   Etk_Widget *frame;
   Etk_Widget *label;
   Etk_Widget *image;

   //ImageBrowserWin
   UI_ImageBrowserWin = etk_window_new();
   etk_window_title_set(ETK_WINDOW(UI_ImageBrowserWin), "Image Browser");
   etk_window_resize(ETK_WINDOW(UI_ImageBrowserWin), 590, 370);
   etk_signal_connect("delete-event", ETK_OBJECT(UI_ImageBrowserWin),
                      ETK_CALLBACK(etk_window_hide_on_delete), NULL);
   etk_container_border_width_set(ETK_CONTAINER(UI_ImageBrowserWin), 5);

   hbox = etk_hbox_new(ETK_FALSE, 0);
   etk_container_add (ETK_CONTAINER(UI_ImageBrowserWin), hbox);

   //ImageBrowserIconbox
   UI_ImageBrowserIconbox = etk_iconbox_new();
   etk_signal_connect("icon-selected", ETK_OBJECT(UI_ImageBrowserIconbox),
                      ETK_CALLBACK(_image_browser_iconbox_selected_cb), NULL);
   etk_box_append(ETK_BOX(hbox), UI_ImageBrowserIconbox,
                  ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

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

   //AddImageButton
   button = etk_button_new_from_stock(ETK_STOCK_DOCUMENT_OPEN);
   etk_object_properties_set(ETK_OBJECT(button), "label","Import image",NULL);
   etk_button_style_set(ETK_BUTTON(button), ETK_BUTTON_BOTH_VERT);
   etk_signal_connect("clicked", ETK_OBJECT(button),
            ETK_CALLBACK(_window_all_button_click_cb), (void*)TOOLBAR_IMAGE_FILE_ADD);
   etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);

   //DeleteImageButton
   button = etk_button_new_from_stock(ETK_STOCK_EDIT_DELETE);
   etk_object_properties_set(ETK_OBJECT(button), "label","Remove image",NULL);
   etk_button_style_set(ETK_BUTTON(button), ETK_BUTTON_BOTH_VERT);
   etk_widget_disabled_set(button, 1);
   etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);

   //EditImageButton
   button = etk_button_new_with_label("Edit Image");
   image = etk_image_new_from_edje(EdjeFile, "GIMP.PNG");
   etk_button_image_set(ETK_BUTTON(button), ETK_IMAGE(image));
   etk_button_style_set(ETK_BUTTON(button), ETK_BUTTON_BOTH_VERT);
   etk_widget_disabled_set(button, 1);
   etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);

   //ImageInfo
   frame = etk_frame_new("Image Info");
   etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 10);

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

   label = etk_label_new("<b>name:</b>");
   etk_box_append(ETK_BOX(vbox2), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("Unknow");
   etk_box_append(ETK_BOX(vbox2), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new(" ");
   etk_box_append(ETK_BOX(vbox2), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   UI_ImageBrowserSizeLabel = etk_label_new("<b>size:</b> Unknow");
   etk_object_properties_set(ETK_OBJECT(UI_ImageBrowserSizeLabel), "xalign", 0, NULL);
   etk_box_append(ETK_BOX(vbox2), UI_ImageBrowserSizeLabel,
                  ETK_BOX_START, ETK_BOX_NONE, 0);

   label = etk_label_new("<b>comp:</b> Unknow");
   etk_box_append(ETK_BOX(vbox2), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   //CloseButton
   button = etk_button_new_from_stock(ETK_STOCK_DIALOG_CLOSE);
   etk_button_style_set(ETK_BUTTON(button), ETK_BUTTON_BOTH_VERT);
   etk_signal_connect("clicked", ETK_OBJECT(button),
            ETK_CALLBACK(_window_all_button_click_cb), (void*)IMAGE_BROWSER_CLOSE);
   etk_box_append(ETK_BOX(vbox), button, 0, ETK_BOX_NONE, 0);

   return UI_ImageBrowserWin;
}
Ejemplo n.º 8
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;
}
Ejemplo n.º 9
0
/* theme page */
static Etk_Widget *_etk_prefs_theme_tab_create()
{
   Eina_List *themes;
   Eina_List *l;   
   char *theme;
   
   Etk_Widget *preview;
   Etk_Widget *theme_list;
   
   Etk_Widget *preview_hbox;
   Etk_Widget *frame;
   Etk_Widget *vbox;
   Etk_Tree_Col *col1;
   Etk_Tree_Row *row;
      
   /* main vbox */
   vbox = etk_vbox_new(ETK_FALSE, 0);
   
   /* hbox to hold tree and preview */
   preview_hbox = etk_hbox_new(ETK_FALSE, 5);
   etk_box_append(ETK_BOX(vbox), preview_hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
   
   /* the preview */
   preview = etk_frame_new(_("Preview"));
      
   /* tree to hold the theme list */
   theme_list = etk_tree_new();
   etk_widget_size_request_set(theme_list, 180, 240);
   etk_tree_mode_set(ETK_TREE(theme_list), ETK_TREE_MODE_LIST);
   etk_tree_multiple_select_set(ETK_TREE(theme_list), ETK_FALSE);
   etk_tree_rows_height_set(ETK_TREE(theme_list), 45);   
   etk_tree_headers_visible_set(ETK_TREE(theme_list), ETK_FALSE);
   etk_signal_connect("row-selected", ETK_OBJECT(theme_list), ETK_CALLBACK(_etk_prefs_theme_row_selected_cb), preview);
   
   col1 = etk_tree_col_new(ETK_TREE(theme_list), "Themes", 150, 0.0);
   etk_tree_col_model_add(col1, etk_tree_model_text_new());
   etk_tree_build(ETK_TREE(theme_list));   
   
   /* scan for themes and add them to the list */
   themes = etk_theme_widget_available_themes_get();
   for(l = themes; l; l = l->next)
     {
        const char *widget_theme = etk_config_widget_theme_get();
	
	theme = l->data;
        row = etk_tree_row_append(ETK_TREE(theme_list), NULL, col1, theme,  NULL);
	if (widget_theme)
        if (!strcmp(theme, widget_theme))
	    etk_tree_row_select(row);
     }
   
   /* pack tree + preview widget */
   etk_box_append(ETK_BOX(preview_hbox), theme_list, ETK_BOX_START, ETK_BOX_NONE, 0);
   etk_box_append(ETK_BOX(preview_hbox), preview, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
      
   etk_container_border_width_set(ETK_CONTAINER(vbox), 5);
   /* add frame */
   frame = etk_frame_new(_("Themes"));
   etk_container_add(ETK_CONTAINER(frame), vbox);
   
   return frame;
}
Ejemplo n.º 10
0
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);   
}
Ejemplo n.º 11
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;
}