Стартовый пул
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, lazcontrols, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
@@ -0,0 +1,90 @@
|
||||
unit exsortibx;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, DB, RxDBGrid;
|
||||
|
||||
type
|
||||
|
||||
{ TZeosDataSetSortEngine }
|
||||
|
||||
{ TIBXDataSetSortEngine }
|
||||
|
||||
TIBXDataSetSortEngine = class(TRxDBGridSortEngine)
|
||||
protected
|
||||
public
|
||||
procedure Sort(FieldName: string; ADataSet:TDataSet; Asc:boolean; SortOptions:TRxSortEngineOptions);override;
|
||||
procedure SortList(ListField: string; ADataSet: TDataSet; Asc: array of boolean; SortOptions: TRxSortEngineOptions); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
uses IBCustomDataSet;
|
||||
|
||||
function FixFieldName(S:string):string;inline;
|
||||
begin
|
||||
if not IsValidIdent(S) then
|
||||
Result:='"'+S+'"'
|
||||
else
|
||||
Result:=S;
|
||||
end;
|
||||
|
||||
{ TIBXDataSetSortEngine }
|
||||
|
||||
procedure TIBXDataSetSortEngine.Sort(FieldName: string; ADataSet: TDataSet;
|
||||
Asc: boolean; SortOptions: TRxSortEngineOptions);
|
||||
begin
|
||||
if not Assigned(ADataSet) then exit;
|
||||
|
||||
if ADataSet is TIBCustomDataSet then
|
||||
begin
|
||||
if Asc then
|
||||
FieldName := FixFieldName(FieldName) + ' Asc'
|
||||
else
|
||||
FieldName := FixFieldName(FieldName) + ' Desc';
|
||||
TIBCustomDataSet(ADataSet).OrderFields:=FieldName;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIBXDataSetSortEngine.SortList(ListField: string; ADataSet: TDataSet;
|
||||
Asc: array of boolean; SortOptions: TRxSortEngineOptions);
|
||||
var
|
||||
S: String;
|
||||
C: SizeInt;
|
||||
i: Integer;
|
||||
begin
|
||||
if not Assigned(ADataSet) then exit;
|
||||
|
||||
S:='';
|
||||
C:=Pos(';', ListField);
|
||||
i:=0;
|
||||
while C>0 do
|
||||
begin
|
||||
if S<>'' then S:=S+';';
|
||||
S:=S + FixFieldName(Copy(ListField, 1, C-1));
|
||||
Delete(ListField, 1, C);
|
||||
|
||||
if (i<=High(Asc)) and (not Asc[i]) then
|
||||
S:=S + ' DESC';
|
||||
C:=Pos(';', ListField);
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
if ListField<>'' then
|
||||
begin
|
||||
if S<>'' then S:=S+';';
|
||||
S:=S + FixFieldName(ListField);
|
||||
if (i<=High(Asc)) and (not Asc[i]) then
|
||||
S:=S + ' DESC';
|
||||
end;
|
||||
|
||||
(ADataSet as TIBCustomDataSet).OrderFields:=S;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterRxDBGridSortEngine(TIBXDataSetSortEngine, 'TIBQuery');
|
||||
RegisterRxDBGridSortEngine(TIBXDataSetSortEngine, 'TIBDataSet');
|
||||
end.
|
||||
|
@@ -0,0 +1,3 @@
|
||||
del rx.lrs
|
||||
del rx.res
|
||||
c:\lazarus\tools\lazres.exe rx.res TDBDateEdit.xpm TRXLookUpEdit.xpm TRxDBCalcEdit.xpm TRxDBLookupCombo.xpm TRxDBGrid.xpm TDualListDialog.xpm TFolderLister.xpm TRxMemoryData.xpm TCURRENCYEDIT.xpm TRXSWITCH.xpm TRXDICE.xpm TRXDBCOMBOBOX.xpm ttoolpanel.xpm TPAGEMANAGER.xpm TRXAPPICON.xpm TSECRETPANEL.xpm TRXLABEL.xpm tautopanel.xpm TRxCalendarGrid.xpm TRxDateEdit.png TRxClock.png TRxSpeedButton.png TRxSpinButton.png TRxSpinEdit.png TRXDBSpinEdit.png TRxTimeEdit.png TRxDBTimeEdit.png TRxDBProgressBar.png TRxDBTrackBar.png TRxLoginDialog.png TRxVersionInfo.png TRxAboutDialog.png TRxDBCurrEdit.png TRxViewsPanel.png TRxDBColorBox.png TRxRadioGroup.png TRxDBRadioGroup.png TRxHistoryNavigator.png TRxCloseFormValidator.png TRxIniPropStorage TRxDBGridFooterTools.png TRxDateRangeEdit.png TRxMDICloseButton.png TRxMDIPanel.png TRxMDITasks.png TRxDBGridExportPDF.png
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user