*/
ContactTextFieldControl(Ui::GenlistItem *parent,
Model::ContactTextField &field);
+ virtual ~ContactTextFieldControl() override;
/**
* @brief Save the control value into the field.
private:
virtual void onCreated() override;
+ void setNextItem(Ui::GenlistItem *item);
+ void unsetNextItem();
void onChanged(Evas_Object *entry, void *eventInfo);
void onFocused(Evas_Object *entry, void *eventInfo);
{
}
+ContactTextFieldControl::~ContactTextFieldControl()
+{
+ unsetNextItem();
+}
+
void ContactTextFieldControl::save()
{
if (!m_IsChanged) {
void ContactTextFieldControl::updateReturnKey()
{
- m_NextItem = nullptr;
+ unsetNextItem();
for (auto item = m_ParentItem->getNextItem(); item; item = item->getNextItem()) {
if (item->isFocusable()) {
- m_NextItem = item;
+ setNextItem(item);
break;
}
}
update();
}
+void ContactTextFieldControl::setNextItem(Ui::GenlistItem *item)
+{
+ m_NextItem = item;
+ m_NextItem->setDestroyCallback(std::bind(&ContactTextFieldControl::updateReturnKey, this));
+}
+
+void ContactTextFieldControl::unsetNextItem()
+{
+ if (m_NextItem) {
+ m_NextItem->setDestroyCallback(nullptr);
+ m_NextItem = nullptr;
+ }
+}
+
void ContactTextFieldControl::onChanged(Evas_Object *entry, void *eventInfo)
{
if (m_IsUpdating) {
void ContactTextFieldControl::onUnfocused(Evas_Object *entry, void *eventInfo)
{
save();
+ unsetNextItem();
}
void ContactTextFieldControl::onActivated(Evas_Object *entry, void *eventInfo)