mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-30 01:09:29 +02:00
grids, implemented SortOrder property for stringgrid, issue #10643
git-svn-id: trunk@13805 -
This commit is contained in:
parent
2ddd71c0ce
commit
52e236cb80
@ -137,6 +137,8 @@ type
|
|||||||
gfRevEditorTab, gfVisualChange, gfDefRowHeightChanged);
|
gfRevEditorTab, gfVisualChange, gfDefRowHeightChanged);
|
||||||
TGridFlags = set of TGridFlagsOption;
|
TGridFlags = set of TGridFlagsOption;
|
||||||
|
|
||||||
|
TSortOrder = (soAscending, soDescending);
|
||||||
|
|
||||||
const
|
const
|
||||||
soAll: TSaveOptions = [soDesign, soAttributes, soContent, soPosition];
|
soAll: TSaveOptions = [soDesign, soAttributes, soContent, soPosition];
|
||||||
constRubberSpace: byte = 2;
|
constRubberSpace: byte = 2;
|
||||||
@ -537,6 +539,7 @@ type
|
|||||||
FFastEditing: boolean;
|
FFastEditing: boolean;
|
||||||
FAltColorStartNormal: boolean;
|
FAltColorStartNormal: boolean;
|
||||||
FFlat: Boolean;
|
FFlat: Boolean;
|
||||||
|
FSortOrder: TSortOrder;
|
||||||
FTitleStyle: TTitleStyle;
|
FTitleStyle: TTitleStyle;
|
||||||
FOnCompareCells: TOnCompareCells;
|
FOnCompareCells: TOnCompareCells;
|
||||||
FGridLineStyle: TPenStyle;
|
FGridLineStyle: TPenStyle;
|
||||||
@ -962,6 +965,8 @@ type
|
|||||||
function MouseToGridZone(X,Y: Integer): TGridZone;
|
function MouseToGridZone(X,Y: Integer): TGridZone;
|
||||||
procedure SaveToFile(FileName: string);
|
procedure SaveToFile(FileName: string);
|
||||||
procedure SetFocus; override;
|
procedure SetFocus; override;
|
||||||
|
|
||||||
|
property SortOrder: TSortOrder read FSortOrder write FSortOrder;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TGetEditEvent = procedure (Sender: TObject; ACol, ARow: Integer; var Value: string) of object;
|
TGetEditEvent = procedure (Sender: TObject; ACol, ARow: Integer; var Value: string) of object;
|
||||||
@ -6663,6 +6668,7 @@ begin
|
|||||||
FHeaderPushZones := [gzFixedCols];
|
FHeaderPushZones := [gzFixedCols];
|
||||||
ResetHotCell;
|
ResetHotCell;
|
||||||
ResetPushedCell;
|
ResetPushedCell;
|
||||||
|
FSortOrder := soAscending;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomGrid.Destroy;
|
destructor TCustomGrid.Destroy;
|
||||||
@ -7831,8 +7837,11 @@ function TCustomStringGrid.DoCompareCells(Acol, ARow, Bcol, BRow: Integer
|
|||||||
begin
|
begin
|
||||||
if Assigned(OnCompareCells) then
|
if Assigned(OnCompareCells) then
|
||||||
Result:=inherited DoCompareCells(Acol, ARow, Bcol, BRow)
|
Result:=inherited DoCompareCells(Acol, ARow, Bcol, BRow)
|
||||||
else
|
else begin
|
||||||
Result:=AnsiCompareText(Cells[ACol,ARow], Cells[BCol,BRow]);
|
Result:=AnsiCompareText(Cells[ACol,ARow], Cells[BCol,BRow]);
|
||||||
|
if SortOrder=soDescending then
|
||||||
|
result:=-result;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomStringGrid.DoCopyToClipboard;
|
procedure TCustomStringGrid.DoCopyToClipboard;
|
||||||
|
Loading…
Reference in New Issue
Block a user