Permalink
Browse files

Show icons instead of text on delete + sort buttons of data sorting d…

…ialog. Use the same new sort icon on column headers.
  • Loading branch information...
ansgarbecker committed Dec 2, 2018
1 parent 382be95 commit 9d61fb53a16ffe60c05b16d754a37abce81dcc46
BIN +261 Bytes (210%) res/icons/sort_ascending.png
Binary file not shown.
BIN -241 Bytes res/icons/sort_desc.png
Binary file not shown.
Binary file not shown.
@@ -33,6 +33,7 @@ object DataSortingForm: TDataSortingForm
Caption = 'OK'
Default = True
Enabled = False
Images = MainForm.ImageListMain
ModalResult = 1
TabOrder = 0
OnClick = btnOKClick
@@ -45,6 +46,7 @@ object DataSortingForm: TDataSortingForm
Anchors = [akLeft, akBottom]
Cancel = True
Caption = 'Cancel'
Images = MainForm.ImageListMain
ModalResult = 2
TabOrder = 1
OnClick = btnCancelClick
@@ -56,6 +58,7 @@ object DataSortingForm: TDataSortingForm
Height = 25
Anchors = [akLeft, akBottom]
Caption = 'Add Col'
Images = MainForm.ImageListMain
TabOrder = 2
OnClick = btnAddColClick
end
@@ -64,11 +67,11 @@ object DataSortingForm: TDataSortingForm
Top = 39
Width = 125
Height = 25
Action = MainForm.actDataResetSorting
Anchors = [akRight, akBottom]
Caption = 'Reset sorting'
Images = MainForm.ImageListMain
ModalResult = 2
TabOrder = 3
OnClick = btnResetClick
end
end
end
@@ -4,8 +4,7 @@ interface
uses
Windows, SysUtils, Classes, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, Buttons,
apphelpers, gnugettext;
Vcl.Graphics, apphelpers, gnugettext;
type
@@ -21,7 +20,6 @@ TDataSortingForm = class(TForm)
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDeactivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnResetClick(Sender: TObject);
procedure DisplaySortingControls(Sender: TObject);
private
{ Private declarations }
@@ -88,9 +86,9 @@ procedure TDataSortingForm.DisplaySortingControls(Sender: TObject);
Margin := Round(3 * DpiScaleFactor(Self));
MarginBig := Margin * 2;
Width1 := Round(15 * DpiScaleFactor(Self));
Width2 := Round(130 * DpiScaleFactor(Self));
Width3 := Round(40 * DpiScaleFactor(Self));
Width4 := Round(30 * DpiScaleFactor(Self));
Width2 := Round(160 * DpiScaleFactor(Self));
Width3 := Round(23 * DpiScaleFactor(Self));
Width4 := Round(23 * DpiScaleFactor(Self));
// Set initial width to avoid resizing form to 0
TopPos := pnlBevel.BorderWidth + MarginBig;
@@ -133,10 +131,13 @@ procedure TDataSortingForm.DisplaySortingControls(Sender: TObject);
btnOrder.Top := TopPos;
btnOrder.AllowAllUp := True; // Enables Down = False
btnOrder.GroupIndex := i+1; // if > 0 enables Down = True
btnOrder.Caption := TXT_ASC;
btnOrder.Glyph.Transparent := True;
btnOrder.Glyph.AlphaFormat := afDefined;
if OrderColumns[i].SortDirection = ORDER_DESC then begin
btnOrder.Caption := TXT_DESC;
MainForm.ImageListMain.GetBitmap(110, btnOrder.Glyph);
btnOrder.Down := True;
end else begin
MainForm.ImageListMain.GetBitmap(109, btnOrder.Glyph);
end;
btnOrder.Hint := _('Toggle the sort direction for this column.');
btnOrder.Tag := i+1;
@@ -149,7 +150,8 @@ procedure TDataSortingForm.DisplaySortingControls(Sender: TObject);
btnDelete.Height := comboColumns.Height;
btnDelete.Left := btnOrder.Left + btnOrder.Width + Margin;
btnDelete.Top := TopPos;
btnDelete.Caption := 'X';
btnDelete.Images := MainForm.ImageListMain;
btnDelete.ImageIndex := 26;
btnDelete.Hint := _('Drops sorting by this column.');
btnDelete.Tag := i+1;
btnDelete.OnClick := btnDeleteClick;
@@ -212,17 +214,15 @@ procedure TDataSortingForm.comboColumnsChange( Sender: TObject );
}
procedure TDataSortingForm.btnOrderClick( Sender: TObject );
var
btn : TSpeedButton;
btn: TSpeedButton;
begin
btn := Sender as TSpeedButton;
if btn.Down then
begin
btn.Caption := TXT_DESC;
btn.Glyph := nil;
if OrderColumns[btn.Tag-1].SortDirection = ORDER_ASC then begin
MainForm.ImageListMain.GetBitmap(110, btn.Glyph);
OrderColumns[btn.Tag-1].SortDirection := ORDER_DESC;
end
else
begin
btn.Caption := TXT_ASC;
end else begin
MainForm.ImageListMain.GetBitmap(109, btn.Glyph);
OrderColumns[btn.Tag-1].SortDirection := ORDER_ASC;
end;
@@ -345,11 +345,4 @@ procedure TDataSortingForm.FormDeactivate(Sender: TObject);
end;
procedure TDataSortingForm.btnResetClick(Sender: TObject);
begin
Mainform.actDataResetSortingExecute(Sender);
btnCancel.OnClick(Sender);
end;
end.
@@ -1417,7 +1417,7 @@ object MainForm: TMainForm
Header.Height = 20
Header.Images = ImageListMain
Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoHotTrack, hoShowHint, hoShowImages, hoShowSortGlyphs]
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoHotTrack, hoShowHint, hoShowImages]
Header.ParentFont = True
IncrementalSearch = isAll
LineStyle = lsSolid
@@ -2806,7 +2806,7 @@ object MainForm: TMainForm
Left = 504
Top = 104
Bitmap = {
494C0101C1005001E80410001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
494C0101C1005001040510001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001003000001002000000000000010
0300000000000000000000000000000000000000000000000000000000005E5E
5EEB000000000000000000000000000000000000000000000000000000000000
@@ -5498,130 +5498,130 @@ object MainForm: TMainForm
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000272727C03C3C3CEF1414
14A5141414A5141414A5090909C0060606C00000000000000000000000000000
0000000000000000000000000000000000000202022D373737D2212121AD0000
0000000000000202023C151515BF111111BF0404047000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000242424AF3C3C3CEF2020
208700000000000000000B0B0B50141414A50000000000000000000000000000
00000000000005020029000000000000000000000000171717801E1E1E970101
011D0101011D0101011F343434FC202020E20000000000000000000000000000
0000000000000502002900000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000242424AF3C3C
3CEF202020870000000000000000000000000000000000000000000000000000
00000502002989502DCB050201290000000000000000000000002C2C2CAD1313
1377303030B92B2B2BBF434343FD0404044D0000000000000000000000000000
00000502002989502DCB05020129000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000002424
24AF3C3C3CEF2020208700000000000000000000000000000000000000000000
0000985932D6E3A471FF9C683FD5000000000000000000000000101010661010
10660303032D565656FB2E2E2EC7000000000000000000000000000000000000
0000985932D6E3A471FF9C683FD5000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000242424AF3C3C3CEF20202087000000000000000000000000000000000000
000000000000E19E67FF00000000000000000000000000000000000000003838
38B44C4C4CD6616161FD03030331000000000000000000000000000000000000
000000000000E19E67FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000AE5516E28A3D10B303010004000000000000
0000000000000000000000000000000000000000000000000000000000009A9A
9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A
9AFF000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000009A9A9AFF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000434343C00B0B0B500000
0000000000002C2C2CC0333333DC2A2A2AA30000000000000000000000000000
000000000000E3A26EFF00000000000000000000000000000000000000001F1F
1F86707070FE353535B400000000000000000000000000000000000000000000
000000000000E3A26EFF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000083491CA4D68749FFD37D41FF813710AC000000000000
0000000000000000000000000000000000000000000000000000000000000000
00009A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF0000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000009A9A9AFF9A9A9AFF9A9A9AFF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000434343C0414141C03D3D
3DC0393939C0313131C02C2C2CC0272727C00000000000000000000000000000
000000000000B88152E600000000000000000000000000000000000000000000
0000424242BF0000000000000000000000000000000000000000000000000000
000000000000B88152E600000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000085512A9EDD965FFFE4B089FFE2AA80FFD0783DFF7D330FA90000
0000000000000000000000000000000000000000000000000000000000000000
0000000000009A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000009A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF000000000000
000000000000B98458E600000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B98458E600000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00007B52348EE3A373FFE9BA98FFE3AA80FFE0A375FFE1A87AFFD0753BFF762D
0CA2000000000000000000000000000000000000000000000000000000000000
000000000000000000009A9A9AFF9A9A9AFF9A9A9AFF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00009A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF0000
0000000000000000000000000000000000000000FFFF00000000000000000000
000000000000E7B283FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000E7B283FF00000000000000000000FFFF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000007855
3C87E8AF86FFEDC1A2FFE8B691FFE3A97EFFE0A272FFDFA070FFE0A577FFCF72
3AFF732B0DA00000000000000000000000000000000000000000000000000000
00000000000000000000000000009A9A9AFF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000009A9A
9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A9AFF9A9A
9AFF000000000000000000000000000000000000FFFF0000FFFF000000000000
3AFF732B0DA00000000000000000000000000202022D373737D2212121AD0000
0000000000000202023C151515BF111111BF0404047000000000000000000000
000000000000EAB688FF000000000000000000000000272727C03C3C3CEF1414
14A5141414A5141414A5090909C0060606C00000000000000000000000000000
000000000000EAB688FF00000000000000000000FFFF0000FFFF000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000007A594187E7A7
7AFEEFC8ACFFEEC7A7FFECC0A0FFEABA98FFE7B48FFFE4AE86FFE1A77CFFDFA2
73FFCC6F39FF6F260C9B00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000
73FFCC6F39FF6F260C9B000000000000000000000000171717801E1E1E970101
011D0101011D0101011F343434FC202020E20000000000000000000000000000
000000000000EAB88DFF000000000000000000000000242424AF3C3C3CEF2020
208700000000000000000B0B0B50141414A50000000000000000000000000000
000000000000EAB88DFF00000000000000000000FFFF0000FFFF0000FFFF0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000DEA27AF4EAAA
7EFFE6A677FFE29F6CFFE19660FFDB8D51FFD68341FFD27533FFCD6C21FFC960
18FFC35716FFBF4C14FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000
18FFC35716FFBF4C14FF000000000000000000000000000000002C2C2CAD1313
1377303030B92B2B2BBF434343FD0404044D0000000000000000000000000000
000000000000EBBB90FF00000000000000000000000000000000242424AF3C3C
3CEF202020870000000000000000000000000000000000000000000000000000
000000000000EBBB90FF00000000000000000000FFFF0000FFFF0000FFFF0000
FFFF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000
0000000000000000000000000000000000000000000000000000101010661010
10660303032D565656FB2E2E2EC7000000000000000000000000000000000000
000000000000EDC19AFF00000000000000000000000000000000000000002424
24AF3C3C3CEF2020208700000000000000000000000000000000000000000000
000000000000EDC19AFF00000000000000000000FFFF0000FFFF0000FFFF0000
FFFF0000FFFF0000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000
0000000000000000000000000000000000000000000000000000000000003838
38B44C4C4CD6616161FD03030331000000000000000000000000000000000000
000000000000D6A87EF400000000000000000000000000000000000000000000
0000242424AF3C3C3CEF20202087000000000000000000000000000000000000
000000000000D6A87EF400000000000000000000FFFF0000FFFF0000FFFF0000
FFFF0000FFFF0000FFFF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000
0000000000000000000000000000000000000000000000000000000000001F1F
1F86707070FE353535B400000000000000000000000000000000000000000000
0000000000000704022D000000000000000000000000434343C00B0B0B500000
0000000000002C2C2CC0333333DC2A2A2AA30000000000000000000000000000
0000000000000704022D00000000000000000000FFFF0000FFFF0000FFFF0000
FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000424242BF0000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000434343C0414141C03D3D
3DC0393939C0313131C02C2C2CC0272727C00000000000000000000000000000
0000000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000
FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Oops, something went wrong.

0 comments on commit 9d61fb5

Please sign in to comment.