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.
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
#menu ⇒ Object
Returns the value of attribute menu.
1397 1398 1399 |
# File 'lib/a-core.rb', line 1397 def @menu end |
#type ⇒ Object
Returns the value of attribute type.
1399 1400 1401 |
# File 'lib/a-core.rb', line 1399 def type @type end |
#underline ⇒ Object
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 |