Class: Cosmos::ComboboxWidget

Inherits:
Qt::ComboBox show all
Includes:
Widget
Defined in:
lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb

Instance Attribute Summary

Attributes included from Widget

#item, #item_name, #limits_set, #limits_state, #packet, #packet_name, #polling_period, #screen, #settings, #target_name, #value, #value_type

Instance Method Summary collapse

Methods included from Widget

#context_menu, #get_tooltip_text, included, #process_settings, #set_setting, #set_subsetting, #shutdown, #update_widget

Methods inherited from Qt::ComboBox

#clearItems, #each, #setCurrentText, #wheelEvent

Constructor Details

#initialize(parent_layout, *combobox_items) ⇒ ComboboxWidget

Returns a new instance of ComboboxWidget.



18
19
20
21
22
23
# File 'lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb', line 18

def initialize (parent_layout, *combobox_items)
  super()
  addItems(combobox_items)
  self.maxVisibleItems = combobox_items.length > 6 ? 6 : combobox_items.length
  parent_layout.addWidget(self) if parent_layout
end

Instance Method Details

#textObject



25
26
27
# File 'lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb', line 25

def text
  self.currentText
end