unit Gui;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls, Controller;
type
TFrmCalculator =
class(TForm)
Lb_Gleichung: TLabel;
Lb_Ergebnis: TLabel;
Bt_Gleich: TButton;
Bt_C: TButton;
Bt_Sechs: TButton;
Bt_Rueck: TButton;
Bt_Drei: TButton;
Bt_Neun: TButton;
Bt_Null: TButton;
Bt_Eins: TButton;
Bt_Durch: TButton;
Bt_Komma: TButton;
Bt_Sieben: TButton;
Bt_Vier: TButton;
Bt_Mal: TButton;
Bt_Zwei: TButton;
Bt_Fuenf: TButton;
Bt_Acht: TButton;
Bt_Plus: TButton;
Bt_Minus: TButton;
procedure Zahl(Sender: TObject);
procedure Rechnoperator(Sender: TObject);
procedure Ereignis(Sender: TObject);
private
{ Private-Deklarationen }
m_ControllerAdd: CalcController;
public
{ Public-Deklarationen }
end;
var
FrmCalculator: TFrmCalculator;
implementation
{$R *.dfm}
//Uses
procedure TFrmCalculator.Zahl(Sender: TObject);
var
zahl:
String;
begin
zahl := TButton(Sender).Caption;
m_ControllerAdd := CalcController.Create;
m_ControllerAdd.Notify('
Zahl', zahl);
Lb_Gleichung.Caption := Lb_Gleichung.Caption + zahl;
m_ControllerAdd.Free;
end;
procedure TFrmCalculator.Ereignis(Sender: TObject);
var
ereignis:
String;
begin
m_ControllerAdd := CalcController.Create;
ereignis := TButton(Sender).Caption;
m_ControllerAdd.Notify('
Ereignis', ereignis);
m_ControllerAdd.Free;
end;
procedure TFrmCalculator.Rechnoperator(Sender: TObject);
var
rechenoperator:
String;
begin
m_ControllerAdd := CalcController.Create;
rechenoperator := TButton(Sender).Caption;
m_ControllerAdd.Notify('
Rechenoperator', rechenoperator);
Lb_Gleichung.Caption := Lb_Gleichung.Caption + rechenoperator;
m_ControllerAdd.Free;
end;
end.