Class: InspectListReadOnly

Inherits:
Object
  • Object
show all
Defined in:
ext/ae-rad/ae-rad-inspector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_host, _left_width = 85) ⇒ InspectListReadOnly

Returns a new instance of InspectListReadOnly.


486
487
488
489
490
# File 'ext/ae-rad/ae-rad-inspector.rb', line 486

def initialize(_host, _left_width = 85)
  @lasthandlervalue = 0;
  @host = _host
  @proplines = Hash.new
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host


482
483
484
# File 'ext/ae-rad/ae-rad-inspector.rb', line 482

def host
  @host
end

#lasthandlervalueObject

Returns the value of attribute lasthandlervalue


484
485
486
# File 'ext/ae-rad/ae-rad-inspector.rb', line 484

def lasthandlervalue
  @lasthandlervalue
end

Instance Method Details

#clearObject


492
493
494
495
496
497
498
# File 'ext/ae-rad/ae-rad-inspector.rb', line 492

def clear
  @proplines.values.each do | _value|
    _value.free
  end
  @lasthandlervalue = 0;
  @proplines.clear
end

#deleteObject


536
537
538
# File 'ext/ae-rad/ae-rad-inspector.rb', line 536

def delete
  @pwind.destroy
end

#modProp(_name, _newvalue) ⇒ Object


532
533
534
# File 'ext/ae-rad/ae-rad-inspector.rb', line 532

def modProp(_name, _newvalue)
  @proplines[_name].setvalue(_newvalue)
end

#updatelines(_properties = nil) ⇒ Object


500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'ext/ae-rad/ae-rad-inspector.rb', line 500

def updatelines(_properties=nil)
  if _properties == nil
    clear
    return
  else
    @lasthandlervalue.free(false) if @lasthandlervalue != 0
    @lasthandlervalue = 0;
  end
  _propvalues = []
  @proplines.keys.sort.each{|key|
    _propvalues << @proplines[key]
  }
  @proplines.clear
  _inf = 0
  _sup = _propvalues.length
  @array_key = _properties.keys
  @array_key.sort.each do |key|
    if _inf < _sup  # reuse it
      _propvalues[_inf].updatekeyvalue(key, _properties[key])
      @proplines[key] = _propvalues[_inf]
      _inf = _inf.next
    else # create new
      @proplines[key] = PropLineReadOnly.new(self, key, _properties[key])
    end
  end
  if _sup > _inf
    _inf.upto(_sup -1 ) {|i|
      _propvalues[i].free
    }
  end
end