From 3e027876802e788a094707c163d529a46ec51c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= <jeremy@asynk.ch> Date: Sun, 8 May 2011 00:58:27 +0200 Subject: Efl::Elm::ElmPager class + specs --- lib/efl/elementary.rb | 9 +++++++++ spec/elm_spec.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) 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 -- cgit v1.1-2-g2b99