OI: made cut/copy/paste/delete descriptions more clear and paste components does not delete components

git-svn-id: trunk@9921 -
This commit is contained in:
mattias 2006-09-17 22:25:05 +00:00
parent 436f4fbaef
commit 33c9b2e647
5 changed files with 40 additions and 13 deletions

View File

@ -146,7 +146,7 @@ const
lihLCLURL = lihBaseUrl+'lcl/'; lihLCLURL = lihBaseUrl+'lcl/';
var var
HelpBoss: TBaseHelpManager; HelpBoss: TBaseHelpManager = nil;
implementation implementation

View File

@ -3108,16 +3108,16 @@ begin
@OnFindDeclarationPopupmenuItemClick,false,true,false); @OnFindDeclarationPopupmenuItemClick,false,true,false);
AddSeparatorMenuItem(nil,'OptionsSeparatorMenuItem',true); AddSeparatorMenuItem(nil,'OptionsSeparatorMenuItem',true);
AddPopupMenuItem(CutPopupMenuItem,nil,'CutPopupMenuItem', AddPopupMenuItem(CutPopupMenuItem,nil,'CutPopupMenuItem',
oisCut,'Cut selected item', oisCutComponents,'Cut selected item',
@OnCutPopupmenuItemClick,false,true,true); @OnCutPopupmenuItemClick,false,true,true);
AddPopupMenuItem(CopyPopupMenuItem,nil,'CopyPopupMenuItem', AddPopupMenuItem(CopyPopupMenuItem,nil,'CopyPopupMenuItem',
oisCopy,'Copy selected item', oisCopyComponents,'Copy selected item',
@OnCopyPopupmenuItemClick,false,true,true); @OnCopyPopupmenuItemClick,false,true,true);
AddPopupMenuItem(PastePopupMenuItem,nil,'PastePopupMenuItem', AddPopupMenuItem(PastePopupMenuItem,nil,'PastePopupMenuItem',
oisPaste,'Paste selected item', oisPasteComponents,'Paste selected item',
@OnPastePopupmenuItemClick,false,true,true); @OnPastePopupmenuItemClick,false,true,true);
AddPopupMenuItem(DeletePopupMenuItem,nil,'DeletePopupMenuItem', AddPopupMenuItem(DeletePopupMenuItem,nil,'DeletePopupMenuItem',
oisDelete,'Delete selected item', oisDeleteComponents,'Delete selected item',
@OnDeletePopupmenuItemClick,false,true,true); @OnDeletePopupmenuItemClick,false,true,true);
AddPopupMenuItem(OptionsSeparatorMenuItem2,nil,'', AddPopupMenuItem(OptionsSeparatorMenuItem2,nil,'',
'-','',nil,false,true,true); '-','',nil,false,true,true);
@ -3563,7 +3563,7 @@ begin
if Selection.Count > 0 then begin if Selection.Count > 0 then begin
ADesigner:=FindRootDesigner(TComponent(Selection[0])); ADesigner:=FindRootDesigner(TComponent(Selection[0]));
if ADesigner is TComponentEditorDesigner then begin if ADesigner is TComponentEditorDesigner then begin
TComponentEditorDesigner(ADesigner).PasteSelection([cpsfReplace]); TComponentEditorDesigner(ADesigner).PasteSelection([]);
end; end;
end; end;
end; end;

View File

@ -52,9 +52,10 @@ resourcestring
oisRemoveFromFavorites = 'Remove from Favorites'; oisRemoveFromFavorites = 'Remove from Favorites';
oisUndo = 'Undo'; oisUndo = 'Undo';
oisFinddeclaration = 'Jump to declaration'; oisFinddeclaration = 'Jump to declaration';
oisCut = 'Cut'; oisCutComponents = 'Cut components';
oisCopy = 'Copy'; oisCopyComponents = 'Copy components';
oisPaste = 'Paste'; oisPasteComponents = 'Paste components';
oisDeleteComponents = 'Delete components';
oisDelete = 'Delete'; oisDelete = 'Delete';
rscdMoveUp = 'Move up'; rscdMoveUp = 'Move up';
rscdMoveDown = 'Move down'; rscdMoveDown = 'Move down';

View File

