fixed setting project LCLWidgetSet in defines

git-svn-id: trunk@5313 -
This commit is contained in:
mattias 2004-03-17 11:28:35 +00:00
parent 558acd0963
commit 70c99062d7
6 changed files with 292 additions and 356 deletions

View File

@ -2054,6 +2054,7 @@ var
MacroParam: string; MacroParam: string;
OldMacroLen: Integer; OldMacroLen: Integer;
Handled: Boolean; Handled: Boolean;
MacroVarName: String;
begin begin
Result:=false; Result:=false;
MacroFuncNameEnd:=MacroEnd; MacroFuncNameEnd:=MacroEnd;
@ -2071,17 +2072,18 @@ var
MacroStr:=ExecuteMacroFunction(MacroFuncName,MacroParam); MacroStr:=ExecuteMacroFunction(MacroFuncName,MacroParam);
end else begin end else begin
// Macro variable // Macro variable
MacroStr:=copy(CurValue,MacroStart+2,MacroEnd-MacroStart-3); MacroVarName:=copy(CurValue,MacroStart+2,MacroEnd-MacroStart-3);
//writeln('**** MacroStr=',MacroStr); MacroStr:=MacroVarName;
//writeln('**** MacroVarName=',MacroVarName,' ',DirDef.Values.Variables[MacroVarName]);
//writeln('DirDef.Values=',DirDef.Values.AsString); //writeln('DirDef.Values=',DirDef.Values.AsString);
if MacroStr=DefinePathMacroName then begin if MacroVarName=DefinePathMacroName then begin
MacroStr:=CurDefinePath; MacroStr:=CurDefinePath;
end else if DirDef.Values.IsDefined(MacroStr) then begin end else if DirDef.Values.IsDefined(MacroVarName) then begin
MacroStr:=DirDef.Values.Variables[MacroStr]; MacroStr:=DirDef.Values.Variables[MacroVarName];
end else begin end else begin
Handled:=false; Handled:=false;
if Assigned(FOnReadValue) then begin if Assigned(FOnReadValue) then begin
MacroParam:=MacroStr; MacroParam:=MacroVarName;
MacroStr:=''; MacroStr:='';
FOnReadValue(Self,MacroParam,MacroStr,Handled); FOnReadValue(Self,MacroParam,MacroStr,Handled);
end; end;
@ -2092,7 +2094,6 @@ var
MacroStr:=''; MacroStr:='';
end; end;
end; end;
//writeln('**** NewValue MacroStr=',MacroStr);
end; end;
NewMacroLen:=length(MacroStr); NewMacroLen:=length(MacroStr);
GrowBuffer(BufferPos+NewMacroLen-OldMacroLen+ValueLen-ValuePos+1); GrowBuffer(BufferPos+NewMacroLen-OldMacroLen+ValueLen-ValuePos+1);

View File

@ -329,6 +329,7 @@ type
function ShortenPath(const SearchPath: string; function ShortenPath(const SearchPath: string;
MakeAlwaysRelative: boolean): string; MakeAlwaysRelative: boolean): string;
function GetCustomOptions: string; function GetCustomOptions: string;
function GetEffectiveLCLWidgetType: string;
public public
{ Properties } { Properties }
property Owner: TObject read fOwner write fOwner; property Owner: TObject read fOwner write fOwner;
@ -1644,6 +1645,13 @@ begin
Result:=SpecialCharsToSpaces(Result); Result:=SpecialCharsToSpaces(Result);
end; end;
function TBaseCompilerOptions.GetEffectiveLCLWidgetType: string;
begin
Result:=LCLWidgetType;
if (Result='') or (Result='default') then
Result:=GetDefaultLCLWidgetType;
end;
function TBaseCompilerOptions.ShortenPath(const SearchPath: string; function TBaseCompilerOptions.ShortenPath(const SearchPath: string;
MakeAlwaysRelative: boolean): string; MakeAlwaysRelative: boolean): string;
begin begin
@ -4709,7 +4717,7 @@ begin
Top:= y; Top:= y;
Width:=Self.ClientWidth-28; Width:=Self.ClientWidth-28;
Height:=45; Height:=45;
Caption:=dlgLCLWidgetType; Caption:=lisLCLWidgetType;
with Items do begin with Items do begin
Add(Format(lisCOdefault, [GetDefaultLCLWidgetType])); Add(Format(lisCOdefault, [GetDefaultLCLWidgetType]));
Add('gnome'); Add('gnome');

View File

@ -898,7 +898,6 @@ resourcestring
lisCOScanForMakeMessages = 'Scan for Make messages'; lisCOScanForMakeMessages = 'Scan for Make messages';
lisCOShowAllMessages = 'Show all messages'; lisCOShowAllMessages = 'Show all messages';
dlgUnitOutp = 'Unit output directory:'; dlgUnitOutp = 'Unit output directory:';
dlgLCLWidgetType = 'LCL Widget Type';
lisCOdefault = 'default (%s)'; lisCOdefault = 'default (%s)';
dlgButApply = 'Apply'; dlgButApply = 'Apply';
dlgCOShowOptions = 'Show Options'; dlgCOShowOptions = 'Show Options';

