Sha256: e818df43407544db461f7331e51010c2b64d56ec730e94368be4075afacd4133

Contents?: true

Size: 1.57 KB

Versions: 21

Compression:

Stored size: 1.57 KB

Contents

=begin
  * Name: InputDataEvent
  * Description: Event created when data modified in Field or TextEdit
  * Author: rkumar (arunachalesha)
  
  --------
  * Date:  2008-12-24 17:27 
  * License:
    Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)

NOTE: this is how we used to write code in the Java days. Anyone reading this source,
this is NOT how to code in rubyland. Please see this link, for how to code such as class:
http://blog.grayproductions.net/articles/all_about_struct

=end

# Event created when data modified in Field or TextEdit
#  2008-12-24 17:54 
module RubyCurses
  class InputDataEvent
    attr_accessor :index0, :index1, :source, :type, :row, :text
    def initialize index0, index1, source, type, row, text
      @index0 = index0
      @index1 = index1
      @source = source
      @type = type
      @row = row
      @text = text
    end
    # until now to_s was returning inspect, but to make it easy for users let us return the value
    # they most expect which is the text that was changed
    def to_s
      inspect
    end
    def inspect
      ## now that textarea.to_s prints content we shouldn pass it here.
      #"#{@type.to_s}, #{@source}, ind0:#{@index0}, ind1:#{@index1}, row:#{@row}, text:#{@text}"
      "#{@type.to_s}, ind0:#{@index0}, ind1:#{@index1}, row:#{@row}, text:#{@text}"
    end
    # this is so that earlier applications were getting source in the block, not an event. they 
    # were doing a fld.getvalue, so we must keep those apps running
    # @since 1.2.0  added 2010-09-11 12:25 
    def getvalue
      @source.getvalue
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
rbhex-core-1.1.0.alpha3 lib/rbhex/core/include/rinputdataevent.rb
rbhex-core-1.1.0.alpha2 lib/rbhex/core/include/rinputdataevent.rb
rbhex-core-1.1.0.alpha1 lib/rbhex/core/include/rinputdataevent.rb
rbhex-core-1.0.0 lib/rbhex/core/include/rinputdataevent.rb
rbcurse-core-0.0.14 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.13 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.12 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.11 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.10 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.9 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.8 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.7 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.6 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.5 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.4 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.3 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.2 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.1 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-core-0.0.0 lib/rbcurse/core/include/rinputdataevent.rb
rbcurse-1.4.1 lib/rbcurse/rinputdataevent.rb