unit main;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    btnAplicar: TButton;
    Negrita: TCheckBox;
    Cursiva: TCheckBox;
    Subrayado: TCheckBox;
    Fuente: TRadioGroup;
    Estilo: TCheckGroup;
    lbTexto: TLabel;
    edTexto: TLabeledEdit;
    Tamano: TRadioGroup;
    Colores: TRadioGroup;
    procedure btnAplicarClick(Sender: TObject);
    procedure edTextoChange(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.btnAplicarClick(Sender: TObject);
var
  Estilos: TFontStyles;
begin
  edTexto.SetFocus;

  Estilos := [];

  If Negrita.Checked Then include(Estilos, fsBold);
  If Cursiva.Checked Then include(Estilos, fsItalic);
  If Subrayado.Checked Then include(Estilos, fsUnderline);

  lbTexto.Font.Style := Estilos;

  case Fuente.ItemIndex of
    0: lbTexto.Font.Name := 'Arial';
    1: lbTexto.Font.Name := 'Courier';
    2: lbTexto.Font.Name := 'Times';
  end;


  case Tamano.ItemIndex of
    0: lbTexto.Font.Size := 12;
    1: lbTexto.Font.Size := 16;
  end;

  case Colores.ItemIndex of
    0: lbTexto.Font.Color := clBlack;
    1: lbTexto.Font.Color := clRed;
    2: lbTexto.Font.Color := clBlue;
  end;
        lbTexto.Caption:=edTexto.Text;
end;

procedure TForm1.edTextoChange(Sender: TObject);
begin
       lbTexto.Caption:=edTexto.Text;
end;






end.

