Class: CWM::ComboBox

Inherits:
AbstractWidget show all
Includes:
ItemsSelection, ValueBasedWidget
Defined in:
library/cwm/src/lib/cwm/common_widgets.rb

Overview

A Combo box to select a value. The AbstractWidget#label method is mandatory.

Examples:

combobox widget child

class MyWidget < CWM::ComboBox
  def initialize(myconfig)
    @config = myconfig
  end

  def label
    _("Choose carefully:")
  end

  def init
    self.value = @config.value
  end

  def store
    @config.value = value
  end

  def items
    [
      [ "Canada", _("Canada")],
      [ "USA", _("United States of America")],
      [ "North Pole", _("Really cold place")],
    ]
  end
end

Instance Attribute Summary

Attributes inherited from AbstractWidget

#handle_all_events, #widget_id

Method Summary

Methods included from ItemsSelection

#change_items, #cwm_definition, #items

Methods included from ValueBasedWidget

#value, #value=

Methods inherited from AbstractWidget

#cleanup, #cwm_definition, #disable, #displayed?, #enable, #enabled?, #focus, #fun_ref, #handle, #help, #init, #label, #my_event?, #opt, #refresh_help, #store, #validate, widget_type=