added catalan

git-svn-id: trunk@4707 -
This commit is contained in:
mattias 2003-10-11 08:33:22 +00:00
parent 48f29ad4c9
commit 1b77f736e7
7 changed files with 118 additions and 74 deletions

View File

@ -89,17 +89,35 @@ const
{ IDE Language (Human, not computer) } { IDE Language (Human, not computer) }
type type
TLazarusLanguage = (llAutomatic, TLazarusLanguage = (
llEnglish, llGerman, llSpanish, llFrench, llRussian, llPolish); llAutomatic,
llCatalan,
llEnglish,
llFrench,
llGerman,
llItalian,
llPolish,
llRussian,
llSpanish
);
const const
// language names for the config files
// for the translations see function GetLazarusLanguageNames below
LazarusLanguageNames: array[TLazarusLanguage] of string = ( LazarusLanguageNames: array[TLazarusLanguage] of string = (
'Automatic (default is english)', 'Automatic (default is english)',
'English', 'Deutsch', 'Spanish', 'French', 'Russian', 'Polish' 'Catalan',
'English',
'French',
'German',
'Italian',
'Polish',
'Russian',
'Spanish'
); );
LazarusLanguageIDs: array[TLazarusLanguage] of string = ( LazarusLanguageIDs: array[TLazarusLanguage] of string = (
'', 'en', 'de', 'es', 'fr', 'ru', 'pl' '', 'ca', 'en', 'fr', 'de', 'it', 'pl', 'ru', 'es'
); );
@ -651,6 +669,8 @@ begin
llFrench : Result:=rsLanguageFrench; llFrench : Result:=rsLanguageFrench;
llRussian : Result:=rsLanguageRussian; llRussian : Result:=rsLanguageRussian;
llPolish : Result:=rsLanguagePolish; llPolish : Result:=rsLanguagePolish;
llItalian : Result:=rsLanguageItalian;
llCatalan : Result:=rsLanguageCatalan;
end; end;
end; end;

View File

@ -1241,10 +1241,12 @@ resourcestring
rsLanguageAutomatic = 'Automatic (or english)'; rsLanguageAutomatic = 'Automatic (or english)';
rsLanguageEnglish = 'English'; rsLanguageEnglish = 'English';
rsLanguageDeutsch = 'Deutsch'; rsLanguageDeutsch = 'Deutsch';
rsLanguageSpanish = 'Español'; rsLanguageSpanish = 'Spanish';
rsLanguageFrench = 'French'; rsLanguageFrench = 'French';
rsLanguageRussian = 'òÕÓÓËÉÊ'; rsLanguageRussian = 'Russian';
rsLanguagePolish = 'polski'; rsLanguagePolish = 'polski';
rsLanguageItalian = 'Italian';
rsLanguageCatalan = 'Catalan';
//Units dependencies //Units dependencies
dlgUnitDepCaption = 'Unit dependencies'; dlgUnitDepCaption = 'Unit dependencies';
@ -1606,6 +1608,8 @@ resourcestring
lisNewDlgCreateANewProgram = 'Create a new ' lisNewDlgCreateANewProgram = 'Create a new '
+'program.%sThe program file is maintained by Lazarus.'; +'program.%sThe program file is maintained by Lazarus.';
lisNewDlgCreateANewCustomProgram = 'Create a new program.'; lisNewDlgCreateANewCustomProgram = 'Create a new program.';
lisNewCreateANewCgiApplicationTheProgramFileIsMaintained = 'Create a new '
+'cgi application.%sThe program file is maintained by Lazarus.';
lisNewDlgCreateANewStandardPackageAPackageIsACollectionOfUn = 'Create a new ' lisNewDlgCreateANewStandardPackageAPackageIsACollectionOfUn = 'Create a new '
+'standard package.%sA package is a collection of units and components.'; +'standard package.%sA package is a collection of units and components.';

View File

