Introduction to Delphi xe2 firemonkey (2)

Source: Internet
Author: User
Firemonkey controls are all self-drawn (rather than system components). I think they should be based on some basic graphics. Let's start with the basic graphics.

The class given by the FMX. Objects Unit:

Tshape // The base class category of the basic image

Add a trectangle. Let's take a look at its available functions:

{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 attributes; property cornertype: tcornertype read fcornertype write setcornertype default tcornertype. ctround; property sides: tsides read fsides write setsides stored attributes; {trectangle parent class 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 writable write stored condition; property strokecap: tstrokecap read fstrokecap write setstrokecap default tstrokecap. scflat; property strokedash: tstrokedash read fstrokedash write setstrokedash default tstrokedash. sdsolid; property strokejoin: tstrokejoin read fstrokejoin write setstrokejoin default tstrokejoin. sjmiter; property shaperect: trectf read getshaperect; {tcontrol (from FMX. types)} public constructor create (aowner: tcomponent); override; includestroy; override; Procedure destroy (aobject: tfmxobject); override; Procedure removeobject (aobject: tfmxobject); override; procedure setnewscene (ascene: iscene); Virtual; Procedure setbounds (X, Y, awidth, aheight: single); Virtual; {matrix} function absolutetolocal (P: tpointf): tpointf; virtual; function localtoabsolute (P: tpointf): tpointf; virtual; function absolutetolocalvector (P: tvector): tvector; virtual; function localtoabsolutevector (P: tvector): tvector; virtual; function pointinobject (X, Y: single): Boolean; virtual; {optimizations} procedure enabled; virtual; Procedure recalauthorized edalign; virtual; Procedure recalcopacity; virtual; Procedure recalcabsolute; virtual; Procedure recalcenabled; virtual; Procedure recalchaseffect; virtual; {drag and drop} function makescreenshot: tbitmap; {caret} procedure success; Procedure setcaretpos (const apoint: tpointf); Procedure setcaretsize (const asize: tpointf); Procedure setcaretcolor (const acolor: talphacolor); Procedure success; {Align} procedure beginupdate; virtual; Procedure success; virtual; Procedure realign; virtual; {paining} procedure applyeffect; procedure painting; virtual; Procedure dopaint; virtual; Procedure afterpaint; virtual; {effects} procedure finished; {} procedure setfocus; Procedure paintto (const acanvas: TCanvas; const arect: trectf; const aparent: tfmxobject = nil); Procedure repaint; Procedure invalidaterect (arect: trectf); Procedure lock; property absolutematrix: tmatrix read getabsolutematrix; property usage: single read usage; property solutewidth: single read getabsolutewidth; property absoluteheight: single read getabsoluteheight; property absolutescale: tpointf read getabsolutescale; property absoluteenabled: Boolean read getabsoluteenabled; property haseffect; property failed: Boolean read failed; property childrenrect: trectf read failed; property invertabsolutematrix: tmatrix read failed; property inpaintto: Boolean read finpaintto; property localrect: trectf read getlocalrect; property absoluterect: trectf read getabsoluterect; property updaterect: trectf read getupdaterect; property boundsrect: trectf read writable write failed; property parentedrect: trectf read failed; property parentedvisible: Boolean read failed; property cliprect: trectf read getcliprect; property canvas: TCanvas read getcanvas; property scene: iscene read fscene; property autocapture: Boolean read fautocapture write fautocapture default false; property canfocus: Boolean read fcanfocus write fcanfocus default false; property identifier: Boolean read partition write partition default false; property disabledefaultalign: Boolean read fdisabledefaultalign write fdisabledefaultalign; property taborder: ttaborder read gettaborder write settaborder default-1; published {triggers} property ismouseover: boolean read fismouseover; property isdragover: Boolean read fisdragover; property isfocused: Boolean read fisfocused; property isvisible: Boolean read fvisible; {props} property align: talignlayout read falign write setalign default talignlayout. alnone; property cursor: tcursor read getcursor write setcursor default crdefault; property dragmode: tdragmode read getdragmode write setdragmode default tdragmode. dmmanual; property enabledraghighlight: Boolean read fenabledraghighlight write fenabledraghighlight default true; property enabled: Boolean read fenabled write setenabled default true; property position: tposition read fposition write setposition; property rotationangle: single read frotationangle write setrotationangle; property rotationcenter: tposition read frotationcenter write frotationcenter; property locked: Boolean read flocked write setlocked default false; property width: single read fwidth write setwidth; property height: single read fheight write setheight; property margins: tbounds read fmargins write fmargins; property padding: tbounds read fpadding write fpadding; property opacity: single read fopacity write setopacity stored children; property clipchildren: boolean read fclipchildren write setclipchildren default false; property clipparent: Boolean read fclipparent write fclipparent default false; property hittest: Boolean read fhittest write sethittest default true; property canclip: boolean read fcanclip write fcanclip default true; property popupmenu: writable read writable write setpopupmenu; property scale: tposition read fscale write fscale; property visible: Boolean read fvisible write setvisible default true; property designvisible: boolean read writable write writable default true; property ondragenter: tdragenterevent read fondragenter write fondragenter; property ondragleave: tpolicyevent read fondragleave write fondragleave; property ondragover: tdragoverevent read fondragover write fondragover; property ondragdrop: optional read fondragdrop write fondragdrop; property ondragend: tpolicyevent read fondragend write fondragend; property onkeydown: tkeyevent read fonkeydown write fonkeydown; property onkeyup: tkeyevent read fonkeyup write fonkeyup; property onclick: tpolicyevent read fonclick write fonclick; property ondblclick: tpolicyevent read fondblclick write fondblclick; property oncanfocus: Internal read foncanfocus write foncanfocus; property onenter: tpolicyevent read fonenter write fonenter; property onexit: tpolicyevent read fonexit write fonexit; property onmousedown: tmouseevent read fonmousedown write fonmousedown; property onmousemove: tmousemoveevent read fonmousemove write fonmousemove; property onmouseup: tmouseevent read fonmouseup write fonmouseup; property onmousewheel: tmousewheelevent read fonmousewheel write fonmousewheel; property onmouseenter: tpolicyevent read fonmouseenter write fonmouseenter; property consumed: tpolicyevent read writable write failed; property onpainting: writable read fonpainting write fonpainting; property onpaint: tonpaintevent read fonpaint write fonpaint; property onresize: tpolicyevent read fonresize write fonresize; property Reset: tpolicyevent read writable write fonapplystylelookup; {tcontrol parent class tfmxobject (from FMX. types)} public constructor create (aowner: tcomponent); override; destructor destroy; override; procedure release (delay: single = 0.1); {check for support interface} function isicontrol: Boolean; function asicontrol: iControl; Procedure setroot (aroot: iroot); {design} procedure setdesign (value: Boolean; setchildren: Boolean = true); function itemclass: string; virtual; {clone} function clone (const aowner: tcomponent): tfmxobject; procedure merge (astream: tstream); {Childs} procedure addobject (aobject: tfmxobject); Virtual; Procedure insertobject (Index: integer; aobject: tfmxobject); Virtual; Procedure removeobject (aobject: tfmxobject); overload; virtual; Procedure removeobject (Index: integer); overload; virtual; Procedure Exchange (aobject1, aobject2: tfmxobject); Virtual; Procedure deletechildren; virtual; Procedure bringtofront; Procedure sendtoback; Procedure transaction (const alist: tlist); Procedure sort (compare: tables); Virtual; {policy} procedure addfreenoication (const aobject: ifreenoication ication); Procedure encryption (const aobject: ifreenotification); {tab} procedure gettaborderlist (const list: tlist; achilist: boolean); {I/O} procedure loadfromstream (const astream: tstream); Procedure savetostream (const stream: tstream); Procedure loadfrombinstream (const astream: tstream ); procedure savetobinstream (const astream: tstream); {resource} function findstyleresource (const failed: string): tfmxobject; virtual; Procedure updatestyle; virtual; {animations} procedure startanimation (const aname: string); Virtual; Procedure stopanimation (const aname: string); Virtual; Procedure starttriggeranimation (ainstance: tfmxobject; const atrigger: string); Virtual; Procedure future (ainstance: tfmxobject; const atrigger: string); Virtual; Procedure stoptriggeranimation (ainstance: tfmxobject); Virtual; Procedure applytriggereffect (ainstance: tfmxobject; const atrigger: string); Virtual; {animation property} procedure animatefloat (const apropertyname: string; const newvalue: single; duration :...); procedure animatecolor (const apropertyname: string; newvalue: talphacolor; duration :...); procedure animatefloatdelay (const apropertyname: string; const newvalue: single; duration :...); procedure animatefloatwait (const apropertyname: string; const newvalue: single; duration :...); procedure stoppropertyanimation (const apropertyname: string); {} property root: iroot read Froot; property stored: Boolean read fstored write setstored; {} property tagobject: tobject read ftagobject write ftagobject; property tagfloat: single read ftagfloat write ftagfloat; property tagstring: String read ftagstring write ftagstring; {children} property childrencount: integer read getchildrencount; property children [index: integer]: tfmxobject read getchild; {binding} function findbinding (const abinding: string): tfmxobject; property data: variant read getdata write setdata; property binding [const index: String]: variant read getbinding write setbinding; property parent: tfmxobject read fparent write setparent; Property Index: integer read getindex write setindex; published property bindingname: String read fbindingname write setbindingname; property stylename: String read fstylename write setstylename; {tfmxobject parent class tcomponent (from system. classes), not new here} public constructor create (aowner: tcomponent); Virtual; destructor destroy; override; Procedure beforedestruction; override; Procedure destroycomponents; Procedure destroying; function executeaction (Action: tbasicaction): Boolean; dynamic; function findcomponent (const aname: string): tcomponent; Procedure freenotification (acomponent: tcomponent); Procedure finished (acomponent: tcomponent ); procedure freeonrelease; function compute: component; function getparentcomponent: tcomponent; dynamic; function getnamepath: string; override; function hasparent: Boolean; dynamic; Procedure insertcomponent (acomponent: tcomponent ); procedure removecomponent (acomponent: tcomponent); Procedure setsubcomponent (issubcomponent: Boolean); function compute (partition: tobject; partition: pointer): hresult; override; function updateaction (Action: tbasicaction ): boolean; virtual; function isimplementorof (const I: iinterface): Boolean; function referenceinterface (const I: iinterface; Operation: toperation): Boolean; property comobject: iunknown read getcomobject; property components [index: integer]: tcomponent read getcomponent; property componentcount: integer read getcomponentcount; property componentindex: integer read getcomponentindex write setcomponentindex; property componentstate: tcomponentstate read fcomponentstate; property componentstyle: tcomponentstyle read fcomponentstyle; property designinfo: longint read fdesigninfo write fdesigninfo; Property Owner: tcomponent read fowner; property attributes: pointer read writable write attributes; property observers: writable read getobservers; published property name: tcomponentname read fname write setname stored false; property Tag: nativeint read ftag write ftag default 0; {tcomponent parent class tpersistent (from system. classes)} public destructor destroy; override; Procedure assign (Source: tpersistent); Virtual; function getnamepath: string; dynamic; {tpersistent parent class tobject (from System )} public constructor create; procedure free; Class function initinstance (instance: pointer): tobject; Procedure cleanupinstance; function classtype: tclass; inline; Class function classname: string; class function classnameis (const name: string): Boolean; Class function classparent: tclass; Class function classinfo: pointer; inline; Class function instancesize: longint; inline; Class function inheritsfrom (Aclass: tclass): Boolean; Class function methodaddress (const name: character string): pointer; overload; Class function methodaddress (const name: string): pointer; overload; Class function methodname (Address: pointer): string; Class function qualifiedclassname: string; function fieldaddress (const name: character string): pointer; overload; function fieldaddress (const name: string): pointer; overload; function getinterface (const IID: tguid; out OBJ): Boolean; Class function getinterfaceentry (const IID: tguid): pinterfaceentry; Class function getinterfacetable: pinterfacetable; Class function unitname: string; class function unitscope: string; function equals (OBJ: tobject): Boolean; virtual; function gethashcode: integer; virtual; function tostring: string; virtual; function safecallexception (export tobject: tobject; extends taddr: pointer): hresult; virtual; Procedure afterconstruction; virtual; Procedure beforedestruction; virtual; Procedure dispatch (VAR message); Virtual; Procedure defaulthandler (VAR message); Virtual; class function newinstance: tobject; virtual; Procedure freeinstance; virtual; destructor destroy; virtual;
Digest it slowly...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.