bool isAnimated = false);
/**
+ * @brief Update item part.
+ * @see elm_gelist_item_fields_update or elm_gengrid_item_fields_update
+ */
+ void update(const char *parts, int partType);
+
+ /**
* @brief Remove item from genlist without destroying it.
*/
void pop();
using namespace Ui;
-CheckItem::CheckItem()
- : m_CheckPart("*"), m_IsChecked(false), m_IsChecking(false),
+CheckItem::CheckItem(GenContainer::Type type)
+ : GenItem(type),
+ m_CheckPart("*"), m_IsChecked(false), m_IsChecking(false),
m_LinkedItem(nullptr)
{
}
void CheckItem::updateCheckPart()
{
- elm_genlist_item_fields_update(getObjectItem(), m_CheckPart.c_str(), ELM_GENLIST_ITEM_FIELD_CONTENT);
+ update(m_CheckPart.c_str(), ELM_GENLIST_ITEM_FIELD_CONTENT);
}
Evas_Object *CheckItem::getContent(Evas_Object *parent, const char *part)
using namespace Ui;
typedef void(*ScrollFunc)(Elm_Object_Item *item, int type);
+typedef void(*UpdateFieldsFunc)(Elm_Object_Item *item, const char *parts, int fieldType);
struct Ui::GenItemApi
{
ScrollFunc bringIn;
ScrollFunc show;
void(*setSelected)(Elm_Object_Item *item, Eina_Bool selected);
+ UpdateFieldsFunc updateFields;
};
namespace
elm_genlist_item_prev_get,
(ScrollFunc) elm_genlist_item_bring_in,
(ScrollFunc) elm_genlist_item_show,
- elm_genlist_item_selected_set },
+ elm_genlist_item_selected_set,
+ (UpdateFieldsFunc) elm_genlist_item_fields_update },
{ [](const Elm_Object_Item *item) -> Elm_Object_Item * { return nullptr; },
elm_gengrid_item_next_get,
elm_gengrid_item_prev_get,
(ScrollFunc) elm_gengrid_item_bring_in,
(ScrollFunc) elm_gengrid_item_show,
- elm_gengrid_item_selected_set }
+ elm_gengrid_item_selected_set,
+ (UpdateFieldsFunc) elm_gengrid_item_fields_update }
};
}
}
}
+void GenItem::update(const char *parts, int partType)
+{
+ m_Api->updateFields(m_Item, parts, partType);
+}
+
void GenItem::pop()
{
onPop();
#include "Ux/SelectView.h"
using namespace Ux;
+using namespace Ui;
-SelectItem::SelectItem()
- : m_SelectView(nullptr), m_SelectMode(SelectNone),
+SelectItem::SelectItem(GenContainer::Type type)
+ : CheckItem(type),
+ m_SelectView(nullptr), m_SelectMode(SelectNone),
m_CustomResult{ 0, 0 }, m_HasCustomResult(false),
m_IsExcluded(false)
{