source-code/screens/circular-motion-screens/centripetal_acceleration_v2_screen.rb
def centripetal_acceleration_v2_screen
    background('images/circular_motion_large.png')

    # Centripetal acceleration v2 screen header
    flow(:height => 80, :width => 1080, :scroll => false) do
      @back_button = image('images/back_icon_white.png',
                           :click => '/title_screen/circular_motion_screen')
      @heading = title('Centripetal acceleration = angular velocity',
                       sup('2'), ' x radius')
      @back_button.style(@@screen_header_image_styles)
      @heading.style(@@screen_header_text_styles)
    end

    # Centripetal acceleration v2 screen content
    flow(:height => 640, :width => 1080, :scroll => true) do
      # Left margin offset
      stack(:height => 640, :width => 80) do
      end
      # Content column
      stack(:height => 640, :width => 1000) do
        @heading_edited = @heading.text
        ScreenLabel.new(self, @@font, @heading_edited, 'Angular velocity')
        flow do
          @angular_velocity = ScreenEditLine.new(self, @@font, @heading_edited)
          @angular_velocity_unit = para(strong(' rads'), strong(sup('-1')))
          @angular_velocity_unit.style(@@screen_unit_text_styles)
        end

        ScreenLabel.new(self, @@font, @heading_edited, 'Radius')
        flow do
          @radius = ScreenEditLine.new(self, @@font, @heading_edited)
          @radius_unit = para(strong(' m'))
          @radius_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.centripetal_acceleration_v2(@angular_velocity.text.to_f,
                                                         @radius.text.to_f)
            @centripetal_acceleration_v2 = para(@result.to_s)
            @centripetal_acceleration_v2_unit = para(' ms', sup('-2'))
            @centripetal_acceleration_v2.style(@@screen_result_text_styles)
            @centripetal_acceleration_v2_unit.style(@@screen_result_text_styles)
          end
        end
      end
    end
  end
# Draws the centripetal acceleration v2 screen on the Shoes app window.
Draws the centripetal acceleration v2 screen on the Shoes app window.
Draws the centripetal acceleration v2 screen on the Shoes app window .
def centripetal_acceleration_v2_screen
    background('images/circular_motion_large.png')
    flow(:height => 80, :width => 1080, :scroll => false) do
      @back_button = image('images/back_icon_white.png',
                           :click => '/title_screen/circular_motion_screen')
      @heading = title('Centripetal acceleration = angular velocity',
                       sup('2'), ' x radius')
      @back_button.style(@@screen_header_image_styles)
      @heading.style(@@screen_header_text_styles)
    end
    flow(:height => 640, :width => 1080, :scroll => true) do
      stack(:height => 640, :width => 80) do
      end
      stack(:height => 640, :width => 1000) do
        @heading_edited = @heading.text
        ScreenLabel.new(self, @@font, @heading_edited, 'Angular velocity')
        flow do
          @angular_velocity = ScreenEditLine.new(self, @@font, @heading_edited)
          @angular_velocity_unit = para(strong(' rads'), strong(sup('-1')))
          @angular_velocity_unit.style(@@screen_unit_text_styles)
        end
        ScreenLabel.new(self, @@font, @heading_edited, 'Radius')
        flow do
          @radius = ScreenEditLine.new(self, @@font, @heading_edited)
          @radius_unit = para(strong(' m'))
          @radius_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.centripetal_acceleration_v2(@angular_velocity.text.to_f,
                                                         @radius.text.to_f)
            @centripetal_acceleration_v2 = para(@result.to_s)
            @centripetal_acceleration_v2_unit = para(' ms', sup('-2'))
            @centripetal_acceleration_v2.style(@@screen_result_text_styles)
            @centripetal_acceleration_v2_unit.style(@@screen_result_text_styles)
          end
        end
      end
    end
  end
def centripetal_acceleration_v2_screen background ( 'images/circular_motion_large.png' ) flow ( :height => 80 , :width => 1080 , :scroll => false ) do @back_button = image ( 'images/back_icon_white.png' , :click => '/title_screen/circular_motion_screen' ) @heading = title ( 'Centripetal acceleration = angular velocity' , sup ( '2' ) , ' x radius' ) @back_button . style ( @@screen_header_image_styles ) @heading . style ( @@screen_header_text_styles ) end flow ( :height => 640 , :width => 1080 , :scroll => true ) do stack ( :height => 640 , :width => 80 ) do end stack ( :height => 640 , :width => 1000 ) do @heading_edited = @heading . text ScreenLabel . new ( self , @@font , @heading_edited , 'Angular velocity' ) flow do @angular_velocity = ScreenEditLine . new ( self , @@font , @heading_edited ) @angular_velocity_unit = para ( strong ( ' rads' ) , strong ( sup ( '-1' ) ) ) @angular_velocity_unit . style ( @@screen_unit_text_styles ) end ScreenLabel . new ( self , @@font , @heading_edited , 'Radius' ) flow do @radius = ScreenEditLine . new ( self , @@font , @heading_edited ) @radius_unit = para ( strong ( ' m' ) ) @radius_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 . centripetal_acceleration_v2 ( @angular_velocity . text . to_f , @radius . text . to_f ) @centripetal_acceleration_v2 = para ( @result . to_s ) @centripetal_acceleration_v2_unit = para ( ' ms' , sup ( '-2' ) ) @centripetal_acceleration_v2 . style ( @@screen_result_text_styles ) @centripetal_acceleration_v2_unit . style ( @@screen_result_text_styles ) end end end end end
Draws the centripetal acceleration v2 screen on the Shoes app window.
Draws the centripetal acceleration v2 screen on the Shoes app window .
# Centripetal acceleration v2 screen header # Centripetal acceleration v2 screen content # Left margin offset # Content column