Тема: Допоможіть зрозуміти в чому помилка(Lazarus)
Всім добрий день! Намагаюсь зробити компонент на основі TLabel з можливістю відображення верхніх та нижніх індексів. Ось мій код
type
  TSuperSubLabel = class(TLabel)
  private
  protected
  procedure SuperSub;
  public
  published
    property AutoSize;
    property Caption;
    property Font;
  end;
procedure Register;
implementation
procedure Register;
begin
  RegisterComponents('Standard',[TSuperSubLabel]);
end;
procedure SuperSub(Canvas:TCanvas; const aRect:TRect; X, Y:integer ; text:String);
var i,xx:integer;
    subScript, superScript:boolean;
    DefFont:TFont;
begin
Canvas.FillRect(aRect);
DefFont:=TFont.Create;
DefFont.Assign(Canvas.Font);
with Canvas do begin
  xx:=X;
  for i:=1 to length(text) do
  begin
   if text[i-1] = '_' then subScript:=true
                      else subScript:=false;
   if text[i-1] = '^' then superScript:=true
                      else superScript:=false;
   if  (text[i] = '_')  and   (text[i] = '^')  then
   begin
      if ( subScript ) then
      begin
        Canvas.Font.Height:=Canvas.Font.Height*8 div 10;
        TextRect(Rect(xx,aRect.Top,xx+TextWidth(text[i]),aRect.Bottom),xx, Y+abs(8*Canvas.Font.Height-10*DefFont.Height) div 10, text[i]);
        inc(xx,TextWidth(text[i]));
      end;
      if ( not subScript) and ( not superScript ) then
      begin
        Canvas.Font:=DefFont;
        TextRect(Rect(xx,aRect.Top,xx+TextWidth(text[i]),aRect.Bottom),xx, Y, text[i]);
        inc(xx,TextWidth(text[i]));
      end;
      if ( superScript ) then
      begin
        Canvas.Font.Height:=Canvas.Font.Height*9 div 10;
        TextRect(Rect(xx,aRect.Top,xx+TextWidth(text[i]),aRect.Bottom),xx, Y-abs(8*Canvas.Font.Height-10*DefFont.Height) div 20, text[i]);
        inc(xx,TextWidth(text[i]));
      end;
      Canvas.Font:=DefFont;
   end;
  end;
end;
 DefFont.Free;
end;
end. Але видає помилку:"Error:Forward declaration not solved '' SuperSub'' "
Можливо ви знаєте посібник з цієї теми але не на freepascal.org?
Бо я тут прочитала статтю https://wiki.freepascal.org/How_To_Writ … _Component, але не знайшла потрібної інформації:(
