Sha256: 519dca1afa5bdbd4670489d3ca3dd99ef712d598435036343769dd115d9a01a4

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 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/widget'

module Cosmos
  # Displays a text label
  class LabelWidget < Qt::Label
    include Widget

    def initialize(parent_layout, text, font_family = nil, point_size = nil, bold = nil, italic = false)
      super()
      font = self.font
      font.setFamily(font_family) unless ConfigParser.handle_nil(font_family).nil?
      font.setPointSize(point_size.to_i) unless ConfigParser.handle_nil(point_size).nil?
      font.setBold(true) if bold == 'BOLD'
      font.setItalic(true) if ConfigParser::handle_true_false(italic) == true
      setFont(font)
      self.text = text.to_s.remove_quotes
      parent_layout.addWidget(self) if parent_layout
    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/label_widget.rb
cosmos-4.5.2 lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.5.1-java lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.5.1 lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.5.0-java lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.5.0 lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.4.2-java lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.4.2 lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.4.1-java lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.4.1 lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.4.0-java lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb
cosmos-4.4.0 lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb