#!/usr/local/bin/wish -f

# The About window...

proc about {} {

toplevel .about -class dialog
wm title .about "Convert v1.2 - About"

frame .about.frame1 -borderwidth 10
label .about.lab1 -text "Designed and programed by Costas Vlassis." -bg snow3
label .about.lab2 -text "Corrections, suggestions and comments are welcome to :" -bg snow3
label .about.lab3 -text "lonewolf@compulink.gr" -bg snow3
label .about.lab4 -text " " -bg snow3
label .about.lab5 -text "Many thanks to Ronald S. Chong for his help !" -bg snow3
label .about.lab6 -text " " -bg snow3
label .about.lab7 -text "Copyright (C) 1995, Costas Vlassis." -bg snow3
label .about.lab8 -text "You may freely use, copy and distribute this software  " -bg snow3
label .about.lab9 -text "as long as this copyright notice appears in all copies." -bg snow3
label .about.lab10 -text " " -bg snow3
button .about.ok -text "Return to Convert v1.2" -command "destroy .about" -bg yellow -fg blue

pack .about.frame1 -side left 
pack .about.lab1 .about.lab2 .about.lab3 .about.lab4 .about.lab8 .about.lab9 .about.lab6 \
 .about.lab7 .about.lab10 .about.lab5 -side top -fill x
pack .about.ok -side bottom -fill x
}

# The prefixes window
proc prefix {} {
toplevel .prefix -class dialog
wm title .prefix "Convert v1.2 - Prefixes for Powers of Ten"

frame .prefix.f -borderwidth 10 -bg snow3
frame .prefix.f.frame1 -borderwidth 10 -bg white
frame .prefix.f.frame2 -borderwidth 10 -bg wheat2
frame .prefix.f.frame3 -borderwidth 10 -bg white
frame .prefix.f.frame4 -borderwidth 10 -bg wheat2
label .prefix.f.frame1.lab1 -text "Power" -bg white -fg black
label .prefix.f.frame1.lab2 -text "1E-18" -bg white -fg black
label .prefix.f.frame1.lab3 -text "1E-15" -bg white -fg black
label .prefix.f.frame1.lab4 -text "1E-12" -bg white -fg black
label .prefix.f.frame1.lab5 -text "1E-9" -bg white -fg black
label .prefix.f.frame1.lab6 -text "1E-6" -bg white -fg black
label .prefix.f.frame1.lab7 -text "1E-3" -bg white -fg black
label .prefix.f.frame1.lab8 -text "1E-2" -bg white -fg black
label .prefix.f.frame1.lab9 -text "1E-1" -bg white -fg black
label .prefix.f.frame2.lab1 -text "Prefix" -bg wheat2
label .prefix.f.frame2.lab2 -text "atto (a)" -bg wheat2
label .prefix.f.frame2.lab3 -text "femto (f)" -bg wheat2
label .prefix.f.frame2.lab4 -text "pico (p)" -bg wheat2
label .prefix.f.frame2.lab5 -text "nano (n)" -bg wheat2
label .prefix.f.frame2.lab6 -text "micro" -bg wheat2
label .prefix.f.frame2.lab7 -text "milli (m)" -bg wheat2
label .prefix.f.frame2.lab8 -text "centi (c)" -bg wheat2
label .prefix.f.frame2.lab9 -text "deci (d)" -bg wheat2
label .prefix.f.frame3.lab1 -text "Power" -bg white -fg black
label .prefix.f.frame3.lab2 -text "1E1" -bg white -fg black
label .prefix.f.frame3.lab3 -text "1E2" -bg white -fg black
label .prefix.f.frame3.lab4 -text "1E3" -bg white -fg black
label .prefix.f.frame3.lab5 -text "1E6" -bg white -fg black
label .prefix.f.frame3.lab6 -text "1E9" -bg white -fg black
label .prefix.f.frame3.lab7 -text "1E12" -bg white -fg black
label .prefix.f.frame3.lab8 -text "1E15" -bg white -fg black
label .prefix.f.frame3.lab9 -text "1E18" -bg white -fg black
label .prefix.f.frame4.lab1 -text "Prefix" -bg wheat2
label .prefix.f.frame4.lab2 -text "deka (da)" -bg wheat2
label .prefix.f.frame4.lab3 -text "hecto (h)" -bg wheat2
label .prefix.f.frame4.lab4 -text "kilo (k)" -bg wheat2
label .prefix.f.frame4.lab5 -text "mega (M)" -bg wheat2
label .prefix.f.frame4.lab6 -text "giga (T)" -bg wheat2
label .prefix.f.frame4.lab7 -text "tera (T)" -bg wheat2
label .prefix.f.frame4.lab8 -text "peta (P)" -bg wheat2
label .prefix.f.frame4.lab9 -text "exa (E)" -bg wheat2
button .prefix.f.ok -text "OK" -command "destroy .prefix" -bg yellow -fg blue
pack .prefix.f -side top
pack .prefix.f.frame1 -side left
pack .prefix.f.frame2 -side left
pack .prefix.f.frame4 -side right
pack .prefix.f.frame3 -side right
pack .prefix.f.ok -side left -fill x
pack .prefix.f.frame1.lab1 .prefix.f.frame1.lab2 .prefix.f.frame1.lab3 .prefix.f.frame1.lab4 \
.prefix.f.frame1.lab5 .prefix.f.frame1.lab6 .prefix.f.frame1.lab7 .prefix.f.frame1.lab8 \
.prefix.f.frame1.lab9 -side top -fill x
pack .prefix.f.frame2.lab1 .prefix.f.frame2.lab2 .prefix.f.frame2.lab3 .prefix.f.frame2.lab4 \
.prefix.f.frame2.lab5 .prefix.f.frame2.lab6 .prefix.f.frame2.lab7 .prefix.f.frame2.lab8 \
.prefix.f.frame2.lab9 -side top -fill x
pack .prefix.f.frame4.lab1 .prefix.f.frame4.lab2 .prefix.f.frame4.lab3 .prefix.f.frame4.lab4 \
.prefix.f.frame4.lab5 .prefix.f.frame4.lab6 .prefix.f.frame4.lab7 .prefix.f.frame4.lab8 \
.prefix.f.frame4.lab9 -side top -fill x
pack .prefix.f.frame3.lab1 .prefix.f.frame3.lab2 .prefix.f.frame3.lab3 .prefix.f.frame3.lab4 \
.prefix.f.frame3.lab5 .prefix.f.frame3.lab6 .prefix.f.frame3.lab7 .prefix.f.frame3.lab8 \
.prefix.f.frame3.lab9 -side top -fill x
} 

#
set tcl_precision 10
wm title . "Convert v1.2"

set entry_variable ""
set last_selected_item 0

frame .menu -relief raised -borderwidth 1
message .msg -font -Adobe-times-medium-r-normal-*-180* -relief raised -width 500 \
 -borderwidth 1 -text "Welcome to Convert v1.2 written on Linux with tcl/tk" \
 -background yellow -foreground blue

pack .menu -side top -fill x
pack .msg -side top -expand no -fill both

menubutton .menu.button -text "File" -menu .menu.button.m -underline 0
menu .menu.button.m
.menu.button.m add command -label "Quit" -command "destroy ." -underline 0

menubutton .menu.alfa -text "Categories" -menu .menu.alfa.m -underline 0
menu .menu.alfa.m
.menu.alfa.m add command -label "All" -command {list_all} -underline 0
.menu.alfa.m add command -label "Energy" -command {list_energy} -underline 0
.menu.alfa.m add command -label "Force" -command {list_force} -underline 0
.menu.alfa.m add command -label "Length" -command {list_length} -underline 0
.menu.alfa.m add command -label "Mass" -command {list_mass} -underline 0
.menu.alfa.m add command -label "Power" -command {list_power} -underline 2
.menu.alfa.m add command -label "Pressure" -command {list_press} -underline 0
.menu.alfa.m add command -label "Speed" -command {list_speed} -underline 0
.menu.alfa.m add command -label "Surface" -command {list_surface} -underline 1
.menu.alfa.m add command -label "Temperature" -command {list_tempr} -underline 0
.menu.alfa.m add command -label "Time" -command {list_time} -underline 1
.menu.alfa.m add command -label "Volume" -command {list_volume} -underline 0

