Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls;
- type
- TForm1 = class(TForm)
- RadioGroup1: TRadioGroup;
- RadioGroup2: TRadioGroup;
- RadioGroup3: TRadioGroup;
- Button1: TButton;
- ComboBox1: TComboBox;
- CheckBox1: TCheckBox;
- GroupBox1: TGroupBox;
- Label3: TLabel;
- Label1: TLabel;
- Label2: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Label10: TLabel;
- Button2: TButton;
- Label11: TLabel;
- Label12: TLabel;
- Button3: TButton;
- Panel1: TPanel;
- procedure RadioGroup2Click(Sender: TObject);
- procedure RadioGroup3Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure RadioGroup1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- ce, ce2, km:real;
- p,x,t,s:string;
- //Ovo su ti promenljive u zadatku
- implementation
- {$R *.dfm}
- procedure TForm1.RadioGroup2Click(Sender: TObject);
- begin
- //Radio grupa za ibarsku magistralu
- RadioGroup3.ItemIndex:=-1;
- Case RadioGroup2.ItemIndex of
- 0:Label1.Caption:='Zvecan';
- 1:Label1.Caption:='Socanica';
- 2:Label1.Caption:='Leposavic';
- 3:Label1.Caption:='Lesak';
- 4:Label1.Caption:='Raska';
- 5:Label1.Caption:='Usce';
- 6:Label1.Caption:='Kraljevo';
- 7:Label1.Caption:='Mrcajevci';
- 8:Label1.Caption:='Gornji Milanovac';
- 9:Label1.Caption:='Stepojevac';
- 10:Label1.Caption:='Beograd';
- end;
- end;
- procedure TForm1.RadioGroup3Click(Sender: TObject);
- begin
- //Ovo ti je radiogroup za autoput..
- RadioGroup2.ItemIndex:=-1;
- Case RadioGroup3.ItemIndex of
- 0:Label1.Caption:='Zvecan';
- 1:Label1.Caption:='Socanica';
- 2:Label1.Caption:='Leposavic';
- 3:Label1.Caption:='Lesak';
- 4:Label1.Caption:='Raska';
- 5:Label1.Caption:='Usce';
- 6:Label1.Caption:='Kraljevo';
- 7:Label1.Caption:='Kragujevac';
- 8:Label1.Caption:='Smederevo';
- 9:Label1.Caption:='Beograd';
- end;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- var
- sediste:integer;
- sediste2:string;
- begin
- //Ovo ti je glavno dugme za program :D Sve resavas sa ovim.
- If RadioGroup1.ItemIndex=-1 then
- Label3.Caption:='Niste izabrali prevoznika!'
- else
- GroupBox1.Visible:=true;
- begin
- Label3.Caption:='';
- Case RadioGroup1.ItemIndex of
- //Ovo ti je za izabranog prevoznika
- 0:begin
- Label7.Caption:='Kolasin prevoz';
- Case RadioGroup2.ItemIndex of
- //Ovo ti je za izabrani put, trenutno za Ibarsku Magistralu
- 0:begin
- ce:=40;
- km:=3;
- end;
- 1:begin
- ce:=140;
- km:=26;
- end;
- 2:begin
- ce:=200;
- km:=36;
- end;
- 3:begin
- ce:=220;
- km:=45;
- end;
- 4:begin
- ce:=500;
- km:=62;
- end;
- 5:begin
- ce:=560;
- km:=75;
- end;
- 6:begin
- ce:=700;
- km:=150;
- end;
- 7:begin
- ce:=760;
- km:=160;
- end;
- 8:begin
- ce:=890;
- km:=210;
- end;
- 9:begin
- ce:=1100;
- km:=245;
- end;
- 10:begin
- ce:=1400;
- km:=349;
- end;
- end;
- Case RadioGroup3.ItemIndex of
- //Ovo su ti cene za autoput..
- 0:begin
- ce:=40;
- km:=3;
- end;
- 1:begin
- ce:=140;
- km:=26;
- end;
- 2:begin
- ce:=200;
- km:=36;
- end;
- 3:begin
- ce:=220;
- km:=45;
- end;
- 4:begin
- ce:=500;
- km:=62;
- end;
- 5:begin
- ce:=560;
- km:=75;
- end;
- 6:begin
- ce:=700;
- km:=150;
- end;
- 7:begin
- ce:=860;
- km:=175;
- end;
- 8:begin
- ce:=990;
- km:=260;
- end;
- 9:begin
- ce:=1440;
- km:=354;
- end;
- end;
- end;
- 1:begin
- Label7.Caption:='Kosmet prevoz';
- Case RadioGroup2.ItemIndex of
- //Ovo ti je za izabrani put, trenutno za Ibarsku Magistralu
- 0:begin
- ce:=45;
- km:=3;
- end;
- 1:begin
- ce:=130;
- km:=26;
- end;
- 2:begin
- ce:=210;
- km:=36;
- end;
- 3:begin
- ce:=230;
- km:=45;
- end;
- 4:begin
- ce:=510;
- km:=62;
- end;
- 5:begin
- ce:=550;
- km:=75;
- end;
- 6:begin
- ce:=690;
- km:=150;
- end;
- 7:begin
- ce:=740;
- km:=160;
- end;
- 8:begin
- ce:=870;
- km:=210;
- end;
- 9:begin
- ce:=1110;
- km:=245;
- end;
- 10:begin
- ce:=1420;
- km:=349;
- end;
- end;
- Case RadioGroup3.ItemIndex of
- //Ovo su ti cene za autoput..
- 0:begin
- ce:=50;
- km:=3;
- end;
- 1:begin
- ce:=130;
- km:=26;
- end;
- 2:begin
- ce:=180;
- km:=36;
- end;
- 3:begin
- ce:=200;
- km:=45;
- end;
- 4:begin
- ce:=480;
- km:=62;
- end;
- 5:begin
- ce:=540;
- km:=75;
- end;
- 6:begin
- ce:=680;
- km:=150;
- end;
- 7:begin
- ce:=870;
- km:=175;
- end;
- 8:begin
- ce:=970;
- km:=260;
- end;
- 9:begin
- ce:=1410;
- km:=354;
- end;
- end;
- end;
- 2:begin
- Label7.Caption:='Kavim Raska';
- Case RadioGroup2.ItemIndex of
- //Ovo ti je za izabrani put, trenutno za Ibarsku Magistralu
- 0:begin
- ce:=45;
- km:=3;
- end;
- 1:begin
- ce:=130;
- km:=26;
- end;
- 2:begin
- ce:=195;
- km:=36;
- end;
- 3:begin
- ce:=205;
- km:=45;
- end;
- 4:begin
- ce:=505;
- km:=62;
- end;
- 5:begin
- ce:=545;
- km:=75;
- end;
- 6:begin
- ce:=680;
- km:=150;
- end;
- 7:begin
- ce:=780;
- km:=160;
- end;
- 8:begin
- ce:=900;
- km:=210;
- end;
- 9:begin
- ce:=1120;
- km:=245;
- end;
- 10:begin
- ce:=1380;
- km:=349;
- end;
- end;
- Case RadioGroup3.ItemIndex of
- //Ovo su ti cene za autoput..
- 0:begin
- ce:=45;
- km:=3;
- end;
- 1:begin
- ce:=130;
- km:=26;
- end;
- 2:begin
- ce:=180;
- km:=36;
- end;
- 3:begin
- ce:=200;
- km:=45;
- end;
- 4:begin
- ce:=510;
- km:=62;
- end;
- 5:begin
- ce:=550;
- km:=75;
- end;
- 6:begin
- ce:=690;
- km:=150;
- end;
- 7:begin
- ce:=840;
- km:=175;
- end;
- 8:begin
- ce:=970;
- km:=260;
- end;
- 9:begin
- ce:=1450;
- km:=354;
- end;
- end;
- end;
- end;
- sediste:=random(50);
- sediste:=sediste+2;
- Str(sediste:2, sediste2);
- Label10.Caption:=sediste2;
- Str(km:3:0, p);
- Label12.Caption:=p;
- if ComboBox1.ItemIndex=-1 then
- ce2:=ce
- else
- begin
- Case ComboBox1.ItemIndex of
- 0:begin
- ce2:=ce;
- end;
- 1:begin
- ce2:=ce*0.70;
- end;
- 2:begin
- ce2:=ce*0.80;
- end;
- 3:begin
- ce2:=ce*0;
- end;
- end;
- end;
- str(ce2:5:1, x);
- Label2.Caption:=x;
- end;
- end;
- procedure TForm1.CheckBox1Click(Sender: TObject);
- begin
- //Ovo ti oznacava autoput, da li se ide preko njega ili ne :D
- If CheckBox1.Checked=true then
- RadioGroup3.Visible:=true
- else
- RadioGroup3.Visible:=false;
- end;
- procedure TForm1.RadioGroup1Click(Sender: TObject);
- begin
- //Ovo ti je kad se izabere prevoznik, da se u Labeli8 pojavi ime prevoznika
- Case RadioGroup1.ItemIndex of
- 0:Label8.Caption:='Kolasin prevoz';
- 1:Label8.Caption:='Kosmet prevoz';
- 2:Label8.Caption:='Kavim Raska';
- end;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- //Ovo ti ponistava sve, vraca na pocetnu vrednost
- RadioGroup1.ItemIndex:=-1;
- ComboBox1.ItemIndex:=-1;
- CheckBox1.Checked:=false;
- RadioGroup2.ItemIndex:=-1;
- RadioGroup3.ItemIndex:=-1;
- GroupBox1.Visible:=false;
- Label8.Caption:='';
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- //Ovim zatvaras SVEEEEEEEEEEEEE :D
- close;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement