IDE: renamed TLazDocManager to TCodeHelpManager

git-svn-id: trunk@13517 -
This commit is contained in:
mattias 2007-12-29 11:28:23 +00:00
parent c5951ad564
commit c26a8750c8
6 changed files with 115 additions and 115 deletions

View File

@ -158,7 +158,7 @@ type
{ TLazDocManager } { TLazDocManager }
TLazDocManager = class TCodeHelpManager = class
private private
FDocs: TAvgLvlTree;// tree of loaded TLazFPDocFile FDocs: TAvgLvlTree;// tree of loaded TLazFPDocFile
FHandlers: array[TLazDocManagerHandler] of TMethodList; FHandlers: array[TLazDocManagerHandler] of TMethodList;
@ -224,7 +224,7 @@ type
end; end;
var var
LazDocBoss: TLazDocManager = nil;// set by the IDE LazDocBoss: TCodeHelpManager = nil;// set by the IDE
function CompareLazFPDocFilenames(Data1, Data2: Pointer): integer; function CompareLazFPDocFilenames(Data1, Data2: Pointer): integer;
function CompareAnsistringWithLazFPDocFile(Key, Data: Pointer): integer; function CompareAnsistringWithLazFPDocFile(Key, Data: Pointer): integer;
@ -504,7 +504,7 @@ begin
end; end;
end; end;
procedure TLazDocManager.AddHandler(HandlerType: TLazDocManagerHandler; procedure TCodeHelpManager.AddHandler(HandlerType: TLazDocManagerHandler;
const AMethod: TMethod; AsLast: boolean); const AMethod: TMethod; AsLast: boolean);
begin begin
if FHandlers[HandlerType]=nil then if FHandlers[HandlerType]=nil then
@ -512,13 +512,13 @@ begin
FHandlers[HandlerType].Add(AMethod); FHandlers[HandlerType].Add(AMethod);
end; end;
procedure TLazDocManager.RemoveHandler(HandlerType: TLazDocManagerHandler; procedure TCodeHelpManager.RemoveHandler(HandlerType: TLazDocManagerHandler;
const AMethod: TMethod); const AMethod: TMethod);
begin begin
FHandlers[HandlerType].Remove(AMethod); FHandlers[HandlerType].Remove(AMethod);
end; end;
procedure TLazDocManager.CallDocChangeEvents(HandlerType: TLazDocManagerHandler; procedure TCodeHelpManager.CallDocChangeEvents(HandlerType: TLazDocManagerHandler;
Doc: TLazFPDocFile); Doc: TLazFPDocFile);
var var
i: LongInt; i: LongInt;
@ -528,7 +528,7 @@ begin
TLazDocChangeEvent(FHandlers[HandlerType].Items[i])(Self,Doc); TLazDocChangeEvent(FHandlers[HandlerType].Items[i])(Self,Doc);
end; end;
function TLazDocManager.DoCreateFPDocFileForSource(const SrcFilename: string function TCodeHelpManager.DoCreateFPDocFileForSource(const SrcFilename: string
): string; ): string;
procedure CleanUpPkgList(var PkgList: TFPList); procedure CleanUpPkgList(var PkgList: TFPList);
@ -660,7 +660,7 @@ begin
end; end;
end; end;
function TLazDocManager.CreateFPDocFile(const ExpandedFilename, function TCodeHelpManager.CreateFPDocFile(const ExpandedFilename,
PackageName, ModuleName: string): TCodeBuffer; PackageName, ModuleName: string): TCodeBuffer;
var var
Doc: TXMLDocument; Doc: TXMLDocument;
@ -716,7 +716,7 @@ begin
end; end;
end; end;
constructor TLazDocManager.Create; constructor TCodeHelpManager.Create;
begin begin
FDocs:=TAvgLvlTree.Create(@CompareLazFPDocFilenames); FDocs:=TAvgLvlTree.Create(@CompareLazFPDocFilenames);
FSrcToDocMap:=TAvgLvlTree.Create(@CompareLDSrc2DocSrcFilenames); FSrcToDocMap:=TAvgLvlTree.Create(@CompareLDSrc2DocSrcFilenames);
@ -725,7 +725,7 @@ begin
@CodeToolBoss.GetCodeTreeNodesDeletedStep); @CodeToolBoss.GetCodeTreeNodesDeletedStep);
end; end;
destructor TLazDocManager.Destroy; destructor TCodeHelpManager.Destroy;
begin begin
ClearSrcToDocMap; ClearSrcToDocMap;
FreeDocs; FreeDocs;
@ -735,7 +735,7 @@ begin
inherited Destroy; inherited Destroy;
end; end;
function TLazDocManager.FindFPDocFile(const Filename: string): TLazFPDocFile; function TCodeHelpManager.FindFPDocFile(const Filename: string): TLazFPDocFile;
var var
Node: TAvgLvlTreeNode; Node: TAvgLvlTreeNode;
begin begin
@ -746,7 +746,7 @@ begin
Result:=nil; Result:=nil;
end; end;
function TLazDocManager.LoadFPDocFile(const Filename: string; UpdateFromDisk, function TCodeHelpManager.LoadFPDocFile(const Filename: string; UpdateFromDisk,
Revert: Boolean; out ADocFile: TLazFPDocFile; out CacheWasUsed: boolean): Boolean; Revert: Boolean; out ADocFile: TLazFPDocFile; out CacheWasUsed: boolean): Boolean;
var var
MemStream: TMemoryStream; MemStream: TMemoryStream;
@ -803,7 +803,7 @@ begin
end; end;
end; end;
function TLazDocManager.SaveFPDocFile(ADocFile: TLazFPDocFile): TModalResult; function TCodeHelpManager.SaveFPDocFile(ADocFile: TLazFPDocFile): TModalResult;
var var
ms: TMemoryStream; ms: TMemoryStream;
s: string; s: string;
@ -850,7 +850,7 @@ begin
DebugLn(['TLazDocManager.SaveFPDocFile saved ',ADocFile.Filename]); DebugLn(['TLazDocManager.SaveFPDocFile saved ',ADocFile.Filename]);
end; end;
function TLazDocManager.GetFPDocFilenameForHelpContext( function TCodeHelpManager.GetFPDocFilenameForHelpContext(
Context: TPascalHelpContextList; out CacheWasUsed: boolean): string; Context: TPascalHelpContextList; out CacheWasUsed: boolean): string;
var var
i: Integer; i: Integer;
@ -867,7 +867,7 @@ begin
end; end;
end; end;
function TLazDocManager.GetFPDocFilenameForSource(SrcFilename: string; function TCodeHelpManager.GetFPDocFilenameForSource(SrcFilename: string;
ResolveIncludeFiles: Boolean; out CacheWasUsed: boolean; ResolveIncludeFiles: Boolean; out CacheWasUsed: boolean;
CreateIfNotExists: boolean): string; CreateIfNotExists: boolean): string;
var var
@ -1009,7 +1009,7 @@ begin
end; end;
end; end;
function TLazDocManager.CodeNodeToElementName(Tool: TFindDeclarationTool; function TCodeHelpManager.CodeNodeToElementName(Tool: TFindDeclarationTool;
CodeNode: TCodeTreeNode): string; CodeNode: TCodeTreeNode): string;
var var
NodeName: String; NodeName: String;
@ -1034,7 +1034,7 @@ begin
end; end;
end; end;
function TLazDocManager.GetFPDocNode(Tool: TCodeTool; CodeNode: TCodeTreeNode; function TCodeHelpManager.GetFPDocNode(Tool: TCodeTool; CodeNode: TCodeTreeNode;
Complete: boolean; out FPDocFile: TLazFPDocFile; out DOMNode: TDOMNode; Complete: boolean; out FPDocFile: TLazFPDocFile; out DOMNode: TDOMNode;
out CacheWasUsed: boolean): TLazDocParseResult; out CacheWasUsed: boolean): TLazDocParseResult;
var var
@ -1066,7 +1066,7 @@ begin
Result:=ldprSuccess; Result:=ldprSuccess;
end; end;
function TLazDocManager.GetDeclarationChain(Code: TCodeBuffer; X, Y: integer; function TCodeHelpManager.GetDeclarationChain(Code: TCodeBuffer; X, Y: integer;
out ListOfPCodeXYPosition: TFPList; out CacheWasUsed: boolean out ListOfPCodeXYPosition: TFPList; out CacheWasUsed: boolean
): TLazDocParseResult; ): TLazDocParseResult;
begin begin
@ -1078,7 +1078,7 @@ begin
Result:=ldprFailed; Result:=ldprFailed;
end; end;
function TLazDocManager.GetCodeContext(CodePos: PCodeXYPosition; out function TCodeHelpManager.GetCodeContext(CodePos: PCodeXYPosition; out
FindContext: TFindContext; Complete: boolean; out CacheWasUsed: boolean FindContext: TFindContext; Complete: boolean; out CacheWasUsed: boolean
): TLazDocParseResult; ): TLazDocParseResult;
var var
@ -1137,7 +1137,7 @@ begin
Result:=ldprSuccess; Result:=ldprSuccess;
end; end;
function TLazDocManager.GetElementChain(Code: TCodeBuffer; X, Y: integer; function TCodeHelpManager.GetElementChain(Code: TCodeBuffer; X, Y: integer;
Complete: boolean; out Chain: TLazDocElementChain; out CacheWasUsed: boolean Complete: boolean; out Chain: TLazDocElementChain; out CacheWasUsed: boolean
): TLazDocParseResult; ): TLazDocParseResult;
var var
@ -1219,7 +1219,7 @@ begin
end; end;
end; end;
function TLazDocManager.GetHint(Code: TCodeBuffer; X, Y: integer; function TCodeHelpManager.GetHint(Code: TCodeBuffer; X, Y: integer;
Complete: boolean; out Hint: string; out CacheWasUsed: boolean Complete: boolean; out Hint: string; out CacheWasUsed: boolean
): TLazDocParseResult; ): TLazDocParseResult;
@ -1323,7 +1323,7 @@ begin
DebugLn(['TLazDocManager.GetHint END Hint="',Hint,'"']); DebugLn(['TLazDocManager.GetHint END Hint="',Hint,'"']);
end; end;
function TLazDocManager.CreateElement(Code: TCodeBuffer; X, Y: integer; function TCodeHelpManager.CreateElement(Code: TCodeBuffer; X, Y: integer;
out Element: TLazDocElement): Boolean; out Element: TLazDocElement): Boolean;
var var
CacheWasUsed: boolean; CacheWasUsed: boolean;
@ -1379,7 +1379,7 @@ begin
end; end;
end; end;
procedure TLazDocManager.FreeDocs; procedure TCodeHelpManager.FreeDocs;
var var
AVLNode: TAvgLvlTreeNode; AVLNode: TAvgLvlTreeNode;
begin begin
@ -1391,12 +1391,12 @@ begin
FDocs.FreeAndClear; FDocs.FreeAndClear;
end; end;
procedure TLazDocManager.ClearSrcToDocMap; procedure TCodeHelpManager.ClearSrcToDocMap;
begin begin
FSrcToDocMap.FreeAndClear; FSrcToDocMap.FreeAndClear;
end; end;
procedure TLazDocManager.RemoveAllHandlersOfObject(AnObject: TObject); procedure TCodeHelpManager.RemoveAllHandlersOfObject(AnObject: TObject);
var var
HandlerType: TLazDocManagerHandler; HandlerType: TLazDocManagerHandler;
begin begin
@ -1404,25 +1404,25 @@ begin
FHandlers[HandlerType].RemoveAllMethodsOfObject(AnObject); FHandlers[HandlerType].RemoveAllMethodsOfObject(AnObject);
end; end;
procedure TLazDocManager.AddHandlerOnChanging( procedure TCodeHelpManager.AddHandlerOnChanging(
const OnDocChangingEvent: TLazDocChangeEvent; AsLast: boolean); const OnDocChangingEvent: TLazDocChangeEvent; AsLast: boolean);
begin begin
AddHandler(ldmhDocChanging,TMethod(OnDocChangingEvent),AsLast); AddHandler(ldmhDocChanging,TMethod(OnDocChangingEvent),AsLast);
end; end;
procedure TLazDocManager.RemoveHandlerOnChanging( procedure TCodeHelpManager.RemoveHandlerOnChanging(
const OnDocChangingEvent: TLazDocChangeEvent); const OnDocChangingEvent: TLazDocChangeEvent);
begin begin
RemoveHandler(ldmhDocChanging,TMethod(OnDocChangingEvent)); RemoveHandler(ldmhDocChanging,TMethod(OnDocChangingEvent));
end; end;
procedure TLazDocManager.AddHandlerOnChanged( procedure TCodeHelpManager.AddHandlerOnChanged(
const OnDocChangedEvent: TLazDocChangeEvent; AsLast: boolean); const OnDocChangedEvent: TLazDocChangeEvent; AsLast: boolean);
begin begin
AddHandler(ldmhDocChanged,TMethod(OnDocChangedEvent),AsLast); AddHandler(ldmhDocChanged,TMethod(OnDocChangedEvent),AsLast);
end; end;
procedure TLazDocManager.RemoveHandlerOnChanged( procedure TCodeHelpManager.RemoveHandlerOnChanged(
const OnDocChangedEvent: TLazDocChangeEvent); const OnDocChangedEvent: TLazDocChangeEvent);
begin begin
RemoveHandler(ldmhDocChanged,TMethod(OnDocChangedEvent)); RemoveHandler(ldmhDocChanged,TMethod(OnDocChangedEvent));

