Class: XRC2Ruby::ObjectTypes::ControlWithItems

Inherits:
Window
  • Object
show all
Defined in:
lib/wx_sugar/xrc/xrc2ruby_types/lists.rb

Overview

Several similar classes with list of strings

Constant Summary

Constants inherited from Window

Window::BASE_NAME

Instance Attribute Summary collapse

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

Methods inherited from Window

#args, #output

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

#selectionObject

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

#setupObject



24
25
26
# File 'lib/wx_sugar/xrc/xrc2ruby_types/lists.rb', line 24

def setup
  self.selection ? "#{var_name}.selection = #{selection}" : ""
end