Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,272 @@
{ RXDBGrid unit
Copyright (C) 2005-2017 Lagunov Aleksey alexs75@yandex.ru and Lazarus team
original conception from rx library for Delphi (c)
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version with the following modification:
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent modules,and
to copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the terms
and conditions of the license of that module. An independent module is a
module which is not derived from or based on this library. If you modify
this library, you may extend this exception to your version of the library,
but you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
for more details.
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
unit rxsortby;
{$I rx.inc}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ButtonPanel, rxdbgrid, db, types;
type
{ TrxSortByForm }
TrxSortByForm = class(TForm)
AddBtn: TBitBtn;
ButtonPanel1: TButtonPanel;
CheckBox1: TCheckBox;
DownBtn: TBitBtn;
Label1: TLabel;
Label2: TLabel;
ListBox1: TListBox;
ListBox2: TListBox;
RemoveBtn: TBitBtn;
UpBtn: TBitBtn;
procedure AddBtnClick(Sender: TObject);
procedure DownBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ListBox1DblClick(Sender: TObject);
procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
procedure ListBox2DblClick(Sender: TObject);
procedure RemoveBtnClick(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure UpBtnClick(Sender: TObject);
private
FDBGrid:TRxDBGrid;
public
{ public declarations }
function Execute(ADBGrid:TRxDBGrid; SortNames:TStringList):Boolean;
end;
var
rxSortByForm: TrxSortByForm;
implementation
uses rxdconst, DBGrids;
{$R *.lfm}
{ TrxSortByForm }
procedure TrxSortByForm.DownBtnClick(Sender: TObject);
var
TmpField:String;
C1:TObject;
Poz: Integer;
begin
if ListBox1.ItemIndex < ListBox1.Items.Count-1 Then
begin
Poz:=ListBox1.ItemIndex;
TmpField:=ListBox1.Items[Poz+1];
C1:=ListBox1.Items.Objects[Poz+1];
ListBox1.Items[Poz+1]:=ListBox1.Items[Poz];
ListBox1.Items.Objects[Poz+1]:=ListBox1.Items.Objects[Poz];
ListBox1.Items[Poz]:=TmpField;
ListBox1.Items.Objects[Poz]:=C1;
ListBox1.ItemIndex:=Poz+1;
end;
end;
procedure TrxSortByForm.FormCreate(Sender: TObject);
begin
{ ComboBox1.Clear;
ComboBox1.Items.Add(sRxAscendign);
ComboBox1.Items.Add(sRxDescending);}
Caption:=sRxSortByFormCaption;
Label2.Caption:=sRxSortByFormAllFields;
Label1.Caption:=sRxSortByFormSortFields;
// Label4.Caption:=sRxSortByFormSortOrder;
AddBtn.Caption:=sRxSortByFormAddField;
RemoveBtn.Caption:=sRxSortByFormRemoveField;
UpBtn.Caption:=sRxSortByFormMoveUpField;
DownBtn.Caption:=sRxSortByFormMoveDnField;
CheckBox1.Caption:=sRxSortByFormCaseInsens;
end;
procedure TrxSortByForm.ListBox1DblClick(Sender: TObject);
begin
RemoveBtn.Click;
end;
procedure TrxSortByForm.ListBox1DrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
var
X, Y:integer;
//P:TRxColumn;
S1, S2:string;
Cnv:TCanvas;
begin
Cnv:=ListBox1.Canvas;
Cnv.FillRect(ARect); { clear the rectangle }
//P:=TRxColumn(ListBox1.Items.Objects[Index]);
S1:=ListBox1.Items[Index];
S2:=Copy(S1, 1, 1);
Delete(S1, 1, 1);
X := aRect.Left + 2;
Y := Trunc((aRect.Top + aRect.Bottom - UpBtn.Glyph.Height) / 2);
if S2 = '1' then
Cnv.Draw(X, Y, UpBtn.Glyph)
else
Cnv.Draw(X, Y, DownBtn.Glyph);
Cnv.TextOut(ARect.Left + UpBtn.Glyph.Width + 6, (ARect.Top + ARect.Bottom - Cnv.TextHeight('Wg')) div 2, S1);
end;
procedure TrxSortByForm.ListBox2DblClick(Sender: TObject);
begin
AddBtn.Click;
end;
procedure TrxSortByForm.AddBtnClick(Sender: TObject);
var
S:string;
begin
if ListBox2.ItemIndex <> -1 Then
begin
S:='1'+ListBox2.Items[ListBox2.ItemIndex];
ListBox1.Items.Objects[ListBox1.Items.Add(S)]:=ListBox2.Items.Objects[ListBox2.ItemIndex];
ListBox2.Items.Delete(ListBox2.ItemIndex);
ListBox1.ItemIndex:=ListBox1.Items.Count-1;
end;
end;
procedure TrxSortByForm.RemoveBtnClick(Sender: TObject);
var
S:string;
begin
if ListBox1.ItemIndex <> -1 Then
begin
S:=TRxColumn(ListBox1.Items.Objects[ListBox1.ItemIndex]).Title.Caption;
ListBox2.Items.Objects[ListBox2.Items.Add(S)]:=ListBox1.Items.Objects[ListBox1.ItemIndex];
ListBox1.Items.Delete(ListBox1.ItemIndex);
end;
end;
procedure TrxSortByForm.SpeedButton1Click(Sender: TObject);
var
S:string;
begin
if (ListBox1.ItemIndex <> -1) then
begin
S:=ListBox1.Items[ListBox1.ItemIndex];
if S[1] = '1' then
S[1] := '0'
else
S[1] := '1';
ListBox1.Items[ListBox1.ItemIndex]:=S;
end;
end;
procedure TrxSortByForm.UpBtnClick(Sender: TObject);
var
TmpField:String;
Poz : Integer;
C1:TObject;
begin
if ListBox1.ItemIndex > 0 Then
begin
Poz:=ListBox1.ItemIndex;
TmpField:=ListBox1.Items[Poz-1];
C1:=ListBox1.Items.Objects[Poz-1];
ListBox1.Items[Poz-1]:=ListBox1.Items[Poz];
ListBox1.Items.Objects[Poz-1]:=ListBox1.Items.Objects[Poz];
ListBox1.Items[Poz]:=TmpField;
ListBox1.Items.Objects[Poz]:=C1;
ListBox1.ItemIndex:=Poz-1;
end;
end;
function TrxSortByForm.Execute(ADBGrid: TRxDBGrid; SortNames: TStringList
): Boolean;
var
i : Integer;
S : String;
C:TRxColumn;
begin
Result:=False;
if not (Assigned(ADBGrid.DataSource) and Assigned(ADBGrid.DataSource.DataSet) and ADBGrid.DataSource.DataSet.Active) then exit;
FDBGrid:=ADBGrid;
ListBox1.Clear;
ListBox2.Clear;
for i:=0 to ADBGrid.Columns.Count-1 do
begin
C:=TRxColumn(ADBGrid.Columns[i]);
if C.SortOrder = smNone then
ListBox2.Items.Objects[ListBox2.Items.Add(C.Title.Caption)]:=C;
end;
for i:=0 to ADBGrid.SortColumns.Count-1 do
begin
C:=ADBGrid.SortColumns[i];
if C.SortOrder = smUp then
S:='1'+C.Title.Caption
else
S:='0'+C.Title.Caption;
ListBox1.Items.Objects[ListBox1.Items.Add(S)]:=C
end;
if ShowModal = mrOK Then
begin
SortNames.Clear;
for i:=0 to ListBox1.Items.Count-1 do
begin
C:=ListBox1.Items.Objects[i] as TRxColumn;
SortNames.Add(Copy(ListBox1.Items[i], 1, 1) + C.FieldName);
end;
Result:=True;
end;
end;
end.

View File

@@ -0,0 +1,336 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="36"
height="36"
viewBox="0 0 36 36"
version="1.1"
id="svg106"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="tdbverticalgrid_rx_150.svg"
inkscape:export-filename="D:\temp\rx\work\tdbverticalgrid_rx_150.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs100">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient914"
id="linearGradient226"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.6666667,0,0,2.6666667,-36.919643,-1737.1066)"
x1="3"
y1="1035.3622"
x2="12"
y2="1035.3622" />
<linearGradient
inkscape:collect="always"
id="linearGradient914">
<stop
style="stop-color:#4276c4;stop-opacity:1;"
offset="0"
id="stop910" />
<stop
id="stop916"
offset="0.34375"
style="stop-color:#80b3ff;stop-opacity:1" />
<stop
style="stop-color:#0044aa;stop-opacity:1"
offset="1"
id="stop912" />
</linearGradient>
<linearGradient
gradientTransform="matrix(2.6666667,0,0,2.6666667,-36.919643,-1745.1066)"
y2="1035.3622"
x2="12"
y1="1035.3622"
x1="3"
gradientUnits="userSpaceOnUse"
id="linearGradient932"
xlink:href="#linearGradient914"
inkscape:collect="always" />
<linearGradient
y2="1035.3622"
x2="12"
y1="1035.3622"
x1="3"
gradientTransform="matrix(2.6666667,0,0,2.6666667,-36.919643,-1753.1063)"
gradientUnits="userSpaceOnUse"
id="linearGradient936"
xlink:href="#linearGradient914"
inkscape:collect="always" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient914"
id="linearGradient208"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.6666667,0,0,2.6666667,-36.919643,-1737.1066)"
x1="3"
y1="1035.3622"
x2="12"
y2="1035.3622" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.313709"
inkscape:cx="16.098085"
inkscape:cy="17.526886"
inkscape:document-units="px"
inkscape:current-layer="layer7"
showgrid="true"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1018"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:snap-global="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-grids="false">
<inkscape:grid
type="xygrid"
id="grid108" />
</sodipodi:namedview>
<metadata
id="metadata103">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="base"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-296.29999)"
sodipodi:insensitive="true"
style="display:inline">
<rect
style="fill:none;fill-rule:evenodd;stroke-width:0.65726703"
id="rect110"
width="36"
height="36"
x="0"
y="296.29999" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="db"
transform="translate(0,-12)"
sodipodi:insensitive="true"
style="display:inline">
<g
style="display:inline"
id="g899"
transform="matrix(0.75,0,0,0.75,27.689732,-741.89438)">
<ellipse
ry="3"
rx="10"
cy="1030.1925"
cx="-20.919643"
id="ellipse880"
style="opacity:1;fill:#bdd1ec;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient208);stroke-width:3.99999976;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<ellipse
ry="3.9169633"
rx="10.988618"
cy="1026.2755"
cx="-20.919643"
id="ellipse878"
style="opacity:1;fill:#bdd1ec;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<ellipse
style="opacity:1;fill:#bdd1ec;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient932);stroke-width:3.99999976;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="ellipse930"
cx="-20.919643"
cy="1024.1925"
rx="10"
ry="3" />
<ellipse
style="opacity:1;fill:#bdd1ec;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="ellipse874"
cx="-20.919643"
cy="1020.2756"
rx="10.988618"
ry="3.9169633" />
<ellipse
ry="3"
rx="10"
cy="1018.1926"
cx="-20.919643"
id="ellipse934"
style="opacity:1;fill:#bdd1ec;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient936);stroke-width:3.99999976;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<ellipse
ry="3.9169633"
rx="10.988618"
cy="1014.2756"
cx="-20.919643"
id="ellipse858"
style="opacity:1;fill:#bdd1ec;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<ellipse
style="opacity:1;fill:#80b3ff;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient226);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="ellipse868"
cx="-20.919643"
cy="1012.1926"
rx="11"
ry="4" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="vertgrid_left"
transform="translate(0,-12)"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="fill:#e5e5e5;fill-opacity:1;stroke:#4d4d4d;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="rect853"
width="10.085701"
height="19.971817"
x="9.5383005"
y="24.981369" />
</g>
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="vertgrid_right"
transform="translate(0,-12)"
style="display:inline;opacity:1"
sodipodi:insensitive="true">
<rect
style="fill:#fcfdc9;fill-opacity:1;stroke:#4d4d4d;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="rect853-1"
width="13.282163"
height="19.986906"
x="19.623602"
y="24.973824" />
</g>
<g
inkscape:groupmode="layer"
id="layer6"
inkscape:label="string_left"
style="display:inline"
transform="translate(0,-12)"
sodipodi:insensitive="true">
<path
style="opacity:1;fill:none;stroke:#0070e9;stroke-width:1.29999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 10.261891,25.996249 c 8.668614,0 8.668614,0 8.668614,0"
id="path881"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:none;stroke:#0070e9;stroke-width:1.29999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 10.261504,34.998574 c 8.668613,0 8.668613,0 8.668613,0"
id="path881-3"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer8"
inkscape:label="string_right"
style="display:inline"
transform="translate(0,-12)"
sodipodi:insensitive="true">
<path
style="opacity:1;fill:none;stroke:#0070e9;stroke-width:1.30000007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 20.34235,25.996354 c 11.906903,0 11.906903,0 11.906903,0"
id="path881-0"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:none;stroke:#0070e9;stroke-width:1.30000007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 20.342252,34.998354 c 11.906903,0 11.906903,0 11.906903,0"
id="path881-1"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer10"
inkscape:label="string_hor_left"
style="display:inline"
transform="translate(0,-12)"
sodipodi:insensitive="true">
<path
style="fill:none;stroke:#000000;stroke-width:1.3499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 11.944723,29.207354 5.950272,0.01097 v 0"
id="path927"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.3499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 11.944647,38.169409 5.950457,0.01096 v 0"
id="path927-4"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer11"
inkscape:label="string_hor_roght"
style="display:inline"
transform="translate(0,-12)"
sodipodi:insensitive="true">
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 21.101197,29.377405 9.627089,0.01096 v 0"
id="path927-4-3"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 21.103752,31.366501 9.627089,0.01096 v 0"
id="path927-4-3-8"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 21.099609,41.58692 7.342291,0.01096 v 0"
id="path927-4-3-0"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 21.099609,37.350423 9.627089,0.01097 v 0"
id="path927-4-3-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 21.099609,39.455623 7.342463,0.01096 v 0"
id="path927-4-3-6"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer7"
inkscape:label="text"
transform="translate(0,-12)"
style="display:inline">
<flowRoot
xml:space="preserve"
id="flowRoot914-8"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:1.25;font-family:'Arial Unicode MS';-inkscape-font-specification:'Arial Unicode MS';letter-spacing:0px;word-spacing:0px;fill:#c500ab;fill-opacity:1;stroke:#ffffff;stroke-width:2.96764684;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
transform="matrix(0.69531428,0,0,0.82672154,-2.2079422,11.788973)"><flowRegion
id="flowRegion916-5"
style="fill:#c500ab;fill-opacity:1;stroke:#ffffff;stroke-width:2.96764684;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"><rect
id="rect918-0"
width="38.14209"
height="34.674625"
x="3.4674628"
y="-1.8781176"
style="fill:#c500ab;fill-opacity:1;stroke:#ffffff;stroke-width:2.96764684;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill" /></flowRegion><flowPara
id="flowPara920-2"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:21.33333397px;font-family:Arial;-inkscape-font-specification:'Arial Bold';stroke:#ffffff;stroke-width:2.96764684;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill">Rx</flowPara></flowRoot> </g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB