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, jpeg, ExtCtrls, StdCtrls;
- type
- TForm1 = class(TForm)
- ComboBox1: TComboBox;
- RadioGroup1: TRadioGroup;
- RadioGroup2: TRadioGroup;
- RadioGroup3: TRadioGroup;
- RadioGroup4: TRadioGroup;
- GroupBox1: TGroupBox;
- Image1: TImage;
- Image2: TImage;
- Image3: TImage;
- Image4: TImage;
- ComboBox2: TComboBox;
- RadioGroup5: TRadioGroup;
- Button1: TButton;
- GroupBox2: TGroupBox;
- Image5: TImage;
- Button2: TButton;
- Label2: TLabel;
- Image6: TImage;
- Image7: TImage;
- Image8: TImage;
- Label3: TLabel;
- Label1: TLabel;
- procedure ComboBox1Change(Sender: TObject);
- procedure RadioGroup2Click(Sender: TObject);
- procedure ComboBox2Change(Sender: TObject);
- procedure RadioGroup3Click(Sender: TObject);
- procedure RadioGroup1Click(Sender: TObject);
- procedure RadioGroup4Click(Sender: TObject);
- procedure RadioGroup5Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- zv,gr,so,lp,le,ru,ra,se,us,uss,kv,kg,ba,sm,mr,pr,gm,lji,st,la,bg,os,kl,go,si:real;
- zv1,gr1,so1,lp1,le1,ru1,ra1,se1,us1,uss1,kv1,kg1,ba1,sm1,mr1,pr1,gm1,lji1,st1,la1,bg1,os1,kl1,go1,si1:real;
- x:string;
- i:integer;
- implementation
- {$R *.dfm}
- procedure TForm1.ComboBox1Change(Sender: TObject);
- begin
- Case ComboBox1.ItemIndex of
- 0: begin
- Image1.Visible:=false;
- Image2.Visible:=true;
- Image3.Visible:=false;
- Image4.Visible:=false;
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=false;
- RadioGroup1.Visible:=true;
- RadioGroup2.Visible:=true;
- RadioGroup3.Visible:=false;
- RadioGroup4.Visible:=false;
- RadioGroup5.Visible:=false;
- ComboBox2.Top:=144;
- RadioGroup1.ItemIndex:=-1;
- RadioGroup2.ItemIndex:=-1;
- RadioGroup3.ItemIndex:=-1;
- RadioGroup4.ItemIndex:=-1;
- RadioGroup5.ItemIndex:=-1;
- Label1.Visible:=false;
- Label2.Visible:=false;
- Label3.Visible:=false;
- case RadioGroup2.ItemIndex of
- 0: begin
- zv:=50;
- end;
- 1: begin
- gr:=70;
- end;
- 2: begin
- so:=110;
- end;
- 3: begin
- lp:=200;
- end;
- 4: begin
- le:=240;
- end;
- 5: begin
- ru:=270;
- end;
- 6: begin
- ra:=300;
- end;
- 7: Begin
- se:=350;
- end;
- 8: begin
- us:=420;
- end;
- 9: Begin
- uss:=450;
- end;
- 10: begin
- kv:=700;
- end;
- end;
- Case RadioGroup3.ItemIndex of
- 0: begin
- kg:=1600;
- end;
- 1:begin
- ba:=1750;
- end;
- 2:begin
- sm:=2100;
- end;
- 3:begin
- bg:=2500;
- end;
- end;
- case RadioGroup4.ItemIndex of
- 0:begin
- mr:=800;
- end;
- 1:begin
- pr:=900;
- end;
- 2:begin
- gm:=1050;
- end;
- 3:begin
- lji:=1150;
- end;
- 4:begin
- st:=1750;
- end;
- 5:begin
- la:=2000;
- end;
- 6:begin
- bg:=2350;
- end;
- end;
- end;
- 1: begin
- Image1.Visible:=true;
- Image2.Visible:=false;
- Image3.Visible:=false;
- Image4.Visible:=false;
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=false;
- RadioGroup1.Visible:=true;
- RadioGroup2.Visible:=true;
- RadioGroup3.Visible:=false;
- RadioGroup4.Visible:=false;
- RadioGroup5.Visible:=false;
- ComboBox2.Top:=144;
- RadioGroup1.ItemIndex:=-1;
- RadioGroup2.ItemIndex:=-1;
- RadioGroup3.ItemIndex:=-1;
- RadioGroup4.ItemIndex:=-1;
- RadioGroup5.ItemIndex:=-1;
- Label1.Visible:=false;
- Label2.Visible:=false;
- Label3.Visible:=false;
- Case ComboBox1.ItemIndex of
- 0: begin
- zv:=45;
- end;
- 1: begin
- gr:=60;
- end;
- 2: begin
- so:=100;
- end;
- 3: begin
- lp:=190;
- end;
- 4: begin
- le:=230;
- end;
- 5: begin
- ru:=260;
- end;
- 6: begin
- ra:=290;
- end;
- 7: Begin
- se:=340;
- end;
- 8: begin
- us:=410;
- end;
- 9: Begin
- uss:=440;
- end;
- 10: begin
- kv:=700;
- end;
- end;
- end;
- 2: begin
- Image1.Visible:=false;
- Image2.Visible:=false;
- Image3.Visible:=true;
- Image4.Visible:=false;
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=false;
- RadioGroup1.Visible:=true;
- RadioGroup2.Visible:=true;
- RadioGroup3.Visible:=false;
- RadioGroup4.Visible:=false;
- RadioGroup5.Visible:=false;
- ComboBox2.Top:=144;
- RadioGroup1.ItemIndex:=-1;
- RadioGroup2.ItemIndex:=-1;
- RadioGroup3.ItemIndex:=-1;
- RadioGroup4.ItemIndex:=-1;
- RadioGroup5.ItemIndex:=-1;
- Label1.Visible:=false;
- Label2.Visible:=false;
- Label3.Visible:=false;
- case RadioGroup2.ItemIndex of
- 0: begin
- zv:=40;
- end;
- 1: begin
- gr:=50;
- end;
- 2: begin
- so:=90;
- end;
- 3: begin
- lp:=180;
- end;
- 4: begin
- le:=220;
- end;
- 5: begin
- ru:=250;
- end;
- 6: begin
- ra:=280;
- end;
- 7: Begin
- se:=330;
- end;
- 8: begin
- us:=400;
- end;
- 9: Begin
- uss:=430;
- end;
- 10: begin
- kv:=680;
- end;
- end;
- Case RadioGroup3.ItemIndex of
- 0: begin
- kg:=1600;
- end;
- 1:begin
- ba:=1750;
- end;
- 2:begin
- sm:=2100;
- end;
- 3:begin
- bg:=2500;
- end;
- end;
- case RadioGroup4.ItemIndex of
- 0:begin
- mr:=800;
- end;
- 1:begin
- pr:=900;
- end;
- 2:begin
- gm:=1050;
- end;
- 3:begin
- lji:=1150;
- end;
- 4:begin
- st:=1750;
- end;
- 5:begin
- la:=2000;
- end;
- 6:begin
- bg:=2350;
- end;
- end;
- end;
- 3: begin
- Image1.Visible:=false;
- Image2.Visible:=false;
- Image3.Visible:=false;
- Image4.Visible:=true;
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=false;
- RadioGroup1.Visible:=false;
- RadioGroup2.Visible:=false;
- RadioGroup3.Visible:=false;
- RadioGroup4.Visible:=false;
- RadioGroup5.Visible:=true;
- ComboBox2.Top:=64;
- RadioGroup5.Top:=96;
- RadioGroup1.ItemIndex:=-1;
- RadioGroup2.ItemIndex:=-1;
- RadioGroup3.ItemIndex:=-1;
- RadioGroup4.ItemIndex:=-1;
- RadioGroup5.ItemIndex:=-1;
- Label1.Visible:=false;
- Label2.Visible:=false;
- Label3.Visible:=false;
- case RadioGroup5.ItemIndex of
- 0: begin
- os:=390;
- end;
- 1: begin
- kl:=425;
- end;
- 2: begin
- go:=550;
- end;
- 3: begin
- si:=700;
- end;
- end;
- end;
- end;
- end;
- procedure TForm1.RadioGroup2Click(Sender: TObject);
- begin
- case RadioGroup2.ItemIndex of
- 0: Label1.Caption:='Zvecan.';
- 1: Label1.Caption:='Grabovac.';
- 2: Label1.Caption:='Socanica.';
- 3: Label1.Caption:='Leposavic.';
- 4: Label1.Caption:='Lesak.';
- 5: Label1.Caption:='Rudnica.';
- 6: Label1.Caption:='Raska.';
- 7: Label1.Caption:='Selevac.';
- 8: Label1.Caption:='Usce.';
- 9: Label1.Caption:='Usce stanica.';
- 10: Label1.Caption:='Kraljevo.';
- end;
- end;
- procedure TForm1.ComboBox2Change(Sender: TObject);
- begin
- case ComboBox2.ItemIndex of
- 0: begin
- zv1:=zv;
- gr1:=gr;
- so1:=so;
- lp1:=lp;
- le1:=le;
- ru1:=ru;
- ra1:=ra;
- se1:=se;
- us1:=us;
- uss1:=uss;
- kv1:=kv;
- kg1:=kg;
- ba1:=ba;
- sm1:=sm;
- bg1:=bg;
- mr1:=mr;
- pr1:=pr;
- gm1:=gm;
- lji1:=lji;
- st1:=st;
- la1:=la;
- bg1:=bg;
- end;
- 1: begin
- zv1:=zv*0.70;
- gr1:=gr*0.70;
- so1:=so*0.70;
- lp1:=lp*0.70;
- le1:=le*0.70;
- ru1:=ru*0.70;
- ra1:=ra*0.70;
- se1:=se*0.70;
- us1:=us*0.70;
- uss1:=uss*0.70;
- kv1:=kv*0.70;
- kg1:=kg*0.70;
- ba1:=ba*0.70;
- sm1:=sm*0.70;
- bg1:=bg*0.70;
- mr1:=mr*0.70;
- pr1:=pr*0.70;
- gm1:=gm*0.70;
- lji1:=lji*0.70;
- st1:=st*0.70;
- la1:=la*0.70;
- bg1:=bg*0.70;
- end;
- 2: begin
- zv1:=zv*0.70;
- gr1:=gr*0.70;
- so1:=so*0.70;
- lp1:=lp*0.70;
- le1:=le*0.70;
- ru1:=ru*0.70;
- ra1:=ra*0.70;
- se1:=se*0.70;
- us1:=us*0.70;
- uss1:=uss*0.70;
- kv1:=kv*0.70;
- kg1:=kg*0.70;
- ba1:=ba*0.70;
- sm1:=sm*0.70;
- bg1:=bg*0.70;
- mr1:=mr*0.70;
- pr1:=pr*0.70;
- gm1:=gm*0.70;
- lji1:=lji*0.70;
- st1:=st*0.70;
- la1:=la*0.70;
- bg1:=bg*0.70;
- end;
- 3: begin
- zv1:=zv*0.80;
- gr1:=gr*0.80;
- so1:=so*0.80;
- lp1:=lp*0.80;
- le1:=le*0.80;
- ru1:=ru*0.80;
- ra1:=ra*0.80;
- se1:=se*0.80;
- us1:=us*0.80;
- uss1:=uss*0.80;
- kv1:=kv*0.80;
- kg1:=kg*0.80;
- ba1:=ba*0.80;
- sm1:=sm*0.80;
- bg1:=bg*0.80;
- mr1:=mr*0.80;
- pr1:=pr*0.80;
- gm1:=gm*0.80;
- lji1:=lji*0.80;
- st1:=st*0.80;
- la1:=la*0.80;
- bg1:=bg*0.80;
- end;
- 4: begin
- zv1:=zv*0;
- gr1:=gr*0;
- so1:=so*0;
- lp1:=lp*0;
- le1:=le*0;
- ru1:=ru*0;
- ra1:=ra*0;
- se1:=se*0;
- us1:=us*0;
- uss1:=uss*0;
- kv1:=kv*0;
- kg1:=kg*0;
- ba1:=ba*0;
- sm1:=sm*0;
- bg1:=bg*0;
- mr1:=mr*0;
- pr1:=pr*0;
- gm1:=gm*0;
- lji1:=lji*0;
- st1:=st*0;
- la1:=la*0;
- bg1:=bg*0;
- end;
- end;
- end;
- procedure TForm1.RadioGroup3Click(Sender: TObject);
- begin
- case RadioGroup3.ItemIndex of
- 0: Label1.Caption:='Kragujevac.';
- 1: Label1.Caption:='Batocina.';
- 2: Label1.Caption:='Smederevo.';
- 3: Label1.Caption:='Beograd.';
- end;
- end;
- procedure TForm1.RadioGroup1Click(Sender: TObject);
- begin
- Case RadioGroup1.ItemIndex of
- 0: begin
- RadioGroup3.Visible:=true;
- RadioGroup4.Visible:=false;
- end;
- 1: begin
- RadioGroup3.Visible:=false;
- RadioGroup4.Visible:=true;
- end;
- end;
- end;
- procedure TForm1.RadioGroup4Click(Sender: TObject);
- begin
- begin
- case RadioGroup4.ItemIndex of
- 0: Label1.Caption:='Mrcajevci.';
- 1: Label1.Caption:='Preljina.';
- 2: Label1.Caption:='Gornji Milanovac.';
- 3: Label1.Caption:='Ljig.';
- 4: Label1.Caption:='Stepojevac.';
- 5: Label1.Caption:='Lazarevac.';
- 6: Label1.Caption:='Beograd.';
- end;
- end;
- end;
- procedure TForm1.RadioGroup5Click(Sender: TObject);
- begin
- case RadioGroup3.ItemIndex of
- 0: Label1.Caption:='Osojane.';
- 1: Label1.Caption:='Klina.';
- 2: Label1.Caption:='Gorazdevac.';
- 3: Label1.Caption:='Siga, Brestovik.';
- end;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- ComboBox1.ItemIndex:=-1;
- ComboBox1.Text:='Odaberite prevoznika:';
- Image1.Visible:=false;
- Image2.Visible:=false;
- Image3.Visible:=false;
- Image4.Visible:=false;
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=false;
- ComboBox2.ItemIndex:=-1;
- ComboBox2.Text:='Odaberite popust:';
- ComboBox2.Top:=144;
- RadioGroup1.ItemIndex:=-1;
- RadioGroup2.ItemIndex:=-1;
- RadioGroup3.ItemIndex:=-1;
- RadioGroup4.ItemIndex:=-1;
- RadioGroup5.ItemIndex:=-1;
- RadioGroup2.Visible:=false;
- RadioGroup3.Visible:=false;
- RadioGroup4.Visible:=false;
- RadioGroup5.Visible:=false;
- Label1.Visible:=false;
- Label2.Visible:=false;
- Label3.Visible:=false;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- var
- s:string;
- begin
- i:=random(51);
- i:=i+1;
- if ComboBox2.ItemIndex=-1 then
- ComboBox2.SetFocus;
- if ComboBox1.ItemIndex=-1 then
- ComboBox1.SetFocus;
- if RadioGroup2.ItemIndex=-1 then
- RadioGroup2.SetFocus;
- Str(i, s);
- Label3.Caption:=s;
- Label1.Visible:=true;
- Label2.Visible:=true;
- Label3.Visible:=true;
- case ComboBox1.ItemIndex of
- 0: begin
- Image5.Visible:=false;
- Image6.Visible:=true;
- Image7.Visible:=false;
- Image8.Visible:=false;
- Label1.Visible:=true;
- end;
- 1: begin
- Image5.Visible:=true;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=false;
- Label1.Visible:=true;
- Label1.Visible:=true;
- end;
- 2: begin
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=true;
- Image8.Visible:=false;
- Label1.Visible:=true;
- end;
- 3: begin
- Image5.Visible:=false;
- Image6.Visible:=false;
- Image7.Visible:=false;
- Image8.Visible:=true;
- Label1.Visible:=true;
- end;
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement