Class: Cosmos::FormatfontvalueWidget

Inherits:
FormatvalueWidget show all
Defined in:
lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb

Overview

FormatfontvalueWidget class

This class implements a value with configurable font values. The font can also be updated after it is created. It inherits from the FormatvalueWidget class.

Instance Attribute Summary

Attributes included from AgingWidget

#coloring

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 inherited from FormatvalueWidget

#value=

Methods inherited from ValueWidget

#process_settings, #value=

Methods included from AgingWidget

included, #process_aging_settings, #setup_aging, #value=

Methods included from Widget

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

Methods inherited from Qt::LineEdit

#setColors, #text=

Constructor Details

#initialize(parent_layout, target_name, packet_name, item_name, format_string, value_type = :CONVERTED, characters = 12, font_name = 'arial', font_size = 100, font_weight = Qt::Font::Normal, font_slant = false) ⇒ FormatfontvalueWidget

Returns a new instance of FormatfontvalueWidget.



23
24
25
26
27
28
# File 'lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb', line 23

def initialize (parent_layout, target_name, packet_name, item_name, format_string, value_type = :CONVERTED, characters = 12,
  font_name = 'arial', font_size = 100, font_weight = Qt::Font::Normal, font_slant = false)
  super(parent_layout, target_name, packet_name, item_name, format_string, value_type, characters)
  setFont(Cosmos.getFont(font_name, font_size.to_i, font_weight, font_slant))
  setFixedWidth(self.fontMetrics.width('X') * characters.to_i + 10)
end

Instance Method Details

#font=(font) ⇒ Object



30
31
32
# File 'lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb', line 30

def font=(font)
  setFont(font)
end