@ -986,12 +986,12 @@ begin
if (ListOfPascalHelpContextList=nil) if (ListOfPascalHelpContextList=nil)
or (ListOfPascalHelpContextList.Count=0) then exit; or (ListOfPascalHelpContextList.Count=0) then exit;
// add the registered nodes // add the registered nodes
//debugln('THelpDatabase.GetNodesForPascalContexts A ListOfPascalHelpContextList.Count=',dbgs(ListOfPascalHelpContextList.Count)); debugln('THelpDatabase.GetNodesForPascalContexts A ListOfPascalHelpContextList.Count=',dbgs(ListOfPascalHelpContextList.Count));
if FSearchItems<>nil then begin if FSearchItems<>nil then begin
// check every pascal context // check every pascal context
for j:=0 to ListOfPascalHelpContextList.Count-1 do begin for j:=0 to ListOfPascalHelpContextList.Count-1 do begin
PascalContext:=TPascalHelpContextList(ListOfPascalHelpContextList[j]); PascalContext:=TPascalHelpContextList(ListOfPascalHelpContextList[j]);
//debugln('THelpDatabase.GetNodesForPascalContexts A PascalContext.Count=',dbgs(PascalContext.Count)); debugln('THelpDatabase.GetNodesForPascalContexts A PascalContext.Count=',dbgs(PascalContext.Count));
if (PascalContext.Count>0) if (PascalContext.Count>0)
and (PascalContext.List[0].Descriptor=pihcFilename) then begin and (PascalContext.List[0].Descriptor=pihcFilename) then begin
// search file item // search file item
@ -1000,10 +1000,10 @@ begin
if not (SearchItem is THelpDBISourceFile) then continue; if not (SearchItem is THelpDBISourceFile) then continue;
FileItem:=THelpDBISourceFile(SearchItem); FileItem:=THelpDBISourceFile(SearchItem);
Filename:=PascalContext.List[0].Context; Filename:=PascalContext.List[0].Context;
//debugln('THelpDatabase.GetNodesForPascalContexts B FileItem.ClassName=',FileItem.ClassName,' Filename=',Filename); debugln('THelpDatabase.GetNodesForPascalContexts B FileItem.ClassName=',FileItem.ClassName,' Filename=',Filename,' FileItem.GetFullFilename="',FileItem.GetFullFilename,'"');
if (FileItem.FileMatches(Filename)) then begin if (FileItem.FileMatches(Filename)) then begin
CreateNodeQueryListAndAdd(FileItem.Node,PascalContext,ListOfNodes,true); CreateNodeQueryListAndAdd(FileItem.Node,PascalContext,ListOfNodes,true);
//debugln('THelpDatabase.GetNodesForPascalContexts C FileItem.ClassName=',FileItem.ClassName,' Filename=',Filename,' ',dbgs(ListOfNodes.Count),' ',TempNode.Title,' ',dbgs(TempNode)); debugln('THelpDatabase.GetNodesForPascalContexts C FileItem.ClassName=',FileItem.ClassName,' Filename=',Filename,' ',dbgs(ListOfNodes.Count));
end; end;
end; end;
end; end;

View File

@ -161,6 +161,7 @@ type
function CheckPackageGraphForCompilation(APackage: TLazPackage; function CheckPackageGraphForCompilation(APackage: TLazPackage;
FirstDependency: TPkgDependency; FirstDependency: TPkgDependency;
const Directory: string): TModalResult; const Directory: string): TModalResult;
function MacroFunctionPkgPath(Data: Pointer): boolean;
function MacroFunctionPkgSrcPath(Data: Pointer): boolean; function MacroFunctionPkgSrcPath(Data: Pointer): boolean;
function MacroFunctionPkgUnitPath(Data: Pointer): boolean; function MacroFunctionPkgUnitPath(Data: Pointer): boolean;
function MacroFunctionPkgIncPath(Data: Pointer): boolean; function MacroFunctionPkgIncPath(Data: Pointer): boolean;
@ -1457,6 +1458,29 @@ begin
Result:=mrOk; Result:=mrOk;
end; end;
function TPkgManager.MacroFunctionPkgPath(Data: Pointer): boolean;
var
FuncData: PReadFunctionData;
PkgID: TLazPackageID;
APackage: TLazPackage;
begin
FuncData:=PReadFunctionData(Data);
PkgID:=TLazPackageID.Create;
Result:=false;
if PkgID.StringToID(FuncData^.Param) then begin
APackage:=PackageGraph.FindPackageWithID(PkgID);
if APackage<>nil then begin
FuncData^.Result:=APackage.Directory;
Result:=true;
end else begin
DebugLn('WARNING: TPkgManager.MacroFunctionPkgPath unknown package id: ',FuncData^.Param);
end;
end else begin
DebugLn('WARNING: TPkgManager.MacroFunctionPkgPath invalid package id: ',FuncData^.Param);
end;
PkgID.Free;
end;
function TPkgManager.MacroFunctionPkgSrcPath(Data: Pointer): boolean; function TPkgManager.MacroFunctionPkgSrcPath(Data: Pointer): boolean;
var var
FuncData: PReadFunctionData; FuncData: PReadFunctionData;
@ -1787,6 +1811,8 @@ begin
PackageEditors.OnCreateMakefile:=@OnPackageEditorCreateMakefile; PackageEditors.OnCreateMakefile:=@OnPackageEditorCreateMakefile;
// package macros // package macros
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
'PKGPATH',nil,@MacroFunctionPkgPath);
CodeToolBoss.DefineTree.MacroFunctions.AddExtended( CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
'PKGSRCPATH',nil,@MacroFunctionPkgSrcPath); 'PKGSRCPATH',nil,@MacroFunctionPkgSrcPath);
CodeToolBoss.DefineTree.MacroFunctions.AddExtended( CodeToolBoss.DefineTree.MacroFunctions.AddExtended(