typedef struct _Widget_Data Widget_Data;
-enum
+enum
{
DATE_YEAR,
DATE_MON,
else
{
char *str = _get_i18n_string(obj, D_FMT);
- if (str)
+ if (str)
{
if (!strcmp(str, "yymmdd")) wd->date_format = DATE_FORMAT_YYMMDD;
else if (!strcmp(str, "yyddmm")) wd->date_format = DATE_FORMAT_YYDDMM;
if (!wd || !wd->base) return ;
- wd->pm = !wd->pm;
+ wd->pm = !wd->pm;
if (wd->pm)
{
str = _get_i18n_string(data, PM_STR);
- if (str)
+ if (str)
{
elm_button_label_set(wd->time[TIME_AMPM], str);
free(str);
elm_object_focus(wd->time[TIME_MIN]);
}
-static Eina_Bool
+static Eina_Bool
_focus_idler_cb(void *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Widget_Data *wd = elm_widget_data_get(data);
if (!wd || !wd->base) return;
- if (wd->idler)
+ if (wd->idler)
{
ecore_idler_del(wd->idler);
wd->idler = NULL;
{
elm_entry_entry_set(wd->date[DATE_MON], i18n_str);
free(i18n_str);
- }
+ }
}
//check day boundary
if (wd->day != (num = _check_date_boundary(data, wd->day, DATE_DAY)))
{
wd->day = num;
- sprintf(str, "%d", wd->day);
+ sprintf(str, "%d", wd->day);
elm_entry_entry_set(wd->date[DATE_DAY], str);
}
edje_object_signal_emit(wd->base, "elm,state,month,focus,out", "elm");
}
wd->hour = (wd->pm == EINA_TRUE)? num + HOUR_12H_MAXIMUM : num;
if ((wd->hour % 12) == 0) wd->hour -= HOUR_12H_MAXIMUM;
- if (wd->pm)
+ if (wd->pm)
{
i18n_str = _get_i18n_string(data, PM_STR);
if (i18n_str)
free(i18n_str);
}
}
- else
+ else
{
i18n_str = _get_i18n_string(data, AM_STR);
if (i18n_str)
}
else if (obj == wd->time[TIME_MIN])
{
- if (strlen(elm_entry_entry_get(wd->time[TIME_MIN])))
+ if (strlen(elm_entry_entry_get(wd->time[TIME_MIN])))
wd->min = atoi(elm_entry_entry_get(wd->time[TIME_MIN]));
if (wd->min > MIN_MAXIMUM) wd->min = MIN_MAXIMUM;
evas_object_smart_callback_call(data, "changed", NULL);
}
-static void
+static void
_entry_focus_move(Evas_Object *obj, Evas_Object *focus_obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
{
case D_FMT:
str = calloc(7, sizeof(char));
- while (fmt[i])
+ while (fmt[i])
{
- if (fmt[i] == '%' && fmt[i+1])
+ if (fmt[i] == '%' && fmt[i+1])
{
i++;
- switch (fmt[i])
+ switch (fmt[i])
{
case 'Y': case 'M': case 'D': case 'y': case 'm': case 'd':
str[j++] = tolower(fmt[i]);
i++;
}
return str;
- case AM_STR:
+ case AM_STR:
case PM_STR:
if (strlen(fmt) > 0)
{
}
i++;
}
- return str;
+ return str;
}
return NULL;
}
return day_of_month;
}
-static Eina_Bool
+static Eina_Bool
_check_input_done(Evas_Object *obj, Evas_Object *focus_obj, int strlen)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
else if (focus_obj == wd->time[TIME_MIN])
{
- if (strlen == TIME_MAX_LENGTH || atoi(elm_entry_entry_get(focus_obj)) > 5)
+ if (strlen == TIME_MAX_LENGTH || atoi(elm_entry_entry_get(focus_obj)) > 5)
wd->editing = EINA_FALSE;
}
return !wd->editing;
elm_entry_entry_set(obj, "");
}
-static Eina_Bool
+static Eina_Bool
_imf_event_commit_cb(void *data , int type __UNUSED__, void *event)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!elm_widget_focus_get(data)) return ECORE_CALLBACK_PASS_ON;
focus_obj = elm_widget_focused_object_get(data);
- if (!wd->editing)
+ if (!wd->editing)
{
elm_entry_entry_set(focus_obj, "");
wd->editing = EINA_TRUE;
return ECORE_CALLBACK_DONE;
}
-static void
+static void
_input_panel_event_callback(void *data, Ecore_IMF_Context *ctx __UNUSED__, int value)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
- if (wd->func)
+ if (wd->func)
wd->func(wd->func_data, data, value);
}
{
wd->pm = EINA_TRUE;
i18n_str = _get_i18n_string(obj, PM_STR);
- if (i18n_str)
+ if (i18n_str)
{
elm_button_label_set(wd->time[TIME_AMPM], i18n_str);
free(i18n_str);
elm_entry_entry_set(wd->time[TIME_MIN], str);
}
-static void
+static void
_date_entry_add(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
static Elm_Entry_Filter_Limit_Size filter_data, filter_data2;
int i;
- if (!wd) return;
+ if (!wd) return;
for (i = 0; i < DATE_MAX; i++)
{
evas_object_event_callback_add(wd->date[i], EVAS_CALLBACK_KEY_UP, _entry_key_up_cb, obj);
elm_widget_sub_object_add(obj, wd->date[i]);
}
-
+
filter_data.max_char_count = 0;
filter_data.max_byte_count = YEAR_MAX_LENGTH;
elm_entry_text_filter_append(wd->date[DATE_YEAR], elm_entry_filter_limit_size, &filter_data);
elm_entry_text_filter_append(wd->date[DATE_YEAR], elm_entry_filter_limit_size, &filter_data2);
}
-static void
+static void
_time_entry_add(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
int i;
if (!wd) return;
-
+
filter_data.max_char_count = 0;
filter_data.max_byte_count = TIME_MAX_LENGTH;
for (i = 0; i < TIME_MAX-1; i++)
Widget_Data *wd;
e = evas_object_evas_get(parent);
- if (!e) return NULL;
+ if (!e) return NULL;
wd = ELM_NEW(Widget_Data);
- obj = elm_widget_add(e);
+ obj = elm_widget_add(e);
ELM_SET_WIDTYPE(widtype, "datefield");
elm_widget_type_set(obj, "datefield");
elm_widget_sub_object_add(parent, obj);
* @param day The day to set
* @param hour The hours to set (24hour mode - 0~23)
* @param min The minutes to set (0~59)
- *
+ *
* @ingroup Datefield
*/
EAPI void
* Set if the datefield show hours in military or am/pm mode
*
* @param obj The datefield object
- * @param mode option for the hours mode. If true, it is shown as 12h mode, if false, it is shown as 24h mode. Default value is true
+ * @param mode option for the hours mode. If true, it is shown as 12h mode, if false, it is shown as 24h mode. Default value is true
*
* @ingroup Datefield
*/
if (!wd) return;
- if (wd->time_mode != mode)
+ if (wd->time_mode != mode)
{
wd->time_mode = mode;
if (!wd->time_mode) edje_object_signal_emit(wd->base, "elm,state,mode,24h", "elm");
* get time mode of the datefield
*
* @param obj The datefield object
- * @return time mode (EINA_TRUE: 12hour mode / EINA_FALSE: 24hour mode)
+ * @return time mode (EINA_TRUE: 12hour mode / EINA_FALSE: 24hour mode)
*
* @ingroup Datefield
*/
*
* @param obj The datefield object
* @param func The function to be called when the event is triggered (value will be the Ecore_IMF_Input_Panel_State)
- * @param data The data pointer to be passed to @p func
+ * @param data The data pointer to be passed to @p func
*
* @ingroup Datefield
*/
-EAPI void
+EAPI void
elm_datefield_input_panel_state_callback_add(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value), void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
*
* @ingroup Datefield
*/
-EAPI void
+EAPI void
elm_datefield_input_panel_state_callback_del(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value))
{
ELM_CHECK_WIDTYPE(obj, widtype);
if (!wd) return;
- if (wd->func && wd->func == pEventCallbackFunc)
+ if (wd->func && wd->func == pEventCallbackFunc)
{
for (i = 0; i < DATE_MAX; i++)
ecore_imf_context_input_panel_event_callback_del(