unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons; type TForm1 = class(TForm) Panel1: TPanel; GroupBox1: TGroupBox; GroupBox2: TGroupBox; RadioGroup1: TRadioGroup; GroupBox3: TGroupBox; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; StatusBar1: TStatusBar; GroupBox4: TGroupBox; StaticText1: TStaticText; BitBtn1: TBitBtn; BitBtn2: TBitBtn; Button1: TButton; Edit1: TEdit; Edit2: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure RadioGroup1Click(Sender: TObject); procedure RadioButton1Click(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure RadioButton3Click(Sender: TObject); procedure RadioButton4Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.RadioGroup1Click(Sender: TObject); begin case RadioGroup1.ItemIndex of 0: begin RadioButton1.Enabled:=false; RadioButton2.Enabled:=true; RadioButton3.Enabled:=true; RadioButton4.Enabled:=true; RadioButton2.Checked:=true; StatusBar1.Panels[1].Text:='m'; StatusBar1.Panels[3].Text:='Parsec'; Label2.Caption:='in m an!'; Label3.Caption:='Parsec'; Edit1.Text:='13744657868756575765'; //Eintragen eínes Basiswertes end; 1: begin RadioButton1.Enabled:=true; RadioButton2.Enabled:=false; RadioButton3.Enabled:=true; RadioButton4.Enabled:=true; RadioButton1.Checked:=true; StatusBar1.Panels[1].Text:='Parsec'; StatusBar1.Panels[3].Text:='m'; Label2.Caption:='in Parsec an!'; Label3.Caption:='m'; Edit1.Text:='14'; //Eintragen eínes Basiswertes end; 2: begin RadioButton1.Enabled:=true; RadioButton2.Enabled:=true; RadioButton3.Enabled:=false; RadioButton4.Enabled:=true; RadioButton1.Checked:=true; StatusBar1.Panels[1].Text:='Lichtjahre'; StatusBar1.Panels[3].Text:='m'; Label2.Caption:='in Lichtjahren an!'; Label3.Caption:='m'; Edit1.Text:='46'; //Eintragen eínes Basiswertes end; 3: begin RadioButton1.Enabled:=true; RadioButton2.Enabled:=true; RadioButton3.Enabled:=true; RadioButton4.Enabled:=false; RadioButton1.Checked:=true; StatusBar1.Panels[1].Text:='Astronomische Einheiten'; StatusBar1.Panels[3].Text:='m'; Label2.Caption:='in Astronomische Einheiten an!'; Label3.Caption:='m'; Edit1.Text:='13'; //Eintragen eínes Basiswertes end; end; end; procedure TForm1.RadioButton1Click(Sender: TObject); begin StatusBar1.Panels[3].Text:='km'; Label3.Caption:='km'; end; procedure TForm1.RadioButton2Click(Sender: TObject); begin StatusBar1.Panels[3].Text:='Parsec'; Label3.Caption:='Parsec'; end; procedure TForm1.RadioButton3Click(Sender: TObject); begin StatusBar1.Panels[3].Text:='Lichtjahre'; Label3.Caption:='Lichtjahre'; end; procedure TForm1.RadioButton4Click(Sender: TObject); begin StatusBar1.Panels[3].Text:='Astronomische Einheiten'; Label3.Caption:='Astronomische Einheiten'; end; procedure TForm1.Button1Click(Sender: TObject); const parsec_zu_lichtjahr=3.26; parsec_zu_ae=206000; parsec_zu_m=3.00857E16; lichtjahre_zu_meter=9.461E15; astronomische_einheiten_zu_meter=300; mittleres_jahr=365.25; var eingabe:extended; ausgabe:extended; begin eingabe:=StrToFloat(Edit1.Text); case RadioGroup1.ItemIndex of 0: begin if RadioButton2.Checked=true then begin ausgabe:=eingabe/parsec_zu_m; end; if RadioButton3.Checked=true then begin ausgabe:=eingabe/lichtjahre_zu_meter; end; if RadioButton4.Checked=true then begin ausgabe:=eingabe/astronomische_einheiten_zu_meter; end; end;//end of branch 0 1: begin if RadioButton1.Checked=true then begin ausgabe:=eingabe*parsec_zu_m; end; if RadioButton3.Checked=true then begin ausgabe:=eingabe*parsec_zu_lichtjahr; end; if RadioButton4.Checked=true then begin ausgabe:=eingabe*parsec_zu_ae; end; end; 2: begin if RadioButton1.Checked=true then begin ausgabe:=eingabe*lichtjahre_zu_meter; end; if RadioButton2.Checked=true then begin ausgabe:=eingabe*parsec_zu_lichtjahr; end; if RadioButton4.Checked=true then begin //ausgabe:=???; end; end; 3: begin if RadioButton1.Checked=true then begin //ausgabe:=???; end; if RadioButton2.Checked=true then begin //ausgabe:=???; end; if RadioButton3.Checked=true then begin //ausgabe:=???; end; end; end;//end of case Edit2.Text:=FloatToStrF(ausgabe,ffFixed,20,3); end; procedure TForm1.BitBtn1Click(Sender: TObject); begin Edit2.Text:=''; end; end.