Class: ValueRapReadOnly

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(_parent, _text = nil) ⇒ ValueRapReadOnly

Returns a new instance of ValueRapReadOnly.



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'ext/ae-rad/ae-rad-inspector.rb', line 397

def initialize(_parent, _text = nil)
  @parent = _parent;
  @host = _parent.splitted_frame.right_frame
  @text = _text
  if !defined? @parent.bodyprops.lasthandlervalue
    @parent.bodyprops.lasthandlervalue = 0
  end
  @labelkey = TkLabel.new(@host, Arcadia.style('label').update({
  'text' => _text,
  'justify' => 'right',
  'anchor' => 'w'
  }))
  @labelkey.pack('fill'=>'x',:padx=>0, :pady=>0)
  @labelkey.bind("ButtonPress-1", proc{
    do_manage_read_only
  })
end

Instance Attribute Details

#handlervalueObject (readonly)

Returns the value of attribute handlervalue.



396
397
398
# File 'ext/ae-rad/ae-rad-inspector.rb', line 396

def handlervalue
  @handlervalue
end

#labelvalueObject (readonly)

Returns the value of attribute labelvalue.



396
397
398
# File 'ext/ae-rad/ae-rad-inspector.rb', line 396

def labelvalue
  @labelvalue
end

Instance Method Details

#do_manage_read_onlyObject



438
439
440
441
# File 'ext/ae-rad/ae-rad-inspector.rb', line 438

def do_manage_read_only
  @handlervalue = TkReadOnly.new(@labelkey)
  @parent.bodyprops.lasthandlervalue = @handlervalue
end

#freeObject



419
420
421
422
423
424
# File 'ext/ae-rad/ae-rad-inspector.rb', line 419

def free
  _reset_last = @handlervalue == @parent.bodyprops.lasthandlervalue
  @labelkey.destroy if defined? @labelkey
  @handlervalue.free if @handlervalue == @parent.bodyprops.lasthandlervalue
  @parent.bodyprops.lasthandlervalue = 0 if _reset_last
end

#recicle(_text) ⇒ Object



426
427
428
429
430
431
# File 'ext/ae-rad/ae-rad-inspector.rb', line 426

def recicle(_text)
  @text = _text
  @parent.bodyprops.lasthandlervalue = 0 if @parent.bodyprops.lasthandlervalue == @handlervalue
  @handlervalue.free(false,@text) if defined? @handlervalue
  @labelkey.configure('text' => @text)
end

#reset_lastObject



415
416
417
# File 'ext/ae-rad/ae-rad-inspector.rb', line 415

def reset_last
  @parent.bodyprops.lasthandlervalue = 0
end

#updatevalue(_text) ⇒ Object



433
434
435
436
# File 'ext/ae-rad/ae-rad-inspector.rb', line 433

def updatevalue(_text)
  @labelkey.configure('text'=>_text)
  @text = _text
end