Add a menu item "Reset sorting", to remove ORDER BY columns with one click / shortcut. Fixes issue #561.

This commit is contained in:
Ansgar Becker
2009-12-27 16:39:54 +00:00
parent 04c8181ba5
commit 6c74af1ec8
5 changed files with 81 additions and 7 deletions

View File

@ -14,6 +14,7 @@ type
btnOK: TButton;
btnCancel: TButton;
btnAddCol: TButton;
btnReset: TButton;
procedure btnAddColClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure btnOKClick(Sender: TObject);
@ -21,6 +22,7 @@ type
procedure FormDeactivate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnResetClick(Sender: TObject);
private
{ Private declarations }
ColumnNames : TWideStringList;
@ -178,7 +180,7 @@ begin
Height := (pnlBevel.BorderWidth * 2) + // Top + Bottom border
(MARGIN_BIG * 2) + // Separator spaces
(Length(OrderColumns) * (LINE_HEIGHT + MARGIN)) + // Height of created controls
(btnOK.Height + MARGIN); // Height of buttons
(btnOK.Height + MARGIN + btnReset.Height + Margin); // Height of buttons
Width := xPosition + pnlBevel.BorderWidth;
// Auto-adjust width and position of main buttons at bottom
@ -190,6 +192,9 @@ begin
btnCancel.Left := btnOK.Left + btnWidth + MARGIN;
btnAddCol.Width := btnWidth;
btnAddCol.Left := btnCancel.Left + btnWidth + MARGIN;
btnReset.Left := btnCancel.Left;
btnReset.Width := 2*btnWidth + MARGIN;
btnReset.Enabled := Mainform.actDataResetSorting.Enabled;
end;
@ -346,4 +351,11 @@ begin
end;
procedure TDataSortingForm.btnResetClick(Sender: TObject);
begin
Mainform.actDataResetSortingExecute(Sender);
btnCancel.OnClick(Sender);
end;
end.