Sha256: b6ca637023ee632f6ad8c7f0a4bbf9d689a26904c225cae68f93c85dafcd2b1b

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

module RubyApp
  
  module Elements
  
    module Pages
      
      module TestPages
        require 'rubyapp/elements/pages/test_pages/base_test_page'
        
        class ListTestPage < RubyApp::Elements::Pages::TestPages::BaseTestPage
          require 'rubyapp/elements/list'

          class AlphabetList < RubyApp::Elements::List
        
            template_path(__FILE__)
        
            def initialize
              super
              items << { :code => 'A', :description => 'Eh' }
              items << { :code => 'B', :description => 'Bee' }
              items << { :code => 'C', :description => 'See' }
              items << { :code => 'D', :description => 'Dee' }
              items << { :code => 'E', :description => 'Eee' }
              items << { :code => 'F', :description => 'Ef' }
            end
        
          end
  
          template_path(__FILE__)
      
          def initialize
            super

            require 'rubyapp/elements/dialogs/message_dialog'

            @list = RubyApp::Elements::Pages::TestPages::ListTestPage::AlphabetList.new
            @list.selected do |element, event|
              @dialog = RubyApp::Elements::Dialogs::MessageDialog.new(self.class.translate.message_title, 
                                                                      self.class.translate.message_body(event.item[:code], event.item[:description]))
              @dialog.hidden do |element, event|
                @dialog = nil
              end
              event.show_dialog(@dialog)
            end
        
          end
        
        end

      end

    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
_rubyapp-0.0.3 lib/rubyapp/elements/pages/test_pages/list_test_page.rb