cody: registration order

git-svn-id: trunk@30641 -
This commit is contained in:
mattias 2011-05-09 17:18:02 +00:00
parent d750730b4e
commit be5b54d28d
8 changed files with 92 additions and 73 deletions

1
.gitattributes vendored
View File

@ -558,6 +558,7 @@ components/codetools/ide/cody.pas svneol=native#text/pascal
components/codetools/ide/codyctrls.pas svneol=native#text/plain
components/codetools/ide/codyfrm.lfm svneol=native#text/plain
components/codetools/ide/codyfrm.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/languages/codystrconsts.it.po svneol=native#text/plain
components/codetools/ide/languages/codystrconsts.po svneol=native#text/plain

View File

@ -36,7 +36,7 @@ uses
CodeCache, CodeToolManager, FileProcs, PascalParserTool,
BasicCodeTools, CodeAtom, CodeTree, FindDeclarationTool,
// IDEIntf
IDEDialogs, IDECommands, MenuIntf, LazIDEIntf, SrcEditorIntf,
IDEDialogs, LazIDEIntf, SrcEditorIntf,
// Cody
CodyCtrls, CodyStrConsts;
@ -111,8 +111,6 @@ type
end;
procedure Register;
procedure ShowAddAssignMethodDialog(Sender: TObject);
function CompareAAMDItemsByName(Item1, Item2: Pointer): integer;
@ -120,21 +118,6 @@ function CompareAnsistringWithAAMDItemName(AnAnsistring, Item: Pointer): integer
implementation
procedure Register;
var
CmdCategory: TIDECommandCategory;
AddAssignMethodCommand: TIDECommand;
begin
CmdCategory:=IDECommandList.FindCategoryByName('CodeTools');
if CmdCategory=nil then
raise Exception.Create('cody: AddAssignMethodDlg.Register: command category CodeTools not found');
AddAssignMethodCommand:=RegisterIDECommand(CmdCategory, 'AddAssignMethod',
crsAddAssignMethod,
CleanIDEShortCut,CleanIDEShortCut,nil,@ShowAddAssignMethodDialog);
RegisterIDEMenuCommand(SrcEditSubMenuSource, 'AddAssignMethod',
crsAddAssignMethod2,nil,nil,AddAssignMethodCommand);
end;
procedure ShowAddAssignMethodDialog(Sender: TObject);
procedure ErrorNotInClass;

View File

@ -15,10 +15,9 @@
<Description Value="IDE extensions using Codetools."/>
<License Value="GPL2"/>
<Version Major="1" Release="1"/>
<Files Count="5">
<Files Count="6">
<Item1>
<Filename Value="ppulistdlg.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="PPUListDlg"/>
</Item1>
<Item2>
@ -27,19 +26,21 @@
</Item2>
<Item3>
<Filename Value="addassignmethoddlg.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="AddAssignMethodDlg"/>
</Item3>
<Item4>
<Filename Value="codyctrls.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="CodyCtrls"/>
</Item4>
<Item5>
<Filename Value="codyfrm.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="codyfrm"/>
<UnitName Value="CodyFrm"/>
</Item5>
<Item6>
<Filename Value="codyregistration.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="CodyRegistration"/>
</Item6>
</Files>
<LazDoc Paths="doc"/>
<i18n>

View File

@ -8,16 +8,13 @@ interface
uses
PPUListDlg, CodyStrConsts, AddAssignMethodDlg, CodyCtrls, CodyFrm,
LazarusPackageIntf;
CodyRegistration, LazarusPackageIntf;
implementation
procedure Register;
begin
RegisterUnit('PPUListDlg', @PPUListDlg.Register);
RegisterUnit('AddAssignMethodDlg', @AddAssignMethodDlg.Register);
RegisterUnit('CodyCtrls', @CodyCtrls.Register);
RegisterUnit('CodyFrm', @CodyFrm.Register);
RegisterUnit('CodyRegistration', @CodyRegistration.Register);
end;
initialization

View File

@ -41,15 +41,8 @@ type
procedure FreeNodeData;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('LazControls',[TCodyTreeView]);
end;
{ TCodyTreeView }
procedure TCodyTreeView.FreeNodeData;

View File

