You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
3.2 KiB
Plaintext

11 months ago
unit u_sys_grid_sort;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, dxExEdtr, dxCntner,
dxTL, dxDBCtrl, dxDBGrid;
type
Tfrm_sys_grid_sort = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinGroupBox2: TbsSkinGroupBox;
bsSkinButton10: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
ListBox1: TListBox;
ListBox2: TListBox;
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_sys_grid_sort: Tfrm_sys_grid_sort;
sys_grid_num_sort:integer;
implementation
uses u_main, u_op_seae;
{$R *.dfm}
procedure Tfrm_sys_grid_sort.bsSkinButton10Click(Sender: TObject);
begin
try
if ListBox1.Items.Count>0 then
begin
ListBox2.Items.add(ListBox1.items[ListBox1.ItemIndex]);
ListBox1.Items.Delete(ListBox1.ItemIndex);
end;
except
;
end;
end;
procedure Tfrm_sys_grid_sort.bsSkinButton11Click(Sender: TObject);
begin
try
if ListBox2.Items.Count>0 then
begin
ListBox1.Items.add(ListBox2.items[ListBox2.ItemIndex]);
ListBox2.Items.Delete(ListBox2.ItemIndex);
end;
except
;
end;
end;
procedure Tfrm_sys_grid_sort.bsSkinButton3Click(Sender: TObject);
var
i:integer;
begin
if ListBox2.ItemIndex>0 then
begin
i:=ListBox2.ItemIndex-1;
ListBox2.Items.Move(ListBox2.ItemIndex,ListBox2.ItemIndex-1);
ListBox2.ItemIndex:=i;
end;
end;
procedure Tfrm_sys_grid_sort.bsSkinButton4Click(Sender: TObject);
var
i:integer;
begin
if ListBox2.ItemIndex<ListBox2.Items.Count-1 then
begin
i:=ListBox2.ItemIndex+1;
ListBox2.Items.Move(ListBox2.ItemIndex,ListBox2.ItemIndex+1);
ListBox2.ItemIndex:=i;
end;
end;
procedure Tfrm_sys_grid_sort.bsSkinButton2Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_sys_grid_sort.bsSkinButton1Click(Sender: TObject);
var
str:string;
i:integer;
begin
if (ListBox2.Items.Text='')then
begin
showmessage('<27><>ѡ<EFBFBD><D1A1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
exit;
end;
if (ListBox2.Items.Count>8) then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2>ܴ<EFBFBD><DCB4><EFBFBD>8<EFBFBD><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
for i:=0 to ListBox2.Items.Count-1 do
begin
if str=''then
str:=ListBox2.Items[i]
else
str:=str+','+ListBox2.Items[i];
end;
case sys_grid_num_sort of
1:
begin
try
frm_op_seae.t_op_seae.DisableControls;
for i:=0 to frm_op_seae.dxdbgrid1.ColumnCount-1 do
begin
frm_op_seae.dxdbgrid1.Columns[i].Sorted:=csNone;
end;
frm_op_seae.t_op_seae.Sort:=str;
finally
frm_op_seae.t_op_seae.First;
frm_op_seae.t_op_seae.EnableControls;
end;
end;
end;
close;
end;
end.