summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-08 00:58:27 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-08 00:58:27 +0200
commit3e027876802e788a094707c163d529a46ec51c1c (patch)
treeaf301fd34c6af1e0987d4f68a100493eeebb7fa3
parent38a9d0584fb903647525d15492bab71f5783275b (diff)
downloadffi-efl-3e027876802e788a094707c163d529a46ec51c1c.zip
ffi-efl-3e027876802e788a094707c163d529a46ec51c1c.tar.gz
Efl::Elm::ElmPager class + specs
-rw-r--r--lib/efl/elementary.rb9
-rw-r--r--spec/elm_spec.rb30
2 files changed, 39 insertions, 0 deletions
diff --git a/lib/efl/elementary.rb b/lib/efl/elementary.rb
index b97ab50..2cf2a02 100644
--- a/lib/efl/elementary.rb
+++ b/lib/efl/elementary.rb
@@ -64,6 +64,15 @@ module Efl
end
end
#
+ class ElmPager < Efl::Evas::REvasObject
+ #
+ search_prefixes 'elm_pager_'
+ #
+ def initialize parent, &block
+ super Native.method(:elm_pager_add), parent, &block
+ end
+ end
+
end
end
#
diff --git a/spec/elm_spec.rb b/spec/elm_spec.rb
index 54019a5..b5d5140 100644
--- a/spec/elm_spec.rb
+++ b/spec/elm_spec.rb
@@ -129,5 +129,35 @@ describe Efl::Elm do
@lb.slide_duration.should == 3.1415926
end
end
+ describe Efl::Elm::ElmPager do
+ #
+ before(:all) {
+ realize_app
+ @p = Elm::ElmPager.new @win
+ @os = []
+ 0.upto(3) do
+ @os << @win.evas.object_rectangle_add
+ end
+ }
+ after(:all) {
+ @p.free
+ @bg.free
+ @win.free
+ }
+ #
+ it "content push pop promote bottom_get top_get" do
+ @os.each do |o|
+ @p.content_push o
+ end
+ @p.content_top_get.should == @os[-1].to_ptr
+ @p.content_bottom_get.should == @os[0].to_ptr
+ @p.content_pop
+ @p.content_top_get.should == @os[-2].to_ptr
+ @p.content_bottom_get.should == @os[0].to_ptr
+ @p.content_promote @os[0]
+ @p.content_top_get.should == @os[0].to_ptr
+ @p.content_bottom_get.should == @os[1].to_ptr
+ end
+ end
end