show();
}
+Entry::Entry(Widget *parent, const std::string &text)
+ : Entry(parent)
+{
+ setEntryText(text);
+}
+
void Entry::setEntryText(const TranslatedString &text)
{
elm_entry_entry_set(uniqueObj_.get(), text.c_str());
{
public:
Entry(Widget *parent);
+ Entry(Widget *parent, const std::string &text);
void setEntryText(const TranslatedString &text);
std::string getEntryText();
#define EDJ_SET_VALUE "edje/accessibility-settings-set-value.edj"
#define GRP_SET_VALUE_NUMERIC "set-value-numeric"
#define GRP_SET_VALUE_NUMERIC_SWITCH "set-value-numeric-switch"
-#define GRP_SET_VALUE_RADIOS "set-value-radios"
#define GRP_SET_VALUE_SWITCHES "set-value-switches"
#define GRP_SET_VALUE_LIST_SWITCH "set-value-list-switch"
-#define GRP_SET_VALUE_UPDATE_ACCESSORIES_SWITCH "set-value-update-accessories-switch"
#define PRT_SET_VALUE_LIST "set-value-list"
#define PRT_SET_VALUE_SWITCH_LABEL "set-value-switch-label"
#define PRT_SET_VALUE_SWITCH "set-value-switch"
#define PRT_SET_VALUE_SELECTOR "set-value-selector"
#define PRT_SET_VALUE_RANGE "set-value-range"
#define PRT_SET_VALUE_DESC "set-value-desc"
-#define PRT_SET_VALUE_ENTRY "set-value-entry"
SetValuePage::SetValuePage(SettingAccessibility *ad, ValueEditorType type, const char *title)
: context_(ad)
auto naviframe = context_->md.getNaviframe();
layout_ = Widget::make<Layout>(naviframe, "edje/accessibility-settings-set-value.edj", GRP_SET_VALUE_UPDATE_ACCESSORIES_SWITCH);
- entry_ = elm_entry_add(layout_->getObject());
- elm_entry_entry_set(entry_, config_item_to_update_.user_name.c_str());
- elm_entry_cursor_end_set(entry_);
- evas_object_show(entry_);
- elm_object_part_content_set(layout_->getObject(), PRT_SET_VALUE_ENTRY, entry_);
-
+ entry_ = Widget::make<Entry>(layout_, config_item_to_update_.user_name);
+ entry_->moveCursorToEnd();
+ layout_->setPartContent(PRT_SET_VALUE_ENTRY, entry_);
layout_->setPartText(PRT_SET_VALUE_DESC, "IDS_ACCS_UNIVERSAL_SWITCH_NAME");
update_accessories_action_genlist_ = createGenlist(layout_, NULL);
if (event_info == self->save_object_item) {
if (self->switch_updated_cb) {
- self->switch_updated_cb(self->switch_updated_cb_data, self->config_item_to_update_.switch_id, self->config_item_to_update_.activity_type, elm_entry_entry_get(self->entry_));
+ self->switch_updated_cb(self->switch_updated_cb_data, self->config_item_to_update_.switch_id, self->config_item_to_update_.activity_type, self->entry_->getEntryText());
}
}
#include "SettingAccessibility.hpp"
#include "ActionPage.hpp"
+#include "Entry.hpp"
#include "Layout.hpp"
#include "Genlist.hpp"
UniversalSwitchConfigurationItem config_item_to_update_;
std::unique_ptr<ActionPage> actionPage_;
Elm_Object_Item *save_object_item = nullptr;
- Evas_Object *entry_ = nullptr;
+ Entry *entry_ = nullptr;
Genlist *update_accessories_action_genlist_ = nullptr;
Layout *layout_ = nullptr;
};