@ -34,7 +34,7 @@ uses
// codetools
CodeToolManager, CodeCache,
// IDEIntf
LazIDEIntf, IDECommands, MenuIntf, SrcEditorIntf, IDEDialogs,
LazIDEIntf, SrcEditorIntf, IDEDialogs,
// cody
CodyStrConsts;
@ -49,8 +49,6 @@ var
procedure RemoveWithBlockCmd(Sender: TObject);
procedure Register;
implementation
procedure RemoveWithBlockCmd(Sender: TObject);
@ -85,21 +83,6 @@ begin
end;
end;
procedure Register;
var
CmdCategory: TIDECommandCategory;
RemoveWithBlockCommand: TIDECommand;
begin
CmdCategory:=IDECommandList.FindCategoryByName('CodeTools');
if CmdCategory=nil then
raise Exception.Create('cody: CodyFrm.Register: command category CodeTools not found');
RemoveWithBlockCommand:=RegisterIDECommand(CmdCategory, 'RemoveWithBlock',
crsRemoveWithBlock,
CleanIDEShortCut,CleanIDEShortCut,nil,@RemoveWithBlockCmd);
RegisterIDEMenuCommand(SrcEditSubMenuRefactor, 'RemoveWithBlock',
crsRemoveWithBlock, nil, nil, RemoveWithBlockCommand);
end;
{$R *.lfm}
end.

View File

@ -0,0 +1,79 @@
{
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
Author: Mattias Gaertner
Abstract:
LCL controls for Cody.
}
unit CodyRegistration;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
IDECommands, MenuIntf,
CodyFrm, CodyStrConsts, CodyCtrls, PPUListDlg, AddAssignMethodDlg;
procedure Register;
implementation
procedure Register;
var
CmdCategory: TIDECommandCategory;
PPUListCommand: TIDECommand;
AddAssignMethodCommand: TIDECommand;
RemoveWithBlockCommand: TIDECommand;
begin
CmdCategory:=IDECommandList.FindCategoryByName('ProjectMenu');
if CmdCategory=nil then
raise Exception.Create('cody: PPUListDlg.Register: command category ProjectMenu not found');
// show ppu list of project
PPUListCommand:=RegisterIDECommand(CmdCategory, 'ShowPPUList',
crsShowUsedPpuFiles,
CleanIDEShortCut,CleanIDEShortCut,nil,@ShowPPUList);
RegisterIDEMenuCommand(itmProjectWindowSection,'PPUList',crsShowUsedPpuFiles,
nil,nil,PPUListCommand);
CmdCategory:=IDECommandList.FindCategoryByName('CodeTools');
if CmdCategory=nil then
raise Exception.Create('cody: AddAssignMethodDlg.Register: command category CodeTools not found');
// add Assign method
AddAssignMethodCommand:=RegisterIDECommand(CmdCategory, 'AddAssignMethod',
crsAddAssignMethod,
CleanIDEShortCut,CleanIDEShortCut,nil,@ShowAddAssignMethodDialog);
RegisterIDEMenuCommand(SrcEditSubMenuSource, 'AddAssignMethod',
crsAddAssignMethod2,nil,nil,AddAssignMethodCommand);
// remove With block
RemoveWithBlockCommand:=RegisterIDECommand(CmdCategory, 'RemoveWithBlock',
crsRemoveWithBlock,
CleanIDEShortCut,CleanIDEShortCut,nil,@RemoveWithBlockCmd);
RegisterIDEMenuCommand(SrcEditSubMenuRefactor, 'RemoveWithBlock',
crsRemoveWithBlock, nil, nil, RemoveWithBlockCommand);
// components
RegisterComponents('LazControls',[TCodyTreeView]);
end;
end.

View File

@ -34,7 +34,7 @@ uses
Graphics, Dialogs, ButtonPanel, Grids, StdCtrls, AvgLvlTree, ExtCtrls,
ComCtrls,
// IDEIntf
IDECommands, MenuIntf, ProjectIntf, LazIDEIntf, IDEDialogs, IDEWindowIntf,
ProjectIntf, LazIDEIntf, IDEDialogs, IDEWindowIntf,
PackageIntf,
// codetools
BasicCodeTools, FileProcs, CodyStrConsts, CodeToolManager, CodeCache,
@ -148,8 +148,6 @@ procedure ShowPPUList(Sender: TObject);
function ComparePPUListItems(Item1, Item2: Pointer): integer;
function CompareUnitNameWithPPUListItem(TheUnitName, Item: Pointer): integer;
procedure Register;
implementation
{$R *.lfm}
@ -188,22 +186,6 @@ begin
Result:=CompareIdentifiers(un,PChar(li.TheUnitName));
end;
procedure Register;
var
CmdCategory: TIDECommandCategory;
PPUListCommand: TIDECommand;
begin
CmdCategory:=IDECommandList.FindCategoryByName('ProjectMenu');
if CmdCategory=nil then
raise Exception.Create('cody: PPUListDlg.Register: command category ProjectMenu not found');
PPUListCommand:=RegisterIDECommand(CmdCategory, 'ShowPPUList',
crsShowUsedPpuFiles,
CleanIDEShortCut,CleanIDEShortCut,nil,@ShowPPUList);
RegisterIDEMenuCommand(itmProjectWindowSection, 'PPUList', crsShowUsedPpuFiles
,
nil,nil,PPUListCommand);
end;
{ TPPUListItem }
destructor TPPUListItem.Destroy;