Class: ArcadiaMainMenu::UserItem

Inherits:
UserItem
  • Object
show all
Defined in:
lib/a-core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_sender, _args) ⇒ UserItem

Returns a new instance of UserItem.



1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/a-core.rb', line 1400

def initialize(_sender, _args)
  super(_sender, _args)
  item_args = Hash.new
  item_args[:image]=Arcadia.image_res(@image_data) if @image_data
  item_args[:label]=@caption
  item_args[:font]=Arcadia.conf('menu.font')
  item_args[:underline]=@underline.to_i if @underline != nil
  item_args[:compound]='left'
  item_args[:command]=@command
  if @type.nil? && @commnad.nil? && @name == '-'
    @type=:separator
    item_args.clear
  elsif @type.nil?
    @type=:command
  end
  @item_obj = @menu.insert('end', @type ,item_args)
  @index = @menu.index('last')
end

Instance Attribute Details

Returns the value of attribute menu.



1397
1398
1399
# File 'lib/a-core.rb', line 1397

def menu
  @menu
end

#typeObject

Returns the value of attribute type.



1399
1400
1401
# File 'lib/a-core.rb', line 1399

def type
  @type
end

#underlineObject

Returns the value of attribute underline.



1398
1399
1400
# File 'lib/a-core.rb', line 1398

def underline
  @underline
end

Instance Method Details

#enable=(_value) ⇒ Object



1419
1420
1421
1422
1423
1424
1425
# File 'lib/a-core.rb', line 1419

def enable=(_value)
  if _value
    @item_obj.entryconfigure(@index,'state'=>'normal')
  else
    @item_obj.entryconfigure(@index,'state'=>'disable')
  end
end