Class: TkBwComboBoxObjBoard

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

Instance Attribute Summary

Attributes inherited from ObjBoard

#objectsList

Instance Method Summary collapse

Methods inherited from ObjBoard

#get_string

Constructor Details

#initialize(_host, _obji) ⇒ TkBwComboBoxObjBoard

Returns a new instance of TkBwComboBoxObjBoard.



950
951
952
953
954
955
956
957
958
959
960
961
962
963
# File 'ext/ae-rad/ae-rad-inspector.rb', line 950

def initialize(_host, _obji)
  super
  do_select = proc {
    _itemindex = @sb.cget('values').index(@sb.cget('text'))
    @obji.select(@objectsList[_itemindex])
    @objectsList[_itemindex].activate
  }
  @sb = Tk::BWidget::ComboBox.new(_host, Arcadia.style('combobox')){
    modifycmd do_select
    editable false
    expand 'tab'
    pack('fill'=>'x', 'padx'=>0, 'pady'=>0, 'anchor'=>'n')
  }
end

Instance Method Details

#delete(_agobj) ⇒ Object



965
966
967
968
# File 'ext/ae-rad/ae-rad-inspector.rb', line 965

def delete(_agobj)
  super
  @sb.delete('active')
end

#getString(_agobj) ⇒ Object



970
971
972
# File 'ext/ae-rad/ae-rad-inspector.rb', line 970

def getString(_agobj)
  _agobj.i_name + '<--'+ _agobj.obj.class.to_s
end

#insert(_agobj) ⇒ Object



974
975
976
977
978
979
980
# File 'ext/ae-rad/ae-rad-inspector.rb', line 974

def insert(_agobj)
  super
  _values = @sb.cget('values').to_a
  _values << getString(_agobj)
  @sb.configure('values'=>_values)
  @sb.set_value(@itemindex)
end

#select(_agobj) ⇒ Object



982
983
984
985
986
# File 'ext/ae-rad/ae-rad-inspector.rb', line 982

def select(_agobj)
  super
  @itemindex = @sb.cget('values').index(getString(_agobj))
  @sb.set_value(@itemindex)
end