home *** CD-ROM | disk | FTP | other *** search
- {$O+,R-,S-,B-,I+,F+}
- Unit VORLAGE;
-
- Interface
-
- uses
- Crt,
- Dos,
- StrTool,
- GEDDEFS,
- KEYSCRN,
- PLOTSYS,
- PLOTSTOR,
- PLSteuer,
- PLGLOB;
-
-
-
- Function Hole_Format(Var Fn :Str64;
- Var Name :Str15;
- Var Df :Druckparams;
- Var RecNr: Integer):Integer;
- { 0 = gefunden, -1 = nicht gefunden >0 :Ioerror }
-
- Procedure SetParams(D :Druckparams;Batch :Boolean);
-
- Procedure GetParams(Var D :Druckparams);
-
- Procedure Vorlage_Laden;
-
- Procedure Vorlage_Speichern;
-
- Procedure Vorlage_loeschen;
-
- Procedure BatchInit;
-
-
-
- implementation
-
- Const GEDDY50ID='GED-PDF-50';
- GEDDY55ID='GED-PDF-55';
- Suffix ='.PDF';
-
- Type
-
- Oldparams =Record
- FileID :Str10; { enthält GEDDY-PAR}
- PARname :Str15; { 12 Zeichen }
- InitString,
- ExitString :Str64;
- Librarypath:Str64;
- Faktor :System.Real;
- D_PenWidth :System.Real;
- D_PenSpeed :Integer;
- LinScal1,
- LinScal2 :System.Real;
- Ursprung :Koord;
- D_Offset :Koord; { 0.1 mm Schritte }
- D_Fenster1 :Koord; { 0.1 mm Schritte }
- D_Fenster2 :Koord; { 0.1 mm Schritte }
- D_Pens :Array[1..8] of Byte;
- D_LineWidth:Array[1..8] of Byte;
- D_Layers :set of 0..7;
- D_Adapt :Boolean;
- D_Mirror :Boolean;
- D_Portrait :Boolean;
- D_Zurueck :Boolean;
- D_Farbe :Byte;
- D_Modus :Byte;
- LoetStopInc:System.Real;
- D_Absolut :Boolean;{ Laser }
- D_Position :Koord; { nur LaserDrucker }
- D_Erweiter :Array[1..86] of Byte;
- {Record-Länge =384 Bytes }
- end;
-
- Procedure Convert_oldRec(Old:OldParams;Var New:DruckParams);
- Var I:Integer;
- begin
- With new Do
- begin
- FileID:=GEDDY55ID;
- ParName:=Old.PARname;
- InitString:=Old.InitString;
- ExitString:=Old.ExitString;
- Librarypath:=Old.Librarypath;
- Faktor:=Old.Faktor;
- For I:=1 to MaxLayer+1 do
- D_PenInfo[I].Penwidth:=Old.D_PenWidth;
- PenSpeed:=Old.D_PenSpeed;
- LinScal1:=Old.LinScal1/SetUpInfo.PinstInfo.LinescaleFac;
- LinScal2:=Old.LinScal2/SetUpInfo.PinstInfo.LinescaleFac;
- Ursprung:=Old.Ursprung;
- D_offset:=Old.D_Offset;
- D_Fenster1:=Old.D_Fenster1;
- D_Fenster2:=Old.D_Fenster2;
- For I:=1 to 8 do D_PenInfo[I].PenNr:=Old.D_Pens[I];
- For I:=9 to MaxLayer+1 do D_PenInfo[I].PenNr:=1;
- D_Layers:=[8..MaxLayer]+Old.D_Layers;
- D_adapt:=Old.D_Adapt;
- D_Mirror:=Old.D_Mirror;
- D_portrait:=Old.D_Portrait;
- D_zurueck:=Old.D_Zurueck;
- D_farbe:=Old.D_Farbe;
- D_modus:=Old.D_Modus;
- LoetstopInc:=Old.LoetStopInc;
- D_absolut:=Old.D_Absolut;
- D_position.X:=0;{Old.D_Position;}
- D_Position.Y:=0;
- D_TextWidth:=0.08;
- end;
- end;
-
- Procedure Convert_50REC(Var New:DruckParams);
- Var I:Integer;
- begin
- With new Do
- begin
- If FileID<>GEDDY50ID then Exit;
- FileID:=GEDDY55ID;
- end;
- end;
-
-
- Function Exist_n_Conv(Fname:Str64):Boolean;
-
- Var Path :Str64;
- Name :Str64;
- Ext :ExtStr;
- Neu :DruckParams;
- Old :Oldparams;
- F :File of Oldparams;
- Fneu :File of Druckparams;
- Ok :Boolean;
- Procedure Check;
- begin
- If Ioresult=0 then Exit;
- Ok:=false;
- end;
- begin
- {$I-}
- Assign(F,Fname);
- Reset(F);
- OK:=IOresult=0;
- Read(F,Old);
- OK:=(IOresult=0) and Ok;
- If OK then
- begin
- Close(F);
- OK:=IOresult=0;
- end;
- {$I+}
- Exist_n_Conv:=Ok;
- If Not(Ok) then Exit;
- If Old.FileID=GEDDY50ID then Exit;
- If Old.FileID=GEDDY55ID then Exit;
- Fsplit(Fname,Path,Name,Ext);
- Assign(F,Fname);
- Name:='GED$$$$.TMP';
- ProcessFilename(Path,Name);
- Rename(F,Name);Check;
- Reset(F);Check;
- Assign(Fneu,Fname);
- Rewrite(Fneu);Check;
- While Not(Eof(F)) and Ok do
- begin
- Read(F,Old);Check;
- Convert_OldRec(Old,Neu);
- Write(Fneu,Neu);Check;
- end;
- Close(F); Check;
- Erase(F); Check;
- Close(Fneu); Check;
- Exist_N_Conv:=Ok;
- end;
-
- Procedure SelectParam(Var FormFile :Str64;
- Var Format :Druckparams;
- Var TC :Char);
-
-
- Const maxdir =255;
-
- type
- List_Entry = Record
- Inh :Str15;
- RecNr :Integer;
- end;
-
- list = array[1..maxdir] of List_Entry;
- var
- DirList : list;
- Taste : Char;
- NDirList,first,
- Last,OldFirst,
- FlipPos,OldFlip:Integer;
- Color :Byte;
- M_Save:Char;
- Dparfile :File of Druckparams;
- ErrorNr :Integer;
- ErrorMsg :Str64;
- FileOpen :Boolean;
-
- Procedure GetDirectory;
- Var Dpar :Druckparams;
- c,rn,i:Integer;
- Mask :Str80;
- TC :Char;
-
- procedure quicksort(var a: list; Lo,Hi: integer);
- Var x,y: List_Entry;
- procedure sort(l,r: integer);
- var i,j: integer;
- begin
- i:=l; j:=r; x:=a[(l+r) DIV 2];
- repeat
- while a[i].Inh<x.Inh do i:=i+1;
- while x.Inh<a[j].Inh do j:=j-1;
- if i<=j then
- begin
- y:=a[i]; a[i]:=a[j]; a[j]:=y;
- i:=i+1; j:=j-1;
- end;
- until i>j;
- if l<j then sort(l,j);
- if i<r then sort(i,r);
- end;
- begin
- sort(Lo,Hi);
- end;
-
- begin { procedure GetDirectory }
- c:=0;
- rn:=0;
- ErrorMsg:='Datei enthält keine Druckformate';
- {$I-}
- Reset(Dparfile);
- ErrorNr:=ioresult;
- FileOpen:=ErrorNr=0;
- While Not(Eof(Dparfile)) and (C<Maxdir) and (ErrorNr=0) do
- begin
- Read(Dparfile,dpar);
- ErrorNr:=Ioresult;
- If (ErrorNr=0) and (Dpar.ParName<>'') then
- begin
- c := Succ(c);
- With DirList[c] Do
- begin
- Inh:=dpar.Parname;
- RecNr:=rn;
- end;
- end;
- Inc(Rn,1);
- end;
- NDirList:=c;
- {$I+}
- If ErrorNr>0 then
- begin
- NDirList:=0;
- If ErrorNr =2 then ErrorMsg:='Datei nicht gefunden '
- else
- begin
- ErrorMSG:='Disketten-Lesefehler';
- DiskErrors(-ErrorNr);
- TC:=SelectError(DiskError+'- <Esc>','Fehler',[ESc]);
- end;
- end;
- Quicksort(Dirlist,1,c);
- First:=1;
- Last:=First+49;
- If Last>NdirList then Last:=NdirList;
- FlipPos:=First;
- end;
-
- Procedure ShowDir(First,Last:Integer;Var Error :Str64);
- Var I:Integer;
- S:Str80;
- begin
- MakeFrame(wind_dir,ModeWinCol,1);
- WriteToWindow(wind_dir,10,12,ModeHeadCol,
- ' Cursortasten: wählen, <Ret>: bestätigen, <ESC>: Ende ');
- WriteToWindow(wind_dir,3,1,ModeHeadCol,' '+FormFile+' ');
- If Last>First+49 then Last:=First+49;
- FillChar(S,Sizeof(S),32);
- S[0]:=#70;
- For I:=1 to 10 do
- WritetoWindow(Wind_dir,4,1+I,ModeNorCol,S);
- For I:=First to Last do
- begin
- With Dirlist[I] do
- WritetoWindow(Wind_dir,4+((I-First) mod 5)*14,2+((I-First) div 5),
- ModeNorCol,Inh);
- end;
- If Ndirlist<1 then
- WritetoWindow(Wind_dir,18,5,ModeLowCol,Error);
- end;
-
- Procedure FlipDir(P:Integer;Color:Byte);
- Var X,Y :Integer;
- begin
- X:=wind_dir.x1+3+((P-First) mod 5)*14;
- Y:=Wind_dir.Y1+1+((P-First) div 5);
- FlipLine(X,Y,Color,12);
- end;
-
- BEGIN
- TC:=#0;
- M_Save:=Mouse_Left;
- Mouse_Left:=^M;
- Assign(Dparfile,Formfile);
- GetDirectory;
- MakeWindow(wind_dir,3,9,74,12,ModeWinCol,wok);
- ShowDir(First,Last,ErrorMsg);
- PutWindow (wind_dir,wok); { Menü anzeigen }
- If NdirList >0 Then FlipDir(FlipPos,ModeFlpCol);
- IF wok<>0 THEN
- begin
- Mouse_Left:=M_save;
- EXIT;
- end;
- Repeat
- Taste:=GetKey([Mouse_Left,^E,^S,^D,^X,^M,^A,^F,^Q,^Z,^M,Esc,
- 'A'..'Z','a'..'z','0'..'9','-','$','#','&','_',
- #128..#160]);
- If NdirList>0 then
- begin
- OldFlip:=FlipPos;
- OldFirst:=First;
- Case Taste of
- 'A'..'Z','a'..'z',
- '0'..'9','-',
- '$','#','&','_',
- #128..#160 :begin
- FlipPos:=1;
- While (Upcase(DirList[FlipPos].Inh[1])<Upcase(Taste))
- and (FlipPos<NDirList) Do Inc(FlipPos);
- end;
- ^S :FlipPos:=FlipPos-1;(*Pfeil links *)
- ^D :FlipPos:=FlipPos+1;(*Pfeil rechts*)
- ^E :FlipPos:=FlipPos-5;(*Pfeil rauf *)
- ^X :FlipPos:=FlipPos+5;(*Pfeil runter*)
- ^A :FlipPos:=1;(*Anfang *)
- ^F :FlipPos:=Ndirlist;(*ende *)
- ^Q :FlipPos:=FlipPos+45;(*Page-down *)
- ^Z :FlipPos:=FlipPos-45;(*Page-up *)
- end;
- If OldFlip<>FlipPos Then
- begin
- If FlipPos<1 then FlipPos:=1;
- If FlipPos>NdirList Then FlipPos:=Ndirlist;
- If (FlipPos<First) or (FlipPos>Last) then
- First:=((FlipPos-1) div 5) *5 +1;
- If First>Ndirlist-45 Then
- First:=((Ndirlist-46) div 5)*5+1;
- If First<1 Then First:=1;
- Last:=First+49;
- If Last>NdirList then Last:=NdirList;
- If OldFirst<>First Then
- begin
- Showdir(First,Last,ErrorMsg);
- ShowWindow(Wind_dir);
- FlipDir(FlipPos,ModeFlpCol);
- end
- else
- begin
- FlipDir(OldFlip,ModeNorCol);
- FlipDir(FlipPos,ModeFlpCol);
- end;
- end;
- end;
- UNTIL Taste IN [^M,Esc,Mouse_left];
- TC:=Taste;
- If (flipPos>0) and (FlipPos<=NdirList) and (TC<>#27) Then
- With DirList[FlipPos] do
- begin
- {$I-}
- Seek(DparFile,RecNr);
- Read(Dparfile,Format);
- Convert_50Rec(Format);
- {$I+}
- ErrorNr:=Ioresult;
- If ErrorNr<>0 then FillChar(Format,Sizeof(Format),0);
- end;
- If FileOpen then
- begin
- {$I-}
- Close(Dparfile);
- ErrorNr:=Ioresult;
- {$I+}
- end;
- RestoreWindow (wind_dir,wok); { Hintergrund anzeigen }
- DeleteWindow(Wind_Dir);
- Mouse_Left:=M_save;
- END;
-
- Function Hole_Format(Var Fn :Str64;
- Var Name :Str15;
- Var Df :Druckparams;
- Var RecNr: Integer):Integer;
- { 0 = gefunden, -1 = nicht gefunden >0 :Ioerror }
-
- Var Dparfile :File of Druckparams;
- D :Druckparams;
- ErrNr :Integer;
- Found :Boolean;
- begin
- If Not Exist_N_Conv(Fn) then
- begin
- Hole_Format:=2; { File Not Found }
- Exit;
- end;
- Assign(Dparfile,Fn);
- {$I-}
- Found:=false;
- RecNr:=-1;
- Reset(Dparfile);
- ErrnR:=Ioresult;
- If ErrNr=0 Then
- begin
- While Not(Eof(Dparfile) or Found) and (ErrNr=0) do
- begin
- Inc(recNr,1);
- Read(Dparfile,D);
- Convert_50Rec(D);
- ErrnR:=Ioresult;
- Found:=D.Parname=Name;
- end;
- Close(Dparfile);
- ErrnR:=Ioresult;
- end;
- {$I+}
- If Found and (ErrNr=0) then
- begin
- Df:=D;
- Hole_Format:=0;
- end
- else If ErrNr=0 then Hole_Format:=-1 else Hole_Format:=ErrNr;
- end;
-
- Procedure ReadDruckpar(FormFile :Str64;
- Var Format :Druckparams;
- Var TC :Char);
- Var Dname :Str15;
- F :Druckparams;
- C :Char;
- begin
- FillChar(F,Sizeof(F),0);
- Dname:='';
- SelectParam(FormFile,F,TC);
- If (F.FileId='') and (F.ParName='') then
- begin
- FillChar(Format,Sizeof(Format),0);
- TC:=Esc;
- end;
- If (TC<>Esc) and (F.FileID<>GEDDY55ID) then
- begin
- C:=SelectError('Fehler beim Zugriff auf Format-Vorlage - <Esc>','Fehler:',[Esc]);
- TC:=Esc;
- FillChar(Format,Sizeof(Format),0);
- end else If TC<>Esc then Format:=F;
- end;
-
- Procedure SetParams(D :Druckparams;Batch :Boolean);
- Var I:Integer;
- Dummy :Boolean;
- C: Char;
- begin
- With D,SetupInfo.SetupPlotter,SetupInfo.PinstInfo do
- begin
- ActualParname:=ParName;
- DeviceInit:=InitString;
- DeviceExit:=ExitString;
- PlotScale:=Faktor;
- If Batch then
- Filesetup.LIBpath:=Librarypath
- else
- If UpcaseStr(Filesetup.LIBpath)<>UpcaseStr(Librarypath) then
- begin
- C:=SelectError('Bibliothek des Formats <> aktuelle Bibliothek ! - <Esc>',
- 'Warnung:',[Esc]);
- end;
- SetupInfo.Voreinstellung.Ursprung:=Ursprung;
- Limit(D_offset.X,MinFormX,FormX);
- Limit(D_offset.Y,MinFormY,FormY);
- Limit(D_Fenster1.X,MinFormX,FormX);
- Limit(D_Fenster1.Y,MinFormY,FormY);
- Limit(D_Fenster2.X,MinFormX,FormX);
- Limit(D_Fenster2.Y,MinFormY,FormY);
- Plotoffset:=D_offset;
- FensterX1:=D_Fenster1.X;
- FensterY1:=D_Fenster1.Y;
- FensterX2:=D_Fenster2.X;
- FensterY2:=D_Fenster2.Y;
- LScaledotted:=LinScal1;
- Lscaledashed:=LinScal2;
- For I:=1 to 9 do Stiftbreiten[I]:=D_PenInfo[I].PenWidth;
- Plotlayers:=D_Layers;
- For I:=1 to MaxLayer+1 Do Penlookup[I]:=D_PenInfo[I].PenNr;
- Adaptlines:=D_Adapt;
- Spiegeln:=D_Mirror;
- Portrait:=D_portrait;
- PlotModus:=PlotModi(D_Modus);
- LoetStopPlus:=LoetstopInc;
- Plotspeed:=PenSpeed;
- Schriftdicke:=D_TextWidth;
- GrafWindow(FensterX1,FensterY1,FensterX2,FensterY2);
- end;
- end;
-
- Procedure GetParams(Var D :Druckparams);
- Var I:Integer;
- begin
- With D,SetupInfo.SetupPlotter,SetupInfo.PinstInfo do
- begin
- D.FileID:=GEDDY55ID;
- D.PARName:=ActualPARname;
- InitString:=DeviceInit;
- ExitString:=DeviceExit;
- LibraryPath:=FileSetup.LIBPath;
- Faktor:=PlotScale;
- Ursprung:=SetupInfo.Voreinstellung.Ursprung;
- D_offset:=Plotoffset;
- D_Fenster1.X:=FensterX1;
- D_Fenster1.Y:=FensterY1;
- D_Fenster2.X:=FensterX2;
- D_Fenster2.Y:=FensterY2;
- LinScal1:=LScaledotted;
- LinScal2:=Lscaledashed;
- For I:=1 to 9 do D_PenInfo[i].PenWidth:=Stiftbreiten[I];
- For I:=10 to MaxLayer+1 do D_PenInfo[I].PenWidth:=0;
- D_Layers:=Plotlayers;
- For I:=1 to MaxLayer+1 Do D_PenInfo[I].PenNr:=PenLookup[I];
- D_Adapt:=Adaptlines;
- D_Mirror:=Spiegeln;
- D_portrait:=Portrait;
- D_Modus:=Byte(Plotmodus);
- LoetStopInc:=LoetStopPlus;
- Penspeed:=PlotSpeed;
- D_TextWidth:=SchriftDicke;
- end;
- end;
-
-
-
- Procedure Store_Vorlage(Fname :Str64;D:Druckparams;Erase:Boolean);
- Var Dparfile:File of Druckparams;
- D1 :Druckparams;
- RecNr :Integer;
- Result :Integer;
- Ok :Boolean;
- Dname :Str15;
- OvrW,TC :Char;
-
- Function Check:Boolean;
- begin
- Ok:=(Ioresult=0) and ok;
- Check:=Ok;
- end;
-
- begin
- If Not(Erase) then
- begin
- MakeWindow(wind_tmp,27,15,24,3,DiaWinCol,wok);
- MakeFrame(wind_tmp,DiaWinCol,1);
- WriteToWindow(wind_tmp,3,1,DiaHeadCol,' Name für Format: ');
- PutWindow(Wind_tmp,Wok);
- Dname:=UpcaseStr(D.Parname);
- If Dname='' then Dname:='STANDARD';
- Repeat
- OvrW:='J';
- InputKbd(Dname,12,30,16,[^M,Esc,^Q],Alphas+[#128..#160],TC);
- Dname:=UpcaseStr(Dname);
- If TC<>Esc then
- begin
- If (Length(Dname)>0) then
- begin
- If Hole_Format(Fname,Dname,D1,RecNr)=0 then
- OvrW:=SelectError( 'Überschreiben ? (J/N) ','',['J','N']);
- end
- else
- begin
- OvrW:=SelectError('Name muß angegeben werden ! - <Esc> ','Fehler:',[Esc]);
- OvrW:='N'
- end;
- end;
- Until (OvrW='J') or (TC=Esc);
- RestoreWindow(Wind_tmp,wok);
- DeleteWindow(Wind_tmp);
- end
- else
- begin
- TC:=SelectError(D.Parname+' wirklich löschen ? (J/N)','',['J','N',Esc]);
- If TC<>'J' then TC:=Esc;
- end;
- If TC<>Esc then
- begin
- If Not(Erase) then
- begin
- ActualParname:=Dname;
- D.Parname:=DName;
- end;
- Result:=Hole_Format(Fname,D.Parname,D1,RecNr);
- If Not(Erase) and (Result<0) then
- begin
- DName:='';
- Result:=Hole_Format(Fname,Dname,D1,RecNr);
- end;
- Assign(Dparfile,Fname);
- Ok:=True;
- {$I-}
- If Result<1 then
- begin
- Reset(Dparfile);
- If Check then
- begin
- If Result<0 then RecNr:=FileSize(Dparfile);
- If RecNr<250 then
- begin
- If Erase then D.Parname:='';
- If Check then Seek(DparFile,RecNr);
- If Check then Write(Dparfile,D);
- end
- else
- begin
- OvrW:=SelectError('Nicht gespeichert, mehr als 250 Einträge ! - <Esc>',
- 'Fehler:',[Esc]);
- end;
- Close(Dparfile);
- Ok:=Check;
- end;
- end
- else
- begin
- Rewrite(Dparfile);
- If Check then Write(Dparfile,D);
- Close(Dparfile);
- Ok:=Check;
- end;
- {$I+}
- If Not(Ok) then
- OvrW:=SelectError('Fehler beim Abspeichern ! - <Esc>','Fehler:',[Esc]);
- end;
- end;
-
- Procedure Vorlage_Laden;
- TYPE txtarr = ARRAY [1 .. 5] OF Str80;
- VAR texte: txtarr;
- P :Byte;
- Fname :Str64;
- LadenMen :MenueType;
- FileNames :Array[1..2] of Str64;
- sel :Integer;
- Df :Druckparams;
- TC :Char;
- begin
- ActualHelp:=92;
- P:=0;
- If EXist_N_Conv('STANDARD'+Suffix) then
- begin
- Inc(P,1);
- Filenames[P]:='STANDARD'+Suffix;
- Texte[P]:=' ~S~TANDARD'+Suffix+' ';
- end;
- Inc(P,1);
- Filenames[P]:=Filesetup.DWG+Suffix;
- Texte[P]:=' '+Filenames[P]+' ';
- With FileSetUp Do
- ProcessFilename(DWGpath,Filenames[p]);
- If Not (Exist_N_Conv(Filenames[p])) then Dec(P,1);
- If P>0 then
- begin
- MakeMenue(LadenMen,12,13,30,P+2,P,ModeWinCol,MainFlpCol,ModeHiCol,
- Ptr(Seg(texte),Ofs(texte)),wok);
- WriteToWindow(LadenMen.picture,5,1,ModeHeadCol,' FORMAT laden aus: ');
- WriteToWindow(LadenMen.picture,3,P+2,ModeHeadCol,
- ' '+Chr(24)+Chr(25)+' wählen <ESC> Ende ');
- Sel:=GetMenueChoice(LadenMen,wok);
- If sel>0 then
- begin
- GetParams(Df);
- ReadDruckpar(Filenames[Sel],Df,TC);
- If TC<>Esc Then SetParams(Df,false);
- end;
- DeleteWindow(LadenMen.Picture);
- end
- else
- TC:=SelectError('Keine FORMAT-Datei vorhanden ! -<Esc>','Fehler:',[Esc]);
- end;
-
- Procedure Vorlage_Speichern;
- TYPE txtarr = ARRAY [1 .. 5] OF Str80;
- VAR texte: txtarr;
- P :Byte;
- StoreMen :Menuetype;
- sel :Integer;
- FileNames :Array[1..2] of Str64;
- Df :Druckparams;
- tmp :WindowType;
- BEGIN
- ActualHelp:=92;
- Filenames[1]:='STANDARD'+Suffix;
- Filenames[2]:=Filesetup.DWG+Suffix;
- texte[1]:=' ~S~TANDARD'+Suffix+' ';
- texte[2]:=' '+Filenames[2]+' ';
- With FileSetUp Do
- begin
- ProcessFilename(DWGpath,Filenames[2]);
- end;
- P:=2;
- MakeMenue(StoreMen,12,13,30,P+2,P,ModeWinCol,MainFlpCol,ModeHiCol,
- Ptr(Seg(texte),Ofs(texte)),wok);
- WriteToWindow(StoreMen.picture,5,1,ModeHeadCol,' FORMAT speichern in : ');
-
- WriteToWindow(StoreMen.picture,3,P+2,ModeHeadCol,
- ' '+Chr(24)+Chr(25)+' wählen <ESC> Ende ');
- Tmp:=StoreMen.Picture;
- PutWindow(Tmp,wok);
- sel:=GetMenueChoice(Storemen,wok);
- If sel>0 then
- begin
- GetParams(Df);
- Store_Vorlage(Filenames[sel],Df,false);
- end;
- RestoreWindow(tmp,wok);
- DeleteWindow(StoreMen.Picture);
- END;
-
- Procedure Vorlage_Loeschen;
- TYPE txtarr = ARRAY [1 .. 5] OF Str80;
- VAR texte: txtarr;
- P :Byte;
- Fname :Str64;
- LadenMen :MenueType;
- FileNames :Array[1..2] of Str64;
- sel :Integer;
- Df :Druckparams;
- TC :Char;
- begin
- ActualHelp:=92;
- P:=0;
- If EXist_N_Conv('STANDARD'+Suffix) then
- begin
- Inc(P,1);
- Filenames[P]:='STANDARD'+Suffix;
- Texte[P]:=' ~S~TANDARD'+Suffix+' ';
- end;
- Inc(P,1);
- Filenames[P]:=Filesetup.DWG+Suffix;
- Texte[P]:=' '+Filenames[P]+' ';
- With FileSetUp Do
- ProcessFilename(DWGpath,Filenames[p]);
- If Not (Exist_N_Conv(Filenames[p])) then Dec(P,1);
- If P>0 then
- begin
- MakeMenue(LadenMen,12,13,30,P+2,P,ModeWinCol,MainFlpCol,ModeHiCol,
- Ptr(Seg(texte),Ofs(texte)),wok);
- WriteToWindow(LadenMen.picture,5,1,ModeHeadCol,' FORMAT laden aus: ');
- WriteToWindow(LadenMen.picture,3,P+2,ModeHeadCol,
- ' '+Chr(24)+Chr(25)+' wählen <ESC> Ende ');
- Sel:=GetMenueChoice(LadenMen,wok);
- If sel>0 then
- begin
- ReadDruckpar(Filenames[Sel],Df,TC);
- If TC<>Esc Then
- Store_Vorlage(Filenames[sel],Df,true);
- end;
- DeleteWindow(LadenMen.Picture);
- end
- else
- TC:=SelectError('Keine FORMAT-Datei vorhanden ! -<Esc>','Fehler:',[Esc]);
- end;
-
- Procedure BatchInit;
- Var Pfad :PathStr;
- Name :PathStr;
- Ex :ExtStr;
- Format :Str15;
- F1,RecNr :Integer;
- FormatFile :PathStr;
- Df :Druckparams;
-
- begin
- FillChar(Batchpar,Sizeof(BatchPar),0);
- If Batch then
- begin
- If ParamCount=2 then
- begin
- Pfad:=Fexpand(ParamStr(1));
- Fsplit(Pfad,Pfad,Name,Ex);
- Format:=UpcaseStr(ParamStr(2));
- If Pfad[Length(Pfad)]='\' then
- Delete(Pfad,Length(Pfad),1);
- With FileSetup Do
- Begin
- ActivePath:=Pfad;
- DWGPath:=Pfad;
- DWG:=Name;
- CheckPath(Pfad);
- end;
- FormatFile:=Name+Suffix;
- ProcessFilename(Pfad,FormatFile);
- If Hole_Format(Formatfile,Format,Df,RecNr)<>0 then
- begin
- FormatFile:='STANDARD'+Suffix;
- If Hole_Format(Formatfile,Format,Df,RecNr)<>0 then Error(101);
- end;
- BatchPAR:=Df;
- SetParams(Df,Batch);
- With FileSetup Do
- Begin
- Macropath:=LibPath;
- CheckPath(MacroPath);
- DirMask:='*.*';
- End;
- AufDatei:=OutPath<>'';
- end else Error(100); { Unzulässige Parameter }
- end else
- begin
- With FileSetup do
- begin
- Formatfile:=DWG+Suffix;
- Processfilename(DWGpath,FormatFile);
- end;
- Format:='STANDARD';
- If Hole_Format(Formatfile,Format,Batchpar,RecNr)=0 then
- Batchpar.Librarypath:=FileSetup.LIBpath
- else
- begin
- FormatFile:='STANDARD'+Suffix;
- Format:='STANDARD';
- If Hole_Format(Formatfile,Format,Batchpar,RecNr)=0 then
- Batchpar.Librarypath:=FileSetup.LIBpath;
- end;
- end;
- end;
-
- end.
-