mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:56:10 +02:00
fixed setting project LCLWidgetSet in defines
git-svn-id: trunk@5313 -
This commit is contained in:
parent
558acd0963
commit
70c99062d7
@ -2054,6 +2054,7 @@ var
|
||||
MacroParam: string;
|
||||
OldMacroLen: Integer;
|
||||
Handled: Boolean;
|
||||
MacroVarName: String;
|
||||
begin
|
||||
Result:=false;
|
||||
MacroFuncNameEnd:=MacroEnd;
|
||||
@ -2071,17 +2072,18 @@ var
|
||||
MacroStr:=ExecuteMacroFunction(MacroFuncName,MacroParam);
|
||||
end else begin
|
||||
// Macro variable
|
||||
MacroStr:=copy(CurValue,MacroStart+2,MacroEnd-MacroStart-3);
|
||||
//writeln('**** MacroStr=',MacroStr);
|
||||
MacroVarName:=copy(CurValue,MacroStart+2,MacroEnd-MacroStart-3);
|
||||
MacroStr:=MacroVarName;
|
||||
//writeln('**** MacroVarName=',MacroVarName,' ',DirDef.Values.Variables[MacroVarName]);
|
||||
//writeln('DirDef.Values=',DirDef.Values.AsString);
|
||||
if MacroStr=DefinePathMacroName then begin
|
||||
if MacroVarName=DefinePathMacroName then begin
|
||||
MacroStr:=CurDefinePath;
|
||||
end else if DirDef.Values.IsDefined(MacroStr) then begin
|
||||
MacroStr:=DirDef.Values.Variables[MacroStr];
|
||||
end else if DirDef.Values.IsDefined(MacroVarName) then begin
|
||||
MacroStr:=DirDef.Values.Variables[MacroVarName];
|
||||
end else begin
|
||||
Handled:=false;
|
||||
if Assigned(FOnReadValue) then begin
|
||||
MacroParam:=MacroStr;
|
||||
MacroParam:=MacroVarName;
|
||||
MacroStr:='';
|
||||
FOnReadValue(Self,MacroParam,MacroStr,Handled);
|
||||
end;
|
||||
@ -2092,7 +2094,6 @@ var
|
||||
MacroStr:='';
|
||||
end;
|
||||
end;
|
||||
//writeln('**** NewValue MacroStr=',MacroStr);
|
||||
end;
|
||||
NewMacroLen:=length(MacroStr);
|
||||
GrowBuffer(BufferPos+NewMacroLen-OldMacroLen+ValueLen-ValuePos+1);
|
||||
|
@ -329,6 +329,7 @@ type
|
||||
function ShortenPath(const SearchPath: string;
|
||||
MakeAlwaysRelative: boolean): string;
|
||||
function GetCustomOptions: string;
|
||||
function GetEffectiveLCLWidgetType: string;
|
||||
public
|
||||
{ Properties }
|
||||
property Owner: TObject read fOwner write fOwner;
|
||||
@ -1644,6 +1645,13 @@ begin
|
||||
Result:=SpecialCharsToSpaces(Result);
|
||||
end;
|
||||
|
||||
function TBaseCompilerOptions.GetEffectiveLCLWidgetType: string;
|
||||
begin
|
||||
Result:=LCLWidgetType;
|
||||
if (Result='') or (Result='default') then
|
||||
Result:=GetDefaultLCLWidgetType;
|
||||
end;
|
||||
|
||||
function TBaseCompilerOptions.ShortenPath(const SearchPath: string;
|
||||
MakeAlwaysRelative: boolean): string;
|
||||
begin
|
||||
@ -4709,7 +4717,7 @@ begin
|
||||
Top:= y;
|
||||
Width:=Self.ClientWidth-28;
|
||||
Height:=45;
|
||||
Caption:=dlgLCLWidgetType;
|
||||
Caption:=lisLCLWidgetType;
|
||||
with Items do begin
|
||||
Add(Format(lisCOdefault, [GetDefaultLCLWidgetType]));
|
||||
Add('gnome');
|
||||
|
@ -898,7 +898,6 @@ resourcestring
|
||||
lisCOScanForMakeMessages = 'Scan for Make messages';
|
||||
lisCOShowAllMessages = 'Show all messages';
|
||||
dlgUnitOutp = 'Unit output directory:';
|
||||
dlgLCLWidgetType = 'LCL Widget Type';
|
||||
lisCOdefault = 'default (%s)';
|
||||
dlgButApply = 'Apply';
|
||||
dlgCOShowOptions = 'Show Options';
|
||||
|
39
ide/main.pp
39
ide/main.pp
@ -5180,7 +5180,7 @@ Begin
|
||||
Project1.Units[i].Modified:=false;
|
||||
Project1.Modified:=false;
|
||||
|
||||
writeln('TMainIDE.DoNewProject end ',CodeToolBoss.ConsistencyCheck);
|
||||
writeln('TMainIDE.DoNewProject end ');
|
||||
Result:=mrOk;
|
||||
end;
|
||||
|
||||
@ -7295,115 +7295,95 @@ begin
|
||||
exit;
|
||||
end;
|
||||
MacroName:=lowercase(TheMacro.Name);
|
||||
Handled:=true;
|
||||
if MacroName='save' then begin
|
||||
Handled:=true;
|
||||
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
|
||||
Abort:=(DoSaveEditorFile(SourceNoteBook.NoteBook.PageIndex,
|
||||
[sfCheckAmbigiousFiles])<>mrOk);
|
||||
s:='';
|
||||
end else if MacroName='saveall' then begin
|
||||
Handled:=true;
|
||||
Abort:=(DoSaveAll([sfCheckAmbigiousFiles])<>mrOk);
|
||||
s:='';
|
||||
end else if MacroName='edfile' then begin
|
||||
Handled:=true;
|
||||
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
|
||||
s:=Project1.UnitWithEditorIndex(SourceNoteBook.NoteBook.PageIndex).Filename
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='col' then begin
|
||||
Handled:=true;
|
||||
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
|
||||
s:=IntToStr(SourceNoteBook.GetActiveSE.EditorComponent.CaretX);
|
||||
end else if MacroName='row' then begin
|
||||
Handled:=true;
|
||||
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
|
||||
s:=IntToStr(SourceNoteBook.GetActiveSE.EditorComponent.CaretY);
|
||||
end else if MacroName='projfile' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.MainFilename
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='projpath' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.ProjectDirectory
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='projunitpath' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.CompilerOptions.GetUnitPath(false)
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='projincpath' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.CompilerOptions.GetIncludePath(false)
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='projsrcpath' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.CompilerOptions.GetSrcPath(false)
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='projpublishdir' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.PublishOptions.DestinationDirectory
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='curtoken' then begin
|
||||
Handled:=true;
|
||||
if (SourceNoteBook<>nil) and (SourceNoteBook.NoteBook<>nil) then
|
||||
with SourceNoteBook.GetActiveSE.EditorComponent do
|
||||
s:=GetWordAtRowCol(CaretXY);
|
||||
end else if MacroName='lazarusdir' then begin
|
||||
Handled:=true;
|
||||
s:=EnvironmentOptions.LazarusDirectory;
|
||||
end else if MacroName='lclwidgettype' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.CompilerOptions.LCLWidgetType
|
||||
else
|
||||
s:='';
|
||||
if (s='') or (s='default') then s:=GetDefaultLCLWidgetType;
|
||||
end else if MacroName='targetcpu' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=lowercase(Project1.CompilerOptions.TargetCPU)
|
||||
else
|
||||
s:='';
|
||||
if (s='') or (s='default') then s:=GetDefaultTargetCPU;
|
||||
end else if MacroName='targetos' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=lowercase(Project1.CompilerOptions.TargetOS)
|
||||
else
|
||||
s:='';
|
||||
if (s='') or (s='default') then s:=GetDefaultTargetOS;
|
||||
end else if MacroName='fpcsrcdir' then begin
|
||||
Handled:=true;
|
||||
s:=EnvironmentOptions.FPCSourceDirectory;
|
||||
end else if MacroName='comppath' then begin
|
||||
Handled:=true;
|
||||
s:=EnvironmentOptions.CompilerFilename;
|
||||
end else if MacroName='params' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=Project1.RunParameterOptions.CmdLineParams
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='targetfile' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=GetProjectTargetFilename
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='targetcmdline' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then begin
|
||||
s:=Project1.RunParameterOptions.CmdLineParams;
|
||||
if s='' then
|
||||
@ -7413,27 +7393,24 @@ begin
|
||||
end else
|
||||
s:='';
|
||||
end else if MacroName='testdir' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=GetTestBuildDir
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='runcmdline' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=GetRunCommandLine
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='projpublishdir' then begin
|
||||
Handled:=true;
|
||||
if Project1<>nil then
|
||||
s:=GetProjPublishDir
|
||||
else
|
||||
s:='';
|
||||
end else if MacroName='confdir' then begin
|
||||
Handled:=true;
|
||||
s:=GetPrimaryConfigPath;
|
||||
end;
|
||||
end else
|
||||
Handled:=false;
|
||||
end;
|
||||
|
||||
function TMainIDE.OnSubstituteCompilerOption(Options: TParsedCompilerOptions;
|
||||
@ -8371,7 +8348,7 @@ begin
|
||||
EnvironmentOptions.LazarusDirectory;
|
||||
Variables[ExternalMacroStart+'FPCSrcDir']:=
|
||||
EnvironmentOptions.FPCSourceDirectory;
|
||||
Variables[ExternalMacroStart+'LCLWidgetType']:='gtk';
|
||||
Variables[ExternalMacroStart+'LCLWidgetType']:=GetDefaultLCLWidgetType;
|
||||
Variables[ExternalMacroStart+'ProjPath']:=VirtualDirectory;
|
||||
end;
|
||||
|
||||
@ -10273,7 +10250,7 @@ begin
|
||||
end
|
||||
else if (not (ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting]))
|
||||
then begin
|
||||
// default position
|
||||
// default window positions
|
||||
l:=NonModalIDEFormIDToEnum(ALayout.FormID);
|
||||
case l of
|
||||
nmiwMainIDEName:
|
||||
@ -10329,7 +10306,6 @@ end;
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
initialization
|
||||
{ $I mainide.lrs}
|
||||
{$I images/laz_images.lrs}
|
||||
{$I images/mainicon.lrs}
|
||||
ShowSplashScreen:=true;
|
||||
@ -10339,6 +10315,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$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
|
||||
fixed package ID string to ID conversion
|
||||
|
||||
|
@ -2818,7 +2818,7 @@ begin
|
||||
Changed:=false;
|
||||
Changed:=Changed or CodeToolBoss.SetGlobalValue(
|
||||
ExternalMacroStart+'LCLWidgetType',
|
||||
Owner.CompilerOptions.LCLWidgetType);
|
||||
Owner.CompilerOptions.GetEffectiveLCLWidgetType);
|
||||
if Owner.IsVirtual then
|
||||
NewProjectDir:=VirtualDirectory
|
||||
else
|
||||
@ -2833,6 +2833,9 @@ end.
|
||||
|
||||
{
|
||||
$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
|
||||
fixed package ID string to ID conversion
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user