Rabu, 21 Maret 2012

Tugas Borland Delphi 7

NAMA : OKI ANDAMITRA
KELAS : 13.6B.01
NIM  :  13090247

Coding Tugas
-------------------------------------------------------------------------------------------------------------
unit Latihan3;

interface

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs, StdCtrls, jpeg, ExtCtrls, Menus;

type

  TForm1 = class(TForm)

    GroupBox1: TGroupBox;

    GroupBox2: TGroupBox;

    RadioButton1: TRadioButton;

    RadioButton2: TRadioButton;

    RadioButton3: TRadioButton;

    RadioButton4: TRadioButton;

    RadioButton5: TRadioButton;

    CheckBox1: TCheckBox;

    CheckBox2: TCheckBox;

    CheckBox3: TCheckBox;

    CheckBox4: TCheckBox;

    ComboBox1: TComboBox;

    ComboBox2: TComboBox;

    CheckBox6: TCheckBox;

    CheckBox7: TCheckBox;

    CheckBox8: TCheckBox;

    CheckBox9: TCheckBox;

    CheckBox10: TCheckBox;

    Image1: TImage;

    Label1: TLabel;

    Button1: TButton;

    Memo1: TMemo;

    MainMenu1: TMainMenu;

    File1: TMenuItem;

    Exit1: TMenuItem;

    Help1: TMenuItem;

    AboutMe1: TMenuItem;

    procedure FormCreate(Sender: TObject);

    procedure ComboBox1Change(Sender: TObject);

    procedure ComboBox2Change(Sender: TObject);

    procedure RadioButton1Click(Sender: TObject);

    procedure RadioButton2Click(Sender: TObject);

    procedure RadioButton3Click(Sender: TObject);

    procedure RadioButton4Click(Sender: TObject);

    procedure RadioButton5Click(Sender: TObject);

    procedure CheckBox1Click(Sender: TObject);

    procedure CheckBox2Click(Sender: TObject);

    procedure CheckBox3Click(Sender: TObject);

    procedure CheckBox4Click(Sender: TObject);

    procedure CheckBox6Click(Sender: TObject);

    procedure CheckBox7Click(Sender: TObject);

    procedure CheckBox8Click(Sender: TObject);

    procedure CheckBox9Click(Sender: TObject);

    procedure CheckBox10Click(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure FormActivate(Sender: TObject);

    procedure Exit1Click(Sender: TObject);

    procedure AboutMe1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

uses Latihan3Form2;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);

begin

ComboBox1.Items:=Screen.Fonts;

ComboBox1.Text:='PILIH FONTS';

ComboBox2.Text:='PILIH UKURAN';

Memo1.Text:='';

end;

procedure TForm1.ComboBox1Change(Sender: TObject);

begin

Memo1.Font.Name:=ComboBox1.Text;

end;

procedure TForm1.ComboBox2Change(Sender: TObject);

begin

memo1.Font.Size:=strtoint(ComboBox2.Text);

end;

procedure TForm1.RadioButton1Click(Sender: TObject);

begin

Memo1.Color:=ClRed;

RadioButton2.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton4.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton2Click(Sender: TObject);

begin

Memo1.Color:=ClBlue;

RadioButton1.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton4.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton3Click(Sender: TObject);

begin

Memo1.Color:=ClYellow;

RadioButton1.Enabled :=False;

RadioButton2.Enabled :=False;

RadioButton4.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton4Click(Sender: TObject);

begin

Memo1.Color:=ClGreen;

RadioButton1.Enabled :=False;

RadioButton2.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton5Click(Sender: TObject);

begin

Memo1.Color:=ClGray;

RadioButton1.Enabled :=False;

RadioButton2.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton4.Enabled :=False;

end;

procedure TForm1.CheckBox1Click(Sender: TObject);

begin

If CheckBox1.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsBold];

   CheckBox1.Caption:='Un Bold';

   End

 Else

 Begin

  CheckBox1.Caption:='Bold';

  Memo1.Font.Style := Memo1.Font.Style-[FsBold];

 End

end;

procedure TForm1.CheckBox2Click(Sender: TObject);

begin

If CheckBox2.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsItalic];

   CheckBox2.Caption:='Un Italic';

   End

 Else

 Begin

  CheckBox2.Caption:='Italic';

  Memo1.Font.Style := Memo1.Font.Style-[FsItalic];

 End

end;

procedure TForm1.CheckBox3Click(Sender: TObject);

begin

If CheckBox3.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsUnderline];

   CheckBox3.Caption:='Non Line';

   End

 Else

 Begin

  CheckBox3.Caption:='Underline';

  Memo1.Font.Style := Memo1.Font.Style-[FsUnderline];

 End

end;

procedure TForm1.CheckBox4Click(Sender: TObject);

begin

If CheckBox4.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsStrikeOut];

   CheckBox4.Caption:='Un StrikeOut';

   End

 Else

 Begin

  CheckBox4.Caption:='StrikeOut';

  Memo1.Font.Style := Memo1.Font.Style-[FsStrikeOut];

 End

end;

procedure TForm1.CheckBox6Click(Sender: TObject);

begin

If CheckBox6.Checked=True then

   Begin

   Memo1.Font.Color:=ClRed;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox7Click(Sender: TObject);

begin

If CheckBox7.Checked=True then

   Begin

   Memo1.Font.Color:=ClBlue;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox8Click(Sender: TObject);

begin

If CheckBox8.Checked=True then

   Begin

   Memo1.Font.Color:=ClYellow;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox9Click(Sender: TObject);

begin

If CheckBox9.Checked=True then

   Begin

   Memo1.Font.Color:=ClGreen;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox10Click(Sender: TObject);

begin

If CheckBox10.Checked=True then

   Begin

   Memo1.Font.Color:=ClGray;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

Memo1.Color:=ClWindow;

RadioButton1.Enabled :=True;

RadioButton2.Enabled :=True;

RadioButton3.Enabled :=True;

RadioButton4.Enabled :=True;

RadioButton5.Enabled :=True;

end;

procedure TForm1.FormActivate(Sender: TObject);

begin

Form1.Action;

Memo1.SetFocus;

end;

procedure TForm1.Exit1Click(Sender: TObject);

begin

Application.Terminate;

end;

procedure TForm1.AboutMe1Click(Sender: TObject);

begin

Form2.Show;

end;

end.

Tidak ada komentar:

Posting Komentar