Class: ArcadiaMainMenu::UserItem
- Inherits:
-
UserItem
- Object
- UserItem
- ArcadiaMainMenu::UserItem
- Defined in:
- lib/a-core.rb
Instance Attribute Summary collapse
-
#menu ⇒ Object
Returns the value of attribute menu.
-
#type ⇒ Object
Returns the value of attribute type.
-
#underline ⇒ Object
Returns the value of attribute underline.
Instance Method Summary collapse
- #enable=(_value) ⇒ Object
-
#initialize(_sender, _args) ⇒ UserItem
constructor
A new instance of UserItem.
Constructor Details
#initialize(_sender, _args) ⇒ UserItem
Returns a new instance of UserItem.
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 |
# File 'lib/a-core.rb', line 1450 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
#menu ⇒ Object
Returns the value of attribute menu.
1447 1448 1449 |
# File 'lib/a-core.rb', line 1447 def @menu end |
#type ⇒ Object
Returns the value of attribute type.
1449 1450 1451 |
# File 'lib/a-core.rb', line 1449 def type @type end |
#underline ⇒ Object
Returns the value of attribute underline.
1448 1449 1450 |
# File 'lib/a-core.rb', line 1448 def underline @underline end |
Instance Method Details
#enable=(_value) ⇒ Object
1469 1470 1471 1472 1473 1474 1475 |
# File 'lib/a-core.rb', line 1469 def enable=(_value) if _value @item_obj.entryconfigure(@index,'state'=>'normal') else @item_obj.entryconfigure(@index,'state'=>'disable') end end |