View File

@ -1,4 +1,4 @@
object LazDocEditForm: TLazDocEditForm object FPDocEditor: TFPDocEditor
Left = 303 Left = 303
Height = 117 Height = 117
Top = 548 Top = 548
@ -6,7 +6,7 @@ object LazDocEditForm: TLazDocEditForm
HorzScrollBar.Page = 752 HorzScrollBar.Page = 752
VertScrollBar.Page = 116 VertScrollBar.Page = 116
ActiveControl = ShortEdit ActiveControl = ShortEdit
Caption = 'LazDoc editor' Caption = 'FPDoc editor'
ClientHeight = 117 ClientHeight = 117
ClientWidth = 753 ClientWidth = 753
OnCreate = FormCreate OnCreate = FormCreate

View File

@ -1,17 +1,17 @@
{ This is an automatically generated lazarus resource file } { This is an automatically generated lazarus resource file }
LazarusResources.Add('TLazDocEditForm','FORMDATA',[ LazarusResources.Add('TFPDocEditor','FORMDATA',[
'TPF0'#15'TLazDocEditForm'#14'LazDocEditForm'#4'Left'#3'/'#1#6'Height'#2'u'#3 'TPF0'#12'TFPDocEditor'#11'FPDocEditor'#4'Left'#3'/'#1#6'Height'#2'u'#3'Top'#3
+'Top'#3'$'#2#5'Width'#3#241#2#18'HorzScrollBar.Page'#3#240#2#18'VertScrollBa' +'$'#2#5'Width'#3#241#2#18'HorzScrollBar.Page'#3#240#2#18'VertScrollBar.Page'
+'r.Page'#2't'#13'ActiveControl'#7#9'ShortEdit'#7'Caption'#6#13'LazDoc editor' +#2't'#13'ActiveControl'#7#9'ShortEdit'#7'Caption'#6#12'FPDoc editor'#12'Clie'
+#12'ClientHeight'#2'u'#11'ClientWidth'#3#241#2#8'OnCreate'#7#10'FormCreate'#9 +'ntHeight'#2'u'#11'ClientWidth'#3#241#2#8'OnCreate'#7#10'FormCreate'#9'OnDes'
+'OnDestroy'#7#11'FormDestroy'#8'OnResize'#7#10'FormResize'#0#12'TPageControl' +'troy'#7#11'FormDestroy'#8'OnResize'#7#10'FormResize'#0#12'TPageControl'#11
+#11'PageControl'#4'Left'#2#17#6'Height'#2'u'#5'Width'#3#224#2#10'ActivePage' +'PageControl'#4'Left'#2#17#6'Height'#2'u'#5'Width'#3#224#2#10'ActivePage'#7
+#7#13'ShortTabSheet'#5'Align'#7#8'alClient'#8'TabIndex'#2#0#8'TabOrder'#2#0 +#13'ShortTabSheet'#5'Align'#7#8'alClient'#8'TabIndex'#2#0#8'TabOrder'#2#0#11
+#11'TabPosition'#7#8'tpBottom'#0#9'TTabSheet'#13'ShortTabSheet'#7'Caption'#6 +'TabPosition'#7#8'tpBottom'#0#9'TTabSheet'#13'ShortTabSheet'#7'Caption'#6#13
+#13'ShortTabSheet'#12'ClientHeight'#2'V'#11'ClientWidth'#3#220#2#0#5'TEdit'#9 +'ShortTabSheet'#12'ClientHeight'#2'V'#11'ClientWidth'#3#220#2#0#5'TEdit'#9'S'
+'ShortEdit'#6'Height'#2#23#5'Width'#3#218#2#5'Align'#7#5'alTop'#19'BorderSpa' +'hortEdit'#6'Height'#2#23#5'Width'#3#218#2#5'Align'#7#5'alTop'#19'BorderSpac'
+'cing.Right'#2#2#13'OnEditingDone'#7#22'DocumentationTagChange'#8'TabOrder'#2 +'ing.Right'#2#2#13'OnEditingDone'#7#22'DocumentationTagChange'#8'TabOrder'#2
+#0#4'Text'#6#9'ShortEdit'#0#0#7'TButton'#12'CreateButton'#21'AnchorSideTop.C' +#0#4'Text'#6#9'ShortEdit'#0#0#7'TButton'#12'CreateButton'#21'AnchorSideTop.C'
+'ontrol'#7#9'ShortEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6 +'ontrol'#7#9'ShortEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6
+'Height'#2#29#3'Top'#2#29#5'Width'#2'b'#8'AutoSize'#9#20'BorderSpacing.Aroun' +'Height'#2#29#3'Top'#2#29#5'Width'#2'b'#8'AutoSize'#9#20'BorderSpacing.Aroun'

View File

@ -25,7 +25,7 @@ unit FPDocEditWindow;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{ $define VerboseLazDoc} { $define VerboseCodeHelp}
interface interface
@ -57,9 +57,9 @@ type
); );
TLazDocFormFlags = set of TLazDocFormFlag; TLazDocFormFlags = set of TLazDocFormFlag;
{ TLazDocEditForm } { TFPDocEditor }
TLazDocEditForm = class(TForm) TFPDocEditor = class(TForm)
AddLinkButton: TButton; AddLinkButton: TButton;
BrowseExampleButton: TButton; BrowseExampleButton: TButton;
SaveButton: TButton; SaveButton: TButton;
@ -152,25 +152,25 @@ type
end; end;
var var
LazDocEditForm: TLazDocEditForm = nil; FPDocEditor: TFPDocEditor = nil;
procedure DoShowLazDoc; procedure DoShowLazDoc;
implementation implementation
{ TLazDocEditForm } { TFPDocEditor }
procedure DoShowLazDoc; procedure DoShowLazDoc;
begin begin
if LazDocEditForm = Nil then begin if FPDocEditor = Nil then begin
Application.CreateForm(TLazDocEditForm, LazDocEditForm); Application.CreateForm(TFPDocEditor, FPDocEditor);
EnvironmentOptions.IDEWindowLayoutList.ItemByEnum(nmiwLazDocName).Apply; EnvironmentOptions.IDEWindowLayoutList.ItemByEnum(nmiwLazDocName).Apply;
end; end;
LazDocEditForm.Show; FPDocEditor.Show;
end; end;
function TLazDocEditForm.GetFirstElement: TDOMNode; function TFPDocEditor.GetFirstElement: TDOMNode;
var var
CurDocFile: TLazFPDocFile; CurDocFile: TLazFPDocFile;
begin begin
@ -180,7 +180,7 @@ begin
Result:=CurDocFile.GetFirstElement; Result:=CurDocFile.GetFirstElement;
end; end;
procedure TLazDocEditForm.UpdateLinkIdComboBox; procedure TFPDocEditor.UpdateLinkIdComboBox;
// fills LinkIdComboBox.Items // fills LinkIdComboBox.Items
var var
n: TDOMNode; n: TDOMNode;
@ -192,8 +192,8 @@ begin
end; end;
Exclude(FFLags,ldffLinkIDComboNeedsUpdate); Exclude(FFLags,ldffLinkIDComboNeedsUpdate);
{$IFDEF VerboseLazDoc} {$IFDEF VerboseCodeHelp}
DebugLn(['TLazDocEditForm.UpdateLinkIdComboBox START']); DebugLn(['TFPDocEditForm.UpdateLinkIdComboBox START']);
{$ENDIF} {$ENDIF}
LinkIdComboBox.Clear; LinkIdComboBox.Clear;
if Doc=nil then exit; if Doc=nil then exit;
@ -211,7 +211,7 @@ begin
sl.Free; sl.Free;
end; end;
procedure TLazDocEditForm.FormCreate(Sender: TObject); procedure TFPDocEditor.FormCreate(Sender: TObject);
begin begin
Caption := lisLazDocMainFormCaption; Caption := lisLazDocMainFormCaption;
@ -256,7 +256,7 @@ begin
EnvironmentOptions.IDEWindowLayoutList.Apply(Self, Name); EnvironmentOptions.IDEWindowLayoutList.Apply(Self, Name);
end; end;
procedure TLazDocEditForm.FormDestroy(Sender: TObject); procedure TFPDocEditor.FormDestroy(Sender: TObject);
begin begin
Reset; Reset;
FreeAndNil(fChain); FreeAndNil(fChain);
@ -264,12 +264,12 @@ begin
Application.RemoveAllHandlersOfObject(Self); Application.RemoveAllHandlersOfObject(Self);
end; end;
procedure TLazDocEditForm.FormResize(Sender: TObject); procedure TFPDocEditor.FormResize(Sender: TObject);
begin begin
LinkIdComboBox.Width := (AddLinkButton.Left - LinkIdComboBox.Left - 8) div 2; LinkIdComboBox.Width := (AddLinkButton.Left - LinkIdComboBox.Left - 8) div 2;
end; end;
procedure TLazDocEditForm.FormatButtonClick(Sender: TObject); procedure TFPDocEditor.FormatButtonClick(Sender: TObject);
procedure InsertTag(starttag, endtag: String); procedure InsertTag(starttag, endtag: String);
begin begin
@ -302,7 +302,7 @@ begin
end; end;
end; end;
procedure TLazDocEditForm.LinkChange(Sender: TObject); procedure TFPDocEditor.LinkChange(Sender: TObject);
begin begin
if LinkListBox.ItemIndex<0 then if LinkListBox.ItemIndex<0 then
Exit; Exit;
@ -310,7 +310,7 @@ begin
LinkListBox.Items.Strings[LinkListBox.ItemIndex] := MakeLink; LinkListBox.Items.Strings[LinkListBox.ItemIndex] := MakeLink;
end; end;
procedure TLazDocEditForm.LinkListBoxClick(Sender: TObject); procedure TFPDocEditor.LinkListBoxClick(Sender: TObject);
var var
strTmp: String; strTmp: String;
intTmp: Integer; intTmp: Integer;
@ -338,7 +338,7 @@ begin
LinkTextEdit.Text := Copy(strTmp, 1, Length(strTmp) - Length('</link>')); LinkTextEdit.Text := Copy(strTmp, 1, Length(strTmp) - Length('</link>'));
end; end;
procedure TLazDocEditForm.ApplicationIdle(Sender: TObject; var Done: Boolean); procedure TFPDocEditor.ApplicationIdle(Sender: TObject; var Done: Boolean);
begin begin
Done:=false; Done:=false;
if ldffChainNeedsUpdate in FFlags then if ldffChainNeedsUpdate in FFlags then
@ -355,7 +355,7 @@ begin
Done:=true; Done:=true;
end; end;
procedure TLazDocEditForm.MoveToInheritedButtonClick(Sender: TObject); procedure TFPDocEditor.MoveToInheritedButtonClick(Sender: TObject);
var var
i: Integer; i: Integer;
Element: TLazDocElement; Element: TLazDocElement;
@ -419,12 +419,12 @@ begin
end; end;
end; end;
procedure TLazDocEditForm.SaveButtonClick(Sender: TObject); procedure TFPDocEditor.SaveButtonClick(Sender: TObject);
begin begin
Save; Save;
end; end;
function TLazDocEditForm.GetContextTitle(Element: TLazDocElement): string; function TFPDocEditor.GetContextTitle(Element: TLazDocElement): string;
// get codetools path. for example: TButton.Align // get codetools path. for example: TButton.Align
begin begin
Result:=''; Result:='';
@ -432,7 +432,7 @@ begin
Result:=Element.ElementName; Result:=Element.ElementName;
end; end;
function TLazDocEditForm.GetDoc: TXMLdocument; function TFPDocEditor.GetDoc: TXMLdocument;
begin begin
if DocFile<>nil then if DocFile<>nil then
Result:=DocFile.Doc Result:=DocFile.Doc
@ -440,19 +440,19 @@ begin
Result:=nil; Result:=nil;
end; end;
function TLazDocEditForm.GetDocFile: TLazFPDocFile; function TFPDocEditor.GetDocFile: TLazFPDocFile;
begin begin
Result:=nil; Result:=nil;
if fChain=nil then exit; if fChain=nil then exit;
Result:=fChain.DocFile; Result:=fChain.DocFile;
end; end;
function TLazDocEditForm.GetSourceFilename: string; function TFPDocEditor.GetSourceFilename: string;
begin begin
Result:=fSourceFilename; Result:=fSourceFilename;
end; end;
procedure TLazDocEditForm.UpdateCaption; procedure TFPDocEditor.UpdateCaption;
var var
strCaption: String; strCaption: String;
begin begin
@ -462,8 +462,8 @@ begin
end; end;
Exclude(FFlags,ldffCaptionNeedsUpdate); Exclude(FFlags,ldffCaptionNeedsUpdate);
{$IFDEF VerboseLazDoc} {$IFDEF VerboseCodeHelp}
DebugLn(['TLazDocEditForm.UpdateCaption START']); DebugLn(['TFPDocEditForm.UpdateCaption START']);
{$ENDIF} {$ENDIF}
strCaption := lisLazDocMainFormCaption + ' - '; strCaption := lisLazDocMainFormCaption + ' - ';
@ -476,12 +476,12 @@ begin
Caption := strCaption + DocFile.Filename Caption := strCaption + DocFile.Filename
else else
Caption := strCaption + lisLazDocNoTagCaption; Caption := strCaption + lisLazDocNoTagCaption;
{$IFDEF VerboseLazDoc} {$IFDEF VerboseCodeHelp}
DebugLn(['TLazDocForm.UpdateCaption ',Caption]); DebugLn(['TLazDocForm.UpdateCaption ',Caption]);
{$ENDIF} {$ENDIF}
end; end;
procedure TLazDocEditForm.UpdateValueControls; procedure TFPDocEditor.UpdateValueControls;
var var
Element: TLazDocElement; Element: TLazDocElement;
begin begin
@ -491,8 +491,8 @@ begin
end; end;
Exclude(FFLags,ldffValueControlsNeedsUpdate); Exclude(FFLags,ldffValueControlsNeedsUpdate);
{$IFDEF VerboseLazDoc} {$IFDEF VerboseCodeHelp}
DebugLn(['TLazDocEditForm.UpdateValueControls START']); DebugLn(['TFPDocEditForm.UpdateValueControls START']);
{$ENDIF} {$ENDIF}
Element:=nil; Element:=nil;
if (fChain<>nil) and (fChain.Count>0) then if (fChain<>nil) and (fChain.Count>0) then
@ -501,7 +501,7 @@ begin
SaveButton.Enabled:=FModified; SaveButton.Enabled:=FModified;
end; end;
procedure TLazDocEditForm.UpdateInheritedControls; procedure TFPDocEditor.UpdateInheritedControls;
var var
i: LongInt; i: LongInt;
Element: TLazDocElement; Element: TLazDocElement;
@ -513,8 +513,8 @@ begin
end; end;
Exclude(FFLags,ldffInheritedControlsNeedsUpdate); Exclude(FFLags,ldffInheritedControlsNeedsUpdate);
{$IFDEF VerboseLazDoc} {$IFDEF VerboseCodeHelp}
DebugLn(['TLazDocEditForm.UpdateInheritedControls START']); DebugLn(['TFPDocEditForm.UpdateInheritedControls START']);
{$ENDIF} {$ENDIF}
i:=FindInheritedIndex; i:=FindInheritedIndex;
if i<0 then begin if i<0 then begin
@ -535,7 +535,7 @@ begin
CopyFromInheritedButton.Enabled:=(i>=0); CopyFromInheritedButton.Enabled:=(i>=0);
end; end;
procedure TLazDocEditForm.UpdateChain; procedure TFPDocEditor.UpdateChain;
var var
Code: TCodeBuffer; Code: TCodeBuffer;
LDResult: TLazDocParseResult; LDResult: TLazDocParseResult;
@ -551,15 +551,15 @@ begin
if (fSourceFilename='') or (CaretXY.X<1) or (CaretXY.Y<1) then exit; if (fSourceFilename='') or (CaretXY.X<1) or (CaretXY.Y<1) then exit;
{$IFDEF VerboseLazDoc} {$IFDEF VerboseCodeHelp}
DebugLn(['TLazDocEditForm.UpdateChain START']); DebugLn(['TFPDocEditForm.UpdateChain START']);
{$ENDIF} {$ENDIF}
NewChain:=nil; NewChain:=nil;
try try
// fetch pascal source // fetch pascal source
Code:=CodeToolBoss.LoadFile(fSourceFilename,true,false); Code:=CodeToolBoss.LoadFile(fSourceFilename,true,false);
if Code=nil then begin if Code=nil then begin
DebugLn(['TLazDocEditForm.UpdateChain failed loading ',fSourceFilename]); DebugLn(['TFPDocEditForm.UpdateChain failed loading ',fSourceFilename]);
exit; exit;
end; end;
@ -570,12 +570,12 @@ begin
ldprParsing: ldprParsing:
begin begin
Include(FFLags,ldffChainNeedsUpdate); Include(FFLags,ldffChainNeedsUpdate);
DebugLn(['TLazDocEditForm.UpdateChain ToDo: still parsing LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]); DebugLn(['TFPDocEditForm.UpdateChain ToDo: still parsing LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]);
exit; exit;
end; end;
ldprFailed: ldprFailed:
begin begin
DebugLn(['TLazDocEditForm.UpdateChain failed LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]); DebugLn(['TFPDocEditForm.UpdateChain failed LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]);
exit; exit;
end; end;
else else
@ -587,7 +587,7 @@ begin
end; end;
end; end;
procedure TLazDocEditForm.OnLazDocChanging(Sender: TObject; procedure TFPDocEditor.OnLazDocChanging(Sender: TObject;
LazDocFPFile: TLazFPDocFile); LazDocFPFile: TLazFPDocFile);
begin begin
if ldffWriting in FFlags then exit; if ldffWriting in FFlags then exit;
@ -595,14 +595,14 @@ begin
InvalidateChain; InvalidateChain;
end; end;
procedure TLazDocEditForm.OnLazDocChanged(Sender: TObject; procedure TFPDocEditor.OnLazDocChanged(Sender: TObject;
LazDocFPFile: TLazFPDocFile); LazDocFPFile: TLazFPDocFile);
begin begin
if ldffWriting in FFlags then exit; if ldffWriting in FFlags then exit;
end; end;
procedure TLazDocEditForm.LoadGUIValues(Element: TLazDocElement); procedure TFPDocEditor.LoadGUIValues(Element: TLazDocElement);
var var
EnabledState: Boolean; EnabledState: Boolean;
Values: TFPDocElementValues; Values: TFPDocElementValues;
@ -651,7 +651,7 @@ begin
FModified:=OldModified; FModified:=OldModified;
end; end;
procedure TLazDocEditForm.MoveToInherited(Element: TLazDocElement); procedure TFPDocEditor.MoveToInherited(Element: TLazDocElement);
var var
Values: TFPDocElementValues; Values: TFPDocElementValues;
begin begin
@ -659,11 +659,11 @@ begin
WriteNode(Element,Values,true); WriteNode(Element,Values,true);
end; end;
function TLazDocEditForm.CreateElement(Element: TLazDocElement): Boolean; function TFPDocEditor.CreateElement(Element: TLazDocElement): Boolean;
var var
NewElement: TLazDocElement; NewElement: TLazDocElement;
begin begin
DebugLn(['TLazDocEditForm.CreateElement ']); DebugLn(['TFPDocEditForm.CreateElement ']);
if (Element=nil) or (Element.ElementName='') then exit(false); if (Element=nil) or (Element.ElementName='') then exit(false);
NewElement:=nil; NewElement:=nil;
Include(FFlags,ldffWriting); Include(FFlags,ldffWriting);
@ -678,7 +678,7 @@ begin
InvalidateChain; InvalidateChain;
end; end;
procedure TLazDocEditForm.Reset; procedure TFPDocEditor.Reset;
begin begin
FreeAndNil(fChain); FreeAndNil(fChain);
@ -695,7 +695,7 @@ begin
CreateButton.Enabled:=false; CreateButton.Enabled:=false;
end; end;
procedure TLazDocEditForm.InvalidateChain; procedure TFPDocEditor.InvalidateChain;
begin begin
FreeAndNil(fChain); FreeAndNil(fChain);
FFlags:=FFlags+[ldffChainNeedsUpdate,ldffCaptionNeedsUpdate, FFlags:=FFlags+[ldffChainNeedsUpdate,ldffCaptionNeedsUpdate,
@ -703,7 +703,7 @@ begin
ldffLinkIDComboNeedsUpdate]; ldffLinkIDComboNeedsUpdate];
end; end;
procedure TLazDocEditForm.UpdateLazDoc(const SrcFilename: string; procedure TFPDocEditor.UpdateLazDoc(const SrcFilename: string;
const Caret: TPoint); const Caret: TPoint);
var var
NewSrcFilename: String; NewSrcFilename: String;
@ -725,12 +725,12 @@ begin
InvalidateChain; InvalidateChain;
end; end;
procedure TLazDocEditForm.BeginUpdate; procedure TFPDocEditor.BeginUpdate;
begin begin
inc(fUpdateLock); inc(fUpdateLock);
end; end;
procedure TLazDocEditForm.EndUpdate; procedure TFPDocEditor.EndUpdate;
begin begin
dec(fUpdateLock); dec(fUpdateLock);
if fUpdateLock<0 then RaiseGDBException(''); if fUpdateLock<0 then RaiseGDBException('');
@ -739,7 +739,7 @@ begin
end; end;
end; end;
procedure TLazDocEditForm.ClearEntry(DoSave: Boolean); procedure TFPDocEditor.ClearEntry(DoSave: Boolean);
begin begin
Modified:=true; Modified:=true;
ShortEdit.Text:=''; ShortEdit.Text:='';
@ -750,7 +750,7 @@ begin
if DoSave then Save; if DoSave then Save;
end; end;
procedure TLazDocEditForm.Save; procedure TFPDocEditor.Save;
var var
Values: TFPDocElementValues; Values: TFPDocElementValues;
begin begin
@ -768,7 +768,7 @@ begin
SaveButton.Enabled:=false; SaveButton.Enabled:=false;
end; end;
function TLazDocEditForm.GetValues: TFPDocElementValues; function TFPDocEditor.GetValues: TFPDocElementValues;
begin begin
Result[fpdiShort]:=ShortEdit.Text; Result[fpdiShort]:=ShortEdit.Text;
Result[fpdiDescription]:=DescrMemo.Text; Result[fpdiDescription]:=DescrMemo.Text;
@ -777,14 +777,14 @@ begin
Result[fpdiExample]:=ExampleEdit.Text; Result[fpdiExample]:=ExampleEdit.Text;
end; end;
procedure TLazDocEditForm.SetModified(const AValue: boolean); procedure TFPDocEditor.SetModified(const AValue: boolean);
begin begin
if FModified=AValue then exit; if FModified=AValue then exit;
FModified:=AValue; FModified:=AValue;
SaveButton.Enabled:=FModified; SaveButton.Enabled:=FModified;
end; end;
function TLazDocEditForm.WriteNode(Element: TLazDocElement; function TFPDocEditor.WriteNode(Element: TLazDocElement;
Values: TFPDocElementValues; Interactive: Boolean): Boolean; Values: TFPDocElementValues; Interactive: Boolean): Boolean;
var var
TopNode: TDOMNode; TopNode: TDOMNode;
@ -884,7 +884,7 @@ var
begin begin
Result:=false; Result:=false;
if ldffWriting in FFlags then begin if ldffWriting in FFlags then begin
DebugLn(['TLazDocEditForm.WriteNode inconsistency detected: recursive write']); DebugLn(['TFPDocEditForm.WriteNode inconsistency detected: recursive write']);
exit; exit;
end; end;
@ -893,7 +893,7 @@ begin
if Check(CurDocFile=nil,'Element.FPDocFile=nil') then begin if Check(CurDocFile=nil,'Element.FPDocFile=nil') then begin
// no fpdoc file found // no fpdoc file found
// TODO: create a new file // TODO: create a new file
DebugLn(['TLazDocEditForm.WriteNode TODO: implement creating new fpdoc file']); DebugLn(['TFPDocEditForm.WriteNode TODO: implement creating new fpdoc file']);
exit; exit;
end; end;
CurDoc:=CurDocFile.Doc; CurDoc:=CurDocFile.Doc;
@ -924,18 +924,18 @@ begin
end; end;
if LazDocBoss.SaveFPDocFile(CurDocFile)<>mrOk then begin if LazDocBoss.SaveFPDocFile(CurDocFile)<>mrOk then begin
DebugLn(['TLazDocEditForm.WriteNode failed writing ',CurDocFile.Filename]); DebugLn(['TFPDocEditForm.WriteNode failed writing ',CurDocFile.Filename]);
exit; exit;
end; end;
Result:=true; Result:=true;
end; end;
procedure TLazDocEditForm.DocumentationTagChange(Sender: TObject); procedure TFPDocEditor.DocumentationTagChange(Sender: TObject);
begin begin
Modified := True; Modified := True;
end; end;
function TLazDocEditForm.MakeLink: String; function TFPDocEditor.MakeLink: String;
begin begin
if Trim(LinkTextEdit.Text) = '' then if Trim(LinkTextEdit.Text) = '' then
Result := '<link id="' + Trim(LinkIdComboBox.Text) + '"/>' Result := '<link id="' + Trim(LinkIdComboBox.Text) + '"/>'
@ -944,7 +944,7 @@ begin
LinkTextEdit.Text + '</link>'; LinkTextEdit.Text + '</link>';
end; end;
function TLazDocEditForm.FindInheritedIndex: integer; function TFPDocEditor.FindInheritedIndex: integer;
// returns Index in chain of an overriden Element with a short description // returns Index in chain of an overriden Element with a short description
// returns -1 if not found // returns -1 if not found
var var
@ -964,7 +964,7 @@ begin
Result:=-1; Result:=-1;
end; end;
procedure TLazDocEditForm.AddLinkButtonClick(Sender: TObject); procedure TFPDocEditor.AddLinkButtonClick(Sender: TObject);
begin begin
if Trim(LinkIdComboBox.Text) <> '' then if Trim(LinkIdComboBox.Text) <> '' then
begin begin
@ -973,7 +973,7 @@ begin
end; end;
end; end;
procedure TLazDocEditForm.BrowseExampleButtonClick(Sender: TObject); procedure TFPDocEditor.BrowseExampleButtonClick(Sender: TObject);
begin begin
if Doc=nil then exit; if Doc=nil then exit;
if OpenDialog.Execute then if OpenDialog.Execute then
@ -981,13 +981,13 @@ begin
ExtractFilePath(DocFile.Filename), OpenDialog.FileName)); ExtractFilePath(DocFile.Filename), OpenDialog.FileName));
end; end;
procedure TLazDocEditForm.CopyFromInheritedButtonClick(Sender: TObject); procedure TFPDocEditor.CopyFromInheritedButtonClick(Sender: TObject);
var var
i: LongInt; i: LongInt;
begin begin
i:=FindInheritedIndex; i:=FindInheritedIndex;
if i<0 then exit; if i<0 then exit;
DebugLn(['TLazDocEditForm.CopyFromInheritedButtonClick ']); DebugLn(['TFPDocEditForm.CopyFromInheritedButtonClick ']);
if ShortEdit.Text<>'' then begin if ShortEdit.Text<>'' then begin
if QuestionDlg('Confirm replace', if QuestionDlg('Confirm replace',
GetContextTitle(fChain[0])+' already contains the help:'+#13 GetContextTitle(fChain[0])+' already contains the help:'+#13
@ -998,17 +998,17 @@ begin
Modified:=true; Modified:=true;
end; end;
procedure TLazDocEditForm.CreateButtonClick(Sender: TObject); procedure TFPDocEditor.CreateButtonClick(Sender: TObject);
begin begin
if (fChain=nil) or (fChain.Count=0) then exit; if (fChain=nil) or (fChain.Count=0) then exit;
CreateElement(fChain[0]); CreateElement(fChain[0]);
end; end;
procedure TLazDocEditForm.DeleteLinkButtonClick(Sender: TObject); procedure TFPDocEditor.DeleteLinkButtonClick(Sender: TObject);
begin begin
if LinkListBox.ItemIndex >= 0 then begin if LinkListBox.ItemIndex >= 0 then begin
LinkListBox.Items.Delete(LinkListBox.ItemIndex); LinkListBox.Items.Delete(LinkListBox.ItemIndex);
DebugLn(['TLazDocEditForm.DeleteLinkButtonClick ']); DebugLn(['TFPDocEditForm.DeleteLinkButtonClick ']);
Modified := True; Modified := True;
end; end;
end; end;

View File

@ -433,7 +433,7 @@ begin
RegisterIDEHelpDatabases; RegisterIDEHelpDatabases;
RegisterDefaultIDEHelpViewers; RegisterDefaultIDEHelpViewers;
LazDocBoss:=TLazDocManager.Create; LazDocBoss:=TCodeHelpManager.Create;
// register property editors for URL handling // register property editors for URL handling
RegisterPropertyEditor(TypeInfo(AnsiString), RegisterPropertyEditor(TypeInfo(AnsiString),

View File

@ -3102,11 +3102,11 @@ var
SrcEdit: TSourceEditor; SrcEdit: TSourceEditor;
CaretPos: TPoint; CaretPos: TPoint;
begin begin
if LazDocEditForm = nil then exit; if FPDocEditor = nil then exit;
SrcEdit:=GetActiveSE; SrcEdit:=GetActiveSE;
if SrcEdit=nil then exit; if SrcEdit=nil then exit;
CaretPos := SrcEdit.EditorComponent.CaretXY; CaretPos := SrcEdit.EditorComponent.CaretXY;
LazDocEditForm.UpdateLazDoc(SrcEdit.Filename,CaretPos); FPDocEditor.UpdateLazDoc(SrcEdit.Filename,CaretPos);
end; end;
function TSourceNotebook.OnSynCompletionPaintItem(const AKey: string; function TSourceNotebook.OnSynCompletionPaintItem(const AKey: string;