Show: Delphi C++
Display Preferences

__property

From RAD Studio XE3
Jump to: navigation, search

Go Up to Keywords, Alphabetical Listing Index


Category

Keyword Extensions

Syntax

<property declaration> ::=
     __property [ <type> ] <id> [ <prop dim list> ] [ = "{" <prop attrib list> "}" ]

<prop dim list> ::=
     "[" <type> [ <id> ] "]" [ <prop dim list> ]

<prop attrib list> ::=
     <prop attrib> [ , <prop attrib list> ]

<prop attrib> ::=
     read = <data/function id> |
     write = <data/function id> |
     stored = <data/function id> |
     stored = <boolean constant> |
     default = <constant> |
     nodefault |
     index = <const int expression>
     dispid = <const int expression>
     implements = the property is used for implementing an interface

Description

The __property keyword was added to support the VCL.

Examples

__property LONG Bottom  = { read=bottom, write=bottom }; 
__property AnsiString Name[int Index] = {read=GetName}; 
__property int Size = 
    {read=GetSize, write=SetSize, stored=false, nodefault}; 
__property TPenMode Mode = 
    {read=FMode, write=SetMode, default=4}; 
__property TColor Pixels[int X][int Y] = 
    {read=GetPixel, write=SetPixel}; 
__property System::TObject* Data[System::TObject* AItem] = 
    {read=GetData, write=SetData};
__property State  = {default=0}; 
__property OnChange ; 
__property int ExplicitTop = 
    {read=GetControlBound, index=5, nodefault}; 
__property Graphics::TColor Color = 
    {read=FColor, write=SetColor, stored=IsColorStored, default=-16777211}; 
__property BevelInner  = {index=0, default=2}; 
__property IFoo4 *p4 = { read = getFoo4, implements };
__property IPersist* Persist = {read=FPersist, write=FPersist, implements};

See Also

Personal tools
Previous Versions
In other languages