mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 16:40:32 +02:00
cody: find overloads: sort columns
git-svn-id: trunk@49973 -
This commit is contained in:
parent
0150692c4d
commit
399ffe0398
@ -1,11 +1,11 @@
|
||||
object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
Left = 728
|
||||
Height = 380
|
||||
Height = 400
|
||||
Top = 242
|
||||
Width = 553
|
||||
Width = 556
|
||||
Caption = 'CodyFindOverloadsWindow'
|
||||
ClientHeight = 380
|
||||
ClientWidth = 553
|
||||
ClientHeight = 400
|
||||
ClientWidth = 556
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
@ -14,8 +14,8 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
object BtnPanel: TPanel
|
||||
Left = 0
|
||||
Height = 39
|
||||
Top = 341
|
||||
Width = 553
|
||||
Top = 361
|
||||
Width = 556
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
@ -23,10 +23,10 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.HorizontalSpacing = 6
|
||||
ClientHeight = 39
|
||||
ClientWidth = 553
|
||||
ClientWidth = 556
|
||||
TabOrder = 0
|
||||
object JumpToButton: TButton
|
||||
Left = 453
|
||||
Left = 456
|
||||
Height = 27
|
||||
Top = 6
|
||||
Width = 94
|
||||
@ -51,14 +51,14 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
object FilterGroupBox: TGroupBox
|
||||
Left = 0
|
||||
Height = 94
|
||||
Top = 247
|
||||
Width = 553
|
||||
Top = 267
|
||||
Width = 556
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
Caption = 'FilterGroupBox'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ClientHeight = 77
|
||||
ClientWidth = 549
|
||||
ClientWidth = 552
|
||||
TabOrder = 1
|
||||
object CompatibleParamsCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = FilterGroupBox
|
||||
@ -93,7 +93,7 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
Left = 87
|
||||
Height = 29
|
||||
Top = 24
|
||||
Width = 456
|
||||
Width = 459
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -117,21 +117,22 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
end
|
||||
object ResultsGroupBox: TGroupBox
|
||||
Left = 0
|
||||
Height = 247
|
||||
Height = 267
|
||||
Top = 0
|
||||
Width = 553
|
||||
Width = 556
|
||||
Align = alClient
|
||||
Caption = 'ResultsGroupBox'
|
||||
ClientHeight = 230
|
||||
ClientWidth = 549
|
||||
ClientHeight = 250
|
||||
ClientWidth = 552
|
||||
TabOrder = 2
|
||||
object ResultsStringGrid: TStringGrid
|
||||
Left = 0
|
||||
Height = 210
|
||||
Height = 230
|
||||
Top = 20
|
||||
Width = 549
|
||||
Width = 552
|
||||
Align = alClient
|
||||
ColCount = 3
|
||||
ColumnClickSorts = True
|
||||
Columns = <
|
||||
item
|
||||
ReadOnly = True
|
||||
@ -156,6 +157,7 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
FixedCols = 0
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goRowSelect, goDblClickAutoSize, goSmoothScroll, goRowHighlight]
|
||||
TabOrder = 0
|
||||
OnColRowExchanged = ResultsStringGridColRowExchanged
|
||||
OnCompareCells = ResultsStringGridCompareCells
|
||||
ColWidths = (
|
||||
182
|
||||
@ -167,7 +169,7 @@ object CodyFindOverloadsWindow: TCodyFindOverloadsWindow
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 0
|
||||
Width = 549
|
||||
Width = 552
|
||||
Align = alTop
|
||||
TabOrder = 1
|
||||
end
|
||||
|
@ -86,6 +86,7 @@ type
|
||||
Name: string;
|
||||
ClassPath: string;
|
||||
TheUnitName: string;
|
||||
Caption: string;
|
||||
Params: string;
|
||||
Distance: integer;
|
||||
Compatibility: TTypeCompatibility;
|
||||
@ -119,6 +120,8 @@ type
|
||||
procedure JumpToButtonClick(Sender: TObject);
|
||||
procedure OnIdle(Sender: TObject; var Done: Boolean);
|
||||
procedure RefreshButtonClick(Sender: TObject);
|
||||
procedure ResultsStringGridColRowExchanged(Sender: TObject;
|
||||
IsColumn: Boolean; sIndex, tIndex: Integer);
|
||||
procedure ResultsStringGridCompareCells(Sender: TObject; ACol, ARow, BCol,
|
||||
BRow: Integer; var Result: integer);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
@ -259,12 +262,33 @@ begin
|
||||
Init;
|
||||
end;
|
||||
|
||||
procedure TCodyFindOverloadsWindow.ResultsStringGridColRowExchanged(
|
||||
Sender: TObject; IsColumn: Boolean; sIndex, tIndex: Integer);
|
||||
begin
|
||||
if (not IsColumn) and (sIndex>0) and (sIndex<=ProcCount)
|
||||
and (tIndex>0) and (tIndex<=ProcCount) then
|
||||
FProcList.Exchange(sIndex-1,tIndex-1);
|
||||
end;
|
||||
|
||||
procedure TCodyFindOverloadsWindow.ResultsStringGridCompareCells(
|
||||
Sender: TObject; ACol, ARow, BCol, BRow: Integer; var Result: integer);
|
||||
var
|
||||
AProc, BProc: TCFOProc;
|
||||
begin
|
||||
if (aRow>0) and (ARow<=ProcCount) then begin
|
||||
|
||||
end;
|
||||
if (ARow>0) and (ARow<=ProcCount) and (ACol=BCol)
|
||||
and (BRow>0) and (BRow<=ProcCount) then begin
|
||||
AProc:=Procs[ARow-1];
|
||||
BProc:=Procs[BRow-1];
|
||||
case ACol of
|
||||
0: Result:=CompareText(AProc.Caption,BProc.Caption);
|
||||
1: Result:=ord(AProc.Compatibility)-ord(BProc.Compatibility);
|
||||
2: Result:=ord(AProc.Distance)-ord(BProc.Distance);
|
||||
end;
|
||||
if ResultsStringGrid.SortOrder=soDescending then
|
||||
Result:=-Result;
|
||||
//debugln(['TCodyFindOverloadsWindow.ResultsStringGridCompareCells "',AProc.Caption,'" "',BProc.Caption,'" ',Result]);
|
||||
end else
|
||||
debugln(['TCodyFindOverloadsWindow.ResultsStringGridCompareCells invalid ACol=',ACol,' ARow=',ARow,' BCol=',BCol,' BRow=',BRow]);
|
||||
end;
|
||||
|
||||
procedure TCodyFindOverloadsWindow.Timer1Timer(Sender: TObject);
|
||||
@ -670,6 +694,7 @@ begin
|
||||
if aProc.ClassPath<>'' then
|
||||
s+=aProc.ClassPath+'.';
|
||||
s+=aProc.Name;
|
||||
aProc.Caption:=s;
|
||||
Grid.Cells[0,Row]:=s;
|
||||
|
||||
case aProc.Compatibility of
|
||||
|
@ -68,10 +68,6 @@ msgstr "Papiertyp"
|
||||
msgid "Portrait"
|
||||
msgstr "Hochformat"
|
||||
|
||||
#: printer4lazstrconst.p4lrsprinterproperties
|
||||
msgid "Printer properties"
|
||||
msgstr ""
|
||||
|
||||
#: printer4lazstrconst.p4lrsresolution
|
||||
msgid "Resolution"
|
||||
msgstr "Auflösung"
|
||||
|
@ -57,10 +57,6 @@ msgstr ""
|
||||
msgid "Portrait"
|
||||
msgstr ""
|
||||
|
||||
#: printer4lazstrconst.p4lrsprinterproperties
|
||||
msgid "Printer properties"
|
||||
msgstr ""
|
||||
|
||||
#: printer4lazstrconst.p4lrsresolution
|
||||
msgid "Resolution"
|
||||
msgstr ""
|
||||
|
@ -67,10 +67,6 @@ msgstr "Тип бумаги"
|
||||
msgid "Portrait"
|
||||
msgstr "Книжная"
|
||||
|
||||
#: printer4lazstrconst.p4lrsprinterproperties
|
||||
msgid "Printer properties"
|
||||
msgstr "Свойства принтера"
|
||||
|
||||
#: printer4lazstrconst.p4lrsresolution
|
||||
msgid "Resolution"
|
||||
msgstr "Разрешение"
|
||||
@ -86,3 +82,4 @@ msgstr "Обратная книжная"
|
||||
#: printer4lazstrconst.p4lrsstart
|
||||
msgid "Start"
|
||||
msgstr "Верхний"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user