Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- Created By Jean Riko Kurniawan Putra
- Programmer Delphi Di Delphi Anime Lover
- BLOG : djeansoftware.blogspot.com
- Fanpage : www.facebook.com/jean.software
- }
- unit UKJW;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ComCtrls, StdCtrls;
- type
- TFKJW = class(TForm)
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- TabSheet3: TTabSheet;
- GroupBox1: TGroupBox;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- LHasil: TLabel;
- EJarak: TEdit;
- EWaktu: TEdit;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- Combobox1: TComboBox;
- ComboBox2: TComboBox;
- GroupBox2: TGroupBox;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Edit1: TEdit;
- EKecepatan: TEdit;
- Button4: TButton;
- Button5: TButton;
- Button6: TButton;
- ComboBox3: TComboBox;
- ComboBox4: TComboBox;
- GroupBox3: TGroupBox;
- Label10: TLabel;
- Label11: TLabel;
- Label12: TLabel;
- Label13: TLabel;
- Label14: TLabel;
- Edit2: TEdit;
- Edit3: TEdit;
- Button7: TButton;
- Button8: TButton;
- Button9: TButton;
- ComboBox5: TComboBox;
- ComboBox6: TComboBox;
- procedure TabSheet1Show(Sender: TObject);
- procedure TabSheet3Show(Sender: TObject);
- procedure TabSheet2Show(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure EJarakKeyPress(Sender: TObject; var Key: Char);
- procedure EWaktuKeyPress(Sender: TObject; var Key: Char);
- procedure Edit2KeyPress(Sender: TObject; var Key: Char);
- procedure Edit3KeyPress(Sender: TObject; var Key: Char);
- procedure Edit1KeyPress(Sender: TObject; var Key: Char);
- procedure EKecepatanKeyPress(Sender: TObject; var Key: Char);
- procedure Button3Click(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure Button7Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- FKJW: TFKJW;
- implementation
- {$R *.dfm}
- procedure TFKJW.TabSheet1Show(Sender: TObject);
- begin
- LHasil.Caption:='0';
- EJarak.SetFocus;
- end;
- procedure TFKJW.TabSheet3Show(Sender: TObject);
- begin
- Label9.Caption:='0';
- Edit1.SetFocus;
- end;
- procedure TFKJW.TabSheet2Show(Sender: TObject);
- begin
- Label14.Caption:='0';
- Edit2.SetFocus;
- end;
- procedure TFKJW.Button1Click(Sender: TObject);
- Var
- a,b:Real;
- begin
- a:=StrToFloat(EJarak.Text);
- b:=StrToFloat(EWaktu.Text);
- If (Combobox1.ItemIndex=0) And
- (ComboBox2.ItemIndex=0) then
- Begin
- LHasil.Caption:=FloatToStr(a/b) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=0) And
- (ComboBox2.ItemIndex=1) then
- Begin
- LHasil.Caption:=FloatToStr(a/(b/60)) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=0) And
- (ComboBox2.ItemIndex=2) then
- Begin
- LHasil.Caption:=FloatToStr(a/(b/3600)) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=1) And
- (ComboBox2.ItemIndex=0) then
- Begin
- LHasil.Caption:=FloatToStr((a/100)/b) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=1) And
- (ComboBox2.ItemIndex=1) then
- Begin
- LHasil.Caption:=FloatToStr((a/100)/(b/60)) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=1) And
- (ComboBox2.ItemIndex=2) then
- Begin
- LHasil.Caption:=FloatToStr((a/100)/(b/3600)) + ' Km/Jam' ;
- End;
- end;
- procedure TFKJW.EJarakKeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in['0'..'9',#8]) then key:= #0;
- end;
- procedure TFKJW.EWaktuKeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in['0'..'9',#8]) then key:= #0;
- end;
- procedure TFKJW.Edit2KeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in['0'..'9',#8]) then key:= #0;
- end;
- procedure TFKJW.Edit3KeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in['0'..'9',#8]) then key:= #0;
- end;
- procedure TFKJW.Edit1KeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in['0'..'9',#8]) then key:= #0;
- end;
- procedure TFKJW.EKecepatanKeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in['0'..'9',#8]) then key:= #0;
- end;
- procedure TFKJW.Button3Click(Sender: TObject);
- begin
- EJarak.Clear;
- EWaktu.Clear;
- LHasil.Caption:='0';
- EJarak.SetFocus;
- end;
- procedure TFKJW.FormShow(Sender: TObject);
- begin
- PageControl1.ActivePageIndex:=0;
- end;
- procedure TFKJW.Button7Click(Sender: TObject);
- Var a,b: Real;
- begin
- a:=StrToFloat(EDit2.Text);
- b:=StrToFloat(EDit3.Text);
- If (ComboBox6.ItemIndex=0) And
- (ComboBox5.ItemIndex=0) then
- Begin
- Label14.Caption:=FloatToStr(a*b) + ' Km' ;
- End
- Else If (Combobox6.ItemIndex=0) And
- (ComboBox5.ItemIndex=1) then
- Begin
- Label14.Caption:=FloatToStr(a*(b/60)) + ' Km' ;
- End
- Else If (Combobox6.ItemIndex=0) And
- (ComboBox5.ItemIndex=2) then
- Begin
- Label14.Caption:=FloatToStr(a*(b/3600)) + ' Km' ;
- End
- Else If (Combobox6.ItemIndex=1) And
- (ComboBox5.ItemIndex=0) then
- Begin
- Label14.Caption:=FloatToStr((a/100)*b) + ' Km' ;
- End
- Else If (Combobox6.ItemIndex=1) And
- (ComboBox5.ItemIndex=1) then
- Begin
- Label14.Caption:=FloatToStr((a/100)*(b/60)) + ' Km' ;
- End
- Else If (Combobox6.ItemIndex=1) And
- (ComboBox5.ItemIndex=2) then
- Begin
- Label14.Caption:=FloatToStr((a/100)*(b/3600)) + ' Km' ;
- End;
- end;
- procedure TFKJW.Button4Click(Sender: TObject);
- Var a,b: Real;
- begin
- a:=StrToFloat(Edit1.Text);
- b:=StrToFloat(EKecepatan.Text);
- If (Combobox4.ItemIndex=0) And
- (ComboBox3.ItemIndex=0) then
- Begin
- Label9.Caption:=FloatToStr(a/b) + ' Jam' ;
- End
- Else If (Combobox4.ItemIndex=0) And
- (ComboBox3.ItemIndex=1) then
- Begin
- Label9.Caption:=FloatToStr(a/(b/100)) + ' Jam' ;
- End
- Else If (Combobox4.ItemIndex=1) And
- (ComboBox3.ItemIndex=0) then
- Begin
- Label9.Caption:=FloatToStr((a/100)/b) + ' Jam' ;
- End
- Else If (Combobox4.ItemIndex=1) And
- (ComboBox3.ItemIndex=1) then
- Begin
- Label9.Caption:=FloatToStr((a/100)/(b/100)) + ' Jam' ;
- End;
- end;
- {
- Created By Jean Riko Kurniawan Putra
- Programmer Delphi Di Delphi Anime Lover
- BLOG : djeansoftware.blogspot.com
- Fanpage : www.facebook.com/jean.software
- }
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement