source-code/screens/waves-screens/refractive_index_v2_screen.rb
# Draws the refractive index v2 screen on the Shoes app window.
Draws the refractive index v2 screen on the Shoes app window.
Draws the refractive index v2 screen on the Shoes app window .
def refractive_index_v2_screen
    @heading = 'Refractive index = 1 / sine(critical angle)'
    background('images/waves_large.png')
    ScreenHeader.new(self, '/title_screen/waves_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, 'Critical angle')
        flow do
          @critical_angle = ScreenEditLine.new(self, @@font, @heading)
          @critical_angle_unit = para(strong(' deg'))
          @critical_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.refractive_index_v2(@critical_angle.text.to_f)
            @refractive_index_v2 = para(@result.to_s)
            @refractive_index_v2.style(@@screen_result_text_styles)
          end
        end
      end
    end
  end
def refractive_index_v2_screen @heading = 'Refractive index = 1 / sine(critical angle)' background ( 'images/waves_large.png' ) ScreenHeader . new ( self , '/title_screen/waves_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 , 'Critical angle' ) flow do @critical_angle = ScreenEditLine . new ( self , @@font , @heading ) @critical_angle_unit = para ( strong ( ' deg' ) ) @critical_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 . refractive_index_v2 ( @critical_angle . text . to_f ) @refractive_index_v2 = para ( @result . to_s ) @refractive_index_v2 . style ( @@screen_result_text_styles ) end end end end end
Draws the refractive index v2 screen on the Shoes app window.
Draws the refractive index v2 screen on the Shoes app window .
# Refractive index v2 screen header # Refractive index v2 screen content # Left margin offset # Content column