Registriert seit: 6. Mär 2011
98 Beiträge
Delphi 6 Professional
|
AW: Erhalte Zugriffsfehler bei Verwendung von Attributen des paremt
9. Dez 2011, 15:33
Kein Problem
Delphi-Quellcode:
TGuiElement = class
protected
ftop, fleft, fwidth, fheight: Double;
fid: Integer;
fname: String;
fclassName: String;
public
procedure Render; virtual; abstract;
property top: Double read ftop write ftop;
property left: Double read fleft write fleft;
property width: Double read fwidth write fwidth;
property height: Double read fheight write fheight;
property id: Integer read fid write fid;
property name: String read fname write fname;
property ClassName: String read fclassName write fclassName;
end;
TGuiButton = class(TGuiElement)
private
fOnClick: TNotifyEvent;
public
procedure Render;
property OnClick: TNotifyEvent read fOnClick write fOnClick;
end;
Delphi-Quellcode:
procedure TGuiButton.Render;
begin
glPushMatrix;
glTranslated(fleft, ftop,0); //Felher taucht erstmals hier auf
glBegin(GL_QUADS);
glColor3f(1,0,1);
glVertex3f(fwidth,0 ,0);
glVertex3f(fwidth,0 ,0);
glVertex3f(fwidth,fheight,0);
glVertex3f(0 ,fheight,0);
glEnd;
glPopMatrix;
end;
Christian i := 0 ; While i = 0 do beep ;
|
|
Zitat
|