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