als ich heute mein mainmenu weiter machen wollte und die neue Datei Format einbauen wollte.
Bekam ich folgende Meldung;
mehr leider nicht.uMainMenu2.pas(11,81) Fatal: Compilation aborted
und die angeben Position ist leer.
ich kopiere mal die Komplete unit hier dran. Evlt. kommt der Fehler bei euch auch:
Code: Alles auswählen
unit uMainMenu2;
 
{$mode objfpc}{$H+}
 
interface
 
uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,Tools,types,uMyListbox,uMyCompo,lclintf;
 
type
  TmyMainMenuA = class(TMyCompo)
  private
  protected
 
  public
    fFileName:String;
    Script:TStringlist.Create;
    ListBoxen:array of TMyListBox;
 
    constructor Create;
    procedure LoadFile(pFileName:String);
    function GetItemIndex(pName:String):Integer;
    procedure LoadSubMenu();
    procedure MouseEV(typ, x, y:Integer;Shift:TShiftState);
  end;
 
implementation
 
{ TMainMenu2 }
 
constructor TmyMainMenuA.Create;
begin
  Script:TStringList.Create;
  SetLength(ListBoxen,0);
  fFileName:='';
end;
 
function GetCaption(Script:TStringlist; Zeile:Integer):String;
var
  i:Integer;
begin
  for i:=Zeile to Script.Count-1 do begin
    if Pos('}',Script.Strings[i]) > 0 then
      break
    else begin
 
      if Pos('Caption',Script.Strings[i]) > 0 then begin
        result:=GetToken(Script.Strings[i],':',2);
        break;
      end;
    end;
  end;
end;
 
procedure TmyMainMenuA.LoadFile(pFileName: String);
var
  i:Integer;
  tmpListBox:TMyListBox;
  tmpListItem:TMyListItem;
begin
  FileName:=pFileName;
  if FileExists(FileName) then begin
    Script.LoadFromFile(Filename);
    tmpListBox:=TMyListBox.Create;
    tmpListBox.rx:=10; tmpListBox.ry:=10;
    tmpListBox.root:=True;
    for i:=0 to Script.Count-1 do begin
      if (Script.strings[i] <> ' ') and (Script.strings[i] <> '}') and (Script.strings[i] <> '')then begin
        tmpListItem.zeile:=i;
        tmpListItem.Visible:=True;
        tmpListItem.isSubMenu:=False;
        tmpListItem.Caption:=GetCaption(Script,i+1);
 
        Writeln(tmpListItem.Caption);
      end; // if ' '
    end; // for i:=0 to Count-1
    SetLength(ListBoxen,high(ListBoxen)+2);
    ListBoxen[high(ListBoxen)]:=tmpListBox;
  end; // FileExists
end;
 
function TmyMainMenuA.GetItemIndex(pName: String): Integer;
begin
 
end;
 
procedure TmyMainMenuA.LoadSubMenu();
begin
 
end;
 
procedure TmyMainMenuA.MouseEV(typ,x,y: Integer; Shift: TShiftState);
begin
 
end;
 
end.edit1:
die Datei Position in X Richtung ist genau da wo der Vertikale weiße strich ist....

 Verein
Verein 
 Links
Links Suche
Suche