@ -3886,7 +3886,8 @@ begin
AText:=Format(lisAFileAlreadyExistsReplaceIt, ['"', NewFilename, '"', #13]); AText:=Format(lisAFileAlreadyExistsReplaceIt, ['"', NewFilename, '"', #13]);
Result:=MessageDlg(ACaption, AText, mtConfirmation, [mbOk, mbCancel], 0); Result:=MessageDlg(ACaption, AText, mtConfirmation, [mbOk, mbCancel], 0);
if Result=mrCancel then exit; if Result=mrCancel then exit;
end else if Project1.ProjectType in [ptProgram, ptApplication] then begin end else if Project1.ProjectType in [ptProgram,ptApplication,ptCGIApplication]
then begin
if FileExists(NewProgramFilename) then begin if FileExists(NewProgramFilename) then begin
ACaption:=lisOverwriteFile; ACaption:=lisOverwriteFile;
AText:=Format(lisAFileAlreadyExistsReplaceIt, ['"', NewProgramFilename, AText:=Format(lisAFileAlreadyExistsReplaceIt, ['"', NewProgramFilename,
@ -4096,7 +4097,7 @@ begin
// create source code // create source code
if nfCreateDefaultSrc in NewFlags then begin if nfCreateDefaultSrc in NewFlags then begin
if NewUnitType in [nuForm,nuDataModule] then begin if NewUnitType in [nuForm,nuDataModule,nuCGIDataModule] then begin
NewUnitInfo.ComponentName:=Project1.NewUniqueComponentName(NewUnitType); NewUnitInfo.ComponentName:=Project1.NewUniqueComponentName(NewUnitType);
NewUnitInfo.ComponentResourceName:=''; NewUnitInfo.ComponentResourceName:='';
CodeToolBoss.CreateFile(ChangeFileExt(NewFilename,ResourceFileExt)); CodeToolBoss.CreateFile(ChangeFileExt(NewFilename,ResourceFileExt));
@ -4118,12 +4119,13 @@ begin
and (not (nfIsNotPartOfProject in NewFlags))); and (not (nfIsNotPartOfProject in NewFlags)));
end; end;
if OldUnitIndex<0 then begin if OldUnitIndex<0 then begin
Project1.AddUnit(NewUnitInfo,(NewUnitType in [nuForm, nuUnit, nuDataModule]) Project1.AddUnit(NewUnitInfo,
and NewUnitInfo.IsPartOfProject); (NewUnitType in [nuForm,nuUnit,nuDataModule,nuCGIDataModule])
and NewUnitInfo.IsPartOfProject);
end; end;
// syntax highlighter type // syntax highlighter type
if NewUnitType in [nuForm,nuUnit,nuDataModule] then begin if NewUnitType in [nuForm,nuUnit,nuDataModule,nuCGIDataModule] then begin
NewUnitInfo.SyntaxHighlighter:=lshFreePascal; NewUnitInfo.SyntaxHighlighter:=lshFreePascal;
end else begin end else begin
NewUnitInfo.SyntaxHighlighter:= NewUnitInfo.SyntaxHighlighter:=
@ -4146,6 +4148,9 @@ begin
case NewUnitType of case NewUnitType of
nuForm: AncestorType:=TForm; nuForm: AncestorType:=TForm;
nuDataModule: AncestorType:=TDataModule; nuDataModule: AncestorType:=TDataModule;
{$IFDEF HasCGIModules}
nuCGIDataModule: AncestorType:=TCGIDataModule;
{$ENDIF}
else AncestorType:=nil; else AncestorType:=nil;
end; end;
if AncestorType<>nil then begin if AncestorType<>nil then begin
@ -4200,6 +4205,7 @@ begin
niiApplication: DoNewProject(ptApplication); niiApplication: DoNewProject(ptApplication);
niiFPCProject: DoNewProject(ptProgram); niiFPCProject: DoNewProject(ptProgram);
niiCustomProject: DoNewProject(ptCustomProgram); niiCustomProject: DoNewProject(ptCustomProgram);
niiCGIApplication: DoNewProject(ptCGIApplication);
// packages // packages
niiPackage: PkgBoss.DoNewPackage; niiPackage: PkgBoss.DoNewPackage;
else else
@ -4656,7 +4662,8 @@ Begin
Project1.Units[i].UnitName,i,Project1.Units[i]=ActiveUnitInfo)); Project1.Units[i].UnitName,i,Project1.Units[i]=ActiveUnitInfo));
end else if Project1.MainUnitID=i then begin end else if Project1.MainUnitID=i then begin
MainUnitInfo:=Project1.MainUnitInfo; MainUnitInfo:=Project1.MainUnitInfo;
if Project1.ProjectType in [ptProgram,ptApplication,ptCustomProgram] if Project1.ProjectType in [ptProgram,ptApplication,ptCustomProgram,
ptCGIApplication]
then begin then begin
MainUnitName:=CreateSrcEditPageName(MainUnitInfo.UnitName, MainUnitName:=CreateSrcEditPageName(MainUnitInfo.UnitName,
MainUnitInfo.Filename,MainUnitInfo.EditorIndex); MainUnitInfo.Filename,MainUnitInfo.EditorIndex);
@ -4986,6 +4993,11 @@ writeln('TMainIDE.DoNewProject A');
ptProgram,ptCustomProgram: ptProgram,ptCustomProgram:
// show program unit // show program unit
DoOpenMainUnit(false); DoOpenMainUnit(false);
ptCGIApplication:
// create a first datamodule
DoNewEditorFile(nuCGIDataModule,'','',
[nfIsPartOfProject,nfOpenInEditor,nfCreateDefaultSrc]);
end; end;
@ -5445,7 +5457,7 @@ begin
s:='"'+ActiveUnitInfo.Filename+'"' s:='"'+ActiveUnitInfo.Filename+'"'
else else
s:='"'+ActiveSourceEditor.PageName+'"'; s:='"'+ActiveSourceEditor.PageName+'"';
if (Project1.ProjectType in [ptProgram, ptApplication]) if (Project1.ProjectType in [ptProgram, ptApplication, ptCGIApplication])
and (ActiveUnitInfo.UnitName<>'') and (ActiveUnitInfo.UnitName<>'')
and (Project1.IndexOfUnitWithName(ActiveUnitInfo.UnitName, and (Project1.IndexOfUnitWithName(ActiveUnitInfo.UnitName,
true,ActiveUnitInfo)>=0) then true,ActiveUnitInfo)>=0) then
@ -5463,7 +5475,8 @@ begin
if Result<>mrOk then exit; if Result<>mrOk then exit;
ActiveUnitInfo.IsPartOfProject:=true; ActiveUnitInfo.IsPartOfProject:=true;
if (FilenameIsPascalUnit(ActiveUnitInfo.Filename)) if (FilenameIsPascalUnit(ActiveUnitInfo.Filename))
and (Project1.ProjectType in [ptProgram, ptApplication]) then begin and (Project1.ProjectType in [ptProgram,ptApplication,ptCGIApplication])
then begin
ActiveUnitInfo.ReadUnitNameFromSource(false); ActiveUnitInfo.ReadUnitNameFromSource(false);
ShortUnitName:=ActiveUnitInfo.CreateUnitName; ShortUnitName:=ActiveUnitInfo.CreateUnitName;
if (ShortUnitName<>'') then begin if (ShortUnitName<>'') then begin
@ -5510,7 +5523,8 @@ Begin
AnUnitInfo:=Project1.Units[TViewUnitsEntry(UnitList[i]).ID]; AnUnitInfo:=Project1.Units[TViewUnitsEntry(UnitList[i]).ID];
AnUnitInfo.IsPartOfProject:=false; AnUnitInfo.IsPartOfProject:=false;
if (Project1.MainUnitID>=0) if (Project1.MainUnitID>=0)
and (Project1.ProjectType in [ptProgram, ptApplication]) then begin and (Project1.ProjectType in [ptProgram,ptApplication,ptCGIApplication])
then begin
if (AnUnitInfo.UnitName<>'') then begin if (AnUnitInfo.UnitName<>'') then begin
if CodeToolBoss.RemoveUnitFromAllUsesSections( if CodeToolBoss.RemoveUnitFromAllUsesSections(
Project1.MainUnitInfo.Source,AnUnitInfo.UnitName) Project1.MainUnitInfo.Source,AnUnitInfo.UnitName)
@ -5720,7 +5734,8 @@ begin
Result := mrCancel; Result := mrCancel;
// Check if we can run this project // Check if we can run this project
if not (Project1.ProjectType in [ptProgram, ptApplication, ptCustomProgram]) if not (Project1.ProjectType in [ptProgram, ptApplication, ptCustomProgram,
ptCGIApplication])
or (Project1.MainUnitID < 0) or (Project1.MainUnitID < 0)
or (ToolStatus <> itNone) or (ToolStatus <> itNone)
then Exit; then Exit;
@ -9180,7 +9195,8 @@ begin
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]); BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
AnUnitInfo.IsPartOfProject:=true; AnUnitInfo.IsPartOfProject:=true;
if FilenameIsPascalUnit(AnUnitInfo.Filename) if FilenameIsPascalUnit(AnUnitInfo.Filename)
and (Project1.ProjectType in [ptProgram, ptApplication]) then begin and (Project1.ProjectType in [ptProgram, ptApplication, ptCGIApplication])
then begin
AnUnitInfo.ReadUnitNameFromSource(false); AnUnitInfo.ReadUnitNameFromSource(false);
ShortUnitName:=AnUnitInfo.UnitName; ShortUnitName:=AnUnitInfo.UnitName;
if (ShortUnitName<>'') then begin if (ShortUnitName<>'') then begin
@ -9209,7 +9225,8 @@ begin
Result:=mrOk; Result:=mrOk;
AnUnitInfo.IsPartOfProject:=false; AnUnitInfo.IsPartOfProject:=false;
if (Project1.MainUnitID>=0) if (Project1.MainUnitID>=0)
and (Project1.ProjectType in [ptProgram, ptApplication]) then begin and (Project1.ProjectType in [ptProgram, ptApplication, ptCGIApplication])
then begin
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]); BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
ShortUnitName:=AnUnitInfo.UnitName; ShortUnitName:=AnUnitInfo.UnitName;
if (ShortUnitName<>'') then begin if (ShortUnitName<>'') then begin
@ -9800,6 +9817,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.655 2003/10/11 08:33:22 mattias
added catalan
Revision 1.654 2003/10/08 08:22:32 mattias Revision 1.654 2003/10/08 08:22:32 mattias
improved FPC Src template for new chaotic FPC sources improved FPC Src template for new chaotic FPC sources

