mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 15:36:03 +02:00
MG: added keymapping to designer
git-svn-id: trunk@3305 -
This commit is contained in:
parent
109aaa2ab7
commit
93a2f932e9
@ -39,7 +39,8 @@ uses
|
|||||||
MemCheck,
|
MemCheck,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, AbstractFormeditor, Controls, PropEdits, TypInfo, ObjectInspector,
|
Classes, AbstractFormeditor, Controls, PropEdits, TypInfo, ObjectInspector,
|
||||||
Forms, IDEComp, JITForms, Compreg, ComponentEditors, Dialogs;
|
Forms, IDEComp, JITForms, Compreg, ComponentEditors, KeyMapping,
|
||||||
|
EditorOptions, Dialogs;
|
||||||
|
|
||||||
Const OrdinalTypes = [tkInteger,tkChar,tkENumeration,tkbool];
|
Const OrdinalTypes = [tkInteger,tkChar,tkENumeration,tkbool];
|
||||||
|
|
||||||
@ -142,13 +143,15 @@ TCustomFormEditor
|
|||||||
OwnerComponent: TComponent): string;
|
OwnerComponent: TComponent): string;
|
||||||
// Function CreateComponent(CI : TIComponentInterface; TypeName : String;
|
// Function CreateComponent(CI : TIComponentInterface; TypeName : String;
|
||||||
Function CreateComponentInterface(AComponent: TComponent): TIComponentInterface;
|
Function CreateComponentInterface(AComponent: TComponent): TIComponentInterface;
|
||||||
|
|
||||||
Function CreateComponent(ParentCI : TIComponentInterface;
|
Function CreateComponent(ParentCI : TIComponentInterface;
|
||||||
TypeClass : TComponentClass; X,Y,W,H : Integer): TIComponentInterface; override;
|
TypeClass : TComponentClass; X,Y,W,H : Integer): TIComponentInterface; override;
|
||||||
Function CreateFormFromStream(BinStream: TStream): TIComponentInterface; override;
|
Function CreateFormFromStream(BinStream: TStream): TIComponentInterface; override;
|
||||||
Procedure SetFormNameAndClass(CI: TIComponentInterface;
|
Procedure SetFormNameAndClass(CI: TIComponentInterface;
|
||||||
const NewFormName, NewClassName: shortstring);
|
const NewFormName, NewClassName: shortstring);
|
||||||
Procedure ClearSelected;
|
Procedure ClearSelected;
|
||||||
|
|
||||||
|
function TranslateKeyToDesignerCommand(Key: word; Shift: TShiftState): integer;
|
||||||
|
|
||||||
property SelectedComponents: TComponentSelectionList
|
property SelectedComponents: TComponentSelectionList
|
||||||
read FSelectedComponents write SetSelectedComponents;
|
read FSelectedComponents write SetSelectedComponents;
|
||||||
property Obj_Inspector : TObjectInspector
|
property Obj_Inspector : TObjectInspector
|
||||||
@ -159,6 +162,7 @@ TCustomFormEditor
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils;
|
SysUtils;
|
||||||
|
|
||||||
@ -897,6 +901,12 @@ Begin
|
|||||||
FSelectedComponents.Clear;
|
FSelectedComponents.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomFormEditor.TranslateKeyToDesignerCommand(Key: word;
|
||||||
|
Shift: TShiftState): integer;
|
||||||
|
begin
|
||||||
|
Result:=EditorOpts.KeyMap.TranslateKey(Key,Shift,[caDesigner]);
|
||||||
|
end;
|
||||||
|
|
||||||
Function TCustomFormEditor.CreateComponentInterface(
|
Function TCustomFormEditor.CreateComponentInterface(
|
||||||
AComponent: TComponent): TIComponentInterface;
|
AComponent: TComponent): TIComponentInterface;
|
||||||
Begin
|
Begin
|
||||||
|
@ -1677,7 +1677,7 @@ begin
|
|||||||
ASynEdit.MaxUndo:=fUndoLimit;
|
ASynEdit.MaxUndo:=fUndoLimit;
|
||||||
GetSynEditSelectedColor(ASynEdit);
|
GetSynEditSelectedColor(ASynEdit);
|
||||||
|
|
||||||
KeyMap.AssignTo(ASynEdit.KeyStrokes);
|
KeyMap.AssignTo(ASynEdit.KeyStrokes,[caSourceEditor]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorOptions.SetSynEditSettings(ASynEdit:TSynEdit);
|
procedure TEditorOptions.SetSynEditSettings(ASynEdit:TSynEdit);
|
||||||
@ -1753,7 +1753,7 @@ begin
|
|||||||
ASynEdit.ExtraLineSpacing:=fExtraLineSpacing;
|
ASynEdit.ExtraLineSpacing:=fExtraLineSpacing;
|
||||||
ASynEdit.ReadOnly:=true;
|
ASynEdit.ReadOnly:=true;
|
||||||
|
|
||||||
KeyMap.AssignTo(ASynEdit.KeyStrokes);
|
KeyMap.AssignTo(ASynEdit.KeyStrokes,[caSourceEditor]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1910,7 +1910,7 @@ begin
|
|||||||
if EditorOpts.UseSyntaxHighlight then
|
if EditorOpts.UseSyntaxHighlight then
|
||||||
Highlighter:=PreviewSyn;
|
Highlighter:=PreviewSyn;
|
||||||
EditorOpts.GetSynEditSettings(PreviewEdits[a]);
|
EditorOpts.GetSynEditSettings(PreviewEdits[a]);
|
||||||
EditorOpts.KeyMap.AssignTo(PreviewEdits[a].KeyStrokes);
|
EditorOpts.KeyMap.AssignTo(PreviewEdits[a].KeyStrokes,[caSourceEditor]);
|
||||||
if a<>3 then begin
|
if a<>3 then begin
|
||||||
Lines.Text:=EditorOpts.HighlighterList[CurLanguageID].SampleSource;
|
Lines.Text:=EditorOpts.HighlighterList[CurLanguageID].SampleSource;
|
||||||
PreviewEdits[a].Options:=PreviewEdits[a].Options
|
PreviewEdits[a].Options:=PreviewEdits[a].Options
|
||||||
@ -2530,7 +2530,7 @@ begin
|
|||||||
ANode.Text:=KeyMappingRelationToString(ARelation);
|
ANode.Text:=KeyMappingRelationToString(ARelation);
|
||||||
for i:=Low(PreviewEdits) to High(PreviewEdits) do
|
for i:=Low(PreviewEdits) to High(PreviewEdits) do
|
||||||
if PreviewEdits[i]<>nil then
|
if PreviewEdits[i]<>nil then
|
||||||
EditorOpts.KeyMap.AssignTo(PreviewEdits[i].KeyStrokes);
|
EditorOpts.KeyMap.AssignTo(PreviewEdits[i].KeyStrokes,[caSourceEditor]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user