Sha256: 19f8cef4bd06a8749b21b6693c0568555e7a824e3e96ec14ff59a6e76b7bec44

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

module Nuklear
  module UI
    class ComboBox < Nuklear::UI::Base
      include Nuklear::UI::Container

      attr_accessor :text, :image, :color, :symbol, :width, :height

      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

      def red; color.red; end
      def red=(a); color.red = a; end
      def green; color.green; end
      def green=(a); color.green = a; end
      def blue; color.blue; end
      def blue=(a); color.blue = a; end
      def alpha; color.alpha; end
      def alpha=(a); color.alpha = a; end
      def hue; color.hue; end
      def hue=(a); color.hue = a; end
      def saturation; color.saturation; end
      def saturation=(a); color.saturation = a; end
      def value; color.value; end
      def value=(a); color.value = a; end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nuklear-0.1.3 lib/nuklear/ui/combo_box.rb
nuklear-0.1.2 lib/nuklear/ui/combo_box.rb
nuklear-0.1.1 lib/nuklear/ui/combo_box.rb
nuklear-0.1.0 lib/nuklear/ui/combo_box.rb