View File

@ -55,6 +55,7 @@ type
niiApplication,// Project: Application niiApplication,// Project: Application
niiFPCProject, // Project: with hidden main file niiFPCProject, // Project: with hidden main file
niiCustomProject,// Project: pascal program without any specials niiCustomProject,// Project: pascal program without any specials
niiCGIApplication,// Project: TCGIApplication using package cgilaz
niiPackage // standard package niiPackage // standard package
); );
TNewIDEItemTypes = set of TNewIDEItemType; TNewIDEItemTypes = set of TNewIDEItemType;
@ -517,6 +518,10 @@ begin
niiCustomProject: niiCustomProject:
Result:=lisNewDlgCreateANewCustomProgram; Result:=lisNewDlgCreateANewCustomProgram;
niiCGIApplication:
Result:=Format(lisNewCreateANewCgiApplicationTheProgramFileIsMaintained, [
#13]);
niiPackage: niiPackage:
Result:=Format( Result:=Format(
lisNewDlgCreateANewStandardPackageAPackageIsACollectionOfUn, [#13#13]); lisNewDlgCreateANewStandardPackageAPackageIsACollectionOfUn, [#13#13]);
@ -563,14 +568,16 @@ begin
TNewIDEItemTemplate.Create(niiFPCProject,'FPC Project',niifCopy,[])); TNewIDEItemTemplate.Create(niiFPCProject,'FPC Project',niifCopy,[]));
NewCategory.Add( NewCategory.Add(
TNewIDEItemTemplate.Create(niiCustomProject,'Custom Project',niifCopy,[])); TNewIDEItemTemplate.Create(niiCustomProject,'Custom Project',niifCopy,[]));
{$IFDEF HasCGIModules}
NewCategory.Add(
TNewIDEItemTemplate.Create(niiCGIApplication,'CGI Application',niifCopy,[]));
{$ENDIF}
{$IFNDEF DisablePkgs}
// category package // category package
NewCategory:=TNewIDEItemCategory.Create('Package'); NewCategory:=TNewIDEItemCategory.Create('Package');
Add(NewCategory); Add(NewCategory);
NewCategory.Add( NewCategory.Add(
TNewIDEItemTemplate.Create(niiPackage,'Standard Package',niifCopy,[])); TNewIDEItemTemplate.Create(niiPackage,'Standard Package',niifCopy,[]));
{$ENDIF}
end; end;
destructor TNewIDEItemCategories.Destroy; destructor TNewIDEItemCategories.Destroy;

View File

@ -264,7 +264,7 @@ type
{ TProject } { TProject }
TProjectType = // for a description see ProjectTypeDescriptions below TProjectType = // for a description see ProjectTypeDescriptions below
(ptApplication, ptProgram, ptCustomProgram); (ptApplication, ptProgram, ptCustomProgram, ptCGIApplication);
TProjectFlag = ( TProjectFlag = (
pfSaveClosedUnits, // save info about closed files (not part of project) pfSaveClosedUnits, // save info about closed files (not part of project)
@ -299,7 +299,7 @@ type
fJumpHistory: TProjectJumpHistory; fJumpHistory: TProjectJumpHistory;
fLastReadLPIFileDate: TDateTime; fLastReadLPIFileDate: TDateTime;
fLastReadLPIFilename: string; fLastReadLPIFilename: string;
fMainUnitID: Integer; // only for ptApplication, ptProgram fMainUnitID: Integer; // only for ptApplication, ptProgram, ptCGIApplication
fModified: boolean; fModified: boolean;
FOnBeginUpdate: TNotifyEvent; FOnBeginUpdate: TNotifyEvent;
FOnEndUpdate: TEndUpdateProjectEvent; FOnEndUpdate: TEndUpdateProjectEvent;
@ -490,7 +490,7 @@ const
ResourceFileExt = '.lrs'; ResourceFileExt = '.lrs';
ProjectTypeNames : array[TProjectType] of string = ( ProjectTypeNames : array[TProjectType] of string = (
'Application', 'Program', 'Custom program' 'Application', 'Program', 'Custom program', 'CGI Application'
); );
ProjectTypeDescriptions : array[TProjectType] of string = ( ProjectTypeDescriptions : array[TProjectType] of string = (
@ -507,14 +507,19 @@ const
// ptCustomProgram // ptCustomProgram
,'Custom program:'#13 ,'Custom program:'#13
+'A freepascal program.' +'A freepascal program.'
// ptCGIApplication
,'CGI Application'#13
+'A cgi freepascal program. The program file is '
+'automatically maintained by lazarus.'#13
); );
ProjectDefaultExt : array[TProjectType] of string = ( ProjectDefaultExt : array[TProjectType] of string = (
'.lpr','.pas','.pas' '.lpr','.pas','.pas', 'pas'
); );
UnitTypeDefaultExt: array[TNewUnitType] of string = ( UnitTypeDefaultExt: array[TNewUnitType] of string = (
'.pas', '.pas', '.pas', '.pas', '.txt', '.pas' '.pas', '.pas', '.pas', '.pas', '.pas', '.txt', '.pas'
); );
DefaultProjectFlags = [pfSaveClosedUnits]; DefaultProjectFlags = [pfSaveClosedUnits];
@ -970,7 +975,7 @@ begin
if fSource=nil then exit; if fSource=nil then exit;
NewSource:=''; NewSource:='';
LE:=EndOfLine; LE:=EndOfLine;
if NewUnitType in [nuForm,nuUnit,nuDataModule] then begin if NewUnitType in [nuForm,nuUnit,nuDataModule,nuCGIDataModule] then begin
fUnitName:=NewUnitName; fUnitName:=NewUnitName;
AResourceFilename:=fUnitName+ResourceFileExt; AResourceFilename:=fUnitName+ResourceFileExt;
NewSource:=Beautified( NewSource:=Beautified(
@ -991,18 +996,32 @@ begin
+'implementation'+LE); +'implementation'+LE);
end; end;
nuForm, nuDataModule: nuForm, nuDataModule, nuCGIDataModule:
begin begin
NewSource:=NewSource+Beautified( if NewUnitType=nuForm then
' Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs;'+LE NewSource:=NewSource+Beautified(
+LE ' Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs;'+LE
+'type'+LE); +LE
+'type'+LE)
else if NewUnitType=nuDataModule then
NewSource:=NewSource+Beautified(
' Classes, SysUtils, LResources, Forms, Controls, Dialogs;'+LE
+LE
+'type'+LE)
else if NewUnitType=nuCGIDataModule then
NewSource:=NewSource+Beautified(
' Classes, SysUtils, LResources, cgiModules;'+LE
+LE
+'type'+LE);
if NewUnitType=nuForm then if NewUnitType=nuForm then
NewSource:=NewSource+Beautified( NewSource:=NewSource+Beautified(
+' T'+fComponentName+' = class(TForm)'+LE) +' T'+fComponentName+' = class(TForm)'+LE)
else else if NewUnitType=nuDataModule then
NewSource:=NewSource+Beautified( NewSource:=NewSource+Beautified(
+' T'+fComponentName+' = class(TDataModule)'+LE); +' T'+fComponentName+' = class(TDataModule)'+LE)
else if NewUnitType=nuCGIDataModule then
NewSource:=NewSource+Beautified(
+' T'+fComponentName+' = class(TCGIDataModule)'+LE);
NewSource:=NewSource+Beautified( NewSource:=NewSource+Beautified(
' private'+LE); ' private'+LE);
NewSource:=NewSource NewSource:=NewSource
@ -1029,6 +1048,7 @@ begin
+LE +LE
+'end.'+LE +'end.'+LE
+LE); +LE);
end else if NewUnitType in [nuCustomProgram] then begin end else if NewUnitType in [nuCustomProgram] then begin
NewSource:=NewSource+Beautified( NewSource:=NewSource+Beautified(
+'program CustomProgram;'+LE +'program CustomProgram;'+LE
@ -1228,7 +1248,7 @@ begin
// create program source // create program source
NewSource:=TStringList.Create; NewSource:=TStringList.Create;
case fProjectType of case fProjectType of
ptProgram, ptApplication, ptCustomProgram: ptProgram, ptApplication, ptCustomProgram, ptCGIApplication:
begin begin
NewPrgBuf:=CodeToolBoss.CreateFile( NewPrgBuf:=CodeToolBoss.CreateFile(
'project1'+ProjectDefaultExt[fProjectType]); 'project1'+ProjectDefaultExt[fProjectType]);
@ -1252,6 +1272,8 @@ begin
Add(' Interfaces,'); Add(' Interfaces,');
Add(' Forms;'); Add(' Forms;');
end; end;
ptCGIApplication:
Add(' cgiModules;');
else else
Add(' { add your units here };'); Add(' { add your units here };');
end; end;
@ -1784,7 +1806,7 @@ var u:integer;
begin begin
u:=1; u:=1;
case NewUnitType of case NewUnitType of
nuForm,nuUnit,nuDataModule: Prefix:='unit'; nuForm,nuUnit,nuDataModule,nuCGIDataModule: Prefix:='unit';
else Prefix:='text' else Prefix:='text'
end; end;
while (UnitNameExists(Prefix+IntToStr(u))) do inc(u); while (UnitNameExists(Prefix+IntToStr(u))) do inc(u);
@ -1818,6 +1840,7 @@ begin
case NewUnitType of case NewUnitType of
nuForm, nuUnit: Prefix:='Form'; nuForm, nuUnit: Prefix:='Form';
nuDataModule: Prefix:='DataModule'; nuDataModule: Prefix:='DataModule';
nuCGIDataModule: Prefix:='CGIDataModule';
else else
Prefix:='form'; Prefix:='form';
end; end;
@ -2435,7 +2458,8 @@ begin
end; end;
end; end;
end; end;
if (OldUnitName<>'') and (ProjectType in [ptProgram, ptApplication]) then if (OldUnitName<>'')
and (ProjectType in [ptProgram, ptApplication, ptCGIApplication]) then
begin begin
// rename unit in program uses section // rename unit in program uses section
CodeToolBoss.RenameUsedUnit(MainUnitInfo.Source CodeToolBoss.RenameUsedUnit(MainUnitInfo.Source
@ -2712,6 +2736,9 @@ end.
{ {
$Log$ $Log$
Revision 1.138 2003/10/11 08:33:22 mattias
added catalan
Revision 1.137 2003/09/18 09:21:02 mattias Revision 1.137 2003/09/18 09:21:02 mattias
renamed LCLLinux to LCLIntf renamed LCLLinux to LCLIntf

View File

@ -53,6 +53,7 @@ type
nuUnit, // unit nuUnit, // unit
nuForm, // unit with form nuForm, // unit with form
nuDataModule, // unit with data module nuDataModule, // unit with data module
nuCGIDataModule, // unit with cgi data module
nuText, nuText,
nuCustomProgram // program nuCustomProgram // program
); );

View File

@ -1154,8 +1154,8 @@ end;
function InitResourceComponent(Instance: TComponent; function InitResourceComponent(Instance: TComponent;
RootAncestor: TClass):Boolean; RootAncestor: TClass):Boolean;
function InitComponent(ClassType: TClass): Boolean; { Old hack. Do we still need this?
procedure ApplyVisible; procedure ApplyVisible;
var var
i: integer; i: integer;
@ -1174,43 +1174,8 @@ function InitResourceComponent(Instance: TComponent;
AControl.ControlState-[csVisibleSetInLoading]; AControl.ControlState-[csVisibleSetInLoading];
end; end;
end; end;
end; end;}
var
CompResource:TLResource;
MemStream: TMemoryStream;
begin
//writeln('[InitComponent] ',ClassType.Classname,' ',Instance<>nil);
Result:=false;
if (ClassType=TComponent) or (ClassType=RootAncestor) then exit;
if Assigned(ClassType.ClassParent) then
Result:=InitComponent(ClassType.ClassParent);
CompResource:=LazarusResources.Find(ClassType.ClassName);
if (CompResource = nil) or (CompResource.Value='') then exit;
//writeln('[InitComponent] CompResource found for ',ClassType.Classname);
if (ClassType.InheritsFrom(TForm))
and (CompResource.ValueType<>'FORMDATA') then exit;
MemStream:=TMemoryStream.Create;
try
MemStream.Write(CompResource.Value[1],length(CompResource.Value));
MemStream.Position:=0;
//writeln('Form Stream "',ClassType.ClassName,'" Signature=',copy(CompResource.Value,1,4));
try
Instance:=MemStream.ReadComponent(Instance);
except
on E: Exception do begin
writeln(Format(rsFormStreamingError, [ClassType.ClassName, E.Message])
);
exit;
end;
end;
finally
//ApplyVisible;
MemStream.Free;
end;
Result:=true;
end;
// InitResourceComponent // InitResourceComponent
//var LocalizedLoading: Boolean; //var LocalizedLoading: Boolean;
begin begin