Стартовый пул
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0"/>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="rxnew"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
@@ -0,0 +1,300 @@
|
||||
<?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="tmemorydata_rx_150.svg"
|
||||
inkscape:export-filename="test2.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" />
|
||||
<filter
|
||||
inkscape:label="Apparition"
|
||||
inkscape:menu="Blurs"
|
||||
inkscape:menu-tooltip="Edges are partly feathered out"
|
||||
style="color-interpolation-filters:sRGB"
|
||||
id="filter1434">
|
||||
<feMorphology
|
||||
radius="4"
|
||||
in="SourceGraphic"
|
||||
result="result0"
|
||||
id="feMorphology1428" />
|
||||
<feGaussianBlur
|
||||
in="result0"
|
||||
stdDeviation="8"
|
||||
result="result91"
|
||||
id="feGaussianBlur1430" />
|
||||
<feComposite
|
||||
operator="in"
|
||||
in="SourceGraphic"
|
||||
in2="result91"
|
||||
id="feComposite1432" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="14.138889"
|
||||
inkscape:cx="16.939096"
|
||||
inkscape:cy="18"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer7"
|
||||
showgrid="true"
|
||||
units="px"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="706"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:snap-global="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">
|
||||
<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="mem_basic"
|
||||
style="display:inline"
|
||||
transform="translate(0,-12)"
|
||||
sodipodi:insensitive="true">
|
||||
<rect
|
||||
style="opacity:1;fill:#0060b0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
||||
id="rect840"
|
||||
width="30"
|
||||
height="13.5"
|
||||
x="3"
|
||||
y="32.999985"
|
||||
ry="3.75" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer5"
|
||||
inkscape:label="mem_text"
|
||||
style="display:inline"
|
||||
transform="translate(0,-12)"
|
||||
sodipodi:insensitive="true">
|
||||
<path
|
||||
id="path840"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 16.98984,42.749999 h 2.25 m -2.25,-3 h 2.25 m 0,-3 h -3 v 6"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path845"
|
||||
d="m 7.0276592,42.749999 7.57e-5,-5.999775 2.9999241,3.374775 3,-3.375 v 6"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 22.94712,42.749999 7.6e-5,-5.999775 2.999924,3.374775 3,-3.375 v 6"
|
||||
id="path899"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer4"
|
||||
inkscape:label="arrow"
|
||||
style="display:inline"
|
||||
transform="translate(0,-12)"
|
||||
sodipodi:insensitive="true">
|
||||
<g
|
||||
transform="matrix(0.75,0,0,0.75,0,-741.27158)"
|
||||
id="g103"
|
||||
style="fill:#80b3ff;fill-opacity:1;stroke:#0060b0;stroke-opacity:1">
|
||||
<path
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path905"
|
||||
d="m 32,1010.3622 v 18 l 12,-9 z"
|
||||
style="fill:#80b3ff;fill-opacity:1;fill-rule:evenodd;stroke:#0060b0;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
|
||||
</g>
|
||||
</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: 12 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<fpdoc-descriptions><package name="rxnew"><module name="RxDBGridFooterTools"><element name="TRxDBGridFooterTools"><short>Инструменты управления итоговой строкий RxDBGrid</short>
|
||||
</element><short>Модуль содержит инструменты управления итоговой строкий RxDBGrid</short>
|
||||
</module>
|
||||
</package>
|
||||
</fpdoc-descriptions>
|
@@ -0,0 +1,636 @@
|
||||
{ rxPopupNotifier unit
|
||||
|
||||
Copyright (C) 2005-2018 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 RxPopupNotifier;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, ExtCtrls, Forms, Graphics, Controls, StdCtrls, Buttons;
|
||||
|
||||
type
|
||||
TRxPopupNotifierItem = class;
|
||||
TRxPopupNotifier = class;
|
||||
TRxPopupNotifierState = (rpsInactive, rpsMaximazed, rpsShowing, rpsMinimized);
|
||||
TRxPopupNotifierCorner = (rpcTopLeft, rpcTopRight, rpcBootomLeft, rpcBottomRight);
|
||||
|
||||
TRxPopupNotifierEvent = procedure(Sender:TRxPopupNotifier; AItem:TRxPopupNotifierItem) of object;
|
||||
|
||||
{ TRxNotifierForm }
|
||||
|
||||
TRxNotifierForm = class(TCustomForm)
|
||||
private
|
||||
//FCloseButton:TSpeedButton;
|
||||
FCloseButton:TButton;
|
||||
FCaptionLabel:TLabel;
|
||||
FMessageLabel:TLabel;
|
||||
FTimerLabel:TLabel;
|
||||
FOwnerItem:TRxPopupNotifierItem;
|
||||
procedure CreateCloseButton;
|
||||
procedure CreateCaption(ACaption:string);
|
||||
procedure CreateMessage(AMessage:string);
|
||||
procedure CreateTimerLabel;
|
||||
procedure ButtonCloseClick(Sender: TObject);
|
||||
protected
|
||||
//procedure DoShowWindow; override;
|
||||
public
|
||||
constructor CreateNotifierForm(AOwnerItem:TRxPopupNotifierItem);
|
||||
end;
|
||||
|
||||
{ TRxPopupNotifierItem }
|
||||
|
||||
TRxPopupNotifierItem = class(TCollectionItem)
|
||||
private
|
||||
FActive: boolean;
|
||||
FAutoClose: boolean;
|
||||
FCaption: string;
|
||||
FColor: TColor;
|
||||
FMessage: string;
|
||||
FNotifyForm:TRxNotifierForm;
|
||||
FShowCloseButton: boolean;
|
||||
FShowCloseTimer: boolean;
|
||||
FCloseTime:TDateTime;
|
||||
FState: TRxPopupNotifierState;
|
||||
procedure OnNotifyFormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure SetActive(AValue: boolean);
|
||||
procedure SetColor(AValue: TColor);
|
||||
procedure UpdateCloseLabel;
|
||||
procedure CreateNotifierForm;
|
||||
procedure UpdateFormSizes(var ATop:integer);
|
||||
procedure UpdateFormPosition(var ATop:integer);
|
||||
procedure NotifierClick(Sender: TObject);
|
||||
protected
|
||||
procedure AssignTo(Dest: TPersistent); override;
|
||||
public
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
property State:TRxPopupNotifierState read FState;
|
||||
published
|
||||
property Active:boolean read FActive write SetActive;
|
||||
property Color:TColor read FColor write SetColor default clYellow;
|
||||
property AutoClose:boolean read FAutoClose write FAutoClose default true;
|
||||
property ShowCloseTimer:boolean read FShowCloseTimer write FShowCloseTimer default true;
|
||||
property ShowCloseButton:boolean read FShowCloseButton write FShowCloseButton default true;
|
||||
property Caption:string read FCaption write FCaption;
|
||||
property Message:string read FMessage write FMessage;
|
||||
end;
|
||||
|
||||
{ TNotifierCollection }
|
||||
|
||||
TNotifierCollection = class(TOwnedCollection)
|
||||
private
|
||||
function GetItems(AIndex: Integer): TRxPopupNotifierItem;
|
||||
protected
|
||||
procedure Update(Item: TCollectionItem); override;
|
||||
public
|
||||
constructor Create(AOwner: TPersistent);
|
||||
property Items[AIndex:Integer]:TRxPopupNotifierItem read GetItems; default;
|
||||
end;
|
||||
|
||||
{ TRxPopupNotifier }
|
||||
|
||||
TRxPopupNotifier = class(TComponent)
|
||||
private
|
||||
FActive: boolean;
|
||||
FCloseInterval: Cardinal;
|
||||
FDefaultColor: TColor;
|
||||
FDefNotifierFormHeight: Cardinal;
|
||||
FDefNotifierFormWidth: Cardinal;
|
||||
FItems: TNotifierCollection;
|
||||
FMessageCorner: TRxPopupNotifierCorner;
|
||||
FOnNotifiClick: TRxPopupNotifierEvent;
|
||||
FTimer:TTimer;
|
||||
procedure SetActive(AValue: boolean);
|
||||
procedure SetItems(AValue: TNotifierCollection);
|
||||
procedure UpdateNotifyFormsPositoon;
|
||||
procedure UpdateTimeState;
|
||||
procedure UpdateClosed;
|
||||
procedure NotifyTimerEvent(Sender: TObject);
|
||||
procedure DoNotifiClick(AItem:TRxPopupNotifierItem);
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
function AddNotifyItem(ACaption, AMessage:string):TRxPopupNotifierItem;
|
||||
procedure Clear;
|
||||
function NotifierFormWidth:Cardinal;
|
||||
function NotifierFormHeight:Cardinal;
|
||||
published
|
||||
property Active:boolean read FActive write SetActive default True;
|
||||
property Items:TNotifierCollection read FItems write SetItems;
|
||||
property MessageCorner:TRxPopupNotifierCorner read FMessageCorner write FMessageCorner default rpcBottomRight;
|
||||
property DefaultColor:TColor read FDefaultColor write FDefaultColor default clYellow;
|
||||
property DefNotifierFormWidth:Cardinal read FDefNotifierFormWidth write FDefNotifierFormWidth default 0;
|
||||
property DefNotifierFormHeight:Cardinal read FDefNotifierFormHeight write FDefNotifierFormHeight default 0;
|
||||
property CloseInterval:Cardinal read FCloseInterval write FCloseInterval default 5;
|
||||
property OnNotifiClick:TRxPopupNotifierEvent read FOnNotifiClick write FOnNotifiClick;
|
||||
end;
|
||||
|
||||
implementation
|
||||
uses rxconst, LCLType;
|
||||
|
||||
{ TRxNotifierForm }
|
||||
|
||||
procedure TRxNotifierForm.CreateCloseButton;
|
||||
begin
|
||||
begin
|
||||
//FCloseButton:=TSpeedButton.Create(Self);
|
||||
FCloseButton:=TButton.Create(Self);
|
||||
FCloseButton.Parent:=Self;
|
||||
FCloseButton.AutoSize:=true;
|
||||
FCloseButton.Caption:=' X '; //sClose;
|
||||
FCloseButton.Top:=6;
|
||||
//FCloseButton.Flat:=true;
|
||||
//FCloseButton.Left:=Width - Canvas.TextWidth(FCloseButton.Caption) - 6;
|
||||
FCloseButton.Left:=Width - FCloseButton.Width - 6;
|
||||
{
|
||||
FCloseButton.BorderSpacing.Around:=6;
|
||||
FCloseButton.AnchorSideLeft.Control:=nil;
|
||||
FCloseButton.AnchorSideRight.Control:=Self;
|
||||
FCloseButton.AnchorSideRight.Side:=asrRight;
|
||||
FCloseButton.AnchorSideTop.Control:=Self;}
|
||||
|
||||
FCloseButton.OnClick:=@ButtonCloseClick;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxNotifierForm.CreateCaption(ACaption: string);
|
||||
begin
|
||||
FCaptionLabel:=TLabel.Create(Self);
|
||||
FCaptionLabel.Parent:=Self;
|
||||
FCaptionLabel.BorderSpacing.Around:=6;
|
||||
FCaptionLabel.Align:=alTop;
|
||||
FCaptionLabel.Caption:=ACaption;
|
||||
FCaptionLabel.Font.Style:=FCaptionLabel.Font.Style + [fsBold];
|
||||
FCaptionLabel.OnClick:=@FOwnerItem.NotifierClick;
|
||||
end;
|
||||
|
||||
procedure TRxNotifierForm.CreateMessage(AMessage: string);
|
||||
begin
|
||||
FMessageLabel:=TLabel.Create(Self);
|
||||
FMessageLabel.Parent:=Self;
|
||||
FMessageLabel.WordWrap:=true;
|
||||
FMessageLabel.BorderSpacing.Around:=6;
|
||||
FMessageLabel.Align:=alClient;
|
||||
FMessageLabel.Caption:=AMessage;
|
||||
FMessageLabel.OnClick:=@FOwnerItem.NotifierClick;
|
||||
end;
|
||||
|
||||
procedure TRxNotifierForm.CreateTimerLabel;
|
||||
begin
|
||||
FTimerLabel:=TLabel.Create(Self);
|
||||
FTimerLabel.Parent:=Self;
|
||||
FTimerLabel.Top:=FCaptionLabel.Height+1;
|
||||
FTimerLabel.Align:=alTop;
|
||||
FTimerLabel.BorderSpacing.Around:=6;
|
||||
FTimerLabel.Font.Style:=FTimerLabel.Font.Style + [fsItalic];
|
||||
FTimerLabel.Caption:=' ';
|
||||
FTimerLabel.OnClick:=@FOwnerItem.NotifierClick;
|
||||
end;
|
||||
|
||||
procedure TRxNotifierForm.ButtonCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
(*
|
||||
procedure TRxNotifierForm.DoShowWindow;
|
||||
begin
|
||||
if (ActiveControl = nil) and (not (csDesigning in ComponentState)) and (Parent=nil) then
|
||||
begin
|
||||
// automatically choose a control to focus
|
||||
{$IFDEF VerboseFocus}
|
||||
DebugLn('THintWindow.WMShowWindow ',DbgSName(Self),' Set ActiveControl := ',DbgSName(FindDefaultForActiveControl));
|
||||
{$ENDIF}
|
||||
ActiveControl := FindNextControl(nil, True, True, False); //FindDefaultForActiveControl;
|
||||
end;
|
||||
end;
|
||||
*)
|
||||
constructor TRxNotifierForm.CreateNotifierForm(AOwnerItem: TRxPopupNotifierItem
|
||||
);
|
||||
begin
|
||||
inherited CreateNew(Application);
|
||||
FOwnerItem:=AOwnerItem;
|
||||
//fCompStyle := csHintWindow;
|
||||
end;
|
||||
|
||||
{ TNotifierCollection }
|
||||
|
||||
function TNotifierCollection.GetItems(AIndex: Integer): TRxPopupNotifierItem;
|
||||
begin
|
||||
Result:=TRxPopupNotifierItem(GetItem(AIndex));
|
||||
end;
|
||||
|
||||
procedure TNotifierCollection.Update(Item: TCollectionItem);
|
||||
var
|
||||
FActive: Boolean;
|
||||
i: Integer;
|
||||
begin
|
||||
inherited Update(Item);
|
||||
|
||||
FActive:=false;
|
||||
for i:=0 to Count-1 do
|
||||
if TRxPopupNotifierItem(Items[i]).Active then
|
||||
begin
|
||||
FActive:=true;
|
||||
Break;
|
||||
end;
|
||||
|
||||
TRxPopupNotifier(Owner).FTimer.Enabled:=TRxPopupNotifier(Owner).FActive and FActive;
|
||||
end;
|
||||
|
||||
constructor TNotifierCollection.Create(AOwner: TPersistent);
|
||||
begin
|
||||
inherited Create(AOwner, TRxPopupNotifierItem);
|
||||
end;
|
||||
|
||||
{ TRxPopupNotifierItem }
|
||||
|
||||
procedure TRxPopupNotifierItem.OnNotifyFormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction:=caFree;
|
||||
FNotifyForm:=nil;
|
||||
FState:=rpsInactive;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.SetActive(AValue: boolean);
|
||||
begin
|
||||
if FActive=AValue then Exit;
|
||||
FActive:=AValue;
|
||||
|
||||
if not AValue then
|
||||
begin
|
||||
FState:=rpsInactive;
|
||||
if Assigned(FNotifyForm) then
|
||||
FNotifyForm.Close;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CreateNotifierForm;
|
||||
FState:=rpsMaximazed;
|
||||
end;
|
||||
|
||||
Changed(false);
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.SetColor(AValue: TColor);
|
||||
begin
|
||||
if FColor=AValue then Exit;
|
||||
FColor:=AValue;
|
||||
if Assigned(FNotifyForm) then
|
||||
FNotifyForm.Color:=FColor;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.UpdateCloseLabel;
|
||||
var
|
||||
D, D1: TDateTime;
|
||||
N: Int64;
|
||||
begin
|
||||
if Assigned(FNotifyForm) and FShowCloseTimer then
|
||||
begin
|
||||
D:=Now;
|
||||
if FCloseTime < D then
|
||||
FState:=rpsMinimized
|
||||
else
|
||||
begin
|
||||
// D1:=;
|
||||
N:=Trunc((FCloseTime - D) * SecsPerDay);
|
||||
FNotifyForm.FTimerLabel.Caption:=Format( sCloseAfterSec, [N]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.CreateNotifierForm;
|
||||
var
|
||||
FSaveActiveForm: TForm;
|
||||
begin
|
||||
if Assigned(FNotifyForm) then exit;
|
||||
FSaveActiveForm:=Screen.ActiveForm;
|
||||
FNotifyForm:=TRxNotifierForm.CreateNotifierForm(Self);
|
||||
FNotifyForm.Width:=TRxPopupNotifier(Collection.Owner).NotifierFormWidth;
|
||||
FNotifyForm.Height:=1;
|
||||
|
||||
case TRxPopupNotifier(Collection.Owner).FMessageCorner of
|
||||
rpcTopLeft:
|
||||
begin
|
||||
//TODO : доделать
|
||||
FNotifyForm.Left := 2;
|
||||
FNotifyForm.Top := 2;
|
||||
end;
|
||||
rpcTopRight:
|
||||
begin
|
||||
//TODO : доделать
|
||||
FNotifyForm.Left := Screen.Width - FNotifyForm.Width - 2;
|
||||
FNotifyForm.Top := 2;
|
||||
end;
|
||||
rpcBootomLeft:
|
||||
begin
|
||||
//TODO : доделать
|
||||
FNotifyForm.Left := 2;
|
||||
FNotifyForm.Top := Screen.Height - FNotifyForm.Height - 2;
|
||||
end;
|
||||
rpcBottomRight:
|
||||
begin
|
||||
FNotifyForm.Left:=Screen.Width - FNotifyForm.Width - 2;
|
||||
FNotifyForm.Top:=Screen.Height - FNotifyForm.Height - 2;
|
||||
end;
|
||||
end;
|
||||
|
||||
FNotifyForm.BorderStyle:=bsNone;
|
||||
FNotifyForm.FormStyle:=fsStayOnTop;
|
||||
FNotifyForm.ShowInTaskBar:=stNever;
|
||||
FNotifyForm.Color:=FColor;
|
||||
|
||||
if FShowCloseButton then
|
||||
FNotifyForm.CreateCloseButton;
|
||||
|
||||
FNotifyForm.CreateCaption(FCaption);
|
||||
if FShowCloseTimer then
|
||||
FNotifyForm.CreateTimerLabel;
|
||||
FNotifyForm.CreateMessage(FMessage);
|
||||
|
||||
FNotifyForm.OnClose:=@OnNotifyFormClose;
|
||||
FNotifyForm.Show;
|
||||
|
||||
if Assigned(FSaveActiveForm) then
|
||||
FSaveActiveForm.BringToFront;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.UpdateFormSizes(var ATop: integer);
|
||||
begin
|
||||
if Assigned(FNotifyForm) then
|
||||
begin
|
||||
if (FState = rpsMaximazed) then
|
||||
begin
|
||||
if (TRxPopupNotifier(Collection.Owner).NotifierFormHeight > FNotifyForm.Height) then
|
||||
begin
|
||||
FNotifyForm.Height:=FNotifyForm.Height + 1;
|
||||
case TRxPopupNotifier(Collection.Owner).FMessageCorner of
|
||||
//rpcTopLeft:;
|
||||
//rpcTopRight:;
|
||||
rpcBootomLeft:FNotifyForm.Top:=ATop - FNotifyForm.Height;
|
||||
rpcBottomRight:FNotifyForm.Top:=ATop - FNotifyForm.Height;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FState:=rpsShowing;
|
||||
FCloseTime:=Now + TRxPopupNotifier(Collection.Owner).FCloseInterval / SecsPerDay;
|
||||
end;
|
||||
end
|
||||
else
|
||||
if (FState = rpsMinimized) then
|
||||
begin
|
||||
if (FNotifyForm.Height > 1) then
|
||||
begin
|
||||
FNotifyForm.Height:=FNotifyForm.Height - 1;
|
||||
case TRxPopupNotifier(Collection.Owner).FMessageCorner of
|
||||
//rpcTopLeft:;
|
||||
//rpcTopRight:;
|
||||
rpcBootomLeft:FNotifyForm.Top:=ATop - FNotifyForm.Height;
|
||||
rpcBottomRight:FNotifyForm.Top:=ATop - FNotifyForm.Height;
|
||||
end;
|
||||
end
|
||||
else
|
||||
FState:=rpsInactive;
|
||||
end;
|
||||
|
||||
if TRxPopupNotifier(Collection.Owner).FMessageCorner in [rpcTopLeft, rpcTopRight] then
|
||||
ATop:=ATop + FNotifyForm.Height + 2
|
||||
else
|
||||
ATop:=ATop - FNotifyForm.Height - 2;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.UpdateFormPosition(var ATop: integer);
|
||||
begin
|
||||
if Assigned(FNotifyForm) then
|
||||
begin
|
||||
case TRxPopupNotifier(Collection.Owner).FMessageCorner of
|
||||
rpcTopLeft,
|
||||
rpcTopRight:
|
||||
begin
|
||||
FNotifyForm.Top:=ATop;
|
||||
ATop:=ATop + FNotifyForm.Height + 2;
|
||||
end;
|
||||
rpcBootomLeft,
|
||||
rpcBottomRight:
|
||||
begin
|
||||
FNotifyForm.Top:=ATop - FNotifyForm.Height;
|
||||
ATop:=ATop - FNotifyForm.Height - 2;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.NotifierClick(Sender: TObject);
|
||||
begin
|
||||
TRxPopupNotifier(Collection.Owner).DoNotifiClick(Self);
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifierItem.AssignTo(Dest: TPersistent);
|
||||
begin
|
||||
if Dest is TRxPopupNotifierItem then
|
||||
begin
|
||||
TRxPopupNotifierItem(Dest).FColor:=FColor;
|
||||
TRxPopupNotifierItem(Dest).FAutoClose:=FAutoClose;
|
||||
TRxPopupNotifierItem(Dest).FShowCloseTimer:=FShowCloseTimer;
|
||||
TRxPopupNotifierItem(Dest).FCaption:=FCaption;
|
||||
TRxPopupNotifierItem(Dest).FMessage:=FMessage;
|
||||
TRxPopupNotifierItem(Dest).FShowCloseButton:=FShowCloseButton;
|
||||
end
|
||||
else
|
||||
inherited AssignTo(Dest);
|
||||
end;
|
||||
|
||||
constructor TRxPopupNotifierItem.Create(ACollection: TCollection);
|
||||
begin
|
||||
inherited Create(ACollection);
|
||||
FColor:=TRxPopupNotifier(ACollection.Owner).FDefaultColor;
|
||||
FShowCloseButton:=true;
|
||||
FShowCloseTimer:=true;
|
||||
end;
|
||||
|
||||
{ TRxPopupNotifier }
|
||||
|
||||
procedure TRxPopupNotifier.UpdateNotifyFormsPositoon;
|
||||
var
|
||||
F: TRxPopupNotifierItem;
|
||||
Y, i: Integer;
|
||||
FReposition: Boolean;
|
||||
begin
|
||||
if FMessageCorner in [rpcTopLeft, rpcTopRight] then
|
||||
Y:=2
|
||||
else
|
||||
Y:=Screen.Height - 2;
|
||||
|
||||
FReposition:=false;
|
||||
for i:=FItems.Count - 1 downto 0 do
|
||||
begin
|
||||
F:=FItems.Items[i] as TRxPopupNotifierItem;
|
||||
if F.Active then
|
||||
begin
|
||||
if F.FState in [rpsMaximazed, rpsMinimized] then
|
||||
begin
|
||||
F.UpdateFormSizes(Y);
|
||||
FReposition:=true;
|
||||
end
|
||||
else
|
||||
if F.FState = rpsInactive then
|
||||
FReposition:=true
|
||||
else
|
||||
if FReposition then
|
||||
F.UpdateFormPosition(Y)
|
||||
else
|
||||
begin
|
||||
if FMessageCorner in [rpcTopLeft, rpcTopRight] then
|
||||
Y:=Y + F.FNotifyForm.Height + 2
|
||||
else
|
||||
Y:=Y - F.FNotifyForm.Height - 2;
|
||||
end;
|
||||
|
||||
if Y<0 then
|
||||
Y:=2
|
||||
else
|
||||
if Y>Screen.Height then
|
||||
Y:=Screen.Height - 2;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.UpdateTimeState;
|
||||
var
|
||||
i: Integer;
|
||||
F: TRxPopupNotifierItem;
|
||||
begin
|
||||
for i:=FItems.Count - 1 downto 0 do
|
||||
begin
|
||||
F:=FItems.Items[i] as TRxPopupNotifierItem;
|
||||
if F.Active and (F.State = rpsShowing) and F.ShowCloseTimer then
|
||||
F.UpdateCloseLabel;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.UpdateClosed;
|
||||
var
|
||||
F: TRxPopupNotifierItem;
|
||||
i: Integer;
|
||||
begin
|
||||
for i:=FItems.Count - 1 downto 0 do
|
||||
begin
|
||||
F:=FItems.Items[i] as TRxPopupNotifierItem;
|
||||
if F.FState = rpsInactive then
|
||||
F.Active:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.SetItems(AValue: TNotifierCollection);
|
||||
begin
|
||||
FItems.Assign(AValue);
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.SetActive(AValue: boolean);
|
||||
begin
|
||||
if FActive=AValue then Exit;
|
||||
FActive:=AValue;
|
||||
FTimer.Enabled:=false;
|
||||
if not FActive then
|
||||
Clear;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.NotifyTimerEvent(Sender: TObject);
|
||||
begin
|
||||
UpdateNotifyFormsPositoon;
|
||||
UpdateClosed;
|
||||
UpdateTimeState;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.DoNotifiClick(AItem: TRxPopupNotifierItem);
|
||||
begin
|
||||
if Assigned(FOnNotifiClick) then
|
||||
FOnNotifiClick(Self, AItem)
|
||||
end;
|
||||
|
||||
constructor TRxPopupNotifier.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FDefaultColor:=clYellow;
|
||||
FCloseInterval:=5;
|
||||
FMessageCorner:=rpcBottomRight;
|
||||
FActive:=true;
|
||||
FItems:=TNotifierCollection.Create(Self);
|
||||
FTimer:=TTimer.Create(Self);
|
||||
FTimer.Enabled:=False;
|
||||
FTimer.Interval:=10;
|
||||
FTimer.OnTimer:=@NotifyTimerEvent;
|
||||
end;
|
||||
|
||||
destructor TRxPopupNotifier.Destroy;
|
||||
begin
|
||||
FTimer.Enabled:=false;
|
||||
FreeAndNil(FItems);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TRxPopupNotifier.AddNotifyItem(ACaption, AMessage: string
|
||||
): TRxPopupNotifierItem;
|
||||
begin
|
||||
Result:=FItems.Add as TRxPopupNotifierItem;
|
||||
Result.Caption:=ACaption;
|
||||
Result.Message:=AMessage;
|
||||
Result.FState:=rpsMaximazed;
|
||||
Result.FColor:=FDefaultColor;
|
||||
Result.Active:=true;
|
||||
end;
|
||||
|
||||
procedure TRxPopupNotifier.Clear;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
function TRxPopupNotifier.NotifierFormWidth: Cardinal;
|
||||
begin
|
||||
if FDefNotifierFormWidth > 0 then
|
||||
Result:=FDefNotifierFormWidth
|
||||
else
|
||||
Result:=Screen.Width div 4;
|
||||
end;
|
||||
|
||||
function TRxPopupNotifier.NotifierFormHeight: Cardinal;
|
||||
begin
|
||||
if FDefNotifierFormHeight > 0 then
|
||||
Result:=FDefNotifierFormHeight
|
||||
else
|
||||
Result:=Screen.Height div 8;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user