mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-01 23:19:39 +01:00
fixed typos makro
git-svn-id: trunk@9271 -
This commit is contained in:
parent
8f6fad5537
commit
9c1a175b91
@ -738,7 +738,7 @@ begin
|
||||
if Result='' then exit;
|
||||
Result:=TrimFilename(SetDirSeparators(Result));
|
||||
|
||||
// check for $(Delphi) makro
|
||||
// check for $(Delphi) macro
|
||||
p:=System.Pos('$(DELPHI)',Result);
|
||||
//DebugLn('ExpandDelphiFilename Result="',Result,'" ',dbgs(p));
|
||||
if p>0 then begin
|
||||
@ -747,10 +747,10 @@ begin
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
// check for other makros
|
||||
// check for other macros
|
||||
p:=System.Pos('$(',Result);
|
||||
if p>0 then begin
|
||||
// path makros are not supported
|
||||
// path macros are not supported
|
||||
// -> ignore
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
@ -73,13 +73,13 @@ begin
|
||||
AEditor:=SrcEdit.EditorControl as TCustomSynEdit;
|
||||
|
||||
Pattern:=TemplateValue;
|
||||
if copy(Pattern,1,length(CodeTemplateMakroMagic))=CodeTemplateMakroMagic
|
||||
if copy(Pattern,1,length(CodeTemplateMacroMagic))=CodeTemplateMacroMagic
|
||||
then begin
|
||||
// macros enabled
|
||||
LazarusIDE.SaveSourceEditorChangesToCodeCache(-1);
|
||||
|
||||
// remove first line (i.e. macro enabled flag)
|
||||
i:=length(CodeTemplateMakroMagic);
|
||||
i:=length(CodeTemplateMacroMagic);
|
||||
while (i<=length(Pattern)) and (not (Pattern[i] in [#10,#13])) do inc(i);
|
||||
if (i<length(Pattern)) and (Pattern[i+1] in [#10,#13])
|
||||
and (Pattern[i+1]<>Pattern[i]) then
|
||||
|
||||
@ -47,7 +47,7 @@ type
|
||||
OkButton: TBitBtn;
|
||||
CancelButton: TBitBtn;
|
||||
InsertMacroButton: TButton;
|
||||
UseMakrosCheckBox: TCheckBox;
|
||||
UseMacrosCheckBox: TCheckBox;
|
||||
EditButton: TButton;
|
||||
DeleteButton: TButton;
|
||||
TemplateListBox: TListBox;
|
||||
@ -127,30 +127,30 @@ function EditCodeTemplate(ASynAutoComplete: TSynEditAutoComplete;
|
||||
procedure CreateStandardCodeMacros;
|
||||
|
||||
// standard code macros
|
||||
function CodeMakroUpper(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroUpper(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroLower(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroLower(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroPaste(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroPaste(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroProcedureHead(const Parameter: string;
|
||||
function CodeMacroProcedureHead(const Parameter: string;
|
||||
InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroProcedureName(const Parameter: string;
|
||||
function CodeMacroProcedureName(const Parameter: string;
|
||||
InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroDate(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroDate(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroTime(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroTime(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
function CodeMakroDateTime(const Parameter: string;
|
||||
function CodeMacroDateTime(const Parameter: string;
|
||||
InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
@ -229,7 +229,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function CodeMakroUpper(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroUpper(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
begin
|
||||
@ -237,7 +237,7 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CodeMakroLower(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroLower(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
begin
|
||||
@ -245,7 +245,7 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CodeMakroPaste(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroPaste(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
var Value, ErrorMsg: string): boolean;
|
||||
begin
|
||||
@ -253,7 +253,7 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CodeMakroProcedureHead(const Parameter: string;
|
||||
function CodeMacroProcedureHead(const Parameter: string;
|
||||
InteractiveValue: TPersistent; SrcEdit: TSourceEditorInterface; var Value,
|
||||
ErrorMsg: string): boolean;
|
||||
var
|
||||
@ -262,7 +262,7 @@ var
|
||||
i: Integer;
|
||||
Attributes: TProcHeadAttributes;
|
||||
begin
|
||||
//debugln('CodeMakroProcedureHead A ',Parameter);
|
||||
//debugln('CodeMacroProcedureHead A ',Parameter);
|
||||
|
||||
// parse attributes
|
||||
Params:=SplitString(Parameter,',');
|
||||
@ -323,7 +323,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
//debugln('CodeMakroProcedureHead B ');
|
||||
//debugln('CodeMacroProcedureHead B ');
|
||||
if not CodeToolBoss.ExtractProcedureHeader(
|
||||
SrcEdit.CodeToolsBuffer as TCodeBuffer,
|
||||
SrcEdit.CursorTextXY.X,SrcEdit.CursorTextXY.Y,Attributes,Value) then
|
||||
@ -333,22 +333,22 @@ begin
|
||||
LazarusIDE.DoJumpToCodeToolBossError;
|
||||
exit;
|
||||
end;
|
||||
//debugln('CodeMakroProcedureHead C Value="',Value,'"');
|
||||
//debugln('CodeMacroProcedureHead C Value="',Value,'"');
|
||||
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CodeMakroProcedureName(const Parameter: string;
|
||||
function CodeMacroProcedureName(const Parameter: string;
|
||||
InteractiveValue: TPersistent; SrcEdit: TSourceEditorInterface; var Value,
|
||||
ErrorMsg: string): boolean;
|
||||
begin
|
||||
Result:=CodeMakroProcedureHead(
|
||||
Result:=CodeMacroProcedureHead(
|
||||
'WithoutParamList,WithoutBrackets,WithoutSemicolon',
|
||||
InteractiveValue,SrcEdit,Value,ErrorMsg);
|
||||
debugln('CodeMakroProcedureName ',Value);
|
||||
debugln('CodeMacroProcedureName ',Value);
|
||||
end;
|
||||
|
||||
function CodeMakroDate(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroDate(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface; var Value, ErrorMsg: string): boolean;
|
||||
begin
|
||||
if Parameter<>'' then
|
||||
@ -358,7 +358,7 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CodeMakroTime(const Parameter: string; InteractiveValue: TPersistent;
|
||||
function CodeMacroTime(const Parameter: string; InteractiveValue: TPersistent;
|
||||
SrcEdit: TSourceEditorInterface; var Value, ErrorMsg: string): boolean;
|
||||
begin
|
||||
if Parameter<>'' then
|
||||
@ -368,7 +368,7 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CodeMakroDateTime(const Parameter: string;
|
||||
function CodeMacroDateTime(const Parameter: string;
|
||||
InteractiveValue: TPersistent; SrcEdit: TSourceEditorInterface; var Value,
|
||||
ErrorMsg: string): boolean;
|
||||
begin
|
||||
@ -397,13 +397,13 @@ begin
|
||||
IDECodeMacros:=TLazCodeMacros.Create;
|
||||
RegisterCodeMacro('Upper','uppercase string',
|
||||
'Uppercase string given as parameter',
|
||||
@CodeMakroUpper,nil);
|
||||
@CodeMacroUpper,nil);
|
||||
RegisterCodeMacro('Lower','lowercase string',
|
||||
'Lowercase string given as parameter',
|
||||
@CodeMakroLower,nil);
|
||||
@CodeMacroLower,nil);
|
||||
RegisterCodeMacro('Paste','paste clipboard',
|
||||
'Paste text from clipboard',
|
||||
@CodeMakroPaste,nil);
|
||||
@CodeMacroPaste,nil);
|
||||
RegisterCodeMacro('ProcedureHead','insert procedure head',
|
||||
'Insert header of current procedure'#13
|
||||
+#13
|
||||
@ -430,19 +430,19 @@ begin
|
||||
+' // with this option you get ''Do ;'')'#13
|
||||
+'WithoutBrackets, // skip start- and end-bracket of parameter list'#13
|
||||
+'WithoutSemicolon, // skip semicolon at end'#13,
|
||||
@CodeMakroProcedureHead,nil);
|
||||
@CodeMacroProcedureHead,nil);
|
||||
RegisterCodeMacro('ProcedureName','insert procedure name',
|
||||
'Insert name of current procedure',
|
||||
@CodeMakroProcedureName,nil);
|
||||
@CodeMacroProcedureName,nil);
|
||||
RegisterCodeMacro('Date','insert date',
|
||||
'Insert date. Optional: format string',
|
||||
@CodeMakroDate,nil);
|
||||
@CodeMacroDate,nil);
|
||||
RegisterCodeMacro('Time','insert time',
|
||||
'Insert time. Optional: format string',
|
||||
@CodeMakroTime,nil);
|
||||
@CodeMacroTime,nil);
|
||||
RegisterCodeMacro('DateTime','insert date and time',
|
||||
'Insert date and time. Optional: format string',
|
||||
@CodeMakroDateTime,nil);
|
||||
@CodeMacroDateTime,nil);
|
||||
end;
|
||||
|
||||
{ TCodeTemplateEditForm }
|
||||
@ -604,7 +604,7 @@ begin
|
||||
TemplateGroupBox.Caption:=lisCTDTemplates;
|
||||
OkButton.Caption:=lisLazBuildOk;
|
||||
FilenameGroupBox.Caption:=lisToDoLFile;
|
||||
UseMakrosCheckBox.Caption:=lisEnableMakros;
|
||||
UseMacrosCheckBox.Caption:=lisEnableMacros;
|
||||
InsertMacroButton.Caption:=lisCTInsertMacro;
|
||||
|
||||
FilenameEdit.Text:=EditorOpts.CodeTemplateFileName;
|
||||
@ -841,13 +841,13 @@ end;
|
||||
|
||||
procedure TCodeTemplateDialog.ShowCurCodeTemplate;
|
||||
var
|
||||
EnableMakros: boolean;
|
||||
EnableMacros: boolean;
|
||||
LineCount: integer;
|
||||
|
||||
procedure AddLine(const s: string);
|
||||
begin
|
||||
if (LineCount=0) and (s=CodeTemplateMakroMagic) then
|
||||
EnableMakros:=true
|
||||
if (LineCount=0) and (s=CodeTemplateMacroMagic) then
|
||||
EnableMacros:=true
|
||||
else
|
||||
TemplateSynEdit.Lines.Add(s);
|
||||
inc(LineCount);
|
||||
@ -857,7 +857,7 @@ var
|
||||
idx, a, sp, ep: integer;
|
||||
s: string;
|
||||
begin
|
||||
EnableMakros:=false;
|
||||
EnableMacros:=false;
|
||||
LineCount := 0;
|
||||
idx := TemplateListBox.ItemIndex;
|
||||
// search template
|
||||
@ -891,7 +891,7 @@ begin
|
||||
LastTemplate := a;
|
||||
TemplateSynEdit.Lines.EndUpdate;
|
||||
TemplateSynEdit.Invalidate;
|
||||
UseMakrosCheckBox.Checked:=EnableMakros;
|
||||
UseMacrosCheckBox.Checked:=EnableMacros;
|
||||
end;
|
||||
|
||||
procedure TCodeTemplateDialog.SaveCurCodeTemplate;
|
||||
@ -915,8 +915,8 @@ begin
|
||||
SetLength(NewValue,l);
|
||||
end;
|
||||
end;
|
||||
if UseMakrosCheckBox.Checked then
|
||||
NewValue:=CodeTemplateMakroMagic+LineEnding+NewValue;
|
||||
if UseMacrosCheckBox.Checked then
|
||||
NewValue:=CodeTemplateMacroMagic+LineEnding+NewValue;
|
||||
SynAutoComplete.CompletionValues[a]:=NewValue;
|
||||
//DebugLn('TCodeTemplateDialog.SaveCurCodeTemplate NewValue="',NewValue,'" SynAutoComplete.CompletionValues[a]="',SynAutoComplete.CompletionValues[a],'"');
|
||||
end;
|
||||
|
||||
@ -177,7 +177,7 @@ begin
|
||||
OpenPackageMenuItem.Visible:=true;
|
||||
ShownFilename:=PkgComponent.PkgFile.Filename;
|
||||
UnitFilename:=APackage.SubstitutePkgMacro(ShownFilename,true);
|
||||
LazarusIDE.SubstituteMakros(UnitFilename);
|
||||
LazarusIDE.SubstituteMacros(UnitFilename);
|
||||
if not FileExists(UnitFilename) then begin
|
||||
UnitFilename:=LazarusIDE.FindSourceFile(ExtractFilename(UnitFilename),
|
||||
APackage.Directory,[]);
|
||||
|
||||
@ -58,6 +58,7 @@ type
|
||||
function GetBaseDirectoryForBasePathObject(BasePathObject: TObject): string; override;
|
||||
function ShowHelpForSourcePosition(Query: THelpQuerySourcePosition;
|
||||
var ErrMsg: string): TShowHelpResult; override;
|
||||
function SubstituteMacros(var s: string): boolean; override;
|
||||
end;
|
||||
|
||||
|
||||
@ -263,6 +264,11 @@ begin
|
||||
Query.SourcePosition,ErrMsg);
|
||||
end;
|
||||
|
||||
function TIDEHelpDatabases.SubstituteMacros(var s: string): boolean;
|
||||
begin
|
||||
Result:=LazarusIDE.SubstituteMacros(s);
|
||||
end;
|
||||
|
||||
{ THelpManager }
|
||||
|
||||
procedure THelpManager.mnuHelpAboutLazarusClicked(Sender: TObject);
|
||||
|
||||
@ -124,7 +124,7 @@ function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): stri
|
||||
function CreateRelativeSearchPath(const SearchPath, BaseDirectory: string): string;
|
||||
function RebaseSearchPath(const SearchPath,
|
||||
OldBaseDirectory, NewBaseDirectory: string;
|
||||
SkipPathsStartingWithMakro: boolean): string;
|
||||
SkipPathsStartingWithMacro: boolean): string;
|
||||
function ShortenSearchPath(const SearchPath, BaseDirectory,
|
||||
ChompDirectory: string): string;
|
||||
function GetNextDirectoryInSearchPath(const SearchPath: string;
|
||||
@ -438,7 +438,7 @@ begin
|
||||
end;
|
||||
|
||||
function RebaseSearchPath(const SearchPath, OldBaseDirectory,
|
||||
NewBaseDirectory: string; SkipPathsStartingWithMakro: boolean): string;
|
||||
NewBaseDirectory: string; SkipPathsStartingWithMacro: boolean): string;
|
||||
// change every relative search path
|
||||
var
|
||||
EndPos: Integer;
|
||||
@ -459,7 +459,7 @@ begin
|
||||
if EndPos>StartPos then begin
|
||||
CurPath:=copy(Result,StartPos,EndPos-StartPos);
|
||||
if (not FilenameIsAbsolute(CurPath))
|
||||
and ((not SkipPathsStartingWithMakro) or (CurPath[1]<>'$'))
|
||||
and ((not SkipPathsStartingWithMacro) or (CurPath[1]<>'$'))
|
||||
then begin
|
||||
CurPath:=TrimFilename(AppendPathDelim(OldBaseDirectory)+CurPath);
|
||||
CurPath:=CreateRelativePath(CurPath,NewBaseDirectory);
|
||||
|
||||
@ -71,7 +71,7 @@ resourcestring
|
||||
// component palette
|
||||
lisSelectionTool = 'Selection tool';
|
||||
|
||||
// makros
|
||||
// macros
|
||||
lisCursorColumnInCurrentEditor = 'Cursor column in current editor';
|
||||
lisCursorRowInCUrrentEditor = 'Cursor row in current editor';
|
||||
lisCompilerFilename = 'Compiler filename';
|
||||
@ -97,14 +97,14 @@ resourcestring
|
||||
lisProjectIncPath = 'Project Include Path';
|
||||
lisProjectSrcPath = 'Project Src Path';
|
||||
lisMakeExe = 'Make Executable';
|
||||
lisProjectMakroProperties = 'Project makro properties';
|
||||
lisProjectMacroProperties = 'Project macro properties';
|
||||
lisOpenProject2 = 'Open project';
|
||||
lisOpenAsXmlFile = 'Open as XML file';
|
||||
lisAnErrorOccuredAtLastStartupWhileLoadingLoadThisPro = 'An error occured '
|
||||
+'at last startup while loading %s!%s%sLoad this project again?';
|
||||
lisOpenProjectAgain = 'Open project again';
|
||||
lisStartWithANewProject = 'Start with a new project';
|
||||
lisProjectMakroUnitPath = 'makro ProjectUnitPath';
|
||||
lisProjectMacroUnitPath = 'macro ProjectUnitPath';
|
||||
lisConfigDirectory = 'Lazarus config directory';
|
||||
|
||||
// main bar menu
|
||||
@ -2958,7 +2958,7 @@ resourcestring
|
||||
lisLazDocDeleteLinkButton = 'Delete link';
|
||||
lisLazDocExampleTag = 'Example';
|
||||
lisLazDocBrowseExampleButton = 'Browse';
|
||||
lisEnableMakros = 'Enable Makros';
|
||||
lisEnableMacros = 'Enable Macros';
|
||||
lisCTSelectCodeMacro = 'Select Code Macro';
|
||||
lisPDProgress = 'Progress';
|
||||
lisPDAbort = 'Abort';
|
||||
|
||||
12
ide/main.pp
12
ide/main.pp
@ -865,8 +865,8 @@ type
|
||||
procedure LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
||||
procedure SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
||||
|
||||
// makros
|
||||
function SubstituteMakros(var s: string): boolean; override;
|
||||
// macros
|
||||
function SubstituteMacros(var s: string): boolean; override;
|
||||
end;
|
||||
|
||||
|
||||
@ -1634,7 +1634,7 @@ begin
|
||||
MacroList.Add(TTransferMacro.Create('MakeExe','',
|
||||
lisMakeExe,@OnMacroFuncMakeExe,[]));
|
||||
MacroList.Add(TTransferMacro.Create('Project','',
|
||||
lisProjectMakroProperties,@OnMacroFuncProject,[]));
|
||||
lisProjectMacroProperties,@OnMacroFuncProject,[]));
|
||||
|
||||
MacroList.OnSubstitution:=@OnMacroSubstitution;
|
||||
CompilerOptions.OnParseString:=@OnSubstituteCompilerOption;
|
||||
@ -3400,7 +3400,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMainIDE.SubstituteMakros(var s: string): boolean;
|
||||
function TMainIDE.SubstituteMacros(var s: string): boolean;
|
||||
begin
|
||||
Result:=MacroList.SubstituteStr(s);
|
||||
end;
|
||||
@ -9237,7 +9237,7 @@ begin
|
||||
else if CompareText(Param,'UnitPath')=0 then
|
||||
Result:=Project1.CompilerOptions.GetUnitPath(false)
|
||||
else begin
|
||||
Result:='<Invalid parameter for makro Project:'+Param+'>';
|
||||
Result:='<Invalid parameter for macro Project:'+Param+'>';
|
||||
debugln('WARNING: TMainIDE.OnMacroFuncProject: ',Result);
|
||||
end;
|
||||
end else begin
|
||||
@ -10627,7 +10627,7 @@ begin
|
||||
else if CompareText(Param,'UnitPath')=0 then
|
||||
FuncData^.Result:=Project1.CompilerOptions.GetUnitPath(false)
|
||||
else begin
|
||||
FuncData^.Result:='<unknown parameter for CodeTools Makro project:"'+Param+'">';
|
||||
FuncData^.Result:='<unknown parameter for CodeTools Macro project:"'+Param+'">';
|
||||
debugln('TMainIDE.MacroFunctionProject WARNING: ',FuncData^.Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -23,8 +23,19 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, Forms, Process, FileUtil, LazConfigStorage,
|
||||
PropEdits, ObjInspStrConsts, MacroIntf, HelpIntf;
|
||||
HelpIntf;
|
||||
|
||||
resourcestring
|
||||
hhsHelpTheHelpDatabaseWasUnableToFindFile = 'The help database %s%s%s was '
|
||||
+'unable to find file %s%s%s.';
|
||||
hhsHelpTheMacroSInBrowserParamsWillBeReplacedByTheURL = 'The macro %s in '
|
||||
+'BrowserParams will be replaced by the URL.';
|
||||
hhsHelpNoHTMLBrowserFoundPleaseDefineOneInHelpConfigureHe = 'No HTML '
|
||||
+'Browser found.%sPlease define one in Help -> Configure Help -> Viewers';
|
||||
hhsHelpBrowserNotFound = 'Browser %s%s%s not found.';
|
||||
hhsHelpBrowserNotExecutable = 'Browser %s%s%s not executable.';
|
||||
hhsHelpErrorWhileExecuting = 'Error while executing %s%s%s:%s%s';
|
||||
|
||||
type
|
||||
{ THTMLHelpDatabase }
|
||||
|
||||
@ -146,7 +157,7 @@ begin
|
||||
end;
|
||||
if (URLType='file') and (not FileExists(URLPath)) then begin
|
||||
Result:=shrContextNotFound;
|
||||
ErrMsg:=Format(oisHelpTheHelpDatabaseWasUnableToFindFile, ['"', ID,
|
||||
ErrMsg:=Format(hhsHelpTheHelpDatabaseWasUnableToFindFile, ['"', ID,
|
||||
'"', '"', URLPath, '"']);
|
||||
exit;
|
||||
end;
|
||||
@ -183,8 +194,8 @@ begin
|
||||
Result:='';
|
||||
if BaseURL<>'' then begin
|
||||
Result:=BaseURL;
|
||||
if (IDEMacros<>nil) then
|
||||
IDEMacros.SubstituteMacros(Result);
|
||||
if (Databases<>nil) then
|
||||
Databases.SubstituteMacros(Result);
|
||||
//debugln('THTMLHelpDatabase.GetEffectiveBaseURL using BaseURL="',Result,'"');
|
||||
end else if (BasePathObject<>nil) and (Databases<>nil) then begin
|
||||
Result:=Databases.GetBaseURLForBasePathObject(BasePathObject);
|
||||
@ -192,8 +203,8 @@ begin
|
||||
end;
|
||||
if (Result='') and (DefaultBaseURL<>'') then begin
|
||||
Result:=DefaultBaseURL;
|
||||
if (IDEMacros<>nil) then
|
||||
IDEMacros.SubstituteMacros(Result);
|
||||
if (Databases<>nil) then
|
||||
Databases.SubstituteMacros(Result);
|
||||
//debugln('THTMLHelpDatabase.GetEffectiveBaseURL using DefaultBaseURL="',Result,'"');
|
||||
end;
|
||||
if (Result<>'') and (Result[length(Result)]<>'/') then
|
||||
@ -231,7 +242,7 @@ begin
|
||||
inherited Create;
|
||||
AddSupportedMimeType('text/html');
|
||||
FBrowserParams:='%s';
|
||||
ParameterHelp:=oisHelpTheMacroSInBrowserParamsWillBeReplacedByTheURL;
|
||||
ParameterHelp:=hhsHelpTheMacroSInBrowserParamsWillBeReplacedByTheURL;
|
||||
end;
|
||||
|
||||
function THTMLBrowserHelpViewer.ShowNode(Node: THelpNode; var ErrMsg: string
|
||||
@ -259,16 +270,16 @@ begin
|
||||
if CommandLine='' then
|
||||
FindDefaultBrowser(CommandLine, Params);
|
||||
if CommandLine='' then begin
|
||||
ErrMsg:=Format(oisHelpNoHTMLBrowserFoundPleaseDefineOneInHelpConfigureHe, [
|
||||
ErrMsg:=Format(hhsHelpNoHTMLBrowserFoundPleaseDefineOneInHelpConfigureHe, [
|
||||
#13]);
|
||||
exit;
|
||||
end;
|
||||
if (not FileExists(CommandLine)) then begin
|
||||
ErrMsg:=Format(oisHelpBrowserNotFound, ['"', CommandLine, '"']);
|
||||
ErrMsg:=Format(hhsHelpBrowserNotFound, ['"', CommandLine, '"']);
|
||||
exit;
|
||||
end;
|
||||
if (not FileIsExecutable(CommandLine)) then begin
|
||||
ErrMsg:=Format(oisHelpBrowserNotExecutable, ['"', CommandLine, '"']);
|
||||
ErrMsg:=Format(hhsHelpBrowserNotExecutable, ['"', CommandLine, '"']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
@ -298,7 +309,7 @@ begin
|
||||
Result:=shrSuccess;
|
||||
except
|
||||
on E: Exception do begin
|
||||
ErrMsg:=Format(oisHelpErrorWhileExecuting, ['"', CommandLine, '"', #13,
|
||||
ErrMsg:=Format(hhsHelpErrorWhileExecuting, ['"', CommandLine, '"', #13,
|
||||
E.Message]);
|
||||
end;
|
||||
end;
|
||||
@ -343,9 +354,5 @@ begin
|
||||
Result:='HTML Browser';
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||
THTMLBrowserHelpViewer,'BrowserPath',TFileNamePropertyEditor);
|
||||
|
||||
end.
|
||||
|
||||
|
||||
@ -557,6 +557,7 @@ type
|
||||
function GetBaseDirectoryForBasePathObject(BasePathObject: TObject): string; virtual;
|
||||
function FindViewer(const MimeType: string; var ErrMsg: string;
|
||||
var Viewer: THelpViewer): TShowHelpResult; virtual;
|
||||
function SubstituteMacros(var s: string): boolean; virtual;
|
||||
public
|
||||
// show help for ...
|
||||
function ShowHelpForNodes(Query: THelpQuery; Nodes: THelpNodeQueryList;
|
||||
@ -1593,6 +1594,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function THelpDatabases.SubstituteMacros(var s: string): boolean;
|
||||
begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function THelpDatabases.ShowHelpForNodes(Query: THelpQuery;
|
||||
Nodes: THelpNodeQueryList; var ErrMsg: string): TShowHelpResult;
|
||||
var
|
||||
|
||||
@ -22,7 +22,7 @@ unit LazIDEIntf;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, ProjectIntf, SrcEditorIntf;
|
||||
Classes, SysUtils, Forms, PropEdits, HelpHTML, ProjectIntf, SrcEditorIntf;
|
||||
|
||||
type
|
||||
// open file flags
|
||||
@ -153,7 +153,7 @@ type
|
||||
NewOwner: TObject; Flags: TSearchIDEFileFlags;
|
||||
TryWithoutNumber: boolean): string; virtual; abstract;
|
||||
|
||||
function SubstituteMakros(var s: string): boolean; virtual; abstract;
|
||||
function SubstituteMacros(var s: string): boolean; virtual; abstract;
|
||||
|
||||
function BeginCodeTools: boolean; virtual; abstract;
|
||||
procedure DoJumpToCodeToolBossError; virtual; abstract;
|
||||
@ -200,5 +200,9 @@ begin
|
||||
Result:=DoNewFile(NewFileDescriptor,NewFilename,NewSource,NewFlags,nil);
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||
THTMLBrowserHelpViewer,'BrowserPath',TFileNamePropertyEditor);
|
||||
|
||||
end.
|
||||
|
||||
|
||||
@ -278,15 +278,6 @@ resourcestring
|
||||
oisNone = '(none)';
|
||||
oisComponentNameIsNotAValidIdentifier = 'Component name %s%s%s is not a '
|
||||
+'valid identifier';
|
||||
oisHelpTheHelpDatabaseWasUnableToFindFile = 'The help database %s%s%s was '
|
||||
+'unable to find file %s%s%s.';
|
||||
oisHelpTheMacroSInBrowserParamsWillBeReplacedByTheURL = 'The macro %s in '
|
||||
+'BrowserParams will be replaced by the URL.';
|
||||
oisHelpNoHTMLBrowserFoundPleaseDefineOneInHelpConfigureHe = 'No HTML '
|
||||
+'Browser found.%sPlease define one in Help -> Configure Help -> Viewers';
|
||||
oisHelpBrowserNotFound = 'Browser %s%s%s not found.';
|
||||
oisHelpBrowserNotExecutable = 'Browser %s%s%s not executable.';
|
||||
oisHelpErrorWhileExecuting = 'Error while executing %s%s%s:%s%s';
|
||||
oisHelpHelpNodeHasNoHelpDatabase = 'Help node %s%s%s has no Help Database';
|
||||
oisHelpHelpDatabaseDidNotFoundAViewerForAHelpPageOfType = 'Help Database %s%'
|
||||
+'s%s did not found a viewer for a help page of type %s';
|
||||
|
||||
@ -211,7 +211,7 @@ var
|
||||
IDECodeMacros: TIDECodeMacros = nil; // set by the IDE
|
||||
|
||||
const
|
||||
CodeTemplateMakroMagic = '$(EnableMakros)';
|
||||
CodeTemplateMacroMagic = '$(EnableMakros)';
|
||||
|
||||
|
||||
function RegisterCodeMacro(const Name: string;
|
||||
|
||||
@ -1236,7 +1236,7 @@ var
|
||||
until false;
|
||||
end;
|
||||
|
||||
function ConvertPIMakrosToMakefileMakros(const s: string): string;
|
||||
function ConvertPIMacrosToMakefileMacros(const s: string): string;
|
||||
begin
|
||||
Result:=s;
|
||||
Replace(Result,'%(','$(');
|
||||
@ -1244,7 +1244,7 @@ var
|
||||
|
||||
function ConvertLazarusToMakefileSearchPath(const s: string): string;
|
||||
begin
|
||||
Result:=ConvertPIMakrosToMakefileMakros(s);
|
||||
Result:=ConvertPIMacrosToMakefileMacros(s);
|
||||
Result:=CreateRelativeSearchPath(TrimSearchPath(Result,''),APackage.Directory);
|
||||
Replace(Result,';',' ');
|
||||
if PathDelimNeedsReplace then
|
||||
@ -1253,7 +1253,7 @@ var
|
||||
|
||||
function ConvertLazarusToMakefileDirectory(const s: string): string;
|
||||
begin
|
||||
Result:=ConvertPIMakrosToMakefileMakros(s);
|
||||
Result:=ConvertPIMacrosToMakefileMacros(s);
|
||||
Result:=CreateRelativePath(TrimFilename(Result),APackage.Directory);
|
||||
if PathDelimNeedsReplace then
|
||||
Replace(Result,PathDelim,'/');
|
||||
@ -1263,7 +1263,7 @@ var
|
||||
|
||||
function ConvertLazarusOptionsToMakefileOptions(const s: string): string;
|
||||
begin
|
||||
Result:=ConvertPIMakrosToMakefileMakros(s);
|
||||
Result:=ConvertPIMacrosToMakefileMacros(s);
|
||||
if PathDelimNeedsReplace then
|
||||
Replace(Result,PathDelim,'/');
|
||||
end;
|
||||
@ -2719,7 +2719,7 @@ function TPkgManager.DoSavePackage(APackage: TLazPackage;
|
||||
if AFile.FileType=pftVirtualUnit then continue;
|
||||
AFilename:=AFile.Filename;
|
||||
if System.Pos('$(',AFilename)>0 then begin
|
||||
// filename contains makros -> skip
|
||||
// filename contains macros -> skip
|
||||
end;
|
||||
if FilenameIsAbsolute(AFilename) then begin
|
||||
if not FileExistsCached(AFilename) then begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user