fixed result on searching proc in interface

git-svn-id: trunk@4325 -
This commit is contained in:
mattias 2003-06-26 17:00:00 +00:00
parent 7dd5932806
commit 05b82e5d51
5 changed files with 314 additions and 271 deletions

View File

@ -27,13 +27,13 @@
ToDo:
- ignore errors behind cursor (implemented, not tested)
- high level expression comparison
- find declaration in dead code
- high type expression evaluation
(i.e. at the moment: integer+integer=longint
wanted: integer+integer=integer)
- caching for procs
- variants
- 'class of'
- find declaration in dead code
- multi pass find declaration
- Get and Set property access parameter lists
- make @Proc context sensitive (started, but not complete)
@ -69,6 +69,7 @@ interface
{ $DEFINE ShowBaseTypeCache}
{ $DEFINE ShowCacheDependencies}
{ $DEFINE ShowCollect}
{ $DEFINE ShowProcSearch}
{$IFDEF CTDEBUG}{$DEFINE DebugPrefix}{$ENDIF}
{$IFDEF ShowTriedIdentifiers}{$DEFINE DebugPrefix}{$ENDIF}
@ -1733,7 +1734,7 @@ var
' File="',ExtractFilename(MainFilename)+'"',
' Flags=[',FindDeclarationFlagsAsString(Params.Flags),']',
' NewResult=',NewResult,
' CallOnIdentifierFound=',CallOnIdentifierFound
' CallOnIdentifierFound=',CallOnIdentifierFound,
);
end;
{$ENDIF}
@ -1767,6 +1768,10 @@ var
Params.SetResult(Params.FoundProc^.Context.Tool,
Params.FoundProc^.Context.Node);
FindIdentifierInContext:=true;
{$IFDEF ShowProcSearch}
writeln('[TFindDeclarationTool.FindIdentifierInContext] PROC Search ended with only one proc:');
Params.WriteDebugReport;
{$ENDIF}
exit;
end;
if not (fdfExceptionOnNotFound in Params.Flags) then exit;
@ -1968,10 +1973,13 @@ var
or (ContextNode.HasAsParent(StartContextNode))) then
begin
// search next in parent
ContextNode:=ContextNode.Parent;
{$IFDEF ShowTriedParentContexts}
writeln('[TFindDeclarationTool.FindIdentifierInContext] Searching in Parent ContextNode=',ContextNode.DescAsString);
writeln('[TFindDeclarationTool.FindIdentifierInContext] Searching in Parent ',
' old ContextNode=',ContextNode.DescAsString,
' new ContextNode=',ContextNode.Parent.DescAsString
);
{$ENDIF}
ContextNode:=ContextNode.Parent;
case ContextNode.Desc of
ctnTypeSection, ctnVarSection, ctnConstSection, ctnResStrSection,
@ -3267,8 +3275,7 @@ begin
FInterfaceIdentifierCache.Add(OldInput.Identifier,Params.NewNode,
Params.NewCleanPos);
end else begin
// do not save proc identifiers or collect results
Result:=false;
// do not save proc identifiers or collection results
end;
end else begin
// identifier does not exist in this interface
@ -4760,9 +4767,15 @@ begin
// The search must go on, and the most compatible proc is returned.
if not Params.IdentifierTool.IsPCharInSrc(Params.Identifier) then begin
// Params.Identifier is not in the source of this tool
// Params.Identifier is not in the source of the start tool
// => impossible to check param list, because the context is unknown
// -> identifier found
{$IFDEF ShowProcSearch}
writeln('[TFindDeclarationTool.CheckSrcIdentifier]',
' Indent=',GetIdentifier(Params.Identifier),
' NO SOURCE to check params'
);
{$ENDIF}
Result:=ifrSuccess;
exit;
end;
@ -4771,6 +4784,12 @@ begin
if (Params.FoundProc=nil) then begin
// this is the first proc found
// -> save it and proceed the search to find all overloadeded procs
{$IFDEF ShowFoundIdentifier}
writeln('[TFindDeclarationTool.CheckSrcIdentifier]',
' Indent=',GetIdentifier(Params.Identifier),
' FIRST PROC'
);
{$ENDIF}
Params.SetFirstFoundProc(FoundContext);
exit;
end;

View File

