Sha256: bb2b683d529d8fc91ba27f1c4b063ed46f623180c6d27996150cf0343a4e4f3b

Contents?: true

Size: 954 Bytes

Versions: 28

Compression:

Stored size: 954 Bytes

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

  class CheckbuttonWidget < Qt::CheckBox
    include Widget

    def initialize(parent_layout, checkbutton_text, checked = 'UNCHECKED')
      super()
      setText(checkbutton_text.to_s)
      case checked.to_s
      when 'CHECKED'
        setChecked(true)
      when 'UNCHECKED'
        setChecked(false)
      else
        raise "Unknown option '#{checked}' given to #{self.class}"
      end
      parent_layout.addWidget(self) if parent_layout
    end

    def checked?
      self.isChecked()
    end
  end

end # module Cosmos

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
cosmos-4.3.0-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.3.0 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.4-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.4 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.3-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.3 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.2-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.2 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.1-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.1 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.0-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.2.0 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.1.1-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.1.1 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.1.0-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.1.0 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.0.3-java lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.0.3-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.0.3 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb
cosmos-4.0.2-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb