def putch char
      return -1 if !@editable 
      return -1 if !@overwrite_mode && (@buffer.length >= @maxlen)
      blen = @buffer.length
      if @chars_allowed != nil
        return if char.match(@chars_allowed).nil?
      end
      # added insert or overwrite mode 2010-03-17 20:11 
      oldchar = nil
      if @overwrite_mode
        oldchar = @buffer[@curpos] 
        @buffer[@curpos] = char
      else
        @buffer.insert(@curpos, char)
      end
      oldcurpos = @curpos
      #$log.warn "XXX:  FIELD CURPOS #{@curpos} blen #{@buffer.length} " #if @curpos > blen
      @curpos += 1 if @curpos < @maxlen
      @modified = true
      #$log.debug " FIELD FIRING CHANGE: #{char} at new #{@curpos}: bl:#{@buffer.length} buff:[#{@buffer}]"
      # i have no way of knowing what change happened and what char was added deleted or changed
      #fire_handler :CHANGE, self    # 2008-12-09 14:51 
      if @overwrite_mode
        fire_handler :CHANGE, InputDataEvent.new(oldcurpos,@curpos, self, :DELETE, 0, oldchar) # 2010-09-11 12:43 
      end
      fire_handler :CHANGE, InputDataEvent.new(oldcurpos,@curpos, self, :INSERT, 0, char) # 2010-09-11 12:43 
      0
    end
def putch char
      return -1 if !@editable 
      return -1 if !@overwrite_mode && (@buffer.length >= @maxlen)
      blen = @buffer.length
      if @chars_allowed != nil
        return if char.match(@chars_allowed).nil?
      end
      # added insert or overwrite mode 2010-03-17 20:11 
      oldchar = nil
      if @overwrite_mode
        oldchar = @buffer[@curpos] 
        @buffer[@curpos] = char
      else
        @buffer.insert(@curpos, char)
      end
      oldcurpos = @curpos
      #$log.warn "XXX:  FIELD CURPOS #{@curpos} blen #{@buffer.length} " #if @curpos > blen
      @curpos += 1 if @curpos < @maxlen
      @modified = true
      #$log.debug " FIELD FIRING CHANGE: #{char} at new #{@curpos}: bl:#{@buffer.length} buff:[#{@buffer}]"
      # i have no way of knowing what change happened and what char was added deleted or changed
      #fire_handler :CHANGE, self    # 2008-12-09 14:51 
      if @overwrite_mode
        fire_handler :CHANGE, InputDataEvent.new(oldcurpos,@curpos, self, :DELETE, 0, oldchar) # 2010-09-11 12:43 
      end
      fire_handler :CHANGE, InputDataEvent.new(oldcurpos,@curpos, self, :INSERT, 0, char) # 2010-09-11 12:43 
      0
    end
add a char to field, and validate
 NOTE: this should return self for chaining operations and throw an exception
 if disabled or exceeding size
 @param [char] a character to add
 @return [Integer] 0 if okay, -1 if not editable or exceeding length