Sha256: 4a0ab3eb0389636f5b26d5950f83d4a19a556e0c00967d81d62c52cfa38eece2

Contents?: true

Size: 885 Bytes

Versions: 10

Compression:

Stored size: 885 Bytes

Contents

module TE3270
  module Accessors

    #
    # adds two methods to the screen object - one to set text in a text field,
    # another to retrieve text from a text field.
    #
    # @example
    #   text_field(:first_name, 23,45,20)
    #   # will generate 'first_name', 'first_name=' method
    #
    # @param  [String] the name used for the generated methods
    # @param [FixedNum] row number of the location
    # @param [FixedNum] column number of the location
    # @param [FixedNum] length of the text field
    # @param [true|false] editable is by default true
    #
  def text_field(name, row, column, length, editable=true)
      define_method(name) do
        platform.get_string(row, column, length)
      end

      define_method("#{name}=") do |value|
        platform.put_string(value, row, column)
      end if editable
    end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
te3270-jruby-0.4-x86-mingw32 lib/te3270/accessors.rb
te3270-jruby-0.3-x86-mingw32 lib/te3270/accessors.rb
te3270-jruby-0.1-x86-mingw32 lib/te3270/accessors.rb
te3270-0.5.1-x64-mingw32 lib/te3270/accessors.rb
te3270-0.4.1-x86-mingw32 lib/te3270/accessors.rb
te3270-0.4-x86-mingw32 lib/te3270/accessors.rb
te3270-0.3-x86-mingw32 lib/te3270/accessors.rb
te3270-jruby-0.1-universal-java-1.7 lib/te3270/accessors.rb
te3270-0.2-x86-mingw32 lib/te3270/accessors.rb
te3270-0.1-x86-mingw32 lib/te3270/accessors.rb