Class: XRC2Ruby::ObjectTypes::ControlWithItems
- Defined in:
- lib/wx_sugar/xrc/xrc2ruby_types/lists.rb
Overview
Several similar classes with list of strings
Direct Known Subclasses
BitmapComboBox, CheckListBox, Choice, ComboBox, ListBox, RadioBox
Constant Summary
Constants inherited from Window
Instance Attribute Summary collapse
-
#selection ⇒ Object
Returns the value of attribute selection.
Attributes inherited from Window
#bg, #enabled, #exstyle, #fg, #help, #hidden, #tooltip
Attributes inherited from Object
#centered, #name, #parent, #sub_class, #win_class
Instance Method Summary collapse
-
#initialize(*args) ⇒ ControlWithItems
constructor
A new instance of ControlWithItems.
- #item=(item) ⇒ Object
- #setup ⇒ Object
Methods inherited from Window
Methods included from InitArgs
#inherited, #init_arg, #init_args, #translatable_string_init_arg
Methods inherited from Object
#inspect, next_id, #output, #var_name
Constructor Details
#initialize(*args) ⇒ ControlWithItems
Returns a new instance of ControlWithItems.
15 16 17 18 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/lists.rb', line 15 def initialize(*args) super @choices = [] end |
Instance Attribute Details
#selection ⇒ Object
Returns the value of attribute selection.
4 5 6 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/lists.rb', line 4 def selection @selection end |
Instance Method Details
#item=(item) ⇒ Object
20 21 22 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/lists.rb', line 20 def item=(item) @choices << item end |
#setup ⇒ Object
24 25 26 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/lists.rb', line 24 def setup self.selection ? "#{var_name}.selection = #{selection}" : "" end |