menubutton .menu.prefix -text "Prefixes" -menu .menu.prefix.m -underline 0
menu .menu.prefix.m
.menu.prefix.m add command -label "Prefixes" -command {prefix} -underline 0

menubutton .menu.about -text "Help" -menu .menu.about.m -underline 0
menu .menu.about.m
.menu.about.m add command -label "About" -command {about} -underline 0

button .conv -text "CONVERT" -background yellow -foreground blue
button .exit -text "EXIT" -command "destroy ." -background yellow -foreground blue

pack .menu.button -side left 
pack .menu.alfa -side left
pack .menu.prefix -side left
pack .menu.about -side right
pack .exit -side bottom -fill both -padx 10 -pady 5

# Input Box
 
frame .frame3 -borderwidth 10
label .frame3.lab1 -text "From : "
pack .frame3 -side top -expand no -fill both
entry .frame3.e1 -textvariable entry_variable -relief sunken
pack .frame3.lab1 -side left -padx 5
pack .frame3.e1 -side top -pady 5 -fill both
.frame3.e1 insert 0 "Initial value"

# List Box 1

frame .frame -borderwidth 10
pack .frame -side top -expand yes -fill y
scrollbar .frame.scroll -relief sunken -command ".frame.list1 yview"
listbox .frame.list1 -yscroll ".frame.scroll set" -relief sunken -setgrid 1
label .frame.label1 -text "Category : All"
pack .frame.label1 -side top
pack .frame.scroll -side right -fill y
pack .frame.list1 -side top -expand yes -fill both -ipadx 110

