cody: find overloads: adjust columns, double click autosize column, nicer distances, resourcestrings

git-svn-id: trunk@50004 -
This commit is contained in:
mattias 2015-10-08 17:23:39 +00:00
parent 580b22f36e
commit 4639bc83bf
12 changed files with 53 additions and 10 deletions

View File

@ -162,7 +162,7 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
TabOrder = 0 TabOrder = 0
OnColRowExchanged = ResultsStringGridColRowExchanged OnColRowExchanged = ResultsStringGridColRowExchanged
OnCompareCells = ResultsStringGridCompareCells OnCompareCells = ResultsStringGridCompareCells
OnDblClick = ResultsStringGridDblClick OnMouseDown = ResultsStringGridMouseDown
ColWidths = ( ColWidths = (
182 182
100 100

View File

@ -36,7 +36,6 @@
-show line number -show line number
-param compatibility -param compatibility
-last visited -last visited
-filter by ancestor
-hint: show file name + param list -hint: show file name + param list
} }
unit CodyFindOverloads; unit CodyFindOverloads;
@ -138,7 +137,8 @@ type
IsColumn: Boolean; sIndex, tIndex: Integer); IsColumn: Boolean; sIndex, tIndex: Integer);
procedure ResultsStringGridCompareCells(Sender: TObject; ACol, ARow, BCol, procedure ResultsStringGridCompareCells(Sender: TObject; ACol, ARow, BCol,
BRow: Integer; var Result: integer); BRow: Integer; var Result: integer);
procedure ResultsStringGridDblClick(Sender: TObject); procedure ResultsStringGridMouseDown(Sender: TObject; {%H-}Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Timer1Timer(Sender: TObject); procedure Timer1Timer(Sender: TObject);
private private
FFilterAncestor: string; FFilterAncestor: string;
@ -335,9 +335,16 @@ begin
debugln(['TCodyFindOverloadsWindow.ResultsStringGridCompareCells invalid ACol=',ACol,' ARow=',ARow,' BCol=',BCol,' BRow=',BRow]); debugln(['TCodyFindOverloadsWindow.ResultsStringGridCompareCells invalid ACol=',ACol,' ARow=',ARow,' BCol=',BCol,' BRow=',BRow]);
end; end;
procedure TCodyFindOverloadsWindow.ResultsStringGridDblClick(Sender: TObject); procedure TCodyFindOverloadsWindow.ResultsStringGridMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
Col, Row: Longint;
begin begin
JumpToIdentifier; Col:=0;
Row:=0;
ResultsStringGrid.MouseToCell(X,Y,Col,Row);
if (Row>0) and (ssDouble in Shift) then
JumpToIdentifier;
end; end;
procedure TCodyFindOverloadsWindow.Timer1Timer(Sender: TObject); procedure TCodyFindOverloadsWindow.Timer1Timer(Sender: TObject);
@ -348,7 +355,7 @@ begin
Cnt:=0; Cnt:=0;
if FUsesGraph.FilesTree<>nil then if FUsesGraph.FilesTree<>nil then
Cnt:=FUsesGraph.FilesTree.Count; Cnt:=FUsesGraph.FilesTree.Count;
ResultsGroupBox.Caption:=Format('Scanning: %s units ...', [IntToStr(Cnt)]); ResultsGroupBox.Caption:=Format(crsScanningSUnits, [IntToStr(Cnt)]);
end; end;
procedure TCodyFindOverloadsWindow.SetIdleConnected(AValue: boolean); procedure TCodyFindOverloadsWindow.SetIdleConnected(AValue: boolean);
@ -678,11 +685,11 @@ var
Edge:=TCFOEdge(AVLNode.Data); Edge:=TCFOEdge(AVLNode.Data);
NewDistance:=GraphNode.Distance; NewDistance:=GraphNode.Distance;
case Edge.Typ of case Edge.Typ of
cfoetReachable: NewDistance+=100000;// not related cfoetReachable: NewDistance+=50000;// not related
cfoetMethodOf: ; // methods within one class are close cfoetMethodOf: ; // methods within one class are close
cfoetDescendantOf: cfoetDescendantOf:
if GraphNode=Edge.FromNode then if GraphNode=Edge.FromNode then
NewDistance+=10 // going to the ancestors NewDistance+=100 // going to the ancestors
else else
NewDistance+=1; // going to the descendants NewDistance+=1; // going to the descendants
end; end;
@ -813,8 +820,7 @@ begin
Grid.EndUpdate(true); Grid.EndUpdate(true);
Grid.HandleNeeded; Grid.HandleNeeded;
Grid.AutoAdjustColumns;
// ToDo: resize columns
JumpToButton.Enabled:=Grid.Row>0; JumpToButton.Enabled:=Grid.Row>0;
end; end;

View File

@ -268,6 +268,7 @@ resourcestring
crsIncompatible = 'incompatible'; crsIncompatible = 'incompatible';
crsCodyFindOverloads = 'Cody - Find Overloads'; crsCodyFindOverloads = 'Cody - Find Overloads';
crsOnlyMethods = 'Only methods'; crsOnlyMethods = 'Only methods';
crsScanningSUnits = 'Scanning: %s units ...';
crsOnlyDescendantsOf = 'Only descendants of %s'; crsOnlyDescendantsOf = 'Only descendants of %s';
crsOnlyNonMethods = 'Only non methods'; crsOnlyNonMethods = 'Only non methods';
crsAny = 'Any'; crsAny = 'Any';

View File

@ -646,6 +646,10 @@ msgstr "Speichere Wörterbuch jetzt"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "" msgstr ""
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "" msgstr ""

View File

@ -647,6 +647,10 @@ msgstr "Enregistrer le dictionnaire tout de suite"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "Enregistrer dans le fichier %s" msgstr "Enregistrer dans le fichier %s"
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "recherche en cours..." msgstr "recherche en cours..."

View File

@ -647,6 +647,10 @@ msgstr "Szótár mentése most"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "Mentés fájlba: %s" msgstr "Mentés fájlba: %s"
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "keresés ..." msgstr "keresés ..."

View File

@ -648,6 +648,10 @@ msgstr "Salvare il dizionario ora"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "Salvare nel file %s" msgstr "Salvare nel file %s"
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "Ricerca in corso..." msgstr "Ricerca in corso..."

View File

@ -647,6 +647,10 @@ msgstr "Žodyną įrašyti dabar"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "Įrašyti į failą „%s“" msgstr "Įrašyti į failą „%s“"
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "ieškoma…" msgstr "ieškoma…"

View File

@ -637,6 +637,10 @@ msgstr ""
msgid "Save to file %s" msgid "Save to file %s"
msgstr "" msgstr ""
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "" msgstr ""

View File

@ -657,6 +657,10 @@ msgstr "Salvar dicionário agora"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "Salvar para o arquivo %s" msgstr "Salvar para o arquivo %s"
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "localizando ..." msgstr "localizando ..."

View File

@ -658,6 +658,10 @@ msgstr "Сохранить словарь сейчас"
msgid "Save to file %s" msgid "Save to file %s"
msgstr "Сохранить в файл %s" msgstr "Сохранить в файл %s"
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "поиск ..." msgstr "поиск ..."

View File

@ -659,6 +659,10 @@ msgstr ""
msgid "Save to file %s" msgid "Save to file %s"
msgstr "" msgstr ""
#: codystrconsts.crsscanningsunits
msgid "Scanning: %s units ..."
msgstr ""
#: codystrconsts.crssearching #: codystrconsts.crssearching
msgid "searching ..." msgid "searching ..."
msgstr "пошук ..." msgstr "пошук ..."