Procedure fra 1 til 2
Hej alle nu har jeg virkelig brug for hjælp;Problemmet er det at jeg ikke kan finde ud af hvordan jeg laver en procedure der ændre en TEdit's Text fra en anden unit kaldet eventu.
Jeg skal alså henvise til en procedure i uniten kaldet gui fra uniten eventu.
EVENTU:
unit eventu;
interface
uses CardClasses,CardFkt;
procedure ProgInit;
procedure NewGame;
procedure MouseDown(Pile: TPile; Card: TCard);
procedure MouseUp(Pile: TPile; Card: TCard);
implementation
uses dialogs,sysutils;
procedure ProgInit;
begin
end;
procedure NewGame;
begin
end;
procedure MouseDown(Pile: TPile; Card: TCard);
begin
end;
procedure MouseUp(Pile: TPile; Card: TCard);
begin
end;
end.
OG GUI:
unit gui;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Menus;
type
TFrmBord = class(TForm)
Edit1: TEdit;
procedure FormPaint(Sender: TObject);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Afslut1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Afslut2Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
procedure EraseRect(HFillrect,VFillRect: TRect);
procedure DrawEmptyPile(aType: integer;x1,y1: integer);
procedure CardDrawInverted(x,y,CardNr: integer);
procedure CardDraw(x,y,CardNr: integer);
procedure BackDraw(x,y,BackNr: integer);
end;
var
FrmBord: TFrmBord;
implementation
{$R *.DFM}
uses cardclasses, cardFkt, Eventu;
procedure TFrmBord.EraseRect(HFillrect,VFillRect: TRect);
begin
Canvas.brush.Color:=Color;
Canvas.FillRect(HFillRect);
Canvas.FillRect(VFillRect);
end;
procedure TFrmBord.DrawEmptyPile(aType: integer;x1,y1: integer);
const d=5;
var i: integer;
begin
case aType of
1: _BackDraw(Canvas,x1,y1,14);
2: _BackDraw(Canvas,x1,y1,13);
else
Canvas.Pen.Color:=clLime;
for i:=0 to 1 do
Canvas.RoundRect(x1+i,y1+i,x1+CardWidth-i,y1+CardHeight-i,d,d);
end
end;
procedure TFrmBord.CardDrawInverted(x,y,CardNr: integer);
begin
_CardDrawInverted(FrmBord.Canvas,x,y,CardNr);
end;
procedure TFrmBord.CardDraw(x,y,CardNr: integer);
begin
_CardDraw(FrmBord.Canvas,x,y,CardNr);
end;
procedure TFrmBord.BackDraw(x,y,BackNr: integer);
begin
_BackDraw(FrmBord.Canvas,x,y,BackNr);
end;
procedure TFrmBord.FormPaint(Sender: TObject);
begin
CTable.Refresh;
end;
procedure TFrmBord.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var p: TPile; c: TCard;
begin
CTable.GetPileCardAt(x,y,p,c);
if p<>nil then Eventu.MouseDown(p,c);
end;
procedure TFrmBord.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var p: TPile; c: TCard;
begin
CTable.GetPileCardAt(x,y,p,c);
if p<>nil then Eventu.MouseUp(p,c);
end;
end.