static E_Widget * _e_widget_label_handle(Enhance *en, EXML_Node *node) { E_Widget *label; char *id; id = ecore_hash_get(node->attributes, "id"); if(!id) return NULL; label = _e_widget_new(en, node, etk_label_new(NULL), id); return label; }
ELAPI void * el_about(void) { Etk_Widget *win, *vbox, *hbox; Etk_Widget *button, *label; Etk_Widget *about; Etk_Textblock *msg; Etk_Textblock_Iter *iter; char buf[4096]; win = etk_dialog_new(); etk_window_title_set(ETK_WINDOW(win), "About "PACKAGE_NAME); etk_window_wmclass_set(ETK_WINDOW(win), PACKAGE"_About", PACKAGE_NAME"_About"); etk_container_border_width_set(ETK_CONTAINER(win), 3); etk_signal_connect("delete_event", ETK_OBJECT(win), ETK_CALLBACK(_close_cb), NULL); vbox = etk_vbox_new(ETK_FALSE, 0); etk_container_add(ETK_CONTAINER(win), vbox); label = etk_label_new("<h1>"PACKAGE_NAME"</h1>"); etk_label_alignment_set(ETK_LABEL(label), 0.5, 0.5); etk_box_append(ETK_BOX(vbox), label, ETK_BOX_START, ETK_BOX_NONE, 0); snprintf(buf, sizeof(buf), "<b>%s is an Etk-based IRC client in development</b>\n\n" "Christopher 'devilhorns' Michael\n\n%s\n", PACKAGE_NAME, PACKAGE_BUGREPORT); about = etk_text_view_new(); etk_widget_size_request_set(about, 250, 150); etk_box_append(ETK_BOX(vbox), about, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); msg = etk_text_view_textblock_get(ETK_TEXT_VIEW(about)); etk_textblock_object_cursor_visible_set(ETK_TEXT_VIEW(about)->textblock_object, ETK_FALSE); iter = etk_textblock_iter_new(msg); etk_textblock_iter_forward_end(iter); etk_textblock_insert_markup(msg, iter, buf, -1); etk_box_append(ETK_BOX(vbox), etk_hseparator_new(), ETK_BOX_END, ETK_BOX_FILL, 5); hbox = etk_hbox_new(ETK_FALSE, 3); etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_END, ETK_BOX_NONE, 0); button = etk_button_new_from_stock(ETK_STOCK_DIALOG_CLOSE); etk_signal_connect_swapped("clicked", ETK_OBJECT(button), ETK_CALLBACK(_close_cb), win); etk_box_append(ETK_BOX(hbox), button, ETK_BOX_END, ETK_BOX_NONE, 0); return win; }
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); }
void entropy_etk_delete_dialog_new(entropy_gui_component_instance* instance, Ecore_List* files) { char buf[PATH_MAX]; Etk_Widget* window = etk_window_new(); Etk_Widget* vbox= etk_vbox_new(ETK_TRUE,5); Etk_Widget* hbox = etk_hbox_new(ETK_TRUE,5); Etk_Widget* button; Etk_Widget* label; if (ecore_list_count(files) == 1) { ecore_list_first_goto(files); entropy_generic_file* file = ((entropy_generic_file*)ecore_list_current(files)); snprintf(buf, PATH_MAX, "Are you sure you want to delete '%s/%s'? ", file->path, file->filename); } else { snprintf(buf, PATH_MAX, "Are you sure you want to delete these %d files'? ", ecore_list_count(files)); } etk_window_title_set(ETK_WINDOW(window), buf); etk_container_add(ETK_CONTAINER(window), vbox); label = etk_label_new(buf); etk_box_append(ETK_BOX(vbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5); etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5); button = etk_button_new_with_label("Yes"); etk_container_add(ETK_CONTAINER(hbox), button); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_delete_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_YES ); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_widget_show(button); button = etk_button_new(); etk_button_label_set(ETK_BUTTON(button), "No"); etk_container_add(ETK_CONTAINER(hbox), button); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_delete_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_NO ); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_widget_show(button); etk_object_data_set(ETK_OBJECT(window), "files", files); etk_object_data_set(ETK_OBJECT(window), "instance", instance); etk_widget_show_all(window); }
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); }
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; }
/*** 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; }
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); }
void entropy_etk_user_interaction_dialog_new(entropy_file_operation* interact) { char buf[PATH_MAX]; Etk_Widget* window = etk_window_new(); Etk_Widget* vbox= etk_vbox_new(ETK_TRUE,5); Etk_Widget* hbox = etk_hbox_new(ETK_TRUE,5); Etk_Widget* button; Etk_Widget* label; snprintf(buf, PATH_MAX, "Confirm overwrite for '%s'? ", interact->file); etk_window_title_set(ETK_WINDOW(window), buf); etk_container_add(ETK_CONTAINER(window), vbox); label = etk_label_new(buf); etk_box_append(ETK_BOX(vbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5); etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5); button = etk_button_new_with_label("Yes"); etk_container_add(ETK_CONTAINER(hbox), button); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_object_data_set(ETK_OBJECT(button), "operation", (long*)interact->id); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_user_interaction_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_YES ); etk_widget_show(button); button = etk_button_new_with_label("Yes to all"); etk_container_add(ETK_CONTAINER(hbox), button); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_object_data_set(ETK_OBJECT(button), "operation", (long*)interact->id); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_user_interaction_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_YES_TO_ALL ); etk_widget_show(button); button = etk_button_new(); etk_button_label_set(ETK_BUTTON(button), "No"); etk_container_add(ETK_CONTAINER(hbox), button); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_object_data_set(ETK_OBJECT(button), "operation", (long*)interact->id); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_user_interaction_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_NO ); etk_widget_show(button); button = etk_button_new_with_label("No to all"); etk_container_add(ETK_CONTAINER(hbox), button); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_object_data_set(ETK_OBJECT(button), "operation", (long*)interact->id); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_user_interaction_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_NO_TO_ALL ); etk_widget_show(button); button = etk_button_new(); etk_button_label_set(ETK_BUTTON(button), "Abort"); etk_container_add(ETK_CONTAINER(hbox), button); etk_object_data_set(ETK_OBJECT(button), "window", window); etk_object_data_set(ETK_OBJECT(button), "operation", (long*)interact->id); etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(etk_entropy_user_interaction_dialog_cb), (int*)ENTROPY_USER_INTERACTION_RESPONSE_ABORT ); etk_widget_show(button); etk_widget_show_all(window); etk_widget_show(vbox); etk_widget_show(hbox); }
/*** Implementation ***/ Etk_Widget* gradient_frame_create(void) { Etk_Widget *table; Etk_Widget *label; Etk_Combobox_Item *item; //table table = etk_table_new(2, 5, ETK_TABLE_NOT_HOMOGENEOUS); //UI_GradientTypeComboBox label = etk_label_new("<b>Type</b>"); etk_table_attach(ETK_TABLE(table), label, 0, 0, 0, 0, ETK_TABLE_NONE, 0, 0); UI_GradientTypeComboBox = etk_combobox_new(); etk_combobox_items_height_set(ETK_COMBOBOX(UI_GradientTypeComboBox), 24); etk_combobox_column_add(ETK_COMBOBOX(UI_GradientTypeComboBox), ETK_COMBOBOX_IMAGE, 27, ETK_COMBOBOX_NONE, 0.0); etk_combobox_column_add(ETK_COMBOBOX(UI_GradientTypeComboBox), ETK_COMBOBOX_LABEL, 75, ETK_COMBOBOX_EXPAND_FILL, 0.0); etk_combobox_build(ETK_COMBOBOX(UI_GradientTypeComboBox)); etk_table_attach_default(ETK_TABLE(table), UI_GradientTypeComboBox, 1, 1, 0, 0); item = etk_combobox_item_append(ETK_COMBOBOX(UI_GradientTypeComboBox), etk_image_new_from_edje(EdjeFile,"GRAD_LINEAR.PNG"), "linear"); item = etk_combobox_item_append(ETK_COMBOBOX(UI_GradientTypeComboBox), etk_image_new_from_edje(EdjeFile,"GRAD_RADIAL.PNG"), "radial"); item = etk_combobox_item_append(ETK_COMBOBOX(UI_GradientTypeComboBox), etk_image_new_from_edje(EdjeFile,"GRAD_RECTANGULAR.PNG"), "rectangular"); item = etk_combobox_item_append(ETK_COMBOBOX(UI_GradientTypeComboBox), etk_image_new_from_edje(EdjeFile,"GRAD_ANGULAR.PNG"), "angular"); item = etk_combobox_item_append(ETK_COMBOBOX(UI_GradientTypeComboBox), etk_image_new_from_edje(EdjeFile,"GRAD_SINUSOIDAL.PNG"), "sinusoidal"); //UI_GradientSpectraComboBox label = etk_label_new("<b>Spectra</b>"); etk_table_attach(ETK_TABLE(table), label, 0, 0, 1, 1, ETK_TABLE_NONE, 0, 0); UI_GradientSpectraComboBox = etk_combobox_new(); etk_combobox_column_add(ETK_COMBOBOX(UI_GradientSpectraComboBox), ETK_COMBOBOX_OTHER, 45, ETK_COMBOBOX_NONE, 0.5); etk_combobox_column_add(ETK_COMBOBOX(UI_GradientSpectraComboBox), ETK_COMBOBOX_LABEL, 100, ETK_COMBOBOX_EXPAND_FILL, 0.0); etk_combobox_build(ETK_COMBOBOX(UI_GradientSpectraComboBox)); etk_table_attach_default(ETK_TABLE(table), UI_GradientSpectraComboBox, 1, 1, 1, 1); //GradientAlphaSlider label = etk_label_new("<b>Alpha</b>"); etk_table_attach(ETK_TABLE(table), label, 0, 0, 2, 2, ETK_TABLE_NONE, 0, 0); UI_GradientAlphaSlider = etk_hslider_new(0, 255, 15, 1,20); etk_slider_label_set(ETK_SLIDER(UI_GradientAlphaSlider), "%.0f"); etk_table_attach_default(ETK_TABLE(table), UI_GradientAlphaSlider, 1, 1, 2, 2); //GradientAngleSlider label = etk_label_new("<b>Angle</b>"); etk_table_attach(ETK_TABLE(table), label, 0, 0, 3, 3, ETK_TABLE_NONE, 0, 0); UI_GradientAngleSlider = etk_hslider_new(0, 360, 15, 1,20); etk_slider_label_set(ETK_SLIDER(UI_GradientAngleSlider), "%.0f"); etk_table_attach_default(ETK_TABLE(table), UI_GradientAngleSlider, 1, 1, 3, 3); //~ //hbox (first handler) //~ hbox = etk_hbox_new(ETK_FALSE, 0); //~ etk_table_attach_default(ETK_TABLE(table), hbox, 0, 2, 3, 3); //~ label = etk_label_new("<b>Start X </b>"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); //~ //UI_GradientRel1XSpinner //~ UI_GradientRel1XSpinner = etk_spinner_new(-100.0, 100.0, 0.0, 0.01, 0.1); //~ etk_spinner_digits_set(ETK_SPINNER(UI_GradientRel1XSpinner), 2); //~ etk_widget_size_request_set(UI_GradientRel1XSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel1XSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //~ label = etk_label_new("+"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0); //~ //UI_GradientRel1XOffsetSpinner //~ UI_GradientRel1XOffsetSpinner = etk_spinner_new(-2000, 2000, 0, 1, 10); //~ etk_widget_size_request_set(UI_GradientRel1XOffsetSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel1XOffsetSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //~ label = etk_label_new("<b> Y </b>"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); //~ //UI_GradientRel1YSpinner //~ UI_GradientRel1YSpinner = etk_spinner_new(-100.0, 100.0, 0.0, 0.01, 0.1); //~ etk_spinner_digits_set(ETK_SPINNER(UI_GradientRel1YSpinner), 2); //~ etk_widget_size_request_set(UI_GradientRel1YSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel1YSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //~ label = etk_label_new("+"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0); //~ //UI_GradientRel1YOffsetSpinner //~ UI_GradientRel1YOffsetSpinner = etk_spinner_new(-2000, 2000, 0, 1, 10); //~ etk_widget_size_request_set(UI_GradientRel1YOffsetSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel1YOffsetSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //hbox (second handler) //~ hbox = etk_hbox_new(ETK_FALSE, 0); //~ etk_table_attach_default(ETK_TABLE(table), hbox, 0, 2, 4, 4); //~ label = etk_label_new("<b>End X </b>"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); //~ //UI_GradientRel2XSpinner //~ UI_GradientRel2XSpinner = etk_spinner_new(-100.0, 100.0, 0.0, 0.01, 0.1); //~ etk_spinner_digits_set(ETK_SPINNER(UI_GradientRel2XSpinner), 2); //~ etk_widget_size_request_set(UI_GradientRel2XSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel2XSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //~ label = etk_label_new("+"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0); //~ //UI_GradientRel2XOffsetSpinner //~ UI_GradientRel2XOffsetSpinner = etk_spinner_new(-2000, 2000, 0, 1, 10); //~ etk_widget_size_request_set(UI_GradientRel2XOffsetSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel2XOffsetSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //~ label = etk_label_new("<b> Y </b>"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); //~ //UI_GradientRel2YSpinner //~ UI_GradientRel2YSpinner = etk_spinner_new(-100.0, 100.0, 0.0, 0.01, 0.1); //~ etk_spinner_digits_set(ETK_SPINNER(UI_GradientRel2YSpinner), 2); //~ etk_widget_size_request_set(UI_GradientRel2YSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel2YSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); //~ label = etk_label_new("+"); //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0); //~ //UI_GradientRel2YOffsetSpinner //~ UI_GradientRel2YOffsetSpinner = etk_spinner_new(-2000, 2000, 0, 1, 10); //~ etk_widget_size_request_set(UI_GradientRel2YOffsetSpinner, 45, 20); //~ etk_box_append(ETK_BOX(hbox), UI_GradientRel2YOffsetSpinner, //~ ETK_BOX_START, ETK_BOX_NONE, 0); etk_signal_connect("item-activated", ETK_OBJECT(UI_GradientTypeComboBox), ETK_CALLBACK(_gradient_type_combo_activated_cb), NULL); etk_signal_connect("item-activated", ETK_OBJECT(UI_GradientSpectraComboBox), ETK_CALLBACK(_gradient_spectra_combo_activated_cb), NULL); etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientAlphaSlider), ETK_CALLBACK(_image_AlphaSlider_value_changed_cb), NULL); etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientAngleSlider), ETK_CALLBACK(_gradient_AngleSlider_value_changed_cb), NULL); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel1XSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL1X_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel1YSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL1Y_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel2XSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL2X_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel2YSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL2Y_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel1XOffsetSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL1XO_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel1YOffsetSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL1YO_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel2XOffsetSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL2XO_SPINNER); //~ etk_signal_connect("value-changed", ETK_OBJECT(UI_GradientRel2YOffsetSpinner), //~ ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), //~ (void *)REL2YO_SPINNER); return table; }
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); }
/*** 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; }
/*** 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; }