Class: ArcadiaMainToolbar::UserItem
- Inherits:
-
ArcadiaUserControl::UserItem
- Object
- ArcadiaUserControl::UserItem
- ArcadiaMainToolbar::UserItem
- Defined in:
- lib/a-core.rb
Instance Attribute Summary collapse
-
#frame ⇒ Object
Returns the value of attribute frame.
-
#menu_button ⇒ Object
Returns the value of attribute menu_button.
Attributes inherited from ArcadiaUserControl::UserItem
#action, #caption, #context, #context_caption, #event_args, #event_class, #hint, #image_data, #item_obj, #name, #rif
Instance Method Summary collapse
- #enable=(_value) ⇒ Object
-
#initialize(_sender, _args) ⇒ UserItem
constructor
A new instance of UserItem.
Methods inherited from ArcadiaUserControl::UserItem
#background, #foreground, #method_missing
Constructor Details
#initialize(_sender, _args) ⇒ UserItem
Returns a new instance of UserItem.
1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 |
# File 'lib/a-core.rb', line 1333 def initialize(_sender, _args) super(_sender, _args) _image = Arcadia.image_res(@image_data) if @image_data _command = @command #proc{Arcadia.process_event(@event_class.new(_sender, @event_args))} if @event_class _hint = @hint _font = @font = @caption @item_obj = Tk::BWidget::Button.new(_args['frame'], Arcadia.style('toolbarbutton')){ image _image if _image command _command if _command width 20 height 20 helptext _hint if _hint text if } if _args['context_path'] && _args['last_item_for_context'] @item_obj.pack('after'=>_args['last_item_for_context'].item_obj, 'side' =>'left', :padx=>2, :pady=>0) else @item_obj.pack('side' =>'left', :padx=>2, :pady=>0) end if _args['menu_button'] && _args['menu_button'] == 'yes' @menu_button = TkMenuButton.new(_args['frame'], Arcadia.style('toolbarbutton')){|mb| indicatoron false TkMenu.new(mb, Arcadia.style('menu')) image Arcadia.image_res(MENUBUTTON_ARROW_DOWN_GIF) padx 0 pady 0 pack('side'=> 'left','anchor'=> 's','pady'=>3) } Arcadia.(_args['name'], @menu_button.cget('menu')) end #Tk::BWidget::Separator.new(@frame, :orient=>'vertical').pack('side' =>'left', :padx=>2, :pady=>2, :fill=>'y',:anchor=> 'w') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ArcadiaUserControl::UserItem
Instance Attribute Details
#frame ⇒ Object
Returns the value of attribute frame.
1331 1332 1333 |
# File 'lib/a-core.rb', line 1331 def frame @frame end |
#menu_button ⇒ Object
Returns the value of attribute menu_button.
1332 1333 1334 |
# File 'lib/a-core.rb', line 1332 def @menu_button end |
Instance Method Details
#enable=(_value) ⇒ Object
1367 1368 1369 1370 1371 1372 1373 |
# File 'lib/a-core.rb', line 1367 def enable=(_value) if _value @item_obj.state='normal' else @item_obj.state='disable' end end |