IDE: added Insert GUID function, changed shortcut for procedure list from Ctrl-Shift-G to Alt-G from Graeme

git-svn-id: trunk@13180 -
This commit is contained in:
mattias 2007-12-06 09:53:13 +00:00
parent 1a64381f03
commit 5871aee8d7
8 changed files with 100 additions and 67 deletions

View File

@ -346,6 +346,7 @@ begin
ecInsertCVSName: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
ecInsertCVSRevision: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
ecInsertCVSSource: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
ecInsertGUID: SetResult(VK_G, [ssCtrl,ssShift],VK_UNKNOWN,[]);
// command commands
ecUndo: SetResult(VK_Z,[ssCtrl],VK_UNKNOWN,[]);
@ -369,7 +370,7 @@ begin
ecJumpToPrevError: SetResult(VK_F8,[ssCtrl, ssShift],VK_UNKNOWN,[]);
ecJumpToNextError: SetResult(VK_F8,[ssCtrl],VK_UNKNOWN,[]);
ecOpenFileAtCursor: SetResult2(VK_RETURN,[ssCtrl],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
ecProcedureList: SetResult(VK_G, [ssCtrl,ssShift],VK_UNKNOWN,[]);
ecProcedureList: SetResult(VK_G, [ssAlt],VK_UNKNOWN,[]);
// marker
@ -1108,8 +1109,7 @@ begin
ecFindPrevious: SetResult(VK_G,[ssCtrl, ssShift],VK_UNKNOWN,[]);
ecReplace: SetResult(VK_R,[SSCtrl],VK_UNKNOWN,[]);
ecGotoLineNumber: SetResult(VK_L,[ssCtrl],VK_UNKNOWN,[]);
ecProcedureList: SetResult(VK_P, [ssCtrl],VK_UNKNOWN,[]);
// view menu
ecToggleObjectInsp: SetResult(VK_F11,[ssCtrl],VK_UNKNOWN,[]);
ecToggleFormUnit: SetResult(VK_F12,[],VK_UNKNOWN,[]);
@ -1377,6 +1377,7 @@ begin
ecInsertCVSName : Result:= srkmecInsertCVSName;
ecInsertCVSRevision : Result:= srkmecInsertCVSRevision;
ecInsertCVSSource : Result:= srkmecInsertCVSSource;
ecInsertGUID : Result:= srkmecInsertGUID;
// search menu
ecFind : Result:= srkmecFind;
@ -2264,6 +2265,7 @@ begin
ecInsertCVSRevision); ;
AddDefault(C, 'Insert CVS keyword Source', srkmecInsertCVSSource,
ecInsertCVSSource);
AddDefault(C, 'Insert a GUID',srkmecInsertGUID, ecInsertGUID);
// command commands
C:=Categories[AddCategory('CommandCommands',srkmCatCmdCmd,nil)];

View File

@ -1748,7 +1748,8 @@ resourcestring
srkmecInsertCVSName = 'Insert CVS keyword Name';
srkmecInsertCVSRevision = 'Insert CVS keyword Revision';
srkmecInsertCVSSource = 'Insert CVS keyword Source';
srkmecInsertGUID = 'Insert a GUID';
// search menu
srkmecFind = 'Find text';
srkmecFindNext = 'Find next';

View File

