source-code/screens/conversions-screens/radians_screen.rb
# Draws the radians screen on the Shoes app window.
Draws the radians screen on the Shoes app window.
Draws the radians screen on the Shoes app window .
def radians_screen
    @heading = 'Radians = (angle × π) / 180'
    background('images/conversions_large.png')
    ScreenHeader.new(self, '/title_screen/conversions_screen', @@font, @heading)
    flow(:height => 640, :width => 1080, :scroll => true) do
      stack(:height => 640, :width => 80) do
      end
      stack(:height => 640, :width => 1000) do
        ScreenLabel.new(self, @@font, @heading, 'Angle')
        flow do
          @angle = ScreenEditLine.new(self, @@font, @heading)
          @angle_unit = para(strong(' deg'))
          @angle_unit.style(@@screen_unit_text_styles)
        end
        @calculate = button('Calculate')
        @result_display = flow
        @error_display = flow
        @calculate.click do
          @result_display.clear do
            @result = Joules.to_radians(@angle.text.to_f)
            @radians = para(@result.to_s)
            @radians_unit = para(' rad')
            @radians.style(@@screen_result_text_styles)
            @radians_unit.style(@@screen_result_text_styles)
          end
        end
      end
    end
  end
def radians_screen @heading = 'Radians = (angle × π) / 180' background ( 'images/conversions_large.png' ) ScreenHeader . new ( self , '/title_screen/conversions_screen' , @@font , @heading ) flow ( :height => 640 , :width => 1080 , :scroll => true ) do stack ( :height => 640 , :width => 80 ) do end stack ( :height => 640 , :width => 1000 ) do ScreenLabel . new ( self , @@font , @heading , 'Angle' ) flow do @angle = ScreenEditLine . new ( self , @@font , @heading ) @angle_unit = para ( strong ( ' deg' ) ) @angle_unit . style ( @@screen_unit_text_styles ) end @calculate = button ( 'Calculate' ) @result_display = flow @error_display = flow @calculate . click do @result_display . clear do @result = Joules . to_radians ( @angle . text . to_f ) @radians = para ( @result . to_s ) @radians_unit = para ( ' rad' ) @radians . style ( @@screen_result_text_styles ) @radians_unit . style ( @@screen_result_text_styles ) end end end end end
Draws the radians screen on the Shoes app window.
Draws the radians screen on the Shoes app window .
# Radians screen header # Radians screen content # Left margin offset # Content column