Class: Nuklear::UI::ComboBox

Inherits:
Base
  • Object
show all
Includes:
Container
Defined in:
lib/nuklear/ui/combo_box.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Container

#<<, #commands, #find, #layout_row_dynamic, #method_missing, #run_command, #run_commands, #traverse, #ui_checkbox, #ui_color_picker, #ui_combo, #ui_edit_focus, #ui_edit_string, #ui_layout_row_begin, #ui_layout_row_dynamic, #ui_layout_row_push, #ui_layout_row_static, #ui_layout_row_template_begin, #ui_layout_row_template_dynamic, #ui_layout_row_template_end, #ui_layout_row_template_static, #ui_layout_row_template_variable, #ui_layout_space_begin, #ui_layout_space_end, #ui_layout_space_push, #ui_layout_widget_bounds, #ui_menu_item, #ui_option, #ui_selectable, #ui_window_close

Methods inherited from Base

descendants, #dsl, inherited

Methods included from Enableable

#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?

Methods included from Events

#event_listeners_for, #on, #trigger

Constructor Details

#initialize(text: nil, image: nil, color: nil, symbol: nil, width:, height:, **options) ⇒ ComboBox

Returns a new instance of ComboBox.



8
9
10
11
12
13
14
15
16
# File 'lib/nuklear/ui/combo_box.rb', line 8

def initialize(text: nil, image: nil, color: nil, symbol: nil, width:, height:, **options)
  super(**options)
  self.text  = text
  self.image = image
  self.color = color
  self.symbol = symbol
  self.width = width
  self.height = height
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nuklear::UI::Container

Instance Attribute Details

#colorObject

Returns the value of attribute color.



6
7
8
# File 'lib/nuklear/ui/combo_box.rb', line 6

def color
  @color
end

#heightObject

Returns the value of attribute height.



6
7
8
# File 'lib/nuklear/ui/combo_box.rb', line 6

def height
  @height
end

#imageObject

Returns the value of attribute image.



6
7
8
# File 'lib/nuklear/ui/combo_box.rb', line 6

def image
  @image
end

#symbolObject

Returns the value of attribute symbol.



6
7
8
# File 'lib/nuklear/ui/combo_box.rb', line 6

def symbol
  @symbol
end

#textObject

Returns the value of attribute text.



6
7
8
# File 'lib/nuklear/ui/combo_box.rb', line 6

def text
  @text
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'lib/nuklear/ui/combo_box.rb', line 6

def width
  @width
end

Instance Method Details

#alphaObject



24
# File 'lib/nuklear/ui/combo_box.rb', line 24

def alpha; color.alpha; end

#alpha=(a) ⇒ Object



25
# File 'lib/nuklear/ui/combo_box.rb', line 25

def alpha=(a); color.alpha = a; end

#blueObject



22
# File 'lib/nuklear/ui/combo_box.rb', line 22

def blue; color.blue; end

#blue=(a) ⇒ Object



23
# File 'lib/nuklear/ui/combo_box.rb', line 23

def blue=(a); color.blue = a; end

#greenObject



20
# File 'lib/nuklear/ui/combo_box.rb', line 20

def green; color.green; end

#green=(a) ⇒ Object



21
# File 'lib/nuklear/ui/combo_box.rb', line 21

def green=(a); color.green = a; end

#hueObject



26
# File 'lib/nuklear/ui/combo_box.rb', line 26

def hue; color.hue; end

#hue=(a) ⇒ Object



27
# File 'lib/nuklear/ui/combo_box.rb', line 27

def hue=(a); color.hue = a; end

#redObject



18
# File 'lib/nuklear/ui/combo_box.rb', line 18

def red; color.red; end

#red=(a) ⇒ Object



19
# File 'lib/nuklear/ui/combo_box.rb', line 19

def red=(a); color.red = a; end

#result(expanded, context) ⇒ Object



37
38
39
# File 'lib/nuklear/ui/combo_box.rb', line 37

def result(expanded, context)
  run_commands(context) if expanded
end

#saturationObject



28
# File 'lib/nuklear/ui/combo_box.rb', line 28

def saturation; color.saturation; end

#saturation=(a) ⇒ Object



29
# File 'lib/nuklear/ui/combo_box.rb', line 29

def saturation=(a); color.saturation = a; end

#to_commandObject



33
34
35
# File 'lib/nuklear/ui/combo_box.rb', line 33

def to_command
  [ :ui_combobox, text, color, symbol, image, width, height ]
end

#valueObject



30
# File 'lib/nuklear/ui/combo_box.rb', line 30

def value; color.value; end

#value=(a) ⇒ Object



31
# File 'lib/nuklear/ui/combo_box.rb', line 31

def value=(a); color.value = a; end