From: Joe Konno Date: Tue, 19 Jun 2012 17:37:36 +0000 (-0700) Subject: Add actionslider widget object X-Git-Tag: upstream/0.2.1~328 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c3c526f76e787ca38344810e40590d14d3f2945;p=test%2Fgeneric%2Fwayland-fits.git Add actionslider widget object Signed-off-by: Joe Konno --- diff --git a/src/efl/Makefile.am b/src/efl/Makefile.am index e3659d3..33de4af 100644 --- a/src/efl/Makefile.am +++ b/src/efl/Makefile.am @@ -20,6 +20,7 @@ bin_PROGRAMS = $(TESTS) wayland_efl_test_SOURCES = \ evasobject.cpp \ + actionslider.cpp \ window.cpp \ application.cpp \ elmtestharness.cpp \ diff --git a/src/efl/actionslider.cpp b/src/efl/actionslider.cpp new file mode 100644 index 0000000..e1f7d25 --- /dev/null +++ b/src/efl/actionslider.cpp @@ -0,0 +1,42 @@ +#include "actionslider.h" + +Actionslider::Actionslider(Evas_Object *parent, const std::string& left, const bool leftOn, const std::string& center, const bool centerOn, const std::string& right, const bool rightOn) + : EvasObject::EvasObject( + elm_actionslider_add(parent) + ) + , parent(parent) +{ + elm_object_part_text_set(*this, "left", left.c_str()); + elm_object_part_text_set(*this, "center", center.c_str()); + elm_object_part_text_set(*this, "right", right.c_str()); + + unsigned int posEnabled = ELM_ACTIONSLIDER_NONE; + if (leftOn) + { + posEnabled |= ELM_ACTIONSLIDER_LEFT; + } + if (centerOn) + { + posEnabled |= ELM_ACTIONSLIDER_CENTER; + } + if (rightOn) + { + posEnabled |= ELM_ACTIONSLIDER_RIGHT; + } + elm_actionslider_enabled_pos_set(*this, static_cast(posEnabled)); +} + +void Actionslider::setPos(Elm_Actionslider_Pos pos) +{ + elm_actionslider_indicator_pos_set(*this, pos); +} + +Elm_Actionslider_Pos Actionslider::getPos() +{ + return elm_actionslider_indicator_pos_get(*this); +} + +Actionslider::operator Evas_Object*() +{ + return EvasObject::obj_; +} diff --git a/src/efl/actionslider.h b/src/efl/actionslider.h new file mode 100644 index 0000000..2d40bb8 --- /dev/null +++ b/src/efl/actionslider.h @@ -0,0 +1,25 @@ +#ifndef __WAYLAND_EFL_ACTIONSLIDER_H__ +#define __WAYLAND_EFL_ACTIONSLIDER_H__ + +#include +#include + +#include "evasobject.h" + +class Actionslider : public EvasObject +{ +public: + Actionslider(Evas_Object *, const std::string& = "Left", const bool = true, const std::string& = "Center", const bool = true, const std::string& = "Right", const bool = true); + + void setPos(Elm_Actionslider_Pos pos); + + Elm_Actionslider_Pos getPos(); + + operator Evas_Object*(); + +private: + Evas_Object *parent; +}; + +#endif +