#define EDC_PART_SEPARATOR_STR "separator%d"
#define EDC_PART_FIELD_ENABLE_SIG_STR "field%d,enable"
#define EDC_PART_FIELD_DISABLE_SIG_STR "field%d,disable"
+#define EDC_PART_FIELD_SEPARATOR_ENABLE_SIG_STR "field%d,separator,enable"
+#define EDC_PART_FIELD_SEPARATOR_DISABLE_SIG_STR "field%d,separator,disable"
/* struct tm does not define the fields in the order year, month,
* date, hour, minute. values are reassigned to an array for easy
};
static const char *multifield_formats = "cxXrRTDF";
-static const char *ignore_separators = "()";
+static const char *ignore_separators = "() ";
static Datetime_Mod_Api *dt_mod = NULL;
static const char SIG_CHANGED[] = "changed";
snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
field->location);
elm_layout_signal_emit(obj, buf, "elm");
+
+ if (field->separator && strcmp(field->separator, ""))
+ {
+ snprintf(buf, sizeof(buf), EDC_PART_FIELD_SEPARATOR_ENABLE_SIG_STR,
+ field->location);
+ elm_layout_signal_emit(obj, buf, "elm");
+ snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, field->location);
+ elm_layout_text_set(obj, buf, field->separator);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), EDC_PART_FIELD_SEPARATOR_DISABLE_SIG_STR,
+ field->location);
+ elm_layout_signal_emit(obj, buf, "elm");
+ }
}
else
{
snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
field->location);
elm_layout_signal_emit(obj, buf, "elm");
+ snprintf(buf, sizeof(buf), EDC_PART_FIELD_SEPARATOR_DISABLE_SIG_STR,
+ field->location);
+ elm_layout_signal_emit(obj, buf, "elm");
}
- snprintf
- (buf, sizeof(buf), EDC_PART_SEPARATOR_STR, (field->location + 1));
- elm_layout_text_set(obj, buf, field->separator);
}
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
field->location);
elm_layout_signal_emit(obj, buf, "elm");
- snprintf
- (buf, sizeof(buf), EDC_PART_SEPARATOR_STR, (field->location + 1));
- elm_layout_text_set(obj, buf, field->separator);
-
dt_mod->field_value_display(sd->mod_data, field->item_obj);
+
+ if (field->separator && strcmp(field->separator, ""))
+ {
+ snprintf(buf, sizeof(buf), EDC_PART_FIELD_SEPARATOR_ENABLE_SIG_STR,
+ field->location);
+ elm_layout_signal_emit(obj, buf, "elm");
+ snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, field->location);
+ elm_layout_text_set(obj, buf, field->separator);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), EDC_PART_FIELD_SEPARATOR_DISABLE_SIG_STR,
+ field->location);
+ elm_layout_signal_emit(obj, buf, "elm");
+ }
}
else
{
snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
field->location);
elm_layout_signal_emit(obj, buf, "elm");
+ snprintf(buf, sizeof(buf), EDC_PART_FIELD_SEPARATOR_DISABLE_SIG_STR,
+ field->location);
+ elm_layout_signal_emit(obj, buf, "elm");
}
}
#define DISKSELECTOR_MIN_ITEMS 4
#define BUFF_SIZE 1024
+static const char *field_styles[] = {
+ "year", "month", "date", "hour", "minute", "ampm" };
+
typedef struct _Ctxpopup_Module_Data Ctxpopup_Module_Data;
typedef struct _DiskItem_Data DiskItem_Data;
static void _field_clicked_cb(void *data, Evas_Object *obj);
const char *fmt;
int idx, min, max, val;
unsigned int display_item_num, text_len = 0;
- Evas_Coord x = 0, y = 0, w = 0, h = 0, width;
+ Evas_Coord x = 0, y = 0, w = 0, h = 0, width, w_item;
ctx_mod = (Ctxpopup_Module_Data *)data;
if (!ctx_mod || !ctx_mod->ctxpopup) return;
elm_diskselector_side_text_max_length_set(diskselector, text_len);
evas_object_geometry_get(obj, &x, &y, &w, &h);
+ if (edje_object_part_exists(elm_layout_edje_get(obj), "elm.text"))
+ edje_object_part_geometry_get(elm_layout_edje_get(obj), "elm.text", NULL, NULL, &w_item, NULL);
+ else
+ w_item = w;
+
evas_object_geometry_get(elm_widget_top_get(ctx_mod->mod_data.base), NULL, NULL, &width, NULL);
evas_object_size_hint_min_set(ctx_mod->ctxpopup, width, -1);
- display_item_num = width / (w + elm_config_finger_size_get());
+ display_item_num = width / (w_item + elm_config_finger_size_get());
// always display even number of items to avoid autoselection
if (display_item_num % 2) display_item_num -= 1;
if (display_item_num < DISKSELECTOR_MIN_ITEMS)
{
Ctxpopup_Module_Data *ctx_mod;
Evas_Object *field_obj;
+ char buf[BUFF_SIZE];
ctx_mod = (Ctxpopup_Module_Data *)module_data;
if (!ctx_mod) return NULL;
if (field_type == ELM_DATETIME_AMPM)
{
field_obj = elm_button_add(ctx_mod->mod_data.base);
- elm_object_style_set(field_obj, "datetime_ampm/default");
evas_object_smart_callback_add(field_obj, "clicked", _ampm_clicked_cb, ctx_mod);
}
else
evas_object_event_callback_add(field_obj, EVAS_CALLBACK_MOUSE_DOWN, _field_mouse_down_cb, ctx_mod);
evas_object_event_callback_add(field_obj, EVAS_CALLBACK_MOUSE_MOVE, _field_mouse_move_cb, ctx_mod);
evas_object_event_callback_add(field_obj, EVAS_CALLBACK_MOUSE_UP, _field_mouse_up_cb, ctx_mod);
- elm_object_style_set(field_obj,"datetime");
}
+ snprintf(buf, sizeof(buf), "datetime/%s/default", field_styles[field_type]);
+ elm_object_style_set(field_obj, buf);
evas_object_data_set(field_obj, "_field_type", (void *)field_type);
// ACCESS