Professional Documents
Culture Documents
, , ,
, Win8 WinRT .
, Delphi XE2 , :
BdeDataDatasnapFMXIBMacapiPosixSoapSystemSystem.BindingsSyste
m.GenericsSystem.InternalSystem.MacSystem.WinVclWinapiXml...
, . FireMonkey :
FMX.Ani.pas
FMX.ASE.Importer.pas
FMX.ASE.Lexer.pas
FMX.ASE.Model.pas
FMX.Canvas.D2D.pas
FMX.Canvas.GDIP.pas
FMX.Canvas.Mac.pas
FMX.Colors.pas
FMX.Consts.pas
FMX.Context.DX9.pas
FMX.Context.Mac.pas
FMX.Controls.pas
FMX.DAE.Importer.pas
FMX.DAE.Model.pas
FMX.DAE.Schema.pas
www.DelphiXEbbs.com
www.DelphiXEbbs.com
FireMonkey HD Application :
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;
type
TForm1 = class(TForm)
Button1: TButton; // TButton FMX.Controls
procedure Button1Click(Sender: TObject);
private
www.DelphiXEbbs.com
FMX.Objects :
TShape //
TLine
TRectangle
www.DelphiXEbbs.com
TRectangle, :
{ TRectangle }
public
constructor Create(AOwner: TComponent); override;
published
property Fill;
property Stroke;
property StrokeCap;
property StrokeDash;
property StrokeJoin;
property StrokeThickness;
property XRadius: Single read FXRadius write SetXRadius;
property YRadius: Single read FYRadius write SetYRadius;
property Corners: TCorners read FCorners write SetCorners stored
IsCornersStored;
property CornerType: TCornerType read FCornerType write SetCorne
rType default TCornerType.ctRound;
www.DelphiXEbbs.com
{ TRectangle TShape }
protected
procedure FillChanged(Sender: TObject); virtual;
procedure StrokeChanged(Sender: TObject); virtual;
function GetShapeRect: TRectF;
procedure Painting; override;
procedure AfterPaint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property Fill: TBrush read FFill write SetFill;
property Stroke: TBrush read FStroke write SetStroke;
property StrokeThickness: Single read FStrokeThickness write Set
StrokeThickness stored IsStrokeThicknessStored;
property StrokeCap: TStrokeCap read FStrokeCap write SetStrokeCa
p default TStrokeCap.scFlat;
property StrokeDash: TStrokeDash read FStrokeDash write SetStrok
eDash default TStrokeDash.sdSolid;
property StrokeJoin: TStrokeJoin read FStrokeJoin write SetStrok
eJoin default TStrokeJoin.sjMiter;
property ShapeRect: TRectF read GetShapeRect;
10
11
12
13
14
15
16
www.DelphiXEbbs.com
17
//TPosition
procedure TForm1.Button2Click(Sender: TObject);
var
posObj: TPosition;
begin
posObj := TPosition.Create(TPointF.Create(10, 10));
Rectangle1.Position.Assign(posObj);
posObj.Free;
end;
//TPosition.Point TPointF
procedure TForm1.Button3Click(Sender: TObject);
begin
Rectangle1.Position.Point := TPointF.Create(50, 50);
end;
//TPointF
procedure TForm1.Button4Click(Sender: TObject);
var
ptf: TPointF;
begin
ptf.X := ClientWidth / 2;
ptf.Y := ClientHeight / 2;
ptf.Offset(-Rectangle1.Width / 2, -Rectangle1.Height / 2);
www.DelphiXEbbs.com
18
//TVector , TPosition
procedure TForm1.Button5Click(Sender: TObject);
var
vector: TVector;
begin
vector.X := ClientWidth - Rectangle1.Width;
vector.Y := ClientHeight - Rectangle1.Height;
//
vector.W := 0.0;
Rectangle1.Position.Vector := vector;
end;
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Objects;
www.DelphiXEbbs.com
19
{ Btuuon1 }
end;
end.
www.DelphiXEbbs.com
20
: AA RR GG BB(); TColor , .
HD TRectangle TButton, :
//
procedure TForm1.Button1Click(Sender: TObject);
begin
Rectangle1.Fill.Color := $FFFF0000;
Rectangle1.Fill.Color := claRed;
Rectangle1.Fill.Color := TAlphaColors.Red;
Rectangle1.Fill.Color := TAlphaColorRec.Red;
end;
// TAlphaColor
procedure TForm1.Button2Click(Sender: TObject);
begin
Rectangle1.Fill.Color := MakeColor(0, 0, 255);
// AppendColor()SubtractColor()
end;
// TAlphaColorRec
procedure TForm1.Button3Click(Sender: TObject);
www.DelphiXEbbs.com
21
TAlphaColorRec(C).A := 127; //
Rectangle1.Fill.Color := C;
A := TAlphaColorRec(C).A;
ShowMessageFmt('%x %x %x %x', [A, R, G, B]);
end;
, : .
TRectangleTColorComboBoxTColorPanelTColorPickerTComboColorBoxTColor
Quad , :
// TColorComboBox OnChange
procedure TForm1.ColorComboBox1Change(Sender: TObject);
begin
Rectangle1.Fill.Color := ColorComboBox1.Color;
end;
// TColorPanel OnChange
www.DelphiXEbbs.com
22
// TColorPicker OnChange
procedure TForm1.ColorPicker1Click(Sender: TObject);
begin
Rectangle1.Fill.Color := ColorPicker1.Color;
end;
// TComboColorBox OnChange
procedure TForm1.ComboColorBox1Change(Sender: TObject);
begin
Rectangle1.Fill.Color := ComboColorBox1.Color;
end;
// TColorQuad HSL()
procedure TForm1.ColorQuad1Change(Sender: TObject);
var
C: TAlphaColor;
begin
C := Rectangle1.Fill.Color;
Rectangle1.Fill.Color := ChangeHSL(C, ColorQuad1.Hue, ColorQuad1.
Sat, ColorQuad1.Lum);
Caption := Format('%f, %f, %f', [ColorQuad1.Hue, ColorQuad1.Sat, C
olorQuad1.Lum]);
end;
www.DelphiXEbbs.com
23
Fill
: TBrush;
//
Stroke
: TBrush;
//()
StrokeThickness : Single;
//()
StrokeCap
: TStrokeCap;
//, TStrokeCap ()
StrokeDash
StrokeJoin
ShapeRect
: TRectF;
//()
//
Line3.LineType := TLineType.ltLeft;
//
end;
24
//
end;
25
TCalloutRectangle , , .
CalloutWidthCalloutLengthCalloutPositionCalloutOffset
.
www.DelphiXEbbs.com
26
TText :
{ }
Text
: string;
//
Font
: TFont;
//
Fill
: TBrush;
//
HorzTextAlign : TTextAlign; //
VertTextAlign : TTextAlign; //
AutoSize
: Boolean;
//
Stretch
: Boolean;
//
WordWrap
: Boolean;
//
{ }
Realign; //
www.DelphiXEbbs.com
27
{ }
Family : TFontName;
//
Size
: Single;
//
Style
: TFontStyles; //
Text1.Font.Family := '';
Text1.Font.Size := 32;
Text1.Font.Style := [TFontStyle.fsBold, TFontStyle.fsUnderline];
Text1.Fill.Color := claRed;
Text1.Stretch := True;
end;
{ }
www.DelphiXEbbs.com
28
: TBitmap;
: TBounds;
//
//
retchiwTile()
DisableInterpolation : Boolean;
//()
TImageViewerTImageControl TImage .
TImageViewer TScrollBox, ;
TImageControl TStyledControl, .
//Bitmap
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
Image1.Bitmap.LoadFromFile(OpenDialog1.FileName);
ImageControl1.Bitmap.LoadFromFile(OpenDialog1.FileName);
ImageViewer1.Bitmap.LoadFromFile(OpenDialog1.FileName);
end;
end;
//WrapMode
procedure TForm1.Button2Click(Sender: TObject);
begin
www.DelphiXEbbs.com
29
//BitmapMargins
procedure TForm1.Button3Click(Sender: TObject);
begin
with Image1.BitmapMargins do
begin
Left := Left + 10;
end;
Image1.Bitmap.BitmapChanged; //
end;
//DisableInterpolation
procedure TForm1.Button4Click(Sender: TObject);
begin
Image1.DisableInterpolation := not Image1.DisableInterpolation;
Image1.Bitmap.BitmapChanged;
end;
{ }
www.DelphiXEbbs.com
30
//
Clear();
//,
ClearRect();
//,
BitmapChanged();
//
IsEmpty();
//
UpdateHandles();
// Handles
AddFreeNotify();
//;
Handles
RemoveFreeNotify();
//; Handles
Rotate();
//
FlipHorizontal();
//
FlipVertical();
//
InvertAlpha();
//,
FillColor();
//,
CreateMask();
//; TBitmap
,
ApplyMask();
//, CreateMask()
CreateThumbnail();
//
LoadFromFile();
//
LoadFromStream();
//
LoadThumbnailFromFile(); //
SaveToFile();
www.DelphiXEbbs.com
//
31
//
HandleRemove();
// Handles ,
HandleAdd();
// Handles
HandleExists();
// Handles
{ }
Width
: Integer;
//
Height
: Integer;
//
Handles[AItem: Pointer]
: Pointer;
// Handles
, ; HandleAdd();
HandlesNeedUpdate[AItem: Pointer] : Boolean;
// Handles
Canvas
Pixels[X, Y: Integer]
: TCanvas;
: TAlphaColor;
//
//
ScanLine[Y: Integer]
: PAlphaColorArray; //
StartLine
: PAlphaColorArray; //
ResourceBitmap
: TBitmap;
//
StyleLookup
: string;
//
, TBitmap
{ }
www.DelphiXEbbs.com
32
Create()SetSize()Clear()IsEmpty():
Rotate()FlipHorizontal()FlipVertical():
33
FillColor():
Image1.Bitmap.FillColor($FF0000FF);
end;
CreateMask()ApplyMask():
34
bitAs := bit.CreateMask;
Image1.Bitmap.Clear(claBlue);
Image1.Bitmap.ApplyMask(bitAs);
bit.Free;
end;
StartLine: , , .
35
//
procedure TForm1.Button1Click(Sender: TObject);
var
bit: TBitmap;
bts: PAlphaColorArray;
i: Integer;
j: Integer;
begin
bit := TBitmap.Create(0, 0);
bit.Assign(Image1.Bitmap);
bts := bit.StartLine;
for i := 0 to bit.Width - 1 do
for j := 0 to bit.Height - 1 do
TAlphaColorRec(bts[i*j]).A := TAlphaColorRec(bts[i*j]).A div 2;
//,
Image1.Bitmap.Assign(bit);
bit.Free;
end;
Pixels[X, Y: Integer]:
36
Handles : TBitmap , .
www.DelphiXEbbs.com
37
www.DelphiXEbbs.com
38
System.Types , FM .
TPoint:
Create();
//
{}
Equal;
// =
NotEqual;
// <>
Add;
// +
Subtract;
// -
Implicit;
// TSmallPoint TPoint
Explicit;
// TSmallPoint
{}
Distance();
//
SetLocation(); //
Offset();
//
Add();
//
www.DelphiXEbbs.com
39
//
IsZero();
// [0,0]
{}
X,Y: Longint;
{ }
procedure TForm1.Button1Click(Sender: TObject);
var
p1,p2,p3: TPoint;
begin
p1 := TPoint.Create(11, 22);
p2.Create(11, 11);
p3 := p1 + p2;
ShowMessageFmt('%d,%d', [p3.X, p3.Y]); //22,33
p3.SetLocation(0, 0);
p3 := p1.Add(p2);
ShowMessageFmt('%d,%d', [p3.X, p3.Y]); //22,33
end;
TPointF: TPoint :
Ceiling();
//
Truncate(); //
Round();
//
40
1,1
%d,%d
1,2
end;
TSmallPoint: , .
Create();
//
{}
Equal;
// =
NotEqual;
// <>
Add;
// +
Subtract;
// -
{}
Add();
//
Subtract(); //
Distance(); //
IsZero();
// [0,0]
{}
X,Y: SmallInt;
TSize:
Create();
//
{}
www.DelphiXEbbs.com
41
// =
NotEqual;
// <>
Add;
// +
Subtract;
// -
{}
Add();
//
Subtract(); //
Distance(); //
IsZero();
// [0,0]
{}
Width;
//
Height;
//
{}
cx,cy: Single;
TRect:
Create();
//; NormalizeRect()
{}
Equal;
// =
NotEqual;
// <>
Add;
// + ()
Multiply;
// * ()
{}
Empty;
// TRect ;
Intersect;
//
www.DelphiXEbbs.com
42
//
{}
NormalizeRect();
.
IsEmpty();
//
Contains();
//
IntersectsWith(); //
Intersect();
//
Union();
//
Offset();
//
SetLocation();
//
Inflate();
//()
CenterPoint();
//
SplitRect();
{}
Width: Integer;
//
Height: Integer;
//
Size: TSize;
//
Location: TPoint; //
{, }
(Left, Top, Right, Bottom: Longint) (TopLeft, BottomRight: TPoin
t)
www.DelphiXEbbs.com
43
Ceiling();
//
Truncate(); //
Round();
//
{ function }
EqualRect();
// TRect TRectF
Rect();
// TRect
RectF();
// TRectF
// TRectF
RectWidth();
//
RectHeight();
//
RectCenter();
//
Bounds();
//
Point();
// TPoint
PointF();
// TPointF
MinPoint();
//( Y)
ScalePoint();
//
SmallPoint();
// TSmallPoint
PtInRect();
//
www.DelphiXEbbs.com
44
//
IntersectRect();
//
UnionRect();
//
IsRectEmpty();
//
OffsetRect();
//
CenterPoint();
//
SplitRect();
//
CenteredRect();
//;
IntersectRectF(); //
UnionRectF();
//
{ procedure }
MultiplyRect();
//
InflateRect();
//
HD TRectangle ...
45
, :
www.DelphiXEbbs.com
46
//
{}
AniIndicator1.Style := TAniIndicatorStyle.aiCircular;
? , FAni: TFloatAnimation; .
TFloatAnimat ion TAnimation; TAnimation FMX.Types ,
.
TAnimation FMX.Ani :
TFloatAnimation
//
TFloatKeyAnimation
//
TColorAnimation
//
TColorKeyAnimation
//
TGradientAnimation
//
TPathAnimation
//
TRectAnimation
//
TBitmapAnimation
//
TBitmapListAnimation //
TFloatKeyAnimation
//
TColorKeyAnimation
//
TFmxObject(FMX ):
StartAnimation();
//
StopAnimation();
//
StartTriggerAnimation();
//
StartTriggerAnimationWait(); //
StopTriggerAnimation();
www.DelphiXEbbs.com
//
47
//
AnimateColor();
//
AnimateFloatDelay();
//
AnimateFloatWait();
//
StopPropertyAnimation();
//
FMX.Types ():
InterpolateSingle();
//
InterpolateRotation(); //
InterpolateColor();
//
InterpolateLinear();
//
InterpolateSine();
//
InterpolateQuint();
//
InterpolateQuart();
//
InterpolateQuad();
//
InterpolateExpo();
//
InterpolateElastic();
//
InterpolateCubic();
//
InterpolateCirc();
//
InterpolateBounce();
//
InterpolateBack();
//
, , :
//Bitmap :
Create New TBitmapAnimation
Create New TBitmapListAnimation
//Color :
Create New TColorAnimation
www.DelphiXEbbs.com
48
//Gradient :
Create New TGradientAnimation
//WidthHeightXYStrokeThicknessXRadiusYRadiusOpacityRot
ationAngle :
Create New TFloatAnimation
Create New TFloatKeyAnimation
FloatAnimation1 :
//, :
procedure TForm1.FormCreate(Sender: TObject);
begin
FloatAnimation1.Enabled := True;
FloatAnimation1.Loop := True;
FloatAnimation1.Duration := 2.5;
//()
FloatAnimation1.StartValue := 0;
//
FloatAnimation1.StopValue := 360; //
end;
www.DelphiXEbbs.com
49
var
rect: TRectangle;
procedure TForm1.FormCreate(Sender: TObject);
begin
rect := TRectangle.Create(Self);
rect.Parent := Self;
rect.Align := TAlignLayout.alCenter;
with TFloatAnimation.Create(Self) do
begin
Parent := rect;
PropertyName := 'RotationAngle';
Enabled := True;
Loop := True;
Duration := 2.5;
StartValue := 0;
StopValue := 360;
end;
end;
www.DelphiXEbbs.com
50
protected
function NormalizedTime: Single;
//
//
//
public
procedure Start; virtual;
//
//
//; Pause
OnFinish
procedure StartTrigger(...); virtual; //, Trig
gerTriggerInverse
procedure ProcessTick(...);
//,
ProcessAnimation .
property Running: Boolean ...;
//;
//
published
property AnimationType: TAnimationType ...;
//;
(Interpolation)
property AutoReverse: Boolean ...;
//(->
->)
www.DelphiXEbbs.com
51
//
//
//();
0.2
property Interpolation: TInterpolationType ...; //;
()
property Inverse: Boolean ...;
//(->
)
property Loop: Boolean ...;
property Trigger: TTrigger ...;
//
//;
()
property TriggerInverse: TTrigger ...;
//
; ()
property OnProcess: TNotifyEvent ...;
//
//
end;
{ TriggerTriggerInverse : }
'IsMouseOver=true'
'IsMouseOver=false'
'IsFocused=true'
'IsFocused=false'
'IsVisible=true'
'IsVisible=false'
'IsDragOver=true'
www.DelphiXEbbs.com
52
TFloatAnimation ;
TColorAnimation ;
TGradientAnimation ;
TRectAnimation (PaddingMargins); ():
StartValue
//
StopValue
//
StartFromCurrent //
PropertyName
//; ()
{ PropertyName : }
'Width'
'Heigth'
'StrokeThickness'
'Position.X'
'Position.Y'
'Scale.X'
'Scale.Y'
'RotationCenter.X'
'RotationCenter.Y'
'RotationAngle'
'Opacity'
'Margins.Left'
'Margins.Top'
'Margins.Rigth'
'Margins.Bottom'
www.DelphiXEbbs.com
53
TFloatKeyAnimationTColorKeyAnimation Keys (
), :
Keys
)TKey.Key()
PropertyName
//
StartFromCurrent //
TBitmapAnimation ; :
StartValue
//
StopValue
//
PropertyName // 'Bitmap'
www.DelphiXEbbs.com
54
AnimationCount
//
AnimationBitmap //
PropertyName
//
TPathAnimation ; :
: HD TRectangle, TPathAnimation;
:
const
strPath = 'M 3.84500002861023,3.47300004959106 ' +
'C 4.83799982070923,24.6110000610352 26.2040004730225,34.974998
4741211 42.875,30.8320007324219 ' +
'C 69.8730010986328,24.121000289917 82.1620025634766, -9.7609996
7956543 74.6009979248047,-37.4169998168945 ' +
'C 63.992000579834,-76.2160034179688 23.7210006713867,-93.31400
29907227 -9.33600044250488,-80.4909973144531 ' +
'C -52.2709999084473,-63.8380012512207 -70.8339996337891,-8.086
00044250488 -55.2200012207031,37.6059989929199 ' +
'C -35.9000015258789,94.1429977416992 24.3759994506836,118.2809
9822998 73.6240005493164,96.3960037231445 ' +
www.DelphiXEbbs.com
55
{ , TPath, . }
: , .
, , FMXObject , :
56
FMX.Filter
FMX.FilterCatBlur
FMX.FilterCatGeometry
FMX.FilterCatTransition
FMX_FilterCatColor
FMX_FilterCatColorAdjust
FMX_FilterCatComposite
FMX_FilterCatGenerator
FMX_FilterCatStyle
FMX_FilterCatTiles
FMX.FilterCatDistortion
FM 10 :
Blur
//FMX.FilterCatBlur
Geometry
//FMX.FilterCatGeometry
Transition
//FMX.FilterCatTransition
Color
//FMX_FilterCatColor
//FMX_FilterCatComposite
Generator
//FMX_FilterCatGenerator
Style
//FMX_FilterCatStyle
Tiles
//FMX_FilterCatTiles
Distortion
//FMX.FilterCatDistortion
{ Blur }
www.DelphiXEbbs.com
57
58
www.DelphiXEbbs.com
59
: TGaussianBlurFilter
: GaussianBlur
: An effect that GaussianBlurs.
: BlurAmount
: The GaussianBlur factor.
: vtFloat
: 1
: .01
: 1
: 10
//-----------------------------------------------: TBlurFilter
: BoxBlur
: An effect that blurs.
: BlurAmount
: The blur factor.
: vtFloat
: 1
: .01
: 1
www.DelphiXEbbs.com
60
: Angle
: The direction of the blur (in degrees).
: vtFloat
: 0
: 0
: 0
: 360
: BlurAmount
: The scale of the blur (as a fraction of the input size).
: vtFloat
: 1
: .01
: 1
: 10
//-----------------------------------------------: TZoomBlurFilter
: RadialBlur
www.DelphiXEbbs.com
61
: Center
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: BlurAmount
: The scale of the blur (as a fraction of the input size).
: vtFloat
: 1
: .01
: 1
: 10
//-----------------------------------------------: TAffineFilter
: AffineTransform
: Applies an affine transform to an image.
: Center
: The center point of the rotation.
www.DelphiXEbbs.com
62
: Rotation
: Rotation angle in degrees.
: vtFloat
: 0
: -180
: 0
: 180
: Scale
: Scale value as floating.
: vtFloat
: 1
: .05
: 1
: 4
//-----------------------------------------------: TPerspectiveFilter
: PerspectiveTransform
www.DelphiXEbbs.com
63
: TopLeft
: Top left point of result transformation.
: vtPoint
: fxpoint 0:0
: fxpoint 0:0
: fxpoint 0:0
: fxpoint 65535:65535
: TopRight
: Top right point of result transformation.
: vtPoint
: fxpoint 300:0
: fxpoint 0:0
: fxpoint 300:0
: fxpoint 65535:65535
: BottomRight
: Bottom right point of result transformation.
: vtPoint
: fxpoint 350:300
: fxpoint 0:0
: fxpoint 350:300
www.DelphiXEbbs.com
64
: BottomLeft
: Bottom left point of result transformation.
: vtPoint
: fxpoint 0:300
: fxpoint 0:0
: fxpoint 0:300
: fxpoint 65535:65535
//-----------------------------------------------: TCropFilter
: Crop
: The size and shape of the cropped image depend on the rectan
gle you specify.
: LeftTop
: Left-top corner of cropping rect
: vtPoint
: fxpoint 0:0
: fxpoint 0:0
: fxpoint 0:0
: fxpoint 65535:65535
: RightBottom
www.DelphiXEbbs.com
65
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Strength
: The amount of twist to the spiral.
: vtFloat
: 1
www.DelphiXEbbs.com
66
: Frequency
: The frequency of the spiral.
: vtFloat
: 20
: 0
: 20
: 100
: Center
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------www.DelphiXEbbs.com
67
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: NumberOfBlinds
: The number of Blinds strips
: vtFloat
: 5
: 2
: 5
: 15
: Target
: The target bitmap.
: vtBitmap
www.DelphiXEbbs.com
68
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: RandomSeed
: The seed value that determines dripiness.
: vtFloat
: .3
: 0
: .3
: 1
: Target
: The target bitmap.
www.DelphiXEbbs.com
69
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: FuzzyAmount
: The fuzziness factor.
: vtFloat
: .1
: 0
: .1
: 1
: Size
www.DelphiXEbbs.com
70
: Center
: The center point of effect.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TMagnifyTransition
: MagnifyTransition
: A transition effect.
: Progress
www.DelphiXEbbs.com
71
: Center
: The center point of effect.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TCrumpleTransition
: CrumpleTransition
: A transition effect.
www.DelphiXEbbs.com
72
: RandomSeed
: The seed value that determines dripiness.
: vtFloat
: 0
: -1
: 0
: 1
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TDissolveTransition
: DissolveTransition
: A transition effect.
www.DelphiXEbbs.com
73
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: RandomSeed
: The seed value that determines dripiness.
: vtFloat
: 0
: -1
: 0
: 1
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TDropTransition
: DropTransition
www.DelphiXEbbs.com
74
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: RandomSeed
: The seed value that determines dripiness.
: vtFloat
: 0
: -1
: 0
: 1
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TFadeTransition
www.DelphiXEbbs.com
75
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TBrightTransition
: BrightTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
www.DelphiXEbbs.com
76
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TPixelateTransition
: PixelateTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Target
: The target bitmap.
: vtBitmap
www.DelphiXEbbs.com
77
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TWiggleTransition
: WiggleTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
www.DelphiXEbbs.com
78
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TShapeTransition
: ShapeTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Target
www.DelphiXEbbs.com
79
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TRotateCrumpleTransition
: RotateCrumpleTransition
: A transition effect.
: Progress
www.DelphiXEbbs.com
80
: RandomSeed
: The seed value that determines dripiness.
: vtFloat
: 0
: -1
: 0
: 1
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TSaturateTransition
: SaturateTransition
: A transition effect.
www.DelphiXEbbs.com
81
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TSlideInTransition
: SlideTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
www.DelphiXEbbs.com
82
: SlideAmount
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint -65535:-65535
: fxpoint 150:150
: fxpoint 65535:65535
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TSwirlTransition
: SwirlTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
www.DelphiXEbbs.com
83
: Strength
: The amount of twist to the spiral.
: vtFloat
: 30
: -70
: 30
: 70
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TWaterTransition
: WaterTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
www.DelphiXEbbs.com
84
: RandomSeed
: The seed value that determines dripiness.
: vtFloat
: .3
: 0
: .3
: 1
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TWaveTransition
: WaveTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
www.DelphiXEbbs.com
85
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TLineTransition
: LineTransition
: A transition effect.
: Progress
: The amount(%) of the transition from first texture to the se
cond texture.
: vtFloat
: 30
: 0
: 30
: 100
: Origin
: The line origin.
www.DelphiXEbbs.com
86
: Normal
: The line normal.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Offset
: The line offset.
: vtPoint
: fxpoint 400:400
: fxpoint 0:0
: fxpoint 400:400
: fxpoint 65535:65535
: FuzzyAmount
: The fuzziness factor.
www.DelphiXEbbs.com
87
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TInvertFilter
: Invert
: An effect that inverts all colors.
//-----------------------------------------------: TMonochromeFilter
: Monochrome
: Remaps colors so they fall within shades of a single color.
//-----------------------------------------------: TColorKeyAlphaFilter
: ColorKeyAlpha
: An effect that makes pixels of a particular color transpare
nt.
: ColorKey
: The color that becomes transparent.
www.DelphiXEbbs.com
88
: Tolerance
: The tolerance in color differences.
: vtFloat
: .3
: 0
: .3
: 1
//-----------------------------------------------: TMaskToAlphaFilter
: MaskToAlpha
: Converts a grayscale image to a white image that is masked b
y alpha.
//-----------------------------------------------: THueAdjustFilter
: HueAdjust
: Changes the overall hue, or tint, of the source pixels.
: Hue
www.DelphiXEbbs.com
89
: Brightness
: The brightness offset.
: vtFloat
: 0
: -1
: 0
: 1
: Contrast
: The contrast multiplier.
: vtFloat
: 1.5
: 0
www.DelphiXEbbs.com
90
: BloomIntensity
: Intensity of the bloom image.
: vtFloat
: 1
: 0
: 1
: 1
: BaseIntensity
: Intensity of the base image.
: vtFloat
: .5
: 0
: .5
: 1
: BloomSaturation
www.DelphiXEbbs.com
91
: BaseSaturation
: Saturation of the base image.
: vtFloat
: .5
: 0
: .5
: 1
//-----------------------------------------------: TGloomFilter
: Gloom
: An effect that intensifies dark regions.
: GloomIntensity
: Intensity of the gloom image.
: vtFloat
: 1
: 0
www.DelphiXEbbs.com
92
: BaseIntensity
: Intensity of the base image.
: vtFloat
: .5
: 0
: .5
: 1
: GloomSaturation
: Saturation of the gloom image.
: vtFloat
: 1
: 0
: 1
: 1
: BaseSaturation
: Saturation of the base image.
: vtFloat
: .5
: 0
www.DelphiXEbbs.com
93
: Target
: The target bitmap.
: vtBitmap
//-----------------------------------------------: TFillFilter
: Fill
: Generates a solid color.
: Color
: The fill color.
: vtColor
: 4280299584
: 0
: 4280299584
: 0
//-----------------------------------------------: TFillOpaqueFilter
www.DelphiXEbbs.com
94
: Color
: The fill color.
: vtColor
: 4280299584
: 0
: 4280299584
: 0
//-----------------------------------------------: TPixelateFilter
: Pixelate
:
: BlockCount
: The number of pixel blocks.
: vtFloat
: 25
: 1
: 25
: 1000
//-----------------------------------------------: TEmbossFilter
www.DelphiXEbbs.com
95
: Amount
: The amplitude of the embossing.
: vtFloat
: .5
: 0
: .5
: 1
: Width
: The separation between samples (as a fraction of input siz
e).
: vtFloat
: 3
: 0
: 3
: 10
//-----------------------------------------------: TSharpenFilter
: Sharpen
: An effect that sharpens the input.
www.DelphiXEbbs.com
96
: Levels
: The number of color levels to use.
: vtFloat
: 5
: 3
: 5
: 15
//-----------------------------------------------: TSepiaFilter
: Sepia
: Sepia effect.
www.DelphiXEbbs.com
97
: Amount
: The amount of sharpening.
: vtFloat
: .5
: 0
: .5
: 1
//-----------------------------------------------: TPaperSketchFilter
: PaperSketch
: An paper sketch effect.
: BrushSize
: The brush size of the sketch effect.
: vtFloat
: 3
: .6
: 3
: 10
//-----------------------------------------------: TPencilStrokeFilter
: PencilStroke
: An pencil stroke effect.
www.DelphiXEbbs.com
98
: BrushSize
: The brush size of the sketch effect.
: vtFloat
: 5
: 1
: 5
: 19
//-----------------------------------------------: TTilerFilter
: Tiler
: Pixel shader tiles the image across multiple rows and colum
ns
: VerticalTileCount
: The number of verical tiles to add to the output. The higher
the value the more tiles.
: vtFloat
: 4
: 0
: 4
: 20
: HorizontalTileCount
www.DelphiXEbbs.com
99
: HorizontalOffset
: Change the horizontal offset of each tile.
: vtFloat
: 0
: 0
: 0
: 1
: VerticalOffset
: Change the vertical offset of each tile.
: vtFloat
: 0
: 0
: 0
: 1
//-----------------------------------------------www.DelphiXEbbs.com
100
: Center
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Amplitude
: The amplitude of the ripples.
: vtFloat
: .1
: 0
: .1
: 1
: Frequency
: The frequency of the ripples.
: vtFloat
: 70
www.DelphiXEbbs.com
101
: Phase
: The phase of the ripples.
: vtFloat
: 0
: -20
: 0
: 20
: AspectRatio
: The aspect ratio (width / height) of the input.
: vtFloat
: 1.5
: .5
: 1.5
: 2
//-----------------------------------------------: TSwirlFilter
: Swirl
: An effect that swirls the input in a spiral.
www.DelphiXEbbs.com
102
: Strength
: The amount of twist to the spiral.
: vtFloat
: 10
: -70
: 10
: 70
: AspectRatio
: The aspect ratio (width / height) of the input.
: vtFloat
: 1.5
: .5
: 1.5
: 2
www.DelphiXEbbs.com
103
: Center
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Radius
: The radius of the magnified region.
: vtFloat
: .25
: 0
: .25
: 1
: Magnification
: The magnification factor.
: vtFloat
www.DelphiXEbbs.com
104
: AspectRatio
: The aspect ratio (width / height) of the input.
: vtFloat
: 1.5
: .5
: 1.5
: 2
//-----------------------------------------------: TSmoothMagnifyFilter
: SmoothMagnify
: An effect that magnifies a circular region.
: Center
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
www.DelphiXEbbs.com
105
: InnerRadius
: The inner radius of the magnified region.
: vtFloat
: .2
: 0
: .2
: 1
: OuterRadius
: The outer radius of the magnified region.
: vtFloat
: .4
: 0
: .4
: 1
: Magnification
: The magnification factor.
: vtFloat
: 2
: 1
: 2
: 5
www.DelphiXEbbs.com
106
: AspectRatio
: The aspect ratio (width / height) of the input.
: vtFloat
: 1.5
: .5
: 1.5
: 2
//-----------------------------------------------: TBandsFilter
: Bands
: An effect that creates bands of bright regions.
: BandDensity
: The number of verical bands to add to the output. The higher
the value the more bands.
: vtFloat
: 65
: 0
: 65
: 150
: BandIntensity
: Intensity of each band.
www.DelphiXEbbs.com
107
: Time
: The moment in time. Animate this value over a long period of
time. The speed depends on the size. The larger the size, the larger
the increase in time on every frame, thus from 0 to 2048 in a smalle
r amount of time.
: vtFloat
: 0
: 0
: 0
: 2048
: WaveSize
: The distance between waves. (the higher the value the clos e
r the waves are to their neighbor).
: vtFloat
www.DelphiXEbbs.com
108
: LeftStart
: Left wrap curve start point
: vtFloat
: 0
: 0
: 0
: 1
: LeftControl1
: Left wrap curve control point 1
: vtFloat
: .25
: 0
: .25
: 1
www.DelphiXEbbs.com
109
: LeftControl2
: Left wrap curve control point 2
: vtFloat
: .25
: 0
: .25
: 1
: LeftEnd
: Left wrap curve end point
: vtFloat
: 0
: 0
: 0
: 1
: RightStart
: Right wrap curve start point
: vtFloat
: 1
: 0
: 1
: 1
www.DelphiXEbbs.com
110
: RightControl1
: Right wrap curve control point 1
: vtFloat
: .75
: 0
: .75
: 1
: RightControl2
: Right wrap curve control point 2
: vtFloat
: .75
: 0
: .75
: 1
: RightEnd
: Right wrap curve end point
: vtFloat
: 1
: 0
: 1
: 1
www.DelphiXEbbs.com
111
: Center
: The center point of the ripples.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
: fxpoint 65535:65535
: Bands
: The number of bands in the swirl.
: vtFloat
: 10
: 0
: 10
: 20
: Strength
: The amount of twist to the spiral.
www.DelphiXEbbs.com
112
: AspectRatio
: The aspect ratio (width / height) of the input.
: vtFloat
: 1.5
: .5
: 1.5
: 2
//-----------------------------------------------: TPinchFilter
: Pinch
: An effect that pinches a circular region.
: Center
: The center point of the pinched region.
: vtPoint
: fxpoint 150:150
: fxpoint 0:0
: fxpoint 150:150
www.DelphiXEbbs.com
113
: Radius
: The radius of the pinched region.
: vtFloat
: .25
: 0
: .25
: 1
: Strength
: The amount of twist to the spiral.
: vtFloat
: 10
: 0
: 10
: 20
: AspectRatio
: The aspect ratio (width / height) of the input.
: vtFloat
: 1.5
: .5
: 1.5
www.DelphiXEbbs.com
114
// FMX.Filter :
procedure FillCategory(AList: TStrings);
procedure FillFiltersInCategory(const Category: string; AList: TStr
ings);
function FilterByName(const AName: string): TFilter;
function FilterClassByName(const AName: string): TFilterClass;
FillCategory():
FillCategory(ListBox1.Items);
FillFiltersInCategory():
FillFiltersInCategory('', ListBox2.Items);
FilterByName():
var
www.DelphiXEbbs.com
115
TFilter FilterAttr():
var
filter: TFilter;
filterRec: TFilterRec; // TFilterRec
begin
filter := FilterByName('');
filterRec := filter.FilterAttr;
{ FilterAttr class , }
filterRec := FilterClassByName('').FilterAttr;
end;
TFilterRec :
TFilterRec = record
Name: string;
//
Desc: string;
//
TShaderValueRec :
www.DelphiXEbbs.com
116
//
Desc: string;
//
//
//
end;
uses System.TypInfo; //
ListBox2.ItemIndex := 0;
ListBox2.OnClick(nil);
www.DelphiXEbbs.com
117
//
filterRec := FilterClassByName(strItem).FilterAttr; //
Memo1.Text :=
118
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Objects;
type
TForm1 = class(TForm)
Image1: TImage;
OpenDialog1: TOpenDialog;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
www.DelphiXEbbs.com
119
120
{: }
procedure TForm1.Button1Click(Sender: TObject);
var
filter: TFilter;
begin
filter := FilterByName('GaussianBlur');
//GaussianBlur
//BlurAmount
filter.Values['BlurAmount'] := 0.25;
, 1(0.1..10)
filter.ValuesAsBitmap['input'] := bit;
//input
,
Image1.Bitmap := filter.ValuesAsBitmap['output']; //output
end;
{: }
procedure TForm1.Button2Click(Sender: TObject);
var
filter: TFilter;
begin
filter := FilterByName('Invert');
//
filter.ValuesAsBitmap['input'] := bit;
Image1.Bitmap := filter.ValuesAsBitmap['output'];
end;
{: }
procedure TForm1.Button3Click(Sender: TObject);
www.DelphiXEbbs.com
121
{: }
procedure TForm1.Button4Click(Sender: TObject);
var
filter: TFilter;
begin
filter := FilterByName('Pixelate');
filter.Values['BlockCount'] := 30; {25 : 1..1000}
filter.ValuesAsBitmap['input'] := bit;
Image1.Bitmap := filter.ValuesAsBitmap['output'];
end;
{: }
procedure TForm1.Button5Click(Sender: TObject);
var
filter: TFilter;
begin
filter := FilterByName('Contrast');
filter.Values['Brightness'] := -0.5; {-1..1}
filter.Values['Contrast']
:= 1.5;
{0..2}
filter.ValuesAsBitmap['input'] := bit;
Image1.Bitmap := filter.ValuesAsBitmap['output'];
end;
{: }
procedure TForm1.Button6Click(Sender: TObject);
www.DelphiXEbbs.com
122
Transition :
uses FMX.Filter;
var
bit1,bit2: TBitmap;
{}
procedure TForm1.FormCreate(Sender: TObject);
var
filter: TFilter;
begin
bit1 := TBitmap.Create(0, 0);
bit2 := TBitmap.Create(0, 0);
bit1.LoadFromFile('C:\Temp\test1.jpg');
bit2.LoadFromFile('C:\Temp\test2.jpg');
www.DelphiXEbbs.com
123
filter := FilterByName('BlindTransition');
filter.Values['Progress'] := 50;
//: 0..100;
, PropertyName := 'Value'
filter.Values['NumberOfBlinds'] := 10; //: 2..15
filter.ValuesAsBitmap['input'] := bit1;
filter.ValuesAsBitmap['target'] := bit2; //target
Image1.Bitmap := filter.ValuesAsBitmap['output'];
Image1.SetBounds(10, 10, bit1.Width, bit1.Height);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
bit1.Free;
bit2.Free;
end;
: TPanel
www.DelphiXEbbs.com
124
{ Panel1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
with TShadowEffect.Create(Self) do
begin
Parent := Panel1;
//
Distance := 3.0;
//
Direction := 45.0;
//
Softness := 0.3;
//
Opacity := 0.6;
//
ShadowColor := claBlack; //
Trigger := 'IsMouseOver=true'; //, TEffec
t , ()
end;
end;
1 AddLang('') , : AddLang('en')AddLang('cn').
2 TStrings , : LangStr['en']LangStr['cn'].
3 LoadFromFile() SaveToFile() (*. lng)
.
4 Lang , Lang := 'cn'.
www.DelphiXEbbs.com
125
:
1 TLang;
2 TRadioButton, ;
3 TButtonTCheckBoxTLabel ;
4 RadioButton1Button1 .
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Objects;
type
TForm1 = class(TForm)
Lang1: TLang;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Button1: TButton;
CheckBox1: TCheckBox;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure RadioButton1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
end;
www.DelphiXEbbs.com
126
{ TLang }
Button1.Text := 'Button';
CheckBox1.Text := 'CheckBox';
Label1.Text := 'Test';
Caption := 'Test';
{}
Lang1.AddLang('en');
Lang1.AddLang('cn');
Lang1.AddLang('big');
{Original: TStrings }
with Lang1.Original do
begin
www.DelphiXEbbs.com
127
{en }
with Lang1.LangStr['en'] do
begin
Add('Button');
Add('CheckBox');
Add('Test');
end;
{}
with Lang1.LangStr['cn'] do
begin
Values['Button'] := '';
Values['CheckBox'] := '';
Values['Test'] := '';
//
Values[Lang1.Original[0]] := '';
//
Values[Lang1.Original[1]] := '';
//
Values[Lang1.Original[2]] := '';
end;
{}
with Lang1.LangStr['big'] do
begin
Values['Button'] := '';
Values['CheckBox'] := '';
www.DelphiXEbbs.com
128
{}
procedure TForm1.RadioButton1Change(Sender: TObject);
begin
case TRadioButton(Sender).Tag of
0: Lang1.Lang := 'en';
1: Lang1.Lang := 'cn';
2: Lang1.Lang := 'big';
end;
end;
{ Resources , TStrings }
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
for i := 0 to Lang1.Resources.Count - 1 do
ShowMessage(TStrings(Lang1.Resources.Objects[i]).Text);
end;
end.
www.DelphiXEbbs.com
129
TFloatAnimation
TFloatKeyAnimat
ion
TGradientAnimati
TFmxO
on
bject
TPathAnimation
TRectAnimation
TBitmapO
bject
TBrushObj
ect
TOpenDialog
TSaveDialog
TPageSetupDialo
TCommon g
Dialog
TPrintDialog
TPrinterSetupDia
log
TCustomP TPopupMenu
www.DelphiXEbbs.com
IItemsContainer
130
TInnerGlowEffect
TImageFXEffect
TImageFXEffect
-> 57
TReflectionEffect
TShadowEffect
TFilterBas TFilterBaseFilter
eFilter
-> 57
TLang
TPathObje
ct
TStyleBoo
k
TTimer
IControl
TCamera
TDummy
TModel3D
TGrid3D
TControl3 TLight
D
TProxyObject
TSelectionPoint3
D
TCone
TShape3D
TCustomMesh
TCube
www.DelphiXEbbs.com
131
TRectangle
3D
TText3D
TStrokeCube
IAlignableObject,
IAlignRoot
TBufferLaye
r3D
IScene,
TAbstractLayer3 TCustomBufferLa
D
yer3D
IContainerObj
TCustomLa
ect
yer3D
TLayer3D
TTextLayer3D
TImage3D
TLayout3D
IControl,
IContainerObjec
TControl
t,
IAlignRoot,
www.DelphiXEbbs.com
132
TScrollContent
TGridLayout
TImage
TCustomBindNav TBindNavig
TLayout
igator
ator
TCustomPath
TPath
TPaintBox
TPlotGrid
TScaledLayout
TSelection
TSelectionPoint
TArc
TEllipse
TCircle
TPie
TShape
TLine
TCalloutRec
TRectangle
tangle
TRoundRect
TText
TAniIndicator
TArcDial
TCalendar
TStyledControl
TColorBox
TColorPanel
TColorPicker
www.DelphiXEbbs.com
133
TBitmapTrack TBWTrack
TTrackBar
Bar
Bar
THueTrac
kBar
TGradientEdit
TImageControl
TImageCell
TCalloutPan
TPanel
el
TPathLabel
TPopup
TProgressC
TProgressBar
ell
www.DelphiXEbbs.com
134
crollBox
IIMENotificatio
TMemo
n
IItemsContain
TCustomGri er
d
TScrollBox
TGrid
TStringGrid
IItemsContain
er
TComboEditLis
TCustomLis tBox
tBox
TComboListBo
x
TColorList
TListBox
Box
IItemsContain
TCustomTr
er
eeView
TTreeView
TSplitter
TStatusBar
www.DelphiXEbbs.com
135
Button
THeaderIt
TCustomBu
em
tton
TExpanderButt
on
TPopupCel
TPopupBox
l
TSpeedButton
TTextControl
TDropTarge
t
TExpander
TGroupBox
TLabel
TListBoxIte
m
TRadioButt
on
TTabItem
IItemsContain
TMenuItem
er
TTreeViewI IItemsContain
www.DelphiXEbbs.com
136
er
TThumb
TToolBar
IIMENotific
ation
TCalendarE
dit
TClearingEd
it
TComboEdi
TCustomEdit
t
TComboTra
ckBar
TEdit
TTextCell
TNumberBo
x
TSpinBox
IItemsCont
TCustomComboB ainer
ox
TColorComboB
TComboBox
ox
IItemsCont
THeader
ainer
IItemsCont
TTabControl
ainer
IMenuView,
TMenuBar
IItemsCon
www.DelphiXEbbs.com
137
ISizeGrip
IViewport3D
TMainMen
IItemsContainer
u
IRoot,
IContainerObjec
t,
TCommon IAlignRoot
CustomFor
m
IScene
TCustomForm
TForm
IViewport3D
TCustomForm3D
TForm3D
TImageFXEffect 57 :
TAffineTransformEffect
TBandedSwirlEffect
TBandedSwirlTransitionEffect
TBandsEffect
TBlindTransitionEffect
TBloodTransitionEffect
TBloomEffect
TBlurTransitionEffect
TBoxBlurEffect
TBrightTransitionEffect
TCircleTransitionEffect
TColorKeyAlphaEffect
TContrastEffect
TCropEffect
TCrumpleTransitionEffect
www.DelphiXEbbs.com
138
139
TFilterBaseFilter 57 :
TFilterAffineTransform
TFilterBandedSwirl
TFilterBandedSwirlTransition
TFilterBands
TFilterBlindTransition
TFilterBloodTransition
TFilterBloom
TFilterBlurTransition
TFilterBoxBlur
TFilterBrightTransition
TFilterCircleTransition
TFilterColorKeyAlpha
TFilterContrast
TFilterCrop
TFilterCrumpleTransition
TFilterDirectionalBlur
TFilterDissolveTransition
TFilterDropTransition
TFilterEmboss
TFilterFadeTransition
TFilterFill
TFilterFillRGB
www.DelphiXEbbs.com
140
141
FMX , , *.style .
XE2 "...\Program Files\Embarcadero\RAD Studio\9.0\Redist\styles\Fmx\"
:
Air.Style
Amakrits.Style
AquaGraphite.style
Blend.Style
dark.style
FMX.Platform.iOS.style
FMX.Platform.Mac.style
FMX.Platform.Win.style
GoldenGraphite.Style
iOS.Style
MacBlue.Style
MacGraphite.Style
RubyGraphite.style
Windows7.Style
, , TStyleBook .
, :
www.DelphiXEbbs.com
142
end;
TStyleBook(StyleBook1), .
StyleBook1 , StyleBook :
StyleBook TStyleBook , :
StyleBook.FileName := '';
//
//StyleBook.Resource.LoadFromFile(''); //TStyleBook Re
source(TStrings)
end;
StyleLookup , :
143
1( T) + 'style' //
2( T)
//
3, , Style
Lookup
4 StyleLookup , StyleName(
StyleName ).
StyleName :
ApplyStyleLookup()UpdateStyle()FindStyleResource() ,
.
(: defaultstyle, : RT_RCDATA),
:
144
Form1.StyleBook := nil;
end;
IInterface,
IInterfaceComp
onentReference
TControlActio
TBasicAction
nLink
TApplication
TBindNavigator
Controller
TO
TPlatformCoco
TPlatform
a
TScreen
TFmxObj
TFmxObject
ect
()
TBindDB
TBasicBindCom
ponent
TCustomBind
CheckLin
TBaseBindDBF TBaseBindDBF DBCheckLink
-> TContainedB
ieldLink
www.DelphiXEbbs.com
ieldControlLink
indComponent
TCustomBind TBindDB
DBEditLink
EditLink
145
TBindDBI
TCustomBind
mageLin
DBImageLink
k
TCustomBind TBindDB
DBListLink
TCustomBind
TBindDBMemo
DBMemoLink
Link
TCustomBind
TBindDBTextLi
DBTextLink
nk
ListLink
ICustomDBGri
d
TBaseBindDBGri
dLink
TBaseBindDB
TCustomBindD TBindDBGrid
GridControlLin
BGridLink
Link
k
TBitmapCodecC
TBitmapCodec
ocoa
TBitmapCodecQ
uartz
TBounds
TCocoaCanvasS
TCanvasSaveSta aveState
te
TQuartzCanvas
SaveState
TShaderFilter
TFilter
TShaderFilter
-> 57
TFont
TGradient
www.DelphiXEbbs.com
146
TListBoxStrings
TWideStrings
TListBoxStrings
TPrinterWin
IInterface
TBrushBitmap
IFreeNotificati
TBrushGrab
on
IFreeNotificati
TBrushResource
on
IFreeNotificati
TInterfacedPersi
on
stent
TCanvasCocoa
TCanvas
TCanvasQuart
z
TPrinterCanva
s
IFreeNotificati
TContext3D
on
www.DelphiXEbbs.com
147
IFreeNotificati
on
TGEBitmap
TGradientPoints
TKeys
TCollection
TBaseDBGridLin TDBGridLinkC
kColumns
olumns
TGradientPoint
TColorKey
TKey
TCollectionItem
TFloatKey
TBaseDBGridLin TDBGridLinkC
kColumn
olumn
TEditActionSta
TList
TOrderedLis
TStack
ck
TSpline
IInterface
TInterfaced
Object
IBindDBGridLin
TBindDBStringGr
kControlManage
idColumnCreator
r
www.DelphiXEbbs.com
148
TBindListStrin
TBindGridEditor
gGridEditor
TBindListCom
boBoxEditor
TBindListListB
oxEditor
IBindCheckBoxE
TBindCheckBoxE ditor
ditor
TBindStateChec
kBoxEditor
TAseModel
TCustomMo
TDAEModel
del
TOBJModel
TGEMateria
TAseMaterial
l
www.DelphiXEbbs.com
149
TShaderFilter 57 :
TAffineFilter
TBandedSwirlFilter
TBandedSwirlTransition
TBandsFilter
TBlindTransition
TBloodTransition
TBloomFilter
TBlurFilter
TBlurTransition
TBrightTransition
TCircleTransition
TColorKeyAlphaFilter
TContrastFilter
TCropFilter
TCrumpleTransition
TDirectionalBlurFilter
TDissolveTransition
TDropTransition
TEmbossFilter
www.DelphiXEbbs.com
150
151
// TrackBar1 Edit1
, FM Data , Variant :
ShowMessage(Edit1.Text);
end;
BindingSource ( TButtonTPanel), (
www.DelphiXEbbs.com
152
{ FindBinding() }
ShowMessage(Self.FindBinding('bn1').ClassName);
ShowMessage(TEdit(FindBinding('bn1')).Text);
{ Bingding[] Data }
Self.Binding['bn1'] := 'NewText';
ShowMessage(Self.Binding['bn1']); //NewText
end;
www.DelphiXEbbs.com
153
TBindingsList (TBindExpression);
TBindExpression ,
.
1 TrackBar1Edit1Label1BindingsList1;
2 TrackBar1 ;
3 TrackBar1.Value Edit1.TextLabel1.Text, ( TrackBar
1 , Edit1Label1 ).
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, Data.Bind.EngEx
t,
Fmx.Bind.DBEngExt, Data.Bind.Components, FMX.Edit;
type
TForm1 = class(TForm)
TrackBar1: TTrackBar;
Edit1: TEdit;
Label1: TLabel;
BindingsList1: TBindingsList;
procedure FormCreate(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
end;
var
www.DelphiXEbbs.com
154
with TBindExpression.Create(BindingsList1) do
begin
ControlComponent := Edit1;
//
ControlExpression := 'Text'; //
SourceComponent := TrackBar1; //
SourceExpression := 'Value'; //
Active := True;
end;
with TBindExpression.Create(BindingsList1) do
begin
ControlComponent := Label1;
ControlExpression := 'Text';
SourceComponent := TrackBar1;
SourceExpression := 'Value';
Active := True;
end;
end;
{ TrackBar1 OnChange }
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
www.DelphiXEbbs.com
155
1 TrackBar1Edit1Label1;
2 Edit1 New LiveBinding...( Strucure Edit1 Object
Inspector LiveBindings );
3 TBindingExpression, : BindExpressionEdit11, ( Binding
sList1 );
4 BindExpressionEdit11, :
ControlComponent : 'Edit1'
ControlExpression: 'Text'
SourceComponent
: 'TrackBar1'
SourceExpression : 'Value'
5 2..4 Label1
6 TrackBar1 OnChange : BindingsList1.Notify(Sender, '');
7.
unit Unit1;
interface
uses
www.DelphiXEbbs.com
156
[TBindings.CreateAssociationScope([Associate(TrackBar1, 'Input1
')])],
'Input1.Value',
[TBindings.CreateAssociationScope([Associate(Edit1, 'Output1
')])],
'Output1.Text',
nil
); // Input1Output1 ,
www.DelphiXEbbs.com
157
Delphi XE2
FireMonkey
TBindExpression.Direction
(24)
TBindingsList:
Edit1Edit2BindingsList1; Edit1Edit2 .
158
Direction := TExpressionDirection.dirSourceToControl; //
//
Direction := TExpressionDirection.dirControlToSource; //
Direction := TExpressionDirection.dirBidirectional;
//
Active := True;
end;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
BindingsList1.Notify(Sender, '');
end;
procedure TForm1.Edit2Change(Sender: TObject);
begin
BindingsList1.Notify(Sender, '');
end;
Direct ion , :
159
, .
TBindingsList.Methods ( System.Bindings.Methods
Data.Bind.EngExt ):
ToStr()
ToVariant()
Round()
www.DelphiXEbbs.com
160
: TLabel .
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, Data.Bind.EngEx
t,
Fmx.Bind.DBEngExt, Data.Bind.Components;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
www.DelphiXEbbs.com
161
; Format , []
Active := True;
www.DelphiXEbbs.com
162
SelfOwner.
TBindExprItems : FormatExpressionsClearExpressions,
.
www.DelphiXEbbs.com
163
:
1TrackBar1 , Value Edit1.Text Edit1.Width Label1.Text;
2, Edit1 "".
: TrackBar1Edit1Label1BindingsList1CheckBox1, TrackBar1
ChengkBox1 :
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, Data.Bind.EngEx
t,
Fmx.Bind.DBEngExt, Data.Bind.Components, FMX.Edit;
type
TForm1 = class(TForm)
TrackBar1: TTrackBar;
Edit1: TEdit;
Label1: TLabel;
BindingsList1: TBindingsList;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure CheckBox1Change(Sender: TObject);
end;
var
Form1: TForm1;
www.DelphiXEbbs.com
164
//
SourceComponent := TrackBar1; //
{ TrackBar1.Value Edit1.Text}
with FormatExpressions.AddExpression do
begin
ControlExpression := 'Text';
SourceExpression := 'Value';
end;
{ TrackBar1.Value Edit1.Width}
with FormatExpressions.AddExpression do
begin
ControlExpression := 'Width';
SourceExpression := 'Value';
end;
{ TrackBar1.Value Label1.Text}
with FormatExpressions.AddExpression do
begin
ControlExpression := 'Owner.Label1.Text'; //Owner
SourceExpression := 'Value';
www.DelphiXEbbs.com
165
// Self ,
SourceExpression := '""';
end;
Active := True;
end;
CheckBox1.IsChecked := True;
TrackBar1.Max := ClientWidth;
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
BindingsList1.Notify(Sender, 'Value');
end;
procedure TForm1.CheckBox1Change(Sender: TObject);
begin
bindExprItems.Active := TCheckBox(Sender).IsChecked;
end;
end.
www.DelphiXEbbs.com
166
Label1Edit1Edit2Edit3BindingsList1BindScope1; Edit1
.
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, Data.Bind.EngEx
t,
Fmx.Bind.DBEngExt, Data.Bind.Components, FMX.Layouts, FMX.Edit;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
BindingsList1: TBindingsList;
BindScope1: TBindScope;
procedure FormCreate(Sender: TObject);
procedure Edit1Change(Sender: TObject);
end;
var
Form1: TForm1;
implementation
www.DelphiXEbbs.com
167
{$R *.fmx}
procedure TForm1.FormCreate(Sender: TObject);
begin
with TBindExpression.Create(BindingsList1) do
begin
ControlComponent := Label1;
ControlExpression := 'Text';
SourceComponent := BindScope1; // BindScope1 ,
www.DelphiXEbbs.com
168
1: Label1Label2ListBox1CheckBox1BindingsList1BindScope1;
2 ListBox1 OnClick .
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, Data.Bind.EngEx
t,
Fmx.Bind.DBEngExt, Data.Bind.Components, FMX.Layouts, FMX.ListBo
x;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
ListBox1: TListBox;
CheckBox1: TCheckBox;
BindingsList1: TBindingsList;
BindScope1: TBindScope;
procedure FormCreate(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
www.DelphiXEbbs.com
169
{$R *.fmx}
//
SourceExpression := 'ListBox1.Selected.Text';
Active := True;
end;
with TBindExpression.Create(BindingsList1) do
begin
ControlComponent := Label2;
ControlExpression := 'Text';
SourceComponent := BindScope1;
SourceExpression := 'CheckedState(CheckBox1)'; //Checked: 'True
'; Unchecked: 'False'; Grayed: ''
//
SourceExpression := 'CheckBox1.IsChecked';
//,
www.DelphiXEbbs.com
170
: Label1Label2 Edit1, .
1: Label1Label2Edit1BindingsList1;
2 Edit1 OnKeyUpOnChange , .
unit Unit1;
interface
uses
www.DelphiXEbbs.com
171
172
www.DelphiXEbbs.com
173
TBindExpression OnAssigningValue .
TBindExpression (TBindExprItemsTBindLinkTBindListLinkTBindGridLink
TBindPositionTBindListTBindGridListTBindDBEditLinkTBindDBTextLinkTBindDBList
LinkTBindDBImageLinkTBindDBMemoLinkTBindDBCheckLinkTBindDBGridLink)
.
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants, FMX.Types,
FMX.Controls, FMX.Forms, FMX.Dialogs, Data.Bind.EngExt, Fmx.Bind.
DBEngExt, System.Rtti,
System.Bindings.Outputs, FMX.Layouts, Data.Bind.Components, FMX.E
dit;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
www.DelphiXEbbs.com
174
www.DelphiXEbbs.com
175
DataSource1
: TDataSource;
ClientDataSet1 : TClientDataSet;
Label1
: TLabel;
Edit1
: TEdit;
Memo1
: TMemo;
ImageControl1
: TImageControl;
BindNavigator1 : TBindNavigator;
{, }
BindingsList1
: TBindingsList;
BindScopeDB1
: TBindScopeDB;
DBLinkLabel1SpeciesNo1
: TBindDBTextLink;
DBLinkEdit1Category1
: TBindDBEditLink;
DBLinkMemo1Notes1
: TBindDBMemoLink;
DBLinkImageControl1Graphic1 : TBindDBImageLink;
www.DelphiXEbbs.com
176
3 biolife.xml :
Label1
Edit1
(stri
(Tex
ng)
Memo1
t)
ImageControl -> -> Link To DB Field... -> Graphic
(Gra
phics)
www.DelphiXEbbs.com
177
():
DataSource1
: TDataSource;
ClientDataSet1 : TClientDataSet;
Label1
: TLabel;
Edit1
: TEdit;
Memo1
: TMemo;
ImageControl1
: TImageControl;
BindNavigator1 : TBindNavigator;
BindingsList1
: TBindingsList;
BindScopeDB1
: TBindScopeDB;
178
TStringGrid :
www.DelphiXEbbs.com
179
, .
:
1: ListBox1Button1Button2
2: Button1.OnClickButton2.OnClickForm1.OnCreate
www.DelphiXEbbs.com
180
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Layouts, FMX.
ListBox;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
{ ListBox1 }
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
www.DelphiXEbbs.com
181
{ ListBox1}
procedure TForm1.Button1Click(Sender: TObject);
const
path = 'c:\temp\ListBox1Stream.txt';
var
stream: TFileStream;
begin
{1}
stream := TFileStream.Create(path, fmCreate);
ListBox1.SaveToStream(stream);
stream.Free;
{2}
ListBox1.Clear;
ShowMessage('a');
{3}
stream := TFileStream.Create(path, fmOpenRead);
ListBox1.LoadFromStream(stream);
stream.Free;
end;
{}
procedure TForm1.Button2Click(Sender: TObject);
const
path = 'c:\temp\Form1Stream.dat';
var
stream: TFileStream;
begin
www.DelphiXEbbs.com
182
:
1: Button1Button2Panel1; Panel1 TCheckBox
2: Button1.OnClickButton2.OnClickForm1.OnCreateForm1.OnDestroy
unit Unit1;
interface
uses
www.DelphiXEbbs.com
183
www.DelphiXEbbs.com
184
{ CheckBox }
procedure TForm1.Button1Click(Sender: TObject);
begin
Panel1.SaveToStream(stream);
ShowMessage(IntToStr(stream.Size));
Button2.Enabled := True;
end;
{}
procedure TForm1.Button2Click(Sender: TObject);
begin
stream.Position := 0;
Panel1.LoadFromStream(stream);
end;
end.
Clone() , CloneChildFromStream() (,
).
185
{ ListBox1 Panel1}
procedure TForm1.Button1Click(Sender: TObject);
begin
Panel1.AddObject(ListBox1.Clone(Self));
end;
ChildrenCountChildren[] ControlCountControls[].
Children : AddObject()InsertObject()RemoveObject()Exchange()D
eleteChildren()
Index Children , ;
SendToBack()BringToFront() Index .
Root , SetRoot() .
IRoot , Root , :
186
Stored Stored , .
(Binding ), , .
, TRectangle :
uses FMX.Objects;
procedure TForm1.Button1Click(Sender: TObject);
begin
(Self.Children[0] as TRectangle).Fill.Color := claRed; //,
Children[0] , (Index)
ShowMessage(Children[0].ToString); //TRectangle
www.DelphiXEbbs.com
187
FMX 8 , VCL 40 .
8 , , :
MouseDownMouseUpMouseMoveMouseLeaveMouseWheelDragDropDragEnter
DragOverDragLeaveKeyDownKeyUp .
, .
: MouseMove :
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;
type
TForm1 = class(TForm)
private
public
{ TForm1 -> Ctrl+ -> MouseM... -> -> Shift+C
trl+C }
procedure MouseMove(Shift: TShiftState; X: Single; Y: Single); o
verride;
end;
www.DelphiXEbbs.com
188
{ TCommonCustomForm }
public
constructor Create(...); override;
//
//
//,
//
189
//
//
{ children }
function ObjectAtPoint(...): IControl; virtual; //
{ called from Platform }
procedure SetMarkedText(...); virtual; //,
;
procedure PaintRects(...); virtual;
//(); TC
ustomForm
procedure MouseDown(...); virtual;
//
//...
//...
//...
//...
//
//...
procedure Activate;
//
procedure Deactivate;
//
//
//...
//...
//...
procedure EnterMenuLoop;
// TMenuBar StartMe
nuLoop
www.DelphiXEbbs.com
190
//
//
//...
// OnCloseQuery
//
procedure Release;
//
procedure Close;
//
procedure Show;
//
procedure Hide;
//
//
procedure CloseModal;
// OnCloseQueryOnClose
procedure Invalidate;
//
procedure BeginUpdate;
//
procedure EndUpdate;
//
//
//
//
{ IRoot }
property Captured: IControl ...;
//
//
www.DelphiXEbbs.com
191
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//(
)
property OnCreate: TNotifyEvent ...;
//
//
www.DelphiXEbbs.com
192
//
//
//
//
//
published
property Left: Integer ...; //
property Top: Integer ...;
//
end;
{ TCustomForm }
public
constructor Create(...); override;
//
//
// Form,
//
procedure UpdateStyle;
//
//
//
//
//
193
//
end;
{ TControl }
public
constructor Create(...); override;
//
//
//
//
//
//
//...
//
//...
//...
//...
//...
//...
// Bitmap
procedure ShowCaretProc;
www.DelphiXEbbs.com
//
194
//
procedure SetCaretSize(...);
//
procedure SetCaretColor(...);
//
procedure HideCaret;
//
//
//
procedure ApplyEffect;
//
//DoPaint
//
//DoPaint
procedure UpdateEffects;
//
procedure SetFocus;
//
procedure PaintTo(...);
// Canvas
procedure Repaint;
//
procedure InvalidateRect(...);
procedure Lock;
//
//
//
//
//
//
//
www.DelphiXEbbs.com
195
//
//?
//
//
//?
//
//
//
//;
, (0,0,Width,Height)
property ParentedRect: TRectF ...;
//
//
//
//
//
// MouseDown
//
//
//Tab
196
//
//
//; , SetFo
cus()
property IsVisible: Boolean ...;
//; Visible,
//
//
//
//
//
//
//
//; Lock()
//
//
//
//
//: 0..1
//?
// Hint
www.DelphiXEbbs.com
197
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//SetFocus()
//
//
//
//
//
//()
//
www.DelphiXEbbs.com
198
//
//
//
//
PopupMenu .
, PopupMenu ;
TPanel TRectangle:
TPopupMenu Popup() :
www.DelphiXEbbs.com
199
Popup() ( TRectangle):
www.DelphiXEbbs.com
200
Rectangle1PopupMenu1.
201
202
203
204
():
205
206
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Menus, FMX.O
bjects;
www.DelphiXEbbs.com
207
208
TVertScrollBox TScrollBox .
TFramedScrollBoxTFramedVertScrollBox , .
{ TScrollBox }
public
constructor Create(...); override;
//
//
//
//
//
//
//
//
//
209
//
procedure InViewRect(...);
//
//
//
//
; True
property Animated: Boolean ...;
//; Tru
e
property DisableMouseWheel: Boolean ...;
//;
False,
property MouseTracking: Boolean ...;
//(
, ); False
property ShowScrollBars: Boolean ...;
//; True
// Grip(
); False
property UseSmallScrollBars: Boolean ...; //
end;
www.DelphiXEbbs.com
210
1 TScrollBox , :
Memo1.UseSmallScrollBars := True;
2, (UnDo).
3 TCaretPosition ,
ComposeCaretPos().
TCaretPosition = record
Line, Pos: Integer;
end;
www.DelphiXEbbs.com
211
Memo1.CharCase := TEditCharCase.ecUpperCase;
5 AutoSelect .
6 Lines ; UnwrapLines .
Memo1.CharCase := TEditCharCase.ecUpperCase;
7 InsertAfter()DeleteFrom() .
{ TMemo }
public
constructor Create(...); override; //
destructor Destroy; override;
//
procedure CopyToClipboard;
//
procedure PasteFromClipboard;
//
procedure CutToClipboard;
//
procedure ClearSelection;
//
procedure SelectAll;
//
procedure GoToTextEnd;
//
procedure GoToTextBegin;
//
procedure GotoLineEnd;
//
procedure GoToLineBegin;
//
//
//
//
212
//
//TextPosToPos()
//
//
//
//;
//
//
published
property Cursor default crIBeam;
//
//
property DisableFocusEffect;
//
property TabOrder;
//Tab
//
//
property Enabled;
property HideSelection: Boolean ...;
property Lines: TStrings ...;
www.DelphiXEbbs.com
//
//?
//
213
//
//
//
//
//
//
//
//
end;
TListBox TCustomListBox .
:
1(: ShowCheckboxesTListBoxItem.IsChecked)
2()
3TListBoxItem .
{ TCustomListBox }
public
constructor Create(...); override;
www.DelphiXEbbs.com
//
214
//
//
//
procedure SelectAll;
//
procedure ClearSelection;
//
procedure SelectRange(...);
//
//
//
procedure Exchange(...);
//
//
//
//
//
//
//
//
end;
{ TListBox }
published
property StyleLookup;
//
property AllowDrag;
//
www.DelphiXEbbs.com
215
//
//
//
property AlternatingRowBackground; //
property Columns;
property HideSelectionUnfocused;
//; 1
//
property Items;
//
property ItemIndex;
//
property ItemWidth;
//
property ItemHeight;
//
property ListStyle;
cal, lsHorizontal);
property MultiSelect;
//; True , Ct
rl
property Sorted;
//
property ShowCheckboxes;
//; False
property BindingSource;
//
property OnChange;
//
property OnChangeCheck;
//
property OnCompare;
//
property OnDragChange;
//
end;
{ TListBoxItem }
public
constructor Create(...); override; //
property Data: TObject ...;
www.DelphiXEbbs.com
//
216
//
published
property IsChecked: Boolean ...;
//
//
//
property Font;
property StyleLookup;
property Text;
//
//
//
//
property WordWrap;
//
end;
217
DropDownCount //
ItemHeight
//
ItemIndex
//
Items
//
Count
//
www.DelphiXEbbs.com
218
ComboEdit1.Text := 'Text';
end;
TGrid Cells[] , ; :
(Grid1.Columns[Grid1.ColumnIndex].CellControlByRow(Grid1.Selected) as TTextCell).Tex
t
TStringGrid :
{ StringGrid1, }
www.DelphiXEbbs.com
219
{ }
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(StringGrid1.Cells[StringGrid1.ColumnIndex, StringGrid
1.Selected]);
end;
{ TCustomGrid }
public
www.DelphiXEbbs.com
220
//
//
//
//
//
//
//
//
//()
//
//()
//
//
//
published
property StyleLookup;
//
//
//
//;
True
www.DelphiXEbbs.com
221
//
//
//
//; False
property TabOrder;
//
//
property OnGetValue; //
property OnSetValue; //
end;
{ TStringGrid }
public
property Cells[ACol, ARow: Integer]: string ...; //
published
property RowCount;
//
end;
, TTreeView, OnChange :
www.DelphiXEbbs.com
222
223
item := TTreeViewItem.Create(Self);
item.Parent := TreeView1;
item.Text := 'Item1';
item := TTreeViewItem.Create(Self);
item.Parent := TreeView1;
item.Text := 'Item2';
for i := 0 to 19 do
with TTreeViewItem.Create(Self) do
begin
Parent := item;
Text := item.Text + '_' + IntToStr(i+1);
IsChecked := Odd(i);
end;
item.IsExpanded := True;
item := TTreeViewItem.Create(Self);
item.Parent := TreeView1;
item.Text := 'Item3';
end;
procedure TForm1.TreeView1Change(Sender: TObject);
var
item: TTreeViewItem;
begin
item := TreeView1.Selected;
if item <> nil then
begin
ShowMessageFmt(
'TreeView1.GlobalCount: %d'#13#10 +
'TreeView1.Count: %d'#13#10 +
'TTreeViewItem.Count: %d'#13#10 +
'TTreeViewItem.Level: %d'#13#10 +
www.DelphiXEbbs.com
224
{ TCustomTreeView }
public
constructor Create(...); override; //
destructor Destroy; override;
//
//
procedure Clear;
//
procedure ExpandAll;
//
procedure CollapseAll;
//
//
//
//
//
//
//
www.DelphiXEbbs.com
225
//
//
//
//
//
//
//
//???
//
//
//
//
//
//
//
//
//
//
//
//
end;
{ TTreeView }
published
property StyleLookup;
property CanFocus default True;
www.DelphiXEbbs.com
//
//
226
//
property TabOrder;
//
//
//
//
//
//
//
property OnChange;
//
property OnChangeCheck;
//
property OnCompare;
//
property OnDragChange;
//
end;
{ TTreeViewItem }
public
constructor Create(...); override;
procedure Paint; override;
//
//
//
//
//
//
//
// TreeView
//
//
227
//
//
//
//
//
//
FMX : , ; ,
!
:
1TCanvasTBrushTApplication;
2FMX GDI+D2DDirectX;
3FMX 3D;
4XE2 ( TZipFile , ).
, .
; FMX , :
TMemo .
www.DelphiXEbbs.com
228
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, Sy
stem.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Layouts, FMX.
Memo;
type
TForm1 = class(TForm)
Memo1: TMemo; // Memo1
private
public
{ }
procedure DragOver(const Data: TDragObject; const Point: TPointF;
var Accept: Boolean); override;
procedure DragDrop(const Data: TDragObject; const Point: TPoint
F); override;
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
{ TForm1 }
www.DelphiXEbbs.com
229
<>
www.DelphiXEbbs.com
230