mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 00:16:15 +02:00
MG: fixed completion box for templates and identifiers
git-svn-id: trunk@1453 -
This commit is contained in:
parent
2295af44f4
commit
63e0c71c47
@ -239,6 +239,10 @@ begin
|
||||
if not fParsed then
|
||||
ParseCompletionList;
|
||||
Len := Length(AToken);
|
||||
{$IFDEF SYN_LAZARUS}
|
||||
if (Len=0) and Assigned(fOnTokenNotFound) then
|
||||
fOnTokenNotFound(Self,AToken,AEditor,i);
|
||||
{$ENDIF}
|
||||
if (Len > 0) and (AEditor <> nil) and not AEditor.ReadOnly
|
||||
and (fCompletions.Count > 0)
|
||||
then begin
|
||||
|
@ -6085,7 +6085,7 @@ begin
|
||||
if FCodeLastActivated then begin
|
||||
// send command to source editor
|
||||
if ActiveSourceEditor=nil then exit;
|
||||
ActiveSourceEditor.DoEditorBasicAction(EditorCommand);
|
||||
ActiveSourceEditor.DoEditorExecuteCommand(EditorCommand);
|
||||
end else begin
|
||||
// send command to form editor
|
||||
if ActiveUnitInfo=nil then exit;
|
||||
@ -6107,6 +6107,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.229 2002/02/22 14:25:00 lazarus
|
||||
MG: fixed completion box for templates and identifiers
|
||||
|
||||
Revision 1.228 2002/02/22 14:05:55 lazarus
|
||||
MG: edit menu reconnected to source editor
|
||||
|
||||
|
@ -194,7 +194,7 @@ type
|
||||
procedure GetDialogPosition(Width, Height:integer; var Left,Top:integer);
|
||||
|
||||
// editor commands
|
||||
procedure DoEditorBasicAction(EditorCommand: integer);
|
||||
procedure DoEditorExecuteCommand(EditorCommand: integer);
|
||||
|
||||
//used to get the word at the mouse cursor
|
||||
Function GetWordAtPosition(Position : TPoint) : String;
|
||||
@ -1494,7 +1494,7 @@ begin
|
||||
FVisible:=Value;
|
||||
end;
|
||||
|
||||
procedure TSourceEditor.DoEditorBasicAction(EditorCommand: integer);
|
||||
procedure TSourceEditor.DoEditorExecuteCommand(EditorCommand: integer);
|
||||
begin
|
||||
EditorComponent.ExecuteCommand(EditorCommand,' ',nil);
|
||||
end;
|
||||
@ -1752,6 +1752,7 @@ procedure TSourceNotebook.OnCodeTemplateTokenNotFound(Sender: TObject;
|
||||
AToken: string; AnEditor: TCustomSynEdit; var Index:integer);
|
||||
var P:TPoint;
|
||||
begin
|
||||
writeln('RRRRRRRRRRR ',AToken,',',AnEditor.ReadOnly,',',CurrentCompletionType=ctNone);
|
||||
if (AnEditor.ReadOnly=false) and (CurrentCompletionType=ctNone) then begin
|
||||
CurrentCompletionType:=ctTemplateCompletion;
|
||||
with AnEditor do
|
||||
@ -1901,7 +1902,9 @@ Begin
|
||||
while (X2>0) and (CurLine[X2] in ['A'..'Z','a'..'z','0'..'9','_']) do dec(X2);
|
||||
CompName:=copy(CurLine,X2+1,X1-X2-1);
|
||||
CompInt := TComponentInterface(FormEditor1.FindComponentByName(CompName));
|
||||
if CompInt = nil then Exit;
|
||||
if CompInt = nil then begin
|
||||
ccSelection:='';
|
||||
end else begin
|
||||
//get all methods
|
||||
NewStr := '';
|
||||
for I := 0 to CompInt.GetPropCount-1 do
|
||||
@ -1994,6 +1997,7 @@ Begin
|
||||
NewStr := '';
|
||||
end; // end for
|
||||
end;
|
||||
end;
|
||||
|
||||
ctWordCompletion:
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user