@ -377,7 +377,7 @@ end;
Params: none
Returns: The (popup)menu containing this item.
Description of the function for the class.
------------------------------------------------------------------------------}
function TMenuItem.GetParentMenu: TMenu;
var
@ -385,7 +385,7 @@ var
begin
Item := Self;
while Item.Parent <> nil do Item := Item.Parent;
Result := Item.FMenu
Result := Item.FMenu;
end;
{------------------------------------------------------------------------------
@ -955,6 +955,9 @@ end;
{ =============================================================================
$Log$
Revision 1.36 2003/06/26 17:00:00 mattias
fixed result on searching proc in interface
Revision 1.35 2003/06/24 15:57:55 mattias
applied win32 menu patch from Micha Nelissen
@ -1088,6 +1091,9 @@ end;
$Log$
Revision 1.36 2003/06/26 17:00:00 mattias
fixed result on searching proc in interface
Revision 1.35 2003/06/24 15:57:55 mattias
applied win32 menu patch from Micha Nelissen

View File

@ -20,6 +20,7 @@ constructor TToggleBox.Create(TheOwner : TComponent);
begin
inherited Create(TheOwner);
fCompStyle := csToggleBox;
SetInitialBounds(0,0,90,25);
end;
{------------------------------------------------------------------------------}

View File

@ -6161,6 +6161,7 @@ begin
gtk_combo_set_use_arrows(PgtkCombo(Handle),0);
end;
end;
csEdit :
with TCustomEdit(Sender) do
begin
@ -6177,26 +6178,37 @@ begin
csProgressBar :
with TProgressBar(Sender) do
begin
Widget := PGtkWidget( gtk_adjustment_new (0, Min, Max, 0, 0, 0));
gtk_progress_set_adjustment (GTK_PROGRESS (handle), PGtkAdjustment (Widget));
gtk_progress_set_value (GTK_PROGRESS (handle), Position);
if Smooth
then gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (handle), GTK_PROGRESS_CONTINUOUS)
else gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (handle), GTK_PROGRESS_DISCRETE);
then gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (handle),
GTK_PROGRESS_CONTINUOUS)
else gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (handle),
GTK_PROGRESS_DISCRETE);
case Orientation of
pbVertical : gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR (handle), GTK_PROGRESS_BOTTOM_TO_TOP);
pbRightToLeft : gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR (handle), GTK_PROGRESS_RIGHT_TO_LEFT);
pbTopDown : gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR (handle), GTK_PROGRESS_TOP_TO_BOTTOM);
pbVertical : gtk_progress_bar_set_orientation(
GTK_PROGRESS_BAR (handle),
GTK_PROGRESS_BOTTOM_TO_TOP);
pbRightToLeft: gtk_progress_bar_set_orientation(
GTK_PROGRESS_BAR (handle),
GTK_PROGRESS_RIGHT_TO_LEFT);
pbTopDown : gtk_progress_bar_set_orientation(
GTK_PROGRESS_BAR (handle),
GTK_PROGRESS_TOP_TO_BOTTOM);
else { pbHorizontal is default }
gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR (handle), GTK_PROGRESS_LEFT_TO_RIGHT);
gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR (Handle),
GTK_PROGRESS_LEFT_TO_RIGHT);
end;
if BarShowText then
begin
gtk_progress_set_format_string (GTK_PROGRESS (handle), '%v from [%l-%u] (=%p%%)');
gtk_progress_set_show_text (GTK_PROGRESS (handle), 1);
gtk_progress_set_format_string (GTK_PROGRESS (Handle),
'%v from [%l-%u] (=%p%%)');
gtk_progress_set_show_text (GTK_PROGRESS (Handle), 1);
end
else
gtk_progress_set_show_text (GTK_PROGRESS (handle), 0);
gtk_progress_set_show_text (GTK_PROGRESS (Handle), 0);
Widget := PGtkWidget( gtk_adjustment_new (0, Min, Max, 0, 0, 0));
gtk_progress_set_adjustment (GTK_PROGRESS (Handle), PGtkAdjustment (Widget));
writeln('SetProperties A ',Position);
gtk_progress_set_value (GTK_PROGRESS (Handle), Position);
end;
@ -7463,6 +7475,9 @@ end;
{ =============================================================================
$Log$
Revision 1.382 2003/06/26 17:00:00 mattias
fixed result on searching proc in interface
Revision 1.381 2002/08/19 15:15:24 mattias
implemented TPairSplitter

View File

@ -213,7 +213,6 @@ type
end;
{ TMenu }
TFindItemKind = (fkCommand, fkHandle, fkShortCut);
@ -383,6 +382,9 @@ end.
{
$Log$
Revision 1.49 2003/06/26 17:00:00 mattias
fixed result on searching proc in interface
Revision 1.48 2003/06/24 15:57:55 mattias
applied win32 menu patch from Micha Nelissen