proc list_all {} {
.frame.label1 config -text "Category : All"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Acres (acre) to Feet2 (ft2)" \
"Acres (acre) to Inches2 (in2)" \
"Acres (acre) to Meters2 (m2)" \
"Acres (acre) to Yards (ya2)" \
"Angstrem (A@) to Centimeters (cm)" \
"Angstrem (A@) to Meters (m)" \
"Atmospheres (atm) to Dynes/centimeter2 (dyn/cm2)" \
"Atmospheres (atm) to Centimeters Hg (cm Hg)" \
"Atmospheres (atm) to Pascals (Pa)" \
"Atmospheres (atm) to Pound/foot2 (lb/ft2)" \
"Atmospheres (atm) to Pound/inch2 (lb/in2)"  \
"Atomic mass unit (u) to Gram (g)"  \
"Atomic mass unit (u) to Slugs (lb/g)" \
"Atomic mass unit (u) to Kilogram (kg)"  \
"Btu (btu) to Calories (cal)"  \
"Btu (btu) to Electronvolts (eV)" \
"Btu (btu) to Energy (erg)"  \
"Btu (btu) to Feet*Pounds (ft*lb)" \
"Btu (btu) to Joules (J)" \
"Btu (btu) to Kilowatt/h (kWh)" \
"Btu/hour (btu/hr) to Watt (W)" \
"Calories (cal) to Btu (btu)" \
"Calories (cal) to Electronvolts (eV)" \
"Calories (cal) to Energy (erg)" \
"Calories (cal) to Feet*Pounds (ft*lb)" \
"Calories (cal) to Joules (J)" \
"Calories (cal) to Kilowatt/h (kWh)" \
"Celsius (C) to Fahrenheit (F)" \
"Celsius (C) to Kelvin (K)" \
"Centimeters (cm) to Angstrem (A@)" \
"Centimeters (cm) to Feet (ft)"  \
"Centimeters (cm) to Inches (in)"  \
"Centimeters (cm) to Kilometers (km)"  \
"Centimeters (cm) to Meters (m)"  \
"Centimeters (cm) to Miles (mi)"  \
"Centimeters Hg (cm Hg) to Atmospheres (atm)" \
"Centimeters Hg (cm Hg) to Dynes/centimeter2 (dyn/cm2)" \
"Centimeters Hg (cm Hg) to Pascals (Pa)" \
"Centimeters Hg (cm Hg) to Pounds/foot2 (lb/ft2)" \
"Centimeters Hg (cm Hg) to Pounds/inch2 (lb/in2)" \
"Centimeters/second (cm/s) to Feet/second (ft/s)" \
"Centimeters/second (cm/s) to Meters/second (m/s)" \
"Centimeters/second (cm/s) to Miles/hour (mi/h)" \
"Days (day) to Hours (h)" \
"Days (day) to Minutes (min)" \
"Days (day) to Seconds (sec)" \
"Days (day) to Years (year)" \
"Dynes (dyn) to Newtons (N)" \
"Dynes (dyn) to Pounds (lb)" \
"Dynes/centimeter2 (dyn/cm2) to Atmospheres (atm)" \
"Dynes/centimeter2 (dyn/cm2) to Centimeters Hg (cm Hg)" \
"Dynes/centimeter2 (dyn/cm2) to Pascals (Pa)" \
"Dynes/centimeter2 (dyn/cm2) to Pound/foot2 (lb/ft2)" \
"Dynes/centimeter2 (dyn/cm2) to Pound/inch2 (lb/in2)" \
"Electronvolts (eV) to Btu (btu)" \
"Electronvolts (eV) to Calories (cal)" \
"Electronvolts (eV) to Energy (erg)" \
"Electronvolts (eV) to Feet*Pounds (ft*pd)" \
"Electronvolts (eV) to Joules (J)" \
"Electronvolts (eV) to Kilowatt/h (kWh)" \
"Energy (erg) to Btu (btu)" \
"Energy (erg) to Calories (cal)" \
"Energy (erg) to Electronvolts (eV)" \
"Energy (erg) to Feets*Pounds (ft*pd)" \
"Energy (erg) to Joules (J)" \
"Energy (erg) to Kilowatt/h (kWh)" \
"Ergo/sec (erg/s) to Watt (W)" \
"Fahrenheit (F) to Clesius (C)" \
"Fahrenheit (F) to Kelvin (K)" \
"Feet (ft) to Centimeters (cm)" \
"Feet (ft) to Inches (in)" \
"Feet (ft) to Kilometers (km)" \
"Feet (ft) to Meters (m)" \
"Feet (ft) to Miles (mi)" \
"Feet2 (ft2) to Acres (acre)" \
"Feet2 (ft2) to Inches (in2)" \
"Feet2 (ft2) to Meters2 (m2)" \
"Feet2 (ft2) to Yards (ya2)" \
"Feet3 (ft3) to Gallons (USA)" \
"Feet3 (ft3) to Gallons (UK)" \
"Feet3 (ft3) to Inches3 (in3)" \
"Feet3 (ft3) to Liters (lt)" \
"Feet3 (ft3) to Meters3 (m3)" \
"Feet3 (ft3) to Yards3 (ya3)" \
"Feet*pounds (ft*lb) to Btu (btu)" \
"Feet*pounds (ft*lb) to Calories (cal)" \
"Feet*pounds (ft*lb) to Electronvolts (eV)" \
"Feet*pounds (ft*lb) to Energy (erg)" \
"Feet*pounds (ft*lb) to Joules (J)" \
"Feet*pounds (ft*lb) to Kilowatt/h (kWh)" \
"Feet/second (ft/s) to Centimeters/second (cm/s)" \
"Feet/second (ft/s) to Meters/second (m/s)" \
"Feet/second (ft/s) to Miles/hour (mi/h)" \
"Gallons (USA) to Feet3 (ft3)" \
"Gallons (USA) to Gallons (UK)" \
"Gallons (USA) to Inches3 (in3)" \
"Gallons (USA) to Liters (lt)" \
"Gallons (USA) to Meters3 (m3)" \
"Gallons (USA) to Yards3 (ya3)" \
"Gallons (UK) to Feet3 (ft3)" \
"Gallons (UK) to Gallons (USA)" \
"Gallons (UK) to Inches3 (in3)" \
"Gallons (UK) to Liters (lt)" \
"Gallons (UK) to Meters3 (m3)" \
"Gallons (UK) to Yards3 (ya3)" \
"Grams (g) to Atomic mass unit (u)" \
"Grams (g) to Kilograms (kg)" \
"Grams (g) to Slugs (lb/g)" \
"Hours (h) to Days (day)" \
"Hours (h) to Minutes (min)" \
"Hours (h) to Seconds (s)" \
"Hours (h) to Years (year)" \
"HP British (hp) to Watt (W)" \
"HP Boler (hp) to Watt (W)" \
"HP Metric (PS) to Watt (W)" \
"Inches (in) to Centimeters (cm)" \
"Inches (in) to Feet (ft)" \
"Inches (in) to Kilometers (km)" \
"Inches (in) to Meters (m)" \
"Inches (in) to Miles (mi)" \
"Inches2 (in2) to Acres (acre)" \
"Inches2 (in2) to Feet2 (ft2)" \
"Inches2 (in2) to Meters2 (m2)" \
"Inches2 (in2) to Yards (ya)" \
"Inches3 (in3) to Feet3 (ft3)" \
"Inches3 (in3) to Gallons (USA)" \
"Inches3 (in3) to Gallons (UK)" \
"inches3 (in3) to Liters (lt)" \
"Inches3 (in3) to Meters3 (m3)" \
"Inches3 (in3) to Yards3 (ya3)" \
"Joules (J) to Btu (btu)" \
"Joules (J) to Calories (cal)"   \
"Joules (J) to Energy (erg)"   \
"Joules (J) to Electronvolts (eV)" \
"Joules (J) to Feets*Pounds (ft*lb)" \
"Joules (J) to Kilowatt/h (kWh)" \
"Kelvin (K) to Celsius (C)" \
"Kelvin (K) to Fahrenheit (F)" \
"Kcalory/hour (Kcal/hr) to Watt (W)" \
"Kilograms (kg) to Grams (g)"   \
"Kilograms (kg) to Slugs (lb/g)"   \
"Kilograms (kg) to Atomic mass unit (u)"   \
"Kilometers (km) to Centimeters (cm)"   \
"Kilometers (km) to Feet (ft)"   \
"Kilometers (km) to Inches (in)"   \
"Kilometers (km) to Meters (m)"   \
"Kilometers (km) to Miles (mi)"   \
"Kilowatt/h (kWh) to Btu (btu)"   \
"Kilowatt/h (kWh) to Calories (cal)" \
"Kilowatt/h (kWh) to Electronvolts (eV)"   \
"Kilowatt/h (kWh) to Energy (erg)"   \
"Kilowatt/h (kWh) to Feet*Pounds (ft*lb)"   \
"Kilowatt/h (kWh) to Joules (J)"   \
"Kpm/sec (Kpm/s) to Watt (W)" \
"Liters (lt) to Feet3 (ft3)" \
"Liters (lt) to Gallons (USA)" \
"Liters (lt) to Gallons (UK)" \
"Liters (lt) to Inches3 (in3)" \
"Liters (lt) to Meters3 (m3)" \
"Liters (lt) to Yards3 (ya3)" \
"Meters (m) to Angstrem (A@)" \
"Meters (m) to Centimeters (cm)"   \
"Meters (m) to Feet (ft)"   \
"Meters (m) to Inches (in)"   \
"Meters (m) to Kilometers (km)"   \
"Meters (m) to Miles (mi)" \
"Meters2 (m2) to Acres (acre)" \
"Meters2 (m2) to Feet2 (ft2)" \
"Meters2 (m2) to Inches2 (in2)" \
"Meters2 (m2) to Yards2 (ya2)" \
"Meters/second (m/s) to Centimeters/second (cm/s)"   \
"Meters/second (m/s) to Feet/second (ft/s)"   \
"Meters/second (m/s) to Miles/hour (mi/h)" \
"Miles (mi) to Centimeters (cm)"   \
"Miles (mi) to Feet (ft)"   \
"Miles (mi) to Inches (in)"   \
"Miles (mi) to Kilometers (km)"   \
"Miles (mi) to Meters (m)"   \
"Miles/hour (mi/h) to Centimeters/second (cm/s)"   \
"Miles/hour (mi/h) to Feet/second (ft/s)"   \
"Miles/hour (mi/h) to Meters/second (m/s)"   \
"Minutes (min) to Days (day)"   \
"Minutes (min) to Hours (h)"   \
"Minutes (min) to Seconds (s)"   \
"Minutes (min) to Years (year)"   \
"Newtons (N) to Dynes (dyn)" \
"Newtons (N) to Pounds (lb)"   \
"Pascals (Pa) to Atmospheres (atm) "   \
"Pascals (Pa) to Dynes/centimiter2 (dyn/cm2)"   \
"Pascals (Pa) to Centimeters Hg (cm Hg)"   \
"Pascals (Pa) to Pound/foot2 (lb/ft2)"   \
"Pascals (Pa) to Pound/inch2 (lb/in2)" \
"Pounds (lb) to Dynes (dyn)" \
"Pounds (lb) to Newtons (N)" \
"Pounds/foot2 (lb/ft2) to Atmospheres (atm)" \
"Pounds/foot2 (lb/ft2) to Centimeters Hg (cm Hg)" \
"Pounds/foot2 (lb/ft2) to Dynes/centimeter2 (dyn/cm2)" \
"Pounds/foot2 (lb/ft2) to Pascals (Pa)" \
"Pounds/foot2 (lb/ft2) to Pounds/inch2 (lb/in2)"   \
"Pounds/inch2 (lb/in2) to Atmospheres (atm)" \
"Pounds/inch2 (lb/in2) to Centimeters Hg (cm Hg)"   \
"Pounds/inch2 (lb/in2) to Dynes/centimeters2 (dyn/cm2)"   \
"Pounds/inch2 (lb/in2) to Pascals (Pa)"   \
"Pounds/inch2 (lb/in2) to Pounds/foot2 (lb/ft2)" \
"Seconds (s) to Days (day)"   \
"Seconds (s) to Hours (h)"   \
"Seconds (s) to Minutes (min)"   \
"Seconds (s) to Years (year)"   \
"Slugs (lb/g) to Atomic mass unit (u)"   \
"Slugs (lb/g) to Grams (g)"   \
"Slugs (lb/g) to Kilograms (kg)"   \
"Yards2 (ya2) to Acres (acre)" \
"Yards2 (ya2) to Feet2 (ft2)" \
"Yards2 (ya2) to Inches (in2)" \
"Yards2 (ya2) to Meters2 (m2)" \
"Yards3 (ya3) to Feet3 (ft3)" \
"Yards3 (ya3) to Gallons (USA)" \
"Yards3 (ya3) to Gallons (UK)" \
"Yards3 (ya3) to Inches3 (in3)" \
"Yards3 (ya3) to Liters (lt)" \
"Yards3 (ya3) to Meters3 (m3)" \
"Years (year) to Days (day)"   \
"Years (year) to Hours (h)"   \
"Years (year) to Minutes (min)"   \
"Years (year) to Seconds (s)"
}

{list_all}

