als ich heute ein projekt complieren woltle bekomme ich folgende fehlermeldung sond kam keine:
umyMemo.pas(11,43) Fatal: Compilation aborted
und zwar in dieser unit:
Code: Alles auswählen
unit umyMemo;
{$mode objfpc}
interface
uses
/ Classes, SysUtils, LResources, Controls, Graphics, Dialogs, ExtCtrls,Tools,lcltype,contnrs,lclintf;
type
TCharItem = class
Brush:TBrush;
Pen:TPen;
Font:TFont;
sel:Boolean;
Position,size:TPoint;
DisplayText:Char;
ChrBmp:TBitMap;
end;
TMyMemo = class(TCustomControl)
public
TextView:TSTringlist.Create;
buffer:TBitMap;
buffer2:TBitMap;
CT:TPoint;
start:Boolean;
CharList:TObjectList;
TextRect:TRect;
m:TPoint;
procedure AddCharItem(Stringlist:TSTringList; CharItem:TCharItem);
function SetSelItem(mx,my,ex,ey:Integer):TPoint;
procedure StringToCharItem(str:String);
procedure SettzeBild(index:Integer = -1);
procedure NewDrawBmp(index:Integer);
constructor Create(AOwner:TComponent;w,h:Integer);
procedure KeyDown(var Key: Word; Shift: TShiftState);override;
procedure KeyPress(var Key: char);override;
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);override;
procedure MouseMove(Shift: TShiftState; X,
Y: Integer);override;
procedure MouseUp(Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);override;
procedure Paint;override;
private
end;
implementation
constructor TMyMemo.Create(AOwner:TComponent;w,h:Integer);
begin
inherited Create(AOwner);
TextRect.left:=0; TextRect.top:=0;
TextRect.Right:=W; TextRect.Bottom:=H;
Width:=w; Height:=h;
CharList:=TObjectList.Create;
buffer:=TBitmap.Create;
buffer.Width:=Width; buffer.Height:=Height;
buffer.Canvas.FillRect(buffer.canvas.ClipRect);
buffer2:=TBitmap.Create;
buffer2.Width:=Width; buffer2.Height:=Height;
buffer2.Canvas.FillRect(buffer2.canvas.ClipRect);
textT:=TStringlist.Create;
TextView:TSTringlist.Create
textT.add('Dies ist ein Test von Heute, Wie geht es dir so ?');
textT.add('Dies ist ein Test von Heute, Wie geht es dir so ?');
textT.add('Dies ist ein Test von Heute, Wie geht es dir so ?');
textT.add('Dies ist ein Test von Heute, Wie geht es dir so ?');
textT.add('Dies ist ein Test von Heute, Wie geht es dir so ?');
textT.add('Dies ist ein Test von Heute, Wie geht es dir so ?');
end;
procedure TMyMemo.NewDrawBmp(index:Integer);
begin
end;
procedure TMyMemo.SettzeBild(index:Integer = -1);
begin
end;
procedure TMyMemo.StringToCharItem(str:String);
begin
end;
function TMyMemo.SetSelItem(mx,my,ex,ey:Integer):TPoint;
begin
end;
procedure TMyMemo.AddCharItem(Stringlist:TSTringList; CharItem:TCharItem);
//var
// CharItem:TCharItem;
begin
{ CharItem:=TCharItem.Create;
CharItem.Brush:=TBrush.Create;
CharItem.Pen:=TPen.Create;
CharItem.Font:=TFont.Create;
Charitem.Position:=Point(0,0); Charitem.Size:=Point(0,0);
Charitem.DisplayText:=char;
Charitem.ChrBmp:=TBitMap.Create;
Charitem.chrBmp.Canvas.Brush:=Charitem.brush;
Charitem.chrBmp.Canvas.Pen:=Charitem.Pen;
Charitem.chrBmp.Canvas.Font:=Charitem.Font;
Charitem.ChrBmp.Width:=Charitem.ChrBmp.Canvas.TextWidth(Charitem.DisplayText)+5;
Charitem.ChrBmp.Height:=Charitem.ChrBmp.Canvas.TextHeight(Charitem.DisplayText)+5;
Charitem.chrBmp.Canvas.FillRect(0,0,Charitem.ChrBmp.Width,Charitem.ChrBmp.Height);
Charitem.ChrBmp.Canvas.TextOut(0,0,Charitem.DisplayText);
CharList.Add(charitem);
SettzeBild;}
end;
procedure TMyMemo.Paint;
begin
Buffer.Canvas.TextRect(Rect(0,0,Width,Height),0,0,TextView.Text);
// Der cuser wird gezeichnet
// buffer.canvas.pen.color:=clred;
// buffer.canvas.moveto(ct.x,zi );
// buffer.canvas.LineTo(ct.x,zi+15);
// Paintbox1.Canvas.CopyRect(TextRect,buffer.canvas,TextRect)
inherited Paint;
Canvas.Draw(0,0,buffer)
end;
procedure TMyMemo.KeyDown(var Key: Word; Shift: TShiftState
);
begin
if (key in [ord('A')..ord('Z')]) or (Key in [ord('a')..ord('z')]) or (shift <> []) or (key = VK_SPACE) then begin
start:=True;
end;
end;
procedure TMyMemo.KeyPress(var Key: char);
begin
inherited keypress(key);
if start = true then begin
AddCharItem(key);
Invalidate;
start:=False;
end;
end;
procedure TMyMemo.MouseDown(Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);
begin
inherited MouseDown(button,shift,x,y);
m.x:=x; m.y:=y;
end;
procedure TMyMemo.MouseMove(Shift: TShiftState; X,
Y: Integer);
begin
inherited MouseMove(shift,x,y);
if ssleft in Shift then begin
SetSelItem(m.x,m.y,x,y);
// Invalidate;
end;
//PaintBox1.Invalidate;
end;
procedure TMyMemo.MouseUp(Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);
begin
inherited MouseUP(button,shift,x,y);
end;
end.