Sha256: 58d058db7c0d60830e85695d9412cc1398938b0ad267ac990142e408a963614e

Contents?: true

Size: 1.21 KB

Versions: 12

Compression:

Stored size: 1.21 KB

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

require 'cosmos'
require 'cosmos/tools/tlm_viewer/widgets/formatvalue_widget'

module Cosmos
  # 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.
  class FormatfontvalueWidget < FormatvalueWidget
    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_italics = 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_italics))
      setFixedWidth(self.fontMetrics.width('X') * characters.to_i + 10)
    end

    def font=(font)
      setFont(font)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cosmos-4.5.2-java lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.5.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.5.1-java lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.5.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.5.0-java lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.5.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.4.2-java lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.4.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.4.1-java lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.4.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.4.0-java lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.4.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb