From: <enl...@li...> - 2005-07-10 08:18:13
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin Modified Files: Makefile.am ewl_test.c ewl_test.h Added Files: ewl_calendar_test.c Log Message: Merged in Ewl_Calendar widget =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- Makefile.am 2 Jul 2005 03:43:02 -0000 1.5 +++ Makefile.am 10 Jul 2005 08:18:04 -0000 1.6 @@ -18,6 +18,7 @@ ewl_border_test.c \ ewl_box_test.c \ ewl_button_test.c \ + ewl_calendar_test.c \ ewl_colordialog_test.c \ ewl_colorpicker_test.c \ ewl_combo_test.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_test.c 2 Jul 2005 03:43:02 -0000 1.12 +++ ewl_test.c 10 Jul 2005 08:18:05 -0000 1.13 @@ -82,6 +82,12 @@ "other widget inside the button." }, { + "Calendar", + __create_calendar_test_window, + "ewl_calendar_test.c", + "Defines a calendar widget." + }, + { "ColorDialog", __create_colordialog_test_window, "ewl_colordialog_test.c", =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_test.h 2 Jul 2005 03:43:02 -0000 1.6 +++ ewl_test.h 10 Jul 2005 08:18:05 -0000 1.7 @@ -20,6 +20,7 @@ void __create_border_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_box_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_button_test_window (Ewl_Widget * w, void *ev_data, void *user_data); +void __create_calendar_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_colordialog_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_colorpicker_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_combo_test_window (Ewl_Widget * w, void *ev_data, void *user_data); |
From: <enl...@li...> - 2005-07-10 08:18:13
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h.in Makefile.am Added Files: ewl_calendar.c ewl_calendar.h Log Message: Merged in Ewl_Calendar widget =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Ewl.h.in,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- Ewl.h.in 6 Jul 2005 23:59:20 -0000 1.10 +++ Ewl.h.in 10 Jul 2005 08:18:05 -0000 1.11 @@ -327,6 +327,7 @@ #include <ewl_checkbutton.h> #include <ewl_radiobutton.h> #include <ewl_separator.h> +#include <ewl_calendar.h> @ewl_media_include@ #include <ewl_notebook.h> #include <ewl_progressbar.h> =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- Makefile.am 20 Jun 2005 20:35:02 -0000 1.5 +++ Makefile.am 10 Jul 2005 08:18:05 -0000 1.6 @@ -16,6 +16,7 @@ ewl_label.h \ ewl_button.h \ ewl_button_stock.h \ + ewl_calendar.h \ ewl_callback.h \ ewl_cell.h \ ewl_check.h \ @@ -79,6 +80,7 @@ ewl_label.c \ ewl_button.c \ ewl_button_stock.c \ + ewl_calendar.c \ ewl_callback.c \ ewl_cell.c \ ewl_check.c \ |
From: <enl...@li...> - 2005-07-10 08:26:43
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_calendar.c ewl_calendar.h Log Message: Cleaned up documentation on ewl_calendar =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_calendar.c 10 Jul 2005 08:18:05 -0000 1.1 +++ ewl_calendar.c 10 Jul 2005 08:26:37 -0000 1.2 @@ -105,6 +105,14 @@ ewl_widget_show(day_label); } +/** + * @param cal: The calendar to get the date frm + * @param str: a pre-initialized char* pointer to insert the date into + * @return none + * @brief Returns an ASCII formatted representation of the selected date + * + * Inserts an ASCII formatted string of the currently selected date into the char* str pointer + */ void ewl_calendar_ascii_time_get(Ewl_Calendar* cal, char* str) { time_t tm; struct tm* month_start; @@ -203,8 +211,10 @@ /** - * @return Returns NULL on failure, a new Ewl_IconBox on success - * @brief Creates a new Ewl_IconBox + * @return Returns NULL on failure, a new Ewl_Calendar on success + * @brief Creates a new Ewl_Calendar + * + * Creates a new Ewl_Calendar object */ Ewl_Widget *ewl_calendar_new() { Ewl_Calendar* ib; @@ -216,7 +226,7 @@ } if (!ewl_calendar_init(ib)) { - printf("Failed iconbox init...\n"); + printf("Failed calendar init...\n"); FREE(ib); ib = NULL; } @@ -224,6 +234,11 @@ DRETURN_PTR(EWL_WIDGET(ib), DLEVEL_STABLE); } +/** + * @param ib: The calendar widget to initialize + * @return Returns NULL on failure, a new Ewl_IconBox on success + * @brief Init a new Ewl_Calendar to default values and callbacks, and set date to today + */ int ewl_calendar_init(Ewl_Calendar* ib) { Ewl_Widget *w; Ewl_Widget *vbox; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_calendar.h 10 Jul 2005 08:18:05 -0000 1.1 +++ ewl_calendar.h 10 Jul 2005 08:26:37 -0000 1.2 @@ -6,7 +6,8 @@ /** * @file ewl_calendar.h * @defgroup Ewl_Calendar Calendar: The EWL Calendar Widget - * @brief Defines the Ewl_Calendar class, + * @brief Defines the Ewl_Calendar class + * Defined the Ewl_Calendar class, allowing selection of a day in time * */ |
From: <enl...@li...> - 2005-07-10 09:09:41
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h.in Makefile.am Added Files: ewl_datepicker.c ewl_datepicker.h Log Message: Added ewl_datepicker widget, and test case =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Ewl.h.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- Ewl.h.in 10 Jul 2005 08:18:05 -0000 1.11 +++ Ewl.h.in 10 Jul 2005 09:09:32 -0000 1.12 @@ -328,6 +328,7 @@ #include <ewl_radiobutton.h> #include <ewl_separator.h> #include <ewl_calendar.h> +#include <ewl_datepicker.h> @ewl_media_include@ #include <ewl_notebook.h> #include <ewl_progressbar.h> =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Makefile.am 10 Jul 2005 08:18:05 -0000 1.6 +++ Makefile.am 10 Jul 2005 09:09:32 -0000 1.7 @@ -26,6 +26,7 @@ ewl_combo.h \ ewl_config.h \ ewl_container.h \ + ewl_datepicker.h \ ewl_debug.h \ ewl_dialog.h \ ewl_embed.h \ @@ -90,6 +91,7 @@ ewl_combo.c \ ewl_config.c \ ewl_container.c \ + ewl_datepicker.c \ ewl_dialog.c \ ewl_embed.c \ ewl_entry.c \ |
From: <enl...@li...> - 2005-07-10 09:09:41
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin Modified Files: Makefile.am ewl_test.c ewl_test.h Added Files: ewl_datepicker_test.c Log Message: Added ewl_datepicker widget, and test case =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Makefile.am 10 Jul 2005 08:18:04 -0000 1.6 +++ Makefile.am 10 Jul 2005 09:09:32 -0000 1.7 @@ -22,6 +22,7 @@ ewl_colordialog_test.c \ ewl_colorpicker_test.c \ ewl_combo_test.c \ + ewl_datepicker_test.c \ ewl_dialog_test.c \ ewl_entry_test.c \ ewl_filedialog_test.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_test.c 10 Jul 2005 08:18:05 -0000 1.13 +++ ewl_test.c 10 Jul 2005 09:09:32 -0000 1.14 @@ -107,6 +107,12 @@ "The contents on the box are not drawn\n" "outside of the Evas." }, + { + "DatePicker", + __create_datepicker_test_window, + "ewl_datepicker_test.c", + "Defines a datepicker widget." + }, { "Dialog", __create_dialog_test_window, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_test.h 10 Jul 2005 08:18:05 -0000 1.7 +++ ewl_test.h 10 Jul 2005 09:09:32 -0000 1.8 @@ -24,6 +24,7 @@ void __create_colordialog_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_colorpicker_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_combo_test_window (Ewl_Widget * w, void *ev_data, void *user_data); +void __create_datepicker_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_dialog_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_fileselector_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_filedialog_test_window (Ewl_Widget * w, void *ev_data, void *user_data); |
From: <enl...@li...> - 2005-07-10 12:39:06
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/data/images Added Files: Draw.png End.png NewBCard.png Open.png Package.png World.png Log Message: Added ewl_iconbox and some sample (bsd licensed) icons |
From: <enl...@li...> - 2005-07-10 12:39:07
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h.in Makefile.am Added Files: ewl_iconbox.c ewl_iconbox.h Log Message: Added ewl_iconbox and some sample (bsd licensed) icons =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Ewl.h.in,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- Ewl.h.in 10 Jul 2005 09:09:32 -0000 1.12 +++ Ewl.h.in 10 Jul 2005 12:39:00 -0000 1.13 @@ -329,6 +329,7 @@ #include <ewl_separator.h> #include <ewl_calendar.h> #include <ewl_datepicker.h> +#include <ewl_iconbox.h> @ewl_media_include@ #include <ewl_notebook.h> #include <ewl_progressbar.h> =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 10 Jul 2005 09:09:32 -0000 1.7 +++ Makefile.am 10 Jul 2005 12:39:00 -0000 1.8 @@ -37,6 +37,7 @@ ewl_floater.h \ ewl_filedialog.h \ ewl_grid.h \ + ewl_iconbox.h \ ewl_image.h \ ewl_imenu.h \ ewl_macros.h \ @@ -100,6 +101,7 @@ ewl_floater.c \ ewl_filedialog.c \ ewl_grid.c \ + ewl_iconbox.c \ ewl_image.c \ ewl_imenu.c \ ewl_menu.c \ |
From: <enl...@li...> - 2005-07-10 12:39:07
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin Modified Files: Makefile.am ewl_test.c ewl_test.h Added Files: ewl_iconbox_test.c Log Message: Added ewl_iconbox and some sample (bsd licensed) icons =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 10 Jul 2005 09:09:32 -0000 1.7 +++ Makefile.am 10 Jul 2005 12:39:00 -0000 1.8 @@ -29,6 +29,7 @@ ewl_filedialog_multi_test.c \ ewl_fileselector_test.c \ ewl_floater_test.c \ + ewl_iconbox_test.c \ ewl_image_test.c \ ewl_imenu_test.c \ ewl_menu_test.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_test.c 10 Jul 2005 09:09:32 -0000 1.14 +++ ewl_test.c 10 Jul 2005 12:39:00 -0000 1.15 @@ -148,6 +148,13 @@ "the ability to follow the movement of\n" "another widget." }, + { + "Iconbox", + __create_iconbox_test_window, + "ewl_iconbox_test.c", + "Provides a widget for displaying icons\n" + " in an arranged grid, or freeform, with callback and label editing facilities.", + }, { "Image", __create_image_test_window, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_test.h 10 Jul 2005 09:09:32 -0000 1.8 +++ ewl_test.h 10 Jul 2005 12:39:00 -0000 1.9 @@ -31,6 +31,7 @@ void __create_filedialog_multi_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_floater_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_entry_test_window (Ewl_Widget * w, void *ev_data, void *user_data); +void __create_iconbox_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_image_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_imenu_test_window (Ewl_Widget * w, void *ev_data, void *user_data); void __create_menu_test_window (Ewl_Widget * w, void *ev_data, void *user_data); |
From: <enl...@li...> - 2005-07-10 12:57:28
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: .cvsignore Log Message: ssshh =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- .cvsignore 20 Jun 2005 22:39:49 -0000 1.2 +++ .cvsignore 10 Jul 2005 12:57:18 -0000 1.3 @@ -23,6 +23,9 @@ ewl_fileselector.lo ewl_floater.lo ewl_grid.lo +ewl_iconbox.lo +ewl_datepicker.lo +ewl_calendar.lo ewl_image.lo ewl_imenu.lo ewl_media.lo |
From: <enl...@li...> - 2005-07-10 13:23:44
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_calendar.c Log Message: Click to selected/double click to pick change for ewl_calendar =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_calendar.c 10 Jul 2005 08:26:37 -0000 1.2 +++ ewl_calendar.c 10 Jul 2005 13:23:38 -0000 1.3 @@ -51,6 +51,9 @@ ewl_widget_color_set(w, 255,0,0,255); EWL_CALENDAR(user_data)->cur_day = i; +} + +void ewl_calendar_day_pick (Ewl_Widget *w, void *ev_data, void *user_data) { ewl_callback_call(EWL_WIDGET(user_data), EWL_CALLBACK_VALUE_CHANGED); } @@ -196,7 +199,9 @@ sprintf(day, "%d", cur_day+1); day_label = ewl_label_new(day); - ewl_callback_append(EWL_WIDGET(day_label), EWL_CALLBACK_DOUBLE_CLICKED,ewl_calendar_day_select, cal); + ewl_callback_append(EWL_WIDGET(day_label), EWL_CALLBACK_MOUSE_DOWN,ewl_calendar_day_select, cal); + ewl_callback_append(EWL_WIDGET(day_label), EWL_CALLBACK_DOUBLE_CLICKED,ewl_calendar_day_pick, cal); + ewl_grid_add(EWL_GRID(cal->grid), day_label, cur_col, cur_col, cur_row, cur_row); ewl_calendar_highlight_today(now, EWL_LABEL(day_label), cal); /*printf("Day: %d:%d, Year: %d:%d, Month: %d:%d\n",now->tm_mday,cur_day, now->tm_year+1900,cal->cur_year, now->tm_mon, cal->cur_month);*/ |
From: <enl...@li...> - 2005-07-11 01:34:06
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_calendar.c ewl_datepicker.c ewl_iconbox.c Log Message: Modified iconbox/calendar/datepicker tests to work properly. Moved printf -> DWARNING for same C99 correctness fixes (no decs inside code body) Fix for datepicker to kill calendar window on main widget destroy =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_calendar.c 10 Jul 2005 13:23:38 -0000 1.3 +++ ewl_calendar.c 11 Jul 2005 01:33:59 -0000 1.4 @@ -231,7 +231,7 @@ } if (!ewl_calendar_init(ib)) { - printf("Failed calendar init...\n"); + DWARNING("Failed calendar init...\n"); FREE(ib); ib = NULL; } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_datepicker.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_datepicker.c 10 Jul 2005 09:09:32 -0000 1.1 +++ ewl_datepicker.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -20,7 +20,7 @@ } if (!ewl_datepicker_init(ib)) { - printf("Failed datepicker init...\n"); + DWARNING("Failed datepicker init...\n"); FREE(ib); ib = NULL; } @@ -42,6 +42,13 @@ } void +ewl_datepicker_destroy_cb (Ewl_Widget *w, void *ev_data, void *user_data) { + Ewl_DatePicker* dp = EWL_DATEPICKER(w); + ewl_widget_destroy(dp->calendar_window); + ewl_widget_destroy(dp->calendar); +} + +void ewl_datepicker_dropdown(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_DatePicker *dp = EWL_DATEPICKER(w); @@ -110,6 +117,7 @@ ewl_widget_hide(dp->calendar_window);*/ ewl_callback_append(EWL_WIDGET(dp->calendar), EWL_CALLBACK_VALUE_CHANGED, ewl_datepicker_value_changed_cb, dp); + ewl_callback_append(EWL_WIDGET(dp), EWL_CALLBACK_DESTROY, ewl_datepicker_destroy_cb, dp); ewl_callback_call(EWL_WIDGET(dp->calendar), EWL_CALLBACK_VALUE_CHANGED); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_iconbox.c 10 Jul 2005 12:39:00 -0000 1.1 +++ ewl_iconbox.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -26,7 +26,7 @@ } if (!ewl_iconbox_init(ib)) { - printf("Failed iconbox init...\n"); + DWARNING("Failed iconbox init...\n"); FREE(ib); ib = NULL; } @@ -40,12 +40,12 @@ icon = NEW(Ewl_IconBox_Icon, 1); if (!icon) { - printf("Failed to init icon..\n"); + DWARNING("Failed to init icon..\n"); DRETURN_PTR(NULL, DLEVEL_STABLE); } if (!ewl_iconbox_icon_init(icon)) { - printf("Failed iconbox init...\n"); + DWARNING("Failed iconbox init...\n"); FREE(icon); icon = NULL; } |
From: <enl...@li...> - 2005-07-11 01:34:06
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin Modified Files: ewl_calendar_test.c ewl_datepicker_test.c ewl_iconbox_test.c Log Message: Modified iconbox/calendar/datepicker tests to work properly. Moved printf -> DWARNING for same C99 correctness fixes (no decs inside code body) Fix for datepicker to kill calendar window on main widget destroy =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_calendar_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_calendar_test.c 10 Jul 2005 08:18:05 -0000 1.1 +++ ewl_calendar_test.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -1,7 +1,7 @@ #include "ewl_test.h" Ewl_Widget* cal; -Ewl_Widget* win; +Ewl_Widget* calendar_win; Ewl_Widget *calendar_button; void @@ -30,20 +30,20 @@ { calendar_button = w; - win= ewl_window_new(); + calendar_win= ewl_window_new(); - ewl_window_title_set(EWL_WINDOW(win), "Calendar"); - ewl_window_name_set(EWL_WINDOW(win), "Calendar"); - ewl_window_class_set(EWL_WINDOW(win), "Calendar"); - ewl_object_size_request(EWL_OBJECT(win), 159,160); + ewl_window_title_set(EWL_WINDOW(calendar_win), "Calendar"); + ewl_window_name_set(EWL_WINDOW(calendar_win), "Calendar"); + ewl_window_class_set(EWL_WINDOW(calendar_win), "Calendar"); + ewl_object_size_request(EWL_OBJECT(calendar_win), 159,160); if (w) { ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_calendar_test_window); - ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, + ewl_callback_append(calendar_win, EWL_CALLBACK_DELETE_WINDOW, __destroy_calendar_test_window, NULL); } else - ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, + ewl_callback_append(calendar_win, EWL_CALLBACK_DELETE_WINDOW, __close_main_window, NULL); @@ -51,14 +51,12 @@ cal = ewl_calendar_new(); - ewl_object_fill_policy_set(EWL_OBJECT(win), EWL_FLAG_FILL_ALL); - ewl_container_child_append(EWL_CONTAINER(win), cal); + ewl_object_fill_policy_set(EWL_OBJECT(calendar_win), EWL_FLAG_FILL_ALL); + ewl_container_child_append(EWL_CONTAINER(calendar_win), cal); - ewl_widget_show(win); + ewl_widget_show(calendar_win); ewl_widget_show(cal); - ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, - __destroy_calendar_test_window, NULL); ewl_callback_append(EWL_WIDGET(cal), EWL_CALLBACK_VALUE_CHANGED,ewl_calendar_test, cal); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_datepicker_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_datepicker_test.c 10 Jul 2005 09:09:32 -0000 1.1 +++ ewl_datepicker_test.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -1,21 +1,40 @@ #include "ewl_test.h" -Ewl_Widget* datepicker; -Ewl_Widget* datepicker_win; +static Ewl_Widget* datepicker_button = NULL; -void - __destroy_datepicker_window(Ewl_Widget *main_win, void *ev_data, void *user_data) + +static void + __destroy_datepicker_window(Ewl_Widget *main_win , void *ev_data __UNUSED__, void *user_data __UNUSED__) { - ewl_widget_destroy(datepicker_win); + ewl_widget_destroy(main_win); + ewl_callback_append(datepicker_button, EWL_CALLBACK_CLICKED, + __create_datepicker_test_window, NULL); } void __create_datepicker_test_window(Ewl_Widget * w, void *ev_data __UNUSED__, void *user_data __UNUSED__) { - + Ewl_Widget* datepicker; + Ewl_Widget* datepicker_win; + + datepicker_button = w; datepicker_win= ewl_window_new(); + + if (w) { + ewl_callback_del(w, EWL_CALLBACK_CLICKED, + __create_datepicker_test_window); + ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW, + __destroy_datepicker_window, NULL); + } else { + ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW, + __close_main_window, NULL); + } + + + + ewl_window_title_set(EWL_WINDOW(datepicker_win), "DatePicker"); ewl_window_name_set(EWL_WINDOW(datepicker_win), "DatePicker"); @@ -32,9 +51,6 @@ ewl_widget_show(datepicker_win); ewl_widget_show(datepicker); - ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW, - __destroy_datepicker_window, NULL); - /*ewl_callback_append(EWL_WIDGET(cal), EWL_CALLBACK_VALUE_CHANGED,ewl_calendar_test, cal);*/ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_iconbox_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_iconbox_test.c 10 Jul 2005 12:39:00 -0000 1.1 +++ ewl_iconbox_test.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -2,6 +2,7 @@ #include <stdlib.h> Ewl_Widget* ib; +static Ewl_Widget* ewl_iconbox_button = NULL; void icon_click_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__, void *user_data __UNUSED__) { printf("Icon clicked!\n"); @@ -22,9 +23,12 @@ } void - __destroy_main_window(Ewl_Widget *main_win, void *ev_data __UNUSED__, void *user_data __UNUSED__) + __destroy_iconbox_test_window(Ewl_Widget *main_win, void *ev_data __UNUSED__, void *user_data __UNUSED__) { ewl_widget_destroy(main_win); + ewl_callback_append(ewl_iconbox_button, EWL_CALLBACK_CLICKED, + __create_iconbox_test_window, NULL); + return; } @@ -36,8 +40,19 @@ Ewl_Widget* ib_win; + ewl_iconbox_button=w; ib_win= ewl_window_new(); + + if (w) { + ewl_callback_del(w, EWL_CALLBACK_CLICKED, + __create_iconbox_test_window); + ewl_callback_append(ib_win, EWL_CALLBACK_DELETE_WINDOW, + __destroy_iconbox_test_window, NULL); + } else + ewl_callback_append(ib_win, EWL_CALLBACK_DELETE_WINDOW, + __close_main_window, NULL); + ewl_window_title_set(EWL_WINDOW(ib_win), "Icon Box"); ewl_window_name_set(EWL_WINDOW(ib_win), "Icon Box"); @@ -69,8 +84,6 @@ ewl_widget_show(ib_win); ewl_widget_show(ib); - ewl_callback_append(ib_win, EWL_CALLBACK_DELETE_WINDOW, - __destroy_main_window, NULL); ewl_callback_append(button, EWL_CALLBACK_MOUSE_DOWN, add_icons_cb, NULL); |
From: <enl...@li...> - 2005-07-11 11:52:19
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_calendar.c ewl_calendar.h Log Message: Date accessor functions for ewl_calendar =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_calendar.c 11 Jul 2005 01:33:59 -0000 1.4 +++ ewl_calendar.c 11 Jul 2005 11:52:06 -0000 1.5 @@ -32,6 +32,7 @@ struct tm* now; time_t now_tm; int i; + Ewl_Widget* it; now_tm = time(NULL); @@ -40,8 +41,6 @@ ewl_container_child_iterate_begin(EWL_CONTAINER(EWL_CALENDAR(user_data)->grid)); - - Ewl_Widget* it; while ( (it = ewl_container_child_next(EWL_CONTAINER(EWL_CALENDAR(user_data)->grid))) != NULL ) { ewl_widget_color_set(EWL_WIDGET(it), 255,255,255,255); ewl_calendar_highlight_today(now, EWL_LABEL(it), EWL_CALENDAR(user_data)); @@ -131,6 +130,18 @@ } +int ewl_calendar_day_get(Ewl_Calendar* c) { + return c->cur_day; +} + +int ewl_calendar_month_get(Ewl_Calendar* c) { + return c->cur_month; +} + +int ewl_calendar_year_get(Ewl_Calendar* c) { + return c->cur_year; +} + void ewl_calendar_grid_setup(Ewl_Calendar* cal) { struct tm* month_start; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_calendar.h 10 Jul 2005 08:26:37 -0000 1.2 +++ ewl_calendar.h 11 Jul 2005 11:52:06 -0000 1.3 @@ -47,6 +47,9 @@ int ewl_calendar_init(Ewl_Calendar* calendar); void ewl_calendar_grid_setup(Ewl_Calendar* cal); void ewl_calendar_ascii_time_get(Ewl_Calendar* cal, char* str); +int ewl_calendar_day_get(Ewl_Calendar*); +int ewl_calendar_month_get(Ewl_Calendar*); +int ewl_calendar_year_get(Ewl_Calendar*); #endif |
From: <enl...@li...> - 2005-07-11 11:55:51
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin Modified Files: ewl_calendar_test.c Log Message: Cleanups to ewl_calendar_test =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_calendar_test.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_calendar_test.c 11 Jul 2005 01:33:59 -0000 1.2 +++ ewl_calendar_test.c 11 Jul 2005 11:55:40 -0000 1.3 @@ -5,7 +5,7 @@ Ewl_Widget *calendar_button; void - __destroy_calendar_test_window(Ewl_Widget *w, void *ev_data, void *user_data) + __destroy_calendar_test_window(Ewl_Widget *w, void *ev_data __UNUSED__, void *user_data __UNUSED__) { ewl_widget_destroy(w); ewl_callback_append(calendar_button, EWL_CALLBACK_CLICKED, @@ -16,7 +16,7 @@ } void -ewl_calendar_test(Ewl_Widget *main_win, void *ev_data, void *user_data) +ewl_calendar_test(Ewl_Widget *main_win __UNUSED__, void *ev_data __UNUSED__, void *user_data) { char date[1024]; ewl_calendar_ascii_time_get(EWL_CALENDAR(user_data), date); |
From: <enl...@li...> - 2005-07-11 12:42:30
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c Log Message: . Layout changes for ewl_iconbox . ewl_text_color_set doesn't seem to be working -> changed to ewl_widget_color_set for now =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_iconbox.c 11 Jul 2005 01:33:59 -0000 1.2 +++ ewl_iconbox.c 11 Jul 2005 12:42:23 -0000 1.3 @@ -94,6 +94,12 @@ ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), nw, nh); /*printf ("Grew iconbox to: %d:%d\n", nw, nh);*/ } + + if (REALIZED(ib) && VISIBLE(ib)) { + ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure); + ewl_iconbox_icon_arrange(ib); + ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); + } } int ewl_iconbox_icon_init(Ewl_IconBox_Icon* icon) { @@ -282,7 +288,7 @@ /*printf ("Entering the arrange..\n");*/ /* Recalc inner pane size */ - ewl_iconbox_inner_pane_calculate(ib); + /*ewl_iconbox_inner_pane_calculate(ib);*/ /*printf ("Ewl_IconBox -> Arranging icons\n");*/ @@ -472,13 +478,15 @@ } ib->selected = 1; - ewl_text_color_set(EWL_TEXT(EWL_BORDER(ib)->label), 0,0,255,255); + + /*printf("Setting color..\n");*/ + ewl_widget_color_set(EWL_WIDGET(EWL_BORDER(ib)->label), 140,0,255,128); ewl_callback_call(EWL_WIDGET(EWL_BORDER(ib)->label), EWL_CALLBACK_APPEARANCE_CHANGED); } void ewl_iconbox_icon_deselect(Ewl_IconBox_Icon *ib) { ib->selected = 0; - ewl_text_color_set(EWL_TEXT(EWL_BORDER(ib)->label), 0,0,0,255); + ewl_widget_color_set(EWL_WIDGET(EWL_BORDER(ib)->label), 0,0,0,255); } |
From: <enl...@li...> - 2005-07-12 03:47:24
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c ewl_iconbox.h Log Message: Selection drag box support for ewl_iconbox =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_iconbox.c 11 Jul 2005 12:42:23 -0000 1.3 +++ ewl_iconbox.c 12 Jul 2005 03:47:17 -0000 1.4 @@ -96,9 +96,9 @@ } if (REALIZED(ib) && VISIBLE(ib)) { - ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure); - ewl_iconbox_icon_arrange(ib); - ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); + /*ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure);*/ + /*ewl_iconbox_icon_arrange(ib); */ + /*ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL);*/ } } @@ -198,7 +198,24 @@ /* Add the iconbox scrollpane to the iconbox */ ewl_container_child_append(EWL_CONTAINER(ib), ib->ewl_iconbox_scrollpane); ewl_object_fill_policy_set(EWL_OBJECT(ib), EWL_FLAG_FILL_ALL); - + + /* Create the selector / selector floater */ + ib->select_floater = ewl_floater_new(ib->ewl_iconbox_pane_inner); + ewl_object_fill_policy_set(EWL_OBJECT(ib->select_floater), EWL_FLAG_FILL_FILL); + ib->select =ewl_button_new(""); + + ewl_container_child_append(EWL_CONTAINER(ib->select_floater), ib->select); + ewl_container_child_append(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), ib->select_floater); + + ewl_object_custom_size_set(EWL_OBJECT(ib->select), 80, 40); + ewl_widget_layer_set(EWL_WIDGET(ib->select_floater), 1000); + ewl_widget_color_set(EWL_WIDGET(ib->select), 128, 50, 70, 128); + ib->drag_box = 0; + /* -------------------------------- */ + + ewl_widget_show(ib->select); + /*ewl_widget_show(ib->select_floater);*/ + /*Init the icon list*/ ib->ewl_iconbox_icon_list = ecore_list_new(); @@ -236,7 +253,9 @@ /** Internal Callbacks */ ewl_callback_append(ib->ewl_iconbox_pane_inner, EWL_CALLBACK_MOUSE_MOVE, ewl_iconbox_mouse_move_cb, ib); ewl_callback_append(ib->ewl_iconbox_pane_inner, EWL_CALLBACK_MOUSE_DOWN, ewl_iconbox_pane_mouse_down_cb, ib); + ewl_callback_append(ib->ewl_iconbox_pane_inner, EWL_CALLBACK_MOUSE_UP, ewl_iconbox_mouse_up, ib); ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); + /*ewl_container_callback_nointercept(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), EWL_CALLBACK_MOUSE_DOWN);*/ @@ -349,11 +368,47 @@ iby = ewl_object_current_y_get(EWL_OBJECT(ib)); px = ewl_object_current_x_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner)); - py = ewl_object_current_y_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner)); - + py = ewl_object_current_y_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner)); - + /*Handle selection box*/ + if (ib->drag_box) { + int sbx, sby; + sbx = ewl_object_current_x_get(EWL_OBJECT(ib->select_floater)); + sby = ewl_object_current_y_get(EWL_OBJECT(ib->select_floater)); + + if (ev->x-sbx-3 > 0 && ev->y-sby-3 >0) { + ewl_object_custom_size_set(EWL_OBJECT(ib->select), ev->x-sbx-3, ev->y-sby-3); + ewl_object_custom_size_set(EWL_OBJECT(ib->select_floater), ev->x-sbx-3, ev->y-sby-3); + } + /*Now check which icons we have to select in this range...*/ + { + Ewl_IconBox_Icon* list_item; + int ix,iy; + ecore_list_goto_first(ib->ewl_iconbox_icon_list); + + + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { + int w,h; + + w = ewl_object_current_w_get(EWL_OBJECT(ib->select)); + h = ewl_object_current_h_get(EWL_OBJECT(ib->select)); + + + ix = ewl_object_current_x_get(EWL_OBJECT(list_item)); + iy = ewl_object_current_y_get(EWL_OBJECT(list_item)); + + if (ix >= sbx && iy >= sby && ix <= (sbx+w) && iy <= (sby+h) ) { + ewl_iconbox_icon_select(EWL_ICONBOX_ICON(list_item),0); + } else { + ewl_iconbox_icon_deselect(EWL_ICONBOX_ICON(list_item)); + } + } + } + + /* If we're drag boxing, we can't be moving an icon, so return.. */ + return; + } /*Check move tolerance, if not past, then don't move..*/ if (abs(ev->x - ib->xdown) < EWL_ICONBOX_MOVE_TOLERANCE && abs(ev->y - ib->ydown) < EWL_ICONBOX_MOVE_TOLERANCE) @@ -389,6 +444,11 @@ Ewl_Event_Mouse_Down *ev = ev_data; int ibx, iby; + int px,py; + + px = ewl_object_current_x_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner)); + py = ewl_object_current_y_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner)); + ibx = ewl_object_current_x_get(EWL_OBJECT(ib)); iby = ewl_object_current_y_get(EWL_OBJECT(ib)); @@ -397,8 +457,18 @@ /*printf ("Context menu: %d,%d\n", ev->x, ev->y);*/ ewl_widget_show(ib->ewl_iconbox_menu_floater); - ewl_floater_position_set(EWL_FLOATER(ib->ewl_iconbox_menu_floater), ev->x-ibx, ev->y-iby); + ewl_floater_position_set(EWL_FLOATER(ib->ewl_iconbox_menu_floater), ev->x-ibx + abs(px-ibx), ev->y-iby +abs(py-iby)); ewl_callback_call(EWL_WIDGET(ib->ewl_iconbox_context_menu), EWL_CALLBACK_SELECT); + } else if (ev->button == 1 /* Confirm that this is not an icon event */ && (ib->xdown != ev->x && ib->ydown != ev->y)) { + /*printf ("Start select at %d:%d\n", ev->x, ev->y);*/ + ewl_object_custom_size_set(EWL_OBJECT(ib->select), 1, 1); + + + ewl_floater_position_set(EWL_FLOATER(ib->select_floater), ev->x-ibx + abs(px-ibx), ev->y-iby + abs(py-iby)); + + + ewl_widget_show(EWL_WIDGET(ib->select_floater)); + ib->drag_box = 1; } } @@ -423,6 +493,7 @@ } void ewl_iconbox_icon_mouse_up(Ewl_Widget *w, void *ev_data, void *user_data) { + /*Ewl_Event_Mouse_Down *ev = ev_data;*/ Ewl_IconBox_Icon* ib = user_data; ib->drag = 0; @@ -430,6 +501,16 @@ /*printf ("Button up on icon: %s\n", ewl_border_text_get(EWL_BORDER(ib)) );*/ } +void ewl_iconbox_mouse_up(Ewl_Widget *w, void *ev_data, void *user_data) { + Ewl_Event_Mouse_Up *ev = ev_data; + Ewl_IconBox* ib = user_data; + if (ev->button == 1) { + /*printf("Stopped select: %d:%d\n", ev->x, ev->y);*/ + ewl_widget_hide(EWL_WIDGET(ib->select_floater)); + ib->drag_box = 0; + } +} + void ewl_iconbox_icon_label_mouse_down_cb(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_IconBox_Icon* ib = user_data; @@ -471,10 +552,12 @@ /*TODO allow multiselect, as per a "select policy" set on widget create/init*/ - Ewl_IconBox_Icon* list_item; - ecore_list_goto_first(ib->icon_box_parent->ewl_iconbox_icon_list); - while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->icon_box_parent->ewl_iconbox_icon_list)) != NULL) { - ewl_iconbox_icon_deselect(list_item); + if (!ib->icon_box_parent->drag_box) { + Ewl_IconBox_Icon* list_item; + ecore_list_goto_first(ib->icon_box_parent->ewl_iconbox_icon_list); + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->icon_box_parent->ewl_iconbox_icon_list)) != NULL) { + ewl_iconbox_icon_deselect(list_item); + } } ib->selected = 1; @@ -489,6 +572,17 @@ ewl_widget_color_set(EWL_WIDGET(EWL_BORDER(ib)->label), 0,0,0,255); } +void ewl_iconbox_deselect_all(Ewl_IconBox* ib) { + return; + + Ewl_IconBox_Icon* list_item; + ecore_list_goto_first(ib->ewl_iconbox_icon_list); + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { + ewl_iconbox_icon_deselect(list_item); + } +} + + void ewl_iconbox_icon_remove(Ewl_IconBox_Icon* icon) { /*printf("Removing icon: %s", ewl_border_text_get(EWL_BORDER(icon)));*/ @@ -556,6 +650,7 @@ /*printf("Added icon: '%s'\n", name);*/ ewl_object_alignment_set(EWL_OBJECT(ib), EWL_FLAG_ALIGN_CENTER); + ewl_widget_layer_set(EWL_WIDGET(ib), 500); return EWL_ICONBOX_ICON(ib); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_iconbox.h 10 Jul 2005 12:39:00 -0000 1.1 +++ ewl_iconbox.h 12 Jul 2005 03:47:17 -0000 1.2 @@ -77,6 +77,12 @@ Ewl_Widget* entry_floater; Ewl_Widget* entry_box; + /*Objects for selection */ + Ewl_Widget* select; + Ewl_Widget* select_floater; + int drag_box; + + /* Editable flag */ int editable; @@ -92,6 +98,7 @@ /* External functions */ void ewl_iconbox_editable_set(Ewl_IconBox *ib, int edit); void ewl_iconbox_icon_arrange(Ewl_IconBox* ib); +void ewl_iconbox_deselect_all(Ewl_IconBox* ib); /* Internal callbacks */ @@ -104,6 +111,7 @@ void ewl_iconbox_icon_deselect(Ewl_IconBox_Icon *ib); void ewl_iconbox_label_edit_key_down(Ewl_Widget *w, void *ev_data, void* user_data); void ewl_iconbox_inner_pane_calculate(Ewl_IconBox* ib); +void ewl_iconbox_mouse_up(Ewl_Widget *w, void *ev_data, void *user_data); |
From: <enl...@li...> - 2005-07-14 08:01:55
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c ewl_iconbox.h Log Message: Fixes to selection box code. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_iconbox.c 12 Jul 2005 03:47:17 -0000 1.4 +++ ewl_iconbox.c 14 Jul 2005 08:01:48 -0000 1.5 @@ -211,6 +211,9 @@ ewl_widget_layer_set(EWL_WIDGET(ib->select_floater), 1000); ewl_widget_color_set(EWL_WIDGET(ib->select), 128, 50, 70, 128); ib->drag_box = 0; + + /*Set the dx/dy drag start points to 'null' values*/ + ib->dx = -1; ib->dy = -1; /* -------------------------------- */ ewl_widget_show(ib->select); @@ -255,7 +258,6 @@ ewl_callback_append(ib->ewl_iconbox_pane_inner, EWL_CALLBACK_MOUSE_DOWN, ewl_iconbox_pane_mouse_down_cb, ib); ewl_callback_append(ib->ewl_iconbox_pane_inner, EWL_CALLBACK_MOUSE_UP, ewl_iconbox_mouse_up, ib); ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); - /*ewl_container_callback_nointercept(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), EWL_CALLBACK_MOUSE_DOWN);*/ @@ -372,15 +374,38 @@ /*Handle selection box*/ if (ib->drag_box) { - int sbx, sby; - sbx = ewl_object_current_x_get(EWL_OBJECT(ib->select_floater)); - sby = ewl_object_current_y_get(EWL_OBJECT(ib->select_floater)); - - if (ev->x-sbx-3 > 0 && ev->y-sby-3 >0) { - ewl_object_custom_size_set(EWL_OBJECT(ib->select), ev->x-sbx-3, ev->y-sby-3); - ewl_object_custom_size_set(EWL_OBJECT(ib->select_floater), ev->x-sbx-3, ev->y-sby-3); + + + + if (ib->dx == -1) { + /* Assume this is the drag start point */ + ib->dx = ewl_object_current_x_get(EWL_OBJECT(ib->select_floater)); + ib->dy = ewl_object_current_y_get(EWL_OBJECT(ib->select_floater)); + } + + int lx,ly,hx,hy; + + /*Work out where to start/end..*/ + if (ib->dx < ev->x) { + lx = ib->dx; hx = ev->x; + } else { + lx = ev->x; hx = ib->dx; + } + + if (ib->dy < ev->y) { + ly = ib->dy ; hy = ev->y; + } else { + ly = ev->y; hy = ib->dy; } + + ewl_floater_position_set(EWL_FLOATER(ib->select_floater), (lx - ibx) + abs(px-ibx) , (ly+1 - iby) + abs(py-iby)); + + if (hx-lx >0 && hy-ly > 0) { + ewl_object_custom_size_set(EWL_OBJECT(ib->select), (hx-lx), (hy-ly)); + ewl_object_custom_size_set(EWL_OBJECT(ib->select_floater), hx-lx, hy-ly); + } + /*Now check which icons we have to select in this range...*/ { Ewl_IconBox_Icon* list_item; @@ -398,7 +423,7 @@ ix = ewl_object_current_x_get(EWL_OBJECT(list_item)); iy = ewl_object_current_y_get(EWL_OBJECT(list_item)); - if (ix >= sbx && iy >= sby && ix <= (sbx+w) && iy <= (sby+h) ) { + if (ix >= lx && iy >= ly && ix <= hx && iy <= hy ) { ewl_iconbox_icon_select(EWL_ICONBOX_ICON(list_item),0); } else { ewl_iconbox_icon_deselect(EWL_ICONBOX_ICON(list_item)); @@ -463,7 +488,7 @@ /*printf ("Start select at %d:%d\n", ev->x, ev->y);*/ ewl_object_custom_size_set(EWL_OBJECT(ib->select), 1, 1); - + /* Put the floater at the position we started at */ ewl_floater_position_set(EWL_FLOATER(ib->select_floater), ev->x-ibx + abs(px-ibx), ev->y-iby + abs(py-iby)); @@ -508,6 +533,8 @@ /*printf("Stopped select: %d:%d\n", ev->x, ev->y);*/ ewl_widget_hide(EWL_WIDGET(ib->select_floater)); ib->drag_box = 0; + ib->dx = -1; + ib->dy = -1; } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_iconbox.h 12 Jul 2005 03:47:17 -0000 1.2 +++ ewl_iconbox.h 14 Jul 2005 08:01:49 -0000 1.3 @@ -70,7 +70,8 @@ Ewl_IconBox_Icon* drag_icon; Ewl_IconBox_Icon* edit_icon; - int xdown, ydown; + int xdown, ydown; /* Last icon button down x/y, for edge resistence */ + int dx, dy; /* Drag start x/y */ /* Objects for label editing..*/ Ewl_Widget* entry; @@ -80,7 +81,7 @@ /*Objects for selection */ Ewl_Widget* select; Ewl_Widget* select_floater; - int drag_box; + int drag_box; /* Are we dragging? */ /* Editable flag */ @@ -99,6 +100,7 @@ void ewl_iconbox_editable_set(Ewl_IconBox *ib, int edit); void ewl_iconbox_icon_arrange(Ewl_IconBox* ib); void ewl_iconbox_deselect_all(Ewl_IconBox* ib); +Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* icon_file); /* Internal callbacks */ @@ -106,7 +108,6 @@ void ewl_iconbox_expansion_cb(Ewl_Widget *w, void *ev_data, void *user_data); /* Internal functions */ -Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* icon_file); void ewl_iconbox_icon_select(Ewl_IconBox_Icon* ib, int loc); void ewl_iconbox_icon_deselect(Ewl_IconBox_Icon *ib); void ewl_iconbox_label_edit_key_down(Ewl_Widget *w, void *ev_data, void* user_data); |
From: <enl...@li...> - 2005-07-17 23:06:15
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c ewl_iconbox.h Log Message: Added an accessor to modify an icons's image after creation =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_iconbox.c 14 Jul 2005 08:01:48 -0000 1.5 +++ ewl_iconbox.c 17 Jul 2005 23:06:02 -0000 1.6 @@ -681,3 +681,8 @@ return EWL_ICONBOX_ICON(ib); } + + +void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename) { + ewl_image_file_set(EWL_IMAGE(icon->image), filename, NULL); +} =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_iconbox.h 14 Jul 2005 08:01:49 -0000 1.3 +++ ewl_iconbox.h 17 Jul 2005 23:06:02 -0000 1.4 @@ -101,6 +101,7 @@ void ewl_iconbox_icon_arrange(Ewl_IconBox* ib); void ewl_iconbox_deselect_all(Ewl_IconBox* ib); Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* icon_file); +void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename); /* Internal callbacks */ |
From: <enl...@li...> - 2005-07-18 12:35:20
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c Log Message: Make an icon resize properly when we reset its image =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_iconbox.c 17 Jul 2005 23:06:02 -0000 1.6 +++ ewl_iconbox.c 18 Jul 2005 12:35:10 -0000 1.7 @@ -684,5 +684,14 @@ void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename) { + int iw,ih,lw,lh; + ewl_image_file_set(EWL_IMAGE(icon->image), filename, NULL); + + /*Make sure we're not too small now */ + /*Shouldn't the floater auto-resize?*/ + + ewl_object_current_size_get(EWL_OBJECT(icon->image), &iw,&ih); + ewl_object_current_size_get(EWL_BORDER(icon)->label, &lw, &lh); /* Shouldn't access this directly, is there another way? */ + ewl_object_minimum_size_set(EWL_OBJECT(icon->floater), iw, ih+lh); } |
From: <enl...@li...> - 2005-07-22 11:54:07
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c Log Message: Visual fix for auto-arrange =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_iconbox.c 21 Jul 2005 04:01:42 -0000 1.8 +++ ewl_iconbox.c 22 Jul 2005 11:53:52 -0000 1.9 @@ -318,14 +318,20 @@ ewl_object_current_size_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner), &sw,&sh); /*printf(" Ewl_IconBox -> We have %d*%d to work with\n", sw,sh);*/ + /*Hack for now - get the biggest icon in the list - this is inefficient*/ + ecore_list_goto_first(ib->ewl_iconbox_icon_list); - while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { - if (iw == 0 || ih == 0) { - iw= ewl_object_preferred_w_get(EWL_OBJECT(list_item)); - ih= ewl_object_preferred_h_get(EWL_OBJECT(list_item)); - } + int nw,nh; + + nw= ewl_object_preferred_w_get(EWL_OBJECT(list_item->image)); + nh= ewl_object_preferred_h_get(EWL_OBJECT(list_item->image)); + if (nw > iw) iw = nw; + if (nh > ih) ih = nh; + } + ecore_list_goto_first(ib->ewl_iconbox_icon_list); + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { if (iw < EWL_ICONBOX_MOVE_TOLERANCE) { iw = EWL_ICONBOX_MINIMUM_SIZE; ih = EWL_ICONBOX_MINIMUM_SIZE; |
From: <enl...@li...> - 2005-07-24 23:35:45
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c ewl_iconbox.h Log Message: Memory cleanup on icon Delete. Also start of label abbreviation work =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_iconbox.c 22 Jul 2005 11:53:52 -0000 1.9 +++ ewl_iconbox.c 24 Jul 2005 23:35:35 -0000 1.10 @@ -233,6 +233,8 @@ /* Ewl Entry for the purposes of label editing - if enabled */ ib->entry = ewl_entry_new("Test"); ewl_text_text_set(EWL_TEXT(ib->entry), "Test"); + + ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(EWL_ENTRY(ib->entry)->cursor), 50); ewl_widget_show(ib->entry); ib->entry_floater = ewl_floater_new(ib->ewl_iconbox_pane_inner); @@ -279,6 +281,34 @@ ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), 680,700); } +void ewl_iconbox_icon_label_set(Ewl_IconBox_Icon* icon, char* text) { + char* compressed; + + /*If we have a current label, nuke it*/ + if (icon->label) { + free(icon->label); + } + + /*Copy the existing label to our icon*/ + icon->label = strdup(text); + + if (strlen(text) <= LABEL_CHARS) { + ewl_border_text_set(EWL_BORDER(icon), text); + } else { + if (icon->label_compressed) { + free(icon->label_compressed); + } + + compressed = malloc(sizeof(char) * LABEL_CHARS + 3); + strncpy(compressed, text, LABEL_CHARS); + strcpy(compressed+LABEL_CHARS, "..\0"); + ewl_border_text_set(EWL_BORDER(icon),compressed); + + icon->label_compressed = compressed; + } + + +} void ewl_iconbox_label_edit_key_down(Ewl_Widget *w, void *ev_data, void* user_data) { @@ -315,7 +345,7 @@ - ewl_object_current_size_get(EWL_OBJECT(ib->ewl_iconbox_pane_inner), &sw,&sh); + ewl_object_current_size_get(EWL_OBJECT(ib->ewl_iconbox_scrollpane), &sw,&sh); /*printf(" Ewl_IconBox -> We have %d*%d to work with\n", sw,sh);*/ /*Hack for now - get the biggest icon in the list - this is inefficient*/ @@ -355,7 +385,7 @@ * the size of the scrollpane, which ever is bigger */ ewl_object_current_size_get(EWL_OBJECT(ib->ewl_iconbox_scrollpane), &pw, &ph); - ewl_object_preferred_inner_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), pw > maxx ? pw : maxx, ph > maxy+ih ? ph : maxy+ih); + ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), pw > maxx ? pw +iw: maxx+iw, ph > maxy+ih ? ph+ih : maxy+ih); @@ -552,8 +582,17 @@ } void ewl_iconbox_icon_select(Ewl_IconBox_Icon* ib, int loc) { /* Loc 0= image, 1= label */ + int sel = ib->selected; - if (ib->selected == 1 && loc == 1) { + if (!ib->icon_box_parent->drag_box) { + Ewl_IconBox_Icon* list_item; + ecore_list_goto_first(ib->icon_box_parent->ewl_iconbox_icon_list); + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->icon_box_parent->ewl_iconbox_icon_list)) != NULL) { + ewl_iconbox_icon_deselect(list_item); + } + } + + if (sel && loc == 1) { int w,h; int iw,ih; int x,y; @@ -580,19 +619,11 @@ } else { ewl_widget_hide(EWL_WIDGET(ib->icon_box_parent->entry_floater)); + ewl_border_text_set(EWL_BORDER(ib), ib->label); } /*TODO allow multiselect, as per a "select policy" set on widget create/init*/ - - if (!ib->icon_box_parent->drag_box) { - Ewl_IconBox_Icon* list_item; - ecore_list_goto_first(ib->icon_box_parent->ewl_iconbox_icon_list); - while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->icon_box_parent->ewl_iconbox_icon_list)) != NULL) { - ewl_iconbox_icon_deselect(list_item); - } - } - ib->selected = 1; /*printf("Setting color..\n");*/ @@ -603,6 +634,11 @@ void ewl_iconbox_icon_deselect(Ewl_IconBox_Icon *ib) { ib->selected = 0; ewl_widget_color_set(EWL_WIDGET(EWL_BORDER(ib)->label), 0,0,0,255); + + /*If we have a compressed label, set it now*/ + if (ib->label_compressed) { + ewl_border_text_set(EWL_BORDER(ib), ib->label_compressed); + } } void ewl_iconbox_deselect_all(Ewl_IconBox* ib) { @@ -621,6 +657,18 @@ /*printf("Removing icon: %s", ewl_border_text_get(EWL_BORDER(icon)));*/ } +void ewl_iconbox_icon_destroy_cb(Ewl_Widget *w, void *ev_data __UNUSED__, + void *user_data __UNUSED__) +{ + Ewl_IconBox_Icon* icon = EWL_ICONBOX_ICON(w); + + DENTER_FUNCTION(DLEVEL_STABLE); + ewl_widget_destroy(icon->image); + ewl_widget_destroy(icon->floater); + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + + Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* icon_file) { Ewl_Widget* ib; /*ib = malloc(sizeof(Ewl_IconBox_Icon));*/ @@ -628,10 +676,17 @@ ib = ewl_iconbox_icon_new(); + /*ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_DESTROY, + ewl_iconbox_icon_destroy_cb, NULL);*/ + EWL_ICONBOX_ICON(ib)->selected = 0; EWL_ICONBOX_ICON(ib)->floater = ewl_floater_new(iconbox->ewl_iconbox_pane_inner); - ewl_border_text_set(EWL_BORDER(ib), name); + + /*Set the label*/ + ewl_iconbox_icon_label_set(EWL_ICONBOX_ICON(ib), name); + + EWL_ICONBOX_ICON(ib)->icon_box_parent = iconbox; /* Set our parent */ /*printf("Setting fill policy..\n");*/ @@ -657,7 +712,7 @@ /* Find the enxt pos for this icon FIXME add this to layout engine */ ewl_floater_position_set(EWL_FLOATER(EWL_ICONBOX_ICON(ib)->floater), nextx, 0); - nextx += 60; + nextx += 75; /*Show*/ @@ -701,3 +756,31 @@ ewl_object_current_size_get(EWL_OBJECT(EWL_BORDER(icon)->label), &lw, &lh); /* Shouldn't access this directly, is there another way? */ ewl_object_minimum_size_set(EWL_OBJECT(icon->floater), iw, ih+lh); } + +void ewl_iconbox_clear(Ewl_IconBox* ib) { + Ewl_IconBox_Icon* list_item; + nextx = 0; + + /*printf("*** Deleting all icons...\n");*/ + + if (ib->ewl_iconbox_icon_list) { + ecore_list_goto_first(ib->ewl_iconbox_icon_list); + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { + /*printf("Deleting icon..\n");*/ + if (list_item->label) { + free(list_item->label); + } + if (list_item->label_compressed) { + free(list_item->label_compressed); + } + + ewl_container_child_remove(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), EWL_WIDGET(list_item)); + ewl_widget_destroy(EWL_WIDGET(list_item)); + } + /*printf("...dione\n");*/ + + ecore_list_destroy(ib->ewl_iconbox_icon_list); + } + + ib->ewl_iconbox_icon_list = ecore_list_new(); +} =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_iconbox.h 17 Jul 2005 23:06:02 -0000 1.4 +++ ewl_iconbox.h 24 Jul 2005 23:35:35 -0000 1.5 @@ -5,6 +5,7 @@ #define EWL_ICONBOX_ICON_PADDING 15 #define EWL_ICONBOX_MOVE_TOLERANCE 5 #define EWL_ICONBOX_MINIMUM_SIZE 50 +#define LABEL_CHARS 10 /** * @file ewl_iconbox.h @@ -33,6 +34,8 @@ int drag; int selected ; Ewl_IconBox* icon_box_parent; /* Our reference upwards, kinda breaks OO conventions */ + char* label; /*Our icon's full (unabbreviated) label) */ + char* label_compressed; }; @@ -101,6 +104,7 @@ void ewl_iconbox_icon_arrange(Ewl_IconBox* ib); void ewl_iconbox_deselect_all(Ewl_IconBox* ib); Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* icon_file); +void ewl_iconbox_clear(Ewl_IconBox* iconbox); void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename); |
From: <enl...@li...> - 2005-07-26 23:39:51
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c ewl_iconbox.h Log Message: Moved to Box for Ewl_IconBox_Icon - we outgrew Ewl_Border =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_iconbox.c 24 Jul 2005 23:35:35 -0000 1.10 +++ ewl_iconbox.c 26 Jul 2005 23:39:45 -0000 1.11 @@ -68,11 +68,20 @@ void configure (Ewl_Widget *w, void *ev_data, void *user_data) { /*printf ("Got a configure\n");*/ + Ewl_IconBox* ib = EWL_ICONBOX(w); + ewl_iconbox_inner_pane_calculate(EWL_ICONBOX(w)); - + if (REALIZED(ib) && VISIBLE(ib)) { + ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure); + ewl_iconbox_icon_arrange(ib); + ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); + } } + + + void ewl_iconbox_inner_pane_calculate(Ewl_IconBox* ib) { int pw,ph; @@ -95,25 +104,33 @@ /*printf ("Grew iconbox to: %d:%d\n", nw, nh);*/ } - if (REALIZED(ib) && VISIBLE(ib)) { - /*ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure);*/ - /*ewl_iconbox_icon_arrange(ib); */ - /*ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL);*/ - } + } int ewl_iconbox_icon_init(Ewl_IconBox_Icon* icon) { Ewl_Widget *w; w = EWL_WIDGET(icon); - if (!ewl_border_init(EWL_BORDER(icon), "Test")) { + if (!ewl_box_init(EWL_BOX(icon), EWL_ORIENTATION_VERTICAL)) { DRETURN_INT(FALSE, DLEVEL_STABLE); } + icon->w_label = ewl_text_new(NULL); + icon->image = ewl_image_new(NULL,NULL); + + icon->label = NULL; + icon->label_compressed = NULL; + + + + /* Init ewl setup */ ewl_widget_appearance_set(EWL_WIDGET(icon), "icon"); ewl_widget_inherit(EWL_WIDGET(w), "icon"); + ewl_container_child_append(EWL_CONTAINER(icon), icon->image); + ewl_container_child_append(EWL_CONTAINER(icon), icon->w_label); + DRETURN_INT(TRUE, DLEVEL_STABLE); @@ -262,7 +279,6 @@ ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); - /*printf("Setup the iconbox...\n");*/ DRETURN_INT(TRUE, DLEVEL_STABLE); @@ -281,19 +297,24 @@ ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), 680,700); } -void ewl_iconbox_icon_label_set(Ewl_IconBox_Icon* icon, char* text) { +void ewl_iconbox_icon_label_setup(Ewl_IconBox_Icon* icon, char* text) { + char* compressed; + + /*If we have a current label, nuke it*/ if (icon->label) { free(icon->label); } - + /*Copy the existing label to our icon*/ icon->label = strdup(text); + + if (strlen(text) <= LABEL_CHARS) { - ewl_border_text_set(EWL_BORDER(icon), text); + ewl_iconbox_icon_label_set(icon, icon->label); } else { if (icon->label_compressed) { free(icon->label_compressed); @@ -302,7 +323,7 @@ compressed = malloc(sizeof(char) * LABEL_CHARS + 3); strncpy(compressed, text, LABEL_CHARS); strcpy(compressed+LABEL_CHARS, "..\0"); - ewl_border_text_set(EWL_BORDER(icon),compressed); + ewl_iconbox_icon_label_set(icon, compressed); icon->label_compressed = compressed; } @@ -310,13 +331,26 @@ } +void ewl_iconbox_icon_label_set(Ewl_IconBox_Icon* icon, char* text) { +ewl_text_wrap_set(EWL_TEXT(icon->w_label), 1); + if (text) { + + ewl_text_text_set(EWL_TEXT(icon->w_label), text); + } else { + ewl_text_text_set(EWL_TEXT(icon->w_label), icon->label); + + } + +} + void ewl_iconbox_label_edit_key_down(Ewl_Widget *w, void *ev_data, void* user_data) { Ewl_Event_Key_Down* ev = ev_data; Ewl_IconBox* ib = EWL_ICONBOX(user_data); if (!strcmp(ev->keyname, "Return")) { - ewl_border_text_set(EWL_BORDER(ib->edit_icon), ewl_text_text_get(EWL_TEXT(ib->entry))); + ewl_iconbox_icon_label_set(EWL_ICONBOX_ICON(ib->edit_icon), ewl_text_text_get(EWL_TEXT(ib->entry))); + /*printf ("Setting label to: '%s'", ewl_text_text_get(EWL_TEXT(ib->entry)));*/ /*Hide the entry, now that we have an enter */ @@ -335,6 +369,7 @@ Ewl_IconBox_Icon* list_item; int maxx=0, maxy=0; int pw, ph; + int x,y; /*printf ("Entering the arrange..\n");*/ @@ -372,7 +407,16 @@ nextx = 0; nexty += ih + EWL_ICONBOX_ICON_PADDING; } - ewl_floater_position_set(EWL_FLOATER(list_item->floater), nextx, nexty); + + x = EWL_FLOATER(list_item->floater)->x; + y = EWL_FLOATER(list_item->floater)->y; + + /*Only move if we have to*/ + if ( abs(x - nextx) > 0 || + abs(y - nexty) > 0) + ewl_floater_position_set(EWL_FLOATER(list_item->floater), nextx, nexty); + + nextx += iw + EWL_ICONBOX_ICON_PADDING; if (nextx > maxx) maxx = nextx; @@ -444,16 +488,18 @@ /*Now check which icons we have to select in this range...*/ { + int w,h; + Ewl_IconBox_Icon* list_item; int ix,iy; ecore_list_goto_first(ib->ewl_iconbox_icon_list); - + + w = ewl_object_current_w_get(EWL_OBJECT(ib->select)); + h = ewl_object_current_h_get(EWL_OBJECT(ib->select)); while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { - int w,h; - w = ewl_object_current_w_get(EWL_OBJECT(ib->select)); - h = ewl_object_current_h_get(EWL_OBJECT(ib->select)); + ix = ewl_object_current_x_get(EWL_OBJECT(list_item)); @@ -461,7 +507,7 @@ if (ix >= lx && iy >= ly && ix <= hx && iy <= hy ) { ewl_iconbox_icon_select(EWL_ICONBOX_ICON(list_item),0); - } else { + } else if (list_item->selected) { ewl_iconbox_icon_deselect(EWL_ICONBOX_ICON(list_item)); } } @@ -487,8 +533,8 @@ /* Get the current width/height to centre */ - fw= ewl_object_preferred_w_get(EWL_OBJECT(list_item)); - fh= ewl_object_preferred_h_get(EWL_OBJECT(list_item)); + fw= ewl_object_preferred_w_get(EWL_OBJECT(list_item->image)); + fh= ewl_object_preferred_h_get(EWL_OBJECT(list_item->image)); @@ -582,8 +628,9 @@ } void ewl_iconbox_icon_select(Ewl_IconBox_Icon* ib, int loc) { /* Loc 0= image, 1= label */ - int sel = ib->selected; + int sel = ib->selected; + if (!ib->icon_box_parent->drag_box) { Ewl_IconBox_Icon* list_item; ecore_list_goto_first(ib->icon_box_parent->ewl_iconbox_icon_list); @@ -602,12 +649,12 @@ y = EWL_FLOATER(ib->floater)->y; /*printf ("Edit label event on: '%s'\n", ewl_border_text_get(EWL_BORDER(ib)));*/ - ewl_object_current_size_get(EWL_OBJECT(EWL_BORDER(ib)->label), &w, &h); + ewl_object_current_size_get(EWL_OBJECT(ib->w_label), &w, &h); ewl_object_current_size_get(EWL_OBJECT(ib->image), &iw, &ih); ewl_object_minimum_size_set(EWL_OBJECT(ib->icon_box_parent->entry), w,h); /* Get the current text to set this to */ - ewl_text_text_set(EWL_TEXT(ib->icon_box_parent->entry), ewl_border_text_get(EWL_BORDER(ib))); + ewl_text_text_set(EWL_TEXT(ib->icon_box_parent->entry), ewl_text_text_get(EWL_TEXT(ib->w_label))); ewl_widget_show(EWL_WIDGET(ib->icon_box_parent->entry_floater)); ewl_floater_position_set(EWL_FLOATER(ib->icon_box_parent->entry_floater), x,y+ih); @@ -618,26 +665,36 @@ ib->icon_box_parent->edit_icon = ib; } else { + + /*printf("Selecting..\n");*/ ewl_widget_hide(EWL_WIDGET(ib->icon_box_parent->entry_floater)); - ewl_border_text_set(EWL_BORDER(ib), ib->label); + ewl_iconbox_icon_label_set(ib, ib->label); + + ewl_text_bg_color_set(EWL_TEXT(ib->w_label), 0, 0, 255, 255); + ewl_text_cursor_position_set(EWL_TEXT(ib->w_label), 0); + ewl_text_color_apply(EWL_TEXT(ib->w_label), 0, 0, 255, 255, strlen(ib->label)); } + /*TODO allow multiselect, as per a "select policy" set on widget create/init*/ ib->selected = 1; /*printf("Setting color..\n");*/ - ewl_widget_color_set(EWL_WIDGET(EWL_BORDER(ib)->label), 140,0,255,128); - ewl_callback_call(EWL_WIDGET(EWL_BORDER(ib)->label), EWL_CALLBACK_APPEARANCE_CHANGED); + + ewl_callback_call(EWL_WIDGET(ib->w_label), EWL_CALLBACK_APPEARANCE_CHANGED); } void ewl_iconbox_icon_deselect(Ewl_IconBox_Icon *ib) { + ib->selected = 0; - ewl_widget_color_set(EWL_WIDGET(EWL_BORDER(ib)->label), 0,0,0,255); /*If we have a compressed label, set it now*/ if (ib->label_compressed) { - ewl_border_text_set(EWL_BORDER(ib), ib->label_compressed); + ewl_text_bg_color_set(EWL_TEXT(ib->w_label), 0, 0, 0, 255); + ewl_iconbox_icon_label_set(ib, ib->label_compressed); + ewl_text_cursor_position_set(EWL_TEXT(ib->w_label), 0); + ewl_text_color_apply(EWL_TEXT(ib->w_label), 0, 0, 0, 255, strlen(ib->label_compressed)); } } @@ -680,11 +737,10 @@ ewl_iconbox_icon_destroy_cb, NULL);*/ EWL_ICONBOX_ICON(ib)->selected = 0; - EWL_ICONBOX_ICON(ib)->floater = ewl_floater_new(iconbox->ewl_iconbox_pane_inner); /*Set the label*/ - ewl_iconbox_icon_label_set(EWL_ICONBOX_ICON(ib), name); + ewl_iconbox_icon_label_setup(EWL_ICONBOX_ICON(ib), name); EWL_ICONBOX_ICON(ib)->icon_box_parent = iconbox; /* Set our parent */ @@ -697,14 +753,13 @@ /* Make the image */ /*printf("MMaking image..\n");*/ - - EWL_ICONBOX_ICON(ib)->image = ewl_image_new(icon_file, NULL); + ewl_iconbox_icon_image_set(EWL_ICONBOX_ICON(ib), icon_file); + /* Put the image into the border */ /*printf("Adding image to box..\n");*/ ewl_container_child_append(EWL_CONTAINER(ib), EWL_ICONBOX_ICON(ib)->image); - ewl_border_label_position_set(EWL_BORDER(ib), EWL_FLAG_ALIGN_BOTTOM); /* Add the floater to our container */ @@ -717,6 +772,7 @@ /*Show*/ ewl_widget_show(EWL_ICONBOX_ICON(ib)->image); + ewl_widget_show(EWL_ICONBOX_ICON(ib)->w_label); ewl_widget_show(EWL_ICONBOX_ICON(ib)->floater); ewl_widget_show(EWL_WIDGET(ib)); @@ -727,7 +783,7 @@ ewl_callback_prepend(EWL_ICONBOX_ICON(ib)->image, EWL_CALLBACK_MOUSE_UP, ewl_iconbox_icon_mouse_up, ib); /* Add a callback to the border box label, for editing purposes... */ - ewl_callback_prepend(EWL_BORDER(ib)->label, EWL_CALLBACK_MOUSE_DOWN, ewl_iconbox_icon_label_mouse_down_cb, ib); + ewl_callback_prepend(EWL_ICONBOX_ICON(ib)->w_label, EWL_CALLBACK_MOUSE_DOWN, ewl_iconbox_icon_label_mouse_down_cb, ib); /* Add this icon to the icon list */ ecore_list_append(iconbox->ewl_iconbox_icon_list, ib); @@ -737,8 +793,10 @@ /*printf("Added icon: '%s'\n", name);*/ - ewl_object_alignment_set(EWL_OBJECT(ib), EWL_FLAG_ALIGN_CENTER); - ewl_widget_layer_set(EWL_WIDGET(ib), 500); + /*ewl_object_alignment_set(EWL_OBJECT(ib), EWL_FLAG_ALIGN_CENTER);*/ + /*ewl_widget_layer_set(EWL_WIDGET(ib), 500);*/ + + return EWL_ICONBOX_ICON(ib); } @@ -753,8 +811,10 @@ /*Shouldn't the floater auto-resize?*/ ewl_object_current_size_get(EWL_OBJECT(icon->image), &iw,&ih); - ewl_object_current_size_get(EWL_OBJECT(EWL_BORDER(icon)->label), &lw, &lh); /* Shouldn't access this directly, is there another way? */ + ewl_object_current_size_get(EWL_OBJECT(icon->w_label), &lw, &lh); /* Shouldn't access this directly, is there another way? */ ewl_object_minimum_size_set(EWL_OBJECT(icon->floater), iw, ih+lh); + + /*Call the configure callback for the iconbox - it doesn't seem to do this by itself*/ } void ewl_iconbox_clear(Ewl_IconBox* ib) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_iconbox.h 24 Jul 2005 23:35:35 -0000 1.5 +++ ewl_iconbox.h 26 Jul 2005 23:39:45 -0000 1.6 @@ -26,13 +26,16 @@ typedef struct Ewl_IconBox_Icon Ewl_IconBox_Icon; struct Ewl_IconBox_Icon { - Ewl_Border box; + Ewl_Box box; Ewl_Widget *image; Ewl_Widget *floater; - /*Ewl_Widget *box;*/ + Ewl_Widget *w_label; + + int drag; int selected ; + Ewl_IconBox* icon_box_parent; /* Our reference upwards, kinda breaks OO conventions */ char* label; /*Our icon's full (unabbreviated) label) */ char* label_compressed; @@ -118,6 +121,7 @@ void ewl_iconbox_label_edit_key_down(Ewl_Widget *w, void *ev_data, void* user_data); void ewl_iconbox_inner_pane_calculate(Ewl_IconBox* ib); void ewl_iconbox_mouse_up(Ewl_Widget *w, void *ev_data, void *user_data); +void ewl_iconbox_icon_label_set(Ewl_IconBox_Icon*, char*); |
From: <enl...@li...> - 2005-07-28 00:32:21
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c Log Message: Fixed ewl_iconbox for iconbox_test - auto arrange on resize it temporarily disabled =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_iconbox.c 26 Jul 2005 23:39:45 -0000 1.11 +++ ewl_iconbox.c 28 Jul 2005 00:32:09 -0000 1.12 @@ -70,11 +70,12 @@ Ewl_IconBox* ib = EWL_ICONBOX(w); - ewl_iconbox_inner_pane_calculate(EWL_ICONBOX(w)); + if (REALIZED(ib) && VISIBLE(ib)) { ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure); - ewl_iconbox_icon_arrange(ib); + ewl_iconbox_inner_pane_calculate(EWL_ICONBOX(w)); + /*ewl_iconbox_icon_arrange(ib); */ ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, configure, NULL); } } @@ -682,20 +683,21 @@ /*printf("Setting color..\n");*/ - ewl_callback_call(EWL_WIDGET(ib->w_label), EWL_CALLBACK_APPEARANCE_CHANGED); } void ewl_iconbox_icon_deselect(Ewl_IconBox_Icon *ib) { ib->selected = 0; + ewl_text_bg_color_set(EWL_TEXT(ib->w_label), 0, 0, 0, 255); + /*If we have a compressed label, set it now*/ if (ib->label_compressed) { - ewl_text_bg_color_set(EWL_TEXT(ib->w_label), 0, 0, 0, 255); ewl_iconbox_icon_label_set(ib, ib->label_compressed); - ewl_text_cursor_position_set(EWL_TEXT(ib->w_label), 0); - ewl_text_color_apply(EWL_TEXT(ib->w_label), 0, 0, 0, 255, strlen(ib->label_compressed)); } + ewl_text_cursor_position_set(EWL_TEXT(ib->w_label), 0); + ewl_text_color_apply(EWL_TEXT(ib->w_label), 0, 0, 0, 255, strlen(ewl_text_text_get(EWL_TEXT(ib->w_label)))); + } void ewl_iconbox_deselect_all(Ewl_IconBox* ib) { |
From: <enl...@li...> - 2005-08-02 04:33:37
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c Log Message: Right click fix for context menu =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_iconbox.c 28 Jul 2005 00:32:09 -0000 1.12 +++ ewl_iconbox.c 2 Aug 2005 04:33:31 -0000 1.13 @@ -101,7 +101,7 @@ if (nh | nw) { if (!nh) nh = sh; if (!nw) nw = sw; - ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), nw, nh); + ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), nw+50, nh+50); /*printf ("Grew iconbox to: %d:%d\n", nw, nh);*/ } @@ -316,6 +316,7 @@ if (strlen(text) <= LABEL_CHARS) { ewl_iconbox_icon_label_set(icon, icon->label); + icon->label_compressed = NULL; } else { if (icon->label_compressed) { free(icon->label_compressed); @@ -333,10 +334,21 @@ } void ewl_iconbox_icon_label_set(Ewl_IconBox_Icon* icon, char* text) { -ewl_text_wrap_set(EWL_TEXT(icon->w_label), 1); + int wrap = 0; + + /*ewl_text_wrap_set(EWL_TEXT(icon->w_label), 1);*/ + if (text) { ewl_text_text_set(EWL_TEXT(icon->w_label), text); + + wrap = 10; + while (wrap < strlen(text)) { + ewl_text_cursor_position_set(EWL_TEXT(icon->w_label), wrap); + ewl_text_text_insert(EWL_TEXT(icon->w_label), "\n", wrap); + + wrap += 10; + } } else { ewl_text_text_set(EWL_TEXT(icon->w_label), icon->label); @@ -430,7 +442,7 @@ * the size of the scrollpane, which ever is bigger */ ewl_object_current_size_get(EWL_OBJECT(ib->ewl_iconbox_scrollpane), &pw, &ph); - ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), pw > maxx ? pw +iw: maxx+iw, ph > maxy+ih ? ph+ih : maxy+ih); + ewl_object_custom_size_set(EWL_OBJECT(ib->ewl_iconbox_pane_inner), pw > maxx ? pw +iw: maxx+iw+20, ph > maxy+ih ? ph+ih : maxy+ih+30); @@ -506,7 +518,7 @@ ix = ewl_object_current_x_get(EWL_OBJECT(list_item)); iy = ewl_object_current_y_get(EWL_OBJECT(list_item)); - if (ix >= lx && iy >= ly && ix <= hx && iy <= hy ) { + if (ix >= lx && iy >= ly && ix <= hx && iy <= hy && !list_item->selected ) { ewl_iconbox_icon_select(EWL_ICONBOX_ICON(list_item),0); } else if (list_item->selected) { ewl_iconbox_icon_deselect(EWL_ICONBOX_ICON(list_item)); @@ -561,7 +573,7 @@ ibx = ewl_object_current_x_get(EWL_OBJECT(ib)); iby = ewl_object_current_y_get(EWL_OBJECT(ib)); - if (ev->button == 3) { + if (ev->button == 3 /* Confirm that this is not an icon event */ && (ib->xdown != ev->x && ib->ydown != ev->y)) { /*printf ("Context menu: %d,%d\n", ev->x, ev->y);*/ ewl_widget_show(ib->ewl_iconbox_menu_floater); @@ -665,7 +677,7 @@ /* Record which icon's label we are editing */ ib->icon_box_parent->edit_icon = ib; - } else { + } else if (!ib->selected) { /*printf("Selecting..\n");*/ ewl_widget_hide(EWL_WIDGET(ib->icon_box_parent->entry_floater)); @@ -748,7 +760,7 @@ EWL_ICONBOX_ICON(ib)->icon_box_parent = iconbox; /* Set our parent */ /*printf("Setting fill policy..\n");*/ - ewl_object_fill_policy_set(EWL_OBJECT(ib), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(ib), EWL_FLAG_FILL_FILL); ewl_object_fill_policy_set(EWL_OBJECT(EWL_ICONBOX_ICON(ib)->floater), EWL_FLAG_FILL_SHRINK); ewl_container_child_append(EWL_CONTAINER(EWL_ICONBOX_ICON(ib)->floater), ib); @@ -805,16 +817,15 @@ void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename) { - int iw,ih,lw,lh; ewl_image_file_set(EWL_IMAGE(icon->image), filename, NULL); /*Make sure we're not too small now */ /*Shouldn't the floater auto-resize?*/ - ewl_object_current_size_get(EWL_OBJECT(icon->image), &iw,&ih); - ewl_object_current_size_get(EWL_OBJECT(icon->w_label), &lw, &lh); /* Shouldn't access this directly, is there another way? */ - ewl_object_minimum_size_set(EWL_OBJECT(icon->floater), iw, ih+lh); + /*ewl_object_current_size_get(EWL_OBJECT(icon->image), &iw,&ih); + ewl_object_current_size_get(EWL_OBJECT(icon->w_label), &lw, &lh); + ewl_object_minimum_size_set(EWL_OBJECT(icon->floater), iw, ih+lh);*/ /*Call the configure callback for the iconbox - it doesn't seem to do this by itself*/ } |
From: <enl...@li...> - 2005-08-02 12:20:28
|
Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c Log Message: Removed an "optimisation" in the rubber band code, that seemed to be slowing us down. Much faster to rubberband large lists of icons now. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_iconbox.c 2 Aug 2005 04:33:31 -0000 1.13 +++ ewl_iconbox.c 2 Aug 2005 12:20:21 -0000 1.14 @@ -174,12 +174,9 @@ /*** Context menu **/ /*Make the menu floater */ ib->ewl_iconbox_menu_floater = ewl_floater_new(ib->ewl_iconbox_pane_inner); - ib->ewl_iconbox_menu_box = ewl_vbox_new(); - ewl_object_fill_policy_set(EWL_OBJECT(ib->ewl_iconbox_menu_box), EWL_FLAG_FILL_FILL); ewl_object_fill_policy_set(EWL_OBJECT(ib->ewl_iconbox_menu_floater), EWL_FLAG_FILL_FILL); - ewl_container_child_append(EWL_CONTAINER(ib->ewl_iconbox_menu_box), ib->ewl_iconbox_menu_floater); /* Get the context menu ready */ ib->ewl_iconbox_context_menu = ewl_menu_new(NULL, ""); @@ -245,7 +242,6 @@ ewl_widget_show(ib->ewl_iconbox_pane_inner); ewl_widget_show(ib->ewl_iconbox_scrollpane); ewl_widget_show(ib->ewl_iconbox_menu_floater); - ewl_widget_show(ib->ewl_iconbox_menu_box); /* Ewl Entry for the purposes of label editing - if enabled */ @@ -510,7 +506,7 @@ w = ewl_object_current_w_get(EWL_OBJECT(ib->select)); h = ewl_object_current_h_get(EWL_OBJECT(ib->select)); - while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) { + while((list_item = (Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) ) { @@ -518,7 +514,7 @@ ix = ewl_object_current_x_get(EWL_OBJECT(list_item)); iy = ewl_object_current_y_get(EWL_OBJECT(list_item)); - if (ix >= lx && iy >= ly && ix <= hx && iy <= hy && !list_item->selected ) { + if (ix >= lx && iy >= ly && ix <= hx && iy <= hy) { ewl_iconbox_icon_select(EWL_ICONBOX_ICON(list_item),0); } else if (list_item->selected) { ewl_iconbox_icon_deselect(EWL_ICONBOX_ICON(list_item)); @@ -577,9 +573,18 @@ /*printf ("Context menu: %d,%d\n", ev->x, ev->y);*/ ewl_widget_show(ib->ewl_iconbox_menu_floater); + ewl_widget_show(ib->ewl_iconbox_context_menu); + ewl_widget_show(ib->ewl_iconbox_view_menu); + ewl_floater_position_set(EWL_FLOATER(ib->ewl_iconbox_menu_floater), ev->x-ibx + abs(px-ibx), ev->y-iby +abs(py-iby)); ewl_callback_call(EWL_WIDGET(ib->ewl_iconbox_context_menu), EWL_CALLBACK_SELECT); } else if (ev->button == 1 /* Confirm that this is not an icon event */ && (ib->xdown != ev->x && ib->ydown != ev->y)) { + /*Make sure the context menu is invisible*/ + ewl_widget_hide(ib->ewl_iconbox_menu_floater); + ewl_widget_hide(ib->ewl_iconbox_context_menu); + ewl_widget_hide(ib->ewl_iconbox_view_menu); + + /*printf ("Start select at %d:%d\n", ev->x, ev->y);*/ ewl_object_custom_size_set(EWL_OBJECT(ib->select), 1, 1); |