Advertisement
MixyPro

Stanica

Jan 4th, 2015
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 10.52 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, jpeg, ExtCtrls, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     ComboBox1: TComboBox;
  12.     RadioGroup1: TRadioGroup;
  13.     RadioGroup2: TRadioGroup;
  14.     RadioGroup3: TRadioGroup;
  15.     RadioGroup4: TRadioGroup;
  16.     GroupBox1: TGroupBox;
  17.     Image1: TImage;
  18.     Image2: TImage;
  19.     Image3: TImage;
  20.     Image4: TImage;
  21.     ComboBox2: TComboBox;
  22.     RadioGroup5: TRadioGroup;
  23.     Button1: TButton;
  24.     GroupBox2: TGroupBox;
  25.     Image5: TImage;
  26.     Button2: TButton;
  27.     Label2: TLabel;
  28.     Image6: TImage;
  29.     Image7: TImage;
  30.     Image8: TImage;
  31.     Label3: TLabel;
  32.     Label1: TLabel;
  33.     procedure ComboBox1Change(Sender: TObject);
  34.     procedure RadioGroup2Click(Sender: TObject);
  35.     procedure ComboBox2Change(Sender: TObject);
  36.     procedure RadioGroup3Click(Sender: TObject);
  37.     procedure RadioGroup1Click(Sender: TObject);
  38.     procedure RadioGroup4Click(Sender: TObject);
  39.     procedure RadioGroup5Click(Sender: TObject);
  40.     procedure Button1Click(Sender: TObject);
  41.     procedure Button2Click(Sender: TObject);
  42.   private
  43.     { Private declarations }
  44.   public
  45.     { Public declarations }
  46.   end;
  47.  
  48. var
  49.   Form1: TForm1;
  50. 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;
  51. 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;
  52. x:string;
  53. i:integer;
  54. implementation
  55.  
  56. {$R *.dfm}
  57.  
  58. procedure TForm1.ComboBox1Change(Sender: TObject);
  59. begin
  60. Case ComboBox1.ItemIndex of
  61. 0: begin
  62. Image1.Visible:=false;
  63. Image2.Visible:=true;
  64. Image3.Visible:=false;
  65. Image4.Visible:=false;
  66. Image5.Visible:=false;
  67. Image6.Visible:=false;
  68. Image7.Visible:=false;
  69. Image8.Visible:=false;
  70. RadioGroup1.Visible:=true;
  71. RadioGroup2.Visible:=true;
  72. RadioGroup3.Visible:=false;
  73. RadioGroup4.Visible:=false;
  74. RadioGroup5.Visible:=false;
  75. ComboBox2.Top:=144;
  76. RadioGroup1.ItemIndex:=-1;
  77. RadioGroup2.ItemIndex:=-1;
  78. RadioGroup3.ItemIndex:=-1;
  79. RadioGroup4.ItemIndex:=-1;
  80. RadioGroup5.ItemIndex:=-1;  
  81. Label1.Visible:=false;
  82. Label2.Visible:=false;
  83. Label3.Visible:=false;
  84. case RadioGroup2.ItemIndex of
  85. 0: begin
  86. zv:=50;
  87. end;
  88. 1: begin
  89. gr:=70;
  90. end;
  91. 2: begin
  92. so:=110;
  93. end;
  94. 3: begin
  95. lp:=200;
  96. end;
  97. 4: begin
  98. le:=240;
  99. end;
  100. 5: begin
  101. ru:=270;
  102. end;
  103. 6: begin
  104. ra:=300;
  105. end;
  106. 7: Begin
  107. se:=350;
  108. end;
  109. 8: begin
  110. us:=420;
  111. end;
  112. 9: Begin
  113. uss:=450;
  114. end;
  115. 10: begin
  116. kv:=700;
  117. end;
  118. end;
  119. Case RadioGroup3.ItemIndex of
  120. 0: begin
  121. kg:=1600;
  122. end;
  123. 1:begin
  124. ba:=1750;
  125. end;
  126. 2:begin
  127. sm:=2100;
  128. end;
  129. 3:begin
  130. bg:=2500;
  131. end;
  132. end;
  133. case RadioGroup4.ItemIndex of
  134. 0:begin
  135. mr:=800;
  136. end;
  137. 1:begin
  138. pr:=900;
  139. end;
  140. 2:begin
  141. gm:=1050;
  142. end;
  143. 3:begin
  144. lji:=1150;
  145. end;
  146. 4:begin
  147. st:=1750;
  148. end;
  149. 5:begin
  150. la:=2000;
  151. end;
  152. 6:begin
  153. bg:=2350;
  154. end;
  155. end;
  156. end;
  157. 1: begin
  158. Image1.Visible:=true;
  159. Image2.Visible:=false;
  160. Image3.Visible:=false;
  161. Image4.Visible:=false;
  162. Image5.Visible:=false;
  163. Image6.Visible:=false;
  164. Image7.Visible:=false;
  165. Image8.Visible:=false;
  166. RadioGroup1.Visible:=true;
  167. RadioGroup2.Visible:=true;
  168. RadioGroup3.Visible:=false;
  169. RadioGroup4.Visible:=false;
  170. RadioGroup5.Visible:=false;
  171. ComboBox2.Top:=144;      
  172. RadioGroup1.ItemIndex:=-1;
  173. RadioGroup2.ItemIndex:=-1;
  174. RadioGroup3.ItemIndex:=-1;
  175. RadioGroup4.ItemIndex:=-1;
  176. RadioGroup5.ItemIndex:=-1;                    
  177. Label1.Visible:=false;
  178. Label2.Visible:=false;
  179. Label3.Visible:=false;
  180. Case ComboBox1.ItemIndex of
  181. 0: begin
  182. zv:=45;
  183. end;
  184. 1: begin
  185. gr:=60;
  186. end;
  187. 2: begin
  188. so:=100;
  189. end;
  190. 3: begin
  191. lp:=190;
  192. end;
  193. 4: begin
  194. le:=230;
  195. end;
  196. 5: begin
  197. ru:=260;
  198. end;
  199. 6: begin
  200. ra:=290;
  201. end;
  202. 7: Begin
  203. se:=340;
  204. end;
  205. 8: begin
  206. us:=410;
  207. end;
  208. 9: Begin
  209. uss:=440;
  210. end;
  211. 10: begin
  212. kv:=700;
  213. end;
  214. end;
  215. end;
  216. 2: begin
  217. Image1.Visible:=false;
  218. Image2.Visible:=false;
  219. Image3.Visible:=true;
  220. Image4.Visible:=false;
  221. Image5.Visible:=false;
  222. Image6.Visible:=false;
  223. Image7.Visible:=false;
  224. Image8.Visible:=false;
  225. RadioGroup1.Visible:=true;
  226. RadioGroup2.Visible:=true;
  227. RadioGroup3.Visible:=false;
  228. RadioGroup4.Visible:=false;
  229. RadioGroup5.Visible:=false;
  230. ComboBox2.Top:=144;  
  231. RadioGroup1.ItemIndex:=-1;
  232. RadioGroup2.ItemIndex:=-1;
  233. RadioGroup3.ItemIndex:=-1;
  234. RadioGroup4.ItemIndex:=-1;
  235. RadioGroup5.ItemIndex:=-1;
  236. Label1.Visible:=false;
  237. Label2.Visible:=false;
  238. Label3.Visible:=false;
  239. case RadioGroup2.ItemIndex of
  240. 0: begin
  241. zv:=40;
  242. end;
  243. 1: begin
  244. gr:=50;
  245. end;
  246. 2: begin
  247. so:=90;
  248. end;
  249. 3: begin
  250. lp:=180;
  251. end;
  252. 4: begin
  253. le:=220;
  254. end;
  255. 5: begin
  256. ru:=250;
  257. end;
  258. 6: begin
  259. ra:=280;
  260. end;
  261. 7: Begin
  262. se:=330;
  263. end;
  264. 8: begin
  265. us:=400;
  266. end;
  267. 9: Begin
  268. uss:=430;
  269. end;
  270. 10: begin
  271. kv:=680;
  272. end;
  273. end;
  274. Case RadioGroup3.ItemIndex of
  275. 0: begin
  276. kg:=1600;
  277. end;
  278. 1:begin
  279. ba:=1750;
  280. end;
  281. 2:begin
  282. sm:=2100;
  283. end;
  284. 3:begin
  285. bg:=2500;
  286. end;
  287. end;
  288. case RadioGroup4.ItemIndex of
  289. 0:begin
  290. mr:=800;
  291. end;
  292. 1:begin
  293. pr:=900;
  294. end;
  295. 2:begin
  296. gm:=1050;
  297. end;
  298. 3:begin
  299. lji:=1150;
  300. end;
  301. 4:begin
  302. st:=1750;
  303. end;
  304. 5:begin
  305. la:=2000;
  306. end;
  307. 6:begin
  308. bg:=2350;
  309. end;
  310. end;
  311. end;
  312. 3: begin
  313. Image1.Visible:=false;
  314. Image2.Visible:=false;
  315. Image3.Visible:=false;
  316. Image4.Visible:=true;
  317. Image5.Visible:=false;
  318. Image6.Visible:=false;
  319. Image7.Visible:=false;
  320. Image8.Visible:=false;
  321. RadioGroup1.Visible:=false;
  322. RadioGroup2.Visible:=false;
  323. RadioGroup3.Visible:=false;
  324. RadioGroup4.Visible:=false;
  325. RadioGroup5.Visible:=true;
  326. ComboBox2.Top:=64;
  327. RadioGroup5.Top:=96;
  328. RadioGroup1.ItemIndex:=-1;
  329. RadioGroup2.ItemIndex:=-1;
  330. RadioGroup3.ItemIndex:=-1;
  331. RadioGroup4.ItemIndex:=-1;
  332. RadioGroup5.ItemIndex:=-1;      
  333. Label1.Visible:=false;
  334. Label2.Visible:=false;
  335. Label3.Visible:=false;
  336. case RadioGroup5.ItemIndex of
  337. 0: begin
  338. os:=390;
  339. end;
  340. 1: begin
  341. kl:=425;
  342. end;
  343. 2: begin
  344. go:=550;
  345. end;
  346. 3: begin
  347. si:=700;
  348. end;
  349. end;
  350. end;
  351. end;
  352. end;
  353. procedure TForm1.RadioGroup2Click(Sender: TObject);
  354. begin
  355. case RadioGroup2.ItemIndex of
  356. 0: Label1.Caption:='Zvecan.';
  357. 1: Label1.Caption:='Grabovac.';
  358. 2: Label1.Caption:='Socanica.';
  359. 3: Label1.Caption:='Leposavic.';
  360. 4: Label1.Caption:='Lesak.';
  361. 5: Label1.Caption:='Rudnica.';
  362. 6: Label1.Caption:='Raska.';
  363. 7: Label1.Caption:='Selevac.';
  364. 8: Label1.Caption:='Usce.';
  365. 9: Label1.Caption:='Usce stanica.';
  366. 10: Label1.Caption:='Kraljevo.';
  367. end;
  368. end;
  369. procedure TForm1.ComboBox2Change(Sender: TObject);
  370. begin
  371. case ComboBox2.ItemIndex of
  372. 0: begin
  373. zv1:=zv;
  374. gr1:=gr;
  375. so1:=so;
  376. lp1:=lp;
  377. le1:=le;
  378. ru1:=ru;
  379. ra1:=ra;
  380. se1:=se;
  381. us1:=us;
  382. uss1:=uss;
  383. kv1:=kv;
  384. kg1:=kg;
  385. ba1:=ba;
  386. sm1:=sm;
  387. bg1:=bg;
  388. mr1:=mr;
  389. pr1:=pr;
  390. gm1:=gm;
  391. lji1:=lji;
  392. st1:=st;
  393. la1:=la;
  394. bg1:=bg;
  395. end;
  396. 1: begin
  397. zv1:=zv*0.70;
  398. gr1:=gr*0.70;
  399. so1:=so*0.70;
  400. lp1:=lp*0.70;
  401. le1:=le*0.70;
  402. ru1:=ru*0.70;
  403. ra1:=ra*0.70;
  404. se1:=se*0.70;
  405. us1:=us*0.70;
  406. uss1:=uss*0.70;
  407. kv1:=kv*0.70;
  408. kg1:=kg*0.70;
  409. ba1:=ba*0.70;
  410. sm1:=sm*0.70;
  411. bg1:=bg*0.70;
  412. mr1:=mr*0.70;
  413. pr1:=pr*0.70;
  414. gm1:=gm*0.70;
  415. lji1:=lji*0.70;
  416. st1:=st*0.70;
  417. la1:=la*0.70;
  418. bg1:=bg*0.70;
  419. end;
  420. 2: begin
  421. zv1:=zv*0.70;
  422. gr1:=gr*0.70;
  423. so1:=so*0.70;
  424. lp1:=lp*0.70;
  425. le1:=le*0.70;
  426. ru1:=ru*0.70;
  427. ra1:=ra*0.70;
  428. se1:=se*0.70;
  429. us1:=us*0.70;
  430. uss1:=uss*0.70;
  431. kv1:=kv*0.70;
  432. kg1:=kg*0.70;
  433. ba1:=ba*0.70;
  434. sm1:=sm*0.70;
  435. bg1:=bg*0.70;
  436. mr1:=mr*0.70;
  437. pr1:=pr*0.70;
  438. gm1:=gm*0.70;
  439. lji1:=lji*0.70;
  440. st1:=st*0.70;
  441. la1:=la*0.70;
  442. bg1:=bg*0.70;
  443. end;
  444. 3: begin
  445. zv1:=zv*0.80;
  446. gr1:=gr*0.80;
  447. so1:=so*0.80;
  448. lp1:=lp*0.80;
  449. le1:=le*0.80;
  450. ru1:=ru*0.80;
  451. ra1:=ra*0.80;
  452. se1:=se*0.80;
  453. us1:=us*0.80;
  454. uss1:=uss*0.80;
  455. kv1:=kv*0.80;
  456. kg1:=kg*0.80;
  457. ba1:=ba*0.80;
  458. sm1:=sm*0.80;
  459. bg1:=bg*0.80;
  460. mr1:=mr*0.80;
  461. pr1:=pr*0.80;
  462. gm1:=gm*0.80;
  463. lji1:=lji*0.80;
  464. st1:=st*0.80;
  465. la1:=la*0.80;
  466. bg1:=bg*0.80;
  467. end;
  468. 4: begin
  469. zv1:=zv*0;
  470. gr1:=gr*0;
  471. so1:=so*0;
  472. lp1:=lp*0;
  473. le1:=le*0;
  474. ru1:=ru*0;
  475. ra1:=ra*0;
  476. se1:=se*0;
  477. us1:=us*0;
  478. uss1:=uss*0;
  479. kv1:=kv*0;
  480. kg1:=kg*0;
  481. ba1:=ba*0;
  482. sm1:=sm*0;
  483. bg1:=bg*0;
  484. mr1:=mr*0;
  485. pr1:=pr*0;
  486. gm1:=gm*0;
  487. lji1:=lji*0;
  488. st1:=st*0;
  489. la1:=la*0;
  490. bg1:=bg*0;
  491. end;
  492. end;
  493. end;
  494.  
  495. procedure TForm1.RadioGroup3Click(Sender: TObject);
  496. begin
  497. case RadioGroup3.ItemIndex of
  498. 0: Label1.Caption:='Kragujevac.';
  499. 1: Label1.Caption:='Batocina.';
  500. 2: Label1.Caption:='Smederevo.';
  501. 3: Label1.Caption:='Beograd.';
  502. end;
  503. end;
  504.  
  505. procedure TForm1.RadioGroup1Click(Sender: TObject);
  506. begin
  507. Case RadioGroup1.ItemIndex of
  508. 0: begin
  509. RadioGroup3.Visible:=true;
  510. RadioGroup4.Visible:=false;
  511. end;
  512. 1: begin
  513. RadioGroup3.Visible:=false;
  514. RadioGroup4.Visible:=true;
  515. end;
  516. end;
  517. end;
  518.  
  519. procedure TForm1.RadioGroup4Click(Sender: TObject);
  520. begin
  521. begin
  522. case RadioGroup4.ItemIndex of
  523. 0: Label1.Caption:='Mrcajevci.';
  524. 1: Label1.Caption:='Preljina.';
  525. 2: Label1.Caption:='Gornji Milanovac.';
  526. 3: Label1.Caption:='Ljig.';  
  527. 4: Label1.Caption:='Stepojevac.';
  528. 5: Label1.Caption:='Lazarevac.';
  529. 6: Label1.Caption:='Beograd.';
  530. end;
  531. end;
  532. end;
  533. procedure TForm1.RadioGroup5Click(Sender: TObject);
  534. begin
  535. case RadioGroup3.ItemIndex of
  536. 0: Label1.Caption:='Osojane.';
  537. 1: Label1.Caption:='Klina.';
  538. 2: Label1.Caption:='Gorazdevac.';
  539. 3: Label1.Caption:='Siga, Brestovik.';
  540. end;
  541. end;
  542.  
  543. procedure TForm1.Button1Click(Sender: TObject);
  544. begin
  545. ComboBox1.ItemIndex:=-1;
  546. ComboBox1.Text:='Odaberite prevoznika:';
  547. Image1.Visible:=false;
  548. Image2.Visible:=false;
  549. Image3.Visible:=false;
  550. Image4.Visible:=false;
  551. Image5.Visible:=false;
  552. Image6.Visible:=false;
  553. Image7.Visible:=false;
  554. Image8.Visible:=false;
  555. ComboBox2.ItemIndex:=-1;
  556. ComboBox2.Text:='Odaberite popust:';
  557. ComboBox2.Top:=144;
  558. RadioGroup1.ItemIndex:=-1;
  559. RadioGroup2.ItemIndex:=-1;
  560. RadioGroup3.ItemIndex:=-1;
  561. RadioGroup4.ItemIndex:=-1;
  562. RadioGroup5.ItemIndex:=-1;
  563. RadioGroup2.Visible:=false;
  564. RadioGroup3.Visible:=false;
  565. RadioGroup4.Visible:=false;
  566. RadioGroup5.Visible:=false;
  567. Label1.Visible:=false;
  568. Label2.Visible:=false;
  569. Label3.Visible:=false;
  570. end;
  571.  
  572. procedure TForm1.Button2Click(Sender: TObject);
  573. var
  574. s:string;
  575. begin
  576. i:=random(51);
  577. i:=i+1;
  578. if ComboBox2.ItemIndex=-1 then
  579. ComboBox2.SetFocus;
  580. if ComboBox1.ItemIndex=-1 then
  581. ComboBox1.SetFocus;
  582. if RadioGroup2.ItemIndex=-1 then
  583. RadioGroup2.SetFocus;
  584. Str(i, s);
  585. Label3.Caption:=s;
  586. Label1.Visible:=true;
  587. Label2.Visible:=true;
  588. Label3.Visible:=true;
  589. case ComboBox1.ItemIndex of
  590. 0: begin
  591. Image5.Visible:=false;
  592. Image6.Visible:=true;
  593. Image7.Visible:=false;
  594. Image8.Visible:=false;
  595. Label1.Visible:=true;
  596. end;
  597. 1: begin
  598. Image5.Visible:=true;
  599. Image6.Visible:=false;
  600. Image7.Visible:=false;
  601. Image8.Visible:=false;
  602. Label1.Visible:=true;
  603. Label1.Visible:=true;
  604. end;
  605. 2: begin
  606. Image5.Visible:=false;
  607. Image6.Visible:=false;
  608. Image7.Visible:=true;
  609. Image8.Visible:=false;
  610. Label1.Visible:=true;
  611. end;
  612. 3: begin
  613. Image5.Visible:=false;
  614. Image6.Visible:=false;
  615. Image7.Visible:=false;
  616. Image8.Visible:=true;
  617. Label1.Visible:=true;
  618. end;
  619. end;
  620. end;
  621. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement