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/';
var
HelpBoss: TBaseHelpManager;
HelpBoss: TBaseHelpManager = nil;
implementation

View File

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

View File

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

View File

@ -986,12 +986,12 @@ begin
if (ListOfPascalHelpContextList=nil)
or (ListOfPascalHelpContextList.Count=0) then exit;
// 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
// check every pascal context
for j:=0 to ListOfPascalHelpContextList.Count-1 do begin
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)
and (PascalContext.List[0].Descriptor=pihcFilename) then begin
// search file item
@ -1000,10 +1000,10 @@ begin
if not (SearchItem is THelpDBISourceFile) then continue;
FileItem:=THelpDBISourceFile(SearchItem);
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
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;

View File

@ -161,6 +161,7 @@ type
function CheckPackageGraphForCompilation(APackage: TLazPackage;
FirstDependency: TPkgDependency;
const Directory: string): TModalResult;
function MacroFunctionPkgPath(Data: Pointer): boolean;
function MacroFunctionPkgSrcPath(Data: Pointer): boolean;
function MacroFunctionPkgUnitPath(Data: Pointer): boolean;
function MacroFunctionPkgIncPath(Data: Pointer): boolean;
@ -1457,6 +1458,29 @@ begin
Result:=mrOk;
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;
var
FuncData: PReadFunctionData;
@ -1787,6 +1811,8 @@ begin
PackageEditors.OnCreateMakefile:=@OnPackageEditorCreateMakefile;
// package macros
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
'PKGPATH',nil,@MacroFunctionPkgPath);
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
'PKGSRCPATH',nil,@MacroFunctionPkgSrcPath);
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(