View File

@ -5180,7 +5180,7 @@ Begin
Project1.Units[i].Modified:=false; Project1.Units[i].Modified:=false;
Project1.Modified:=false; Project1.Modified:=false;
writeln('TMainIDE.DoNewProject end ',CodeToolBoss.ConsistencyCheck); writeln('TMainIDE.DoNewProject end ');
Result:=mrOk; Result:=mrOk;
end; end;
@ -7295,115 +7295,95 @@ begin
exit; exit;
end; end;
MacroName:=lowercase(TheMacro.Name); MacroName:=lowercase(TheMacro.Name);
Handled:=true;
if MacroName='save' then begin if MacroName='save' then begin
Handled:=true;
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
Abort:=(DoSaveEditorFile(SourceNoteBook.NoteBook.PageIndex, Abort:=(DoSaveEditorFile(SourceNoteBook.NoteBook.PageIndex,
[sfCheckAmbigiousFiles])<>mrOk); [sfCheckAmbigiousFiles])<>mrOk);
s:=''; s:='';
end else if MacroName='saveall' then begin end else if MacroName='saveall' then begin
Handled:=true;
Abort:=(DoSaveAll([sfCheckAmbigiousFiles])<>mrOk); Abort:=(DoSaveAll([sfCheckAmbigiousFiles])<>mrOk);
s:=''; s:='';
end else if MacroName='edfile' then begin end else if MacroName='edfile' then begin
Handled:=true;
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
s:=Project1.UnitWithEditorIndex(SourceNoteBook.NoteBook.PageIndex).Filename s:=Project1.UnitWithEditorIndex(SourceNoteBook.NoteBook.PageIndex).Filename
else else
s:=''; s:='';
end else if MacroName='col' then begin end else if MacroName='col' then begin
Handled:=true;
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
s:=IntToStr(SourceNoteBook.GetActiveSE.EditorComponent.CaretX); s:=IntToStr(SourceNoteBook.GetActiveSE.EditorComponent.CaretX);
end else if MacroName='row' then begin end else if MacroName='row' then begin
Handled:=true;
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
s:=IntToStr(SourceNoteBook.GetActiveSE.EditorComponent.CaretY); s:=IntToStr(SourceNoteBook.GetActiveSE.EditorComponent.CaretY);
end else if MacroName='projfile' then begin end else if MacroName='projfile' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.MainFilename s:=Project1.MainFilename
else else
s:=''; s:='';
end else if MacroName='projpath' then begin end else if MacroName='projpath' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.ProjectDirectory s:=Project1.ProjectDirectory
else else
s:=''; s:='';
end else if MacroName='projunitpath' then begin end else if MacroName='projunitpath' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.CompilerOptions.GetUnitPath(false) s:=Project1.CompilerOptions.GetUnitPath(false)
else else
s:=''; s:='';
end else if MacroName='projincpath' then begin end else if MacroName='projincpath' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.CompilerOptions.GetIncludePath(false) s:=Project1.CompilerOptions.GetIncludePath(false)
else else
s:=''; s:='';
end else if MacroName='projsrcpath' then begin end else if MacroName='projsrcpath' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.CompilerOptions.GetSrcPath(false) s:=Project1.CompilerOptions.GetSrcPath(false)
else else
s:=''; s:='';
end else if MacroName='projpublishdir' then begin end else if MacroName='projpublishdir' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.PublishOptions.DestinationDirectory s:=Project1.PublishOptions.DestinationDirectory
else else
s:=''; s:='';
end else if MacroName='curtoken' then begin end else if MacroName='curtoken' then begin
Handled:=true;
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
with SourceNoteBook.GetActiveSE.EditorComponent do with SourceNoteBook.GetActiveSE.EditorComponent do
s:=GetWordAtRowCol(CaretXY); s:=GetWordAtRowCol(CaretXY);
end else if MacroName='lazarusdir' then begin end else if MacroName='lazarusdir' then begin
Handled:=true;
s:=EnvironmentOptions.LazarusDirectory; s:=EnvironmentOptions.LazarusDirectory;
end else if MacroName='lclwidgettype' then begin end else if MacroName='lclwidgettype' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.CompilerOptions.LCLWidgetType s:=Project1.CompilerOptions.LCLWidgetType
else else
s:=''; s:='';
if (s='') or (s='default') then s:=GetDefaultLCLWidgetType; if (s='') or (s='default') then s:=GetDefaultLCLWidgetType;
end else if MacroName='targetcpu' then begin end else if MacroName='targetcpu' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=lowercase(Project1.CompilerOptions.TargetCPU) s:=lowercase(Project1.CompilerOptions.TargetCPU)
else else
s:=''; s:='';
if (s='') or (s='default') then s:=GetDefaultTargetCPU; if (s='') or (s='default') then s:=GetDefaultTargetCPU;
end else if MacroName='targetos' then begin end else if MacroName='targetos' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=lowercase(Project1.CompilerOptions.TargetOS) s:=lowercase(Project1.CompilerOptions.TargetOS)
else else
s:=''; s:='';
if (s='') or (s='default') then s:=GetDefaultTargetOS; if (s='') or (s='default') then s:=GetDefaultTargetOS;
end else if MacroName='fpcsrcdir' then begin end else if MacroName='fpcsrcdir' then begin
Handled:=true;
s:=EnvironmentOptions.FPCSourceDirectory; s:=EnvironmentOptions.FPCSourceDirectory;
end else if MacroName='comppath' then begin end else if MacroName='comppath' then begin
Handled:=true;
s:=EnvironmentOptions.CompilerFilename; s:=EnvironmentOptions.CompilerFilename;
end else if MacroName='params' then begin end else if MacroName='params' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=Project1.RunParameterOptions.CmdLineParams s:=Project1.RunParameterOptions.CmdLineParams
else else
s:=''; s:='';
end else if MacroName='targetfile' then begin end else if MacroName='targetfile' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=GetProjectTargetFilename s:=GetProjectTargetFilename
else else
s:=''; s:='';
end else if MacroName='targetcmdline' then begin end else if MacroName='targetcmdline' then begin
Handled:=true;
if Project1<>nil then begin if Project1<>nil then begin
s:=Project1.RunParameterOptions.CmdLineParams; s:=Project1.RunParameterOptions.CmdLineParams;
if s='' then if s='' then
@ -7413,27 +7393,24 @@ begin
end else end else
s:=''; s:='';
end else if MacroName='testdir' then begin end else if MacroName='testdir' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=GetTestBuildDir s:=GetTestBuildDir
else else
s:=''; s:='';
end else if MacroName='runcmdline' then begin end else if MacroName='runcmdline' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=GetRunCommandLine s:=GetRunCommandLine
else else
s:=''; s:='';
end else if MacroName='projpublishdir' then begin end else if MacroName='projpublishdir' then begin
Handled:=true;
if Project1<>nil then if Project1<>nil then
s:=GetProjPublishDir s:=GetProjPublishDir
else else
s:=''; s:='';
end else if MacroName='confdir' then begin end else if MacroName='confdir' then begin
Handled:=true;
s:=GetPrimaryConfigPath; s:=GetPrimaryConfigPath;
end; end else
Handled:=false;
end; end;
function TMainIDE.OnSubstituteCompilerOption(Options: TParsedCompilerOptions; function TMainIDE.OnSubstituteCompilerOption(Options: TParsedCompilerOptions;
@ -8371,7 +8348,7 @@ begin
EnvironmentOptions.LazarusDirectory; EnvironmentOptions.LazarusDirectory;
Variables[ExternalMacroStart+'FPCSrcDir']:= Variables[ExternalMacroStart+'FPCSrcDir']:=
EnvironmentOptions.FPCSourceDirectory; EnvironmentOptions.FPCSourceDirectory;
Variables[ExternalMacroStart+'LCLWidgetType']:='gtk'; Variables[ExternalMacroStart+'LCLWidgetType']:=GetDefaultLCLWidgetType;
Variables[ExternalMacroStart+'ProjPath']:=VirtualDirectory; Variables[ExternalMacroStart+'ProjPath']:=VirtualDirectory;
end; end;
@ -10273,7 +10250,7 @@ begin
end end
else if (not (ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting])) else if (not (ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting]))
then begin then begin
// default position // default window positions
l:=NonModalIDEFormIDToEnum(ALayout.FormID); l:=NonModalIDEFormIDToEnum(ALayout.FormID);
case l of case l of
nmiwMainIDEName: nmiwMainIDEName:
@ -10329,7 +10306,6 @@ end;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
initialization initialization
{ $I mainide.lrs}
{$I images/laz_images.lrs} {$I images/laz_images.lrs}
{$I images/mainicon.lrs} {$I images/mainicon.lrs}
ShowSplashScreen:=true; ShowSplashScreen:=true;
@ -10339,6 +10315,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.717 2004/03/17 11:28:35 mattias
fixed setting project LCLWidgetSet in defines
Revision 1.716 2004/03/15 15:56:24 mattias Revision 1.716 2004/03/15 15:56:24 mattias
fixed package ID string to ID conversion fixed package ID string to ID conversion

View File

@ -2818,7 +2818,7 @@ begin
Changed:=false; Changed:=false;
Changed:=Changed or CodeToolBoss.SetGlobalValue( Changed:=Changed or CodeToolBoss.SetGlobalValue(
ExternalMacroStart+'LCLWidgetType', ExternalMacroStart+'LCLWidgetType',
Owner.CompilerOptions.LCLWidgetType); Owner.CompilerOptions.GetEffectiveLCLWidgetType);
if Owner.IsVirtual then if Owner.IsVirtual then
NewProjectDir:=VirtualDirectory NewProjectDir:=VirtualDirectory
else else
@ -2833,6 +2833,9 @@ end.
{ {
$Log$ $Log$
Revision 1.151 2004/03/17 11:28:35 mattias
fixed setting project LCLWidgetSet in defines
Revision 1.150 2004/03/15 15:56:24 mattias Revision 1.150 2004/03/15 15:56:24 mattias
fixed package ID string to ID conversion fixed package ID string to ID conversion

File diff suppressed because it is too large Load Diff