@ -213,6 +213,7 @@ type
procedure mnuEditInsertDateTimeClick(Sender: TObject);
procedure mnuEditInsertChangeLogEntryClick(Sender: TObject);
procedure mnuInsertTodo(Sender: TObject);
procedure mnuEditInsertGUID(Sender: TObject);
// search menu
procedure mnuSearchFindInFiles(Sender: TObject);
@ -730,6 +731,7 @@ type
// edit menu
procedure DoCommand(EditorCommand: integer); override;
procedure DoSourceEditorCommand(EditorCommand: integer);
procedure DoInsertGUID;
// Delphi conversion
function DoConvertDFMtoLFM: TModalResult;
@ -2654,6 +2656,9 @@ begin
ecProcedureList:
mnuSearchProcedureList(self);
ecInsertGUID:
mnuEditInsertGUID(self);
else
Handled:=false;
// let the bosses handle it
@ -13377,6 +13382,11 @@ begin
DoSourceEditorCommand(ecInsertTodo);
end;
procedure TMainIDE.mnuEditInsertGUID(Sender: TObject);
begin
DoInsertGUID;
end;
procedure TMainIDE.mnuSearchFindInFiles(Sender: TObject);
begin
DoFindInFiles;
@ -13484,6 +13494,23 @@ begin
DoCommand(EditorCommand);
end;
procedure TMainIDE.DoInsertGUID;
const
cGUID = '[''%s'']'; // The format of the GUID used for Interfaces
var
ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo;
lGUID: TGUID;
begin
// get active source editor
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit;
if ActiveSrcEdit = nil then
Exit; //==>
CreateGUID(lGUID);
ActiveSrcEdit.Selection := Format(cGUID, [GUIDToString(lGUID)]);
end;
procedure TMainIDE.OnApplyWindowLayout(ALayout: TIDEWindowLayout);
var
l: TNonModalIDEWindow;

View File

@ -137,6 +137,7 @@ type
itmEditInsertUsername: TIDEMenuCommand;
itmEditInsertDateTime: TIDEMenuCommand;
itmEditInsertChangeLogEntry: TIDEMenuCommand;
itmEditInsertGUID: TIDEMenuCommand;
//itmEditMenuCodeTools: TIDEMenuSection;
itmEditCompleteCode: TIDEMenuCommand;
itmEditExtractProc: TIDEMenuCommand;

View File

@ -437,6 +437,7 @@ begin
CreateMenuItem(SubSubParentMI,itmEditInsertUsername,'itmEditInsertUsername',lisMenuInsertUsername);
CreateMenuItem(SubSubParentMI,itmEditInsertDateTime,'itmEditInsertDateTime',lisMenuInsertDateTime);
CreateMenuItem(SubSubParentMI,itmEditInsertChangeLogEntry,'itmEditInsertChangeLogEntry',lisMenuInsertChangeLogEntry);
CreateMenuItem(SubSubParentMI,itmEditInsertGUID,'itmEditInsertGUID',srkmecInsertGUID);
end;
end;
@ -841,6 +842,7 @@ begin
itmEditInsertUsername.Command:=GetCommand(ecInsertUserName);
itmEditInsertDateTime.Command:=GetCommand(ecInsertDateTime);
itmEditInsertChangeLogEntry.Command:=GetCommand(ecInsertChangeLogEntry);
itmEditInsertGUID.Command:=GetCommand(ecInsertGUID);
// search menu
itmSearchFind.Command:=GetCommand(ecFind);

View File

@ -1,23 +1,23 @@
object ProcedureListForm: TProcedureListForm
Left = 44
Height = 688
Top = 58
Width = 952
HorzScrollBar.Page = 951
VertScrollBar.Page = 687
Left = 93
Height = 327
Top = 186
Width = 638
HorzScrollBar.Page = 637
VertScrollBar.Page = 326
ActiveControl = cbObjects
Caption = 'Procedure List - '
ClientHeight = 688
ClientWidth = 952
ClientHeight = 327
ClientWidth = 638
OnCreate = FormCreate
OnKeyPress = FormKeyPress
OnResize = FormResize
OnShow = FormShow
Position = poDefault
object StatusBar: TStatusBar
Height = 23
Top = 665
Width = 952
Height = 24
Top = 303
Width = 638
Panels = <
item
Width = 400
@ -29,7 +29,7 @@ object ProcedureListForm: TProcedureListForm
end
object TB: TToolBar
Height = 26
Width = 952
Width = 638
Caption = 'TB'
Flat = True
TabOrder = 1
@ -127,31 +127,31 @@ object ProcedureListForm: TProcedureListForm
object pnlHeader: TPanel
Height = 38
Top = 26
Width = 952
Width = 638
Align = alTop
BevelOuter = bvNone
ClientHeight = 38
ClientWidth = 952
ClientWidth = 638
Color = clLime
ParentColor = False
TabOrder = 2
object pnlObjects: TPanel
Left = 256
Height = 38
Width = 696
Width = 382
Align = alClient
BevelOuter = bvNone
ClientHeight = 38
ClientWidth = 696
ClientWidth = 382
ParentColor = False
TabOrder = 0
object lblObjects: TLabel
AnchorSideTop.Control = cbObjects
AnchorSideTop.Side = asrCenter
Left = 8
Height = 14
Top = 11
Width = 38
Height = 17
Top = 10
Width = 68
Caption = '&Objects'
ParentColor = False
end
@ -159,10 +159,9 @@ object ProcedureListForm: TProcedureListForm
Left = 64
Height = 21
Top = 8
Width = 625
Width = 311
Anchors = [akTop, akLeft, akRight]
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
MaxLength = 0
OnChange = cbObjectsChange
Sorted = True
@ -203,9 +202,9 @@ object ProcedureListForm: TProcedureListForm
end
end
object LV: TListView
Height = 601
Height = 239
Top = 64
Width = 952
Width = 638
Align = alClient
Columns = <
item

