mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 02:29:26 +02:00
IDE: undid handling copy, cut, paste of objectinspector
git-svn-id: trunk@24855 -
This commit is contained in:
parent
504da5187d
commit
a92d69cb0d
@ -48,7 +48,7 @@ uses
|
||||
LazarusIDEStrConsts, EnvironmentOpts, IDECommands, ComponentReg,
|
||||
NonControlDesigner, FrameDesigner, AlignCompsDlg, SizeCompsDlg, ScaleCompsDlg,
|
||||
TabOrderDlg, DesignerProcs, CustomFormEditor, AskCompNameDlg,
|
||||
ControlSelection, ChangeClassDialog, EditorOptions, SynEditKeyCmds;
|
||||
ControlSelection, ChangeClassDialog, EditorOptions;
|
||||
|
||||
type
|
||||
TDesigner = class;
|
||||
@ -197,8 +197,6 @@ type
|
||||
procedure DoOrderMoveSelectionToBack;
|
||||
procedure DoOrderForwardSelectionOne;
|
||||
procedure DoOrderBackSelectionOne;
|
||||
procedure DoUndo;
|
||||
procedure DoRedo;
|
||||
|
||||
procedure GiveComponentsNames;
|
||||
procedure NotifyPersistentAdded(APersistent: TPersistent);
|
||||
@ -262,7 +260,6 @@ type
|
||||
MenuIndex: integer): boolean; override;
|
||||
procedure DoProcessCommand(Sender: TObject; var Command: word;
|
||||
var Handled: boolean);
|
||||
function DoCommand(Command: word): boolean;
|
||||
|
||||
function NonVisualComponentLeftTop(AComponent: TComponent): TPoint;
|
||||
function NonVisualComponentAtPos(X, Y: integer): TComponent;
|
||||
@ -510,7 +507,8 @@ begin
|
||||
'Custom dynamic section');
|
||||
|
||||
// register align section
|
||||
DesignerMenuSectionAlign:=RegisterIDEMenuSection(DesignerMenuRoot, 'Align section');
|
||||
DesignerMenuSectionAlign:=RegisterIDEMenuSection(DesignerMenuRoot,
|
||||
'Align section');
|
||||
DesignerMenuAlign:=RegisterIDEMenuCommand(DesignerMenuSectionAlign,
|
||||
'Align',fdmAlignWord, nil, nil, nil, 'align');
|
||||
DesignerMenuMirrorHorizontal:=RegisterIDEMenuCommand(DesignerMenuSectionAlign,
|
||||
@ -523,7 +521,8 @@ begin
|
||||
'Size',fdmSizeWord, nil, nil, nil, 'size');
|
||||
|
||||
// register tab and z-order section
|
||||
DesignerMenuSectionOrder:=RegisterIDEMenuSection(DesignerMenuRoot, 'Order section');
|
||||
DesignerMenuSectionOrder:=RegisterIDEMenuSection(DesignerMenuRoot,
|
||||
'Order section');
|
||||
DesignerMenuTabOrder:=RegisterIDEMenuCommand(DesignerMenuSectionOrder,
|
||||
'Tab order',fdmTabOrder);
|
||||
DesignerMenuSectionZOrder:=RegisterIDESubMenu(DesignerMenuSectionOrder,
|
||||
@ -538,7 +537,8 @@ begin
|
||||
'Move z order backwards one',fdmOrderBackOne, nil, nil, nil, 'Order_back_one');
|
||||
|
||||
// register clipboard section
|
||||
DesignerMenuSectionClipboard:=RegisterIDEMenuSection(DesignerMenuRoot, 'Clipboard section');
|
||||
DesignerMenuSectionClipboard:=RegisterIDEMenuSection(DesignerMenuRoot,
|
||||
'Clipboard section');
|
||||
DesignerMenuCut:=RegisterIDEMenuCommand(DesignerMenuSectionClipboard,
|
||||
'Cut',lisMenuCut, nil, nil, nil, 'laz_cut');
|
||||
DesignerMenuCopy:=RegisterIDEMenuCommand(DesignerMenuSectionClipboard,
|
||||
@ -551,7 +551,8 @@ begin
|
||||
'Select All',fdmSelectAll, nil, nil, nil, 'menu_select_all');
|
||||
|
||||
// register miscellaneous section
|
||||
DesignerMenuSectionMisc:=RegisterIDEMenuSection(DesignerMenuRoot, 'Miscellaneous section');
|
||||
DesignerMenuSectionMisc:=RegisterIDEMenuSection(DesignerMenuRoot,
|
||||
'Miscellaneous section');
|
||||
DesignerMenuChangeClass:=RegisterIDEMenuCommand(DesignerMenuSectionMisc,
|
||||
'Change class',lisChangeClass);
|
||||
DesignerMenuChangeParent:=RegisterIDEMenuSection(DesignerMenuSectionMisc,
|
||||
@ -566,7 +567,8 @@ begin
|
||||
'Center form', lisCenterForm);
|
||||
|
||||
// register options section
|
||||
DesignerMenuSectionOptions:=RegisterIDEMenuSection(DesignerMenuRoot, 'Options section');
|
||||
DesignerMenuSectionOptions:=RegisterIDEMenuSection(DesignerMenuRoot,
|
||||
'Options section');
|
||||
DesignerMenuSnapToGridOption:=RegisterIDEMenuCommand(DesignerMenuSectionOptions,
|
||||
'Snap to grid',fdmSnapToGridOption);
|
||||
DesignerMenuSnapToGuideLinesOption:=RegisterIDEMenuCommand(DesignerMenuSectionOptions,
|
||||
@ -1320,16 +1322,6 @@ begin
|
||||
Modified;
|
||||
end;
|
||||
|
||||
procedure TDesigner.DoUndo;
|
||||
begin
|
||||
; // ToDo: Implement Undo
|
||||
end;
|
||||
|
||||
procedure TDesigner.DoRedo;
|
||||
begin
|
||||
; // ToDo: Implement Redo
|
||||
end;
|
||||
|
||||
procedure TDesigner.GiveComponentsNames;
|
||||
var
|
||||
i: Integer;
|
||||
@ -1419,32 +1411,28 @@ end;
|
||||
procedure TDesigner.DoProcessCommand(Sender: TObject; var Command: word;
|
||||
var Handled: boolean);
|
||||
begin
|
||||
if Assigned(OnProcessCommand) and (Command <> ecNone) then
|
||||
begin
|
||||
if Assigned(OnProcessCommand) and (Command <> ecNone)
|
||||
then begin
|
||||
OnProcessCommand(Self,Command,Handled);
|
||||
Handled := Handled or (Command = ecNone);
|
||||
end;
|
||||
if not Handled then
|
||||
Handled := DoCommand(Command);
|
||||
end;
|
||||
|
||||
function TDesigner.DoCommand(Command: word): boolean;
|
||||
begin
|
||||
if Handled then Exit;
|
||||
|
||||
case Command of
|
||||
ecDesignerSelectParent : SelectParentOfSelection;
|
||||
ecUndo : DoUndo;
|
||||
ecRedo : DoRedo;
|
||||
ecCopy : CopySelection;
|
||||
ecCut : CutSelection;
|
||||
ecPaste : PasteSelection([cpsfFindUniquePositions]);
|
||||
ecDesignerCopy : CopySelection;
|
||||
ecDesignerCut : CutSelection;
|
||||
ecDesignerPaste : PasteSelection([cpsfFindUniquePositions]);
|
||||
ecDesignerMoveToFront : DoOrderMoveSelectionToFront;
|
||||
ecDesignerMoveToBack : DoOrderMoveSelectionToBack;
|
||||
ecDesignerForwardOne : DoOrderForwardSelectionOne;
|
||||
ecDesignerBackOne : DoOrderBackSelectionOne;
|
||||
else
|
||||
Exit(False);
|
||||
Exit;
|
||||
end;
|
||||
Result := True;
|
||||
|
||||
Handled := True;
|
||||
end;
|
||||
|
||||
function TDesigner.NonVisualComponentLeftTop(AComponent: TComponent): TPoint;
|
||||
@ -1689,7 +1677,9 @@ begin
|
||||
Result := True;
|
||||
Sender.Dispatch(TheMessage);
|
||||
if ControlSelection.SelectionForm = Form then
|
||||
begin
|
||||
ControlSelection.CheckForLCLChanges(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDesigner.MoveControl(Sender: TControl; TheMessage: TLMMove): Boolean;
|
||||
@ -1982,6 +1972,7 @@ var
|
||||
// modified
|
||||
Modified;
|
||||
|
||||
|
||||
// set initial properties
|
||||
if NewComponent is TControl then begin
|
||||
TControl(NewComponent).Visible:=true;
|
||||
@ -2368,7 +2359,8 @@ begin
|
||||
if Mediator<>nil then
|
||||
Mediator.KeyDown(Sender,TheMessage.CharCode,Shift);
|
||||
|
||||
Command := FTheFormEditor.TranslateKeyToDesignerCommand(TheMessage.CharCode, Shift);
|
||||
Command := FTheFormEditor.TranslateKeyToDesignerCommand(
|
||||
TheMessage.CharCode, Shift);
|
||||
//DebugLn(['TDesigner.KEYDOWN Command=',dbgs(Command),' ',TheMessage.CharCode,' ',dbgs(Shift)]);
|
||||
DoProcessCommand(Self, Command, Handled);
|
||||
//DebugLn(['TDesigner.KeyDown Command=',Command,' Handled=',Handled,' TheMessage.CharCode=',TheMessage.CharCode]);
|
||||
@ -2452,7 +2444,8 @@ begin
|
||||
if (ControlSelection.LookupRootSelected) then begin
|
||||
if ControlSelection.Count>1 then
|
||||
MessageDlg(lisInvalidDelete,
|
||||
lisTheRootComponentCanNotBeDeleted, mtInformation, [mbOk],0);
|
||||
lisTheRootComponentCanNotBeDeleted, mtInformation,
|
||||
[mbOk],0);
|
||||
exit;
|
||||
end;
|
||||
// check if a selected component is inherited (can not be deleted)
|
||||
@ -2513,7 +2506,8 @@ begin
|
||||
Form.Invalidate;
|
||||
end;
|
||||
|
||||
procedure TDesigner.DoDeletePersistent(APersistent: TPersistent; FreeIt: boolean);
|
||||
procedure TDesigner.DoDeletePersistent(APersistent: TPersistent;
|
||||
FreeIt: boolean);
|
||||
var
|
||||
Hook: TPropertyEditorHook;
|
||||
begin
|
||||
@ -2543,7 +2537,8 @@ begin
|
||||
// delete component
|
||||
if APersistent is TComponent then
|
||||
TheFormEditor.DeleteComponent(TComponent(APersistent),FreeIt)
|
||||
else if FreeIt then
|
||||
else
|
||||
if FreeIt then
|
||||
APersistent.Free;
|
||||
// unmark component
|
||||
DeletingPersistent.Remove(APersistent);
|
||||
|
@ -596,6 +596,9 @@ begin
|
||||
ecReportingBug: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
|
||||
// designer
|
||||
ecDesignerCopy : SetResult(VK_C,[ssCtrl],VK_Insert,[ssCtrl]);
|
||||
ecDesignerCut : SetResult(VK_X,[ssCtrl],VK_Delete,[ssShift]);
|
||||
ecDesignerPaste : SetResult(VK_V,[ssCtrl],VK_Insert,[ssShift]);
|
||||
ecDesignerSelectParent: SetResult(VK_ESCAPE,[],VK_UNKNOWN,[]);
|
||||
ecDesignerMoveToFront : SetResult(VK_PRIOR,[ssShift],VK_UNKNOWN,[]);
|
||||
ecDesignerMoveToBack : SetResult(VK_NEXT,[ssShift],VK_UNKNOWN,[]);
|
||||
@ -693,7 +696,7 @@ begin
|
||||
|
||||
case Command of
|
||||
// moving
|
||||
ecWordLeft: SetResult(VK_A, [ssCtrl], VK_UNKNOWN, [], VK_LEFT, [ssCtrl], VK_UNKNOWN,[]);
|
||||
ecWordLeft:SetResult(VK_A, [ssCtrl], VK_UNKNOWN, [], VK_LEFT, [ssCtrl], VK_UNKNOWN,[]);
|
||||
ecWordRight: SetResult(VK_D, [ssCtrl], VK_UNKNOWN, [], VK_RIGHT, [ssCtrl],VK_UNKNOWN,[]);
|
||||
ecLineStart: SetResult(VK_Q, [ssCtrl], VK_S, [], VK_HOME, [],VK_UNKNOWN,[]);
|
||||
ecLineEnd: SetResult(VK_Q, [ssCtrl], VK_D, [], VK_END, [],VK_UNKNOWN,[]);
|
||||
@ -1030,6 +1033,9 @@ begin
|
||||
ecReportingBug: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
|
||||
// designer
|
||||
ecDesignerCopy : SetResult(VK_C,[ssCtrl],VK_UNKNOWN,[],VK_Insert,[ssCtrl],VK_UNKNOWN,[]);
|
||||
ecDesignerCut : SetResult(VK_X,[ssCtrl],VK_UNKNOWN,[],VK_Delete,[ssShift],VK_UNKNOWN,[]);
|
||||
ecDesignerPaste : SetResult(VK_V,[ssCtrl],VK_UNKNOWN,[],VK_Insert,[ssShift],VK_UNKNOWN,[]);
|
||||
ecDesignerSelectParent: SetResult(VK_ESCAPE,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
ecDesignerMoveToFront : SetResult(VK_PRIOR,[ssShift],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
ecDesignerMoveToBack : SetResult(VK_NEXT,[ssShift],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
@ -1646,6 +1652,9 @@ begin
|
||||
ecReportingBug: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
|
||||
// designer
|
||||
ecDesignerCopy : SetResult(VK_C,[ssMeta],VK_UNKNOWN,[]);
|
||||
ecDesignerCut : SetResult(VK_X,[ssMeta],VK_UNKNOWN,[]);
|
||||
ecDesignerPaste : SetResult(VK_V,[ssMeta],VK_UNKNOWN,[]);
|
||||
ecDesignerSelectParent: SetResult(VK_ESCAPE,[],VK_UNKNOWN,[]);
|
||||
ecDesignerMoveToFront : SetResult(VK_PRIOR,[ssShift],VK_UNKNOWN,[]);
|
||||
ecDesignerMoveToBack : SetResult(VK_NEXT,[ssShift],VK_UNKNOWN,[]);
|
||||
@ -2177,6 +2186,9 @@ begin
|
||||
ecReportingBug : Result:= lisMenuReportingBug;
|
||||
|
||||
// desginer
|
||||
ecDesignerCopy : Result:= lisDsgCopyComponents;
|
||||
ecDesignerCut : Result:= lisDsgCutComponents;
|
||||
ecDesignerPaste : Result:= lisDsgPasteComponents;
|
||||
ecDesignerSelectParent : Result:= lisDsgSelectParentComponent;
|
||||
ecDesignerMoveToFront : Result:= lisDsgOrderMoveToFront;
|
||||
ecDesignerMoveToBack : Result:= lisDsgOrderMoveToBack;
|
||||
@ -2394,7 +2406,8 @@ begin
|
||||
AddDefault(C, 'Move cursor left one page', srkmecPageLeft, ecPageLeft);
|
||||
AddDefault(C, 'Move cursor right one page', srkmecPageRight, ecPageRight);
|
||||
AddDefault(C, 'Move cursor to top of page', srkmecPageTop, ecPageTop);
|
||||
AddDefault(C, 'Move cursor to bottom of page', srkmecPageBottom, ecPageBottom);
|
||||
AddDefault(C, 'Move cursor to bottom of page', srkmecPageBottom, ecPageBottom
|
||||
);
|
||||
AddDefault(C, 'Move cursor to absolute beginning', srkmecEditorTop,
|
||||
ecEditorTop);
|
||||
AddDefault(C, 'Move cursor to absolute end', srkmecEditorBottom,
|
||||
@ -2407,6 +2420,9 @@ begin
|
||||
// selection
|
||||
C:=Categories[AddCategory('Selection',srkmCatSelection,
|
||||
IDECmdScopeSrcEditOnly)];
|
||||
AddDefault(C, 'Copy selection to clipboard', srkmecCopy, ecCopy);
|
||||
AddDefault(C, 'Cut selection to clipboard', srkmecCut, ecCut);
|
||||
AddDefault(C, 'Paste clipboard to current position', srkmecPaste, ecPaste);
|
||||
AddDefault(C, 'Normal selection mode', srkmecNormalSelect, ecNormalSelect);
|
||||
AddDefault(C, 'Column selection mode', srkmecColumnSelect, ecColumnSelect);
|
||||
AddDefault(C, 'Line selection mode', srkmecLineSelect, ecLineSelect);
|
||||
@ -2419,10 +2435,12 @@ begin
|
||||
AddDefault(C, 'Convert tabs to spaces in selection',
|
||||
srkmecSelectionTabs2Spaces, ecSelectionTabs2Spaces);
|
||||
AddDefault(C, 'Enclose selection', lisKMEncloseSelection, ecSelectionEnclose);
|
||||
AddDefault(C, 'Comment selection', lisMenuCommentSelection, ecSelectionComment);
|
||||
AddDefault(C, 'Comment selection', lisMenuCommentSelection, ecSelectionComment
|
||||
);
|
||||
AddDefault(C, 'Uncomment selection', lisMenuUncommentSelection,
|
||||
ecSelectionUncomment);
|
||||
AddDefault(C, 'Toggle comment', lisMenuToggleComment, ecToggleComment);
|
||||
AddDefault(C, 'Toggle comment', lisMenuToggleComment, ecToggleComment
|
||||
);
|
||||
AddDefault(C, 'Sort selection', lisSortSelSortSelection, ecSelectionSort);
|
||||
AddDefault(C, 'Break Lines in selection', lisMenuBeakLinesInSelection,
|
||||
ecSelectionBreakLines);
|
||||
@ -2493,21 +2511,25 @@ begin
|
||||
AddDefault(C, 'Insert from Character Map', lisMenuInsertCharacter,
|
||||
ecInsertCharacter);
|
||||
AddDefault(C, 'Insert GPL notice', srkmecInsertGPLNotice, ecInsertGPLNotice);
|
||||
AddDefault(C, 'Insert LGPL notice', srkmecInsertLGPLNotice, ecInsertLGPLNotice);
|
||||
AddDefault(C, 'Insert LGPL notice', srkmecInsertLGPLNotice, ecInsertLGPLNotice
|
||||
);
|
||||
AddDefault(C, 'Insert modified LGPL notice', srkmecInsertModifiedLGPLNotice,
|
||||
ecInsertModifiedLGPLNotice);
|
||||
AddDefault(C, 'Insert username', lisKMInsertUsername, ecInsertUserName);
|
||||
AddDefault(C, 'Insert date and time', lisKMInsertDateAndTime, ecInsertDateTime);
|
||||
AddDefault(C, 'Insert date and time', lisKMInsertDateAndTime, ecInsertDateTime
|
||||
);
|
||||
AddDefault(C, 'Insert ChangeLog entry', srkmecInsertChangeLogEntry,
|
||||
ecInsertChangeLogEntry);
|
||||
AddDefault(C, 'Insert CVS keyword Author', srkmecInsertCVSAuthor,
|
||||
ecInsertCVSAuthor);
|
||||
AddDefault(C, 'Insert CVS keyword Date', srkmecInsertCVSDate, ecInsertCVSDate);
|
||||
AddDefault(C, 'Insert CVS keyword Date', srkmecInsertCVSDate, ecInsertCVSDate
|
||||
);
|
||||
AddDefault(C, 'Insert CVS keyword Header', srkmecInsertCVSHeader,
|
||||
ecInsertCVSHeader);
|
||||
AddDefault(C, 'Insert CVS keyword ID', srkmecInsertCVSID, ecInsertCVSID);
|
||||
AddDefault(C, 'Insert CVS keyword Log', srkmecInsertCVSLog, ecInsertCVSLog);
|
||||
AddDefault(C, 'Insert CVS keyword Name', srkmecInsertCVSName, ecInsertCVSName);
|
||||
AddDefault(C, 'Insert CVS keyword Name', srkmecInsertCVSName, ecInsertCVSName
|
||||
);
|
||||
AddDefault(C, 'Insert CVS keyword Revision', srkmecInsertCVSRevision,
|
||||
ecInsertCVSRevision); ;
|
||||
AddDefault(C, 'Insert CVS keyword Source', srkmecInsertCVSSource,
|
||||
@ -2519,9 +2541,6 @@ begin
|
||||
C:=Categories[AddCategory('CommandCommands',srkmCatCmdCmd,nil)];
|
||||
AddDefault(C, 'Undo', lisMenuUndo, ecUndo);
|
||||
AddDefault(C, 'Redo', lisMenuRedo, ecRedo);
|
||||
AddDefault(C, 'Copy selection to clipboard', srkmecCopy, ecCopy);
|
||||
AddDefault(C, 'Cut selection to clipboard', srkmecCut, ecCut);
|
||||
AddDefault(C, 'Paste clipboard to current position', srkmecPaste, ecPaste);
|
||||
|
||||
// search & replace
|
||||
C:=Categories[AddCategory('SearchReplace',srkmCatSearchReplace,
|
||||
@ -2542,7 +2561,8 @@ begin
|
||||
AddDefault(C, 'Jump forward', lisMenuJumpForward, ecJumpForward);
|
||||
AddDefault(C, 'Add jump point', srkmecAddJumpPoint, ecAddJumpPoint);
|
||||
AddDefault(C, 'View jump history', lisKMViewJumpHistory, ecViewJumpHistory);
|
||||
AddDefault(C, 'Jump to next error', lisMenuJumpToNextError, ecJumpToNextError);
|
||||
AddDefault(C, 'Jump to next error', lisMenuJumpToNextError, ecJumpToNextError
|
||||
);
|
||||
AddDefault(C, 'Jump to previous error', lisMenuJumpToPrevError,
|
||||
ecJumpToPrevError);
|
||||
AddDefault(C, 'Open file at cursor', srkmecOpenFileAtCursor,
|
||||
@ -2635,7 +2655,8 @@ begin
|
||||
ecRemoveEmptyMethods);
|
||||
AddDefault(C, 'Remove unused units', srkmecRemoveUnusedUnits,
|
||||
ecRemoveUnusedUnits);
|
||||
AddDefault(C, 'Find overloads', srkmecFindOverloads, ecFindOverloads);
|
||||
AddDefault(C, 'Find overloads', srkmecFindOverloads,
|
||||
ecFindOverloads);
|
||||
|
||||
// Template editing
|
||||
C:=Categories[AddCategory('Edit Template', srkmCatTemplateEdit, IDECmdScopeSrcEditOnlyTmplEdit)];
|
||||
@ -2703,7 +2724,8 @@ begin
|
||||
AddDefault(C, 'Go to next editor', srkmecNextEditor, ecNextEditor);
|
||||
AddDefault(C, 'Go to prior editor', srkmecPrevEditor, ecPrevEditor);
|
||||
AddDefault(C, 'Add break point', srkmecToggleBreakPoint, ecToggleBreakPoint);
|
||||
AddDefault(C, 'Remove break point', srkmecRemoveBreakPoint, ecRemoveBreakPoint);
|
||||
AddDefault(C, 'Remove break point', srkmecRemoveBreakPoint, ecRemoveBreakPoint
|
||||
);
|
||||
AddDefault(C, 'Move editor left', srkmecMoveEditorLeft, ecMoveEditorLeft);
|
||||
AddDefault(C, 'Move editor right', srkmecMoveEditorRight, ecMoveEditorRight);
|
||||
AddDefault(C, 'Move editor leftmost', srkmecMoveEditorLeftmost, ecMoveEditorLeftmost);
|
||||
@ -2801,7 +2823,8 @@ begin
|
||||
AddDefault(C, 'Save project', lisKMSaveProject, ecSaveProject);
|
||||
AddDefault(C, 'Save project as', lisKMSaveProjectAs, ecSaveProjectAs);
|
||||
AddDefault(C, 'Publish project', lisKMPublishProject, ecPublishProject);
|
||||
AddDefault(C, 'Project Inspector', lisMenuProjectInspector, ecProjectInspector);
|
||||
AddDefault(C, 'Project Inspector', lisMenuProjectInspector, ecProjectInspector
|
||||
);
|
||||
AddDefault(C, 'Add active unit to project', lisKMAddActiveUnitToProject,
|
||||
ecAddCurUnitToProj);
|
||||
AddDefault(C, 'Remove active unit from project',
|
||||
@ -2896,6 +2919,12 @@ begin
|
||||
|
||||
// designer - without menu items in the IDE bar (at least not directly)
|
||||
C:=Categories[AddCategory('Designer',lisKeyCatDesigner,IDECmdScopeDesignerOnly)];
|
||||
AddDefault(C, 'Copy selected Components to clipboard',
|
||||
lisKMCopySelectedComponentsToClipboard, ecDesignerCopy);
|
||||
AddDefault(C, 'Cut selected Components to clipboard',
|
||||
lisKMCutSelectedComponentsToClipboard, ecDesignerCut);
|
||||
AddDefault(C, 'Paste Components from clipboard',
|
||||
lisKMPasteComponentsFromClipboard, ecDesignerPaste);
|
||||
AddDefault(C, 'Select parent component', lisDsgSelectParentComponent,
|
||||
ecDesignerSelectParent);
|
||||
AddDefault(C, 'Move component to front', lisDsgOrderMoveToFront,
|
||||
@ -2904,8 +2933,8 @@ begin
|
||||
ecDesignerMoveToBack);
|
||||
AddDefault(C, 'Move component one forward', lisDsgOrderForwardOne,
|
||||
ecDesignerForwardOne);
|
||||
AddDefault(C, 'Move component one back', lisDsgOrderBackOne,
|
||||
ecDesignerBackOne);
|
||||
AddDefault(C, 'Move component one back', lisDsgOrderBackOne, ecDesignerBackOne
|
||||
);
|
||||
|
||||
// object inspector - without menu items in the IDE bar (at least no direct)
|
||||
C:=Categories[AddCategory('Object Inspector',lisKeyCatObjInspector,
|
||||
|
18
ide/main.pp
18
ide/main.pp
@ -16613,27 +16613,27 @@ end;
|
||||
|
||||
procedure TMainIDE.mnuEditCopyClicked(Sender: TObject);
|
||||
begin
|
||||
DoCommand(ecCopy);
|
||||
DoSourceEditorCommand(ecCopy);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuEditCutClicked(Sender: TObject);
|
||||
begin
|
||||
DoCommand(ecCut);
|
||||
DoSourceEditorCommand(ecCut);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuEditPasteClicked(Sender: TObject);
|
||||
begin
|
||||
DoCommand(ecPaste);
|
||||
DoSourceEditorCommand(ecPaste);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuEditRedoClicked(Sender: TObject);
|
||||
begin
|
||||
DoCommand(ecRedo);
|
||||
DoSourceEditorCommand(ecRedo);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuEditUndoClicked(Sender: TObject);
|
||||
begin
|
||||
DoCommand(ecUndo);
|
||||
DoSourceEditorCommand(ecUndo);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuEditIndentBlockClicked(Sender: TObject);
|
||||
@ -16837,6 +16837,7 @@ var
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
AForm: TCustomForm;
|
||||
begin
|
||||
// todo: if focus is really on a designer or the source editor
|
||||
GetCurrentUnit(ActiveSourceEditor,ActiveUnitInfo);
|
||||
case FDisplayState of
|
||||
dsSource: // send command to source editor
|
||||
@ -16848,8 +16849,8 @@ begin
|
||||
GetUnitWithForm(FLastFormActivated, ActiveSourceEditor, ActiveUnitInfo);
|
||||
if Assigned(ActiveUnitInfo) then begin
|
||||
AForm:=GetDesignerFormOfSource(ActiveUnitInfo,False);
|
||||
if (AForm<>nil) and (AForm.Designer<>nil) then
|
||||
TDesigner(AForm.Designer).DoCommand(ACommand);
|
||||
|
||||
// ToDo: call designer
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -16865,7 +16866,8 @@ begin
|
||||
CurFocusControl:=GetParentForm(CurFocusControl);
|
||||
if (CurFocusControl<>MainIDEBar) and not(CurFocusControl is TSourceNotebook) then
|
||||
begin
|
||||
// MainIDEBar.mnuMainMenu.ShortcutHandled := false; // Shortcut not handled yet
|
||||
// continue processing shortcut, not handled yet
|
||||
MainIDEBar.mnuMainMenu.ShortcutHandled := false;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
@ -149,7 +149,7 @@ type
|
||||
out ActiveSourceEditor: TSourceEditorInterface;
|
||||
out ActiveUnitInfo: TUnitInfo); virtual; abstract;
|
||||
|
||||
procedure DoCommand(ACommand: integer); virtual; abstract;
|
||||
procedure DoCommand(EditorCommand: integer); virtual; abstract;
|
||||
|
||||
procedure GetIDEFileState(Sender: TObject; const AFilename: string;
|
||||
NeededFlags: TIDEFileStateFlags;
|
||||
|
@ -298,6 +298,9 @@ const
|
||||
ecReportingBug = ecFirstLazarus + 905;
|
||||
|
||||
// designer
|
||||
ecDesignerCopy = ecFirstLazarus + 1000;
|
||||
ecDesignerCut = ecFirstLazarus + 1001;
|
||||
ecDesignerPaste = ecFirstLazarus + 1002;
|
||||
ecDesignerSelectParent = ecFirstLazarus + 1003;
|
||||
ecDesignerMoveToFront = ecFirstLazarus + 1004;
|
||||
ecDesignerMoveToBack = ecFirstLazarus + 1005;
|
||||
|
Loading…
Reference in New Issue
Block a user