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.
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 |
# File 'lib/a-core.rb', line 1556 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') if !OS.mac? 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.
1553 1554 1555 |
# File 'lib/a-core.rb', line 1553 def @menu end |
#type ⇒ Object
Returns the value of attribute type.
1555 1556 1557 |
# File 'lib/a-core.rb', line 1555 def type @type end |
#underline ⇒ Object
Returns the value of attribute underline.
1554 1555 1556 |
# File 'lib/a-core.rb', line 1554 def underline @underline end |
Instance Method Details
#enable=(_value) ⇒ Object
1575 1576 1577 1578 1579 1580 1581 |
# File 'lib/a-core.rb', line 1575 def enable=(_value) if _value @item_obj.entryconfigure(@index,'state'=>'normal') else @item_obj.entryconfigure(@index,'state'=>'disable') end end |