mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 23:00:35 +02:00
MG: added selection keys and nil operand
git-svn-id: trunk@1466 -
This commit is contained in:
parent
f85924125e
commit
eb8ad3a7c7
@ -43,7 +43,7 @@ interface
|
||||
{ $DEFINE ShowSearchPaths}
|
||||
{ $DEFINE ShowTriedFiles}
|
||||
{ $DEFINE ShowTriedContexts}
|
||||
{ $DEFINE ShowExprEval}
|
||||
{$DEFINE ShowExprEval}
|
||||
{ $DEFINE ShowFoundIdentifier}
|
||||
{ $DEFINE ShowCachedIdentifiers}
|
||||
{ $DEFINE ShowNodeCache}
|
||||
@ -3007,6 +3007,10 @@ writeln('[TFindDeclarationTool.ReadOperandTypeAtCursor] A Atom=',GetAtom);
|
||||
Result:=FindExpressionTypeOfVariable(CurPos.StartPos,Params,EndPos);
|
||||
MoveCursorToCleanPos(EndPos);
|
||||
end
|
||||
else if UpAtomIs('NIL') then begin
|
||||
Result.Desc:=xtNil;
|
||||
ReadNextAtom;
|
||||
end
|
||||
else if AtomIsChar('(') then begin
|
||||
// read til bracket end and find the result of the inner expression
|
||||
// this algo is not very fast, but expressions are almost always small
|
||||
@ -3677,6 +3681,9 @@ writeln('[TFindDeclarationTool.IsCompatible] B ',
|
||||
and (ExpressionType.Desc in xtAllBooleanConvertibles))
|
||||
or ((TargetType.Desc in xtAllPointerTypes)
|
||||
and (ExpressionType.Desc in xtAllPointerConvertibles))
|
||||
or ((TargetType.Desc=xtContext)
|
||||
and (TargetType.Context.Node.Desc in [ctnClass,ctnProcedure])
|
||||
and (ExpressionType.Desc=xtNil))
|
||||
then
|
||||
Result:=tcCompatible
|
||||
else if (ExpressionType.Desc=xtContext) then begin
|
||||
|
@ -164,7 +164,7 @@ type
|
||||
TSynStateFlags = set of TSynStateFlag;
|
||||
|
||||
TSynEditorOption = (eoAltSetsColumnMode, eoAutoIndent,
|
||||
{$IFDEF SYN_LAZARUS}eoBracketHighlight,{$ENDIF}
|
||||
{$IFDEF SYN_LAZARUS}eoBracketHighlight, eoHideRightMargin,{$ENDIF}
|
||||
eoDragDropEditing, //mh 2000-11-20
|
||||
eoDropFiles, eoHalfPageScroll, eoKeepCaretX, eoNoCaret, eoNoSelection,
|
||||
eoScrollByOneLess, eoScrollPastEof, eoScrollPastEol, eoShowScrollHint,
|
||||
@ -2595,8 +2595,10 @@ var
|
||||
// calls to ExtTextOut.
|
||||
if bDoRightEdge then begin
|
||||
{$IFDEF SYN_LAZARUS}
|
||||
LCLLinux.MoveToEx(dc, nRightEdge, rcLine.Top, nil);
|
||||
LCLLinux.LineTo(dc, nRightEdge, rcLine.Bottom + 1);
|
||||
if (not (eoHideRightMargin in Options)) then begin
|
||||
LCLLinux.MoveToEx(dc, nRightEdge, rcLine.Top, nil);
|
||||
LCLLinux.LineTo(dc, nRightEdge, rcLine.Bottom + 1);
|
||||
end;
|
||||
{$ELSE}
|
||||
Windows.MoveToEx(dc, nRightEdge, rcLine.Top, nil);
|
||||
Windows.LineTo(dc, nRightEdge, rcLine.Bottom + 1);
|
||||
|
@ -98,7 +98,7 @@ begin
|
||||
inherited Create(AOwner);
|
||||
if LazarusResources.Find(ClassName)=nil then begin
|
||||
Width:=300;
|
||||
Height:=140;
|
||||
Height:=150;
|
||||
Position:=poScreenCenter;
|
||||
|
||||
TokenLabel:=TLabel.Create(Self);
|
||||
@ -129,7 +129,7 @@ begin
|
||||
Parent:=Self;
|
||||
Caption:='Comment:';
|
||||
Left:=12;
|
||||
Top:=TokenEdit.Top+TokenEdit.Height+23;
|
||||
Top:=TokenEdit.Top+TokenEdit.Height+10;
|
||||
Width:=Self.ClientWidth-Left-Left;
|
||||
Show;
|
||||
end;
|
||||
|
@ -168,7 +168,6 @@ type
|
||||
procedure SetupCodeCreationPage;
|
||||
procedure SetupLineSplittingPage;
|
||||
procedure SetupSpacePage;
|
||||
procedure SetupDefinesPage;
|
||||
procedure CreateAtomCheckBoxes(ParentGroupBox: TGroupBox;
|
||||
AtomTypes: TAtomTypes; Columns: integer);
|
||||
procedure SetAtomCheckBoxes(AtomTypes: TAtomTypes;
|
||||
@ -558,14 +557,12 @@ begin
|
||||
Pages.Add('Code Creation');
|
||||
Pages.Add('Line Splitting');
|
||||
Pages.Add('Space');
|
||||
Pages.Add('Defines');
|
||||
end;
|
||||
|
||||
SetupGeneralPage;
|
||||
SetupCodeCreationPage;
|
||||
SetupLineSplittingPage;
|
||||
SetupSpacePage;
|
||||
SetupDefinesPage;
|
||||
|
||||
NoteBook.Show;
|
||||
|
||||
@ -605,11 +602,6 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TCodeToolsOptsDlg.SetupDefinesPage;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TCodeToolsOptsDlg.SetupGeneralPage;
|
||||
begin
|
||||
SrcPathGroupBox:=TGroupBox.Create(Self);
|
||||
|
@ -151,7 +151,7 @@ type
|
||||
fHighlighterList: TEditOptLangList;
|
||||
|
||||
// Code tools options (MG: these will move to an unit of their own)
|
||||
fAutoCodeCompletion:boolean;
|
||||
fAutoIdentifierCompletion:boolean;
|
||||
fAutoCodeParameters:boolean;
|
||||
fAutoToolTipExprEval:boolean;
|
||||
fAutoToolTipSymbTools:boolean;
|
||||
@ -237,8 +237,8 @@ type
|
||||
read fHighlighterList write fHighlighterList;
|
||||
|
||||
// Code Tools options
|
||||
property AutoCodeCompletion:boolean
|
||||
read fAutoCodeCompletion write fAutoCodeCompletion default true;
|
||||
property AutoIdentifierCompletion:boolean
|
||||
read fAutoIdentifierCompletion write fAutoIdentifierCompletion default true;
|
||||
property AutoCodeParameters:boolean
|
||||
read fAutoCodeParameters write fAutoCodeParameters default true;
|
||||
property AutoToolTipExprEval:boolean
|
||||
@ -370,7 +370,7 @@ type
|
||||
|
||||
// Code Tools options
|
||||
AutomaticFeaturesGroupBox:TGroupBox;
|
||||
AutoCodeCompletionCheckBox:TCheckBox;
|
||||
AutoIdentifierCompletionCheckBox:TCheckBox;
|
||||
AutoCodeParametersCheckBox:TCheckBox;
|
||||
AutoToolTipExprEvalCheckBox:TCheckBox;
|
||||
AutoToolTipSymbToolsCheckBox:TCheckBox;
|
||||
@ -1105,8 +1105,8 @@ begin
|
||||
end;
|
||||
|
||||
// Code Tools options
|
||||
fAutoCodeCompletion:=
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/AutoCodeCompletion',true);
|
||||
fAutoIdentifierCompletion:=
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/AutoIdentifierCompletion',true);
|
||||
fAutoCodeParameters:=
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/AutoCodeParameters',true);
|
||||
fAutoToolTipExprEval:=
|
||||
@ -1216,8 +1216,8 @@ begin
|
||||
end;
|
||||
|
||||
// Code Tools options
|
||||
XMLConfig.SetValue('EditorOptions/CodeTools/AutoCodeCompletion'
|
||||
,fAutoCodeCompletion);
|
||||
XMLConfig.SetValue('EditorOptions/CodeTools/AutoIdentifierCompletion'
|
||||
,fAutoIdentifierCompletion);
|
||||
XMLConfig.SetValue('EditorOptions/CodeTools/AutoCodeParameters'
|
||||
,fAutoCodeParameters);
|
||||
XMLConfig.SetValue('EditorOptions/CodeTools/AutoToolTipExprEval'
|
||||
@ -2414,19 +2414,17 @@ var i:integer;
|
||||
ARelation: TKeyCommandRelation;
|
||||
ANode: TTreeNode;
|
||||
begin
|
||||
if Button=mbRight then begin
|
||||
ANode:=KeyMappingTreeView.GetNodeAt(X,Y);
|
||||
if (ANode<>nil) and (ANode.Data<>nil)
|
||||
and (TObject(ANode.Data) is TKeyCommandRelation) then begin
|
||||
ARelation:=TKeyCommandRelation(ANode.Data);
|
||||
i:=EditorOpts.KeyMap.IndexOf(ARelation);
|
||||
if (i>=0)
|
||||
and (ShowKeyMappingEditForm(i,EditorOpts.KeyMap)=mrOk) then begin
|
||||
ANode.Text:=KeyMappingRelationToString(ARelation);
|
||||
for i:=Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[i]<>nil then
|
||||
EditorOpts.KeyMap.AssignTo(PreviewEdits[i].KeyStrokes);
|
||||
end;
|
||||
ANode:=KeyMappingTreeView.GetNodeAt(X,Y);
|
||||
if (ANode<>nil) and (ANode.Data<>nil)
|
||||
and (TObject(ANode.Data) is TKeyCommandRelation) then begin
|
||||
ARelation:=TKeyCommandRelation(ANode.Data);
|
||||
i:=EditorOpts.KeyMap.IndexOf(ARelation);
|
||||
if (i>=0)
|
||||
and (ShowKeyMappingEditForm(i,EditorOpts.KeyMap)=mrOk) then begin
|
||||
ANode.Text:=KeyMappingRelationToString(ARelation);
|
||||
for i:=Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[i]<>nil then
|
||||
EditorOpts.KeyMap.AssignTo(PreviewEdits[i].KeyStrokes);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -4044,16 +4042,16 @@ begin
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
AutoCodeCompletionCheckBox:=TCheckBox.Create(Self);
|
||||
with AutoCodeCompletionCheckBox do begin
|
||||
Name:='AutoCodeCompletionCheckBox';
|
||||
AutoIdentifierCompletionCheckBox:=TCheckBox.Create(Self);
|
||||
with AutoIdentifierCompletionCheckBox do begin
|
||||
Name:='AutoIdentifierCompletionCheckBox';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=2;
|
||||
Left:=5;
|
||||
Width:=200;
|
||||
Height:=20;
|
||||
Caption:='Code completion';
|
||||
Checked:=EditorOpts.AutoCodeCompletion;
|
||||
Caption:='Identfier completion';
|
||||
Checked:=EditorOpts.AutoIdentifierCompletion;
|
||||
Enabled:=false;
|
||||
Visible:=true;
|
||||
end;
|
||||
@ -4062,10 +4060,11 @@ begin
|
||||
with AutoCodeParametersCheckBox do begin
|
||||
Name:='AutoCodeParametersCheckBox';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=AutoCodeCompletionCheckBox.Top+AutoCodeCompletionCheckBox.Height;
|
||||
Left:=AutoCodeCompletionCheckBox.Left;
|
||||
Width:=AutoCodeCompletionCheckBox.Width;
|
||||
Height:=AutoCodeCompletionCheckBox.Height;
|
||||
Top:=AutoIdentifierCompletionCheckBox.Top
|
||||
+AutoIdentifierCompletionCheckBox.Height;
|
||||
Left:=AutoIdentifierCompletionCheckBox.Left;
|
||||
Width:=AutoIdentifierCompletionCheckBox.Width;
|
||||
Height:=AutoIdentifierCompletionCheckBox.Height;
|
||||
Caption:='Code parameters';
|
||||
Checked:=EditorOpts.AutoCodeParameters;
|
||||
Enabled:=false;
|
||||
@ -4077,9 +4076,9 @@ begin
|
||||
Name:='AutoToolTipExprEvalCheckBox';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=AutoCodeParametersCheckBox.Top+AutoCodeParametersCheckBox.Height;
|
||||
Left:=AutoCodeCompletionCheckBox.Left;
|
||||
Width:=AutoCodeCompletionCheckBox.Width;
|
||||
Height:=AutoCodeCompletionCheckBox.Height;
|
||||
Left:=AutoIdentifierCompletionCheckBox.Left;
|
||||
Width:=AutoIdentifierCompletionCheckBox.Width;
|
||||
Height:=AutoIdentifierCompletionCheckBox.Height;
|
||||
Caption:='Tooltip expression evaluation';
|
||||
Checked:=EditorOpts.AutoToolTipExprEval;
|
||||
Enabled:=false;
|
||||
@ -4091,9 +4090,9 @@ begin
|
||||
Name:='AutoToolTipSymbToolsCheckBox';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=AutoToolTipExprEvalCheckBox.Top+AutoToolTipExprEvalCheckBox.Height;
|
||||
Left:=AutoCodeCompletionCheckBox.Left;
|
||||
Width:=AutoCodeCompletionCheckBox.Width;
|
||||
Height:=AutoCodeCompletionCheckBox.Height;
|
||||
Left:=AutoIdentifierCompletionCheckBox.Left;
|
||||
Width:=AutoIdentifierCompletionCheckBox.Width;
|
||||
Height:=AutoIdentifierCompletionCheckBox.Height;
|
||||
Caption:='Tooltip symbol Tools';
|
||||
Checked:=EditorOpts.AutoToolTipSymbTools;
|
||||
Visible:=true;
|
||||
@ -4104,7 +4103,8 @@ begin
|
||||
Name:='AutoDelayLabel';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=10;
|
||||
Left:=AutoCodeCompletionCheckBox.Left+AutoCodeCompletionCheckBox.Width+17;
|
||||
Left:=AutoIdentifierCompletionCheckBox.Left
|
||||
+AutoIdentifierCompletionCheckBox.Width+17;
|
||||
Width:=70;
|
||||
Caption:='Delay';
|
||||
Visible:=true;
|
||||
@ -4115,7 +4115,8 @@ begin
|
||||
Name:='AutoDelayTrackBar';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=32;
|
||||
Left:=AutoCodeCompletionCheckBox.Left+AutoCodeCompletionCheckBox.Width+15;
|
||||
Left:=AutoIdentifierCompletionCheckBox.Left
|
||||
+AutoIdentifierCompletionCheckBox.Width+15;
|
||||
Width:=150;
|
||||
Min:=2;
|
||||
Max:=6;
|
||||
@ -4130,7 +4131,8 @@ begin
|
||||
Name:='AutoDelayMinLabel';
|
||||
Parent:=AutomaticFeaturesGroupBox;
|
||||
Top:=AutoDelayTrackBar.Top+AutoDelayTrackBar.Height+5;
|
||||
Left:=AutoCodeCompletionCheckBox.Left+AutoCodeCompletionCheckBox.Width+15;
|
||||
Left:=AutoIdentifierCompletionCheckBox.Left
|
||||
+AutoIdentifierCompletionCheckBox.Width+15;
|
||||
Width:=70;
|
||||
Caption:='0.5 sec';
|
||||
Visible:=true;
|
||||
@ -4385,7 +4387,7 @@ begin
|
||||
SaveAllHighlighters;
|
||||
|
||||
// code Tools
|
||||
EditorOpts.AutoCodeCompletion:=AutoCodeCompletionCheckBox.Checked;
|
||||
EditorOpts.AutoIdentifierCompletion:=AutoIdentifierCompletionCheckBox.Checked;
|
||||
EditorOpts.AutoCodeParameters:=AutoCodeParametersCheckBox.Checked;
|
||||
EditorOpts.AutoToolTipSymbTools:=AutoToolTipSymbToolsCheckBox.Checked;
|
||||
EditorOpts.AutoToolTipExprEval:=AutoToolTipExprEvalCheckBox.Checked;
|
||||
|
@ -1031,7 +1031,12 @@ begin
|
||||
fExtToolCount:=0;
|
||||
|
||||
// create default keymapping
|
||||
|
||||
|
||||
// selection
|
||||
C:=Categories[AddCategory('CursorMoving','Cursor moving commands')];
|
||||
Add(C,'Move cursor to absolute beginning',ecEditorTop,VK_HOME,[ssCtrl],VK_UNKNOWN,[]);
|
||||
Add(C,'Move cursor to absolute end',ecEditorBottom,VK_END,[ssCtrl],VK_UNKNOWN,[]);
|
||||
|
||||
// selection
|
||||
C:=Categories[AddCategory('Selection','Text selection commands')];
|
||||
Add(C,'Select All',ecSelectAll,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
@ -1041,6 +1046,14 @@ begin
|
||||
Add(C,'Normal selection mode',ecNormalSelect,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
Add(C,'Column selection mode',ecColumnSelect,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
Add(C,'Line selection mode',ecLineSelect,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
Add(C,'Select word left',ecSelWordLeft,VK_LEFT,[ssCtrl,ssShift],VK_UNKNOWN,[]);
|
||||
Add(C,'Select word right',ecSelWordRight,VK_RIGHT,[ssCtrl,ssShift],VK_UNKNOWN,[]);
|
||||
Add(C,'Select line start',ecSelLineStart,VK_HOME,[ssShift],VK_UNKNOWN,[]);
|
||||
Add(C,'Select line end',ecSelLineEnd,VK_END,[ssShift],VK_UNKNOWN,[]);
|
||||
Add(C,'Select page top',ecSelPageTop,VK_PRIOR, [ssShift,ssCtrl],VK_UNKNOWN,[]);
|
||||
Add(C,'Select page bottom',ecSelPageBottom,VK_NEXT, [ssShift,ssCtrl],VK_UNKNOWN,[]);
|
||||
Add(C,'Select to absolute beginning',ecSelEditorTop,VK_HOME, [ssShift,ssCtrl],VK_UNKNOWN,[]);
|
||||
Add(C,'Select to absolute end',ecSelEditorBottom,VK_END, [ssShift,ssCtrl],VK_UNKNOWN,[]);
|
||||
|
||||
// simple tools
|
||||
C:=Categories[AddCategory('SimpleTools','Simple tools commands')];
|
||||
|
@ -42,7 +42,7 @@ uses
|
||||
Debugger, DBGOutputForm, GDBDebugger, RunParamsOpts, ExtToolDialog,
|
||||
MacroPromptDlg, LMessages, ProjectDefs, Watchesdlg, BreakPointsdlg, ColumnDlg,
|
||||
OutputFilter, BuildLazDialog, MiscOptions, EditDefineTree, CodeToolsOptions,
|
||||
TypInfo, IDEOptionDefs;
|
||||
TypInfo, IDEOptionDefs{, CodeToolsDefines};
|
||||
|
||||
const
|
||||
Version_String = '0.8.2 alpha';
|
||||
@ -6212,6 +6212,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.237 2002/03/01 15:51:06 lazarus
|
||||
MG: added selection keys and nil operand
|
||||
|
||||
Revision 1.236 2002/02/28 12:09:07 lazarus
|
||||
MG: fixes, code creation policies, keymap categories, menu shortcuts
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user