Sha256: d4bcfbf814ee9b95fa60d797e248c2dfab357a9117c485ddc1c9123c6e48779b

Contents?: true

Size: 1.23 KB

Versions: 31

Compression:

Stored size: 1.23 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

  # 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.
  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_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

    def font=(font)
      setFont(font)
    end

  end

end # module Cosmos

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
cosmos-4.0.1-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.0.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.0.0-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-4.0.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.9.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.9.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.8.3 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.8.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.8.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.8.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.7.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.7.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.6.3 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.6.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.6.1 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.6.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.5.3 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.5.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.5.0 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb
cosmos-3.4.2 lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb