source-code/screens/conversions_screen.rb
# Draws the conversions screen on the Shoes app window.
Draws the conversions screen on the Shoes app window.
Draws the conversions screen on the Shoes app window .
def conversions_screen
    @heading = 'Conversions'
    @heading_edited = @heading.downcase.gsub(/[,&]/,'').squeeze(' ').gsub(' ','_')
    background("images/#{@heading_edited}_large.png")
    ScreenHeader.new(self, '/title_screen', @@font, @heading)
    flow(:height => 640, :width => 1080, :scroll => true) do
      stack(:height => 640, :width => 80) do
      end
      stack(:height => 640, :width => 1000) do
        @formula_set =
          {'Degrees' => 'Degrees = (angle × 180) / π',
           'Radians' => 'Radians = (angle × π) / 180',
           'Kelvins' => 'Kelvins = temperature + 273.15',
           'Celcius' => 'Celcius = temperature - 273.15',
           'Metres per second' => 'Metres per second = (velocity × 1000) / 3600',
           'Kilometres per hour' => 'Kilometres per hour = (velocity × 3600) / 1000'}
        @formula_set.each do |name, formula|
          ScreenBox.new(self, @@theme_colour, @@font, @heading, formula, name)
        end
      end
    end
  end
def conversions_screen @heading = 'Conversions' @heading_edited = @heading . downcase . gsub ( / [,&] / , '' ) . squeeze ( ' ' ) . gsub ( ' ' , '_' ) background ( "images/#{@heading_edited}_large.png" ) ScreenHeader . new ( self , '/title_screen' , @@font , @heading ) flow ( :height => 640 , :width => 1080 , :scroll => true ) do stack ( :height => 640 , :width => 80 ) do end stack ( :height => 640 , :width => 1000 ) do @formula_set = { 'Degrees' => 'Degrees = (angle × 180) / π', 'Radians' => 'Radians = (angle × π) / 180', 'Kelvins' => 'Kelvins = temperature + 273.15' , 'Celcius' => 'Celcius = temperature - 273.15' , 'Metres per second' => 'Metres per second = (velocity × 1000) / 3600', 'Kilometres per hour' => 'Kilometres per hour = (velocity × 3600) / 1000'} @formula_set . each do | name , formula | ScreenBox . new ( self , @@theme_colour , @@font , @heading , formula , name ) end end end end
Draws the conversions screen on the Shoes app window.
Draws the conversions screen on the Shoes app window .
# Conversions screen header # Conversions screen content # Left margin offset # Content column