View File

@ -1,16 +1,16 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TProcedureListForm','FORMDATA',[
'TPF0'#18'TProcedureListForm'#17'ProcedureListForm'#4'Left'#2','#6'Height'#3
+#176#2#3'Top'#2':'#5'Width'#3#184#3#18'HorzScrollBar.Page'#3#183#3#18'VertSc'
+'rollBar.Page'#3#175#2#13'ActiveControl'#7#9'cbObjects'#7'Caption'#6#17'Proc'
+'edure List - '#12'ClientHeight'#3#176#2#11'ClientWidth'#3#184#3#8'OnCreate'
+#7#10'FormCreate'#10'OnKeyPress'#7#12'FormKeyPress'#8'OnResize'#7#10'FormRes'
+'ize'#6'OnShow'#7#8'FormShow'#8'Position'#7#9'poDefault'#0#10'TStatusBar'#9
+'StatusBar'#6'Height'#2#23#3'Top'#3#153#2#5'Width'#3#184#3#6'Panels'#14#1#5
+'Width'#3#144#1#0#1#5'Width'#2'2'#0#0#11'SimplePanel'#8#0#0#8'TToolBar'#2'TB'
+#6'Height'#2#26#5'Width'#3#184#3#7'Caption'#6#2'TB'#4'Flat'#9#8'TabOrder'#2#1
+#0#11'TToolButton'#7'tbAbout'#4'Left'#3#136#0#4'Hint'#6#5'About'#3'Top'#2#2#7
'TPF0'#18'TProcedureListForm'#17'ProcedureListForm'#4'Left'#2']'#6'Height'#3
+'G'#1#3'Top'#3#186#0#5'Width'#3'~'#2#18'HorzScrollBar.Page'#3'}'#2#18'VertSc'
+'rollBar.Page'#3'F'#1#13'ActiveControl'#7#9'cbObjects'#7'Caption'#6#17'Proce'
+'dure List - '#12'ClientHeight'#3'G'#1#11'ClientWidth'#3'~'#2#8'OnCreate'#7
+#10'FormCreate'#10'OnKeyPress'#7#12'FormKeyPress'#8'OnResize'#7#10'FormResiz'
+'e'#6'OnShow'#7#8'FormShow'#8'Position'#7#9'poDefault'#0#10'TStatusBar'#9'St'
+'atusBar'#6'Height'#2#24#3'Top'#3'/'#1#5'Width'#3'~'#2#6'Panels'#14#1#5'Widt'
+'h'#3#144#1#0#1#5'Width'#2'2'#0#0#11'SimplePanel'#8#0#0#8'TToolBar'#2'TB'#6
+'Height'#2#26#5'Width'#3'~'#2#7'Caption'#6#2'TB'#4'Flat'#9#8'TabOrder'#2#1#0
+#11'TToolButton'#7'tbAbout'#4'Left'#3#136#0#4'Hint'#6#5'About'#3'Top'#2#2#7
+'Caption'#6#7'tbAbout'#10'ImageIndex'#2#9#14'ParentShowHint'#8#8'ShowHint'#9
+#7'OnClick'#7#12'tbAboutClick'#0#0#11'TToolButton'#11'ToolButton2'#4'Left'#3
+#131#0#3'Top'#2#2#5'Width'#2#5#7'Caption'#6#11'ToolButton2'#5'Style'#7#10'tb'
@ -33,34 +33,34 @@ LazarusResources.Add('TProcedureListForm','FORMDATA',[
+'yle'#7#10'tbsDivider'#0#0#11'TToolButton'#6'tbCopy'#4'Left'#2#1#4'Hint'#6'!'
+'Copy method name to the clipboard'#3'Top'#2#2#7'Caption'#6#6'tbCopy'#10'Ima'
+'geIndex'#2#6#14'ParentShowHint'#8#8'ShowHint'#9#7'OnClick'#7#11'tbCopyClick'
+#0#0#0#6'TPanel'#9'pnlHeader'#6'Height'#2'&'#3'Top'#2#26#5'Width'#3#184#3#5
+'Align'#7#5'alTop'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'&'#11'Clien'
+'tWidth'#3#184#3#5'Color'#7#6'clLime'#11'ParentColor'#8#8'TabOrder'#2#2#0#6
+'TPanel'#10'pnlObjects'#4'Left'#3#0#1#6'Height'#2'&'#5'Width'#3#184#2#5'Alig'
+'n'#7#8'alClient'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'&'#11'Client'
+'Width'#3#184#2#11'ParentColor'#8#8'TabOrder'#2#0#0#6'TLabel'#10'lblObjects'
+#21'AnchorSideTop.Control'#7#9'cbObjects'#18'AnchorSideTop.Side'#7#9'asrCent'
+'er'#4'Left'#2#8#6'Height'#2#14#3'Top'#2#11#5'Width'#2'&'#7'Caption'#6#8'&Ob'
+'jects'#11'ParentColor'#8#0#0#9'TComboBox'#9'cbObjects'#4'Left'#2'@'#6'Heigh'
+'t'#2#21#3'Top'#2#8#5'Width'#3'q'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRig'
+'ht'#0#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAsce'
+'nding'#0#10'ItemHeight'#2#13#9'MaxLength'#2#0#8'OnChange'#7#15'cbObjectsCha'
+'nge'#6'Sorted'#9#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#0#6'TPan'
+'el'#9'pnlSearch'#6'Height'#2'&'#5'Width'#3#0#1#5'Align'#7#6'alLeft'#10'Beve'
+'lOuter'#7#6'bvNone'#12'ClientHeight'#2'&'#11'ClientWidth'#3#0#1#11'ParentCo'
+'lor'#8#8'TabOrder'#2#1#0#6'TLabel'#9'lblSearch'#21'AnchorSideTop.Control'#7
+#9'edMethods'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#11#6'Height'#2
+#17#3'Top'#2#11#5'Width'#2'?'#7'Caption'#6#7'&Search'#11'ParentColor'#8#0#0#5
+'TEdit'#9'edMethods'#4'Left'#2'D'#6'Height'#2#23#3'Top'#2#8#5'Width'#3#180#0
+#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'OnChange'#7#15'edMethodsCha'
+'nge'#9'OnKeyDown'#7#16'edMethodsKeyDown'#10'OnKeyPress'#7#17'edMethodsKeyPr'
+'ess'#8'TabOrder'#2#0#0#0#0#0#9'TListView'#2'LV'#6'Height'#3'Y'#2#3'Top'#2'@'
+#5'Width'#3#184#3#5'Align'#7#8'alClient'#7'Columns'#14#1#0#1#7'Caption'#6#9
+'Procedure'#5'Width'#3','#1#0#1#7'Caption'#6#4'Type'#0#1#7'Caption'#6#4'Line'
+#0#0#13'HideSelection'#8#13'Items.LazData'#10'L'#0#0#0'L'#0#0#0#1#0#0#0#0#0#0
+#0#255#255#255#255#255#255#255#255#3#0#0#0#0#0#0#0#14#0#0#0'TForm.TestFour'#8
+#0#0#0'Function'#2#0#0#0'24'#255#255#255#255#255#255#255#255#255#255#255#255
+#8'ReadOnly'#9#9'RowSelect'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0
+#9'ViewStyle'#7#8'vsReport'#10'OnDblClick'#7#10'LVDblClick'#10'OnKeyPress'#7
+#17'edMethodsKeyPress'#12'OnSelectItem'#7#12'LVSelectItem'#0#0#0
+#0#0#0#6'TPanel'#9'pnlHeader'#6'Height'#2'&'#3'Top'#2#26#5'Width'#3'~'#2#5'A'
+'lign'#7#5'alTop'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'&'#11'Client'
+'Width'#3'~'#2#5'Color'#7#6'clLime'#11'ParentColor'#8#8'TabOrder'#2#2#0#6'TP'
+'anel'#10'pnlObjects'#4'Left'#3#0#1#6'Height'#2'&'#5'Width'#3'~'#1#5'Align'#7
+#8'alClient'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'&'#11'ClientWidth'
+#3'~'#1#11'ParentColor'#8#8'TabOrder'#2#0#0#6'TLabel'#10'lblObjects'#21'Anch'
+'orSideTop.Control'#7#9'cbObjects'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'L'
+'eft'#2#8#6'Height'#2#17#3'Top'#2#10#5'Width'#2'D'#7'Caption'#6#8'&Objects'
+#11'ParentColor'#8#0#0#9'TComboBox'#9'cbObjects'#4'Left'#2'@'#6'Height'#2#21
+#3'Top'#2#8#5'Width'#3'7'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#16
+'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#9
+'MaxLength'#2#0#8'OnChange'#7#15'cbObjectsChange'#6'Sorted'#9#5'Style'#7#14
+'csDropDownList'#8'TabOrder'#2#0#0#0#0#6'TPanel'#9'pnlSearch'#6'Height'#2'&'
+#5'Width'#3#0#1#5'Align'#7#6'alLeft'#10'BevelOuter'#7#6'bvNone'#12'ClientHei'
+'ght'#2'&'#11'ClientWidth'#3#0#1#11'ParentColor'#8#8'TabOrder'#2#1#0#6'TLabe'
+'l'#9'lblSearch'#21'AnchorSideTop.Control'#7#9'edMethods'#18'AnchorSideTop.S'
+'ide'#7#9'asrCenter'#4'Left'#2#11#6'Height'#2#17#3'Top'#2#11#5'Width'#2'?'#7
+'Caption'#6#7'&Search'#11'ParentColor'#8#0#0#5'TEdit'#9'edMethods'#4'Left'#2
+'D'#6'Height'#2#23#3'Top'#2#8#5'Width'#3#180#0#7'Anchors'#11#5'akTop'#6'akLe'
+'ft'#7'akRight'#0#8'OnChange'#7#15'edMethodsChange'#9'OnKeyDown'#7#16'edMeth'
+'odsKeyDown'#10'OnKeyPress'#7#17'edMethodsKeyPress'#8'TabOrder'#2#0#0#0#0#0#9
+'TListView'#2'LV'#6'Height'#3#239#0#3'Top'#2'@'#5'Width'#3'~'#2#5'Align'#7#8
+'alClient'#7'Columns'#14#1#0#1#7'Caption'#6#9'Procedure'#5'Width'#3','#1#0#1
+#7'Caption'#6#4'Type'#0#1#7'Caption'#6#4'Line'#0#0#13'HideSelection'#8#13'It'
+'ems.LazData'#10'L'#0#0#0'L'#0#0#0#1#0#0#0#0#0#0#0#255#255#255#255#255#255
+#255#255#3#0#0#0#0#0#0#0#14#0#0#0'TForm.TestFour'#8#0#0#0'Function'#2#0#0#0
+'24'#255#255#255#255#255#255#255#255#255#255#255#255#8'ReadOnly'#9#9'RowSele'
+'ct'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#9'ViewStyle'#7#8'vsRe'
+'port'#10'OnDblClick'#7#10'LVDblClick'#10'OnKeyPress'#7#17'edMethodsKeyPress'
+#12'OnSelectItem'#7#12'LVSelectItem'#0#0#0
]);

View File

@ -115,6 +115,7 @@ const
ecInsertCVSSource = ecFirstLazarus + 93;
ecInsertModifiedLGPLNotice= ecFirstLazarus + 94;
ecInsertTodo = ecFirstLazarus + 95;
ecInsertGUID = ecFirstLazarus + 96;
// source tools
ecWordCompletion = ecFirstLazarus + 100;