procedure TFPReportDesignerForm.FormCreate(Sender: TObject);
var
F : Text;
i : Integer;
begin
DesignOptions:=AllReportDesignOptions;
if PaperManager.PaperCount=0 then
PaperManager.RegisterStandardSizes;
if gTTFontCache.SearchPath.Count=0 then
begin
{$IFDEF UNIX}
{$IFDEF DARWIN}
gTTFontCache.SearchPath.Add(ExtractFilePath(ParamStr(0))+'../../../../demos/fonts/');
gTTFontCache.SearchPath.Add(GetUserDir + 'Library/Fonts/');
gTTFontCache.SearchPath.Add('/Library/Fonts/');
gTTFontCache.SearchPath.Add('/System/Library/Fonts/');
gTTFontCache.SearchPath.Add('/System/Library/Fonts/');
{$ELSE}
gTTFontCache.SearchPath.Add(ExtractFilePath(ParamStr(0))+'../demos/fonts/');
gTTFontCache.SearchPath.Add(GetUserDir + '.fonts/');
gTTFontCache.SearchPath.Add('/usr/share/fonts/truetype/ubuntu-font-family/');
gTTFontCache.SearchPath.Add('/usr/share/fonts/truetype/dejavu/');
{$ENDIF}
{$ENDIF}
end;
if (gTTFontCache.Count=0) then
gTTFontCache.ReadStandardFonts;
{$IFNDEF WINDOWS}
AssignFile(F,'/tmp/fonts.txt');
Rewrite(F);
For I:=0 to gTTFontCache.Count-1 do
Writeln(F,I,' ',gTTFontCache.Items[i].PostScriptName,' : ',gTTFontCache.Items[i].FamilyName,' : ',gTTFontCache.Items[i].HumanFriendlyName);
CloseFile(F);
{$ENDIF}
FDataParent:=TComponent.Create(nil);
FreeAndNil(TSDesign); // Remove design-time added page
FReportDesignData:=TDesignReportDataManager.Create(Self);
SetBandActionTags;
FCustomStartIndex:=Madd.Count;
AddCustomElements;
// DEMO
{$IFDEF USEDEMOREPORT}
CreateDemoReport;
CreateReportData;
{$ENDIF}
// END OF DEMO
SetFileCaption('');
FOI.OnSelectElement:=@DoSelectComponent;
FOI.OnModified:=@DoSelectionModifiedByOI;
MRUMenuManager1 := TMRUMenuManager.Create(self);
with MRUMenuManager1 do
begin
IniFileName := ChangeFileExt(ParamStr(0), '.ini');
MenuItem := MIRecent;
PopupMenu := PMRecent;
MaxItemLength := 80;
MenuCaptionMask := '(%d) %s';
OnRecentFile := @MRUMenuManager1RecentFile;
LoadRecentFilesFromIni;
maxRecent := 15;
end;
end;