if (!entry) continue;
if (elm_object_focus_get(entry))
{
- elm_object_focus_set(entry, EINA_FALSE);
elm_layout_signal_emit(spinner, "elm,action,entry,toggle", "elm");
edje_object_message_signal_process(elm_layout_edje_get(spinner));
}
if (!entry) continue;
if (elm_object_focus_get(entry))
{
- elm_object_focus_set(entry, EINA_FALSE);
elm_layout_signal_emit(spinner, "elm,action,entry,toggle", "elm");
edje_object_message_signal_process(elm_layout_edje_get(spinner));
}
if (!entry) continue;
if (elm_object_focus_get(entry))
{
- elm_object_focus_set(entry, EINA_FALSE);
elm_layout_signal_emit(spinner, "elm,action,entry,toggle", "elm");
}
}
if (!entry) continue;
if (elm_object_focus_get(entry))
{
- elm_object_focus_set(entry, EINA_FALSE);
elm_layout_signal_emit(spinner, "elm,action,entry,toggle", "elm");
}
}
popup_mod = (Popup_Module_Data *)data;
if (!popup_mod) return;
- elm_object_focus_set(obj, EINA_FALSE);
for (idx = 0; idx < ELM_DATETIME_DATE; idx++)
{
entry = elm_object_part_content_get(popup_mod->popup_field[idx], "elm.swallow.entry");
idx++;
en = elm_object_part_content_get(popup_mod->popup_field[idx], "elm.swallow.entry");
elm_layout_signal_emit(popup_mod->popup_field[idx], "elm,action,entry,toggle", "elm");
- elm_object_focus_set(en, EINA_TRUE);
return;
}
}
en = elm_object_part_content_get(popup_mod->popup_field[ELM_DATETIME_MINUTE], "elm.swallow.entry");
elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_MINUTE],
"elm,action,entry,toggle", "elm");
- elm_object_focus_set(en, EINA_TRUE);
}
}
entry = elm_object_part_content_get(popup_mod->popup_field[idx], "elm.swallow.entry");
if ((obj != entry) && elm_object_focus_get(entry))
{
- elm_object_focus_set(entry, EINA_FALSE);
- elm_entry_input_panel_hide(obj);
+ elm_layout_signal_emit(popup_mod->popup_field[idx],
+ "elm,action,entry,toggle", "elm");
return;
}
}
-
- elm_entry_select_all(obj);
}
static void
_set_timepicker_popup_title_text(popup_mod);
}
+const char *
+_text_insert(const char *text, char *input, int pos)
+{
+ char *result;
+ int text_len, input_len;
+
+ text_len = strlen(text);
+ input_len = strlen(input);
+ result = (char *)malloc(sizeof(char) * (text_len + input_len) + 1);
+ memset(result, 0, sizeof(char) * (text_len + input_len) + 1);
+
+ strncpy(result, text, pos);
+ strcpy(result + pos, input);
+ strcpy(result + pos + input_len, text + pos);
+
+ return (const char *)result;
+}
+
static void
_year_validity_checking_filter(void *data, Evas_Object *obj, char **text)
{
Popup_Module_Data *popup_mod;
Evas_Object *entry;
- char new_str[BUFF_SIZE] = {0,};
+ const char *new_str = NULL;
int min, max, val = 0, len;
char *insert;
const char *curr_str;
if (len < 3) return;
curr_str = elm_object_text_get(obj);
- if (curr_str) strncpy(new_str, curr_str, BUFF_SIZE);
- strncat(new_str, insert, 1);
- if (new_str[0]) val = atoi(new_str);
+ if (curr_str) new_str = _text_insert(curr_str, insert, elm_entry_cursor_pos_get(obj));
+ if (new_str) val = atoi(new_str);
popup_mod->mod_data.field_limit_get(popup_mod->mod_data.base, ELM_DATETIME_YEAR, &min, &max);
min += STRUCT_TM_YEAR_BASE_VALUE;
if (val <= max)
{
- elm_spinner_value_set(popup_mod->popup_field[ELM_DATETIME_YEAR], val);
+ elm_entry_entry_set(obj, new_str);
elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_YEAR],
"elm,action,entry,toggle", "elm");
- elm_object_focus_set(obj, EINA_FALSE);
entry = elm_object_part_content_get(popup_mod->popup_field[ELM_DATETIME_MONTH],
"elm.swallow.entry");
{
elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_MONTH],
"elm,action,entry,toggle", "elm");
- elm_object_focus_set(entry, EINA_TRUE);
}
}
*insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
}
static void
{
Popup_Module_Data *popup_mod;
Evas_Object *entry;
- char new_str[BUFF_SIZE] = {0,};
+ const char *new_str = NULL;
int min, max, val = 0, len;
char *insert;
const char *curr_str;
if (len < 1) return;
curr_str = elm_object_text_get(obj);
- if (curr_str) strncpy(new_str, curr_str, BUFF_SIZE);
- strncat(new_str, insert, 1);
- if (new_str[0]) val = atoi(new_str) - 1;
+ if (curr_str) new_str = _text_insert(curr_str, insert, elm_entry_cursor_pos_get(obj));
+ if (new_str) val = atoi(new_str) - 1;
popup_mod->mod_data.field_limit_get(popup_mod->mod_data.base, ELM_DATETIME_MONTH, &min, &max);
if ((val >= min) && (val <= max))
{
- elm_spinner_value_set(popup_mod->popup_field[ELM_DATETIME_MONTH], val + 1);
+ elm_entry_entry_set(obj, new_str);
elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_MONTH],
"elm,action,entry,toggle", "elm");
- elm_object_focus_set(obj, EINA_FALSE);
entry = elm_object_part_content_get(popup_mod->popup_field[ELM_DATETIME_DATE],
"elm.swallow.entry");
{
elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_DATE],
"elm,action,entry,toggle", "elm");
- elm_object_focus_set(entry, EINA_TRUE);
}
}
*insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
}
static void
{
Popup_Module_Data *popup_mod;
Evas_Object *entry;
- char new_str[BUFF_SIZE] = {0,};
+ const char *new_str = NULL;
int val = 0, len;
char *insert;
const char *curr_str;
if (len < 1) return;
curr_str = elm_object_text_get(obj);
- if (curr_str) strncpy(new_str, curr_str, BUFF_SIZE);
- strncat(new_str, insert, 1);
- if (new_str[0]) val = atoi(new_str);
+ if (curr_str) new_str = _text_insert(curr_str, insert, elm_entry_cursor_pos_get(obj));
+ if (new_str) val = atoi(new_str);
+
if (!popup_mod->time_24hr && val > STRUCT_TM_TIME_12HRS_MAX_VALUE)
{
*insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
return;
}
else if (popup_mod->time_24hr && val > STRUCT_TM_TIME_24HRS_MAX_VALUE)
{
*insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
return;
}
- elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_HOUR],
- "elm,action,entry,toggle", "elm");
- elm_object_focus_set(obj, EINA_FALSE);
+ elm_entry_entry_set(obj, new_str);
+ elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_HOUR],
+ "elm,action,entry,toggle", "elm");
entry = elm_object_part_content_get(popup_mod->popup_field[ELM_DATETIME_MINUTE],
"elm.swallow.entry");
{
elm_layout_signal_emit(popup_mod->popup_field[ELM_DATETIME_MINUTE],
"elm,action,entry,toggle", "elm");
- elm_object_focus_set(entry, EINA_TRUE);
}
+ *insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
}
static void
_date_validity_checking_filter(void *data, Evas_Object *obj, char **text)
{
Popup_Module_Data *popup_mod;
- char new_str[BUFF_SIZE] = {0,};
+ const char *new_str = NULL;
int min, max, val = 0, len;
const char *curr_str;
char *insert;
if (len < 1) return;
curr_str = elm_object_text_get(obj);
- if (curr_str) strncpy(new_str, curr_str, BUFF_SIZE);
- strncat(new_str, insert, 1);
- if (new_str[0]) val = atoi(new_str);
+ if (curr_str) new_str = _text_insert(curr_str, insert, elm_entry_cursor_pos_get(obj));
+ if (new_str) val = atoi(new_str);
popup_mod->mod_data.field_limit_get(popup_mod->mod_data.base, ELM_DATETIME_DATE, &min, &max);
- if ((val < min) || (val > max))
- *insert = 0;
+ if ((val >= min) && (val <= max))
+ {
+ elm_entry_entry_set(obj, new_str);
+ elm_entry_cursor_end_set(obj);
+ }
+ *insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
}
static void
_minute_validity_checking_filter(void *data, Evas_Object *obj, char **text)
{
Popup_Module_Data *popup_mod;
- char new_str[BUFF_SIZE];
+ const char *new_str = NULL;
int min, max, val = 0, len;
char *insert;
const char *curr_str;
if (len < 1) return;
curr_str = elm_object_text_get(obj);
- if (curr_str) strncpy(new_str, curr_str, BUFF_SIZE);
- new_str[BUFF_SIZE - 1] = '\0';
- strncat(new_str, insert, 1);
- if (new_str[0]) val = atoi(new_str);
+ if (curr_str) new_str = _text_insert(curr_str, insert, elm_entry_cursor_pos_get(obj));
+ if (new_str) val = atoi(new_str);
popup_mod->mod_data.field_limit_get(popup_mod->mod_data.base, ELM_DATETIME_MINUTE, &min, &max);
- if ((val < min) || (val > max))
- *insert = 0;
+ if ((val >= min) && (val <= max))
+ {
+ elm_entry_entry_set(obj, new_str);
+ elm_entry_cursor_end_set(obj);
+ }
+ *insert = 0;
+ free((void *)new_str);
+ new_str = NULL;
}
static void