From 9b869cc4c598b891d37051f0fb416b5473d39dcd Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 28 Jan 2013 14:12:21 +0000 Subject: [PATCH] cody: started unit dependencies dlg git-svn-id: trunk@40003 - --- .gitattributes | 2 + components/codetools/ide/cody.lpk | 6 ++- components/codetools/ide/cody.pas | 3 +- .../codetools/ide/codyidentifiersdlg.pas | 16 +++--- components/codetools/ide/codyregistration.pas | 15 ++++-- components/codetools/ide/codyunitdepwnd.lfm | 41 ++++++++++++++ components/codetools/ide/codyunitdepwnd.pas | 53 +++++++++++++++++++ 7 files changed, 122 insertions(+), 14 deletions(-) create mode 100644 components/codetools/ide/codyunitdepwnd.lfm create mode 100644 components/codetools/ide/codyunitdepwnd.pas diff --git a/.gitattributes b/.gitattributes index baf8cffdb4..9c069427d9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -791,6 +791,8 @@ components/codetools/ide/codynodeinfodlg.pas svneol=native#text/plain components/codetools/ide/codyopts.pas svneol=native#text/plain components/codetools/ide/codyregistration.pas svneol=native#text/plain components/codetools/ide/codystrconsts.pas svneol=native#text/pascal +components/codetools/ide/codyunitdepwnd.lfm svneol=native#text/plain +components/codetools/ide/codyunitdepwnd.pas svneol=native#text/plain components/codetools/ide/codyutils.pas svneol=native#text/pascal components/codetools/ide/declarevardlg.lfm svneol=native#text/plain components/codetools/ide/declarevardlg.pas svneol=native#text/pascal diff --git a/components/codetools/ide/cody.lpk b/components/codetools/ide/cody.lpk index aee47667d9..a6e9797a6d 100644 --- a/components/codetools/ide/cody.lpk +++ b/components/codetools/ide/cody.lpk @@ -19,7 +19,7 @@ - + @@ -85,6 +85,10 @@ + + + + diff --git a/components/codetools/ide/cody.pas b/components/codetools/ide/cody.pas index 21b645fa6f..5cb32dfbb5 100644 --- a/components/codetools/ide/cody.pas +++ b/components/codetools/ide/cody.pas @@ -10,7 +10,8 @@ uses PPUListDlg, CodyStrConsts, AddAssignMethodDlg, CodyCtrls, CodyFrm, CodyRegistration, DeclareVarDlg, CodyUtils, CodyNodeInfoDlg, CodyCopyDeclaration, AddWithBlockDlg, CodyIdentifiersDlg, CodyMiscOptsFrame, - CodyOpts, TemplateIDEDockableWindow, NewIDEWndDlg, LazarusPackageIntf; + CodyOpts, TemplateIDEDockableWindow, NewIDEWndDlg, CodyUnitDepWnd, + LazarusPackageIntf; implementation diff --git a/components/codetools/ide/codyidentifiersdlg.pas b/components/codetools/ide/codyidentifiersdlg.pas index 93067c84fa..8a680de49c 100644 --- a/components/codetools/ide/codyidentifiersdlg.pas +++ b/components/codetools/ide/codyidentifiersdlg.pas @@ -248,19 +248,19 @@ implementation procedure ShowUnitDictionaryDialog(Sender: TObject); var - CodyIdentifiersDlg: TCodyIdentifiersDlg; + Dlg: TCodyIdentifiersDlg; begin - CodyIdentifiersDlg:=TCodyIdentifiersDlg.Create(nil); + Dlg:=TCodyIdentifiersDlg.Create(nil); try - if not CodyIdentifiersDlg.Init then exit; - if CodyIdentifiersDlg.ShowModal=mrOk then begin - case CodyIdentifiersDlg.DlgAction of - cidaUseIdentifier: CodyIdentifiersDlg.UseIdentifier; - cidaJumpToIdentifier: CodyIdentifiersDlg.JumpToIdentifier; + if not Dlg.Init then exit; + if Dlg.ShowModal=mrOk then begin + case Dlg.DlgAction of + cidaUseIdentifier: Dlg.UseIdentifier; + cidaJumpToIdentifier: Dlg.JumpToIdentifier; end; end; finally - CodyIdentifiersDlg.Free; + Dlg.Free; end; end; diff --git a/components/codetools/ide/codyregistration.pas b/components/codetools/ide/codyregistration.pas index 0ad4303573..1249c4e915 100644 --- a/components/codetools/ide/codyregistration.pas +++ b/components/codetools/ide/codyregistration.pas @@ -32,11 +32,12 @@ interface uses Classes, SysUtils, LazUTF8, LResources, LCLProc, Controls, Forms, MenuIntf, IDEWindowIntf, SrcEditorIntf, IDEOptionsIntf, ProjectIntf, - IDECommands, + IDECommands, NewIDEWndDlg, CodeToolManager, - CodyStrConsts, CodyCtrls, PPUListDlg, AddAssignMethodDlg, AddWithBlockDlg, - CodyUtils, CodyNodeInfoDlg, CodyFrm, DeclareVarDlg, CodyCopyDeclaration, - CodyIdentifiersDlg, CodyMiscOptsFrame, CodyOpts, NewIDEWndDlg; + CodyStrConsts, CodyUtils, CodyCtrls, CodyOpts, + PPUListDlg, CodyUnitDepWnd, AddAssignMethodDlg, AddWithBlockDlg, + CodyNodeInfoDlg, CodyFrm, DeclareVarDlg, CodyCopyDeclaration, + CodyIdentifiersDlg, CodyMiscOptsFrame; procedure Register; @@ -131,6 +132,12 @@ begin CreateSourceCommand(CmdCatCodeTools,'ShowUnitDictionary', crsShowUnitIdentifierDictionary,nil,@ShowUnitDictionaryDialog); + // Unit dependencies + {$IFDEF EnableCodyExperiments} + CreateSourceCommand(CmdCatCodeTools,'UnitDependencies', + 'Cody Unit Dependencies',nil,@ShowUnitDependenciesDialog); + {$ENDIF} + // Refactor menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // declare variable diff --git a/components/codetools/ide/codyunitdepwnd.lfm b/components/codetools/ide/codyunitdepwnd.lfm new file mode 100644 index 0000000000..3fd91df38f --- /dev/null +++ b/components/codetools/ide/codyunitdepwnd.lfm @@ -0,0 +1,41 @@ +object UnitDependenciesDialog: TUnitDependenciesDialog + Left = 215 + Height = 390 + Top = 224 + Width = 486 + Caption = 'UnitDependenciesDialog' + ClientHeight = 390 + ClientWidth = 486 + LCLVersion = '1.1' + object BtnPanel: TPanel + Left = 0 + Height = 41 + Top = 349 + Width = 486 + Align = alBottom + AutoSize = True + ClientHeight = 41 + ClientWidth = 486 + TabOrder = 0 + object CloseBitBtn: TBitBtn + AnchorSideRight.Control = BtnPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = BtnPanel + AnchorSideBottom.Side = asrBottom + Left = 402 + Height = 27 + Top = 7 + Width = 77 + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'CloseBitBtn' + OnClick = CloseBitBtnClick + TabOrder = 0 + end + end + object Timer1: TTimer + left = 230 + top = 187 + end +end diff --git a/components/codetools/ide/codyunitdepwnd.pas b/components/codetools/ide/codyunitdepwnd.pas new file mode 100644 index 0000000000..64629e274e --- /dev/null +++ b/components/codetools/ide/codyunitdepwnd.pas @@ -0,0 +1,53 @@ +unit CodyUnitDepWnd; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, + Buttons; + +type + + { TUnitDependenciesDialog } + + TUnitDependenciesDialog = class(TForm) + BtnPanel: TPanel; + CloseBitBtn: TBitBtn; + Timer1: TTimer; + procedure CloseBitBtnClick(Sender: TObject); + private + public + end; + +var + UnitDependenciesDialog: TUnitDependenciesDialog; + +procedure ShowUnitDependenciesDialog(Sender: TObject); + +implementation + +procedure ShowUnitDependenciesDialog(Sender: TObject); +var + Dlg: TUnitDependenciesDialog; +begin + Dlg:=TUnitDependenciesDialog.Create(nil); + try + Dlg.ShowModal; + finally + Dlg.Free; + end; +end; + +{ TUnitDependenciesDialog } + +procedure TUnitDependenciesDialog.CloseBitBtnClick(Sender: TObject); +begin + ModalResult:=mrOk; +end; + +{$R *.lfm} + +end. +