proc list_length {} {
.frame.label1 config -text "Category : Length"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Angstrem (A@) to Centimeters (cm)" \
"Angstrem (A@) to Meters (m)" \
"Centimeters (cm) to Angstrem (A@)" \
"Centimeters (cm) to Feet (ft)"  \
"Centimeters (cm) to Inches (in)"  \
"Centimeters (cm) to Kilometers (km)"  \
"Centimeters (cm) to Meters (m)"  \
"Centimeters (cm) to Miles (mi)"  \
"Feet (ft) to Centimeters (cm)" \
"Feet (ft) to Inches (in)" \
"Feet (ft) to Kilometers (km)" \
"Feet (ft) to Meters (m)" \
"Feet (ft) to Miles (mi)" \
"Inches (in) to Centimeters (cm)" \
"Inches (in) to Feet (ft)" \
"Inches (in) to Kilometers (km)" \
"Inches (in) to Meters (m)" \
"Inches (in) to Miles (mi)" \
"Kilometers (km) to Centimeters (cm)"   \
"Kilometers (km) to Feet (ft)"   \
"Kilometers (km) to Inches (in)"   \
"Kilometers (km) to Meters (m)"   \
"Kilometers (km) to Miles (mi)"   \
"Meters (m) to Angstrem (A@)" \
"Meters (m) to Centimeters (cm)"   \
"Meters (m) to Feet (ft)"   \
"Meters (m) to Inches (in)"   \
"Meters (m) to Kilometers (km)"   \
"Meters (m) to Miles (mi)" \
"Miles (mi) to Centimeters (cm)"   \
"Miles (mi) to Feet (ft)"   \
"Miles (mi) to Inches (in)"   \
"Miles (mi) to Kilometers (km)"   \
"Miles (mi) to Meters (m)"   \
}

proc list_mass {} {
.frame.label1 config -text "Category : Mass"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Atomic mass unit (u) to Gram (g)"  \
"Atomic mass unit (u) to Slugs (lb/g)" \
"Atomic mass unit (u) to Kilogram (kg)"  \
"Grams (g) to Atomic mass unit (u)" \
"Grams (g) to Kilograms (kg)" \
"Grams (g) to Slugs (lb/g)" \
"Kilograms (kg) to Grams (g)"   \
"Kilograms (kg) to Slugs (lb/g)"   \
"Kilograms (kg) to Atomic mass unit (u)"   \
"Slugs (lb/g) to Atomic mass unit (u)"   \
"Slugs (lb/g) to Grams (g)"   \
"Slugs (lb/g) to Kilograms (kg)"   \
}

proc list_time {} {
.frame.label1 config -text "Category : Time"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Days (day) to Hours (h)" \
"Days (day) to Minutes (min)" \
"Days (day) to Seconds (sec)" \
"Days (day) to Years (year)" \
"Hours (h) to Days (day)" \
"Hours (h) to Minutes (min)" \
"Hours (h) to Seconds (s)" \
"Hours (h) to Years (year)" \
"Seconds (s) to Days (day)" \
"Seconds (s) to Hours (h)" \
"Seconds (s) to Minutes (min)" \
"Seconds (s) to Years (year)" \
"Years (year) to Days (day)" \
"Years (year) to Hours (h)" \
"Years (year) to Minutes (min)" \
"Years (year) to Seconds (s)"
}

proc list_speed {} {
.frame.label1 config -text "Category : Speed"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Centimeters/second (cm/s) to Feet/second (ft/s)" \
"Centimeters/second (cm/s) to Meters/second (m/s)" \
"Centimeters/second (cm/s) to Miles/hour (mi/h)" \
"Feet/second (ft/s) to Centimeters/second (cm/s)" \
"Feet/second (ft/s) to Meters/second (m/s)" \
"Feet/second (ft/s) to Miles/hour (mi/h)" \
"Meters/second (m/s) to Centimeters/second (cm/s)"   \
"Meters/second (m/s) to Feet/second (ft/s)"   \
"Meters/second (m/s) to Miles/hour (mi/h)" \
"Miles/hour (mi/h) to Centimeters/second (cm/s)"   \
"Miles/hour (mi/h) to Feet/second (ft/s)"   \
"Miles/hour (mi/h) to Meters/second (m/s)"   \
}

proc list_force {} {
.frame.label1 config -text "Category : Force"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Dynes (dyn) to Newtons (N)" \
"Dynes (dyn) to Pounds (lb)" \
"Newtons (N) to Dynes (dyn)" \
"Newtons (N) to Pounds (lb)"   \
"Pounds (lb) to Dynes (dyn)" \
"Pounds (lb) to Newtons (N)" \
}

proc list_energy {} {
.frame.label1 config -text "Category : Energy"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Btu (btu) to Calories (cal)"  \
"Btu (btu) to Electronvolts (eV)" \
"Btu (btu) to Energy (erg)"  \
"Btu (btu) to Feet*Pounds (ft*lb)" \
"Btu (btu) to Joules (J)" \
"Btu (btu) to Kilowatt/h (kWh)" \
"Calories (cal) to Btu (btu)" \
"Calories (cal) to Electronvolts (eV)" \
"Calories (cal) to Energy (erg)" \
"Calories (cal) to Feet*Pounds (ft*lb)" \
"Calories (cal) to Joules (J)" \
"Calories (cal) to Kilowatt/h (kWh)" \
"Electronvolts (eV) to Btu (btu)" \
"Electronvolts (eV) to Calories (cal)" \
"Electronvolts (eV) to Energy (erg)" \
"Electronvolts (eV) to Feet*Pounds (ft*pd)" \
"Electronvolts (eV) to Joules (J)" \
"Electronvolts (eV) to Kilowatt/h (kWh)" \
"Energy (erg) to Btu (btu)" \
"Energy (erg) to Calories (cal)" \
"Energy (erg) to Electronvolts (eV)" \
"Energy (erg) to Feets*Pounds (ft*pd)" \
"Energy (erg) to Joules (J)" \
"Energy (erg) to Kilowatt/h (kWh)" \
"Feet*pounds (ft*lb) to Btu (btu)" \
"Feet*pounds (ft*lb) to Calories (cal)" \
"Feet*pounds (ft*lb) to Electronvolts (eV)" \
"Feet*pounds (ft*lb) to Energy (erg)" \
"Feet*pounds (ft*lb) to Joules (J)" \
"Feet*pounds (ft*lb) to Kilowatt/h (kWh)" \
"Joules (J) to Btu (btu)" \
"Joules (J) to Calories (cal)"   \
"Joules (J) to Energy (erg)"   \
"Joules (J) to Electronvolts (eV)" \
"Joules (J) to Feets*Pounds (ft*lb)" \
"Joules (J) to Kilowatt/h (kWh)" \
"Kilowatt/h (kWh) to Btu (btu)"   \
"Kilowatt/h (kWh) to Calories (cal)" \
"Kilowatt/h (kWh) to Electronvolts (eV)"   \
"Kilowatt/h (kWh) to Energy (erg)"   \
"Kilowatt/h (kWh) to Feet*Pounds (ft*lb)"   \
"Kilowatt/h (kWh) to Joules (J)"   \
}

proc list_press {} {
.frame.label1 config -text "Category : Pressure"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Atmospheres (atm) to Centimeters Hg (cm Hg)" \
"Atmospheres (atm) to Dynes/centimeter2 (dyn/cm2)" \
"Atmospheres (atm) to Pascals (Pa)" \
"Atmospheres (atm) to Pound/foot2 (lb/ft2)" \
"Atmospheres (atm) to Pound/inch2 (lb/in2)"  \
"Centimeters Hg (cm Hg) to Atmospheres (atm)" \
"Centimeters Hg (cm Hg) to Dynes/centimeter2 (dyn/cm2)" \
"Centimeters Hg (cm Hg) to Pascals (Pa)" \
"Centimeters Hg (cm Hg) to Pounds/foot2 (lb/ft2)" \
"Centimeters Hg (cm Hg) to Pounds/inch2 (lb/in2)" \
"Dynes/centimeter2 (dyn/cm2) to Atmospheres (atm)" \
"Dynes/centimeter2 (dyn/cm2) to Centimeters Hg (cm Hg)" \
"Dynes/centimeter2 (dyn/cm2) to Pascals (Pa)" \
"Dynes/centimeter2 (dyn/cm2) to Pound/foot2 (lb/ft2)" \
"Dynes/centimeter2 (dyn/cm2) to Pound/inch2 (lb/in2)" \
"Pascals (Pa) to Atmospheres (atm)"   \
"Pascals (Pa) to Dynes/centimiter2 (dyn/cm2)"   \
"Pascals (Pa) to Centimeters Hg (cm Hg)"   \
"Pascals (Pa) to Pound/foot2 (lb/ft2)"   \
"Pascals (Pa) to Pound/inch2 (lb/in2)" \
"Pounds/foot2 (lb/ft2) to Atmospheres (atm)" \
"Pounds/foot2 (lb/ft2) to Centimeters Hg (cm Hg)" \
"Pounds/foot2 (lb/ft2) to Dynes/centimeter2 (dyn/cm2)" \
"Pounds/foot2 (lb/ft2) to Pascals (Pa)" \
"Pounds/foot2 (lb/ft2) to Pounds/inch2 (lb/in2)"   \
"Pounds/inch2 (lb/in2) to Atmospheres (atm)" \
"Pounds/inch2 (lb/in2) to Centimeters Hg (cm Hg)"   \
"Pounds/inch2 (lb/in2) to Dynes/centimeters2 (dyn/cm2)"   \
"Pounds/inch2 (lb/in2) to Pascals (Pa)"   \
"Pounds/inch2 (lb/in2) to Pounds/foot2 (lb/ft2)" \
}

proc list_surface {} {
.frame.label1 config -text "Category : Surface"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Acres (acre) to Feet2 (ft2)" \
"Acres (acre) to Inches2 (in2)" \
"Acres (acre) to Meters2 (m2)" \
"Acres (acre) to Yards (ya2)" \
"Feet2 (ft2) to Acres (acre)" \
"Feet2 (ft2) to Inches (in2)" \
"Feet2 (ft2) to Meters2 (m2)" \
"Feet2 (ft2) to Yards (ya2)" \
"Inches2 (in2) to Acres (acre)" \
"Inches2 (in2) to Feet2 (ft2)" \
"Inches2 (in2) to Meters2 (m2)" \
"Inches2 (in2) to Yards (ya)" \
"Meters2 (m2) to Acres (acre)" \
"Meters2 (m2) to Feet2 (ft2)" \
"Meters2 (m2) to Inches2 (in2)" \
"Meters2 (m2) to Yards2 (ya2)" \
"Yards2 (ya2) to Acres (acre)" \
"Yards2 (ya2) to Feet2 (ft2)" \
"Yards2 (ya2) to Inches (in2)" \
"Yards2 (ya2) to Meters2 (m2)" \
}

proc list_volume {} {
.frame.label1 config -text "Category : Volume"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Feet3 (ft3) to Gallons (USA)" \
"Feet3 (ft3) to Gallons (UK)" \
"Feet3 (ft3) to Inches3 (in3)" \
"Feet3 (ft3) to Liters (lt)" \
"Feet3 (ft3) to Meters3 (m3)" \
"Feet3 (ft3) to Yards3 (ya3)" \
"Gallons (USA) to Feet3 (ft3)" \
"Gallons (USA) to Gallons (UK)" \
"Gallons (USA) to Inches3 (in3)" \
"Gallons (USA) to Liters (lt)" \
"Gallons (USA) to Meters3 (m3)" \
"Gallons (USA) to Yards3 (ya3)" \
"Gallons (UK) to Feet3 (ft3)" \
"Gallons (UK) to Gallons (USA)" \
"Gallons (UK) to Inches3 (in3)" \
"Gallons (UK) to Liters (lt)" \
"Gallons (UK) to Meters3 (m3)" \
"Gallons (UK) to Yards3 (ya3)" \
"Inches3 (in3) to Feet3 (ft3)" \
"Inches3 (in3) to Gallons (USA)" \
"Inches3 (in3) to Gallons (UK)" \
"inches3 (in3) to Liters (lt)" \
"Inches3 (in3) to Meters3 (m3)" \
"Inches3 (in3) to Yards3 (ya3)" \
"Liters (lt) to Feet3 (ft3)" \
"Liters (lt) to Gallons (USA)" \
"Liters (lt) to Gallons (UK)" \
"Liters (lt) to Inches3 (in3)" \
"Liters (lt) to Meters3 (m3)" \
"Liters (lt) to Yards3 (ya3)" \
"Yards3 (ya3) to Feet3 (ft3)" \
"Yards3 (ya3) to Gallons (USA)" \
"Yards3 (ya3) to Gallons (UK)" \
"Yards3 (ya3) to Inches3 (in3)" \
"Yards3 (ya3) to Liters (lt)" \
"Yards3 (ya3) to Meters3 (m3)" \
}

proc list_tempr {} {
.frame.label1 config -text "Category : Temperature"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Celsius (C) to Fahrenheit (F)" \
"Celsius (C) to Kelvin (K)" \
"Fahrenheit (F) to Clesius (C)" \
"Fahrenheit (F) to Kelvin (K)" \
"Kelvin (K) to Celsius (C)" \
"Kelvin (K) to Fahrenheit (F)" \
}

proc list_power {} {
.frame.label1 config -text "Category : Power"
.frame.list1 delete 0 end
.frame.list1 insert 0 \
"Btu/hour (btu/hr) to Watt (W)" \
"Ergo/sec (erg/s) to Watt (W)" \
"HP British (hp) to Watt (W)" \
"HP Boler (hp) to Watt (W)" \
"HP Metric (PS) to Watt (W)" \
"Kcalory/hour (Kcal/hr) to Watt (W)" \
"Kpm/sec (Kpm/s) to Watt (W)" \
}

# Output Label

frame .left
frame .right
pack .left .right -side bottom -expand no -fill both
label .left.l2 -text "To : "
label .left.l1 -text "Output value" -relief sunken
pack .left.l2 -side left -padx 5 
pack .conv .left.l1 -side bottom -expand no -padx 10 -pady 5 -fill both

# Conversions

set multipliers(Angstrem\ (A@)\ to\ Centimeters\ (cm))			1E-8
set multipliers(Angstrem\ (A@)\ to\ Meters\ (m))			1E-10
set multipliers(Atmospheres\ (atm)\ to\ Centimeters\ Hg\ (cm\ Hg)) 	76
set multipliers(Atmospheres\ (atm)\ to\ Dynes/centimeter2\ (dyn/cm2)) 	1.013E6
set multipliers(Atmospheres\ (atm)\ to\ Pascals\ (Pa)) 			1.013E5
set multipliers(Atmospheres\ (atm)\ to\ Pound/foot2\ (lb/ft2)) 		2116
set multipliers(Atmospheres\ (atm)\ to\ Pound/inch2\ (lb/in2))		14.70
set multipliers(Atomic\ mass\ unit\ (u)\ to\ Gram\ (g)) 		1.660E-26
set multipliers(Atomic\ mass\ unit\ (u)\ to\ Slugs\ (lb/g)) 		1.137E-28
set multipliers(Atomic\ mass\ unit\ (u)\ to\ Kilogram\ (kg)) 		1.660E-27
set multipliers(Btu\ (btu)\ to\ Calories\ (cal))  			252
set multipliers(Btu\ (btu)\ to\ Electronvolts\ (eV)) 			6.585E21
set multipliers(Btu\ (btu)\ to\ Energy\ (erg)) 				1.055E10
set multipliers(Btu\ (btu)\ to\ Feet*Pounds\ (ft*lb)) 			777.9
set multipliers(Btu\ (btu)\ to\ Joules\ (J)) 				1055
set multipliers(Btu\ (btu)\ to\ Kilowatt/h\ (kWh)) 			2.930E-4
set multipliers(Calories\ (cal)\ to\ Btu\ (btu)) 			3.968E-3
set multipliers(Calories\ (cal)\ to\ Electronvolts\ (eV))		2.613E19
set multipliers(Calories\ (cal)\ to\ Energy\ (erg))			4.186E7
set multipliers(Calories\ (cal)\ to\ Feet*Pounds\ (ft*lb))		3.087
set multipliers(Calories\ (cal)\ to\ Joules\ (J))			4.186
set multipliers(Calories\ (cal)\ to\ Kilowatt/h\ (kWh))			1.163E-6
set multipliers(Centimeters\ (cm)\ to\ Angstrem\ (A@))			1E8
set multipliers(Centimeters\ (cm)\ to\ Feet\ (ft))			3.281E-2 
set multipliers(Centimeters\ (cm)\ to\ Inches\ (in))			0.3937
set multipliers(Centimeters\ (cm)\ to\ Kilometers\ (km))		1E-5
set multipliers(Centimeters\ (cm)\ to\ Meters\ (m))			1E-2
set multipliers(Centimeters\ (cm)\ to\ Miles\ (mi))			6.214E-6
set multipliers(Centimeters\ Hg\ (cm\ Hg)\ to\ Atmospheres\ (atm)) 	1.316E-2
set multipliers(Centimeters\ Hg\ (cm\ Hg)\ to\ Dynes/centimeter2\ (dyn/cm2)) 1.333E4
set multipliers(Centimeters\ Hg\ (cm\ Hg)\ to\ Pascals\ (Pa)) 		1.333E3
set multipliers(Centimeters\ Hg\ (cm\ Hg)\ to\ Pounds/foot2\ (lb/ft2))  27.85
set multipliers(Centimeters\ Hg\ (cm\ Hg)\ to\ Pounds/inch2\ (lb/in2))  0.1943
set multipliers(Centimeters/second\ (cm/s)\ to\ Feet/second\ (ft/s))	3.281E-2
set multipliers(Centimeters/second\ (cm/s)\ to\ Meters/second\ (m/s))	0.01
set multipliers(Centimeters/second\ (cm/s)\ to\ Miles/hour\ (mi/h))	2.237E-2
set multipliers(Days\ (day)\ to\ Hours\ (h))				24
set multipliers(Days\ (day)\ to\ Minutes\ (min))			1440
set multipliers(Days\ (day)\ to\ Seconds\ (sec)) 			8.640E4
set multipliers(Days\ (day)\ to\ Years\ (year))				2.738E-3
set multipliers(Dynes\ (dyn)\ to\ Newtons\ (N)) 			1E(-5)
set multipliers(Dynes\ (dyn)\ to\ Pounds\ (lb)) 			2.248E-6
set multipliers(Dynes/centimeter2\ (dyn/cm2)\ to\ Atmospheres\ (atm))   9.869E-7
set multipliers(Dynes/centimeter2\ (dyn/cm2)\ to\ Centimeters\ Hg\ (cm\ Hg)) 7.501E-5
set multipliers(Dynes/centimeter2\ (dyn/cm2)\ to\ Pascals\ (Pa))	0.1
set multipliers(Dynes/centimeter2\ (dyn/cm2)\ to\ Pound/foot2\ (lb/ft2)) 2.089E-3
set multipliers(Dynes/centimeter2\ (dyn/cm2)\ to\ Pound/inch2\ (lb/in2)) 1.450E-5
set multipliers(Electronvolts\ (eV)\ to\ Btu\ (btu))			1.519E-22
set multipliers(Electronvolts\ (eV)\ to\ Calories\ (cal))		3.827E-20
set multipliers(Electronvolts\ (eV)\ to\ Energy\ (erg))			1.602E-12
set multipliers(Electronvolts\ (eV)\ to\ Feet*Pounds\ (ft*pd))		1.182E-19
set multipliers(Electronvolts\ (eV)\ to\ Joules\ (J))			1.602E-19
set multipliers(Electronvolts\ (eV)\ to\ Kilowatt/h\ (kWh))		4.450E-26
set multipliers(Energy\ (erg)\ to\ Btu\ (btu))				9.481E-11
set multipliers(Energy\ (erg)\ to\ Calories\ (cal))			2.389E-8
set multipliers(Energy\ (erg)\ to\ Electronvolts\ (eV))			6.242E11
set multipliers(Energy\ (erg)\ to\ Feets*Pounds\ (ft*pd))		7.376E-8
set multipliers(Energy\ (erg)\ to\ Joules\ (J))				1E-7
set multipliers(Energy\ (erg)\ to\ Kilowatt/h\ (kWh))			2.778E-14
set multipliers(Feet\ (ft)\ to\ Centimeters\ (cm))			30.48
set multipliers(Feet\ (ft)\ to\ Inches\ (in))				12
set multipliers(Feet\ (ft)\ to\ Kilometers\ (km))			3.048E-4
set multipliers(Feet\ (ft)\ to\ Meters\ (m))				0.3048
set multipliers(Feet\ (ft)\ to\ Miles\ (mi))				1.894E-4
set multipliers(Feet*pounds\ (ft*lb)\ to\ Btu\ (btu))			1.285E-3
set multipliers(Feet*pounds\ (ft*lb)\ to\ Calories\ (cal))		0.3239
set multipliers(Feet*pounds\ (ft*lb)\ to\ Electronvolts\ (eV))		8.464E18
set multipliers(Feet*pounds\ (ft*lb)\ to\ Energy\ (erg))		1.356E7
set multipliers(Feet*pounds\ (ft*lb)\ to\ Joules\ (J))			1.356
set multipliers(Feet*pounds\ (ft*lb)\ to\ Kilowatt/h\ (kWh))		3.766E-7
set multipliers(Feet/second\ (ft/s)\ to\ Centimeters/second\ (cm/s))	30.48
set multipliers(Feet/second\ (ft/s)\ to\ Meters/second\ (m/s))		0.3048
set multipliers(Feet/second\ (ft/s)\ to\ Miles/hour\ (mi/h))		0.6818
set multipliers(Grams\ (g)\ to\ Atomic\ mass\ unit\ (u))		6.024E23
set multipliers(Grams\ (g)\ to\ Kilograms\ (kg))			1E-3
set multipliers(Grams\ (g)\ to\ Slugs\ (lb/g))				6.852E-5
set multipliers(Hours\ (h)\ to\ Days\ (day))				4.167E-2
set multipliers(Hours\ (h)\ to\ Minutes\ (min))				60
set multipliers(Hours\ (h)\ to\ Seconds\ (s))				3600
set multipliers(Hours\ (h)\ to\ Years\ (year))				1.141E-4
set multipliers(Inches\ (in)\ to\ Centimeters\ (cm))			2.540
set multipliers(Inches\ (in)\ to\ Feet\ (ft))				8.333E-2
set multipliers(Inches\ (in)\ to\ Kilometers\ (km))			2.540E-5
set multipliers(Inches\ (in)\ to\ Meters\ (m))				2.540E-2
set multipliers(Inches\ (in)\ to\ Miles\ (mi))				1.578E-5
set multipliers(Joules\ (J)\ to\ Btu\ (btu))				9.481E-4
set multipliers(Joules\ (J)\ to\ Calories\ (cal))			0.2389
set multipliers(Joules\ (J)\ to\ Energy\ (erg))				1E7
set multipliers(Joules\ (J)\ to\ Electronvolts\ (eV))			6.242E18
set multipliers(Joules\ (J)\ to\ Feets*Pounds\ (ft*lb))			0.7376
set multipliers(Joules\ (J)\ to\ Kilowatt/h\ (kWh))			2.778E-7
set multipliers(Kilograms\ (kg)\ to\ Grams\ (g))			1000
set multipliers(Kilograms\ (kg)\ to\ Slugs\ (lb/g))			6.852E-2
set multipliers(Kilograms\ (kg)\ to\ Atomic\ mass\ unit\ (u))		6.024E-26
set multipliers(Kilometers\ (km)\ to\ Centimeters\ (cm))		1E5
set multipliers(Kilometers\ (km)\ to\ Feet\ (ft))			3281
set multipliers(Kilometers\ (km)\ to\ Inches\ (in))			39370
set multipliers(Kilometers\ (km)\ to\ Meters\ (m))			1000
set multipliers(Kilometers\ (km)\ to\ Miles\ (mi))			0.6214
set multipliers(Kilowatt/h\ (kWh)\ to\ Btu\ (btu))			341.3
set multipliers(Kilowatt/h\ (kWh)\ to\ Calories\ (cal))			860100
set multipliers(Kilowatt/h\ (kWh)\ to\ Electronvolts\ (eV))		2.247E25
set multipliers(Kilowatt/h\ (kWh)\ to\ Energy\ (erg))			3.6E13
set multipliers(Kilowatt/h\ (kWh)\ to\ Feet*Pounds\ (ft*lb))		2.655E6
set multipliers(Kilowatt/h\ (kWh)\ to\ Joules\ (J))			3.6E6
set multipliers(Meters\ (m)\ to\ Angstrem\ (A@))			1E10
set multipliers(Meters\ (m)\ to\ Centimeters\ (cm))			100
set multipliers(Meters\ (m)\ to\ Feet\ (ft))				3.281
set multipliers(Meters\ (m)\ to\ Inches\ (in))				39.37
set multipliers(Meters\ (m)\ to\ Kilometers\ (km))			0.001
set multipliers(Meters\ (m)\ to\ Miles\ (mi))				6.214E-4
set multipliers(Meters/second\ (m/s)\ to\ Centimeters/second\ (cm/s)) 	100
set multipliers(Meters/second\ (m/s)\ to\ Feet/second\ (ft/s))		3.281
set multipliers(Meters/second\ (m/s)\ to\ Miles/hour\ (mi/h))		2.237
set multipliers(Miles\ (mi)\ to\ Centimeters\ (cm))			1.609E5
set multipliers(Miles\ (mi)\ to\ Feet\ (ft))				5280
set multipliers(Miles\ (mi)\ to\ Inches\ (in))				63360
set multipliers(Miles\ (mi)\ to\ Kilometers\ (km))			1.609
set multipliers(Miles\ (mi)\ to\ Meters\ (m))				1609
set multipliers(Miles/hour\ (mi/h)\ to\ Centimeters/second\ (cm/s))	44.70
set multipliers(Miles/hour\ (mi/h)\ to\ Feet/second\ (ft/s))		1.467
set multipliers(Miles/hour\ (mi/h)\ to\ Meters/second\ (m/s))		0.4470
set multipliers(Minutes\ (min)\ to\ Days\ (day))			6.994E-4
set multipliers(Minutes\ (min)\ to\ Hours\ (h))				1.667E-2
set multipliers(Minutes\ (min)\ to\ Seconds\ (s))			60
set multipliers(Minutes\ (min)\ to\ Years\ (year))			1.901E-6
set multipliers(Newtons\ (N)\ to\ Dynes\ (dyn))				1E5
set multipliers(Newtons\ (N)\ to\ Pounds\ (lb))				0.2248
set multipliers(Pascals\ (Pa)\ to\ Atmospheres\ (atm))			9.869E-6
set multipliers(Pascals\ (Pa)\ to\ Dynes/centimiter2\ (dyn/cm2))	10
set multipliers(Pascals\ (Pa)\ to\ Centimeters\ Hg\ (cm\ Hg))		7.501E-4
set multipliers(Pascals\ (Pa)\ to\ Pound/foot2\ (lb/ft2))		2.089E-2
set multipliers(Pascals\ (Pa)\ to\ Pound/inch2\ (lb/in2))		1.450E-4
set multipliers(Pounds\ (lb)\ to\ Dynes\ (dyn))				4.448E5
set multipliers(Pounds\ (lb)\ to\ Newtons\ (N))				4.448
set multipliers(Pounds/foot2\ (lb/ft2)\ to\ Atmospheres\ (atm))		4.725E-4
set multipliers(Pounds/foot2\ (lb/ft2)\ to\ Centimeters\ Hg\ (cm\ Hg))  3.591E-2
set multipliers(Pounds/foot2\ (lb/ft2)\ to\ Dynes/centimeter2\ (dyn/cm2)) 4788
set multipliers(Pounds/foot2\ (lb/ft2)\ to\ Pascals\ (Pa))		47.88
set multipliers(Pounds/foot2\ (lb/ft2)\ to\ Pounds/inch2\ (lb/in2))	6.944E-3
set multipliers(Pounds/inch2\ (lb/in2)\ to\ Atmospheres\ (atm))		6.805E-2
set multipliers(Pounds/inch2\ (lb/in2)\ to\ Centimeters\ Hg\ (cm\ Hg)) 	5.171
set multipliers(Pounds/inch2\ (lb/in2)\ to\ Dynes/centimeters2\ (dyn/cm2)) 68950
set multipliers(Pounds/inch2\ (lb/in2)\ to\ Pascals\ (Pa)) 		6895
set multipliers(Pounds/inch2\ (lb/in2)\ to\ Pounds/foot2\ (lb/ft2))	144
set multipliers(Seconds\ (s)\ to\ Days\ (day))				1.157E-5
set multipliers(Seconds\ (s)\ to\ Hours\ (h))				2.778E-4
set multipliers(Seconds\ (s)\ to\ Minutes\ (min))			1.667E-2
set multipliers(Seconds\ (s)\ to\ Years\ (year))			3.169E-8
set multipliers(Slugs\ (lb/g)\ to\ Atomic\ mass\ unit\ (u))		8.789E27
set multipliers(Slugs\ (lb/g)\ to\ Grams\ (g))				14590
set multipliers(Slugs\ (lb/g)\ to\ Kilograms\ (kg))			14.59
set multipliers(Years\ (year)\ to\ Days\ (day))				365.2
set multipliers(Years\ (year)\ to\ Hours\ (h))				8766
set multipliers(Years\ (year)\ to\ Minutes\ (min))			525900
set multipliers(Years\ (year)\ to\ Seconds\ (s))			31560000
set multipliers(Acres\ (acre)\ to\ Feet2\ (ft2))			43515.129
set multipliers(Acres\ (acre)\ to\ Inches2\ (in2))			6272473.652
set multipliers(Acres\ (acre)\ to\ Meters2\ (m2))			4047
set multipliers(Acres\ (acre)\ to\ Yards\ (ya2))			4840.909
set multipliers(Feet2\ (ft2)\ to\ Acres\ (acre))			0.093/4047
set multipliers(Feet2\ (ft2)\ to\ Inches\ (in2))			0.093/645.2E-6
set multipliers(Feet2\ (ft2)\ to\ Meters2\ (m2))			0.093
set multipliers(Feet2\ (ft2)\ to\ Yards\ (ya2))				0.093/0.836
set multipliers(Inches2\ (in2)\ to\ Acres\ (acre))			645.2E-6/4047
set multipliers(Inches2\ (in2)\ to\ Feet2\ (ft2))			645.2E-6/0.093
set multipliers(Inches2\ (in2)\ to\ Meters2\ (m2))			645.2E-6
set multipliers(Inches2\ (in2)\ to\ Yards\ (ya))			645.2E-6/0.836
set multipliers(Meters2\ (m2)\ to\ Acres\ (acre))			1/4047
set multipliers(Meters2\ (m2)\ to\ Feet2\ (ft2))			1/0.093
set multipliers(Meters2\ (m2)\ to\ Inches2\ (in2))			1/645.2E-6
set multipliers(Meters2\ (m2)\ to\ Yards2\ (ya2))			1/0.836
set multipliers(Yards2\ (ya2)\ to\ Acres\ (acre))			0.836/4047
set multipliers(Yards2\ (ya2)\ to\ Feet2\ (ft2))			0.836/0.093
set multipliers(Yards2\ (ya2)\ to\ Inches\ (in2))			0.836/645.2E-6
set multipliers(Yards2\ (ya2)\ to\ Meters2\ (m2))			0.836
set multipliers(Feet3\ (ft3)\ to\ Gallons\ (USA))			0.0283/3.786E-3
set multipliers(Feet3\ (ft3)\ to\ Gallons\ (UK))			0.0283/4.546E-3
set multipliers(Feet3\ (ft3)\ to\ Inches3\ (in3))			0.0283/16.387E-6
set multipliers(Feet3\ (ft3)\ to\ Liters\ (lt))				0.0283*1000
set multipliers(Feet3\ (ft3)\ to\ Meters3\ (m3))			0.0283
set multipliers(Feet3\ (ft3)\ to\ Yards3\ (ya3))			0.0283/0.765
set multipliers(Gallons\ (USA)\ to\ Feet3\ (ft3))			3.786E-3/0.0283
set multipliers(Gallons\ (USA)\ to\ Gallons\ (UK))			3.786E-3/4.546E-3
set multipliers(Gallons\ (USA)\ to\ Inches3\ (in3))			3.786E-3/16.387E-6
set multipliers(Gallons\ (USA)\ to\ Liters\ (lt))			3.786
set multipliers(Gallons\ (USA)\ to\ Meters3\ (m3))			3.786E-3
set multipliers(Gallons\ (USA)\ to\ Yards3\ (ya3))			3.786E-3/0.765
set multipliers(Gallons\ (UK)\ to\ Feet3\ (ft3))			4.546E-3/0.0283
set multipliers(Gallons\ (UK)\ to\ Gallons\ (USA))			4.546E-3/3.786E-3
set multipliers(Gallons\ (UK)\ to\ Inches3\ (in3))			4.546E-3/16.387E-6
set multipliers(Gallons\ (UK)\ to\ Liters\ (lt))			4.546
set multipliers(Gallons\ (UK)\ to\ Meters3\ (m3))			4.546E-3
set multipliers(Gallons\ (UK)\ to\ Yards3\ (ya3))			4.546E-3/0.765
set multipliers(Inches3\ (in3)\ to\ Feet3\ (ft3))			16.387E-6/0.0283
set multipliers(Inches3\ (in3)\ to\ Gallons\ (USA))			16.387E-6/3.786E-3
set multipliers(Inches3\ (in3)\ to\ Gallons\ (UK))			16.387E-6/4.546E-3
set multipliers(inches3\ (in3)\ to\ Liters\ (lt))			16.387E-3
set multipliers(Inches3\ (in3)\ to\ Meters3\ (m3))			16.387E-6
set multipliers(Inches3\ (in3)\ to\ Yards3\ (ya3))			16.387E-6/0.765
set multipliers(Liters\ (lt)\ to\ Feet3\ (ft3))				1E-3/0.0283
set multipliers(Liters\ (lt)\ to\ Gallons\ (USA))			1E-3/3.786E-3
set multipliers(Liters\ (lt)\ to\ Gallons\ (UK))			1E-3/4.546E-3
set multipliers(Liters\ (lt)\ to\ Inches3\ (in3))			1E-3/16.387E-6
set multipliers(Liters\ (lt)\ to\ Meters3\ (m3))			1E-3
set multipliers(Liters\ (lt)\ to\ Yards3\ (ya3))			1E-3/0.765
set multipliers(Meters3\ (m3)\ to\ Feet3\ (ft3))			1/0.0283
set multipliers(Meters3\ (m3)\ to\ Gallons\ (USA))			1/3.786E-3
set multipliers(Meters3\ (m3)\ to\ Gallons\ (UK))			1/4.546E-3
set multipliers(Meters3\ (m3)\ to\ Inches3\ (in3))			1/16.387E-6
set multipliers(Meters3\ (m3)\ to\ Liters\ (lt))			1000
set multipliers(Meters3\ (m3)\ to\ Yards3\ (ya3))			1/0.765
set multipliers(Yards3\ (ya3)\ to\ Feet3\ (ft3))			0.765/0.0283
set multipliers(Yards3\ (ya3)\ to\ Gallons\ (USA))			0.765/3.786E-3
set multipliers(Yards3\ (ya3)\ to\ Gallons\ (UK))			0.765/4.546E-3
set multipliers(Yards3\ (ya3)\ to\ Inches3\ (in3))			0.765/16.387E-6
set multipliers(Yards3\ (ya3)\ to\ Liters\ (lt))			0.765E3
set multipliers(Yards3\ (ya3)\ to\ Meters3\ (m3))			0.765
set multipliers(Celsius\ (C)\ to\ Fahrenheit\ (F))			K1
set multipliers(Celsius\ (C)\ to\ Kelvin\ (K))				K2
set multipliers(Fahrenheit\ (F)\ to\ Clesius\ (C))			K3
set multipliers(Fahrenheit\ (F)\ to\ Kelvin\ (K))			K4
set multipliers(Kelvin\ (K)\ to\ Celsius\ (C))				K5
set multipliers(Kelvin\ (K)\ to\ Fahrenheit\ (F))			K6
set multipliers(Btu/hour\ (btu/hr)\ to\ Watt\ (W))			0.283
set multipliers(Ergo/sec\ (erg/s)\ to\ Watt\ (W))			1E-7
set multipliers(HP\ British\ (hp)\ to\ Watt\ (W))			745.7
set multipliers(HP\ Boler\ (hp)\ to\ Watt\ (W))				9800
set multipliers(HP\ Metric\ (PS)\ to\ Watt\ (W))			735.5
set multipliers(Kcalory/hour\ (Kcal/hr)\ to\ Watt\ (W))			1.163
set multipliers(Kpm/sec\ (Kpm/s)\ to\ Watt\ (W))			9.81

#

bind .frame.list1 <Leave>  {\
	if {[.frame.list1 size] != 0} { \
	set last_selected_item [.frame.list1 curselection];\
	focus . \
	}\
	}

bind .frame.list1 <Enter> { \
        if {[.frame.list1 size] != 0} { \
           .frame.list1 select set $last_selected_item; \
           }\
   }

bind .conv <Enter> { \
        if {[.frame.list1 size] != 0} { \
           .frame.list1 select set $last_selected_item; \
           }\
   }

#

#

bind .conv <ButtonPress-1> { \
	if {[ .frame.list1 size] != 0} {\
	 update_label [selection get] }
}

bind .frame.list1 <Double-1> {\
	if {[ .frame.list1 size] != 0 } {\
	 update_label [selection get] }
}

proc update_label {listbox_value} {
	global entry_variable
	global multipliers

	 if {[scan $entry_variable "%f%s" j k] != 1} then {\
	 .left.l1 config -text "Entry does not contain a number !"
	 return }

set multiplier $multipliers([selection get])

	if {$multiplier == "K2"} {\
	set newvalue [expr $entry_variable + 273.15]
        .left.l1 config -text $newvalue
	return }

	if {$multiplier == "K1"} {\
	set newvalue [expr (1.8 * $entry_variable) + 32]
        .left.l1 config -text $newvalue
	return }

	if {$multiplier == "K6"} {\
	set newvalue [expr ($entry_variable + 459.67)/1.8]
        .left.l1 config -text $newvalue
	return }
	
	if {$multiplier == "K3"} {\
	set newvalue [expr ($entry_variable - 32)/1.8]
        .left.l1 config -text $newvalue
	return }

	if {$multiplier == "K4"} {\
	set newvalue [expr ($entry_variable - 32)/1.8 + 273.15]
        .left.l1 config -text $newvalue
	return }

	if {$multiplier == "K5"} {\
	set newvalue [expr $entry_variable - 273.15]
        .left.l1 config -text $newvalue
	return }

set newvalue [expr $multiplier * $entry_variable]
	.left.l1 config -text $newvalue
}

bind . <Any-FocusIn> {
	if {("%d" == "NotifyVirtual") && ("%m" == "NotifyNormal")} {
	focus .menu}
}
        update
        scan [wm geometry .] "%dx%d+%d+%d" x y c d
        wm minsize . $x $y

tk_menuBar .menu .menu.button .menu.alfa .menu.about .menu.prefix