mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 17:55:55 +02:00
IDE: ide internals: fpdoc files
git-svn-id: trunk@34854 -
This commit is contained in:
parent
366a247eab
commit
e0e58b47c4
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4283,6 +4283,8 @@ ide/idecontexthelpedit.pas svneol=native#text/plain
|
||||
ide/idedefs.pas svneol=native#text/pascal
|
||||
ide/idefpcinfo.lfm svneol=native#text/plain
|
||||
ide/idefpcinfo.pas svneol=native#text/plain
|
||||
ide/idefpdocfilesearch.lfm svneol=native#text/plain
|
||||
ide/idefpdocfilesearch.pas svneol=native#text/plain
|
||||
ide/ideguicmdline.pas svneol=native#text/plain
|
||||
ide/idehelpmanager.lfm svneol=native#text/plain
|
||||
ide/idehelpmanager.pas svneol=native#text/pascal
|
||||
|
122
ide/idefpdocfilesearch.lfm
Normal file
122
ide/idefpdocfilesearch.lfm
Normal file
@ -0,0 +1,122 @@
|
||||
object FPDocFileSearchDialog: TFPDocFileSearchDialog
|
||||
Left = 239
|
||||
Height = 483
|
||||
Top = 201
|
||||
Width = 647
|
||||
Caption = 'FPDocFileSearchDialog'
|
||||
ClientHeight = 483
|
||||
ClientWidth = 647
|
||||
KeyPreview = True
|
||||
OnCreate = FormCreate
|
||||
OnKeyDown = FormKeyDown
|
||||
LCLVersion = '0.9.31'
|
||||
object SearchTextLabel: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SearchTextComboBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 12
|
||||
Width = 91
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'SearchTextLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object SearchTextComboBox: TComboBox
|
||||
AnchorSideLeft.Control = SearchTextLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideRight.Control = CloseBitBtn
|
||||
Left = 103
|
||||
Height = 27
|
||||
Top = 6
|
||||
Width = 457
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 0
|
||||
TabOrder = 0
|
||||
Text = 'SearchTextComboBox'
|
||||
end
|
||||
object ScopeGroupBox: TGroupBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SearchTextComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 438
|
||||
Top = 39
|
||||
Width = 145
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'ScopeGroupBox'
|
||||
ClientHeight = 422
|
||||
ClientWidth = 141
|
||||
TabOrder = 1
|
||||
object ScopeTreeView: TTreeView
|
||||
Left = 0
|
||||
Height = 422
|
||||
Top = 0
|
||||
Width = 141
|
||||
Align = alClient
|
||||
DefaultItemHeight = 16
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object CloseBitBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 566
|
||||
Height = 26
|
||||
Top = 6
|
||||
Width = 75
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'CloseBitBtn'
|
||||
ModalResult = 11
|
||||
TabOrder = 2
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
AnchorSideLeft.Control = ScopeGroupBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ScopeGroupBox
|
||||
AnchorSideBottom.Control = ScopeGroupBox
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 151
|
||||
Height = 438
|
||||
Top = 39
|
||||
Width = 5
|
||||
Align = alNone
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
end
|
||||
object ResultsMemo: TMemo
|
||||
AnchorSideLeft.Control = Splitter1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Splitter1
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 156
|
||||
Height = 432
|
||||
Top = 45
|
||||
Width = 485
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Lines.Strings = (
|
||||
'ResultsMemo'
|
||||
)
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 4
|
||||
end
|
||||
end
|
117
ide/idefpdocfilesearch.pas
Normal file
117
ide/idefpdocfilesearch.pas
Normal file
@ -0,0 +1,117 @@
|
||||
unit IDEFPDocFileSearch;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ButtonPanel, Buttons, ComCtrls, ExtCtrls, LCLType,
|
||||
LazarusIDEStrConsts, PackageSystem, PackageDefs;
|
||||
|
||||
type
|
||||
|
||||
{ TFPDocFileSearchDialog }
|
||||
|
||||
TFPDocFileSearchDialog = class(TForm)
|
||||
CloseBitBtn: TBitBtn;
|
||||
ResultsMemo: TMemo;
|
||||
ScopeGroupBox: TGroupBox;
|
||||
ScopeTreeView: TTreeView;
|
||||
SearchTextComboBox: TComboBox;
|
||||
SearchTextLabel: TLabel;
|
||||
Splitter1: TSplitter;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure OnIdle(Sender: TObject; var Done: Boolean);
|
||||
private
|
||||
FIdleConnected: boolean;
|
||||
procedure SetIdleConnected(AValue: boolean);
|
||||
procedure FillScope;
|
||||
public
|
||||
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||
end;
|
||||
|
||||
procedure ShowFPDocFileSearch;
|
||||
|
||||
implementation
|
||||
|
||||
procedure ShowFPDocFileSearch;
|
||||
var
|
||||
FPDocFileSearchDialog: TFPDocFileSearchDialog;
|
||||
begin
|
||||
FPDocFileSearchDialog:=TFPDocFileSearchDialog.Create(nil);
|
||||
try
|
||||
FPDocFileSearchDialog.ShowModal;
|
||||
finally
|
||||
FPDocFileSearchDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TFPDocFileSearchDialog }
|
||||
|
||||
procedure TFPDocFileSearchDialog.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Caption:='Search in FPDoc files';
|
||||
CloseBitBtn.Caption:='Close';
|
||||
SearchTextLabel.Caption:='Search:';
|
||||
SearchTextComboBox.Text:='';
|
||||
ActiveControl:=SearchTextComboBox;
|
||||
ScopeGroupBox.Caption:='Scope';
|
||||
|
||||
ResultsMemo.Clear;
|
||||
FillScope;
|
||||
IdleConnected:=true;
|
||||
end;
|
||||
|
||||
procedure TFPDocFileSearchDialog.FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key=VK_ESCAPE then
|
||||
ModalResult:=mrCancel;
|
||||
end;
|
||||
|
||||
procedure TFPDocFileSearchDialog.OnIdle(Sender: TObject; var Done: Boolean);
|
||||
begin
|
||||
// ToDo:
|
||||
|
||||
|
||||
// nothing to do
|
||||
IdleConnected:=false;
|
||||
end;
|
||||
|
||||
procedure TFPDocFileSearchDialog.SetIdleConnected(AValue: boolean);
|
||||
begin
|
||||
if FIdleConnected=AValue then Exit;
|
||||
FIdleConnected:=AValue;
|
||||
if IdleConnected then
|
||||
Application.AddOnIdleHandler(@OnIdle)
|
||||
else
|
||||
Application.RemoveOnIdleHandler(@OnIdle);
|
||||
end;
|
||||
|
||||
procedure TFPDocFileSearchDialog.FillScope;
|
||||
var
|
||||
PkgsNode: TTreeNode;
|
||||
i: Integer;
|
||||
Pkg: TLazPackage;
|
||||
begin
|
||||
ScopeTreeView.Items.BeginUpdate;
|
||||
ScopeTreeView.Items.Clear;
|
||||
|
||||
// packages with fpdoc
|
||||
PkgsNode:=ScopeTreeView.Items.Add(nil,'Packages');
|
||||
for i:=0 to PackageGraph.Count-1 do begin
|
||||
Pkg:=PackageGraph[i];
|
||||
if Pkg.FPDocPaths='' then continue;
|
||||
ScopeTreeView.Items.AddChild(PkgsNode,Pkg.Name);
|
||||
end;
|
||||
PkgsNode.Expanded:=true;
|
||||
|
||||
ScopeTreeView.Items.EndUpdate;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -45,7 +45,7 @@ uses
|
||||
// IDE
|
||||
LazarusIDEStrConsts, TransferMacros, DialogProcs, IDEOptionDefs,
|
||||
ObjInspExt, EnvironmentOpts, AboutFrm, MsgView, Project, MainBar, OutputFilter,
|
||||
PackageDefs, PackageSystem,
|
||||
IDEFPDocFileSearch, PackageDefs, PackageSystem,
|
||||
HelpOptions, MainIntf, LazConf, HelpFPCMessages, CodeHelp,
|
||||
IDEContextHelpEdit, IDEWindowHelp;
|
||||
|
||||
@ -168,6 +168,7 @@ type
|
||||
{ TIDEHelpManager }
|
||||
|
||||
TIDEHelpManager = class(TBaseHelpManager)
|
||||
procedure mnuSearchInFPDocFilesClick(Sender: TObject);
|
||||
// help menu of the IDE menu bar
|
||||
procedure mnuHelpAboutLazarusClicked(Sender: TObject);
|
||||
procedure mnuHelpOnlineHelpClicked(Sender: TObject);
|
||||
@ -1109,6 +1110,11 @@ end;
|
||||
|
||||
{ TIDEHelpManager }
|
||||
|
||||
procedure TIDEHelpManager.mnuSearchInFPDocFilesClick(Sender: TObject);
|
||||
begin
|
||||
ShowFPDocFileSearch;
|
||||
end;
|
||||
|
||||
procedure TIDEHelpManager.mnuHelpAboutLazarusClicked(Sender: TObject);
|
||||
begin
|
||||
ShowAboutForm;
|
||||
@ -1291,6 +1297,8 @@ begin
|
||||
itmHelpAboutLazarus.OnClick := @mnuHelpAboutLazarusClicked;
|
||||
itmHelpOnlineHelp.OnClick := @mnuHelpOnlineHelpClicked;
|
||||
itmHelpReportingBug.OnClick := @mnuHelpReportBugClicked;
|
||||
|
||||
itmSearchInFPDocFiles.OnClick:=@mnuSearchInFPDocFilesClick;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
<PackageName Value="SynEdit"/>
|
||||
</Item6>
|
||||
</RequiredPackages>
|
||||
<Units Count="86">
|
||||
<Units Count="87">
|
||||
<Unit0>
|
||||
<Filename Value="lazarus.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -648,6 +648,13 @@
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<UnitName Value="env_file_filters"/>
|
||||
</Unit85>
|
||||
<Unit86>
|
||||
<Filename Value="idefpdocfilesearch.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="FPDocFileSearchDialog"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="IDEFPDocFileSearch"/>
|
||||
</Unit86>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
@ -657,7 +664,7 @@
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="include"/>
|
||||
<OtherUnitFiles Value="frames;../converter;../debugger;../debugger/frames;../packager;../designer;../packager/frames;frames;../packager/frames"/>
|
||||
<OtherUnitFiles Value="frames;../converter;../debugger;../debugger/frames;../packager;../designer;../packager/frames"/>
|
||||
<UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
|
@ -195,6 +195,7 @@ type
|
||||
itmViewPackageLinks: TIDEMenuCommand;
|
||||
itmViewFPCInfo: TIDEMenuCommand;
|
||||
itmViewIDEInfo: TIDEMenuCommand;
|
||||
itmSearchInFPDocFiles: TIDEMenuCommand;
|
||||
|
||||
// source menu
|
||||
//mnuSource: TIDEMenuSection;
|
||||
|
@ -534,6 +534,10 @@ begin
|
||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks);
|
||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewFPCInfo, 'itmViewFPCInfo', lisMenuAboutFPC);
|
||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewIDEInfo, 'itmViewIDEInfo', lisAboutIDE);
|
||||
{$IFDEF EnableFPDocSearch}
|
||||
CreateMenuItem(itmViewIDEInternalsWindows, itmSearchInFPDocFiles, 'itmSearchInFPDocFiles',
|
||||
'Search in FPDoc files');
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user