Set data type

See also	Example 	Reference

Use the Set type as defined in INCLUDE\VCL\SYSDEFS.H to define types used as VCL function parameters or VCL function return types.

The Set<type, minval, maxval> template class is a C++ class that implements the Delphi intrinsic type set. You must specify three template parameters:

•	type: the type of the set elements (usually int, char, or an enum type)

•	minval: the minimum value the set can hold (this value cannot be less then 0)

•	maxval: the maximum value the set can hold (this value cannot be greater than 255)

Each instantiation of a Set creates an object based on all three parameters. Therefore, the following are two distinct types:

Set <char, ‘A’, ‘C’> s1;

Set <char, ‘X’, ‘Z’> s2;

if (s1 == s2)   // ERROR; illegal struct.

To create multiple instances of a Set type, use a typedef expression.

typedef Set <char, ‘A’,‘Z’> UPPERCASESet;

The declaration of a Set variable does not initialize the variable. You can declare the set types and initialize by using this syntax.

UPPERCASESet s1() << ‘A’ << ‘B’ << ‘C’;

UPPERCASESet s2() << ‘X’ << ‘Y’ << ‘Z’;


Set

See also

Syntax

template<class T, unsigned char minEl, unsigned char maxEl>

class __declspec(delphireturn) Set;

Public constructor

__fastcall Set();

__fastcall Set(const Set& src);

Public member functions

bool __fastcall Contains(const T el) const;

Set& __fastcall Clear();

Public operators

Set& __fastcall operator =(const Set& rhs);

Set& __fastcall operator +=(const Set& rhs); //Union

Set& __fastcall operator -=(const Set& rhs); //Difference

Set& __fastcall operator *=(const Set& rhs); //Intersection

Set __fastcall operator +(const Set& rhs) const; //Union

Set __fastcall operator -(const Set& rhs) const; //Difference

Set __fastcall operator *(const Set& rhs) const; //Intersection

Set& __fastcall operator <<(const T el); //Add element

Set& __fastcall operator >>(const T el); //Remove element

bool __fastcall operator ==(const Set& rhs) const;

bool __fastcall operator !=(const Set& rhs) const ;


Example

#include <sysdefs.h>

#include <iostream.h>

typedef Set<char,'U','Z'> UpperSet;

typedef Set<char,'a','z'> LowerSet;

typedef Set<char,'a','j'> HalfLowerSet;

void set_example()

{

LowerSet ae, ae2, ac, de;

UpperSet AE, AE2, AC, DE;

HalfLowerSet aj;

// Both of these are false. Sets are empty until members are added.

cout <<"Set ae " << (ae.Contains('a')?"does":"does not") << " contain 'a' " << endl;

cout <<"Set AE " << (AE.Contains('C')?"does":"does not") << " contain 'C' " << endl;

ae  << 'a' << 'b' << 'c' << 'd' << 'e';

ae2 << 'a' << 'b' << 'c' << 'd' << 'e';

ac  << 'a' << 'b' << 'c';

de  << 'd' << 'e';

aj  << 'd' << 'e';

DE  << 'D' << 'E';

cout <<"Now, set ae " << (ae.Contains('a')?"does":"does not") << " contain 'a' " << endl;

// Compiler-time error! Although sets 'de' and 'aj' contain the same members,

// they are different types of sets and cannot be compared.

//cout << (de==aj?" == ":" != ") << endl;

// Sets support operations * (intersection),+ (union) and - (difference).

cout << "Set ae " << (ae==(ac+de)?" == ":" != ") << "set ac + de." << endl;

cout << "Set de " << (de==(ae-ac)?" == ":" != ") << "set ae - ac." << endl;

// Clear member function

cout << "Set ae2: " << ae2 << endl;

ae2.Clear();

cout << "Set ae2: " << ae2 << " after ae2.Clear()" << endl;

// Sets also support operations *= (intersection),+= (union) and -= (difference).

ae2+=ac;

cout << "Union ae2+=ac: Set ae2 " << (ae2==ac?" == ":" != ") << "set ac." << endl;

ae2+=de;

cout << "Union ae2+=de: Set ae2 " << (ae2==ae?" == ":" != ") << "set ae." << endl;

ae2-=ac;

cout << "Difference ae2-=ac: Set ae2 " << (ae2==de?" == ":" != ") << "set de." << endl;

}

int main()

{

   set_example();

return 0;

}


AnsiString data type

See also	Example	Reference

C++Builder implements the AnsiString type as a class. AnsiString is designed to function like the Delphi long  string type. Accordingly, AnsiString provides the following string handling characteristics which are required when you call VCL-type functions that use any of the Delphi long string types.

•	reference count

•	string length

•	data

•	null string terminator

If you don’t provide an initial value, AnsiString variables are zero-initialized upon instantiation.


Example

/* Compile with  bcc32 -DPRONTO_NAMESPACES famille.cpp vcl.lib ole2w32.lib */

#include <vcl/dstring.h>

#include <stdio.h>

class Famille

{

private:

   AnsiString FNames[10];

   AnsiString GetName(int Index);

   void SetName(int, AnsiString);

public:

    __property AnsiString Names[int Index] = {read=GetName, write=SetName};

   Famille(){}

   ~Famille(){}

};

AnsiString Famille::GetName(int i)

{

   return FNames[i];

}

void Famille::SetName(int i,const AnsiString s)

{

   FNames[i]=s;

}

int main()

{

   Famille C;

   C.Names[0]="Steve";   //calls Famille::SetName()

   C.Names[1]="Amy";

   C.Names[2]="Sarah";

   C.Names[3]="Andrew";

   for (int i = 0; i <= 3; i++)

   {

      //calls Famille::GetName()

      puts(C.Names[i].c_str());

   }

}


AnsiString

Syntax

class __declspec(delphireturn) AnsiString

Public constructors

__fastcall AnsiString();

Creates an empty string.

__fastcall AnsiString(const char* src);

__fastcall AnsiString(const AnsiString& src);

__fastcall AnsiString(const char* src, unsigned char len);

__fastcall AnsiString(const wchar_t* src);

__fastcall AnsiString(int src);

__fastcall AnsiString(double src);

Public destructor

__fastcall ~AnsiString();

Public data member

enum TStringFloatFormat {sffGeneral, sffExponent, sffFixed, sffNumber, sffCurrency };

The TStringFloatFormat enum is used by FloatToStrF

Operators

friend AnsiString __fastcall operator +(const char*, const AnsiString& rhs);

static AnsiString __fastcall StringOfChar(char ch, int count);

static AnsiString __fastcall LoadStr(int ident);

static AnsiString __fastcall FmtLoadStr(int ident, const TVarRec *args, int size);

static AnsiString __fastcall Format(const AnsiString& format,const TVarRec *args, int size);

static AnsiString __fastcall FormatFloat(const AnsiString& format,const long double& value);

static AnsiString __fastcall FloatToStrF(long double value, TStringFloatFormat format, int precision, int digits);

static AnsiString __fastcall IntToHex(int value, int digits);

static AnsiString __fastcall CurrToStr(Currency value);

static AnsiString __fastcall CurrToStrF(Currency value, TStringFloatFormat format, int digits);

    // Assignments

    AnsiString& __fastcall operator =(const AnsiString& rhs);

    AnsiString& __fastcall operator +=(const AnsiString& rhs);

    //Comparisons

    bool __fastcall operator ==(const AnsiString& rhs) const;

    bool __fastcall operator !=(const AnsiString& rhs) const;

    bool __fastcall operator <(const AnsiString& rhs) const;

    bool __fastcall operator >(const AnsiString& rhs) const;

    bool __fastcall operator <=(const AnsiString& rhs) const;

    bool __fastcall operator >=(const AnsiString& rhs) const;

    int __fastcall AnsiCompare(const AnsiString& rhs) const;

    int __fastcall AnsiCompareIC(const AnsiString& rhs) const; //ignorecase

    // Index

    char& __fastcall operator [](const int idx) {return Data[idx];}

    // Concatenation

    AnsiString __fastcall operator +(const AnsiString& rhs) const;

    // C string operator

    char* __fastcall c_str() const

      {return (Data)? Data: "";}

int __fastcall Length() const;

bool __fastcall IsEmpty() const;

    // make string unique (refcnt == 1)

    void __fastcall Unique();

    void __fastcall Insert(const AnsiString& str, int index);

    void __fastcall Delete(int index, int count);

    void __fastcall SetLength(int newLength);

    int __fastcall Pos(const AnsiString& subStr) const;

    AnsiString __fastcall LowerCase() const;

    AnsiString __fastcall UpperCase() const;

    AnsiString __fastcall Trim() const;

    AnsiString __fastcall TrimLeft() const;

    AnsiString __fastcall TrimRight() const;

    AnsiString __fastcall SubString(int index, int count) const;

    int __fastcall ToInt() const;

    int __fastcall ToIntDef(int defaultValue) const;

    double __fastcall ToDouble() const;

    //Convert to Unicode

    int __fastcall WideCharBufSize() const;

    wchar_t* __fastcall WideChar(wchar_t* dest, int destSize) const;

#if defined(MBCS)

    // mbcs support

    enum TStringMbcsByteType { mbSingleByte, mbLeadByte, mbTrailByte };

    TStringMbcsByteType __fastcall ByteType(int index) const;

    bool __fastcall IsLeadByte(int index) const;

    bool __fastcall IsTrailByte(int index) const;

    bool __fastcall IsDelimiter(const AnsiString& delimiters, int index) const;

    bool __fastcall IsPathDelimiter(int index) const;

    int __fastcall LastDelimiter(const AnsiString& delimiters) const;

    int __fastcall AnsiPos(const AnsiString& subStr) const;

    char* __fastcall AnsiLastChar() const;

#endif


Variant data type

See also	Reference

The Variant class is a C++Builder implementation of the Delphi intrinsic type Variant.

In C++Builder, the syntax for using variants is different from the Delphi usage. For example, if you have the following Delphi code:

V: Variant;

V := VarArrayCreate([0,HighVal,0,HighVal],varInteger);

In C++Builder you can use Variant and OPENARRAY like this.

Variant V(OPENARRAY(int,(0,HighVal,0,HighVal)),varInteger);


Variant

See also

Syntax

class __declspec(delphireturn) Variant: public TVarData

Public constructors

__fastcall Variant();

__fastcall Variant(const Variant& src);

//By value constructors

__fastcall Variant(const short src);

__fastcall Variant(const int src);

__fastcall Variant(const float src);

__fastcall Variant(const double src);

__fastcall Variant(const Currency src);

__fastcall Variant(const TDateTime src);

__fastcall Variant(const bool src);

__fastcall Variant(const WordBool src);

__fastcall Variant(const Byte src);

__fastcall Variant(const AnsiString& src);

__fastcall Variant(const char* src); // treat as asciiz pointer

__fastcall Variant(wchar_t* const src);

__fastcall Variant(Ole2::IDispatch* const src);

__fastcall Variant(Ole2::IUnknown* const src);

//By ref constructors

__fastcall Variant(short* src);

__fastcall Variant(int* src);

__fastcall Variant(float* src);

__fastcall Variant(double* src);

__fastcall Variant(Currency* src);

__fastcall Variant(TDateTime* src);

__fastcall Variant(WordBool* src);

__fastcall Variant(Byte* src);

__fastcall Variant(wchar_t** src);

// constructor for array of variants of type varType

__fastcall Variant(const int* bounds, const int boundsSize, Word varType);

// constructor for one dimensional array of type Variant

__fastcall Variant(const Variant* values, const int valuesSize);

Operators

~ Variant &

-    (int negation)

+ Variant &

- Variant &

* Variant &

/ Variant &

% Variant &

<< Variant &

>> Varian-++++++t &

| Variant &

& Variant &

^ Variant &

= Variant &

+= Variant &

-= Variant &

*= Variant &

/= Variant &

%= Variant &

<<= Variant &

>>= Varinat &

|= Variant &

&= Variant &

^ Variant &

Public member functions

// HRESULT methods

void __fastcall SetError(const Integer err);

Integer __fastcall GetError() const;

void __fastcall Clear();

Variant& __fastcall ChangeType(int VarType);

Variant __fastcall AsType(int VarType) const;

int __fastcall Type() const;

bool __fastcall IsNull() const;

bool __fastcall IsEmpty() const;

// variant array stuff

bool    __fastcall IsArray() const;

Variant __fastcall GetElement(const int i1) const;

Variant __fastcall GetElement(const int i1, const int i2) const;

Variant __fastcall GetElement(const int i1, const int i2, const int i3) const;

Variant __fastcall GetElement(const int i1, const int i2, const int i3, const int i4) const;

Variant __fastcall GetElement(const int i1, const int i2, const int i3, const int i4, const int i5) const;

void __fastcall PutElement(const Variant& data, const int i1);

void __fastcall PutElement(const Variant& data, const int i1, const int i2);

void __fastcall PutElement(const Variant& data, const int i1, const int i2, const int i3);

void __fastcall PutElement(const Variant& data, const int i1, const int i2, const int i3, const int i4);

void __fastcall PutElement(const Variant& data, const int i1, const int i2, const int i3, const int i4, const int i5);

int __fastcall ArrayDimCount() const;

int __fastcall ArrayLowBound(const int dim = 1) const;

int __fastcall ArrayHighBound(const int dim = 1) const;

void __fastcall ArrayRedim(int highBound);

Pointer __fastcall ArrayLock();

void    __fastcall ArrayUnlock();

// Automation Goodies

Variant __fastcall Exec(AutoCmd& cmd, Integer lcid = LOCALE_SYSTEM_DEFAULT);

// Alternate Syntax for Automation

// (Doesn't support Named Parameters for now)

void OleProcedure(const String& name, Variant& v0 = Variant(),

  Variant& v1 = Variant(),Variant& v2 = Variant(),Variant& v3 = Variant(),

  Variant& v4 = Variant(),Variant& v5 = Variant(),Variant& v6 = Variant(),

  Variant& v7 = Variant(),Variant& v8 = Variant(),Variant& v9 = Variant());

Variant OleFunction(const String& name, Variant& v0 = Variant(),

   Variant& v1 = Variant(),Variant& v2 = Variant(),Variant& v3 = Variant(),

   Variant& v4 = Variant(),Variant& v5 = Variant(),Variant& v6 = Variant(),

   Variant& v7 = Variant(),Variant& v8 = Variant(),Variant& v9 = Variant());

 Variant OlePropertyGet(const String& name, Variant& v0 = Variant(),

   Variant& v1 = Variant(),Variant& v2 = Variant(),Variant& v3 = Variant(),

   Variant& v4 = Variant(),Variant& v5 = Variant(),Variant& v6 = Variant(),

   Variant& v7 = Variant(),Variant& v8 = Variant(),Variant& v9 = Variant());

 void OlePropertySet(const String& name, Variant& v0 = Variant(),

   Variant& v1 = Variant(),Variant& v2 = Variant(),Variant& v3 = Variant(),

   Variant& v4 = Variant(),Variant& v5 = Variant(),Variant& v6 = Variant(),

   Variant& v7 = Variant(),Variant& v8 = Variant(),Variant& v9 = Variant());

 // End of Alternate Syntax for Automation


TDateTime data type

See also	Example 	Reference

The TDateTime class is a C++ class that implements the Delphi intrinsic type TDateTime.

Use the TDateTime data type to construct dates from the data types double, int, or AnsiString. The TDateTime class public interface allows you to do arithmetic and comparison operations on TDateTime types. You can also get information from a TDateTime type such as date, time, day of week, or a file’s date.


TDateTime

Syntax

class __declspec(delphireturn) TDateTime : public TDateTimeBase

Public constructors

// Used by TDateTime(const AnsiString& src)

enum TDateTimeFlag {Date, Time, DateTime};

static TDateTime __fastcall CurrentDate();

static TDateTime __fastcall CurrentTime();

static TDateTime __fastcall CurrentDateTime();

static TDateTime __fastcall FileDateToDateTime(int fileDate);

__fastcall TDateTime()                                  {Val = 0;}

__fastcall TDateTime(const TDateTimeBase& src)          {Val = src.Val;}

__fastcall TDateTime(const TDateTime& src)              {Val = src.Val;}

__fastcall TDateTime(const double src)                  {Val = src;}

__fastcall TDateTime(const int src)                     {Val = src;}

__fastcall TDateTime(const AnsiString& src, TDateTimeFlag flag = DateTime);

__fastcall TDateTime(unsigned short year, unsigned short month, unsigned short day);

__fastcall TDateTime(unsigned short hour, unsigned short min, unsigned short sec, unsigned short msec);

Operators

TDateTime& __fastcall operator =(const TDateTimeBase& rhs)

 {Val = rhs.Val;return *this;}

TDateTime& __fastcall operator =(const TDateTime& rhs)

 {Val = rhs.Val;  return *this;}

TDateTime& __fastcall operator =(const double rhs)

 {Val = rhs; return *this;}

TDateTime& __fastcall operator =(const int rhs)

 {Val = rhs; return *this;}

TDateTime& __fastcall operator +=(const TDateTimeBase& rhs)

 {Val+=rhs.Val;return *this;}

TDateTime& __fastcall operator +=(const TDateTime& rhs)

 {Val += rhs.Val; return *this;}

TDateTime& __fastcall operator +=(const double rhs)

 {Val += rhs; return *this;}

TDateTime& __fastcall operator +=(const int rhs)

 {Val += rhs; return *this;}

TDateTime& __fastcall operator -=(const TDateTimeBase& rhs)

 {Val-=rhs.Val;return *this;}

TDateTime& __fastcall operator -=(const TDateTime& rhs)

 {Val -= rhs.Val; return *this;}

TDateTime& __fastcall operator -=(const double rhs)

 {Val -= rhs; return *this;}

TDateTime& __fastcall operator -=(const int rhs)

 {Val -= rhs; return *this;}

TDateTime& operator ++() {Val++; return *this;}

TDateTime operator ++(int) {TDateTime tmp(*this); Val++; return tmp;}

TDateTime& operator --() {Val--; return *this;}

TDateTime operator --(int) {TDateTime tmp(*this); Val--; return tmp;}

TDateTime __fastcall operator +(const TDateTimeBase& rhs) const

 {return Val+rhs.Val;}

TDateTime __fastcall operator +(const TDateTime& rhs) const

 {return Val+rhs.Val;}

TDateTime __fastcall operator +(const double rhs) const {return Val+rhs;}

TDateTime __fastcall operator +(const int rhs) const {return Val+rhs;}

TDateTime __fastcall operator -(const TDateTimeBase& rhs) const

 {return Val-rhs.Val;}

TDateTime __fastcall operator -(const TDateTime& rhs) const

 {return Val-rhs.Val;}

TDateTime __fastcall operator -(const double rhs) const {return Val-rhs;}

TDateTime __fastcall operator -(const int rhs) const {return Val-rhs;}

// comparisons

bool __fastcall operator ==(const TDateTime& rhs) const

 {return Val == rhs.Val;}

bool __fastcall operator !=(const TDateTime& rhs) const

 {return Val != rhs.Val;}

bool __fastcall operator >(const TDateTime& rhs) const

 {return Val > rhs.Val;}

bool __fastcall operator <(const TDateTime& rhs) const

 {return Val < rhs.Val;}

bool __fastcall operator >=(const TDateTime& rhs) const

 {return Val >= rhs.Val;}

bool __fastcall operator <=(const TDateTime& rhs) const

 {return Val <= rhs.Val;}

__fastcall operator AnsiString() const;//<Date||Time||DateTime>String(smart)

AnsiString __fastcall FormatString(const AnsiString& format);

AnsiString __fastcall DateString() const;

AnsiString __fastcall TimeString() const;

AnsiString __fastcall DateTimeString() const;

__fastcall operator double() const;

__fastcall operator int() const;

int __fastcall DayOfWeek() const;

int __fastcall FileDate() const;


TAdviseSink

Hierarchy	Methods

Header

vcl/olectnrs.hpp

Description


TAdviseSink methods

TAdviseSink	Alphabetically

In TAdviseSink

~TAdviseSink

AddRef

OnClose

OnDataChange

OnRename

OnSave

OnViewChange

QueryInterface

Release

TAdviseSink

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAdviseSink methods

TAdviseSink	By object

~TAdviseSink

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OnClose

OnDataChange

OnRename

OnSave

OnViewChange

QueryInterface

Release

TAdviseSink


TAdviseSink::AddRef

TAdviseSink	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TAdviseSink::OnClose

TAdviseSink	Methods

Syntax

virtual void __stdcall OnClose(void);

Description


TAdviseSink::OnDataChange

TAdviseSink	Methods

Syntax

virtual void __stdcall OnDataChange(Ole2::TFormatEtc &formatetc, Ole2::TStgMedium &stgmed);

Description


TAdviseSink::OnRename

TAdviseSink	Methods

Syntax

virtual void __stdcall OnRename(Ole2::IMoniker *mk);

Description


TAdviseSink::OnSave

TAdviseSink	Methods

Syntax

virtual void __stdcall OnSave(void);

Description


TAdviseSink::OnViewChange

TAdviseSink	Methods

Syntax

virtual void __stdcall OnViewChange(System::Longint dwAspect, System::Longint lindex);

Description


TAdviseSink::QueryInterface

TAdviseSink	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TAdviseSink::Release

TAdviseSink	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TAdviseSink::TAdviseSink

TAdviseSink	Methods	See also

TAdviseSink creates a new TAdviseSink object.

Syntax

__fastcall TAdviseSink(TOleContainer *Container);

Description

Use TAdviseSink to create a new TAdviseSink object.


TAdviseSink::~TAdviseSink

TAdviseSink	Methods	See also

~TAdviseSink frees the memory associated with the TAdviseSink object.

Syntax

__fastcall virtual ~TAdviseSink(void);

Description

Do not call ~TAdviseSink directly. Instead, use the delete keyword on the object, which causes ~TAdviseSink to be invoked automatically.


Hierarchy

TObject

IUnknown

IAdviseSink


TAdviseSink example

TAdviseSink


TAmbientDispatch

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TAmbientDispatch methods

TAmbientDispatch	Alphabetically

In TAmbientDispatch

~TAmbientDispatch

AddRef

GetIDsOfNames

GetTypeInfo

GetTypeInfoCount

Invoke

QueryInterface

Release

TAmbientDispatch

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAmbientDispatch methods

TAmbientDispatch	By object

~TAmbientDispatch

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetIDsOfNames

GetTypeInfoCount

GetTypeInfo

InheritsFrom

InitInstance

InstanceSize

Invoke

MethodAddress

MethodName

NewInstance

QueryInterface

Release

TAmbientDispatch


TAmbientDispatch::AddRef

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TAmbientDispatch::GetIDsOfNames

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall GetIDsOfNames(const Ole2::TGUID &iid, Ole2::POleStrList rgszNames

Description


TAmbientDispatch::GetTypeInfo

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall GetTypeInfo(System::Integer itinfo, System::Longint lcid, Ole2::ITypeInfo *

Description


TAmbientDispatch::GetTypeInfoCount

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall GetTypeInfoCount(System::Integer &ctinfo);

Description


TAmbientDispatch::Invoke

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall Invoke(System::Longint dispIDMember, const Ole2::TGUID &iid, System::Longint

Description


TAmbientDispatch::QueryInterface

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TAmbientDispatch::Release

TAmbientDispatch	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TAmbientDispatch::TAmbientDispatch

TAmbientDispatch	Methods	See also

TAmbientDispatch creates a new TAmbientDispatch object.

Syntax

__fastcall TAmbientDispatch(TOleControl *Control);

Description

Use TAmbientDispatch to create a new TAmbientDispatch object.


TAmbientDispatch::~TAmbientDispatch

TAmbientDispatch	Methods	See also

~TAmbientDispatch frees the memory associated with the TAmbientDispatch object.

Syntax

__fastcall virtual ~TAmbientDispatch(void);

Description

Do not call ~TAmbientDispatch directly. Instead, use the delete keyword on the object, which causes ~TAmbientDispatch to be invoked automatically.


Hierarchy

TObject

IUnknown

IDispatch


TAmbientDispatch example

TAmbientDispatch


TApplication

Hierarchy	Properties	Methods	Events	See also

TApplication is the type used for a Borland C++ Builder application.

Header

vcl/forms.hpp

Description

TApplication is a class that encapsulates a windows application. The methods and properties introduced in TApplication reflect the fundamentals established in the Windows operating system to create, run, sustain, and destroy an application. TApplication thereby simplifies the interface between the user and the Windows environment when writing a Windows application. For this purpose TApplication encapsulates behavior for:

•	Windows message processing.

•	Context-sensitive online help.

•	Menu accelerator and key processing.

•	Exception handling.

•	Managing the fundamental parts defined by the Windows operating system for an application, such as MainWindow, WindowClass and so on.

Each Borland C++ Builder application automatically declares an Application variable of type TApplication as the instance of the application. Therefore TApplication does not need to appear on the component palette, nor is it available in the form designer to visually manipulate; so it has no published properties. Nevertheless, some of its public properites can be set or modified at design-time in the Forms and Application pages of the Project|Options dialog box.


TApplication properties

TApplication	Alphabetically	Legend

In TApplication

Active

DialogHandle

ExeName

Handle

HelpFile

Hint

HintColor

HintHidePause

HintPause

HintShortPause

Icon

MainForm

ShowHint

ShowMainForm

Terminated

Title

UpdateFormatSettings

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TApplication properties

TApplication	By object	Legend

Active

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

DialogHandle

ExeName

Handle

HelpFile

HintColor

HintHidePause

HintPause

HintShortPause

Hint

Icon

MainForm

Name

Owner

ShowHint

ShowMainForm

Tag

Terminated

Title

UpdateFormatSettings


TApplication::Active

TApplication	Properties	See also

Active specifies whether the application is active and has focus.

Syntax

__property System::Boolean Active;

Description

Active is read-only. Active is true while the application is active and false if it is not. Active is set to true in the constructor.

An application is active if the form or application has focus. An application becomes inactive when a window from a different application is about to become activated. When the application closes, Active is set to false in the destructor.


TApplication::DialogHandle

TApplication	Properties	See also

DialogHandle provides a mechanism for using non-Borland C++ Builder dialog boxes in a Borland C++ Builder application.

Syntax

__property System::Integer DialogHandle;

Description

Use DialogHandle when creating a modeless dialog box that was created using the CreateDialog API function, and that needs to see messages from the application's message loop in order to operate.

To do this, assign the handle of the modeless dialog box to DialogHandle when it receives an activation message (WM_NCACTIVATE) and set DialogHandle to zero when the dialog box receives a deactivation message. The folowing code demonstrates:

Example

Here is part of the window procedure for Borland C++ Builder's encapsulation of the Windows search-and-replace common dialog box:


TApplication::ExeName

TApplication	Properties	See also

ExeName contains the filename of the executable application including path information.

Syntax

__property System::AnsiString ExeName;

Description

ExeName is a read-only property. Use ExeName to obtain the name of the executable file for the application.

The name of the application is the root name of the project file with an .EXE extension. By default this name is PROJECT1.EXE. To change the ExeName, save the project by the desired new root name and rebuild the application. ExeName will reflect the change to the project filename.


TApplication::Handle

TApplication	Properties	See also

Handle provides access to the window handle of the main form (window) of the application.

Syntax

__property System::Integer Handle;

Description

Use Handle when calling a Windows API functions that require a parent window handle. For example, a DLL that displays its own top-level pop-up windows will need a parent window to display its windows in the application. Using the Application.Handle makes such windows part of the application, so that they will be minimized, restored, enabled and disabled with the application.

Note

When writing a DLL that uses VCL forms, assign the window handle of the host EXE’s main window to the DLL’s Application.Handle property. This makes the DLL’s form part of the host application. Never assign to Application.Handle in an EXE.


TApplication::HelpFile

TApplication	Properties	See also

HelpFile specifies the name of the file the application uses to display Help.

Syntax

__property System::AnsiString HelpFile;

Description

Use HelpFile for applications that have a help file to use with the Windows Help system. Windows displays the file specified by the HelpFile property. Either assign a filename to the HelpFile property at run-time, or specify a Help File on the Application page of the Project|Options dialog box at design-time.

By default, HelpFile is a null string, and the application's Help method ignores attempts to display Help. If HelpFile contains anything, the HelpContext method passes it to the Windows Help system as the name of the file to use for Help.


TApplication::Hint

TApplication	Properties	See also

Hint specifies the text string that appears in the Help Hint box.

Syntax

__property System::AnsiString Hint;

Description

TApplication’s Hint property is assigned the Hint value of the control or menu item that the mouse is currently moving over. It can also be assigned a string value that informs the user of some action, error, or other type of information. Therefore, use Hint either to:

•	Transfer hints from controls to another area of display, such as a status bar, using the OnHint event handler. This reads the Hint property.

•	Indicate the status of the application while it is processing some action. This sets the Hint property.

Help Hints appear when the OnHint event occurs. Therefore, if TApplication’s Hint property is assigned to the status bar’s caption, for example, the caption of the status bar control displays the current string value of the Hint property duing an OnHint event.

There are two parts to the Hint string: short and long. Short hints are used by pop-up tool tips. Long hints are used by the status bar, separated by the | character.

Note

When setting Hint to a message informing the user of an event occuring in the application, remember that, by default, the Hint string is reset to a control’s Hint when the mouse cursor moves over a control.


TApplication::HintColor

TApplication	Properties	See also

HintColor determines the color of the hint boxes for the Help Hints for the application.

Syntax

__property Graphics::TColor HintColor;

Description

Use HintColor to specify the hint box color. A default color value is set for the HintColor property in the constructor when the application is created. To change the HintColor assign it a new TColor value at run-time.


TApplication::HintHidePause

TApplication	Properties	See also

HintHidePause specifies the time interval to wait before hiding the Help Hint if the mouse has not moved from the control or menu item.

Syntax

__property System::Integer HintHidePause;

Description

Use HintHidePause to specify a wait time in milliseconds that is different from the default value that is set in the constructor. The Help Hint for the control or menu item is specified in the Hint property.

Note

The default is a predefined const value that is several times longer than, HintPause.


TApplication::HintPause

TApplication	Properties	See also

HintPause specifies the time interval that passes before the control's Help Hint appears when the user places the mouse pointer on a control or menu item.

Syntax

__property System::Integer HintPause;

Description

Use HintPause to change the default pause time set in the constructor. When assigning a value to HintPause specify the interval in milliseconds. The Help Hint displayed at the end of the pause is specified in the Hint property.


TApplication::HintShortPause

TApplication	Properties	See also

HintShortPause specifies the pause to wait before bringing up a hint if a hint has already been shown.

Syntax

__property System::Integer HintShortPause;

Description

Use HintShortPause to reduce the flicker when moving the mouse quickly over a set of buttons that all have help hints on. Specify a value in milliseconds that is different from the default set in the constructor.


TApplication::Icon

TApplication	Properties	See also

Icon determines which icon represents the application when it is minimized.

Syntax

__property Graphics::TIcon * Icon;

Description

Use Icon to assign a specific icon to represent the application. Set the Icon property by either:

•	Assigning it a TIcon at run-time.

•	Loading an icon on the Application pages of the Project|Options dialog box at design-time.

Icon represents the application when it is minimized and appears either on the Windows desktop or on the task bar in Windows 95.


TApplication::MainForm

TApplication	Properties	See also

MainForm identifies which form in the application is the main window that is always created first.

Syntax

__property TForm * MainForm;

Description

Use MainForm to specify a form, different from the default, as the main window of the application. When a new project is created, Form1 automatically becomes the value of the MainForm property. To assign a different form to the MainForm property, use the Forms page of the Project|Options dialog box at design-time. MainForm cannot be modified at run-time because it is read-only.

The main form is the first form created in the main body of the application. When the main form closes, the application terminates.


TApplication::ShowHint

TApplication	Properties	See also

Showing determines whether Help Hints are enabled or disabled for the entire application.

Syntax

__property System::Boolean ShowHint;

Description

Use ShowHints to choose when to display Help Hints. If ShowHint is true, Help Hints are enabled; if ShowHint is false, Help Hints are disabled. The default value is true. Help Hints are specified in the Hint property.

Setting ShowHint for the application to false disables all Help Hints, regardless of the value of the ShowHint properties for individual controls.


TApplication::ShowMainForm

TApplication	Properties	See also

ShowMainWindow determines whether the application shows its main form on startup.

Syntax

__property System::Boolean ShowMainForm;

Description

Use ShowMainForm to control whether and when the application shows its main form.

The default value of true is set in the constructor. By default the main window shows. The MainForm property specifies which form is the main form.

To hide the main form at startup, set ShowMainForm to false in the main project file before the call to Application.Run. This is mostly useful for implementing OLE automation servers, to hide the server’s main form when started for automation purposes.


TApplication::Terminated

TApplication	Properties	See also

Terminated reports whether the application has received the Windows WM_QUIT message, which then terminates the application.

Syntax

__property System::Boolean Terminated;

Description

Terminated is read-only. It is used when calling the ProcessMessages method so that the application doesn't attempt to process Windows messages after the application has quit. ProcessMessage sets Terminated to true when it receives a WM_QUIT message.

A Borland C++ Builder application usually receives a WM_QUIT message because the main window of the application has closed, or because the Terminate method has been called, thereby requiring windows to quit the application.

For applications using calculation-intensive loops, call Application.ProcessMessages periodically, and also check Application.Terminated to determine whether or not to abort the calculation so that the application can terminate.


TApplication::Title

TApplication	Properties	See also

Title contains the text that appears below the icon representing the application when it is minimized.

Syntax

__property System::AnsiString Title;

Description

Use the Title property to modify the name of this text string appearing below the icon of the application. The default value is taken from the DLL/EXE filename at run-time.

Set the Title at run time, or enter the value of the Title property on the Application page of the Project |Options dialog box.


TApplication::UpdateFormatSettings

TApplication	Properties

UpdateFormatSettings specifies whether the format settings are updated automatically when the user alters the system configuration.

Syntax

__property System::Boolean UpdateFormatSettings;

Description

Use UpdateFormatSettings to control automatic updating of format settings.

The default of true is set in the constructor. UpdateFormatSettings is checked when the application receives a WM_WININICHANGE message.

It is recommended to use the default format settings, which are initialized to the Windows local settings. However, to prevent the settings from changing during the execution of the appliaction when alterring the format settings in a Borland C++ Builder application, UpdateFormatSettings can be set to false.


TApplication events

TApplication	Alphabetically

In TApplication

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShowHint


TApplication events

TApplication	By object

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShowHint


TApplication::OnActivate

TApplication	Events	See also

OnActivate occurs when an application becomes active.

Syntax

__property Classes::TNotifyEvent OnActivate;

Description

Use OnActivate to write an event handler to perform special processing when the application becomes activated.

An application becomes active when it is initially run or when focus moves from another Windows application back to any window of the application.


TApplication::OnDeactivate

TApplication	Events	See also

OnDeactivate occurs when an application becomes inactive.

Syntax

__property Classes::TNotifyEvent OnDeactivate;

Description

Use the OnDeactive event to specify any special processing that should occur immediately before the application becomes deactivated. The OnDeactivate event occurs when the user switches from the application to another Windows application.


TApplication::OnException

TApplication	Events	See also

OnException occurs when an unhandled exception occurs in the application.

Syntax

__property TExceptionEvent OnException;

Description

Use OnException to change the default behavior that occurs during an unhandled exception in the application. The OnException event handler is called automatically in the HandleException method.

OnException only handles exceptions that occur during message processing. Exceptions that occur before or after the Application.Run do not go through Application.HandleException or OnException.

If an exception passes through the try blocks in the application code, the application automatically calls the HandleException method, which displays a dialog box indicating an error occurred. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists, otherwise it calls ShowException to display a message dialog box indicating an error occurred.

The TExceptionEvent type is the type of the OnException event. It points to a method that handles exceptions in the application. The Sender parameter is the object that raised the exception, and E is the exception message.


TApplication::OnHelp

TApplication	Events	See also

OnHelp occurs when the application receives a request for help.

Syntax

__property Classes::THelpEvent OnHelp;

Description

Use OnHelp to write an event handler to perform special processing when help is requested. The HelpContext and the HelpJump methods automatically trigger the OnHelp event.

Set CallHelp to true to have the VCL call WinHelp after the event. Set CallHelp to false to prevent the VCL from calling WinHelp.

All application help methods go through OnHelp. Only if OnHelp’s CallHelp parameter returns true, or if OnHelp is not assigned, is WinHelp called.

To find the possible values of the Command and Data parameters, search for WinHelp in the Win32 Developer's Reference Help (Win32.HLP) file, which explains the WinHelp API (application programming interface). The possible values for the Data parameter depend upon the value of the Command parameter.

The return value is true if the function succeeds, false if the function fails.


TApplication::OnHint

TApplication	Events	See also

OnHint occurs when the mouse pointer moves over a control or menu item that can display a Help Hint.

Syntax

__property Classes::TNotifyEvent OnHint;

Description

Use OnHint to write an event handler to perform special processing when the OnHint event occurs. OnHint occurs when the user positions the mouse pointer over a control with a Hint property value other than an empty string ('').

A common use of the OnHint event is to display the value of a control or menu item's Hint property as the caption of a panel control (TStatusBar), thereby using the panel as a status bar. The Hint property can specify a Help Hint and a usually longer hint that appears elsewhere when the OnHint event occurs.

Example

This example uses a status bar component, a menu, and an edit box on a form. Include a value for the Hint property for each menu item in the menu. Also, specify a value for the Hint property of the edit box.

To write the OnHint event handler, create a method of the TForm1 object and give it an appropriate name, such as DisplayHint. Write the method in the implementation part of the unit, declare the method in the TForm1 type declaration in the public section.

In the DisplayHint method assign the Hint property of the application to the Caption property of the panel component.

Assign this new method as the method used by the OnHint event. In the example this is done in the form's OnCreate event handler.

This code shows the complete type declaration, the new method, and the OnCreate event handler. When the user runs the application and positions the cursor over the edit box or a menu item on the menu, the specified hint appears as the caption of the panel at the bottom of the form:


TApplication::OnIdle

TApplication	Events

OnIdle occurs when an application becomes idle.

Syntax

__property TIdleEvent OnIdle;

Description

Use OnIdle to write an event handler to perform special processing when an application is idle. An application is idle when it is processing code, for example, or when it is waiting for input from the user.

OnIdle is called only once, as the application transitions into an idle state. It is not called continuously unless Done is set to false. If Done is false, WaitMessage is not called. Applications that set Done to false consume an inordinate amount of CPU time that affects overall system performance.

The TIdleEvent type is the type of the OnIdle event. It points to a method that runs when the application is idle. TIdleEvent has a Boolean parameter Done that is true by default. When Done is true, the Windows API WaitMessage function is called when OnIdle returns. WaitMessage yields control to other applications until a new message appears in the message queue of the application.


TApplication::OnMessage

TApplication	Events	See also

OnMessage processes Windows messages that an application receives.

Syntax

__property TMessageEvent OnMessage;

Description

Use OnMessage to trap any or all Windows messages posted to all windows in the application. The OnMessage event occurs when an application receives a Windows message. Creating an OnMessage event handler in an application allows other handlers to respond to messages other than those declared in the events for TApplication. If the application doesn't have a specific handler for an incoming message, the message is dispatched to the window for which it was intended, and Windows handles the message.

The TMessageEvent type is the type of the OnMessage event. It points to a method that handles the processing of incoming Windows messages. The Msg parameter identifies the Windows message, and the Handled parameter determines whether the message is handled or not. Set Handled to true, if the message has been completely handled, to prevent normal processing of the message.

Note

OnMessage only receives messages that are posted to the message queue, not those sent directly with the Windows API SendMessage function.

Caution

Thousands of messages per second flow though this event. Be careful when coding the handler since it can affect the performance of the entire application.


TApplication::OnMinimize

TApplication	Events	See also

OnMinimize occurs when an application is minimized.

Syntax

__property Classes::TNotifyEvent OnMinimize;

Description

Use OnMinimize to write an event handler to perform special processing when the application is minimized. The application is minimized, either because the user minimizes the main window, or because of a call to the Minimize method. The Icon property determines the icon that represents the minimized application.


TApplication::OnRestore

TApplication	Events	See also

OnRestore occurs when the previously minimized application is restored to its normal size.

Syntax

__property Classes::TNotifyEvent OnRestore;

Description

Use OnRestore to write an event handler to perform special processing when the application is restored from a minimized state in which ir appears as an icon. An application is restored either because the user restores the application, or because the application calls the Restore method.

Note

Don't confuse restoring an application with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of the WindowState property.


TApplication::OnShowHint

TApplication	Events	See also

OnShowHint occurs when the application is about to display a hint window for a Help Hint for a particular control.

Syntax

__property TShowHintEvent OnShowHint;

Description

Use OnShowHint to write an event handler that changes the appearance and behavior of Help Hints.

The TShowHintEvent is the type of the OnShowHint event. It points to a method that displays a Help Hint for a control. The HintStr parameter sets the text of the Help Hint. To obtain the text of a hint for a particular control, call the GetLongHint or GetShortHint function, assigning the result to HintStr. To change the text, change the contents of this string.

Use the CanShow variable to permit or prevent the Help Hint from displaying. If CanShow is true, the Help Hint displays. If it is false, the Help Hint does not appear.

The HintInfo parameter is a record that contains information about the appearance and behavior of the Help window.

The HintColor field of the record contains the name of the control for which hint processing is occurring.

The HintPos field determines the default position in screen coordinates of the top-left corner of the hint window. Change where the window appears by changing this value.

The HintMaxWidth field determines the maximum width of the hint window before word wrapping begins. By default, the value is the width of the screen (Screen.Width).

The CursorRect field determines the rectangle the user's mouse pointer must be in for the hint window to appear. The default value for CursorRect is the client rectangle of the control. An application can change this value so that a single control can divided into several hint regions. When the user moves the mouse pointer moves outside the rectangle, the hint window disappears.

The CursorPos field contains the location of the mouse pointer within the control.


TApplication methods

TApplication	Alphabetically

In TApplication

~TApplication

BringToFront

CancelHint

ControlDestroyed

CreateForm

CreateHandle

HandleException

HandleMessage

HelpCommand

HelpContext

HelpJump

HideHint

HintMouseMessage

HookMainWindow

Initialize

MessageBox

Minimize

NormalizeTopMosts

ProcessMessages

Restore

RestoreTopMosts

Run

ShowException

TApplication

Terminate

UnhookMainWindow

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TApplication methods

TApplication	By object

~TApplication

Assign

BringToFront

CancelHint

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ControlDestroyed

CreateForm

CreateHandle

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HandleException

HandleMessage

HasParent

HelpCommand

HelpContext

HelpJump

HideHint

HintMouseMessage

HookMainWindow

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

MessageBox

MethodAddress

MethodName

Minimize

NewInstance

NormalizeTopMosts

ProcessMessages

RemoveComponent

Restore

RestoreTopMosts

Run

ShowException

TApplication

Terminate

UnhookMainWindow


TApplication::BringToFront

TApplication	Methods	See also

BringToFront sets the last active window as the topmost window on the desktop above all other applications.

Syntax

void __fastcall BringToFront(void);

Description

Use BringToFront to find the window owned by the MainForm that was last active and bring it to the foreground. BringToFront also tests to see if the window is visible and enabled before making it the topmost window.


TApplication::CancelHint

TApplication	Methods	See also

CancelHint cancels the displaying of a hint for a control.

Syntax

void __fastcall CancelHint(void);

Description

Applications rarely, if ever, call CancelHint directly. CancelHint is used internally in the VCL to cancel the displaying of hints at appropriate times, such as when a window is not valid or when the application closes. CancelHint calls a series of routines that perform a cleanup on the display and timing issues of the hint window for a control.


TApplication::ControlDestroyed

TApplication	Methods	See also

ControlDestroyed notifies the application that a control has been destoyed.

Syntax

void __fastcall ControlDestroyed(Controls::TControl *Control);

Description

ControlDestroyed notifies the application that the control passed as the Control parameter has been destoyed, so that the application pointers, such as MainForm and ActiveForm, can be updated to point to a valid control object or to NULL.

ControlDestroyed is called by TControl.Destroy. Do not call it directly.


TApplication::CreateForm

TApplication	Methods	See also

CreateForm creates a new form.

Syntax

void __fastcall CreateForm(System::TMetaClass * InstanceClass, void *Reference);

Description

Applications allways call CreateForm. However, Borland C++ Builder programmers rarely write code that necessitates calling CreateForm directly.

A Borland C++ Builder project typically contains one or more calls to CreateForm in the project's main statement part and handles form creation automatically when using the form designer. An application might call CreateFrom to dynamically create a form at run-time.

CreateForm creates a new form of the type specified by the FormClass parameter and assigns it to the variable given by the Reference parameter. The owner of the new form is the Application object. By default the form created by the first call to CreateForm in a project becomes the project's main form.


TApplication::CreateHandle

TApplication	Methods	See also

CreateHandle generates a handle for the Handle property of the application if it does not already have one.

Syntax

void __fastcall CreateHandle(void);

Description

Do not call CreateHandle directly. In EXEs TApplication.Create calls CreateHandle. In DLLs it does not.

CreateHandle is mainly an encapsulation of much the Windows API function WinMain. For example, CreateHandle registers the Window Class, creates the application window and determines how the appliaction window is shown.


TApplication::HandleException

TApplication	Methods	See also

HandleException provides default handling of exceptions for the application.

Syntax

void __fastcall HandleException(System::TObject *Sender);

Description

It should not be necessary to call HandleException directly.

To assign other exception handling code for the application, use the OnException event handler.

If an exception passes through all the try blocks in the application code , the application automatically calls the HandleException method, which displays a dialog box indicating an error occurred. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists, otherwise it calls ShowException to display a message dialog box indicating an error occurred.


TApplication::HandleMessage

TApplication	Methods	See also

HandleMessage interrupts the execution of an application so that Windows can process a single message in the Windows message queue and then returns control to the application.

Syntax

void __fastcall HandleMessage(void);

Description

If the message queue is empty, HandleMessage calls the application's Idle method, which, in turn, calls the OnIdle event handler if one is defined.

Note

If the application goes idle HandleMessage may take a long time to return. Therefore, do not call HandleMessage when waiting for something message-based, while priority actions are also being processed. In contrast, call ProcessMessages when processing other actions besides messages.


TApplication::HelpCommand

TApplication	Methods	See also

HelpCommand provides quick access to any of the Help commands in the WinHelp API (application programming interface).

Syntax

System::Boolean __fastcall HelpCommand(System::Integer Command, System::Longint Data);

Description

Use HelpCommand to access WinHelp.

HelpCommand is a wrapper function that simply calls a method which calls the OnHelp event.

For information about these commands and the data passed to them, see the WinHelp topic in the Windows Help system.


TApplication::HelpContext

TApplication	Methods	See also

HelpContext displays the help file for an application.

Syntax

System::Boolean __fastcall HelpContext(Classes::THelpContext Context);

Description

Use HelpContext to bring up the help file for the application specified in the HelpFile property. HelpContext calls OnHelp directly.

HelpContext passes the file name contained in HelpFile and the context number passed in Context parameter. For example, if the Context value is 714, the HelpContext method displays the screen with the context help ID of 714 in the Help file.

HelpContext returns false if HelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpContext returns true.


TApplication::HelpJump

TApplication	Methods	See also

HelpJump calls OnHelp indirectly.

Syntax

System::Boolean __fastcall HelpJump(const System::AnsiString JumpID);

Description

Use HelpJump to bring up Help for the specific topic. HelpJump passes the file name contained in HelpFile and the context string specified in the JumpID parameter. For example, if the JumpID value is 'vclDefaultProperty', the HelpJump method displays the screen in the Help file that has the context string 'vclDefaultProperty'.

HelpJump returns false if HelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpJump returns true.


TApplication::HideHint

TApplication	Methods	See also

HideHint hides the current hint.

Syntax

void __fastcall HideHint(void);

Description

Applications rarely, if ever, call HideHint directly. HideHint is used internally in Borland C++ Builder to hide the hint window at the appropriate times according to predetermined conditions and timer values. For example, CancelHint calls HideHint.


TApplication::HintMouseMessage

TApplication	Methods	See also

HintMouseMessage regulates the display of hint windows.

Syntax

void __fastcall HintMouseMessage(Controls::TControl *Control, Messages::TMessage &Message);

Description

Applications rarely, if ever, call HintMouseMessage directly. HintMouseMessage is used internally by Borland C++ Builder to manage the display of the hint windows.


TApplication::HookMainWindow

TApplication	Methods	See also

HookMainWindow enables a non-Borland C++ Builder dialog box to receive messages sent to its parent, represented by the application object's Handle property.

Syntax

void __fastcall HookMainWindow(TWindowHook Hook);

Description

Use HookMainWindow to ensure that the non-Borland C++ Builder dialog box behaves correctly as a child of the application, not as a stand-alone window. For example, switching among applications with Alt+Tab treats the application as a single task after calling HookMainWindow, rather than treating the non-Borland C++ Builder dialog box as a separate task.

The TWindowHook type is the parameter type used for the HookMainWindow method. It is a method-pointer type used for the dialog-procedures of non-Borland C++ Builder dialog boxes. The dialog procedure is similar to a window procedure for a window, in that it processes messages for the dialog box, but its syntax is somewhat different.

There is no problem with leaving a dialog box hooked into the main window, even for extended periods. However, should the dialog box close, call the UnhookMainWindow method to release the hook.

For more information about Windows hooks see the SetWindowsHookEx and UnhookWindowsEx functions in the Windows Help File.


TApplication::Initialize

TApplication	Methods

Initialize is the first method called for every Borland C++ Builder project, providing an opportunity to call an OLE automation procedure.

Syntax

void __fastcall Initialize(void);

Description

Use Initialize to call a procedure for OLE automation. Initialize automatically calls the InitProc procedure pointer, which is a pointer to a procedure that handles OLE automation.

Since Initialize is the first method called for a Borland C++ Builder application, the InitProc pointer must somehow be predefined. By default the call to Initialize for the application does nothing, because it calls a default InitProc pointer that is NULL .

Therefore, to call an OLE automation procedure either:

•	Add a unit that defines InitProc, such as the OleAuto unit.

•	Define a custom procedure for OLE automation, assign it to the InitProc pointer, and add this as the first line of code, that is, before the call to Initialize.

For projects that do not contain OLE automation servers, the call to Initialize can be safely deleted.

Note

Although Initialize is the first method called in the main project source code, it is not the first code that is exectued in an application.


TApplication::MessageBox

TApplication	Methods

MessageBox displays a specified message to the user.

Syntax

System::Integer __fastcall MessageBox(System::PChar Text, System::PChar Caption, System::Word Flags

Description

Use MessageBox to displays a generic dialog box a message and one or more buttons. Caption is the caption of the dialog box and is optional.

MessageBox is an encapsulation of the Windows API MessageBox function. TApplication’s encapsulation of MessageBox automatically supplies the missing window handle parameter needed for the Windows API function.

The value of the Text parameter is the message, which can be longer than 255 characters if necessary. Long messages are automatically wrapped in the message box. The value of the Caption property is the caption that appears in the title bar of the dialog box. Captions can be longer than 255 characters, but they don't wrap. A long caption results in a wide message box.

To see the possible values of the Flags parameter, see the MessageBox function in the Windows API Help file. The corresponding parameter on that Help screen is called TextType. The values determine the buttons that appear in the message box and the behavior of the message box. The values can be combined to obtain the desired effect.

The return value of the MessageBox method is 0, if there wasn't enough memory to create the message box, or one of these values:

Value	Numeric value	Meaning

IDABORT	         3	The user chose the Abort button.

IDCANCEL	         2	The user chose the Cancel button.

IDIGNORE	         5	The user chose the Ignore button.

IDNO	         7	The user chose the No button.

IDOK	         1	The user chose the OK button.

IDRETRY	         4	The user chose the Retry button.

IDYES	         6	The user chose the Yes button.


TApplication::Minimize

TApplication	Methods	See also

Minimize shrinks an application to an icon on the Windows desktop.

Syntax

void __fastcall Minimize(void);

Description

Call Minimize directly to minimize the application. When the user minimizes the application, the Minimize method is automatically called.

Note

Don't confuse the Minimize method with minimizing a form or window. To minimize, maximize, or restore a window or form, change the value of the WindowState property.


TApplication::NormalizeTopMosts

TApplication	Methods	See also

NormalizeTopMosts makes forms that have been designated as topmost forms (their FormStyle is fsStayOnTop) behave as if they were not topmost forms.

Syntax

void __fastcall NormalizeTopMosts(void);

Description

Use NormalizeTopMosts to have message box or dialog box, that is displayed using the Windows API functions (such as MessageBox and MessageDlg) directly, appear on top of a topmost form. Otherwise the form remains on top, which may obscure the message box.

Calling NormalizeTopMosts is not necessary when when using Borland C++ Builder methods and functions to display message boxes.

To return the forms designated as fsStayOnTop to be topmost again, call RestoreTopMosts.


TApplication::ProcessMessages

TApplication	Methods	See also

ProcessMessages interrupts the execution of an application so that Windows can respond to events.

Syntax

void __fastcall ProcessMessages(void);

Description

Call ProcessMessages to permit Windows to process these events at the time ProcessMessages is called. The ProcessMessages method cycles the Windows message loop until it is empty and then returns control to the application.

Note

In Win32, neglecting message processing only the application calling ProcessMessages, not other applications. In lengthy operations calling ProcessMessages periodically will allow the application to respond to paint and other messages.

Note

ProcessMessages does not allow the application to go idle, whereas HandleMessages does.


TApplication::Restore

TApplication	Methods	See also

Restore restores a minimized application to its normal size.

Syntax

void __fastcall Restore(void);

Description

Use Restore to restore the application to its previous size before it was minimized. When the user restores the application to normal size, the Restore method is automatically called.

Note

Don't confuse the Restore method with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of the WindowState property.


TApplication::RestoreTopMosts

TApplication	Methods	See also

RestoreTopMosts restores forms designated as fsStayOnTop to be topmost again.

Syntax

void __fastcall RestoreTopMosts(void);

Description

Use RestoreTopMosts to return forms that were originally designated as topmost forms (FormStyle is fsStayOnTop), then temporarily changed to be non-topmost forms with the NormalizeTopMosts method, to a topmost position.


TApplication::Run

TApplication	Methods	See also

Run executes the application.

Syntax

void __fastcall Run(void);

Description

Run contains the application’s main message loop. The call to Run does not return until the application’s message loop is terminated.

When creating a new project, Borland C++ Builder automatically creates a main program block in the project file that calls the Run method. When the application is excuted, the application’s Run method is called.


TApplication::ShowException

TApplication	Methods	See also

ShowException displays an exception that occurred in an application in a message box.

Syntax

void __fastcall ShowException(Sysutils::Exception *E);

Description

ShowException is called by HandleException as a default if no handler is specified for the OnException event.

If an exception handler filters exceptions, ShowException will need to be called for those exceptions that are not filtered out.

To specify how exceptions are handled for an application write a handler for the OnException event.

Note

Calling ShowException is rarely necessary in a Borland C++ Builder application, since the default VCL exception handler will call ShowException automatically.


TApplication::Terminate

TApplication	Methods	See also

Terminate ends application execution.

Syntax

void __fastcall Terminate(void);

Description

Terminate calls the Windows API PostQuitMessage function to perform an orderly shutdown of the application. Terminate is not immediate.

Terminate is called automatically on a WM_QUIT message and when the main form closes.


TApplication::UnhookMainWindow

TApplication	Methods	See also

UnhookMainWindow releases the dialog procedure previously hooked by a call to the HookMainWindow method.

Syntax

void __fastcall UnhookMainWindow(TWindowHook Hook);

Description

Use UnhookMainWindow to release the hooked window. Specify the dialog procedure as the value of the Hook parameter.

The TWindowHook type is the parameter type used for the InhookMainWindow method. It is a method-pointer type used for the dialog-procedures of non-Borland C++ Builder dialog boxes. The dialog procedure is similar to a window procedure for a window, in that it processes messages for the dialog box, but its syntax is somewhat different.

For more information about Windows hooks see the SetWindowsEx and UnhookWindowsEx functions in the Windows Help File.


TApplication::TApplication

TApplication	Methods	See also

TApplication creates a new TApplication object.

Syntax

__fastcall virtual TApplication(Classes::TComponent *AOwner);

Description

Use TApplication to create a new TApplication object.


TApplication::~TApplication

TApplication	Methods	See also

~TApplication frees the memory associated with the TApplication object.

Syntax

__fastcall virtual ~TApplication(void);

Description

Do not call ~TApplication directly. Instead, use the delete keyword on the object, which causes ~TApplication to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TApplication example

TApplication


TAutoDispatch

Hierarchy	Properties	Methods

Header

vcl/oleauto.hpp

Description


TAutoDispatch properties

TAutoDispatch	Alphabetically	Legend

In TAutoDispatch

AutoObject


TAutoDispatch properties

TAutoDispatch	By object	Legend

AutoObject


TAutoDispatch::AutoObject

TAutoDispatch	Properties

Syntax

__fastcall TAutoDispatch(TAutoObject *AutoObject);

Description


TAutoDispatch methods

TAutoDispatch	Alphabetically

In TAutoDispatch

~TAutoDispatch

AddRef

GetAutoObject

GetIDsOfNames

GetTypeInfo

GetTypeInfoCount

Invoke

QueryInterface

Release

TAutoDispatch

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoDispatch methods

TAutoDispatch	By object

~TAutoDispatch

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetAutoObject

GetIDsOfNames

GetTypeInfoCount

GetTypeInfo

InheritsFrom

InitInstance

InstanceSize

Invoke

MethodAddress

MethodName

NewInstance

QueryInterface

Release

TAutoDispatch


TAutoDispatch::AddRef

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TAutoDispatch::GetAutoObject

TAutoDispatch	Methods

Syntax

virtual TAutoObject *__stdcall GetAutoObject(void);

Description


TAutoDispatch::GetIDsOfNames

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall GetIDsOfNames(const Ole2::TGUID &iid, Ole2::POleStrList rgszNames

Description


TAutoDispatch::GetTypeInfo

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall GetTypeInfo(System::Integer itinfo, System::Longint lcid, Ole2::ITypeInfo *

Description


TAutoDispatch::GetTypeInfoCount

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall GetTypeInfoCount(System::Integer &ctinfo);

Description


TAutoDispatch::Invoke

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall Invoke(System::Longint dispIDMember, const Ole2::TGUID &iid, System::Longint

Description


TAutoDispatch::QueryInterface

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TAutoDispatch::Release

TAutoDispatch	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TAutoDispatch::TAutoDispatch

TAutoDispatch	Methods	See also

TAutoDispatch creates a new TAutoDispatch object.

Syntax

__fastcall TAutoDispatch(TAutoObject *AutoObject);

Description

Use TAutoDispatch to create a new TAutoDispatch object.


TAutoDispatch::~TAutoDispatch

TAutoDispatch	Methods	See also

~TAutoDispatch frees the memory associated with the TAutoDispatch object.

Syntax

__fastcall virtual ~TAutoDispatch(void);

Description

Do not call ~TAutoDispatch directly. Instead, use the delete keyword on the object, which causes ~TAutoDispatch to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

IUnknown

IDispatch


TAutoDispatch example

TAutoDispatch


TAutoIncField

Hierarchy	Properties	Methods	Events	See also

A TAutoInc component represents an auto-incrementing integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Auto-incrementing integer fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are used as a counter for the records in the dataset. Each record will have a unique value in an auto-incrementing integer field, with each record receiving the next highest integer from that of the previously inserted record. Auto-incrementing fields are commonly used to provide a unique primary key value for a record.

TAutoInc does not introduce any new properties, events, or methods beyond those provided by the TInteger class. It exists as a separate class to represent the DataType for an auto-incrementing field.


TAutoIncField properties

TAutoIncField	Alphabetically	Legend

Derived from TIntegerField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TAutoIncField properties

TAutoIncField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TAutoIncField events

TAutoIncField	Alphabetically

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TAutoIncField events

TAutoIncField	By object

OnChange

OnGetText

OnSetText

OnValidate


TAutoIncField methods

TAutoIncField	Alphabetically

In TAutoIncField

~TAutoIncField

TAutoIncField

Derived from TIntegerField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoIncField methods

TAutoIncField	By object

~TAutoIncField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TAutoIncField


 TAutoIncField class


TAutoIncField::TAutoIncField

TAutoIncField	Methods	See also

TAutoIncField creates a new TAutoIncField object.

Syntax

__fastcall virtual TAutoIncField(Classes::TComponent *AOwner);

Description

Use TAutoIncField to create a new TAutoIncField object.


TAutoIncField::~TAutoIncField

TAutoIncField	Methods	See also

~TAutoIncField frees the memory associated with the TAutoIncField object.

Syntax

__fastcall virtual ~TAutoIncField(void);

Description

Do not call ~TAutoIncField directly. Instead, use the delete keyword on the object, which causes ~TAutoIncField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TAutoIncField example

TAutoIncField


TAutomation

Hierarchy	Properties	Methods	Events	See also

The TAutomation object is the OLE automation manager object.

Header

vcl/oleauto.hpp


TAutomation properties

TAutomation	Alphabetically	Legend

In TAutomation

AutoObjectCount

IsInprocServer

StartMode


TAutomation properties

TAutomation	By object	Legend

AutoObjectCount

IsInprocServer

StartMode


TAutomation::AutoObjectCount

TAutomation	Properties

Indicates how many OLE automation object instances the Automation manager is currently managing.

Syntax

__property System::Integer AutoObjectCount;

Each time the Automation manager creates an instance of one of the server objects it manages, it increments its internal count, which your application can read through the read-only property AutoObjectCount.


TAutomation::IsInprocServer

TAutomation	Properties

Indicates whether the OLE automation server is an in-process server.

Syntax

__property System::Boolean IsInprocServer;

Borland C++ Builder assumes that all OLE automation servers in DLLs are in-process servers, and that those in applications are not.


TAutomation::StartMode

TAutomation	Properties

Indicates the reason an OLE automation server was started: as a standalone, interactive application, as an embedded object, or for registration or unregistration.

Syntax

__property TStartMode StartMode;

The Automation manager decides what, if anything, to do with the server when its controller applications have finished with it based on the value of StartMode, as described under OnLastRelease.

The TStartMode type specifies the possible values for the StartMode property, indicating the different reasons why an OLE automation server can be started.

The following table explains each of the possible start-mode values and the command-line switch that corresponds to each.

Start mode	Switch	Meaning

smAutomation	embedding	The application was started by Windows in response to a request from an automation controller.

smRegServer	regserver	The application was started only to add the server to the system registry.

smStandalone	---	The user started the application as a standalone, interactive application.

smUnregServer	unregserver	The application was started only to remove the server from the system registry.


TAutomation events

TAutomation	Alphabetically

In TAutomation

OnLastRelease


TAutomation events

TAutomation	By object

OnLastRelease


TAutomation::OnLastRelease

TAutomation	Events

Occurs when the automation manager releases the last instance of an OLE automation object.

Syntax

__property TLastReleaseEvent OnLastRelease;

OnLastRelease does not occur for in-process servers.

The Shutdown parameter of the event is a var parameter, so an event handler can force or prevent the shutdown of the automation manager by setting Shutdown to true or false, respectively. By default, Shutdown is true only for servers with a StartMode of smAutomation; that is, shutdown is only automatic for servers started expressly for automation.

The TLastReleaseEvent type is a method-pointer type used for the OnLastRelease event. The variable parameter Shutdown enables the application to override the default behavior for whether to shut down the server application when all instances are released.


TAutomation methods

TAutomation	Alphabetically

In TAutomation

~TAutomation

RegisterClass

TAutomation

UpdateRegistry

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutomation methods

TAutomation	By object

~TAutomation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClass

TAutomation

UpdateRegistry


TAutomation::RegisterClass

TAutomation	Methods

Registers an OLE automation server class with the OLE automation manager (Automation).

Syntax

void __fastcall RegisterClass(const TAutoClassInfo &AutoClassInfo);

Every unit that defines an OLE automation server class (an object derived from TAutoObject) must include a call in its initialization section to Automation.RegisterClass, passing a record of class-registration information.


TAutomation::UpdateRegistry

TAutomation	Methods

Updates the system registry for all the OLE automation objects handled by the OLE automation manager (that is, all the OLE automation objects in a particular server application).

Syntax

void __fastcall UpdateRegistry(System::Boolean Register);

If the Register parameter is true, UpdateRegistry registers the servers. Otherwise, it unregisters them.

The ServerRegistration method calls UpdateRegistry automatically, so you should never need to call it yourself.


TAutomation::TAutomation

TAutomation	Methods	See also

TAutomation creates a new TAutomation object.

Syntax

__fastcall TAutomation(void);

Description

Use TAutomation to create a new TAutomation object.


TAutomation::~TAutomation

TAutomation	Methods	See also

~TAutomation frees the memory associated with the TAutomation object.

Syntax

__fastcall virtual ~TAutomation(void);

Description

Do not call ~TAutomation directly. Instead, use the delete keyword on the object, which causes ~TAutomation to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TAutomation example

TAutomation


TAutoObject

Hierarchy	Properties	Methods	See also

The TAutoObject object is the base class for all objects in  automation servers. When you create a new automation object, you derive it from TAutoObject, then declare properties and methods in an automated section of the new class.

Header

vcl/oleauto.hpp

Overview

To expose an automation object to external OLE automation controllers, the unit that implements the automation object must call Automation.RegisterClass in its initialization section, passing in a TAutoClassInfo record.Once you register your automation object, the global Automation object automatically manages all aspects of the object’s interface with the OLE automation APIs.

When an external OLE automation controller requests an instance of the automation object, the Automation manager calls the Create constructor to construct the instance. When all external references to the object disappear, the Automation manager calls the Destroy method to destroy the instance. The automation object maintains a reference count to determine when all references are gone.


TAutoObject properties

TAutoObject	Alphabetically	Legend

In TAutoObject

AutoDispatch

OleObject

RefCount


TAutoObject properties

TAutoObject	By object	Legend

AutoDispatch

OleObject

RefCount


TAutoObject::AutoDispatch

TAutoObject	Properties	See also

Provides an IDispatch interface to the automation object, suitable for passing to OLE API functions.

Syntax

__property TAutoDispatch * AutoDispatch;


TAutoObject::OleObject

TAutoObject	Properties

Provides a variant containing the automation object.

Syntax

__property System::Variant OleObject;

When your server needs to pass an OLE object to a controller, the controller expects it in the form of a variant. You should therefore always references to an automation object's OleObject property, rather than references to the object itself.


TAutoObject::RefCount

TAutoObject	Properties

Holds the current reference count of the OLE automation object.

Syntax

__property System::Integer RefCount;

To increment or decrement the reference count, call the AddRef or Release methods.


TAutoObject methods

TAutoObject	Alphabetically

In TAutoObject

~TAutoObject

AddRef

Release

TAutoObject

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoObject methods

TAutoObject	By object

~TAutoObject

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Release

TAutoObject


TAutoObject::AddRef

TAutoObject	Methods

Increments the reference count for an OLE automation object and returns the current reference count.

Syntax

System::Integer __fastcall AddRef(void);


TAutoObject::Release

TAutoObject	Methods

Decrements the OLE automation object's reference count and returns the current count.

Syntax

System::Integer __fastcall Release(void);

If the new count is zero, Release destroys the object by calling Free.


TAutoObject::TAutoObject

TAutoObject	Methods	See also

TAutoObject creates a new TAutoObject object.

Syntax

__fastcall virtual TAutoObject(void);

Description

Use TAutoObject to create a new TAutoObject object.


TAutoObject::~TAutoObject

TAutoObject	Methods	See also

~TAutoObject frees the memory associated with the TAutoObject object.

Syntax

__fastcall virtual ~TAutoObject(void);

Description

Do not call ~TAutoObject directly. Instead, use the delete keyword on the object, which causes ~TAutoObject to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TAutoObject example

TAutoObject


TBatchMove

Hierarchy	Properties	Methods	See also

TBatchMove enables applications to perform database operations on groups of records or entire tables.

Header

vcl/dbtables.hpp

Description

Instantiate a TBatchMove object to

•	Add the records in a dataset to a database table.

•	Delete the records in a dataset from a database table.

•	Copy a dataset to create a new database table or overwrite an existing table.

Set the properties of the TBatchMove object to specify the desired operation. Call the Execute method to perform the actual operation. TTable objects can also perform the same batch operations, but only with the options specified by the default TBatchMove property values.

TBatchMove has several properties that instruct the Borland Database Engine (BDE) how to handle problems that occur when executing the batch operation. Additionaly, applications can use a TBDECallback object to further refine the response to problems that arise.


TBatchMove properties

TBatchMove	Alphabetically	Legend

In TBatchMove

AbortOnKeyViol

AbortOnProblem

ChangedCount

ChangedTableName

CommitCount

Destination

KeyViolCount

KeyViolTableName

Mappings

Mode

MovedCount

ProblemCount

ProblemTableName

RecordCount

Source

Transliterate

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBatchMove properties

TBatchMove	By object	Legend

AbortOnKeyViol

AbortOnProblem

ChangedCount

ChangedTableName

CommitCount

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Destination

KeyViolCount

KeyViolTableName

Mappings

Mode

MovedCount

Name

Owner

ProblemCount

ProblemTableName

RecordCount

Source

Tag

Transliterate


TBatchMove::AbortOnKeyViol

TBatchMove	Properties	See also

AbortOnKeyViol specifies whether the batch operation is terminated immediately when integrity or key violations occur.

Syntax

__property System::Boolean AbortOnKeyViol;

Description

Set AbortOnKeyViol to true to cancel the batch operation when it causes integrity or key violations in the destination table. Set AbortOnKeyViol to false to cause records that would cause integrity or key violations to be posted to a key violations table instead. Provide a KeyViolTableName when setting AbortOnKeyViol to false. If there is no KeyViolTableName, AbortOnKeyViol may still be set to false, in which case problem records are counted but not saved in a table.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.


TBatchMove::AbortOnProblem

TBatchMove	Properties	See also

AbortOnProblem specifies whether the batch operation is terminated immediately when it is necessary to truncate data to make it fit in the specified Destination.

Syntax

__property System::Boolean AbortOnProblem;

Description

Set AbortOnProblem to true to cancel the batch operation when types of the fields in the Source table records do not match the types of the fields in the Destination table records. Set AbortOnProblem to false to cause the mismatched fields to be “trimmed”. When AbortOnProblem is false, set the ProblemTableName to have all the untrimmed versions of records that were trimmed saved to a separate table.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note

To allow trimming on a field by field basis, use a TBDECallback object.


TBatchMove::ChangedCount

TBatchMove	Properties	See also

ChangedCount indicates the number of records fromthe Destination table are altered as a result of the batch operation.

Syntax

__property System::Longint ChangedCount;

Description

Use ChangedCount to learn the number of records in the Destination table that are updated if the Mode is batUpdate or batAppendUpdate, or to learn the number that are deleted if the Mode is batDelete.

Set the ChangedTableName property to save the unchanged versions of the altered records to a separate table. ChangedCount is then the number of records in that separate table.


TBatchMove::ChangedTableName

TBatchMove	Properties	See also

ChangedTableName specifies the name of a local Paradox table that is created to hold copies of all records from the destination table that are changed by the batch operation.

Syntax

__property System::AnsiString ChangedTableName;

Description

Set ChangedTableName to create a table that saves all unchanged versions of records that are changed by the batch operation. ChangedTableName must specify the name of a Paradox table. Setting ChangedTableName ensures that no information in the Destination table gets lost when the records are altered or deleted.

When the Mode property is batUpdate or batAppendUpdate, the new table will hold all records that were updated. When the Mode property is batDelete, the new table will hold all records that were deleted.

The ChangedCount property specifies the number of records in the new table.


TBatchMove::CommitCount

TBatchMove	Properties	See also

CommitCount specifies how many records are batch moved before a commit occurs.

Syntax

__property System::Integer CommitCount;

Description

Use CommitCount to chunk a batch operations into smaller operations, CommitCount allows an application to accomodate server transaction logs that are not big enough to handle the entire batch. Setting CommitCount to 0 will cause chunking into the number of records that will fit in 32K bytes.

Note

If the Execute method is called within an explicit transaction on the database containing the tables, CommitCount is ignored.


TBatchMove::Destination

TBatchMove	Properties	See also

Destination specifies the TTable object for the database table that is the destination of the batch operation.

Syntax

__property TTable * Destination;

Description

Use Destination to indicate the database table that will be created or altered by the batch operation. The batch operation affects the Destination differently depending on the Mode:

Mode	Effect on Destination

batAppend	Records are added to the destination table. No pre-existing records are altered. Destination table must already exist.

batUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source records. No new records are added. Destination table must already exist and must have an index defined.

batAppendUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source. Source records that do not match key fields are added to the destination table. Destination table must already exis and must have an index defined.

batDelete	Records in the destination table that match the records in the source are deleted. Destination table must already exist and must have an index defined.

batCopy	Destination table is created to match the records in the source. If Destination already exists, it is replaced by the copy of the source.


TBatchMove::KeyViolCount

TBatchMove	Properties	See also

KeyViolCount reports the number of records which could not be replaced, added, or deleted from Destination because of integrity or key violations.

Syntax

__property System::Longint KeyViolCount;

Description

Use KeyViolCount to learn the number of records form the Source table that could not be applied to the Destination table because of integrity or key violations. To obtain a table of the offending records from the Source table, specify a KeyViolTableName.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.

Note

If AbortOnKeyViol is true, KeyViolCount will never be greater than one, because the first violation will cause the batch operation to terminate.


TBatchMove::KeyViolTableName

TBatchMove	Properties	See also

KeyViolTableName specifies the name of a Paradox table that will be created to contain all records from the Source that cannot participate in the batch operation because of integrity or key violations.

Syntax

__property System::AnsiString KeyViolTableName;

Description

Use KeyViolTableName to obtain a table of records that could not be applied to the Destination table because of integrity or key violations. KeyViolCount has the number of records in the table that is created.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.

Note

If AbortOnKeyViol is true, then there will be at most one record in this table because the operation aborts with that first record.


TBatchMove::Mappings

TBatchMove	Properties	See also

Mappings specifies the column mappings for a batch operation.

Syntax

__property Classes::TStrings * Mappings;

Description

Set Mappings to specify the correspondance between fields in the Source and fields in the Destination. By default TBatchMove matches fields based on their position in the source and destination tables. That is, the first column in the source is matched with the first column in the destination, and so on. Mappings enables an application to override this default.

Mappings is a list of column mappings (one per line) in one of two forms. To map the column ColName in the source table to the column of the same name in the destination table, use:

To map the column named SourceColName in the source table to the column named DestColName in the destination table, use:

When adding or appending records, fields in Destination which have no entry in Mappings will be set to NULL. When copying a dataset, fields in Destination which have no entry in Mappings will not appear as columns in the copy of the table.

If source and destination column data types are not the same, TBatchMove can either cancel the batch operation or perform a "best fit". If AbortOnProblem is true, type mismatches will terminate the batch move. Otherwise, the field values from the Source will be converted, if possible, to be compatible with the Destination.


TBatchMove::Mode

TBatchMove	Properties	See also

Mode specifies what the TBatchMove object does when the Execute method is called.

Syntax

__property TBatchMode Mode;

Description

Use Mode to indicate whether the TBatchMove object should add records, replace records, delete records, or copy the Source. These are the possible values for Mode:

Value	Meaning

batAppend	Append the records in the source to the destination table. The destination table must already exist. This is the default mode.

batUpdate	Replace records in the destination table with matching records from the source table. The destination table must exist and must have an index defined to match records.

batAppendUpdate	If a matching record exists in the destination table, replace it. Otherwise, append records to the destination table. The destination table must exist and must have an index defined to match records.

batCopy	Create the destination table based on the structure of the source table. If the destination already exists, the operation will delete it, and replace it with the new copy of the source.

batDelete	Delete records in the destination table that match records in the source table. The destination table must already exist and must have an index defined.


TBatchMove::MovedCount

TBatchMove	Properties	See also

MovedCount reports the number of records form the Source which were applied to the destination.

Syntax

__property System::Longint MovedCount;

Description

Read MovedCount to learn the number of records fromthe Source that were read during the Execute method. The MovedCount value includes any records which caused key or integrity violations, or which were trimmed.


TBatchMove::ProblemCount

TBatchMove	Properties	See also

ProblemCount indicates the number of records which could not be added to Destination without loss of data due to a field type mismatch.

Syntax

__property System::Longint ProblemCount;

Description

Read ProblemCount to learn the number of records from the Source that had field values which could not be mapped to destination fields without being “trimmed”. If a ProblemTableName is specified, ProblemCount is the number of records in that table.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note

If AbortOnProblem is true, then ProblemCount will be at most one, because the operation aborts when the problem occurs.


TBatchMove::ProblemTableName

TBatchMove	Properties	See also

ProblemTableName specifies the name of a Paradox table that will be created to contain all records from the Source that contain fields which were trimmed to match the corresponding field type in the Destination table.

Syntax

__property System::AnsiString ProblemTableName;

Description

Set ProblemTableName to create a table that holds records from the Source that contain fields that had to be trimmed to be applied to the Destination. ProblemCount will have the number of records placed in the new table. If ProblemTableName is not specified, the data in the record is still trimmed when applied to the destination table, but there will be no easy way to tell which fields were trimmed.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note

If AbortOnProblem is true, then there will be at most one record in this table because the operation aborts with the first record that has a problem.


TBatchMove::RecordCount

TBatchMove	Properties	See also

RecordCount specifies the maximum number of records that are applied to the Destination when Execute is called.

Syntax

__property System::Longint RecordCount;

Description

Use RecordCount to limit the number of Source records that are applied to the Destination. If zero, all records are added, subtracted, or copied, beginning with the first record in Source. If RecordCount is greater than zero, up to RecordCount records are applied to the Destination, starting with the current record in the dataset. If RecordCount exceeds the number of records remaining in Source, no wraparound occurs; the operation is terminated.


TBatchMove::Source

TBatchMove	Properties	See also

Source specifies the dataset that is the source of the batch operation.

Syntax

__property Db::TDataSet * Source;

Description

Use Source to indicate the dataset that contains the records that will be added to, subtracted from, or copied to the Destination. The Mode affects how the Source records are applied to the Destination:

Mode	Effect on Destination

batAppend	Records are added to the destination table.

batUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source records.

batAppendUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source. Source records that do not match key fields are added to the destination table.

batDelete	Records in the destination table that match the records in the source are deleted.

batCopy	Destination table is created to match the records in the source.


TBatchMove::Transliterate

TBatchMove	Properties	See also

Transliterate specifies whether the data in the Source records should be converted form the locale of the Source to the locale of the Destination when the Execute method is called.

Syntax

__property System::Boolean Transliterate;

Description

Set Transliterate to true when the Source dataset and the Destination table use different language drivers and the data may contain extended ascii characters. Set Transliterate to false to avoid the overhead of the character set conversion when both the Source and the Destination use the same language driver or the data does not contain extended ascii characters.


TBatchMove methods

TBatchMove	Alphabetically

In TBatchMove

~TBatchMove

Execute

TBatchMove

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBatchMove methods

TBatchMove	By object

~TBatchMove

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TBatchMove


TBatchMove::Execute

TBatchMove	Methods	See also

Execute performs the batch operation specified by Mode.

Syntax

void __fastcall Execute(void);

Description

After setting properties to indicate what batch operation should be performed and how, call Execute to perform the operation. At a minimum, the Mode, Source, and Destination properties must be set.

After calling Execute, the values of the ChangedCount, KeyViolCount, MovedCount, ProblemCount, and RecordCount properties will become available. These properties will give an indication of what happened as a result of the call to Execute. Additional information about the batch operation will be available through the creation of a changed table, a keyviol table, and/or a problems table if it was requested.


TBatchMove::TBatchMove

TBatchMove	Methods	See also

TBatchMove creates a new TBatchMove object.

Syntax

__fastcall virtual TBatchMove(Classes::TComponent *AOwner);

Description

Use TBatchMove to create a new TBatchMove object.


TBatchMove::~TBatchMove

TBatchMove	Methods	See also

~TBatchMove frees the memory associated with the TBatchMove object.

Syntax

__fastcall virtual ~TBatchMove(void);

Description

Do not call ~TBatchMove directly. Instead, use the delete keyword on the object, which causes ~TBatchMove to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TBatchMove example

TBatchMove


TBDECallback

Hierarchy	Methods	See also

TBDECallback is a wrapper for a Borland Database Engine (BDE) callback function.

Header

vcl/db.hpp

Description

Use a TBDECallback object to register a callback function with the BDE. Callbacks allow an application to instruct the BDE to take particular actions in response to events that occur during a BDE function call.

For example, the TBatchMove object may encounter problems when the corresponding BDE batch operation is called. A callback function can respond to those problems by instructing the BDE to generate a problems table or to trim the data so that the operation succeeds.

To use a TBDECallback object, use the following steps:

1	Create an instance of TBDECallback to register the callback with the BDE.

2	Call the BDE function within which the pertinent events can take place. For example, create an instance of TBatchMove, and call its Execute method.

3	After the BDE function returns, destroy the TBDECallback object to unregister the callback function.


TBDECallback methods

TBDECallback	Alphabetically

In TBDECallback

~TBDECallback

TBDECallback

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBDECallback methods

TBDECallback	By object

~TBDECallback

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TBDECallback


TBDECallback::TBDECallback

TBDECallback	Methods	See also

TBDECallback creates a new TBDECallback object.

Syntax

__fastcall TBDECallback(System::TObject *AOwner, Bde::hDBICur Handle, Bde::CBType CBType, System::Pointer

Description

Use TBDECallback to create a new TBDECallback object.


TBDECallback::~TBDECallback

TBDECallback	Methods	See also

~TBDECallback frees the memory associated with the TBDECallback object.

Syntax

__fastcall virtual ~TBDECallback(void);

Description

Do not call ~TBDECallback directly. Instead, use the delete keyword on the object, which causes ~TBDECallback to be invoked automatically.


Hierarchy

TObject


TBDECallback example

TBDECallback


TBevel

Hierarchy	Properties	Methods

TBevel lets you put beveled lines, boxes, or frames on the forms in your application.

Header

vcl/extctrls.hpp

You determine if the bevel appears as a box, frame, or line using the Shape property. The bevel can appear raised or lowered, depending on the value selected for the Style property.

To keep the bevel aligned within the form so that even if the user resizes the form, the bevel remains in the same relative position, set the Align property.

In addition to these properties and methods, the TBevel component also has the properties and methods that apply to all controls and component is a direct descendent of TGraphicControl.


TBevel properties

TBevel	Alphabetically	Legend

In TBevel

Shape

Style

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TBevel properties

TBevel	By object	Legend

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

Height

Hint

Left

Name

Owner

ParentShowHint

Parent

Shape

ShowHint

Style

Tag

Top

Visible

Width


TBevel::Shape

TBevel	Properties

Determines the shape the bevel control assumes.

Syntax

__property TBevelShape Shape;

These are the possible values:

Value	Meaning

bsBox	The bevel assumes a box shape.

bsFrame	The bevel assumes a frame shape.

bsTopLine	The bevel becomes a line at the top of the bevel control.

bsBottomLine	The bevel becomes a line at the bottom of the bevel control.

bsLeftLine	The bevel becomes a line at the left side of the bevel control.

bsRightLine	The bevel becomes a line at the right side of the bevel control.


TBevel::Style

TBevel	Properties

Determines if the bevel is raised or lowered.

Syntax

__property TBevelStyle Style;

These are the possible values:

Value	Meaning

bsLowered	The bevel is lowered.

bsRaised	The bevel is raised.


TBevel methods

TBevel	Alphabetically

In TBevel

~TBevel

TBevel

Derived from TGraphicControl

BeginDrag

Derived from TControl

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBevel methods

TBevel	By object

~TBevel

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TBevel

Update


TBevel::TBevel

TBevel	Methods	See also

TBevel creates a new TBevel object.

Syntax

__fastcall virtual TBevel(Classes::TComponent *AOwner);

Description

Use TBevel to create a new TBevel object.


TBevel::~TBevel

TBevel	Methods	See also

~TBevel frees the memory associated with the TBevel object.

Syntax

__fastcall virtual ~TBevel(void);

Description

Do not call ~TBevel directly. Instead, use the delete keyword on the object, which causes ~TBevel to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TBevel example

TBevel


TBinaryField

Hierarchy	Properties	Methods	Events	See also

A TBinaryField component represents an untyped binary field in a dataset.

Header

vcl/dbtables.hpp

Description

TBinaryField is an abstract object that encapsulates the fundamental behavior common to untyped binary fields. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TBinaryField reimplements the properties that are needed to read and write binary data from or to the underlying database table.

Do not create instances of TBinaryField. TBinaryField descendants are created automatically each time a dataset is activated.


TBinaryField properties

TBinaryField	Alphabetically	Legend

In TBinaryField

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBinaryField properties

TBinaryField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBinaryField::AsVariant

TBinaryField	Properties	See also

AsVariant converts the value of a binary field to or from a variant array of Byte values.

Syntax

Description

Use AsVariant to read or write the value of the field as a variant array of byte values. For example, this code assigns a variant array of bytes to a binary field value:

To assign a binary field value to a variant variable, use code similar to this:

Because binary fields are stored in their database tables as unformatted arrays of bytes, the AsVariant property for a binary field is the same as the Value property.


TBinaryField::Value

TBinaryField	Properties	See also

Value is the actual data in the binary field.

Syntax

virtual void __fastcall SetVarValue(const System::Variant &Value);

Description

Use Value to read data directly from and write data directly to a binary field component at run time. For binary fields, the Value property is equivalent to the AsVariant property.


TBinaryField events

TBinaryField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBinaryField events

TBinaryField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBinaryField methods

TBinaryField	Alphabetically

In TBinaryField

~TBinaryField

TBinaryField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBinaryField methods

TBinaryField	By object

~TBinaryField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBinaryField


TBinaryField::TBinaryField

TBinaryField	Methods	See also

TBinaryField creates a new TBinaryField object.

Syntax

__fastcall virtual TBinaryField(Classes::TComponent *AOwner);

Description

Use TBinaryField to create a new TBinaryField object.


TBinaryField::~TBinaryField

TBinaryField	Methods	See also

~TBinaryField frees the memory associated with the TBinaryField object.

Syntax

__fastcall virtual ~TBinaryField(void);

Description

Do not call ~TBinaryField directly. Instead, use the delete keyword on the object, which causes ~TBinaryField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBinaryField example

TBinaryField


TBitBtn

Hierarchy	Properties	Methods	Events	See also

TBitBtn is a push button control that can include a bitmap on its button face.

Header

vcl/buttons.hpp

Description

Bitmap buttons have the general behavior of button controls. Use them to initiate actions, usually within dialog boxes.

Bitmap buttons have additional properties used to specify the bitmap images, their appearance and placement on the button. You can choose from predefined bitmap buttons styles or use your own, customized bitmap for the button. You can select different bitmap images to represent different states of the button (selected, unselected, clicked, disabled and so on). Use other properties to select multiple bitmaps or to change the arrangement of bitmaps and captions on the button.

Properties of bitmap buttons also allow you to easily set them up as buttons of a particular kind (Ok, Cancel, Help and so on) that will have the appropriate graphical image and default behavior.


TBitBtn properties

TBitBtn	Alphabetically	Legend

In TBitBtn

Glyph

Kind

Layout

Margin

NumGlyphs

Spacing

Style

Derived from TButton

Cancel

Default

ModalResult

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TBitBtn properties

TBitBtn	By object	Legend

Align

BoundsRect

Brush

Cancel

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

Default

DesignInfo

DragCursor

DragMode

Enabled

Font

Glyph

Handle

Height

HelpContext

Hint

Kind

Layout

Left

Margin

ModalResult

Name

NumGlyphs

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

Spacing

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TBitBtn::Glyph

TBitBtn	Properties

Specifies the bitmap that appears on the selected bitmap button or on a speed button.

Syntax

__property Graphics::TBitmap * Glyph;

Description

Use the Open dialog box that appears as an editor in the Object Inspector to choose a bitmap file (with a .BMP extension) to use on the button, or specify a bitmap file at run time.

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++ Builder then displays one of these images depending on the state of the button.

Image position in bitmap	Button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++ Builder also uses this image for all other images.

Second	Disabled	This image usually appears dimmed to indicate that the button can't be selected.

Third	Down	This image appears when a button is clicked. The up state image reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected. (This fourth state applies only to speed buttons.)

If only one image is present, Borland C++ Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren't satisfied with the results, you can provide one or more additional images in the bitmap.

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a horizontal row.

Note


TBitBtn::Kind

TBitBtn	Properties

Determines the kind of bitmap button.

Syntax

__property TBitBtnKind Kind;

Description

The TBitBtnKind type contains the values the Kind property of a TBitBtn bitmap button can assume.

These are the possible values and their meanings:

Table Part 0.1

Value	Meaning

bkCustom	You indicate which bitmap you want the bitmap button to have by setting the value of the Glyph property to the bitmap of your choice. Like push buttons, you can either select a ModalResult for the button, or you can supply the code to respond to an OnClick event.

bkOK	A green check mark and the text "OK" appear on the button face. The button becomes the default button (the Default property is automatically set to true). When the user chooses the button, the dialog box closes. The resulting ModalResult value of the bitmap button is mrOK.

bkCancel	A red X and the text "Cancel" appear on the button face. The button becomes the Cancel button (the Cancel property is automatically set to true). When the user chooses the button, the dialog box closes. The resulting ModalResult value of the bitmap button is mrCancel.

bkYes	A green check mark and the text "Yes" appear on the button face. The button becomes the default button (the Default property is automatically set to true). When the user chooses the button, any changes the user made in the dialog box are accepted and the dialog box closes. The resulting ModalResult value of the bitmap button is mrYes.

bkNo	A red no symbol and the text "No" appear on the button face. The button becomes the Cancel button (the Cancel property is automatically set to true). When the user chooses the button, any changes the user made in the dialog box are canceled and the dialog box closes. The resulting ModalResult value of the bitmap button is mrNo.

bkHelp	A cyan question mark and the text "Help" appear on the button face. When the user chooses the button, a Help screen in the application's Help file appears. The Help file that appears is the file specified as the value of the application's HelpFile property. The value of the HelpContext property of the button specifies which Help screen in the Help file appears.

bkClose	A door with a green exit sign over it (use your imagination) and the text "Close" appear on the button face. When the user chooses the button, the form closes. The Default property of the button is true.

bkAbort	A red X and the text "Abort" appear on the button face.

bkRetry	A green circular arrow and the text "Retry" appear on the button face.

bkIgnore	A green man walking away and the text "Ignore" appear on the button face. Use it to allow the user to continue after an error has occurred.


TBitBtn::Layout

TBitBtn	Properties

Determines where the image appears on the bitmap button or a speed button.

Syntax

__property TButtonLayout Layout;

Description

The TButtonLayout type defines the values the Layout property of a bitmap button (TBitBtn). These are the possible values.:

Table Part 0.2

Value	Meaning

blGlyphLeft	The image appears near the left side of the button.

blGlyphRight	The image appears near the right side of the button.

blGlyphTop	The image appears near the top of the button.


TBitBtn::Margin

TBitBtn	Properties

Determines the number of pixels between the edge of the image (specified in the Glyph property) and the edge of the button.

Syntax

__property System::Integer Margin;

Description

The edges that the margin separates depends on the layout of the image and text (specified in the Layout property). For example, if Layout is blGlyphLeft, the margin appears between the left edge of the image and the left edge of the button. If Margin is 3, three pixels separates the image and the button edges. If Margin is 0, no distance in pixels separates the image and the button edges.


TBitBtn::NumGlyphs

TBitBtn	Properties

Indicates the number of images that are in the graphic specified in the Glyph property for use on a bitmap button or speed button.

Syntax

__property TNumGlyphs NumGlyphs;

Description

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a row. Valid NumGlyphs values are 1 to 4. The default value is 1.

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++ Builder then displays one of these images depending on the state of the button. Only one image is required in a bitmap.

Table Part 0.3

Image position in bitmap	Speed button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++ Builder uses this image for all other images.

Second	Disabled	This image usually appears dimmed and indicates that the button can't be selected.

Third	Down	This image appears when a button is clicked. The up state image then reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected.

If only one image is present, Borland C++ Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren't satisfied with the results, you can provide additional images in the bitmap.


TBitBtn::Spacing

TBitBtn	Properties

Determines where the image and text appear on a bitmap or speed button.

Syntax

__property System::Integer Spacing;

Description

Spacing determines the number of pixels between the image (specified in the Glyph property) and the text (specified in the Caption property). The default value is 4 pixels.


TBitBtn::Style

TBitBtn	Properties

Determines the appearance of a bitmap button.

Syntax

__property TButtonStyle Style;

Description

The TButtonStyle type contains the values the Style property of bitmap buttons can assume.

These are the possible values:

Table Part 0.4

Value	Meaning

bsAutoDetect	When you are using Windows 3.x, the bitmap button uses the standard Windows 3.x look. When you are using a later version of Windows, the bitmap button uses a newer look.

bsWin31	Uses the standard Windows 3.1 look, regardless of which version of Windows you are running.


TBitBtn events

TBitBtn	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TBitBtn events

TBitBtn	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TBitBtn methods

TBitBtn	Alphabetically

In TBitBtn

~TBitBtn

Click

TBitBtn

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBitBtn methods

TBitBtn	By object

~TBitBtn

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TBitBtn

UpdateControlState

Update


TBitBtn::Click

TBitBtn	Methods

Simulates a mouse click, as if the user had clicked a button, executing any code attached to the OnClick event.

Syntax

virtual void __fastcall Click(void);

Description


TBitBtn::TBitBtn

TBitBtn	Methods	See also

TBitBtn creates a new TBitBtn object.

Syntax

__fastcall virtual TBitBtn(Classes::TComponent *AOwner);

Description

Use TBitBtn to create a new TBitBtn object.


TBitBtn::~TBitBtn

TBitBtn	Methods	See also

~TBitBtn frees the memory associated with the TBitBtn object.

Syntax

__fastcall virtual ~TBitBtn(void);

Description

Do not call ~TBitBtn directly. Instead, use the delete keyword on the object, which causes ~TBitBtn to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TButton


TBitBtn example

TBitBtn


TBitmap

Hierarchy	Properties	Methods	Events	See also

TBitmap is an encapsulation of a Windows HBITMAP and HPALETTE.

Header

vcl/graphics.hpp

Description

TBitmap contains a bitmap graphic (.BMP file format) (is it a DDB or DIB?)

and manages the realizing of the palette automatically.

To draw a bitmap on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TBitmap as a parameter.

It manages the palette realizing automatically as well as having a Canvas to allow modifications to the palette.  Creating copies of a TBitmap is very fast since the handles is copied not the image.  If the image is modified, and the handle is shared by more than one TBitmap object, the image is copied before the modification is performed (i.e. copy on write).

Handle - The HBITMAP encapsulated by the TBitmap.  Grabbing the handle directly should be avoided since it causes the HBITMAP to be copied if more than one TBitmap share the handle.

      Palette - The HPALETTE realized by the TBitmap.  Grabbing this handle directly should be avoided since it causes the HPALETTE to be copied if more than one TBitmap share the handle.

The canvas of the TBitmap is a TCanvas object specified by the Canvas property. The palette of the TBitmap is specified by the Palette property.

The height and width in pixels of the bitmap are specified by the Height and Width properties, respectively.

If the Monochrome property is set to false, the bitmap is displayed in color. If Monochrome is set to true, the bitmap is converted to a monochrome format.

To load a bitmap from a file, call the LoadFromFile method. To load a bitmap from a resource along with palette information by name or resource ID, use LoadFromResourceName or LoadFromResourceID. To save a bitmap to a file, call SaveToFile.


TBitmap properties

TBitmap	Alphabetically	Legend

In TBitmap

Canvas

Empty

Handle

Height

IgnorePalette

Monochrome

Palette

TransparentColor

Width

Derived from TGraphic

Modified


TBitmap properties

TBitmap	By object	Legend

Canvas

Empty

Handle

Height

IgnorePalette

Modified

Monochrome

Palette

TransparentColor

Width


TBitmap::Canvas

TBitmap	Properties	See also

Canvas provides access to a drawing surface that represents the bitmap.

Syntax

__property TCanvas * Canvas;

Description

Canvas allows drawing on the bitmap by providing a TCanvas object for this purpose. Drawing on the canvas effectively modifies the underlying bitmap. Use the Canvas property by calling the Draw and StretchDraw methods of the Canvas object represented by the Canvas property. The bitmap object is passed as a parameter to these methods.

check up on the Modified property and OnChange

A canvas object is created automatically for the bitmap and the property is read-only. NOT-DONE


TBitmap::Empty

TBitmap	Properties	See also

Empty specifies whether the bitmap object contains a bitmap.

Syntax

Description

Use Empty to determine if a bitmap has been loaded into the bitmap object.

Empty is true if the bitmap contains a bitmap image, and false if it does not. OK


TBitmap::Handle

TBitmap	Properties

Handle provides access to the Windows GDI bitmap handle for accessing the GDI bitmap object.

Syntax

__property System::Integer Handle;

Description

Use Handle to call a Windows API function that requires the handle of a bitmap object. Pass Handle as the bitmap handle parameter to these functions. OK


TBitmap::Height

TBitmap	Properties	See also

Height specifies the vertical size of the bitmap in pixels.

Syntax

Description

Use Height to find or set the height of the bitmap image. If the Height property is changed, the bitmap image is copied to a new image with the new Height. NOT-OK


TBitmap::IgnorePalette

TBitmap	Properties	See also

IgnorePalette determines whether the bitmap realizes its palette when drawing its image.

Syntax

__property System::Boolean IgnorePalette;

Description

Use IgnorePalette when speed of drawing is a priority. When IgnorePalette is true, the bitmap does not realize its palette when drawing itself, resulting in lower picture quality on 256 color video drivers, but faster drawing of the bitamp image. OK

Note

Borland C++ Builder uses IgnorePalette only when a TDBImage is replicated in a TDBCtrlGrid.


TBitmap::Monochrome

TBitmap	Properties

Monochrome determines whether the bitmap displays its image in monochrome. NOT-OK

Syntax

__property System::Boolean Monochrome;

Description

If Monochrome is true if the bitmap displays as a monochrome bitmap. Monochrome is false if the bitmap displays in color. (can this be changed or is it just informative?) - NOT-OK

see line 3975 in graphics for creating a monchrome bitmap if the monochrome prop is set to true. this function is called at some point after the monochrome proeprty is set . . . so it should work and there is a bug . . .

according to danny there is a BUG in this and it SHOULD change a color

bitmap to mono and vice versa but the handle needs to be touched first.

this doesn’t look like it’s repainting a color bitmap as monochrome but rather, holding info on whether or not the bitmap IS monochrome so it can call SetStretchBltMode if it’s color ??????????


TBitmap::Palette

TBitmap	Properties

Palette controls a bitmap’s color mapping.

Syntax

__property System::Integer Palette;

Description

Use Palette to change the palette for the bitmap. tried switching a black and white bitmap palette with a color one and the color bitmap stayed color????

and, how is this supposed to be used . . . old docs say to call the CreatePalette WinAPI function, but couldn’t they just reset the Palette property??????????

Use Palette to assign custom palettes created with CreatePalette to this property. Palette contains up to 256 colors that can be used to display the bitmap on screen

.

When running in a 256 color video mode, and if the bitmap is drawn by an application running in the foreground, all colors of Palette will be added to the Windows system palette. If the bitmap is drawn by an application running in the background and another application has loaded the system palette with its own colors, the bitmap's colors will be mapped to the system palette. Palette=0 if the bitmap has no palette. NOT-OK


TBitmap::TransparentColor

TBitmap	Properties	See also

TransparentColor returns the color of the bitmap when it is transparent.

Syntax

__property TColor TransparentColor;

Description

Use TransparentColor to find the color of the transparent “mode” (figure out a word for this) of the bitmap. TransparentColor is read-only and cannot be modified. A bitmap is transparent when . . . NOT-OK


TBitmap::Width

TBitmap	Properties

Width specifies the width of the bitmap in pixels.

Syntax

Description

Use Width to find or set the width of the bitmap. is this used for stretching the bitmap??????????????????? NOT-OK


TBitmap events

TBitmap	Alphabetically

Derived from TGraphic

OnChange


TBitmap events

TBitmap	By object

OnChange


TBitmap methods

TBitmap	Alphabetically

In TBitmap

~TBitmap

Assign

Dormant

FreeImage

LoadFromClipboardFormat

LoadFromResourceID

LoadFromResourceName

LoadFromStream

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToStream

TBitmap

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBitmap methods

TBitmap	By object

~TBitmap

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Dormant

FieldAddress

FreeImage

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromResourceID

LoadFromResourceName

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToFile

SaveToStream

TBitmap


TBitmap::Assign

TBitmap	Methods	See also

[GENERIC - modified for TBitmap - the last paragraph]

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assign assigns an object to the bitmap. reword this

Description

The Assign method assigns one object to another. The general form of a call to Assign is

which tells the Destination object to assign the contents of the Source object to itself.

In general, the statement "Destination = Source" is not the same as the statement "Destination.Assign(Source)". The statement "Destination = Source" makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object references by Source into the object referenced by Destination.

If Destination is a property of some object, however, and that property is not a reference to another object (such as the ActiveControl property of a form, or the DataSource property of a data-aware control), then the statement "Destination = Source" is the same as "Destination.Assign(Source)". Consider these statements:

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at run time only if (the conversion rules are laid out) the objects involved "know" how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at run time.

An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a bitmap.


TBitmap::Dormant

TBitmap	Methods	See also

Dormant creates a memory bitmap image in order to release the bitmap handle and save resources.

Syntax

void __fastcall Dormant(void);

Description

Use Dormant to reduce the amount of GDI resources used by the application.

Dormant creates a bitmap image in memory using a memory stream object. This preserves the image so that the bitmap can then free the HBITMAP (accessed through the Handle property) that was assigned to it. OK


TBitmap::FreeImage

TBitmap	Methods

FreeImage frees the cached file image stored in memory by the bitmap.

Syntax

void __fastcall FreeImage(void);

Description

Use FreeImage to reduce the memory requirements of an application when color depth is not an issue. Freeing the image releases the memory allocated for the bitmap image, at the same time loosing some of the color depth of the bitmap.

When a bitmap is loaded into a bitmap object, Borland C++ Builder creates an image of the loaded bitmap in memory. If the bitmap isn't changed, the memory image is used when saving the bitmap, to verify that the bitmap has not lost color depth. OK


TBitmap::LoadFromClipboardFormat

TBitmap	Methods	See also

LoadFromClipboardFormat loads a bitmap from the Clipboard into the bitmap object.

Syntax

virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer

Description

Use LoadFromClipboardFormat

is called if the TBitmap is registered with the TPicture object using the RegisterClipboardFormat method.

LoadFromClipboardFormat replaces the current image with the data pointed to by the AData parameter. The palette for the bitmap is specified by the APalette parameter.


TBitmap::LoadFromResourceID

TBitmap	Methods

LoadFromResourceName loads a bitmap from a resource into the bitmap object.

Syntax

void __fastcall LoadFromResourceID(System::Integer Instance, System::Integer ResID);

Description


TBitmap::LoadFromResourceName

TBitmap	Methods

LoadFromResourceName loads a bitmap resource into the bitmap object.

Syntax

void __fastcall LoadFromResourceName(System::Integer Instance, const System::AnsiString ResName);

Description

The LoadFromResourceName method loads the specified bitmap resource along with palette information from a module's executable file. Specify the resource to be loaded as the value of ResName.


TBitmap::LoadFromStream

TBitmap	Methods	See also

LoadFromStream loads the bitmap from a stream into the bitmap object.

Syntax

virtual void __fastcall LoadFromStream(Classes::TStream *Stream);

Description

Use LoadFromStream to . . .

specify the stream from which the bitmap is to be loaded as the value of Stream.


TBitmap::ReleaseHandle

TBitmap	Methods

ReleaseHandle returns the handle to the bitmap so that the TBitmap object no longer knows about the handle.

Syntax

System::Integer __fastcall ReleaseHandle(void);

Description

Use ReleaseHandle to


TBitmap::ReleasePalette

TBitmap	Methods

ReleasePalette returns the handle to the bitmap's palette and disassociates the palette from the TBitmap object.

Syntax

System::Integer __fastcall ReleasePalette(void);

Description

Use ReleasePalette to


TBitmap::SaveToClipboardFormat

TBitmap	Methods

SaveToClipboardFormat saves a bitmap to a Clipboard format.

Syntax

virtual void __fastcall SaveToClipboardFormat(System::Word &Format, System::Integer &Data, System::Integer

Description

Use SaveToClipboardFormat to

Specify the palette as the value of the APalette parameter, the format as the value of AFormat, and data to be saved as the value of AData. Before the bitmap can be saved, an application must have registered the format with the TBitmap object using the RegisterClipboardFormat method.


TBitmap::SaveToStream

TBitmap	Methods

SaveToStream saves the bitmap to a stream.

Syntax

virtual void __fastcall SaveToStream(Classes::TStream *Stream);

Description

Use SaveToStream to

Specify the stream to save the bitmap to as the value of Stream.


TBitmap::TBitmap

TBitmap	Methods	See also

TBitmap creates a new TBitmap object.

Syntax

__fastcall virtual TBitmap(void);

Description

Use TBitmap to create a new TBitmap object.


TBitmap::~TBitmap

TBitmap	Methods	See also

~TBitmap frees the memory associated with the TBitmap object.

Syntax

__fastcall virtual ~TBitmap(void);

Description

Do not call ~TBitmap directly. Instead, use the delete keyword on the object, which causes ~TBitmap to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TBitmap example

TBitmap


TBits

Hierarchy	Properties	Methods

TBits is an object that is used to store an "array" of Boolean values.

Header

vcl/classes.hpp

Overview

The TBits class can store as many Boolean values as can fit in available memory, automatically expanding its storage space as needed to store additional values. You can do something similar by using Object Pascal sets or the bitwise "and" and "or" operators against an integer type variable, but that's limited to 32 Boolean values (the maximum number of entries in a set type and bits in the Integer and Longint types).


TBits properties

TBits	Alphabetically

In TBits

Bits

Size


TBits properties

TBits	By object

Bits

Size


TBits::Bits

TBits	Properties

Returns or sets the value stored at the specified index.

Syntax

__property System::Boolean Bits[System::Integer Index];

If Index isn't in the range 0..Size  1, an EBitsError exception is raised.


TBits::Size

TBits	Properties

Represents the number of Boolean values the TBits object can hold.

Syntax

__property System::Integer Size;

You can set Size to expand or shrink the number of values being held. If you expand the size, the new entries are set to false. If you shrink the size, values whose indexes are less than or equal to the new size are preserved; entries whose indexes are greater than the new size are lost.


TBits methods

TBits	Alphabetically

In TBits

~TBits

OpenBit

TBits

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBits methods

TBits	By object

~TBits

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OpenBit

TBits


TBits::OpenBit

TBits	Methods

Returns the index of the first false value.

Syntax

System::Integer __fastcall OpenBit(void);


TBits::TBits

TBits	Methods	See also

TBits creates a new TBits object.

Syntax

__fastcall TBits(void);

Description

Use TBits to create a new TBits object.


TBits::~TBits

TBits	Methods	See also

~TBits frees the memory associated with the TBits object.

Syntax

__fastcall virtual ~TBits(void);

Description

Do not call ~TBits directly. Instead, use the delete keyword on the object, which causes ~TBits to be invoked automatically.


Hierarchy

TObject


TBits example

TBits


TBookmarkList

Hierarchy	Properties	Methods

Header

vcl/dbgrids.hpp

Description


TBookmarkList properties

TBookmarkList	Alphabetically	Legend

In TBookmarkList

Count

CurrentRowSelected

Items


TBookmarkList properties

TBookmarkList	By object	Legend

Count

CurrentRowSelected

Items


TBookmarkList::Count

TBookmarkList	Properties

Syntax

__property System::Integer Count;

Description


TBookmarkList::CurrentRowSelected

TBookmarkList	Properties

Syntax

__property System::Boolean CurrentRowSelected;

Description


TBookmarkList::Items

TBookmarkList	Properties

Syntax

__property System::AnsiString Items[System::Integer Index];

Description


TBookmarkList methods

TBookmarkList	Alphabetically

In TBookmarkList

~TBookmarkList

Clear

Delete

Find

IndexOf

Refresh

TBookmarkList

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBookmarkList methods

TBookmarkList	By object

~TBookmarkList

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

FieldAddress

Find

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Refresh

TBookmarkList


TBookmarkList::Clear

TBookmarkList	Methods

Syntax

void __fastcall Clear(void);

Description


TBookmarkList::Find

TBookmarkList	Methods

Syntax

System::Boolean __fastcall Find(const System::AnsiString Item, System::Integer &Index);

Description


TBookmarkList::IndexOf

TBookmarkList	Methods

Syntax

System::Integer __fastcall IndexOf(const System::AnsiString Item);

Description


TBookmarkList::Refresh

TBookmarkList	Methods

Syntax

System::Boolean __fastcall Refresh(void);

Description


TBookmarkList::TBookmarkList

TBookmarkList	Methods	See also

TBookmarkList creates a new TBookmarkList object.

Syntax

__fastcall TBookmarkList(TCustomDBGrid *AGrid);

Description

Use TBookmarkList to create a new TBookmarkList object.


TBookmarkList::~TBookmarkList

TBookmarkList	Methods	See also

~TBookmarkList frees the memory associated with the TBookmarkList object.

Syntax

__fastcall virtual ~TBookmarkList(void);

Description

Do not call ~TBookmarkList directly. Instead, use the delete keyword on the object, which causes ~TBookmarkList to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TBookmarkList example

TBookmarkList


TBlobField

Hierarchy	Properties	Methods	Events	See also

The TBlobField component represents a field in a dataset that holds a reference to a binary large object (BLOB).

Header

vcl/dbtables.hpp

Description

BLOB fields are database fields that contain binary data of arbitrary length. Unlike binary fields, BLOB fields do not store the binary data directly in the database table. Instead, the field in the physical database table contains a reference to a separate file that contains the individual BLOB value for the field.

TBlobField introduces new methods to support streaming of the data of the BLOB field.

As a descendent of TField, TBlobField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.

BLOB field components can represent different arbitrarily large data types. These are distinguished by the header of the actual binary data. In addition to the field types supported directly by TBlobField, TBlobField is the direct ancestor of two BLOB field components: TMemoField (ftMemo) and TGraphicField (ftGraphic).


TBlobField properties

TBlobField	Alphabetically	Legend

In TBlobField

AsString

AsVariant

BlobType

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBlobField properties

TBlobField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

BlobType

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBlobField::AsString

TBlobField	Properties	See also

AsString converts the value of the BLOB field to or from a string value.

Syntax

Description

Use AsString to assign the BLOB field value to a string or assign a string value to the BLOB field.

For example, this code assigns a string value to a BLOB field value:

To assign a BLOB field value to a string value, use code similar to this:

Typically, using AsString makes sense only if the BLOB contains text, such as that in a memo field component. The Borland C++ Builder string data type can, however, store binary data as well. Thus, even BLOB fields for non-textual BLOB types such as ftGraphic or ftTypedBinary can use the AsString property.

Use the AsString property rather than the Text property to set the BLOB field’s value to textual data. Trying to set the Text property will raise an exception.


TBlobField::AsVariant

TBlobField	Properties	See also

AsVariant converts the value of BLOB field to or from a variant value.

Syntax

Description

Use AsVariant to:

•	Assign the BLOB field value to variant value.

•	Assign a variant value to the BLOB field.

Using variants is useful when you don't know the actual field type and don't want to use one of the other As... properties to convert the field value to another type.


TBlobField::BlobType

TBlobField	Properties	See also

BlobType identifies the type of the BLOB field associated with a BLOB field object.

Syntax

__property TBlobType BlobType;

Description

Use BlobType to set or read the data type for the BLOB data associated with the field component.

Specifying BLOB types when using a TBlobField component to represent a BLOB type that isn’t directly supported (such as a formatted memo BLOB) ensures that the BLOB type in the table matches what you expect to work with.

TBlobType is a range of TFieldType values. These are the values included within that range:

Value	Description

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBase OLE field

ftTypedBinary	Typed binary field


TBlobField::Value

TBlobField	Properties	See also

Value is the actual data in the BLOB field.

Syntax

void __fastcall SetBlobType(TBlobType Value);

Description

Use Value to read data directly from and write data directly to a BLOB field component at run time. For BLOB fields, the Value property is equivalent to the AsString property.

Note

The Borland C++ Builder string data type can store binary data as well as text. Thus, even BLOB fields for non-textual BLOB types such as ftGraphic or ftTypedBinary can get or set their data using a string.


TBlobField events

TBlobField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBlobField events

TBlobField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBlobField methods

TBlobField	Alphabetically

In TBlobField

~TBlobField

Assign

Clear

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

SetText

TBlobField

Derived from TField

AssignValue

FocusControl

GetData

IsValidChar

SetData

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBlobField methods

TBlobField	By object

~TBlobField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SaveToFile

SaveToStream

SetData

SetFieldType

SetText

TBlobField


TBlobField::Assign

TBlobField	Methods	See also

Assign copies a value to the BLOB field.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Use Assign to copy data to the BLOB field. Assign will assign the Value of a BLOB field from

•	Another BLOB field

•	A TStrings object

•	A TBitmap object, if the BlobType is ftGraphic or ftTypedBinary

•	A TPicture object, if the BlobType is ftGraphic or ftTypedBinary

•	Any object that supports TBlobField in its AssignTo method


TBlobField::Clear

TBlobField	Methods	See also

Clear clears the current value in the BLOB field.

Syntax

virtual void __fastcall Clear(void);

Description

Use Clear to delete the current value in the field and leave the field without a value.


TBlobField::LoadFromFile

TBlobField	Methods	See also

LoadFromFile loads a BLOB from a file into the field.

Syntax

void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Use LoadFromFile to load the contents of a file into a BLOB field. Specify the name of the file to load into the field as the value of the FileName parameter.


TBlobField::LoadFromStream

TBlobField	Methods	See also

LoadFromStream loads a BLOB from a stream into the field.

Syntax

void __fastcall LoadFromStream(Classes::TStream *Stream);

Description

Use LoadFromStream to copy the contents of a stream into the BLOB field. Specify the stream from which the field’s value is copied as the value of the Stream parameter.


TBlobField::SaveToFile

TBlobField	Methods	See also

SaveToFile saves the contents of the BLOB field to a file.

Syntax

void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Use SaveToFile to save the contents of the BLOB field to a file. Specify the name of the file as the value of the FileName parameter.


TBlobField::SaveToStream

TBlobField	Methods	See also

SaveToStream saves the contents of the BLOB field to a stream.

Syntax

void __fastcall SaveToStream(Classes::TStream *Stream);

Description

Use SaveToStream to copy the contents of a BLOB field to a stream. Specify the name of the stream to which the field’s value is saved as the value of the Stream parameter.


TBlobField::SetFieldType

TBlobField	Methods	See also

SetFieldType specifies the specific type of BLOB field.

Syntax

virtual void __fastcall SetFieldType(Db::TFieldType Value);

Description

Use SetFieldType to override the normal determination of what the field type of should be.

Normally, the type of the physical database field is checked and a TFieldType is selected that matches most closely. For BLOB fields, you might want to be more specific about what kind of BLOB is in the database. Specify the BLOB type as the value of the Value parameter.

These following table contains the possible values for BLOB fields. Calling SetFieldType with any other data type will do nothing::

Value	Description

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBase OLE field

ftTypedBinary	Typed binary field

Note

Calling SetFieldType does the same thing as setting the BlobType property.


TBlobField::SetText

TBlobField	Methods	See also

SetText raises an exception for BLOB field components .

Syntax

virtual void __fastcall SetText(const System::AnsiString Value);

Description

SetText prevents data-aware controls from storing the ‘(fieldname)’ string back into the dataset. To set the Value of a BLOB field to textual data, use the AsString property.


TBlobField::TBlobField

TBlobField	Methods	See also

TBlobField creates a new TBlobField object.

Syntax

__fastcall virtual TBlobField(Classes::TComponent *AOwner);

Description

Use TBlobField to create a new TBlobField object.


TBlobField::~TBlobField

TBlobField	Methods	See also

~TBlobField frees the memory associated with the TBlobField object.

Syntax

__fastcall virtual ~TBlobField(void);

Description

Do not call ~TBlobField directly. Instead, use the delete keyword on the object, which causes ~TBlobField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBlobField example

TBlobField


TBlobStream

Hierarchy	Properties	Methods	See also

The TBlobStream object is a stream object that provides services that allow applications to read from or write to field objects which represent Binary large object (BLOB) fields.

Header

vcl/dbtables.hpp

Description

Use TBlobStream to access or modify the value of a BLOB field object. BLOB field objects are TBlobField objects and descendants of TBlobField such as TGraphicField and TMemoField. BLOB fields use BLOB streams to implement many of their data access properties and methods.

TBlobStream allows objects that have no specialized knowledge of how data is stored in a BLOB field to read or write such data by employing the uniform stream interface.

To use a BLOB stream, simply create an instance of TBlobStream, use the methods of the stream to read or write the data, and then free the BLOB stream.


TBlobStream properties

TBlobStream	Alphabetically	Legend

Derived from TStream

Position

Size


TBlobStream properties

TBlobStream	By object	Legend

Position

Size


TBlobStream methods

TBlobStream	Alphabetically

In TBlobStream

~TBlobStream

Read

Seek

TBlobStream

Truncate

Write

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBlobStream methods

TBlobStream	By object

~TBlobStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

TBlobStream

Truncate

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TBlobStream::Read

TBlobStream	Methods	See also

Read reads up to Count bytes from the current position in the field’s data into Buffer.

Syntax

virtual System::Longint __fastcall Read(void *Buffer, System::Longint Count);

Description

Use Read to read data from the BLOB field when the number of bytes in the field’s data is not known. Buffer must have at least Count bytes allocated to hold the data that was read from the field.

Read transfers up to Count bytes from the BLOB data into Buffer, starting in the current postion, and then advances the current position by the number of bytes actually transferred. Read returns the number of bytes actually transferred (which may be less than the number requested in Count.)

If the BLOB field is an instance of TMemoField, Read will check the Transliterate property of the field, and convert the data into ANSI from the character set specified by the dataset if Transliterate is true.

All the other data-reading methods of a BLOB stream (ReadBuffer, ReadComponent) call Read to do their actual reading.

Note

Do not call Read when the TBlobStream was created in bmWrite mode.


TBlobStream::Seek

TBlobStream	Methods	See also

Seek resets the current position of the TBlobStream.

Syntax

virtual System::Longint __fastcall Seek(System::Longint Offset, System::Word Origin);

Description

Use Seek to move the current postion within the BLOB data by the indicated offset. Seek allows an application to read from or write to a particular location within the BLOB data.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values::

Value	Meaning

soFromBeginning	Offset is from the beginning of the BLOB data. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the BLOB data. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the BLOB data. Offset must be <= 0 to indicate a number of bytes before the end of the BLOB.

Seek returns the new value of the Position property, the new current position in the BLOB data.


TBlobStream::Truncate

TBlobStream	Methods	See also

Truncate discards all data in the BLOB field from the current position on.

Syntax

void __fastcall Truncate(void);

Description

Use Truncate to limit the size of the BLOB data. Calling Truncate when the current position is 0 will clear the contents of the BLOB field.

Note

Do not call Truncate when the TBlobStream was created in bmRead mode.


TBlobStream::Write

TBlobStream	Methods	See also

Write writes Count bytes from Buffer to the current position in the field and updates the current postion by Count bytes.

Syntax

virtual System::Longint __fastcall Write(const void *Buffer, System::Longint Count);

Description

Use Write to write Count bytes to the BLOB field, starting at the current position. The Write method for TBlobStream always writes the entire Count bytes, as BLOB data does not necessarily include a termination character. Thus, Write is equivalent to the WriteBuffer method.

If the BLOB field is an instance of TMemoField, Write will check the Transliterate property of the field, and convert the data from ANSI into the character set of the dataset if Transliterate is true.

All the other data-writing methods of a BLOB stream (WriteBuffer, WriteComponent) call Write to do their actual writing.

Note

Do not call Write when the TBlobStream was created in bmRead mode.


TBlobStream::TBlobStream

TBlobStream	Methods	See also

TBlobStream creates a new TBlobStream object.

Syntax

__fastcall TBlobStream(TBlobField *Field, TBlobStreamMode Mode);

Description

Use TBlobStream to create a new TBlobStream object.


TBlobStream::~TBlobStream

TBlobStream	Methods	See also

~TBlobStream frees the memory associated with the TBlobStream object.

Syntax

__fastcall virtual ~TBlobStream(void);

Description

Do not call ~TBlobStream directly. Instead, use the delete keyword on the object, which causes ~TBlobStream to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TStream


TBlobStream example

TBlobStream


TBitmapImage

Hierarchy	Methods	See also

TBitmapImage is the internal representation of the bitmap image for a TBitmap object.

Header

vcl/graphics.hpp

Description

TBitmapImage is used for internal implementation only  in Borland C++ Builder.  It represents the internal image of the  bitmap encapsulated by the TBitmap object.  All of the data and methods introduced in TBitmapImage are private.  They contain information about the specific HBITMAP,   including pointers to the standard HBITMAP structures defined by Windows.  TBitmapImage is referenced in the constructor of the TBitmap object the bitmap image is created.


TBitmapImage methods

TBitmapImage	Alphabetically

In TBitmapImage

~TBitmapImage

TBitmapImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBitmapImage methods

TBitmapImage	By object

~TBitmapImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TBitmapImage


TBitmapImage::TBitmapImage

TBitmapImage	Methods	See also

TBitmapImage creates a new TBitmapImage object.

Syntax

__fastcall TBitmapImage(void);

Description

Use TBitmapImage to create a new TBitmapImage object.


TBitmapImage::~TBitmapImage

TBitmapImage	Methods	See also

~TBitmapImage frees the memory associated with the TBitmapImage object.

Syntax

__fastcall virtual ~TBitmapImage(void);

Description

Do not call ~TBitmapImage directly. Instead, use the delete keyword on the object, which causes ~TBitmapImage to be invoked automatically.


Hierarchy

TObject

TInternalImage


TBitmapImage example

TBitmapImage


TBooleanField

Hierarchy	Properties	Methods	Events	See also

A TBooleanField component represents a field containing Boolean values.

Header

vcl/dbtables.hpp

Description

Boolean fields can hold values of true or false.

TBooleanField introduces new properties to convert between boolean values and other data types, and to provide display strings that represent various interpretations of the data. As a descendent of TField, TBooleanField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.


TBooleanField properties

TBooleanField	Alphabetically	Legend

In TBooleanField

AsBoolean

AsString

AsVariant

DisplayValues

Value

Derived from TField

Alignment

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBooleanField properties

TBooleanField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayValues

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBooleanField::AsBoolean

TBooleanField	Properties	See also

AsBoolean reads or writes the value of a Boolean field to or from a Boolean value.

Syntax

Description

Boolean values need no conversion, because the Value of a Boolean field is already a Boolean value. AsBoolean provides a uniform interface that allows applications to get or set Boolean values with generic field components when the actual field type is not known.


TBooleanField::AsString

TBooleanField	Properties	See also

AsString converts the value of a Boolean field to or from a string value.

Syntax

Description

Use AsString to:

•	Assign the Boolean field value to string variable.

•	Assign a string value to the Boolean field.

For example, this code assigns a string value to an Boolean field value:

To assign a Boolean field value to a string variable, use code similar to this:

If the DisplayValues property has not been set, when a Boolean value is inserted or updated using the AsString property, the value is set to true if the string is ‘True’, and false if the string is ‘False’. Any other string raises an EDatabaseError exception.

The DisplayValues property specifies the strings associated with the values of true or false. Change the DisplayValues property to change the strings that must be assigned to set the value of the Boolean field to true or false.

Reading the AsString property returns the string that corresponds to the value of the field. If DisplayValues has not been set, this is ‘True’ or ‘False’.


TBooleanField::AsVariant

TBooleanField	Properties	See also

AsVariant converts the value of a Boolean field to or from a variant value.

Syntax

Description

Use AsVariant to:

•	Assign the Boolean field value to variant variable.

•	Assign a variant value to the Boolean field.

For example, this code assigns a variant value to a Boolean field:

To assign a Boolean field value to a variant value, use code similar to this:

Using variants is useful when you don't know the actual field type and don't want to use one of the other As... properties to convert the field value to another type.


TBooleanField::DisplayValues

TBooleanField	Properties	See also

DisplayValues controls how the Boolean field is translated to and from display format.

Syntax

__property System::AnsiString DisplayValues;

Description

Use DisplayValues to specify strings you want used to represent Boolean values. Use any pair of phrases, separated by a semicolon. For example, to have the true and false values correspond to the letters T and F, respectively, set DisplayValues to T;F. Similarly, to set the values of true and false to the strings Yes and No, set DisplayValues to Yes;No.

The string associated with true or false can be an empty string. To set the value for true to an empty string, set DisplayValues to a string that begins with a semicolon. For example, to associate false with the string Fail, and true with an empty string, set DisplayValues to ;Fail. To associate false with an empty string, set DisplayValues to the string for true, with no semicolon at all.

The strings associated with true and false by DisplayValues appear in data-aware controls when they display the data for a Boolean field. If one of the strings is an empty string, then Boolean values associated with that string will appear blank in data-aware controls.

These strings are also used when getting or setting the Boolean field’s AsString property.


TBooleanField::Value

TBooleanField	Properties	See also

Value is the actual data in the Boolean field.

Syntax

void __fastcall SetDisplayValues(const System::AnsiString Value);

Description

Use Value to read data directly from and write data directly to a Boolean field component at run time. Using Value is the same as using the AsBoolean property. Use Value when you know the field component is a Boolean field. Use AsBoolean when working with a generic field component.


TBooleanField events

TBooleanField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBooleanField events

TBooleanField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBooleanField methods

TBooleanField	Alphabetically

In TBooleanField

~TBooleanField

TBooleanField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBooleanField methods

TBooleanField	By object

~TBooleanField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBooleanField


TBooleanField::TBooleanField

TBooleanField	Methods	See also

TBooleanField creates a new TBooleanField object.

Syntax

__fastcall virtual TBooleanField(Classes::TComponent *AOwner);

Description

Use TBooleanField to create a new TBooleanField object.


TBooleanField::~TBooleanField

TBooleanField	Methods	See also

~TBooleanField frees the memory associated with the TBooleanField object.

Syntax

__fastcall virtual ~TBooleanField(void);

Description

Do not call ~TBooleanField directly. Instead, use the delete keyword on the object, which causes ~TBooleanField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBooleanField example

TBooleanField


TBrush

Hierarchy	Properties	Methods	Events

Header

vcl/graphics.hpp

Description


TBrush properties

TBrush	Alphabetically	Legend

In TBrush

Bitmap

Color

Handle

Style


TBrush properties

TBrush	By object	Legend

Bitmap

Color

Handle

Style


TBrush::Bitmap

TBrush	Properties

Syntax

__property TBitmap * Bitmap;

Description


TBrush::Color

TBrush	Properties

Syntax

__property TColor Color;

Description


TBrush::Handle

TBrush	Properties

Syntax

__property System::Integer Handle;

Description


TBrush::Style

TBrush	Properties

Syntax

__property TBrushStyle Style;

Description


TBrush events

TBrush	Alphabetically

Derived from TGraphicsObject

OnChange


TBrush events

TBrush	By object

OnChange


TBrush methods

TBrush	Alphabetically

In TBrush

~TBrush

Assign

TBrush

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBrush methods

TBrush	By object

~TBrush

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TBrush


TBrush::Assign

TBrush	Methods

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description


TBrush::TBrush

TBrush	Methods	See also

TBrush creates a new TBrush object.

Syntax

__fastcall TBrush(void);

Description

Use TBrush to create a new TBrush object.


TBrush::~TBrush

TBrush	Methods	See also

~TBrush frees the memory associated with the TBrush object.

Syntax

__fastcall virtual ~TBrush(void);

Description

Do not call ~TBrush directly. Instead, use the delete keyword on the object, which causes ~TBrush to be invoked automatically.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TBrush example

TBrush


TButtonControl

Hierarchy	Properties	Methods

TButtonControl is the base class type for Borland C++ Builder button objects that are wrappers for the Windows button controls.

Header

vcl/stdctrls.hpp

Description

TButtonControl encapulates behavior common to all button controls, check boxes and radio buttons in Borland C++ Builder. You use Component Library button objects to . . .


TButtonControl properties

TButtonControl	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TButtonControl properties

TButtonControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TButtonControl methods

TButtonControl	Alphabetically	Legend

In TButtonControl

~TButtonControl

TButtonControl

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TButtonControl methods

TButtonControl	By object	Legend

~TButtonControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TButtonControl

UpdateControlState

Update

WndProc


TButtonControl::WndProc

TButtonControl	Methods

WndProc overrides the inherited method to handle button messages.

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description


TButtonControl::TButtonControl

TButtonControl	Methods	See also

TButtonControl creates a new TButtonControl object.

Syntax

__fastcall virtual TButtonControl(Classes::TComponent *AOwner);

Description

Use TButtonControl to create a new TButtonControl object.


TButtonControl::~TButtonControl

TButtonControl	Methods	See also

~TButtonControl frees the memory associated with the TButtonControl object.

Syntax

__fastcall virtual ~TButtonControl(void);

Description

Do not call ~TButtonControl directly. Instead, use the delete keyword on the object, which causes ~TButtonControl to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TButtonControl example

TButtonControl


TButton

Hierarchy	Properties	Methods	Events

TButton is a wrapper for a Windows push button control.

Header

vcl/stdctrls.hpp

Users choose button control to initiate actions. Buttons are most commonly used in dialog boxes.

Description

A default button is the button whose OnClick event handler runs whenever the user presses the Enter key while using the dialog box. To make a button a default button, set the button’s Default property to true.

A Cancel button is the button whose OnClick event handler runs whenever the user presses the Esc key while using the dialog box. To make a button a Cancel button, set the button’s Cancel property to true.


TButton properties

TButton	Alphabetically	Legend

In TButton

Cancel

Default

ModalResult

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TButton properties

TButton	By object	Legend

Align

BoundsRect

Brush

Cancel

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

Default

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

ModalResult

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TButton::Cancel

TButton	Properties

Cancel indicates whether a button or a bitmap button is a Cancel button.

Syntax

__property System::Boolean Cancel;

Description

Use Cancel to . . .


TButton::Default

TButton	Properties

Indicates whether a push or bitmap button is the default button.

Syntax

__property System::Boolean Cancel;

Description

If Default is true, any time the user presses Enter, the OnClick event handler for that button runs. The only exception to this is if the user selects another button before pressing Enter, in which case the OnClick event handler for that button runs. Although your application can have more than one button designated as a default button, the form calls the OnClick event handler for the first button in the tab order.


TButton::ModalResult

TButton	Properties

Syntax

__property Forms::TModalResult ModalResult;

Description

Use a button's ModalResult property when you want a click of the button to close a modal form. For example, if you create a dialog box with two buttons, OK and Cancel, set the ModalResult property to mrOK for the OK button and mrCancel for the Cancel button. When the user chooses either of these two buttons, the dialog box's modal state ends because ModalResult is greater than mrNone and the dialog box disappears. Using ModalResult, you don't have to write an event handler just to close the dialog box.

These constants are possible ModalResult values:

Constant	Value

mrNone	0

mrOk	idOK

mrCancel	idCancel

mrAbort	idAbort

mrRetry	idRetry

mrIgnore	idIgnore

mrYes	idYes

mrNo	idNo


TButton events

TButton	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TButton events

TButton	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TButton methods

TButton	Alphabetically

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

In TButton

~TButton

Click

TButton

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign


TButton methods

TButton	By object

~TButton

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TButton

UpdateControlState

Update


Click

Click simulates a mouse click, as if the user had clicked a button, executing any code attached to the OnClick event.

Description


TButton

TButton creates a new TButton object.

Description

Use TButton to create a new TButton object.


~TButton

~TButton frees the memory associated with the TButton object.

Description

Do not call ~TButton directly. Instead, use the delete keyword on the object, which causes ~TButton to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObjec

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TButton example

TButton


TBytesField

Hierarchy	Properties	Methods	Events	See also

A TBytesField component represents a Bytes field in a dataset.

Header

vcl/dbtables.hpp

Description

A bytes field value is set of unformatted bytes of fixed size.

TBytesField differs from its immediate ancestor TBinaryField only in its Create method, where it sets the data type to ftBytes. As a descendent of TBinaryField, it inherits many properties, events and methods useful to managing unformatted binary data fields in a dataset.


TBytesField properties

TBytesField	Alphabetically	Legend

Derived from TBinaryField

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBytesField properties

TBytesField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBytesField events

TBytesField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBytesField events

TBytesField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBytesField methods

TBytesField	Alphabetically

In TBytesField

~TBytesField

TBytesField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBytesField methods

TBytesField	By object

~TBytesField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBytesField


TBytesField::TBytesField

TBytesField	Methods	See also

TBytesField creates a new TBytesField object.

Syntax

__fastcall virtual TBytesField(Classes::TComponent *AOwner);

Description

Use TBytesField to create a new TBytesField object.


TBytesField::~TBytesField

TBytesField	Methods	See also

~TBytesField frees the memory associated with the TBytesField object.

Syntax

__fastcall virtual ~TBytesField(void);

Description

Do not call ~TBytesField directly. Instead, use the delete keyword on the object, which causes ~TBytesField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBinaryField


TBytesField example

TBytesField


TCanvas

Hierarchy	Properties	Methods	Events	See also

TCanvas provides an abstract drawing space for objects that must render their own images.

Header

vcl/graphics.hpp

Description

Use TCanvas as a drawing surface for objects that draw an image of themselves. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

TCanvas provides properties, events and methods that assist in creating an image by

•	Specifying the type of brush, pen and font to use.

•	Drawing and filling a variety of shapes and lines.

•	Writing text.

•	Rendering graphic images.

•	Enabling a response to changes in the current image.

TCanvas has two descendants, TControlCanvas and TMetafileCanvas, which assist in drawing images of controls and in creating metafile images for objects.


TCanvas properties

TCanvas	Alphabetically	Legend

In TCanvas

Brush

ClipRect

CopyMode

Font

Handle

Pen

PenPos

Pixels


TCanvas properties

TCanvas	By object	Legend

Brush

ClipRect

CopyMode

Font

Handle

PenPos

Pen

Pixels


TCanvas::Brush

TCanvas	Properties	See also

Brush determines the color and pattern the canvas uses for filling graphical shapes and backgrounds.

Syntax

__property TBrush * Brush;

Description

Set the Brush property to specify the color and pattern to use when drawing the background or filling in graphical shapes. The value of Brush is a TBrush object. Set the properties of the TBrush object to specify the color and pattern or bitmap to use when filling in spaces on the canvas.

Note

Setting the Brush property assigns the specified TBrush object, rather than replacing the current TBrush object.


TCanvas::ClipRect

TCanvas	Properties	See also

ClipRect specifies the boundaries of the clipping rectangle.

Syntax

__property Windows::TRect ClipRect;

Description

Use ClipRect to limit the drawing region of the canvas. Any drawing that occurs at coordinates outside the ClipRect is clipped and doesn’t appear in the image. For example, to draw a portion of a large circle in a smaller box, first draw the box, then set the ClipRect to the rectangle defined by the inner boundary of the box. Drawing the entire circle will only show the portion that is within the box.

When handling a form’s OnPaint event, the canvas' ClipRect property is set to the rectangle that needs to be painted. Portions of the image that do not overlap the ClipRect do not need to be drawn. Thus, OnPaint routines can use the value of ClipRect to optimize painting and speed the overall performance of the application.


TCanvas::CopyMode

TCanvas	Properties	See also

CopyMode specifies how the a graphical image is copied onto the canvas.

Syntax

__property System::Longint CopyMode;

Description

Set CopyMode to affect the way graphical images are drawn onto the canvas. The CopyMode is used when copying an image from another canvas using the CopyRect method. The CopyMode is also used by TBitmap objects when they draw themselves to a canvas.

Use CopyMode to achieve a variety of affects when rendering an image. Achieve special effects like merged images and making parts of a bitmap transparent by combining multiple images with different CopyModes.

The following table shows possible values of CopyMode and describes each.

Value	Meaning

cmBlackness	Fills the destination rectangle on the canvas with black..

cmDstInvert	Inverts the image on the canvas and ignores the source.

cmMergeCopy	Combines the image on the canvas and the source bitmap by using the Boolean AND operator.

cmMergePaint	Combines the inverted source bitmap with the image on the canvas by using the Boolean OR operator.

cmNotSrcCopy	Copies the inverted source bitmap to the canvas.

cmNotSrcErase	Combines the image on the canvas and the source bitmap by using the Boolean OR operator, and inverts the result.

cmPatCopy	Copies the source pattern to the canvas.

cmPatInvert	Combines the source pattern with the image on the canvas using the Boolean XOR operator

cmPatPaint	Combines the inverted source bitmap with the source pattern by using the Boolean OR operator. Combines the result of this operation with the image on the canvas by using the Boolean OR operator.

cmSrcAnd	Combines the image on the canvas and source bitmap by using the Boolean AND operator.

cmSrcCopy	Copies the source bitmap to the canvas.

cmSrcErase	Inverts the image on the canvas and combines the result with the source bitmap by using the Boolean AND operator.

cmSrcInvert	Combines the image on the canvas and the source bitmap by using the Boolean XOR operator.

cmSrcPaint	Combines the image on the canvas and the source bitmap by using the Boolean OR operator.

cmWhiteness	Fills the destination rectangle on the canvas with white.


TCanvas::Font

TCanvas	Properties	See also

Font specifies the font to use when writing text on the image.

Syntax

__property TFont * Font;

Description

Set Font to specify the font to use for writing text on the image. The value of Font is a TFont object. Set the properties of the TFont object to specify the font face, color, size, and style of the font.

Note

Setting the Font property assigns the specified TFont object, rather than replacing the current TFont object.


TCanvas::Handle

TCanvas	Properties	See also

Handle is the Windows GDI handle to the device context for this canvas.

Syntax

__property System::Integer Handle;

Description

Set Handle to the HDC for the device context the canvas must draw into. When a windowed control responds to a Windows paint message, the HDC for drawing is passed in to the PaintWindow method. In other cases, an HDC can be obtained for a window by calling the GetDeviceContext method of a control. Additionally, Windows provides API calls to obtain an HDC for a printer or for a memory image.

Read the Handle property to supplement the drawing services provided by the TCanvas object with API calls that require a handle to a device context. Most of the Windows GDI calls require an HDC.

TCanvas does not own the HDC. Applications must create an HDC and set the Handle property. Applications must release the HDC when it is no longer needed by the canvas. Setting the Handle property of a canvas that already has a valid HDC will not automatically release the initial HDC.

Note

Some descendants of TCanvas, such as TControlCanvas, do own the HDC. Do not set the Handle property for these objects. They fetch and free their own Handle.


TCanvas::Pen

TCanvas	Properties	See also

Pen specifies the kind of pen the canvas uses for drawing lines and outlining shapes.

Syntax

__property TPen * Pen;

Description

Set Pen to specify the pen to use for drawing lines and outlining shapes in the image. The value of Pen is a TPen object. Set the properties of the TPen object to specify the color, style, width, and mode of the pen.

Note

Setting the Pen property assigns the specified TPen object, rather than replacing the current TPen object.


TCanvas::PenPos

TCanvas	Properties	See also

PenPos specifies the current drawing position of the Pen.

Syntax

__property Windows::TPoint PenPos;

Description

Read PenPos to learn the current drawing position of the Pen. This is the starting point of a line drawn by the LineTo method. Setting the PenPos property is equivalent to calling the MoveTo method.


TCanvas::Pixels

TCanvas	Properties	See also

Pixels specifies the color of the pixels within the current ClipRect.

Syntax

__property TColor Pixels[System::Integer X][System::Integer Y];

Description

Read Pixels to learn the color on the drawing surface at a specific pixel position. Write Pixels to change the color of individual pixels on the drawing surface. Use Pixels for detailed effects on an image. Pixels may also be used to determine the color that should be used for the FillRect method.

The value of Pixels is a TColor. If the device represented by the Handle supports it, this can be any 4-byte RGB value. If you specify TColor as an RGB value instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 represents full-intensity, pure blue, $0000FF00 is pure green, and $000000FF is pure red. $00000000 is black and $00FFFFFF is white.

If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context.

The following table lists the constants for collow values defined in the Graphics unit.

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current background color of the Windows desktop

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 or NT 4.0 only: Text color for tool tip controls

clInfoBk 	Windows 95 or NT 4.0 only: Background color for tool tip controls

Not every device context supports the Pixels property. Reading the Pixels property for such a device context will return a value of -1. Setting the Pixels property for such a device context does nothing.

Note

The Pixels property is only valid for pixels within the current value of ClipRect.


TCanvas events

TCanvas	Alphabetically

In TCanvas

OnChange

OnChanging


TCanvas events

TCanvas	By object

OnChange

OnChanging


TCanvas::OnChange

TCanvas	Events	See also

OnChange occurs when the image has just changed.

Syntax

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action whenever the image on the canvas changes. When an application calls one of the drawing methods of TCanvas, the following steps occur.

1	An OnChanging event occurs.

2	The TCanvas method makes a change to the image.

3	An OnChange event occurs.

OnChange events occur on changes to the image, not changes to the properties of the canvas. Applications can respond to changes in the Font, Brush, and Pen properties by assigning OnChange event handlers to the corresponding TFont, TBrush, and TPen objects. However, TCanvas assigns its own OnChange event handlers for those objects. Before assigning an OnChange event handler to one of these objects, read the existing event handler. Use that value to call the TCanvas event handler from the new event handler.


TCanvas::OnChanging

TCanvas	Events	See also

OnChanging occurs just before a change is made to the image.

Syntax

__property Classes::TNotifyEvent OnChanging;

Description

Write an OnChanging event handler to take specific action before the image on the canvas changes. When an application calls one of the drawing methods of TCanvas, the following steps occur.

1	An OnChanging event occurs.

2	The TCanvas method makes a change to the image.

3	An OnChange event occurs.


TCanvas methods

TCanvas	Alphabetically

In TCanvas

~TCanvas

Arc

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

MoveTo

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TCanvas

TextHeight

TextOut

TextRect

TextWidth

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCanvas methods

TCanvas	By object

~TCanvas

Arc

Assign

BrushCopy

Chord

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyRect

DefaultHandler

Dispatch

DrawFocusRect

Draw

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LineTo

MethodAddress

MethodName

MoveTo

NewInstance

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TCanvas

TextHeight

TextOut

TextRect

TextWidth


TCanvas::Arc

TCanvas	Methods	See also

Arc draws an arc on the image along the perimeter of the ellipse bounded by the specified rectangle.

Syntax

void __fastcall Arc(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer Y2,

Description

Use Arc to draw an elliptically curved line with the current Pen. The arc traverses the perimeter of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The arc is drawn following the perimeter of the elipse, counterclockwise, from the starting point to the ending point. The starting point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X3,Y3). The ending point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X4, Y4).

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.

On NT, the drawing direction can be changed to clockwise using the Windows API call SetArcDirection.


TCanvas::BrushCopy

TCanvas	Methods	See also

BrushCopy copies a portion of a bitmap onto a rectangle on the canvas, replacing one of the colors of the bitmap with the brush of the canvas.

Syntax

void __fastcall BrushCopy(const Windows::TRect &Dest, TBitmap *Bitmap, const Windows::TRect &Source

Description

Use BrushCopy to achieve special effects such as making the copied image partially transparent. BrushCopy is provided mainly for backwards compatibility. Use a TImageList instead of BrushCopy.

Dest specifies the rectangular portion of the canvas that will receive the copy of the bitmap. Bitmap specifies the graphic to copy from. Source specifies the rectangular area of Bitmap to copy. Color specifies the color in Bitmap to replace with the Brush of the canvas.

To use BrushCopy to make the copied image partially transparent, specify the color of the surface of the canvas (clBackground for example) as the Color of the Brush property, then call BrushCopy.

For information about the possible values of the Color parameter, see the Pixels property.


TCanvas::Chord

TCanvas	Methods	See also

Chord draws a closed figure represented by the intersection of a line and an ellipse.

Syntax

void __fastcall Chord(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer Y2

Description

Use Chord to create a shape that is defined by an arc and a line that joins the endpoints of the arc. The chord consists of a portion of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The ellipse is bisected by a line that runs between the points (X3,Y3) and (X4,Y4).

The perimeter of the chord runs counter clockwise from (X3, Y3), counterclockwise along the elipse to (X4,Y4), and straight back to (X3,Y3). If (X3,Y3) and (X4,Y4) are not on the surface of the ellipse, the corresponding corners on the chord are the closest points on the perimeter that intersect the line. The outline of the chord is drawn using the value of Pen, and the shape is filled using the value of Brush.

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.

On NT, the drawing direction can be changed to clockwise using the Windows API call SetArcDirection.


TCanvas::CopyRect

TCanvas	Methods	See also

CopyRect copies part of an image from another canvas into the canvas.

Syntax

void __fastcall CopyRect(const Windows::TRect &Dest, TCanvas *Canvas, const Windows::TRect &Source)

Description

Use CopyRect to transfer part of the image on another canvas to the image of the TCanvas object. Dest specifies the rectangle on the canvas where the source image will be copied. The Canvas parameter specifies the canvas with teh source image. Source specifies a rectangle bounding the portion of the source canvas that will be copied.

The portion of the source canvas is copied using the mode specified by CopyMode.


TCanvas::Draw

TCanvas	Methods	See also

Draw renders the graphic specified by the Graphic parameter on the canvas at the location given by the coordinates (X, Y).

Syntax

void __fastcall Draw(System::Integer X, System::Integer Y, TGraphic *Graphic);

Description

Call Draw to draw a graphic on the canvas. Draw calls the Draw method of the graphic. The image is rendered into a rectangle determined by the size of the graphic, with the upper left corner at the point (X, Y).

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


TCanvas::DrawFocusRect

TCanvas	Methods	See also

DrawFocusRect draws a rectangle in the style used to indicate that the object inside the rectangle has focus.

Syntax

void __fastcall DrawFocusRect(const Windows::TRect &Rect);

Description

Call DrawFocusRect for the perimeter of the image of a control when the control gets or loses input focus. Because DrawFocusRect uses an XOR function, calling it a second time while specifying the same rectangle removes the rectangle from the screen.

The rectangle this function draws cannot be scrolled. To scroll an area containing a rectangle drawn by DrawFocusRect, call DrawFocusRect to remove the rectangle from the screen, scroll the area, and then call DrawFocusRect to draw the rectangle in the new position.


TCanvas::Ellipse

TCanvas	Methods	See also

Ellipse draws the ellipse defined by a bounding rectangle on the canvas.

Syntax

void __fastcall Ellipse(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer

Description

Call Ellipse to draw a circle or ellipse on the canvas. The top left point of the bounding rectangle is at pixel coordinates (X1, Y1) and the bottom right point is at (X2, Y2). If the points of the rectangle form a square, a circle is drawn.

The ellipse is outlined using the value of Pen, and filled using the value of Brush.

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.


TCanvas::FillRect

TCanvas	Methods	See also

FillRect fills the specified rectangle on the canvas using the current brush.

Syntax

void __fastcall FillRect(const Windows::TRect &Rect);

Description

Use FillRect to fill a rectangular region using the current brush. The region is filled including the top and left sides of the rectangle, but excluding the bottom and left edges.


TCanvas::FloodFill

TCanvas	Methods	See also

FloodFill fills an area of the canvas using the current brush.

Syntax

void __fastcall FloodFill(System::Integer X, System::Integer Y, TColor Color, TFillStyle FillStyle)

Description

Use FloodFill to fill a possibly non-rectangular region of the image with the value of Brush. The boundaries of the region to be filled are determined by moving outward from the point (X,Y) until a color boundary involving the Color parameter is encountered.

FillStyle determines what type of color changes define the boundaries, as indicated in the following table..

Value	Meaning

fsSurface	Fill all area that has the color indicated by the Color parameter. Stop when another color is encountered.

fsBorder	Fill all area that does not have the color indicated by the Color parameter. Stop when Color is encountered.

Use the Pixels property to get the exact value of the color at the point (X,Y) when using a FillStyle of fsSurface. Similarly, when FillStyle is fsBorder, use Pixels to get the exact value of the boundary color if a point on the boundary is known.


TCanvas::FrameRect

TCanvas	Methods	See also

FrameRect draws a rectangle using the Brush of the canvas to draw the border.

Syntax

void __fastcall FrameRect(const Windows::TRect &Rect);

Description

Use FrameRect to draw a 1 pixel wide border around a rectangular region. FrameRect does not fill the interior of the rectangle with the Brush pattern.

To draw a boundary using the Pen instead, use the Polygon method.


TCanvas::LineTo

TCanvas	Methods	See also

LineTo draws a line on the canvas from PenPos to the point specified by X and Y, and sets the pen position to (X, Y).

Syntax

void __fastcall LineTo(System::Integer X, System::Integer Y);

Description

Use LineTo to draw a line from PenPos up to, but not including the point (X,Y). LineTo changes the value of PenPos to (X,Y).

The line is drawn using Pen.


TCanvas::MoveTo

TCanvas	Methods	See also

MoveTo changes the current drawing position to the point (X ,Y).

Syntax

void __fastcall MoveTo(System::Integer X, System::Integer Y);

Description

Use MoveTo to set the value of PenPos before calling LineTo. Calling MoveTo is equivalent to setting the PenPos property.


TCanvas::Pie

TCanvas	Methods	See also

Pie draws a pie-shaped the section of the ellipse bounded by the rectangle (X1, Y1) and (X2, Y2) on the canvas.

Syntax

void __fastcall Pie(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer Y2,

Description

Use Pie to draw a pie-shaped wedge on the image. The wedge is defined by the ellipse bounded by the rectangle determined by the points (X1, Y1) and X2, Y2). The section drawn is determined by two lines radiating from the center of the ellipse through the points (X3, Y3) and (X4, Y4).

The wedge is outlined using Pen, and filled using Brush.

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.


TCanvas::Polygon

TCanvas	Methods	See also

Polygon draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point.

Syntax

void __fastcall Polygon(const TPoint *Points, const System::Integer Points_Size);

Description

Use Polygon to draw a closed, many-sided shape on the canvas, using the value of Pen. After drawing the complete shape, Polygon fills the shape using the value of Brush.

To draw a polygon on the canvas, without filling it, use the Polyline method, specifying the first point a second time at the end.

Use the Slice function to pass a portion of an array of points to the Polygon method. For example, to form a polygon from the first ten points from an array of 100 points, use the Slice function as follows:


TCanvas::Polyline

TCanvas	Methods	See also

Polyline draws a series of lines on the canvas with the current pen, connecting each of the points passed to it in Points.

Syntax

void __fastcall Polyline(const TPoint *Points, const System::Integer Points_Size);

Description

Use Polyline to connect a set of points on the canvas. If there are only two points , Polyline draws a single line.

Calling the MoveTo function with the value of the first point, and then repeatedly calling LineTo with all subsequent points will draw the same image on the canvas. However, unlike LineTo, Polyline does not change the value of PenPos.

Use the Slice function to pass a portion of an array of points to the Polyline method. For example, to connect the first ten points in an array of 100 points, use the Slice function as follows:


TCanvas::Rectangle

TCanvas	Methods	See also

Rectangle draws a rectangle on the canvas with its upper left corner at the point (X1, Y1) and its lower right corner at the point (X2, Y2).

Syntax

void __fastcall Rectangle(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer

Description

Use Rectangle to draw a rectangle using Pen and fill it with Brush. To fill a rectangular region without drawing the boundary in the current pen, use FillRect. To outline a rectangular region without filling it, use FrameRect or Polygon. To draw a rectangle with rounded corners, use RoundRect.


TCanvas::Refresh

TCanvas	Methods	See also

Refresh deselects the Pen, Brush, and Font from the device context.

Syntax

void __fastcall Refresh(void);

Description

Call Refresh to return the HDC used by the canvas to a default state. Refresh does not change the values of the Font, Brush, or Pen properties. Calling any of the drawing methods of the canvas after calling Refresh will re-select the Font, Brush, or Pen into the HDC if it is used by the drawing method.


TCanvas::RoundRect

TCanvas	Methods	See also

RoundRect draws a rectangle with rounded corners on the canvas.

Syntax

void __fastcall RoundRect(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer

Description

Use RoundRect to draw a rounded rectangle using Pen and fill it with Brush. The rectangle will have edges defined by the points (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2), but the corners will be shaved to create a rounded appearance.

To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.


TCanvas::StretchDraw

TCanvas	Methods	See also

StretchDraw draws the graphic specified by the Graphic parameter in the rectangle specified by the Rect parameter.

Syntax

void __fastcall StretchDraw(const Windows::TRect &Rect, TGraphic *Graphic);

Description

Call StretchDraw to draw a graphic on the canvas so that the image fits in the specified rectangle. StretchDraw calls the Draw method of the graphic. The graphic object determines how to fit into the rectangle. This may involve changing magnification and/or aspect ratio.

To render the graphic in its natural size, use the Draw method, instead.

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


TCanvas::TextHeight

TCanvas	Methods	See also

TextHeight returns the height, in pixels, of a string rendered in the current font.

Syntax

System::Integer __fastcall TextHeight(const System::AnsiString Text);

Description

Use TextHeight to determine the height a string will occupy in the image. Other elements in the image such as lines, boxes, or additional lines of text can be positioned to accomodate the height of the text.


TCanvas::TextOut

TCanvas	Methods	See also

TextOut writes a string on the canvas, starting at the point (X,Y), and thenupdates the PenPos to the end of the string.

Syntax

void __fastcall TextOut(System::Integer X, System::Integer Y, const System::AnsiString Text);

Description

Use TextOut to write a string onto the canvas. The string will be written using the current value of Font. Use the TextHeight and TextWidth methods to determine the space occupied by the text in the image. To write only the text that fits within a clipping rectangle, use TextRect instead.


TCanvas::TextRect

TCanvas	Methods	See also

TextRect writes a string inside a clipping rectangle.

Syntax

void __fastcall TextRect(const Windows::TRect &Rect, System::Integer X, System::Integer Y, const System::AnsiString

Description

Use TextRect to write a string within a limited rectangular region. Any portions of the string that fall outside the rectangle passed in the Rect parameter are clipped and don't appear. The upper left corner of the text is placed at the point (X, Y).


TCanvas::TextWidth

TCanvas	Methods	See also

TextWidth returns the width, in pixels, of a string rendered in the current font.

Syntax

System::Integer __fastcall TextWidth(const System::AnsiString Text);

Description

Use TextWdith to determine the length a string will occupy in the image. TextWidth indicates whether a given string will fit in the available space. Other graphical elements in the image such as lines, or additional strings can be positioned to accomodate the width of the text.


TCanvas::TCanvas

TCanvas	Methods	See also

TCanvas creates a new TCanvas object.

Syntax

__fastcall TCanvas(void);

Description

Use TCanvas to create a new TCanvas object.


TCanvas::~TCanvas

TCanvas	Methods	See also

~TCanvas frees the memory associated with the TCanvas object.

Syntax

__fastcall virtual ~TCanvas(void);

Description

Do not call ~TCanvas directly. Instead, use the delete keyword on the object, which causes ~TCanvas to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TCanvas example

TCanvas


TCheckBox

Hierarchy	Properties	Methods	Events

A TCheckBox component presents an option for the user; the user can check it to select the option, or uncheck it to deselect the option.

Header

vcl/stdctrls.hpp

When the user checks or unchecks a check box, the value of the Checked property changes. The OnClick event also occurs. The text associated with the check box that identifies its purpose is the value of the Caption property.

If you want the user to be able to dim or gray the check box, set the AllowGrayed property to true. Whether the check box is checked, unchecked, or grayed is determined by the value of the State property. You can change value of State to change the check box’s appearance.


TCheckBox properties

TCheckBox	Alphabetically	Legend

Derived from TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCheckBox properties

TCheckBox	By object	Legend

Alignment

Align

AllowGrayed

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

State

TabOrder

TabStop

Tag

Top

Visible

Width


TCheckBox events

TCheckBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TCheckBox events

TCheckBox	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TCheckBox methods

TCheckBox	Alphabetically

In TCheckBox

~TCheckBox

TCheckBox

Derived from TCustomCheckBox

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCheckBox methods

TCheckBox	By object

~TCheckBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCheckBox

UpdateControlState

Update


TCheckBox::TCheckBox

TCheckBox	Methods	See also

TCheckBox creates a new TCheckBox object.

Syntax

__fastcall virtual TCheckBox(Classes::TComponent *AOwner);

Description

Use TCheckBox to create a new TCheckBox object.


TCheckBox::~TCheckBox

TCheckBox	Methods	See also

~TCheckBox frees the memory associated with the TCheckBox object.

Syntax

__fastcall virtual ~TCheckBox(void);

Description

Do not call ~TCheckBox directly. Instead, use the delete keyword on the object, which causes ~TCheckBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TCustomCheckBox


TCheckBox example

TCheckBox


TChangeLink

Hierarchy	Properties	Methods	Events	See also

The TChangeLink object is used internally by the TImageList component to notify other objects when changes are made to the image list.

Header

vcl/controls.hpp

Description

A TImageList keeps a list of its TChangeLink objects. Each is associated with a particular component, such as a tree view or list view control. A component can register its change link with an image list by calling the image list’s RegisterChanges method. Before destruction, the component should then call the UnregisterChanges method.

Component writers can use the change link object to receive notification when changes are made to an image list that a control uses. Use the OnChange event of the change link to execute some code when the image list changes. For example, the tree view control uses a change link object to know when its image list has changed.


TChangeLink properties

TChangeLink	Alphabetically

In TChangeLink

Sender


TChangeLink properties

TChangeLink	By object

Sender


TChangeLink::Sender

TChangeLink	Properties	See also

The Sender property specifies which image list component notifies the change link object of changes.

Syntax

__property TCustomImageList * Sender;

Description

The TImageList automatically sets this property when a call to RegisterChanges is made.


TChangeLink events

TChangeLink	Alphabetically

In TChangeLink

OnChange


TChangeLink events

TChangeLink	By object

OnChange


TChangeLink::OnChange

TChangeLink	Events	See also

The OnChange event occurs when there's a change in any of the images stored in the associated image list component.

Syntax

__property Classes::TNotifyEvent OnChange;

Description

Use the OnChange event to notify a control when the image list that it’s using has changed. Specify any special processing to occur at that time in the OnChange event handler.

The TNotifyEvent type is the type for events that have no parameters. These events simply notify the object that a specific event occurred, in this case an OnChange event.


TChangeLink methods

TChangeLink	Alphabetically

In TChangeLink

~TChangeLink

Change

TChangeLink

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TChangeLink methods

TChangeLink	By object

~TChangeLink

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TChangeLink


TChangeLink::Change

TChangeLink	Methods	See also

The Change method calls the OnChange event handler, if one has been defined.

Syntax

virtual void __fastcall Change(void);

Description

Use the Change method to trigger the OnChange event handler of the change link object.


TChangeLink::TChangeLink

TChangeLink	Methods	See also

TChangeLink creates a new TChangeLink object.

Syntax

__fastcall TChangeLink(void);

Description

Use TChangeLink to create a new TChangeLink object.


TChangeLink::~TChangeLink

TChangeLink	Methods	See also

~TChangeLink frees the memory associated with the TChangeLink object.

Syntax

__fastcall virtual ~TChangeLink(void);

Description

Do not call ~TChangeLink directly. Instead, use the delete keyword on the object, which causes ~TChangeLink to be invoked automatically.


Hierarchy

TObject


TChangeLink example

TChangeLink


TComponent

Hierarchy	Properties	Methods	See also

TComponent is the common ancestor of all component objects in Borland C++ Builder.

Header

vcl/classes.hpp

Description

TComponent encapsulates the fundamental behavior common to all components in Borland C++ Builder by introducing methods and properties that provide:

•	The ability to appear on Component palette and be manipulated in the form designer.

•	The ability to own and manage other components.

•	Enhanced streaming and filing capabilities.

Do not create instances of TComponent. Use TComponent as a base class when declaring non-visual components that can appear on the component palette and be used in the form designer. Properties and methods of TComponent provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.

To create visual components, use TControl or its descendents as a base. To create visual windowed controls use TWinControl or its descendents as a base.


TComponent properties

TComponent	Alphabetically	Legend

In TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TComponent properties

TComponent	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Name

Owner

Tag


TComponent::ComponentCount

TComponent	Properties	See also

ComponentCount indicates the number of components owned by the component as listed in the Components array property list.

Syntax

__property System::Integer ComponentCount;

Description

Use ComponentCount to find or verify the number of components owned by a component, or when iteratiing throughthe Components list to perform some action on all owned components. ComponentCount is used internally in Borland C++ Builder for such iterative procedures.

Note

The ComponentCount of a component contains the same number of items as in the Components list for that component, and is always 1 more than the highest Components index, because the first Components index is always 0.


TComponent::ComponentIndex

TComponent	Properties	See also

ComponentIndex indicates the position of the component in its owner's Components array property list.

Syntax

__property System::Integer ComponentIndex;

Description

Use ComponentIndex when iterating through the Components list to perform some action on owned components. For convenience it can be used in conjunction with ComponentCount. ComponentIndex is used internally in Borland C++ Builder for interative assignment procedures.

Note

The first component in the list has a ComponentIndex value of 0, the second has a value of 1, and so on. Therefore, when using ComponentIndex with ComponentCount, note that ComponentCount is always 1 more than the highest Components index.


TComponent::Components

TComponent	Properties	See also

Components lists of all components owned by the component.

Syntax

__property TComponent * Components[System::Integer Index];

Description

Use Components to access any of these owned components, such as the controls owned by a form. The Components property is most useful when needing to refer to owned components by number rather than name. It is also used internally in Borland C++ Builder for iterative processing on all owned components.

Note

For convenience use Components with ComponentCount for iterative processing. However, be aware that while the ComponentCount of a component contains the same number of items as in the Components list for that component, ComponentCount is always 1 more than the highest Components index, because the first Components index is always 0.


TComponent::ComponentState

TComponent	Properties	See also

ComponentState describes the current state of the component, indicating when a component needs to avoid certain actions.

Syntax

__property TComponentState ComponentState;

Description

Components use the ComponentState property to detect states in which certain kinds of actions are allowed or disallowed. For example, if a component needs to avoid certain behaviors at design time that it will perform at run time, it can check for the csDesigning flag. ComponentState is read-only and its flags are set automatically by various methods, each for its own purpose.

The TComponentState type defines the set of possible state flags for the ComponentState property. The following table lists the possible values for the TComponentState type and the meaning corresponding to each flag:

Table Part 0.1

Flag	Component state

csAncestor	Set if the component was introduced in an ancestor form. Only set if csDesigning is also set.

csDesigning	Design mode, meaning it is in a form being manipulated by a form designer.

csDestroying	The component is about to be destroyed.

csFixups	Set if the component is linked to a component in another form that has not yet been loaded. This flag is cleared when all pending fixups are resolved.

csLoading	Loading from a filer object.

csReading	Reading its property values from a stream.

csUpdating	The component is being updated to reflect changes in an ancestor form. Only set if csAncestor is also set.

csWriting	Writing its property values to a stream.


TComponent::ComponentStyle

TComponent	Properties

ComponentStyle sets a a flag for a style that governs the behavior of the component.

Syntax

__property TComponentStyle ComponentStyle;

Description

ComponentStyle determines whether a component (and therefore the forms that contain it) is inheritable, and whether it needs to check its properties for readability.

The TComponentStyle type defines a set of values for the ComponentStyle property. TComponent sets the csInheritable style by default in the constructor, and most of the standard components are inheritable.

The csInheritable style indicates that the component can be inherited by a descendant form type. If any of the components in a form do not have the csInheritable style, the form cannot be used as the ancestor of an inherited form.

The csCheckPropAvail style indicates that a component needs to check its properties for readability. This is only used for OLE controls, where the Object Inspector cannot tell directly that a property is readable, and therefore displayable. Native Borland C++ Builder components should not use this style.


TComponent::DesignInfo

TComponent	Properties	See also

DesignInfo contains information used by the form designer.

Syntax

__property System::Longint DesignInfo;

Description

DesignInfo is used internally by the Borland C++ Builder environment. Do not call it directly.


TComponent::Name

TComponent	Properties	See also

Name contains the name of the component as referenced by other components.

Syntax

__property System::AnsiString Name;

Description

Use Name to change the name of a component to reflect its purpose in the current application. By default, Borland C++ Builder assigns sequential names based on the type of the component, such as 'Button1', 'Button2', and so on.


TComponent::Owner

TComponent	Properties	See also

Owner indicates which component owns the component.

Syntax

__property TComponent * Owner;

Description

Use Owner to find the owner of a component. When one component is owned by another, the memory for the owned component is freed when its owner's memory is freed. This means that when a form is destroyed, all the components on the form are also destroyed.

In Borland C++ Builder, a form owns all components that are on it. In turn, the form is owned by the application. Thus when the memory for the application itself is freed, the memory for the form (and all its owned components) is also freed.

The owner of a component is determined by the parameter passed to the Create method when the component is constructed. For components created in the Borland C++ Builder form designer, the owner is passed automatically to the constructor.


TComponent::Tag

TComponent	Properties

Tag stores an integer value as part of a component.

Syntax

__property System::Longint Tag;

Description

Tag has no predefined meaning to Borland C++ Builder. The Tag property is provided for the convenience of storing additional integer value or pointer information for special needs in an application. For example, use the Tag property when implementing case statements with a component.


TComponent methods

TComponent	Alphabetically	Legend

In TComponent

~TComponent

ChangeName

DefineProperties

DestroyComponents

Destroying

FindComponent

FreeNotification

GetChildOwner

GetChildParent

GetChildren

GetParentComponent

HasParent

InsertComponent

Loaded

Notification

ReadState

RemoveComponent

SetAncestor

SetChildOrder

SetDesigning

SetName

SetParentComponent

TComponent

Updated

Updating

ValidateRename

WriteState

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComponent methods

TComponent	By object	Legend

~TComponent

Assign

ChangeName

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineProperties

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetChildOwner

GetChildParent

GetChildren

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Loaded

MethodAddress

MethodName

NewInstance

Notification

ReadState

RemoveComponent

SetAncestor

SetChildOrder

SetDesigning

SetName

SetParentComponent

TComponent

Updated

Updating

ValidateRename

WriteState


TComponent::ChangeName

TComponent	Methods	See also

ChangeName sets the private, internal storage for the Name property to the string passed in NewName.

Syntax

void __fastcall ChangeName(const System::AnsiString NewName);

Description

ChangeName is used by the SetName method to actually change the component's name. ChangeName is not virtual; do not override it. When overriding SetName be sure to call the inherited SetName.


TComponent::DefineProperties

TComponent	Methods	See also

DefineProperties designates methods for storing an object's unpublished data on a stream such as a form file.

Syntax

virtual void __fastcall DefineProperties(TFiler *Filer);

Description

TComponent overrides the DefineProperties method defined in TPersistent to define "fake" Top and Left properties. These are defined so that a non-visual component can be manipulated at design-time. However, the Top and Left properties are hidden, that is, they are not published because non-visual components do not appear at run-time.

DefineProperties is virtual, so descendent classes can override it. When writing or overriding a DefineProperties method, be aware that the Ancestor property of TFiler might be set, and that it might be necessary to write or not write properties, as appropriate.

DefineProperties is called automatically as part of the streaming system; do not call it directly.


TComponent::DestroyComponents

TComponent	Methods	See also

DestroyComponents iterates through the components owned by the component, removing each from the list of owned components and destroying it.

Syntax

void __fastcall DestroyComponents(void);

Description

DestroyComponents ensures that owned components are automatically destroyed by their owner.

It is not necessary to call DestroyComponents directly. DestroyComponents is automatically called by Destroy in the destructor sequence that begins with a call to Free and ends with the object destroying itself.


TComponent::Destroying

TComponent	Methods	See also

Destroying sets the csDestroying flag for the component and all owned components, indicating that the components are about to be destroyed.

Syntax

void __fastcall Destroying(void);

Description

Destroying sets the csDestroying flag in the ComponentState property, then calls the Destroying method for each owned component so that their csDestroying flags will also be set. If csDestroying is already set, Destroying does nothing.

It is not necessary to call Destroying directly. Destroying is automatically called by Destroy in the destructor sequence that begins with a call to Free and ends with the object destroying itself.


TComponent::FindComponent

TComponent	Methods	See also

FindComponent indicates whether or not a given component, AName, is owned by the component.

Syntax

TComponent *__fastcall FindComponent(const System::AnsiString AName);

Description

FindComponent returns the component in the Components array property with the name that matches the string in the AName parameter. Use to find whether a given component is owned by another.

FindComponent is not case sensitive.


TComponent::FreeNotification

TComponent	Methods	See also

FreeNotification ensures that AComponent is notified that the component is going to be destroyed.

Syntax

void __fastcall FreeNotification(TComponent *AComponent);

Description

Use FreeNotification when a component is assigned to a property of another component.

It is necessary to call FreeNotification for components in other forms that have references to the component. But for components in the same form with the component, the Notification method will be called automatically.


TComponent::GetChildOwner

TComponent	Methods	See also

GetChildOwner returns the owner of a child component being read from a stream.

Syntax

virtual TComponent *__fastcall GetChildOwner(void);

Description

In TComponent GetChildOwner returns NULL by default, meaning that the owner is assumed to be the root component currently being read (that is usually a form). The Owner of a component is responsible for destroying it.

GetChildOwner is used internally by the streaming system in Borland C++ Builder. It is rarely necessary to call it directly.


TComponent::GetChildParent

TComponent	Methods	See also

GetChildParent returns the parent, or if there is no parent, returns the owner of a child component being read from a stream.

Syntax

virtual TComponent *__fastcall GetChildParent(void);

Description

By default GetChildParent for TComponent returns Self. If GetChildParent returns NULL, the parent is assumed to be the root component currently being read (that is usually a form).

GetChildParent is used internally in the Borland C++ Builder streaming system. It is not necessary to call it directly.


TComponent::GetChildren

TComponent	Methods	See also

The GetChildren method defined by TComponent does nothing other than provide an interface for a method that windowed controls use to return their child components.

Syntax

virtual void __fastcall GetChildren(TGetChildProc Proc);

Description

The GetChildren method is introduced in TComponent for convenience for the Borland C++ Builder streaming system. Descendent classes override GetChildren to return the "child" components of the component; that is, those who return the component from their GetParentComponent method.


TComponent::GetParentComponent

TComponent	Methods	See also

GetParentComponent returns NULL for TComponent.

Syntax

virtual TComponent *__fastcall GetParentComponent(void);

Description

The GetParentComponent method is introduced in TComponent for convenience for the Borland C++ Builder streaming system. Descendent classes can override GetParentComponent to return the appropriate parent for their particular type of component.


TComponent::HasParent

TComponent	Methods	See also

HasParent returns false for TComponent.

Syntax

virtual System::Boolean __fastcall HasParent(void);

Description

The HasParent method is introduced in TComponent for the streaming system to determine whether the component has a parent to handle its filing for it.

A return value of true indicates that some other object (a parent) is responsible for writing the object to a stream. Most commonly the parent other object is a form or panel component that contains a control.

It is rarely necessary to override HasParent. Any child component that returns true from HasParent must now also implement the GetParentComponent and SetParentComponent methods.


TComponent::InsertComponent

TComponent	Methods	See also

InsertComponent establishes the component as the owner of the component passed in the AComponent parameter.

Syntax

void __fastcall InsertComponent(TComponent *AComponent);

Description

InsertComponet adds the component to the end of the Components array property. The inserted component must have no name (no specified Name property value), or the name must be unique among all others in the Components list.

When the owning component is destroyed, AComponent is destroyed also.

Components are automatically inserted and removed when visually manipulating them in the Borland C++ Builder form designer. Use InsertComponent when manually adding components to another Owner component’s Components list.


TComponent::Loaded

TComponent	Methods	See also

Loaded clears the csLoading flag in the ComponentState property indicating that the component has been loaded from a stream.

Syntax

virtual void __fastcall Loaded(void);

Description

The Loaded method provides an opportunity for a component to initialize itself after all its parts have loaded from a stream.

When a Borland C++ Builder application loads a form from its form file, for example, it first constructs the form component by calling its Create constructor, then reading its property values from the form file, which is a stream. After reading all the property values for all the components, Borland C++ Builder calls the Loaded methods of each component in the order the components were created. This gives the components a chance to initialize any data that depends on the values of other components or other parts of itself.

Note

All references to sibling components are resolved by the time Loaded is called. Loaded is the first place that sibling pointers can be used after being streamed in.


TComponent::Notification

TComponent	Methods	See also

Notification forwards notification messages to all owned components.

Syntax

virtual void __fastcall Notification(TComponent *AComponent, TOperation Operation);

Description

The Notification method notifies the component that the component specified by AComponent is about to be inserted or removed, as specified by Operation. By default, components pass along the notification to their owned components, if any.

A component can, if needed, act on the notification that a component is being inserted or removed. In particular, if a component has object fields or properties that contain references to other components, it might check the notifications of component removals and invalidate those references as needed.


TComponent::ReadState

TComponent	Methods	See also

ReadState is a method used by the streaming system to read the component’s data from a stream.

Syntax

virtual void __fastcall ReadState(TReader *Reader);

Description

ReadState is a method that communicates with a reader object, passed in Reader, to assure that the component is properly read in from a stream.

The ReadState method is part of a sequence of calls used by the Borland C++ Builder streaming system to read the values of all the component's published properties, other stored data from a stream. It is not necessary to call ReadState directly.

Although ReadState is virtual, it is rarely overridden. Nevertheless, any descendent classes overriding ReadState should end with a call to the inherited ReadState method of TComponent.

ReadState reads the value of the component's published propeties, stored data, and owned components from the reader object passed in Reader.


TComponent::RemoveComponent

TComponent	Methods	See also

RemoveComponent removes the component specified in the AComponent parameter from the component's Components list.

Syntax

void __fastcall RemoveComponent(TComponent *AComponent);

Description

Components are automatically inserted and removed when visually manipulating them in the Borland C++ Builder form designer. Use RemoveComponent when manually deleting components from an Owner component.


TComponent::SetAncestor

TComponent	Methods	See also

SetAncestor sets or clears the ComponentState property’s csAncestor flag for the component where the method is executed and all components it owns.

Syntax

void __fastcall SetAncestor(System::Boolean Value);

Description

SetAncestor is used internally for the Borland C++ Builder streaming system. It is not necessary to call SetAncestor directly.

SetAncestor sets or clears the csAncestor flag which is used to determine whether or not the component was introduced in an ancestor form. SetAncestor then calls the SetAncestor methods of any owned components, passing Value, so that the owned components' ComponentState properties will be synchronized with the owner's.


TComponent::SetChildOrder

TComponent	Methods	See also

SetChildOrder does nothing in TComponent.

Syntax

virtual void __fastcall SetChildOrder(TComponent *Child, System::Integer Order);

Description

SetChildOrder is introduced in TComponent for convenience for the Borland C++ Builder streaming system. Descendent classes override SetChildOrder to change the order in which the Child appears in the child component list returned by GetChildren.


TComponent::SetDesigning

TComponent	Methods	See also

SetDesigning ensures that components inserted at design time have their design-mode flag set.

Syntax

void __fastcall SetDesigning(System::Boolean Value);

Description

SetDesigning is used internally for the Borland C++ Builder form designer. It is not necessary to call SetDesigning directly.

SetDesigning sets the csDesigning option in the ComponentState property if Value is true, otherwise, it removes csDesigning. SetDesigning then calls the SetDesigning methods of any owned components, passing Value, so that the owned components' ComponentState properties will be synchronized with the owner's.

The InsertComponent and RemoveComponent methods call SetDesigning for inserted or removed components to ensure that their design-mode flags are set properly.


TComponent::SetName

TComponent	Methods	See also

SetName is the property-access method for setting the value of the Name property.

Syntax

virtual void __fastcall SetName(const System::AnsiString NewName);

Description

SetName is the virtual method used as the write part of the Name property. It calls the ChangeName method, which performs the actual name change. ChangeName is not virtual; override SetName instead when modifying the behavior of the Name property.


TComponent::SetParentComponent

TComponent	Methods	See also

SetParentComponent does nothing in TComponent.

Syntax

virtual void __fastcall SetParentComponent(TComponent *Value);

Description

SetParentComponent was introduced in TComponent for convenience in the Borland C++ Builder streaming system. Descendent classes override SetParentComponent to change the value that GetParentComponent returns to match Value.


TComponent::Updated

TComponent	Methods	See also

Updated clears the csUpdating state in the component's ComponentState property to indicate that the component has finished updating.

Syntax

virtual void __fastcall Updated(void);

Description

Updated is used internally in Borland C++ Builder to modify the ComponentState property. It is not necessary to call Updated directly. A call to Updated always follows a call to Updating, which sets the flag.


TComponent::Updating

TComponent	Methods	See also

Updating sets the csUpdating state in the component's ComponentState property to indicate that the component is about to be updated.

Syntax

virtual void __fastcall Updating(void);

Description

Updating is used internally in Borland C++ Builder to modify the ComponentState property. It is not necessary to call Updating directly. A call to Updating should always be followed by a call to Updated, which clears the flag.


TComponent::ValidateRename

TComponent	Methods	See also

ValidateRename ensures that renaming an owened component does not create name conflict.

Syntax

virtual void __fastcall ValidateRename(TComponent *AComponent, const System::AnsiString CurName, const System::AnsiString

Description

ValidateRename checks to see if a component can rename one of its owned components, passed in AComponent, from its current name (CurName) to the string passed in NewName. If AComponent is NULL or NewName is already the name of a component in the Components list, ValidateRename raises an EComponentError exception.

ValidateRename is used internally by Borland C++ Builder when the Name property is modified. It is not necessary to call it directly.


TComponent::WriteState

TComponent	Methods	See also

WriteState is a method used by the streaming system to write the component’s data to a stream.

Syntax

virtual void __fastcall WriteState(TWriter *Writer);

Description

WriteState is an interative method that communicates with a writer object, passed in Writer, to assure that the component is properly written out.

The WriteState method is part of a sequence of calls used by the Borland C++ Builder streaming system to write the values of all the component's published properties, other stored data to a stream. It is not necessary to call WriteState directly.

Although WriteState is virtual, it is rarely overridden. Nevertheless, any descendent classes overriding WriteState should end with a call to the inherited WriteState method of TComponent.


TComponent::TComponent

TComponent	Methods	See also

TComponent creates a new TComponent object.

Syntax

__fastcall virtual TComponent(TComponent *AOwner);

Description

Use TComponent to create a new TComponent object.


TComponent::~TComponent

TComponent	Methods	See also

~TComponent frees the memory associated with the TComponent object.

Syntax

__fastcall virtual ~TComponent(void);

Description

Do not call ~TComponent directly. Instead, use the delete keyword on the object, which causes ~TComponent to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TComponent example

TComponent


TCollection

Hierarchy	Properties	Methods	See also

TCollection is a container for TCollectionItem objects.

Header

vcl/classes.hpp

Description

Each TCollection holds a group of TCollectionItem objects. TCollection maintains an index of the collection items in its Items array. The Count property contains the number of items in the collection. Use the Add and Clear methods to add items to the collection and delete items from the collection.

Objects descended from TCollection can contain objects descended from TCollectionItem. For example, a TDBGridColumns object contains TColumn objects; these two classes are used by TDBGrid to represent grid columns. The following table lists each descendant of TCollection with the corresponding descendant TCollectionItem and the control component (descended from TWinControl) that uses each pair:

TCollection descendant	TCollectionItem descendant	Control component

TDBGridColumns	TColumn	TDBGrid

THeaderSections	THeaderSection	THeaderControl

TListColumns	TListColumn	TListView

TStatusPanels	TStatusPanel	TStatusBar


TCollection properties

TCollection	Alphabetically	Legend

In TCollection

Count

Items


TCollection properties

TCollection	By object	Legend

Count

Items


TCollection::Count

TCollection	Properties	See also

The number of items in the collection.

Syntax

__property System::Integer Count;

Description

Count contains the number of items in the Items array. Since Items is indexed starting with 0, the value of Count will always be one greater than the index of the last member of Items.


TCollection::Items

TCollection	Properties	See also

An index of the items in the collection.

Syntax

__property TCollectionItem * Items[System::Integer Index];

Description

The value of the Index parameter corresponds to the Index property of TCollectionItem. It represents the position of the item in the collection.


TCollection methods

TCollection	Alphabetically

In TCollection

~TCollection

Add

Assign

BeginUpdate

Clear

EndUpdate

TCollection

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCollection methods

TCollection	By object

~TCollection

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TCollection


TCollection::Add

TCollection	Methods	See also

Creates a new TCollectionItem instance and adds it to the Items array.

Syntax

TCollectionItem *__fastcall Add(void);

Description

Add returns the new collection item.


TCollection::Assign

TCollection	Methods	See also

Copies the contents of another collection to the object where the method is executed.

Syntax

virtual void __fastcall Assign(TPersistent *Source);

Description

Use Assign to copy the contents of one TCollection instance to another. The Assign method deletes all items from the destination collection (the object where it is executed), then adds a copy of each item in the Source collection’s Items array.


TCollection::BeginUpdate

TCollection	Methods	See also

Suspends screen repainting.

Syntax

void __fastcall BeginUpdate(void);

Description

The BeginUpdate method suspends screen repainting until the EndUpdate method is called. Use BeginUpdate to speed processing while items are added to or deleted from a collection.


TCollection::Clear

TCollection	Methods	See also

Deletes all items from the collection.

Syntax

void __fastcall Clear(void);

Description

Clear empties the Items array and destroys each TCollectionItem.


TCollection::EndUpdate

TCollection	Methods	See also

Re-enables screen repainting.

Syntax

void __fastcall EndUpdate(void);

Description

Use EndUpdate to re-enable screen repainting that was turned off with the BeginUpdate method.


TCollection::TCollection

TCollection	Methods	See also

TCollection creates a new TCollection object.

Syntax

__fastcall TCollection(System::TMetaClass * ItemClass);

Description

Use TCollection to create a new TCollection object.


TCollection::~TCollection

TCollection	Methods	See also

~TCollection frees the memory associated with the TCollection object.

Syntax

__fastcall virtual ~TCollection(void);

Description

Do not call ~TCollection directly. Instead, use the delete keyword on the object, which causes ~TCollection to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TCollection example

TCollection


TCollectionItem

Hierarchy	Properties	Methods	See also

TCollectionItem represents an item in a collection.

Header

vcl/classes.hpp

Description

A TCollection holds a group of TCollectionItem objects. TCollectionItems are created and destroyed by TCollection’s Add and Clear methods. Each TCollectionItem has a Collection property that points to the TCollection object to which the item belongs.

Objects descended from TCollection can contain objects descended from TCollectionItem. For example, a TDBGridColumns object contains TColumn objects; these two classes are used by TDBGrid to represent grid columns. For a complete list of TCollection and TCollectionItem descendents, see TCollection.


TCollectionItem properties

TCollectionItem	Alphabetically

In TCollectionItem

Collection

Index


TCollectionItem properties

TCollectionItem	By object

Collection

Index


TCollectionItem::Collection

TCollectionItem	Properties

Specifies the TCollection instance to which the TCollectionItem belongs.

Syntax

__fastcall virtual TCollectionItem(TCollection *Collection);

Description

Each TCollectionItem belongs to the TCollection which creates it. The Collection property points to the collection object to which the item belongs.


TCollectionItem::Index

TCollectionItem	Properties	See also

The item’s position in the Items array of TCollection.

Syntax

__property System::Integer Index;

Description

Each TCollectionItem is indexed in the Items array of the TCollection to which it belongs. The Index property of the TCollectionItem contains the item’s index value in that array.

Items is a zero-based array. The first member of the collection has an index value of 0, the second member has an index value of 1, and so forth.


TCollectionItem methods

TCollectionItem	Alphabetically

In TCollectionItem

~TCollectionItem

TCollectionItem

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCollectionItem methods

TCollectionItem	By object

~TCollectionItem

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TCollectionItem


TCollectionItem::TCollectionItem

TCollectionItem	Methods	See also

TCollectionItem creates a new TCollectionItem object.

Syntax

__fastcall virtual TCollectionItem(TCollection *Collection);

Description

Use TCollectionItem to create a new TCollectionItem object.


TCollectionItem::~TCollectionItem

TCollectionItem	Methods	See also

~TCollectionItem frees the memory associated with the TCollectionItem object.

Syntax

__fastcall virtual ~TCollectionItem(void);

Description

Do not call ~TCollectionItem directly. Instead, use the delete keyword on the object, which causes ~TCollectionItem to be invoked automatically.


Hierarchy

TObject

TPersistent


TCollectionItem example

TCollectionItem


TColorDialog

Hierarchy	Properties	Methods

TColorDialog generates a color-selection dialog.

Header

vcl/dialogs.hpp

Description

The TColorDialog component displays a Windows dialog box for selecting colors. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user selects a color and clicks OK, the dialog closes and the selected color is stored in the Color property.


TColorDialog properties

TColorDialog	Alphabetically	Legend

In TColorDialog

Color

CustomColors

Options

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TColorDialog properties

TColorDialog	By object	Legend

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

CustomColors

DesignInfo

HelpContext

Name

Options

Owner

Tag


TColorDialog::Color

TColorDialog	Properties	See also

Returns the selected color.

Syntax

__property Graphics::TColor Color;

Description

When the user selects a color in the dialog box and clicks OK, the selected color selected becomes the value of Color.


TColorDialog::CustomColors

TColorDialog	Properties

Determines which custom colors are available in the dialog box.

Syntax

__property Classes::TStrings * CustomColors;

Description

Each custom color is represented as a string that follows this format:

For example, this string could indicate that the first custom color box in the Color dialog box:

You can have up to 16 custom colors, ColorA through ColorP.


TColorDialog::Options

TColorDialog	Properties

Specifies the options that are in effect when the Color dialog box appears.

Syntax

__property TColorDialogOptions Options;

Description

These are the possible values that can be included in the Options set:

Value	Meaning

cdFullOpen	Displays the custom coloring options when the Color dialog opens

cdPreventFullOpen	Disables the Create Custom Colors button in the Color dialog box so the user cannot create their own custom colors.

cdShowHelp	Adds a Help button to the Color dialog box.

cdSolidColor	Directs the dialog box to display only solid colors.

cdAnyColor	Directs the dialog box to display any color.

The default value is [ ], the empty set, meaning all of these values are false and none of the options are in effect.


TColorDialog methods

TColorDialog	Alphabetically

In TColorDialog

~TColorDialog

Execute

TColorDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColorDialog methods

TColorDialog	By object

~TColorDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TColorDialog


TColorDialog::Execute

TColorDialog	Methods

Displays the Color dialog box.

Syntax

System::Boolean __fastcall Execute(void);

Description


TColorDialog::TColorDialog

TColorDialog	Methods	See also

TColorDialog creates a new TColorDialog object.

Syntax

__fastcall virtual TColorDialog(Classes::TComponent *AOwner);

Description

Use TColorDialog to create a new TColorDialog object.


TColorDialog::~TColorDialog

TColorDialog	Methods	See also

~TColorDialog frees the memory associated with the TColorDialog object.

Syntax

__fastcall virtual ~TColorDialog(void);

Description

Do not call ~TColorDialog directly. Instead, use the delete keyword on the object, which causes ~TColorDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TColorDialog example

TColorDialog


TColumnTitle

Hierarchy	Properties	Methods	See also

TColumnTitle represents the title of a data-grid column (TColumn).

Header

vcl/dbgrids.hpp

Description

TDBGrid uses a TDBGridColumns to maintain a collection of TColumn objects. Each TColumn has an associated TColumnTitle that holds information about its title. The TColumnTitle instance is stored in the column’s Title property.


TColumnTitle properties

TColumnTitle	Alphabetically	Legend

In TColumnTitle

Alignment

Caption

Color

Font


TColumnTitle properties

TColumnTitle	By object	Legend

Alignment

Caption

Color

Font


TColumnTitle::Alignment

TColumnTitle	Properties	See also

Specifies how text is aligned within the column title.

Syntax

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the column.

taCenter	Center text in the column.

taRightJustify	Align text on the right side of the column.


TColumnTitle::Caption

TColumnTitle	Properties	See also

The text that appears at the top of the column.

Syntax

__property System::AnsiString Caption;

Description

The Caption property contains a text string that identifies the column. If the dgTitles flag is set in the data grid’s Options property, the title appears on the form at runtime.

If the FieldName property is set in TColumn, it becomes the default value of TColumnTitle.Caption.


TColumnTitle::Color

TColumnTitle	Properties	See also

The background color for the column title.

Syntax

__property Graphics::TColor Color;

Description

The Color property determines the background color of the column title. You can set Color to one of the constants defined in the Graphics unit (such as clBlue), or to an explicit four-byte hexadecimal value.


TColumnTitle::Font

TColumnTitle	Properties	See also

Controls the font in which the column title displays its caption.

Syntax

__property Graphics::TFont * Font;

Description

The Font property points to a TFont object that determines typographic attributes of text displayed in the column title.


TColumnTitle methods

TColumnTitle	Alphabetically

In TColumnTitle

~TColumnTitle

Assign

DefaultAlignment

DefaultCaption

DefaultColor

DefaultFont

RestoreDefaults

TColumnTitle

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColumnTitle methods

TColumnTitle	By object

~TColumnTitle

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultAlignment

DefaultCaption

DefaultColor

DefaultFont

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

TColumnTitle


TColumnTitle::Assign

TColumnTitle	Methods	See also

Copies the contents of the source column title to a new column title.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Assign creates a new column title with the same Alignment, Color, Caption, and Font values as the source object.


TColumnTitle::DefaultAlignment

TColumnTitle	Methods	See also

Returns the default alignment of the column title.

Syntax

Classes::TAlignment __fastcall DefaultAlignment(void);

Description

DefaultAlignment always returns taLeftJustify.


TColumnTitle::DefaultCaption

TColumnTitle	Methods	See also

Returns the default caption of the column title.

Syntax

System::AnsiString __fastcall DefaultCaption(void);

Description

DefaultCaption returns the DisplayName of the TField object associated with the column. If there is no dataset field associated with the column (that is, if the column’s Field property is empty), it returns the column’s FieldName.


TColumnTitle::DefaultColor

TColumnTitle	Methods	See also

Returns the default background color for the column title.

Syntax

Graphics::TColor __fastcall DefaultColor(void);

Description

DefaultColor returns the FixedColor of the data grid to which the column belongs. If the column has no associated data grid, DefaultColor returns clBtnFace.


TColumnTitle::DefaultFont

TColumnTitle	Methods	See also

Returns the default font for the column title.

Syntax

Graphics::TFont *__fastcall DefaultFont(void);

Description

DefaultFont returns the TitleFont of the data grid to which the column belongs. If the column has no associated data grid, DefaultFont returns the current value of the column’s Font property.


TColumnTitle::RestoreDefaults

TColumnTitle	Methods	See also

Restores the column title’s default settings.

Syntax

virtual void __fastcall RestoreDefaults(void);

Description

RestoreDefaults reinitializes the Caption and Font properties.


TColumnTitle::TColumnTitle

TColumnTitle	Methods	See also

TColumnTitle creates a new TColumnTitle object.

Syntax

__fastcall TColumnTitle(TColumn *Column);

Description

Use TColumnTitle to create a new TColumnTitle object.


TColumnTitle::~TColumnTitle

TColumnTitle	Methods	See also

~TColumnTitle frees the memory associated with the TColumnTitle object.

Syntax

__fastcall virtual ~TColumnTitle(void);

Description

Do not call ~TColumnTitle directly. Instead, use the delete keyword on the object, which causes ~TColumnTitle to be invoked automatically.


Scope

Published


Hierarchy

TObject

TPersistent


TColumnTitle example

TColumnTitle


TColumn

Hierarchy	Properties	Methods	See also

TColumn represents a column in a data grid (TDBGrid).

Header

vcl/dbgrids.hpp

Description

Each TDBGrid uses a TDBGridColumns to maintain a collection of TColumn objects.


TColumn properties

TColumn	Alphabetically	Legend

In TColumn

Alignment

AssignedValues

ButtonStyle

Color

DropDownRows

Field

FieldName

Font

PickList

ReadOnly

Title

Width

Derived from TCollectionItem

Collection

Index


TColumn properties

TColumn	By object	Legend

Alignment

AssignedValues

ButtonStyle

Collection

Color

DropDownRows

FieldName

Field

Font

Index

PickList

ReadOnly

Title

Width


TColumn::Alignment

TColumn	Properties	See also

Specifies how text is aligned within the column.

Syntax

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the column.

taCenter	Center text in the column.

taRightJustify	Align text on the right side of the column.


TColumn::AssignedValues

TColumn	Properties	See also

Indicates which TColumn and TColumnTitle properties have been set.

Syntax

__property TColumnValues AssignedValues;

Description

The read-only AssignedValues lists properties of the column and its title (TColumnTitle) which have been set or whose default values have been changed. AssignedValues is a set of zero or more of the following:

Value	Meaning

cvColor	The column’s Color property has been changed.

cvWidth	The column’s Width property has been changed.

cvFont	The column’s Font property has been changed.

cvAlignment	The column’s Alignment property has been changed.

cvReadOnly	The column’s ReadOnly property has been changed.

cvTitleColor	The column title’s Color property has been changed.

cvTitleCaption	The column title’s Caption property has been changed.

cvTitleAlignment	The column title’s Alignment property has been changed.

cvTitleFont	The column title’s Font property has been changed.

For example, if AssignedValues returns [cvColor, cvTitleCaption], then the column’s font and title caption have been changed.


TColumn::ButtonStyle

TColumn	Properties	See also

Determines whether and how the user can select values for the column from a list.

Syntax

__property TColumnButtonStyle ButtonStyle;

Description

The ButtonStyle property determines how users can choose the content of a data-grid column. These are the possible values of ButtonStyle:

Value	Meaning

cbsAuto	If the column is associated with a lookup field or has a value assigned to its PickList property, the grid displays a combo box in the column. The user can choose a value from the drop-down list.

cbsEllipsis	The column displays an ellipsis button that the user can click to choose a value. Clicking the ellipsis button triggers an OnEditButtonClick event.

cbsNone	No combo box or ellipsis button is provided. The user cannot select the column’s content from a list.


TColumn::Color

TColumn	Properties	See also

The background color for the column.

Syntax

__property Graphics::TColor Color;

Description

The Color property determines the background color of the data-grid column. You can set Color to one of the constants defined in the Graphics unit (such as clBlue), or to an explicit four-byte hexadecimal value.


TColumn::DropDownRows

TColumn	Properties	See also

The number of lines displayed in the column’s drop-down list.

Syntax

__property System::Integer DropDownRows;

Description

DropDownRows determines the number of lines of text displayed in the drop-down list associated with the column. This property is operative only if ButtonStyle is set to cbsAuto and the column has a lookup field or pick list associated with it.


TColumn::Field

TColumn	Properties	See also

The TField instance represented by the column.

Syntax

__property Db::TField * Field;

Description

The Field property points to the TField object corresponding to the dataset field displayed in the column.


TColumn::FieldName

TColumn	Properties	See also

The name of the field represented by the column.

Syntax

__property System::AnsiString FieldName;

Description

Setting FieldName changes the Field property so that it points to the dataset field with the same name. If the dataset does not have a field with the same name, Field is set to NULL.


TColumn::Font

TColumn	Properties	See also

Controls the font in which the column displays its data.

Syntax

__property Graphics::TFont * Font;

Description

The Font property points to a TFont object that determines typographic attributes of text displayed in the column.


TColumn::PickList

TColumn	Properties	See also

A list of values that the user can select for the column.

Syntax

__property Classes::TStrings * PickList;

Description

The PickList property points to a TStrings object. If ButtonStyle is set to cbsAuto, these strings appear in the drop-down list associated with the column.


TColumn::ReadOnly

TColumn	Properties	See also

Determines whether data displayed in the column is editable.

Syntax

__property System::Boolean ReadOnly;

Description

If ReadOnly is set to true, data displayed in the column cannot be changed by the user at runtime. If ReadOnly is set to false (and the data grid’s Options property includes the dgEditing flag), users can edit data directly from the grid.


TColumn::Title

TColumn	Properties	See also

The TColumnTitle that represents the column’s title.

Syntax

__property TColumnTitle * Title;

Description

The Title property points to a TColumnTitle object that determines attributes of the column’s title. If FieldName is set, the value of FieldName becomes the default column title (TColumnTitle.Caption).

The title (TColumnTitle.Caption) appears at runtime only if the dgTitles flag is set in the data grid’s Options property.


TColumn::Width

TColumn	Properties	See also

The width of the column.

Syntax

__property System::Integer Width;

Description

The Width property determines the width of the column, in pixels. If the dgColumnResize flag is set in the data grid’s Options property, users can resize the column at runtime.


TColumn methods

TColumn	Alphabetically

In TColumn

~TColumn

Assign

DefaultAlignment

DefaultColor

DefaultFont

DefaultReadOnly

DefaultWidth

RestoreDefaults

TColumn

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColumn methods

TColumn	By object

~TColumn

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultAlignment

DefaultColor

DefaultFont

DefaultHandler

DefaultReadOnly

DefaultWidth

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

TColumn


TColumn::Assign

TColumn	Methods	See also

Copies the contents of the source column to a new column.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Assign creates a new column with the same FieldName, Title, DropDownRows, ButtonStyle, and PickList values as the source object. Color, Width, Font, Alignment, and ReadOnly are also copied if AssignedValues indicates that they have been changed.


TColumn::DefaultAlignment

TColumn	Methods	See also

Returns the default alignment for the column.

Syntax

Classes::TAlignment __fastcall DefaultAlignment(void);

Description

DefaultAlignment returns the Alignmnent of the TField associated with the column. If the column has no dataset field associated with it, DefaultAlignment returns taLeftJustify.


TColumn::DefaultColor

TColumn	Methods	See also

Returns the default background color for the column.

Syntax

Graphics::TColor __fastcall DefaultColor(void);

Description

DefaultColor returns the Color of the data grid to which the column belongs. If the column has no associated data grid, DefaultColor returns clWindow.


TColumn::DefaultFont

TColumn	Methods	See also

Returns the default font for data displayed in the column.

Syntax

Graphics::TFont *__fastcall DefaultFont(void);

Description

DefaultFont returns the Font of the data grid to which the column belongs. If the column has no associated data grid, DefaultFont returns the current value of the column’s Font property.


TColumn::DefaultReadOnly

TColumn	Methods	See also

Returns the default ReadOnly setting for the column.

Syntax

System::Boolean __fastcall DefaultReadOnly(void);

Description

DefaultReadOnly always returns false.


TColumn::DefaultWidth

TColumn	Methods	See also

Returns the default width for the column.

Syntax

System::Integer __fastcall DefaultWidth(void);

Description

The value of DefaultWidth is determined as follows:

•	If the column has no data grid associated with it, DefaultWidth returns 64.

•	If the column has an associated data grid but the Field property is empty, DefaultWidth returns data grid’s protected DefaultColWidth property. Usually, this value is 64.

•	If the column has an associated data field, DefaultWidth is calculated from the TField object’s DisplayWidth property.

•	If the dgTitles flag is set in the data grid’s Options property, DefaultWidth is increased (as necessary) to accommodate the column’s title caption.


TColumn::RestoreDefaults

TColumn	Methods	See also

Restores the column’s default settings.

Syntax

virtual void __fastcall RestoreDefaults(void);

Description

RestoreDefaults reinitializes the AssignedValues, ButtonStyle, Font, and PickList properties, freeing the pick list (TStrings) object if there is one, and calls the RestoreDefaults method in the column’s title (TColumnTitle). If the Font property has been changed previousy, its current value is preserved. [Is this correct?]


TColumn::TColumn

TColumn	Methods	See also

TColumn creates a new TColumn object.

Syntax

__fastcall virtual TColumn(Classes::TCollection *Collection);

Description

Use TColumn to create a new TColumn object.


TColumn::~TColumn

TColumn	Methods	See also

~TColumn frees the memory associated with the TColumn object.

Syntax

__fastcall virtual ~TColumn(void);

Description

Do not call ~TColumn directly. Instead, use the delete keyword on the object, which causes ~TColumn to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TColumn example

TColumn


TComboBox

Hierarchy	Properties	Methods	Events

A TComboBox component is a control that combines an edit box with a list, much like that of a list box. Users can either type text in the edit box or select an item from the list.

Header

vcl/stdctrls.hpp

When users enter data into the combo box, either by typing text or selecting an item from the list, the value of the Text property changes. Your application can also change the Text property by displaying text for the user in the edit box of the combo box.

The list of items in the list is the value of the Items property. The ItemIndex property indicates which item in the list is selected.

You can add, delete, insert, and move items in the list using the Add, Delete, and Insert methods of the Items object, which is of type TStrings. For example, to add a string to the list, you could write this line of RefSyn:

ComboBox1.Items.Add('New item');

Sort the items in the list with the Sorted property.

At run time, you can select all the text in the edit box with the SelectAll method. To find out which text the user selected, or to replace selected text, use the SelText property. To select only part of the text or to find out what part of the text is selected, use the SelStart and SelLength properties.

You can change the style of the combo box or make it an owner-draw control by changing the value of the Style property.


TComboBox properties

TComboBox	Alphabetically	Legend

Derived from TCustomComboBox

Canvas

DropDownCount

DroppedDown

ItemHeight

ItemIndex

Items

MaxLength

SelLength

SelStart

SelText

Sorted

Style

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TComboBox properties

TComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DropDownCount

DroppedDown

Enabled

Font

Handle

Height

HelpContext

Hint

ItemHeight

ItemIndex

Items

Left

MaxLength

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TComboBox events

TComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TComboBox events

TComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnStartDrag


OnChange


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnDrawItem


OnDropDown


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMeasureItem


OnStartDrag


TComboBox methods

TComboBox	Alphabetically

In TComboBox

~TComboBox

TComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComboBox methods

TComboBox	By object

~TComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TComboBox

UpdateControlState

Update


TComboBox::TComboBox

TComboBox	Methods	See also

TComboBox creates a new TComboBox object.

Syntax

__fastcall virtual TComboBox(Classes::TComponent *AOwner);

Description

Use TComboBox to create a new TComboBox object.


TComboBox::~TComboBox

TComboBox	Methods	See also

~TComboBox frees the memory associated with the TComboBox object.

Syntax

__fastcall virtual ~TComboBox(void);

Description

Do not call ~TComboBox directly. Instead, use the delete keyword on the object, which causes ~TComboBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TComboBox example

TComboBox


TCommonDialog

Hierarchy	Properties	Methods	See also

TCommonDialog is the ancestor of all components that represent Windows common dialog boxes.

Header

vcl/dialogs.hpp

Description

TCommonDialog is an abstract class that represents Windows common dialog boxes. Its descendants include visual components that handle such tasks as finding and opening files, setting fonts and colors, and printing.

New components that encapsulate common-dialog functions should descend from TCommonDialog. Most other dialog boxes should descend from TForm.


TCommonDialog properties

TCommonDialog	Alphabetically	Legend

In TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TCommonDialog properties

TCommonDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

HelpContext

Name

Owner

Tag


TCommonDialog::Ctl3D

TCommonDialog	Properties	See also

Determines whether the dialog has a three-dimensional look.

Syntax

__property System::Boolean Ctl3D;

Description

If Ctl3D is set to true, the dialog box and the controls in it appear three-dimensional. If Ctl3D is set to false, the dialog and its controls appear flat.

Note

For dialogs to appear three-dimensional under Windows NT 3.51, CTL3D32.DLL must be installed in the System32 directory.


TCommonDialog::HelpContext

TCommonDialog	Properties	See also

A context number for online Help.

Syntax

__property Classes::THelpContext HelpContext;

Description

The HelpContext property is an integer value that determines which Help screen appears when the user requests context-sensitive online Help. If HelpContext is set to the default value of 0, the dialog inherits the Help context of its parent.


TCommonDialog methods

TCommonDialog	Alphabetically

In TCommonDialog

~TCommonDialog

TCommonDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCommonDialog methods

TCommonDialog	By object

~TCommonDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TCommonDialog


TCommonDialog::TCommonDialog

TCommonDialog	Methods	See also

TCommonDialog creates a new TCommonDialog object.

Syntax

__fastcall virtual TCommonDialog(Classes::TComponent *AOwner);

Description

Use TCommonDialog to create a new TCommonDialog object.


TCommonDialog::~TCommonDialog

TCommonDialog	Methods	See also

~TCommonDialog frees the memory associated with the TCommonDialog object.

Syntax

__fastcall virtual ~TCommonDialog(void);

Description

Do not call ~TCommonDialog directly. Instead, use the delete keyword on the object, which causes ~TCommonDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TCommonDialog example

TCommonDialog


TControl

Hierarchy	Properties	Methods	Events	See also

The TControl component is the abstract component type for all controls.

Header

vcl/controls.hpp

Description

Controls are visual components, meaning the user can see them and manipulate them at run time. All controls have properties, methods, and events in common that are specific to the visual aspect of controls, such as the Left, Top, Height, Width, Cursor, and Hint properties; the BringToFront, Show, Repaint, and SetBounds methods; and click, mouse, and drag-and-drop events.

TControl has many protected properties and methods that are published by its descendants.


TControl properties

TControl	Alphabetically	Legend

In TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

IsControl

Left

MouseCapture

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ScalingFlags

ShowHint

Text

Top

Visible

Width

WindowText

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TControl properties

TControl	By object	Legend

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Height

Hint

IsControl

Left

MouseCapture

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ScalingFlags

ShowHint

Tag

Text

Top

Visible

Width

WindowText


TControl::Align

TControl	Properties	See also

The Align property determines how the control aligns within its container (or parent control).

Syntax

__property TAlign Align;

Description

Use Align to align a control to the top, bottom, left, or right of a form or panel and have it remain there even if the size of the form, panel, or component that contains the control changes.

For example, to use a panel component with various controls on it as a tool palette, change the panel’s Align value to alLeft. The value of alLeft for the Align property of the panel guarantees that the tool palette remains on the left side of the form and always equals the client height of the form.

The default value of Align is alNone, which means a control remains where it is positioned on a form or panel. Specify another value to align the control. Use one of these possible values:

Value	Meaning

alNone	The component remains where it was placed on the form or panel. This is the default value.

alTop	The component moves to the top of the form and resizes to fill the width of the form. The height of the component is not affected.

alBottom	The component moves to the bottom of the form and resizes to fill the width of the form. The height of the component is not affected.

alLeft	The component moves to the left side of the form and resizes to fill the height of the form. The width of the component is not affected.

alRight	The component moves to the right side of the form and resizes to fill the height of the form. The width of the component is not affected.

alClient	The component resizes to fill the client area of a form. If a component already occupies part of the client area, the component resizes to fit within the remaining client area.

Note

If you set the Align property to alClient, the control fills the entire client area so that you can’t select the parent form by clicking on it. In this case, select the parent by selecting the control on the form and pressing Esc, or by using the Object Inspector.

Any number of child components within a single parent can have the same Align value, in which case they stack up along the edge of the parent form or panel. To adjust the order in which the controls stack up, drag the controls into their desired positions.


TControl::BoundsRect

TControl	Properties	See also

The BoundsRect method returns the bounding rectangle of the control, expressed in the coordinate system of the parent control.

Syntax

__property Windows::TRect BoundsRect;

Description

Use BoundsRect as a quick way to return the corners of a control in pixel locations all at once.

For example, the statement

corresponds to

The TRect type defines a rectangle. The coordinates are specified both as four separate integers representing the pixel locations of the left, top, right, and bottom sides, and as two points representing the pixel locations of the top left and bottom right corners. The origin of the pixel coordinate system is in the top left corner of the screen.


TControl::Caption

TControl	Properties	See also

The Caption property specifies a text string that identifies the control to the user.

Syntax

__property System::AnsiString Caption;

Description

Use Caption to associate the control with a text string that identifies the control.

For most controls, the Caption is the window title and it appears as a label for the control. Some objects interpret Caption differently, however. For example, the Caption of a button is the button name until a new value is entered.

To underline a character in a Caption that labels a component, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the component by pressing Alt while typing the underlined character.


TControl::ClientHeight

TControl	Properties	See also

The ClientHeight property is the height of the control's client area in pixels.

Syntax

__property System::Integer ClientHeight;

Description

Use ClientHeight to read or change the height of the control’s client area.

For TControl, ClientHeight is the same as Height. Derived classes may implement a ClientHeight property that differs from Height. For example, the ClientHeight of a form is the same as the Height minus the height of the Titlebar, resize border, and scrollbars.


TControl::ClientOrigin

TControl	Properties	See also

The ClientOrigin determines the screen coordinates (in pixels) of the top left corner of a control’s client area.

Syntax

__property Windows::TPoint ClientOrigin;

Description

Read ClientOrigin to locate the top-left corner of the control’s client area. ClientOrigin returns X and Y coordinates in a record of type TPoint, with the origin in the top left corner. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.

The screen coordinates of a control descended from TControl and not TWinControl are actually the screen coordinates of the control’s parent added to its Left and Top properties. If the control doesn’t have a parent, an EInvalidOperation exception is raised when ClientOrigin is read.


TControl::ClientRect

TControl	Properties	See also

The ClientRect property returns the size (in pixels) of a control client area.

Syntax

__property Windows::TRect ClientRect;

Description

Read ClientRect when you need to find the size of the client area of a control. ClientRect returns a rectangle with its Top and Left fields set to zero, and its Bottom and Right fields set to the control's Height and Width, respectively. ClientRect is equivalent to Rect(0, 0, ClientWidth, ClientHeight).

The TRect type defines a rectangle. The coordinates are specified both as four separate integers representing the pixel locations of the left, top, right, and bottom sides, and as two points representing the pixel locations of the top left and bottom right corners.


TControl::ClientWidth

TControl	Properties	See also

The ClientWidth property is the horizontal size of the control's client area in pixels.

Syntax

__property System::Integer ClientWidth;

Description

Use ClientWidth to read or change the width of the control’s client area. ClientWidth is equivalent to ClientRect.Right.


TControl::Color

TControl	Properties	See also

The Color property is the background color of the control.

Syntax

__property Graphics::TColor Color;

Description

Use Color to read or change the background color of the control.

These are the possible values of Color:

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current background color of the Windows desktop

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 or NT 4.0 only: Text color for tool tip controls

clInfoBk 	Windows 95 or NT 4.0 only: Background color for tool tip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel. The actual color that appears will vary from system to system. For example, the clBtnFace system color might be gray in one user’s color scheme, and tan in another user’s color scheme.

Note

If a control's ParentColor property is true, then changing the Color property of the control's parent automatically changes the Color property of the control. When you assign a value to a control's Color property, the control's ParentColor property is automatically set to false.


TControl::ControlState

TControl	Properties	See also

The ControlState property holds a set of values indicating the current state of a control at run time.

Syntax

__property TControlState ControlState;

Description

Read ControlState to find out various conditions that affect the control such as whether it has been clicked or needs alignment. ControlState reflects transient conditions of an instance of the control, as opposed to attributes of the control class as a whole. ControlState consists of a set of flags from the following values:

Flag	Meaning

csLButtonDown	The left mouse button was clicked and not yet released. This is set for all mouse-down events.

csClicked	The same as csLButtonDown, but only set if ControlStyle contains csClickEvents, meaning that mouse-down events are interpreted as clicks.

csPalette	A WM_PALETTCHANGED message was received by the control or one of its parents.

csReadingState	The control is reading its state from a stream.

csAlignmentNeeded	The control needs to realign itself when alignment is re-enabled.

csFocusing	The application is processing messages intended to give the control focus. This does not guarantee the control will receive focus, but prevents recursive calls.

csCreating	The control and/or its owner and subcontrols is being created. This flag clears when all have finished creating.

csPaintCopy	The control is being replicated, meaning a copy of the control is being painted. The ControlStyle flag csReplicatable must be set for this state to occur.

The flags in ControlState are specific to controls, and are in addition to the state flags in the ComponentState property, which apply to all components.

ControlState is primarily used by component writers in the implementation of components derived from TControl.


TControl::ControlStyle

TControl	Properties	See also

The ControlStyle property holds a set of values that determine style characteristics of the control.

Syntax

__property TControlStyle ControlStyle;

Description

Use ControlStyle to find out various attributes of the control, such as whether the control can capture the mouse or has a fixed size. The ControlStyle property contains a set of style flags indicating these attributes. The following table lists the flags and their meanings:.

Flag	Meaning

csAcceptsControls	The control becomes the parent of any controls dropped on it at design time.

csCaptureMouse	The control captures mouse events when it is clicked.

csDesignInteractive	The control maps right mouse-button clicks at design time into left-button clicks to manipulate the control.

csClickEvents	The control can receive and respond to mouse clicks.

csFramed	The control has a 3D frame.

csSetCaption	The control should change its caption to match the Name property if the caption has not been explicitly set to something else.

csOpaque	The control completely fills its client area.

csDoubleClicks	The control can receive and respond to double-click messages. Otherwise, map double-clicks into clicks.

csFixedWidth	The width of the control does not vary.

csFixedHeight	The height of the control does not vary.

csNoDesignVisible	The control is not visible at design time.

csReplicatable	The control can be copied using the PaintTo method to draw its image to an arbitrary canvas.

csNoStdEvents	Standard events such as mouse, key, and click events are ignored. Use this setting if your code doesn’t need to respond to these events and your application will run faster.

csDisplayDragImage	The control can display an image from an image list when the control is dragged over. Use this setting if your control correctly handles an image list being dragged over it.

ControlStyle generally describes an entire class, which all instances reflect. The flags do not change among different instances of a type of control, nor do they vary at run time. Such transient conditions are indicated by the ControlState property.

The Create method of TControl initializes ControlStyle to [csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks].

ControlStyle is primarily used by component writers in the implementation of components derived from TControl.


TControl::Cursor

TControl	Properties	See also

The Cursor property specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

Syntax

__property TCursor Cursor;

Description

Change the value of Cursor to provide feedback to the user about what action is appropriate when the mouse pointer enters the control.

These are the possible images:

Value	Image	I’ll insert the missing images later.

crDefault

crNone

crArrow

crCross

crIBeam

crSize

crSizeNESW

crSizeNS

crSizeNWSE

crSizeWE

crUpArrow

crHourGlass

crDrag

crNoDrop

crHSplit

crVSplit

crMultiDrag

crSQLWait

crNo

crAppStart

crHelp

Note:

To learn how to make a custom cursor available to your application, see the Cursors property of the TScreen component.


TControl::DragCursor

TControl	Properties	See also

The DragCursor property contains the image used to represent the mouse pointer when the control is being dragged.

Syntax

__property TCursor DragCursor;

Description

Use the DragCursor property to change the cursor image presented when the control is being dragged. The possible values for the DragCursor property are the same as those for the Cursor property. See the table in the Cursor property entry.

Note:

To learn how to make a custom cursor available to your application, see the Cursors property of the TScreen component.


TControl::DragMode

TControl	Properties	See also

The DragMode property determines the drag and drop behavior of a control.

Syntax

__property TDragMode DragMode;

Description

Use the DragMode property to control when the user is able to drag the control. If the control's DragMode property value is dmAutomatic, the application can disable the drag and drop capability at run time by changing the DragMode property value to dmManual.

These are the possible values:

Value	Meaning

dmAutomatic	If dmAutomatic is selected, the control is ready to be dragged; the user just clicks and drags it.

dmManual	If dmManual is selected, the control can't be dragged until the application calls the BeginDrag method.


TControl::Enabled

TControl	Properties	See also

The Enabled property controls whether the control responds to mouse, keyboard, and timer events.

Syntax

__property System::Boolean Enabled;

Description

Use Enabled to change the availability of the control to the user. To disable a control, set Enabled to false. Disabled controls appear dimmed. If Enabled is false, the control ignores mouse and keyboard events, and in the case of a timer control, the OnTimer event.

To re-enable a control, set Enabled to true. The control is no longer dimmed, and the user can use the control.


TControl::Font

TControl	Properties	See also

The Font property controls the attributes of text written on or in the control.

Syntax

__property Graphics::TFont * Font;

Description

To change to a new font, specify a new TFont object. To modify a font, change the value of the Color, Height, Name, Pitch, Size, or Style of the TFont object.


TControl::Height

TControl	Properties	See also

The Height property of a control is the vertical size of the control in pixels.

Syntax

__property System::Integer Height;

Description

Use the Height property to read or change the height of the control.


TControl::Hint

TControl	Properties	See also

The Hint property contains the text string that can appear when the user moves the mouse pointer over the control.

Syntax

__property System::AnsiString Hint;

Description

Use the Hint property to provide a string of help text either as a Help Hint, or as help text on a particular location such as a status bar.

A Help Hint is a box containing help text that appears for a control when the user moves the mouse pointer over the control and pauses momentarily. To set up Help Hints:

1	Specify a Hint value for each control that a Help Hint should appear for.

2	Set the ShowHint property of each control to true.

3	At run time, set the value of the application's ShowHint property to true.

To show the Hint on a status bar or other location, use the OnHint event handle of the application. When the mouse pointer moves over the control, the application’s OnHint event occurs. Write an OnHint event handler to display the hint as the caption of a panel component that is being used as a status bar.

Specify a hint to be used for both for a Help Hint box and by an OnHint handler by specifying two values separated by a | character (the "or" or "pipe" symbol). For example,

The 'Name' string appears in the Help Hint box, and the 'Enter full name' string appears as specified in the OnHint event handler.

If you specify just one value, it can be used as both a Help Hint and as the Hint property of the application. If the application's ShowHint property is false, the Help Hint won't appear, but the OnHint event handler will still be called.

If a control has no Hint value specified, but its parent control does, the control uses the Hint value of the parent control as long as the control's ShowHint property is true.


TControl::IsControl

TControl	Properties	See also

The IsControl property determines whether a form stores its form-specific properties to a stream.

Syntax

__property System::Boolean IsControl;

Description

Use IsControl to use a form as a complex control, rather than as a desktop form. IsControl affects the way the form gets saved. When IsControl is true, form-specific properties do not get saved with the form. When IsControl is false, the form-specific properties get saved along with the other properties.

IsControl permits you to use the forms designer to create complex controls such as panels, by creating those controls as forms, placing and naming their contained controls, and attaching code to events. After saving the form, edit the form as text, and in the text version set IsControl to true. The next time the form is reloaded and saved, only those form properties appropriate to use as a control are stored, not the properties specific to TForm. Next, edit the form file as text, changing the type of the component from TForm to the desired control type, such as TPanel.


TControl::Left

TControl	Properties	See also

The Left property determines the horizontal coordinate of the left edge of a component relative to the form in pixels.

Syntax

__property System::Integer Left;

Description

Use the Left property to determine where the left side of the control begins or reposition the left side of the control.

If the control is contained in another control, such as a TPanel, the Left and Top properties are relative to the parent control. If the control is contained directly by the form, the properties values are relative to the form. For forms, the value of the Left property is relative to the screen in pixels.


TControl::MouseCapture

TControl	Properties	See also

The MouseCapture property indicates whether the control has "captured" mouse events.

Syntax

__property System::Boolean MouseCapture;

Description

Use MouseCapture to determine whether a control has captured the mouse. The capture control is the control to which all subsequent mouse events go until the user releases the mouse button.

A control becomes the capture control when the user drags an item from it. In addition, if the control has the csCaptureMouse flag set in its ControlStyle property, it becomes the capture control when the user presses the left mouse button over it, until the user releases the mouse button.


TControl::Name

TControl	Properties	See also

The Name property contains the name of the control as referenced by other controls.

Syntax

Description

Use the Name property to assign a new name to the control or to find out what the name of the control is.

By default, Borland C++ Builder assigns sequential names based on the type of the control, such as 'Button1', 'Button2', and so on. Change these to more meaningful names that make the application’s code more readable. The Name must be a valid Object Pascal identifier. If the control‘s Caption has not already been modified, the Caption is changed to match the new control name.

Note:

Change component names only at design time.


TControl::Parent

TControl	Properties	See also

The Parent property refers to the parent of the control and determines where the control is displayed.

Syntax

__property TWinControl * Parent;

Description

Use the Parent property to determine the parent of this control or to assign a control to be the parent of this control. When creating a new control, always assign a Parent property value for the new control. Usually, this is a form, panel, group box, or some control that is designed to contain another. Changing the parent of a control moves the control onscreen so that it is displayed within the parent.

The parent of a control is the windowed control that contains the control. If one control (parent) contains others, the contained controls are child controls of the parent. For example, if an application includes three radio buttons in a group box, the group box is the parent of the three radio buttons, and the radio buttons are the child controls of the group box.

Don't confuse the Parent property declared in TControl with the Owner property declared in TComponent. A form is the Owner of all the components on it, whether or not they are windowed controls. A child control is always a visible control contained within another windowed control (its parent). If you put three radio buttons in a group box on a form, the Owner of the radio buttons is still the form, while the parent is the group box.

When the parent of a control is destroyed, all controls that are its children are also destroyed.


TControl::ParentColor

TControl	Properties	See also

The ParentColor property determines where a control looks for its color information.

Syntax

__property System::Boolean ParentColor;

Description

To have a control use the same color as its parent control, set ParentColor to true. For example, if the ParentColor of a list box on a panel is true, the list box has the same color as the panel. If ParentColor is false, the control uses its own Color property.

Set ParentColor to true for all controls in order to ensure that all the controls on a form have a uniform appearance. For example, if ParentColor is true for all controls in a form, changing the background color of the form to gray causes all the controls on the form to also have a gray background.

To specify a different color for a particular control, specify the desired color as the value of that control's Color property, and ParentColor becomes false automatically.


TControl::ParentFont

TControl	Properties	See also

The ParentFont property determines where a control looks for its font information.

Syntax

__property System::Boolean ParentFont;

Description

To have a control use the same font as its parent control, set ParentFont to true. For example, if the ParentFont of a list box on a panel is true, the list box uses the same font as the panel. If ParentFont is false, the control uses its own Font property.

Set ParentFont to true for all controls in order to ensure that all the controls on a form have a uniform appearance. For example, if ParentFont is true for all controls in a form, changing the form’s Font property to 12-point Courier causes all controls on the form to use that font.

To specify a different font for a particular control, specify the desired font as the value of the control's Font property, and ParentFont becomes false automatically.

When the ParentFont is true for a form, the form uses the value of the application's Font property.


TControl::ParentShowHint

TControl	Properties	See also

The ParentShowHint property determines where a control looks to find out if the Help Hint, specified as the value of the Hint property for the control, should be shown.

Syntax

__property System::Boolean ParentShowHint;

Description

Use ParentShowHint to ensure that all the controls on a form either uniformly show their Help Hints or uniformly don't show them.

If ParentShowHint is true, the control uses the ShowHint property value of its parent. If ParentShowHint is false, the control uses the value of its own ShowHint property.

To provide Help Hints for only selected controls on a form, set the ShowHint property for those controls that should have Help Hints to true, and ParentShowHint becomes false automatically.

Note

Enable or disable all Help Hints for the entire application using the ShowHint property of the application.


TControl::PopupMenu

TControl	Properties	See also

The PopupMenu property identifies the pop-up menu associated with the control.

Syntax

__property Menus::TPopupMenu * PopupMenu;

Description

Assign a value to PopupMenu to make a pop-up menu appear when the user selects the control and clicks the right mouse button. If the TPopupMenu’s AutoPopup property is true, the pop-up menu appears automatically. If the menu’s AutoPopup property is false, display the menu with a call to its Popup method.


TControl::ScalingFlags

TControl	Properties	See also

The ScalingFlags property reflects which attributes of the control have not yet been scaled.

Syntax

__property TScalingFlags ScalingFlags;

Description

ScalingFlags is an internal set of flags used primarily in scaling inherited forms and their controls. Applications should not use this property without a serious need. These are the flags and their meanings:

Flag	Meaning

sfLeft	Left side of control not yet scaled.

sfTop	Top of control not yet scaled.

sfWidth	Width of control not yet scaled.

sfHeight	Height of control not yet scaled.

sfFont	Font of control not yet scaled.


TControl::ShowHint

TControl	Properties	See also

The ShowHint property determines if the control should display a Help Hint when the mouse pointer rests momentarily on the control.

Syntax

__property System::Boolean ShowHint;

Description

The Help Hint is the value of the Hint property, which is displayed in a box just beneath the control. Use ShowHint to determine whether a Help Hin appears for the control.

To enable Help Hint for a particular control, the application ShowHint must be true and either:

•	the control’s own ShowHint property must be true

•	the control’s ParentShowHint property must be true and its parent's ShowHint property must be true

For example, imagine a check box within a group box. If the ShowHint property of the group box is true and the ParentShowHint property of the check box is true, but the ShowHint property of the check box is false, the check box will still display its Help Hint.

Changing the ShowHint value automatically sets the ParentShowHint property to false.


TControl::Text

TControl	Properties	See also

The Text property contains a text string associated with the control.

Syntax

__property System::AnsiString Text;

Description

Use the Text property to

•	Read the Text value of the control.

•	Specify a new string for the Text value.

By default, Text is the control name until you assign a new Text value. For edit controls and memos, the Text appears within the control. For combo boxes, the Text is the content of the edit control portion of the combo box.


TControl::Top

TControl	Properties	See also

The Top property determines the Y coordinate of the top left corner of a control, relative to its parent or containing control in pixels.

Syntax

__property System::Integer Top;

Description

Use the Left property to locate the top of the control or reposition the control to a different Y coordinate. The Top property, like the Left property, is the position of the control relative to its container. Thus, if a control is contained in a TPanel, the Left and Top properties are relative to the panel. If the control is contained directly by the form, it is relative to the form. For forms, the value of the Left property is relative to the screen in pixels.


TControl::Visible

TControl	Properties	See also

The Visible property determines whether the component appears onscreen.

Syntax

__property System::Boolean Visible;

Description

Use the Visible property to control the visibility of the control at run time. If Visible is true, the control appears. If Visible is false, the control is not visible.

Calling the Show method sets the control's Visible property to true. Calling the Hide method sets it to false.


TControl::Width

TControl	Properties	See also

The Width property determines the horizontal size of the control or form in pixels.

Syntax

__property System::Integer Width;

Description

Use the Width property to read or change the width of the control.

Note:

For tab sheets controls, changing this property at run time has no effect.


TControl::WindowText

TControl	Properties	See also

The WindowText property contains the text string of the control.

Syntax

__property System::PChar WindowText;

Description

Use WindowText to determine the text associated with the control.

For an edit box, the WindowText is the content of the control. For a combo box, the text string is the content of the edit box  part of the combo box. For a button, the string is the button name. For all other controls, the string is the window title.


TControl events

TControl	Alphabetically	Legend

In TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TControl events

TControl	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TControl::OnClick

TControl	Events	See also

The OnClick event occurs when the user clicks the control.

Syntax

__property Classes::TNotifyEvent OnClick;

Description

Use the OnClick event handler to write code that responds to the click event.

Usually OnClick occurs because the user presses and releases the primary mouse button with the mouse pointer over the control. This event can also occur when

•	The user selects an item in a grid, outline, list, or combo box by pressing an arrow key.

•	The user presses Spacebar while a button or check box has focus.

•	The user presses Enter when the active form has a default button (specified by the Default property).

•	The user presses Esc when the active form has a cancel button (specified by the Cancel property).

•	The user presses the accelerator key for a button or check box. For example, if the value of the Caption property of a check box is '&Bold', the B is underlined at run time and the OnClick event of the check box is triggered when the user presses Alt+B.

•	The Checked property of a radio button is set to true.

•	The value of the Checked property of a check box is changed.

•	The Click method of a menu item is called.

For a form, an OnClick event occurs when the user clicks a blank area of the form or on a disabled component.


TControl::OnDblClick

TControl	Events	See also

The OnDblClick event occurs when the user double-clicks the primary mouse button when the mouse pointer is over the control.

Syntax

__property Classes::TNotifyEvent OnDblClick;

Description

Use the OnDblClick event to write code that responds to the double-click event.


TControl::OnDragDrop

TControl	Events	See also

The OnDragDrop event occurs when the user drops an object being dragged.

Syntax

__property TDragDropEvent OnDragDrop;

Description

Use the OnDragDrop event handler to specify what you want to happen when the user drops an object. The Source parameter of the OnDragDrop event is the object being dropped, and the Sender is the control the object is being dropped on. The X and Y parameters are the coordinates of the mouse positioned over the control.


TControl::OnDragOver

TControl	Events	See also

The OnDragOver event occurs when the user drags an object over a control.

Syntax

__property TDragOverEvent OnDragOver;

Description

Use an OnDragOver event to accept an object so the user can drop it.

Within the OnDragOver event handler, set the Accept parameter to true to accept the dragged object. Set Accept to false to prevent the user from being able to drop the dragged object on the control.

To change the shape of the cursor, indicating that the control can accept the dragged object if the user drops it, change the value of the DragCursor property for the control either at design time or at run time before an OnDragOver event occurs.

The Source is the object being dragged, the Sender is self, the potential drop site, and X and Y are screen coordinates in pixels. The TDragState type specifies the drag state of a dragged control in relationship to another control. These are the possible states:

Value	Meaning

dsDragEnter	The state a drag object is in when it enters a control that allows the drag object to be dropped. dsDragEnter is the default state.

dsDragMove	The state a drag object is in when it is moved within a control that allows the drag object to be dropped.

dsDragLeave	The state a drag object is in when it leaves a control that would allow the drag object to be dropped


TControl::OnEndDrag

TControl	Events	See also

The OnEndDrag event occurs whenever the dragging of an object ends, either by dropping the object or by canceling the dragging.

Syntax

__property TEndDragEvent OnEndDrag;

Description

Use the OnEndDrag event handler to specify any special processing that occurs when dragging stops. The Sender is the object being dragged, Target is the object Sender is dragged to, and X and Y are screen coordinates in pixels.

The OnEndDrag event is received by the Sender. If the dragged object was dropped and accepted by a control, the Target parameter of the OnEndDrag event is set to the object that accepted the drop. If the object was not dropped successfully, the value of Target is NULL.


TControl::OnMouseDown

TControl	Events	See also

The OnMouseDown event occurs when the user presses a mouse button with the mouse pointer over a control.

Syntax

__property TMouseEvent OnMouseDown;

Description

Use the OnMouseDown event handler to implement any special processing that should occur as a result of pressing a mouse button.

The OnMouseDown event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the Shift, Ctrl, and Alt keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.


TControl::OnMouseMove

TControl	Events	See also

The OnMouseMove event occurs when the user moves the mouse pointer while the mouse pointer is over a control.

Syntax

__property TMouseMoveEvent OnMouseMove;

Description

Use the OnMouseMove event handler to make something happen when the mouse pointer moves within the control.

Use the Shift parameter of the OnMouseDown event handler, to respond to the state of the shift keys and mouse buttons. Shift keys are the Shift, Ctrl, and Alt keys or shift key-mouse button combinations. X and Y are pixel coordinates of the new location of the mouse pointer in the client area of the Sender.


TControl::OnMouseUp

TControl	Events	See also

The OnMouseUp event occurs when the user releases a mouse button that was pressed with the mouse pointer over a component.

Syntax

__property TMouseEvent OnMouseUp;

Description

Use the OnMouseUp event handler to implement special processing when the user releases a mouse button.

The OnMouseUp event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the Shift, Ctrl, and Alt keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.


TControl::OnStartDrag

TControl	Events	See also

The OnStartDrag event occurs when the user has begun to drag the control or an object it contains by left-clicking on the control and holding the mouse button down.

Syntax

__property TStartDragEvent OnStartDrag;

Description

Use the OnStartDrag event handler to implement special processing when the user starts to drag the control or an object it contains.

To drag an object within the control, create a TDragObject for the object and pass the TDragObject as the value of DragObject. The TDragObject object can provide its own drag cursor, and optionally, a drag image list. The DragObject receives the OnEndDrag message when the dragging is finished. Remember to call the Free method on the DragObject when dragging is over.

When the DragObject is NULL, a TDragControlObject is automatically created and dragging begins on the control itself. There is no need to call the Free method for the DragObject.


TControl methods

TControl	Alphabetically	Legend

In TControl

~TControl

BeginDrag

BringToFront

ChangeScale

Click

ClientToScreen

DblClick

DefaultHandler

DefineProperties

DoEndDrag

DoStartDrag

DragCanceled

DragDrop

Dragging

DragOver

EndDrag

GetClientOrigin

GetClientRect

GetDeviceContext

GetDragImages

GetPalette

GetParentComponent

GetPopupMenu

GetTextBuf

GetTextLen

HasParent

Hide

Invalidate

MouseDown

MouseMove

MouseUp

Notification

PaletteChanged

Perform

ReadState

Refresh

Repaint

ScreenToClient

SendCancelMode

SendToBack

SetBounds

SetDragMode

SetName

SetParent

SetParentComponent

SetTextBuf

SetZOrder

Show

TControl

Update

UpdateBoundsRect

VisibleChanging

WndProc

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControl methods

TControl	By object	Legend

~TControl

Assign

BeginDrag

BringToFront

ChangeScale

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

DblClick

DefaultHandler

DefineProperties

DestroyComponents

Destroying

Dispatch

DoEndDrag

DoStartDrag

DragCanceled

DragDrop

Dragging

DragOver

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetClientOrigin

GetClientRect

GetDeviceContext

GetDragImages

GetPalette

GetParentComponent

GetPopupMenu

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

MouseDown

MouseMove

MouseUp

NewInstance

Notification

PaletteChanged

Perform

ReadState

Refresh

RemoveComponent

Repaint

ScreenToClient

SendCancelMode

SendToBack

SetBounds

SetDragMode

SetName

SetParentComponent

SetParent

SetTextBuf

SetZOrder

Show

TControl

UpdateBoundsRect

Update

VisibleChanging

WndProc


TControl::BeginDrag

TControl	Methods	See also

The BeginDrag method starts the dragging of a control.

Syntax

void __fastcall BeginDrag(System::Boolean Immediate);

Description

Call BeginDrag to control the start of a drag operation. An application needs to call the BeginDrag method to begin dragging only when the DragMode property value for the control is dmManual.

If the Immediate parameter is true, the mouse pointer changes to the value of the DragCursor property and dragging begins immediately. If Immediate is false, the mouse pointer doesn't change to the value of the DragCursor property and dragging doesn't begin until the user moves the mouse pointer a short distance (5 pixels). This allows the control to accept mouse clicks without beginning a drag operation.


TControl::BringToFront

TControl	Methods	See also

The BringToFront method puts the control in front of all other controls within its parent control.

Syntax

void __fastcall BringToFront(void);

Description

BringToFront is especially useful for making certain that a form is visible. It is also used to reorder overlapping controls within a form.

The order in which controls stack on top of each order (also called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they "stack" as you would expect them to. Call the BringToFront method for the bottom object to make it appear on top.

The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling BringToFront for the memo moves the memo so that it appears on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the BringToFront method of the label does nothing, the label remains behind the memo.


TControl::ChangeScale

TControl	Methods	See also

The ChangeScale method repositions and resizes the control by a specified ratio.

Syntax

virtual void __fastcall ChangeScale(System::Integer M, System::Integer D);

Description

Use ChangeScale to rescale a control. ChangeScale modifies the position as well as the size of a control. Thus, ChangeScale modifies the control’s Top, Left, Width, and Height properties.

The M and D parameters define a fraction by which to scale the control. The M parameter is the multiplier and the D parameter is the divisor. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, the same results are achieved by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To scale the control to be 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100). Alternately, specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Controls derived from TControl might want to override ChangeScale. For example, a control which defines additional font properties should scale the heights of these fonts by the M/D ratio so that all the control’s fonts scale uniformly. Similarly, any control which subdivides its client area into display regions and displays text in those regions might want to override ChangeScale to ensure those regions resize when the font does.

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling a control repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TControl::Click

TControl	Methods	See also

The Click method calls the event handler attached to the control’s OnClick event.

Syntax

virtual void __fastcall Click(void);

Description

The Click method defined in TControl does nothing except call any event handler attached to the OnClick event. It is the protected implementation method for a control's OnClick event. Override Click to provide other responses in addition to the inherited event-handler call.

 A control calls Click whenever it receives a left-button mouse-up message (WM_LBUTTONUP) if that message indicates that the mouse up occurred near the corresponding mouse-down. Many specific controls call Click in other circumstances, such as when a user types the shortcut key for a button or menu item.

See the OnClick event for a description of all occurrences that trigger click events.


TControl::ClientToScreen

TControl	Methods	See also

The ClientToScreen method translates the given point from client area coordinates to global screen coordinates.

Syntax

Windows::TPoint __fastcall ClientToScreen(const Windows::TPoint &Point);

Description

Use ClientToScreen to convert a point whose coordinates are expressed locally to the control to the corresponding point in screen coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Use ScreenToClient along with ClientToScreen to convert from one control's coordinate system to another control's coordinate system. For example,

converts P from coordinates in SourceControl to coordinates in TargetControl.


TControl::DblClick

TControl	Methods	See also

The DblClick method calls the event handler attached to the control’s OnClick event.

Syntax

virtual void __fastcall DblClick(void);

Description

The DblClick method as implemented in TControl does nothing except call any event handler attached to the OnDblClick event. It is the protected implementation method for a control's OnDblClick event. Override DblClick to provide other responses in addition to the inherited event-handler call.

A control calls the DblClick method in response to a left-button double-click message (WM_LBUTTONDBLCLICK) from Windows.


TControl::DefaultHandler

TControl	Methods	See also

The DefaultHandler method provides message handling for all messages that a control does not have specific handlers for.

Syntax

virtual void __fastcall DefaultHandler(void *Message);

Description

Override DefaultHandler to extend the behavior default handling of messages. DefaultHandler handles the messages Windows sends to manage the control's text: WM_GETTEXT, WM_SETTEXT, and WM_GETTEXTLENGTH.


TControl::DefineProperties

TControl	Methods	See also

The DefineProperties method makes the IsControl protected property persistent, providing the methods to read and write IsControl to a stream, such as a form file.

Syntax

virtual void __fastcall DefineProperties(Classes::TFiler *Filer);

Description

Override DefineProperties to define new properties or publish unpublished properties. When overriding this method, call the inherited DefineProperties method first.


TControl::DoEndDrag

TControl	Methods	See also

The DoEndDrag method is the protected implementation method for a windowed control's OnEnter event.

Syntax

virtual void __fastcall DoEndDrag(System::TObject *Target, System::Integer X, System::Integer Y);

Description

The DoEndDrag method does nothing except call any event handler attached to the OnEndDrag event. When creating a component that descends from TControl, override DoEndDrag to provide other responses in addition to the inherited event-handler call.


TControl::DoStartDrag

TControl	Methods	See also

The DoStartDrag method is the protected implementation method for a windowed control's OnEnter event.

Syntax

virtual void __fastcall DoStartDrag(TDragObject *&DragObject);

Description

The DoStartDrag method does nothing except call any event handler attached to the OnStartDrag event. Whencreating a component that descends from TControl, override DoStartDrag to provide other responses in addition to the inherited event-handler call.


TControl::DragCanceled

TControl	Methods	See also

The DragCanceled method does nothing except provide an interface for a method to respond to the cancellation of a drag.

Syntax

virtual void __fastcall DragCanceled(void);

Description

When creating a component that descends from TControl, override DragCanceled to provide code that executes when a drag operation is canceled.


TControl::DragDrop

TControl	Methods	See also

The DragDrop method calls the OnDragDrop event handler, if one exists.

Syntax

virtual void __fastcall DragDrop(System::TObject *Source, System::Integer X, System::Integer Y);

Description

When creating a component that descends from TControl, override DragDrop to add additional code that executes before the OnDragDrop event handler is called.

The Source parameter of the DragDrop method is the object to be considered dropped by the handler. The X and Y parameters are the coordinates of the mouse positioned where the object is to be considered dropped.


TControl::Dragging

TControl	Methods	See also

The Dragging method specifies whether a control is being dragged.

Syntax

System::Boolean __fastcall Dragging(void);

Description

Use Dragging to determine the drag state of the control. If Dragging returns true, the control is being dragged. If Dragging is false, the control is not being dragged.


TControl::DragOver

TControl	Methods	See also

The DragOver method calls the OnDragOver event handler, if one exists.

Syntax

virtual void __fastcall DragOver(System::TObject *Source, System::Integer X, System::Integer Y, TDragState

Description

When creating a component that descends from TControl, override DragOver to add additional code that executes before the OnDragOver event handler is called.

When the Accept parameter is true, the user is able to drop the dragged object on the control.When Accept is false, the user can’t drop the dragged object on the control.

The Source parameter is the object being dragged. These are the possible values of the State parameter:

Value	Meaning

dsDragEnter	The state a drag object is in when it enters a control that allows the drag object to be dropped. dsDragEnter is the default state.

dsDragMove	The state a drag object is in when it is moved within a control that allows the drag object to be dropped.

dsDragLeave	The state a drag object is in when it leaves a control that would allow the drag object to be dropped


TControl::EndDrag

TControl	Methods	See also

The EndDrag method stops a control from being dragged any further.

Syntax

void __fastcall EndDrag(System::Boolean Drop);

Description

Use EndDrag to stop a dragging operation that began with a call to the BeginDrag method.

If the Drop parameter is true, the control being dragged is dropped. If the Drop parameter is false, the control is not dropped and dragging is canceled.


TControl::GetClientOrigin

TControl	Methods	See also

The GetClientOrigin method obtains the screen coordinates of the top-left corner of the control’s client area.

Syntax

virtual Windows::TPoint __fastcall GetClientOrigin(void);

Description

Override GetClientOrigin to change how the ClientOrigin is calculated.

The GetClientOrigin method is a protected method for the ClientOrigin property. GetClientOrigin calculates the ClientOrigin by adding the control’s Left and Top values to the ClientOrigin coordinates of its parent.


TControl::GetClientRect

TControl	Methods	See also

The GetClientRect method returns a rectangle defining the client area of the control.

Syntax

virtual Windows::TRect __fastcall GetClientRect(void);

Description

Override GetClientRect to change how the client area is calculated.

The GetClientRect method is a protected method for the ClientRect property. GetClientRect returns a rectangle with the rectangle’s Top and Left fields set to zero, and its Bottom and Right fields set to the control's CleintHeight and ClientWidth, respectively.


TControl::GetDeviceContext

TControl	Methods	See also

The GetDeviceContext method returns a device context for the control.

Syntax

virtual System::Integer __fastcall GetDeviceContext(System::Integer &WindowHandle);

Description

Call GetDeviceContext to obtain a device context. Override GetDeviceContext to change how the device context is obtained.

Pass the window handle of the control in the WindowHandle parameter. GetDeviceContext returns the device context returned from its parent control's GetDeviceContext.


TControl::GetDragImages

TControl	Methods	See also

The GetDragImages method returns the control's image list containing the image to be displayed while dragging.

Syntax

virtual TCustomImageList *__fastcall GetDragImages(void);

Description

Override GetDragImages to provide a custom image list for the control. The GetDragImages method for TControl returns NULL.


TControl::GetPalette

TControl	Methods	See also

The GetPalette method returns the handle to a palette for use by the control.

Syntax

virtual System::Integer __fastcall GetPalette(void);

Description

The GetPalette for TControl returns a null handle, indicating that the control does not need to specify a palette. Override GetPalette to implement derived objects that use a palette. Create a palette handle for the control by a call to the Windows API function CreatePalette. GetPalette should return the palette handle for the control.

Specifying the palette for a control does two things for your application:

•	It tells the application that your control's palette needs to be realized.

•	It designates the palette to use for realization.

GetPalette is called only if the run-time video mode requires color palette support, for example, in 256-color mode.


TControl::GetParentComponent

TControl	Methods	See also

The GetParentComponent method returns the parent component of the control.

Syntax

virtual Classes::TComponent *__fastcall GetParentComponent(void);

Description

Call GetParentComponent to find the parent component of the control. GetParentComponent is a protected access method of the control’s Parent property.


TControl::GetPopupMenu

TControl	Methods	See also

The GetPopupMenu returns the popup menu associated with the control.

Syntax

virtual Menus::TPopupMenu *__fastcall GetPopupMenu(void);

Description

Call GetPopupMenu to find the popup menu associated with the control. Override GetPopupMenu to change which popup menu is associated with the control or to specify different popup menus depending on the state of the control.

GetPopupMenu returns the value of the Popup property.


TControl::GetTextBuf

TControl	Methods	See also

The GetTextBuf method retrieves the control's text and copies it into a buffer and returns the number of characters copied.

Syntax

System::Integer __fastcall GetTextBuf(System::PChar Buffer, System::Integer BufSize);

Description

Call GetTextBuf to retrieve the text of a control into a fixed size buffer. The text copied is the value of the Text property. GetTextBuf returns the number of characters that were actually copied, which is either the length of the Text property, or BufSize - 1, whichever is smaller.

To find out how many characters the buffer needs to hold the entire text, call the GetTextLen method before allocating a buffer for GetTextBuf.

GetTextBuf is available for compatibility with 16-bit code. Where backward compatiblity is not an issue, use the Text property.


TControl::GetTextLen

TControl	Methods	See also

The GetTextLen method returns the length of the control's text.

Syntax

System::Integer __fastcall GetTextLen(void);

Description

Call GetTextLen is to find the length of the control’s text. This is the size needed for a text buffer to be used by the GetTextBuf method.


TControl::HasParent

TControl	Methods	See also

The HasParent method indicates whether the control has a parent.

Syntax

virtual System::Boolean __fastcall HasParent(void);

Description

Call HasParent to find out if a control has a parent.

The parent of the control is responsible for writing the control to a stream. By default, HasParent for a control returns true. The parent that writes the control to a stream is usually a form or panel control that contains this control.

Note

A child control that returns true from HasParent must implement the GetParentComponent and SetParentComponent methods.


TControl::Hide

TControl	Methods	See also

The Hide method makes the control invisible.

Syntax

void __fastcall Hide(void);

Description

Call Hide to hide a control. Hide sets the Visible property of the control to false.

Although a control that is hidden is not visible, its properties and methods are still available.


TControl::Invalidate

TControl	Methods	See also

The Invalidate method tells Windows to repaint the control after other important Windows messages are handled.

Syntax

virtual void __fastcall Invalidate(void);

Description

Use Invalidate when the entire control needs to be repainted. When more than one region within the control needs repainting, Invalidate will cause the entire window to be repainted, avoiding flicker. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.


TControl::MouseDown

TControl	Methods	See also

The MouseDown method calls the OnMouseDown event handler, if one exists.

Syntax

virtual void __fastcall MouseDown(TMouseButton Button,  Classes::TShiftState Shift, System::Integer

Description

Override the protected MouseDown method to provide other responses in addition to calling the OnMouseDown event handler.

The Button parameter determines which mouse button the user pressed. Shift indicates which shift keys (Shift, Ctrl, or Alt) were down when the user pressed or released the mouse button that generated the mouse-button event. X and Y are the pixel coordinates of the mouse pointer within the client area of the control.

A control calls MouseDown in response to any of the Windows mouse-down messages (WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TControl::MouseMove

TControl	Methods	See also

The MouseMove method calls the event handler attached to the OnMouseMove event.

Syntax

virtual void __fastcall MouseMove( Classes::TShiftState Shift, System::Integer X, System::Integer Y

Description

Override the protected MouseMove method to provide other responses in addition to calling the OnMouseMove event handler.

A control calls MouseMove in response to any of the Windows mouse-move messages (WM_MOUSEMOVE), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively.


TControl::MouseUp

TControl	Methods	See also

The MouseUp event calls the OnMouseUp event handler.

Syntax

virtual void __fastcall MouseUp(TMouseButton Button,  Classes::TShiftState Shift, System::Integer X

Description

Override the protected MouseUp method to provide other responses in addition to calling the OnMouseUp event handler.

A control calls MouseUp in response to any of the Windows mouse-up messages (WM_LBUTTONUP, WM_MBUTTONUP, WM_RBUTTONUP), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TControl::Notification

TControl	Methods	See also

The Notification method allows TControl to update its Popupmenu property when the popup menu it refers to is destroyed.

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation

Description

Override the Notification method to update controls that rely on other system resources so that they will not contain references to objects that have been removed. For example, data-aware objects should override the Notification method to update themselves when their data source is removed.

By default, components pass along the notification to their owned components, if any.


TControl::PaletteChanged

TControl	Methods	See also

The PaletteChanged method responds to changes in the system's palette by realizing the control's palette.

Syntax

virtual System::Boolean __fastcall PaletteChanged(System::Boolean Foreground);

Description

Override PaletteChanged to change how the control responds to Windows notifications that the system palette is changing. TControl responds to these notifications by trying to realize the control’s palette, if any, into the current device context. If the change in the system palette causes the actual value of the control’s palette to change, PaletteChanged will invalidate the control so that it can repaint with the new palette.

Windows paints the topmost window with a foreground palette, while other windows employ background palettes. Background palettes are approximate matches to the colors specified by the control’s logical palette, given the limitations imposed by implementing the foreground palette. Windows only allows a single foreground palette.

PaletteChanged allows the control to obtain a new realization of its palette when the system palette changes. When ForeGround is true, the form has been activated and controls is specifing the new foreground palette. When ForeGround is false, another application has changed the foreground palette, and controls that are sensitive to the available palette should realize new background palettes to best match their logical palettes.

If the control does not have a logical palette to be realized into the current device context, GetPalette will return false, and PaletteChanged will return false, indicating that no palette was realized. If GetPalette returns the handle to a logical palette, PaletteChanged will realize this palette into the current device context, and return true.

Note

PaletteChanged is called only when the run-time video mode requires palette support, such as for 256 color mode, but not 16 million color mode.


TControl::Perform

TControl	Methods	See also

The Perform method enables a control to send itself a Windows message.

Syntax

System::Longint __fastcall Perform(System::Cardinal Msg, System::Longint WParam, System::Longint LParam

Description

Call Perform to bypass the Windows message queue and send a message directly to the control’s window procedure.

Perform fills a message record (of type TMessage) with the message ID passed in the Msg parameter, the message parameters passed in WParam and LParam, and a result field of zero. Perform then passes the message record to the WndProc method for processing.


TControl::ReadState

TControl	Methods	See also

The ReadState method prepares the control for having its properties assigned values read from a stream.

Syntax

virtual void __fastcall ReadState(Classes::TReader *Reader);

Description

Override ReadState to change the preparations the control makes as it readies itself to have the values of its properties assigned from a stream. For example, a control might destroy temporary internal data structures or objects before new instances are loaded from the stream. Remember to include a call to the inherited ReadState property when overriding ReadState.

TControl.ReadState assigns the TReader object’s Parent property to this control’s own Parent property before calling the inherited ReadState method of TComponent. Finally, ReadState synchronizes the Font, Color, and ShowHint properties with the parent control, as indicated by the ParentFont, ParentColor, and ParentShowHint properties, respectively.


TControl::Refresh

TControl	Methods	See also

The Refresh method repaints the control on the screen.

Syntax

void __fastcall Refresh(void);

Description

Call Refresh method to repaint the control immediately. Refresh calls the Repaint method. Use the Refresh and Repaint methods interchangeably.


TControl::Repaint

TControl	Methods	See also

The Repaint method forces the control to repaint its image on the screen.

Syntax

virtual void __fastcall Repaint(void);

Description

Call Repaint to force the control to repaint its image immediately. If the ControlStyle includes csOpaque, as does a control derived from TGraphicControl, the control is repainted into the parent’s device context. Otherwise, the Repaint method calls the Invalidate method and then the Update method to repaint the control immediately.


TControl::ScreenToClient

TControl	Methods	See also

The ScreenToClient method converts the screen coordinates of a specified point on the screen to client coordinates.

Syntax

Windows::TPoint __fastcall ScreenToClient(const Windows::TPoint &Point);

Description

Use ScreenToClient to convert a point in screen coordinates to local, or client area, coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Use ScreenToClient along with ClientToScreen to convert from one control's coordinate system to another control's coordinate system. For example,

converts P from coordinates in SourceControl to coordinates in TargetControl.


TControl::SendCancelMode

TControl	Methods	See also

The SendCancelMode method cancels the modal state of the control.

Syntax

void __fastcall SendCancelMode(TControl *Sender);

Description

Call SendCancelMode to cancel the modal state of the control. Various controls implemented in the Visual Component Library support a model state where the user must respond to the control before interacting with any other object on the form. An example would be the dropped-down state of a combo box when the drop-down list is showing. For these controls, specific user actions send a windows message to the control to end the model state. SendCancelMode allows an application to end the modal state of the control in the absense of a user action, or in order to implement a new user interface response.


TControl::SendToBack

TControl	Methods	See also

The SendToBack method puts a windowed control behind all other windowed controls within its parent component or form, or it puts a non-windowed control behind all other non-windowed control within its parent component or form.

Syntax

void __fastcall SendToBack(void);

Description

Use SendToBack to change the order of overlapping controls or forms.

The order in which controls stack on top of each order (also called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they "stack" as you would expect them to. Call the SendToBack method for the top object to move it below the other object.

The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling SendToBack for the check box makes the memo appear on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SendToBack method of the memo does nothing, the label remains behind the memo.

If the control has the input focus when the SendToBack method executes, it loses the input focus.


TControl::SetBounds

TControl	Methods	See also

The SetBounds method sets the Left, Top, Width, and Height properties all at once.

Syntax

virtual void __fastcall SetBounds(System::Integer ALeft, System::Integer ATop, System::Integer AWidth

Description

Use SetBounds to change all of the component's boundary properties at one time. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately, but SetBounds changes all four properties at once ensuring that the control will not repaint between changes.

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.


TControl::SetDragMode

TControl	Methods	See also

The SetDragMode methods sets the drag mode for the control.

Syntax

virtual void __fastcall SetDragMode(TDragMode Value);

Description

SetDragMode is the protected method for the DragMode property. Override SetDragMode to execute additional code when the value of the DragMode property changes.


TControl::SetName

TControl	Methods	See also

The SetName property sets the name of the control.

Syntax

virtual void __fastcall SetName(const System::AnsiString Value);

Description

SetName is the protected method for setting the value of the Name property. Override SetName to execute additional code when the value of the Name property changes.


TControl::SetParent

TControl	Methods	See also

The SetParent sets the parent of the control

Syntax

virtual void __fastcall SetParent(TWinControl *AParent);

Description

Call SetParent to make the specified window control the parent of this control. The SetParent method is a protected method for setting the Parent property. Override SetParent to execute additional code when the value of the Parent property changes.

Specify the control that is to become the parent control as the value of the AParent parameter.

If the control already has a parent, SetParent removes the control from that parent's list of controls by calling the parent's RemoveControl method. If AParent is non-NULL, SetParent calls that control's InsertControl method to add the control to its list of controls.

The Destroy method of all controls calls SetParent(NULL) to remove the control from its parent's control list before destroying the component.


TControl::SetParentComponent

TControl	Methods	See also

The SetParentComponent sets the parent for the control.

Syntax

virtual void __fastcall SetParentComponent(Classes::TComponent *Value);

Description

Call SetParentComponent to make the specified component the parent of the control. Specify the component that is to become the parent of the control as the value of the Value parameter.

SetParentComponent calls the SetParent method only if the component specified as the parent is a windowed control.


TControl::SetTextBuf

TControl	Methods	See also

The SetTextBuf method sets text of the control.

Syntax

void __fastcall SetTextBuf(System::PChar Buffer);

Description

Call the SetTextBuf method to set the text of the control to the text in the specified buffer.

The text is set to the text in the buffer pointed to by the Buffer parameter. Buffer must point to a null-terminated string. The SetTextBuf method sends the WM_SETTEXT and CM_TEXTCHANGED messages.

Note

The SetTextBuf method is provided for backwards compatibility only. Use the Text property instead to set the text of the control.


TControl::SetZOrder

TControl	Methods	See also

The SetZOrder method repositions the control in its parent’s control list, thereby changing position onscreen also.

Syntax

virtual void __fastcall SetZOrder(System::Boolean TopMost);

Description

Call SetZOrder to change the Z-order of the control. To make the control the topmost control, specify the TopMost value as true. To make the control the bottommost, set TopMost to false.

After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SetZOrder method of the label or the memo has no effect, the label always remains behind the memo.


TControl::Show

TControl	Methods	See also

The Show method makes a control visible.

Syntax

void __fastcall Show(void);

Description

Use the Show method to make visible a control that was previously hidden.

The Show method sets the control’s Visible property to true and also ensures that the parent control is visible.


TControl::Update

TControl	Methods	See also

The Update method processes any pending paint messages immediately.

Syntax

virtual void __fastcall Update(void);

Description

Call Update to force the control to be repainted before any more, possibly time-consuming, processing takes place. Use Update to provide immediate feedback to the user that cannot wait for the Windows paint message to arrive. Update does not invalidate the control, but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead if you need to invalidate the control as well.


TControl::UpdateBoundsRect

TControl	Methods	See also

The UpdateBoundsRect method changes the Top, Left, Width, and Height properties of the control, but doesn’t update it’s screen image.

Syntax

void __fastcall UpdateBoundsRect(const Windows::TRect &R);

Description

UpdateBoundsRect is primarily used internally by controls to stay synchronized with changes made by Windows. UpdateBoundsRect updates the properties to match those passed in the rectangle as the R parameter.


TControl::VisibleChanging

TControl	Methods	See also

The VisibleChanging method is called before the value of a control’s Visible property changes.

Syntax

virtual void __fastcall VisibleChanging(void);

Description

VisibleChanging does nothing more than provide an interface for descendent objects to override in order to respond to changes in the control’s visibility. For example, if the control should not change its visibility, override VisibleChanging to raise an exception when an attempt is made to alter the control’s visibility.


TControl::WndProc

TControl	Methods	See also

The WndProc method provides specific message responses for the control.

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

Override WndProc to provide specialized responses to messages.

WndProc is the first method that receives messages for a Borland C++ Builder control. It defines mouse-message responses for basic clicks and drags, and sends all other messages on to the Dispatch method.

When overridingWndProc to provide specialized responses to messages, be sure to call the inherited WndProc at the end to dispatch any other messages.


TControl::TControl

TControl	Methods	See also

TControl creates a new TControl object.

Syntax

__fastcall virtual TControl(Classes::TComponent *AOwner);

Description

Use TControl to create a new TControl object.


TControl::~TControl

TControl	Methods	See also

~TControl frees the memory associated with the TControl object.

Syntax

__fastcall virtual ~TControl(void);

Description

Do not call ~TControl directly. Instead, use the delete keyword on the object, which causes ~TControl to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TControl example

TControl


TConversion

Hierarchy	Methods	See also

TConversion provides streaming services to convert between text represented in rich text format (RTF) and the representation of that within a file.

Header

vcl/comctrls.hpp

Description

TConversion, by itself, does not perform any conversions, but simply streams the text. TConversion exists primarily to provide an interface that can be overridden by derived classes that convert text from one format to another while streaming it in or out.

Descendents of TCustomRichEdit use TConversion to handle the streaming of text to and from files, when the files contain plain ANSI text or text in RTF format. To allow rich text edit controls to read from and write to files that use another format, derive a class from TConversion which converts between that format and RTF. Rich text edit controls can use the new class by registering it through their RegisterConversionFormat method, or by setting it as the default converter;


TConversion methods

TConversion	Alphabetically

In TConversion

~TConversion

ConvertReadStream

ConvertWriteStream

TConversion

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TConversion methods

TConversion	By object

~TConversion

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ConvertReadStream

ConvertWriteStream

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TConversion


TConversion::ConvertReadStream

TConversion	Methods	See also

ConvertReadStream reads BufSize bytes from the  TStream Stream into the memory buffer pointed to by Buffer.

Syntax

virtual System::Integer __fastcall ConvertReadStream(Classes::TStream *Stream, System::PChar Buffer

To convert text between two formats, override this method in a descendant class and convert the text in the buffer. To create a descendant class that TCustomRichEdit can use, convert the text to RTF format.

Note

ConvertReadStream should reverse the conversion that ConvertWriteStream makes.


TConversion::ConvertWriteStream

TConversion	Methods	See also

ConvertWriteStream writes BufSize bytes to the  TStream Stream from the memory buffer pointed to by Buffer.

Syntax

virtual System::Integer __fastcall ConvertWriteStream(Classes::TStream *Stream, System::PChar Buffer

To write text between two formats, override this method in a descendant class and convert the text in the buffer. To create a descendant class that TCustomRichEdit can use, convert the text from RTF format.

Note

ConvertWriteStream should reverse the conversion that ConvertReadStream makes.


TConversion::TConversion

TConversion	Methods	See also

TConversion creates a new TConversion object.

Syntax

__fastcall TConversion(void);

Description

Use TConversion to create a new TConversion object.


TConversion::~TConversion

TConversion	Methods	See also

~TConversion frees the memory associated with the TConversion object.

Syntax

__fastcall virtual ~TConversion(void);

Description

Do not call ~TConversion directly. Instead, use the delete keyword on the object, which causes ~TConversion to be invoked automatically.


Hierarchy

TObject


TConversion example

TConversion


TCurrencyField

Hierarchy	Properties	Methods	Events	See also

A TCurrencyField component represents a field that contains currency values in a dataset.

Header

vcl/dbtables.hpp

Description

Currency fields can hold values in the range from (positive or negative) 5.0 * 10-324 to 1.7 * 10308 with an accuracy of 15 to 16 digits.

TCurrencyField differs from its immediate ancestor TFloatField only in having a DataType of ftCurrency, and in formatting the value in a currency format by default. As a descendent of TFloatField, TCurrencyField includes many properties, methods, and events that are useful for managing the value and properties of a floating-point field in a database.

Do not confuse TCurrencyField with the Currency data type. Currency fields use the Double data type to store and manipulate their values. This corresponds to the format used by the physical database tables for currency fields. The BCDField class uses the Currency data type to store and manipulate its value.


TCurrencyField properties

TCurrencyField	Alphabetically	Legend

In TCurrencyField

Currency

Derived from TFloatField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TCurrencyField properties

TCurrencyField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Currency

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

Precision

ReadOnly

Required

Size

Tag

Text

Value

Visible


TCurrencyField::Currency

TCurrencyField	Properties	See also

Currency determines whether the value in the field should be formatted as a currency value.

Syntax

__property currency;

Description

Use the Currency property to influence how the value in the field should be formatted for viewing and editing in a data-aware control.

The format of the field for display purposes uses the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, then Currency determines how the field is formatted for display. If Currency is true, the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is false, the value is formatted with the ffGeneral format.

The format of the field for editing purposes uses the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, then Currency determines how the field is formatted for editing. If Currency is true, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is false, the value is formatted with the ffGeneral format.

The default value of Currency for TCurrencyField components is true.


TCurrencyField events

TCurrencyField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TCurrencyField events

TCurrencyField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TCurrencyField methods

TCurrencyField	Alphabetically

In TCurrencyField

~TCurrencyField

TCurrencyField

Derived from TFloatField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCurrencyField methods

TCurrencyField	By object

~TCurrencyField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TCurrencyField


TCurrencyField::TCurrencyField

TCurrencyField	Methods	See also

TCurrencyField creates a new TCurrencyField object.

Syntax

__fastcall virtual TCurrencyField(Classes::TComponent *AOwner);

Description

Use TCurrencyField to create a new TCurrencyField object.


TCurrencyField::~TCurrencyField

TCurrencyField	Methods	See also

~TCurrencyField frees the memory associated with the TCurrencyField object.

Syntax

__fastcall virtual ~TCurrencyField(void);

Description

Do not call ~TCurrencyField directly. Instead, use the delete keyword on the object, which causes ~TCurrencyField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TFloatField


TCurrencyField example

TCurrencyField


TControlScrollBar

Hierarchy	Properties	Methods

The TControlScrollBar object is used by the HorzScrollBar and VertScrollBar properties of a form or scroll box to display horizontal and vertical scroll bars users can use to scroll the form or scroll box.

Header

vcl/forms.hpp

The HorzScrollBar and VertScrollBar objects have nested properties that determine how these scroll bars behave. The Range property determines how far a user can scroll a form or scroll box. Increment determines how many positions the thumb tab on a scroll bar moves when the user clicks on the scroll bar arrows. You can set the position of the thumb tab with the Position property. If you don’t want a scroll bar to appear, set the Visible property to false.

If you want to prevent controls from scrolling partially off screen so the user can’t scroll them back into view, use the Margin property.

In addition to these properties, the TControlScrollBar object also has the methods that apply to all objects and is a direct descendent of TPersistent.


TControlScrollBar properties

TControlScrollBar	Alphabetically	Legend

In TControlScrollBar

Increment

Kind

Margin

Position

Range

ScrollPos

Tracking

Visible


TControlScrollBar properties

TControlScrollBar	By object	Legend

Increment

Kind

Margin

Position

Range

ScrollPos

Tracking

Visible


TControlScrollBar::Increment

TControlScrollBar	Properties

Determines how many positions the scroll box in a form scroll bar moves when the user clicks one of the small end arrows.

Syntax

__property TScrollBarInc Increment;


Kind

Determines if a scroll bar is horizontal or vertical.

These are the possible values for Kind:

Value	Meaning

sbHorizontal	Scroll bar is horizontal

sbVertical	Scroll bar is vertical


TControlScrollBar::Margin

TControlScrollBar	Properties

Determines the minimum number of pixels controls on a form or in a scroll box to be are from the edge of the form or scroll box.

Syntax

__property System::Word Margin;

The value of Margin is automatically added to the Range value to ensure that the user has a scroll bar whenever the distance from a control and the edge of the form or scroll box becomes less than the Margin value.


TControlScrollBar::Position

TControlScrollBar	Properties

Determines the position of the thumb tab on a scroll bar.

Syntax

__property System::Integer Position;

When the user scrolls the scroll bar, the value of Position changes. You can also change where the thumb tab appears on the scroll bar by changing the value of Position.

For TControlScrollBar components, the value of the Range property determines the number of possible positions on a scroll bar that a thumb tab can assume. The default value is 0, which positions the thumb tab at the far left.

For TScrollBar components, the number of possible positions on the scroll bar is determined by the difference between the Max property and the Min property. If the Min and Position values are both 0, the thumb tab is positioned to the far left on a horizontal scroll bar and to the top of a vertical scroll bar. If Min is 10, Position can be no less than 10.


TControlScrollBar::Range

TControlScrollBar	Properties

Determines how far a horizontal or vertical form scroll bar can be scrolled.

Syntax

__property System::Integer Range;

Range also represents the virtual size of the form. For example, if the Range value of a horizontal scroll bar is 500, and the client width of the form is 200, the scroll bar position can range from 0 to 300. While the client width of the form is 200, the virtual client width of the form is 500, because the user can scroll the form that far.

If the value of Range for a horizontal scroll bar is less than the client width of the form or scroll box, no horizontal scroll bar appears on the form. Likewise, if the value of Range for a vertical scroll bar is less than the client height of the form or scroll box, no vertical scroll bar appears.

For a horizontal scroll bar, the Range is calculated to be the distance of the right edge of the control that is the farthest to the right in the scroll bar or form from the left edge of the scroll box or form plus an amount specified as the value of the Margin property. If the form or scroll box contains one or more controls that are right-aligned (their Align value is alRight), the width of these controls is also added to the Range calculation.

For a vertical scroll bar, the Range is calculated to be the distance of the bottom edge of the control farthest away from the top edge of the scroll box or form from the top of the scroll box or form plus an amount specified as the value of the Margin property. If the form or scroll box contains one or more controls that are bottom-aligned (their Align value is alBottom), the height of these controls is also added to the Range calculation.


TControlScrollBar::ScrollPos

TControlScrollBar	Properties

Reports the current Position value of a horizontal or vertical scroll bar on a form or scroll box.

Syntax

__property System::Integer ScrollPos;


Tracking

Determines whether the form or scroll box scrolls when the scroll bar thumb tab is dragged or waits for the thumb tab to be dropped.


TControlScrollBar::Visible

TControlScrollBar	Properties

Determines whether a scroll bar appears on a form or in scroll box.

Syntax

__property System::Boolean Visible;

Even when Visible is true, scroll bars aren’t visible on a form or scroll box unless there is a need to scroll the form or scroll box. For example, a scroll bar appears if only part of a control is visible on a form. When Visible is false, the scroll bar does not appear even if a control on a form or in a scroll box is only partly visible.


TControlScrollBar methods

TControlScrollBar	Alphabetically

In TControlScrollBar

~TControlScrollBar

Assign

TControlScrollBar

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControlScrollBar methods

TControlScrollBar	By object

~TControlScrollBar

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TControlScrollBar


TControlScrollBar::Assign

TControlScrollBar	Methods

[GENERIC]

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assigns an object to control scroll bar.

Use assign to assign a one control scroll bar object to another. The general form of a call to Assign is

which tells the Destination object to assign the contents of the Source object to itself.

In general, the statement "Destination = Source" is not the same as the statement "Destination.Assign(Source)". The statement "Destination = Source" makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object references by Source into the object referenced by Destination.

If Destination is a property of some object, however, and that property is not a reference to another object (such as the ActiveControl property of a form, or the DataSource property of a data-aware control), then the statement "Destination = Source" is the same as "Destination.Assign(Source)". Consider these statements:

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at run time only if the objects involved "know" how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at run time.

An object of one type can always be assigned to another object of the same type.


TControlScrollBar::TControlScrollBar

TControlScrollBar	Methods	See also

TControlScrollBar creates a new TControlScrollBar object.

Syntax

__fastcall TControlScrollBar(TScrollingWinControl *AControl, TScrollBarKind AKind);

Description

Use TControlScrollBar to create a new TControlScrollBar object.


TControlScrollBar::~TControlScrollBar

TControlScrollBar	Methods	See also

~TControlScrollBar frees the memory associated with the TControlScrollBar object.

Syntax

__fastcall virtual ~TControlScrollBar(void);

Description

Do not call ~TControlScrollBar directly. Instead, use the delete keyword on the object, which causes ~TControlScrollBar to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TControlScrollBar example

TControlScrollBar


TControlCanvas

Hierarchy	Properties	Methods	Events	See also

TControlCanvas is a specialized canvas object associated with a control.

Header

vcl/controls.hpp

Description

Use TControlCanvas as a drawing space to render the image of a control. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

As a canvas, TControlCanvas provides many properties, events, and methods to aid in the creation of rich images. In addition, TControlCanvas adds properties and methods to interact with a control object, and to manage the device context associated with the control.

TControlCanvas is used by TGraphicControl and TCustomControl to provide services for rendering their images.


TControlCanvas properties

TControlCanvas	Alphabetically	Legend

In TControlCanvas

Control

Derived from TCanvas

Brush

ClipRect

CopyMode

Font

Handle

Pen

PenPos

Pixels


TControlCanvas properties

TControlCanvas	By object	Legend

Brush

ClipRect

Control

CopyMode

Font

Handle

PenPos

Pen

Pixels


TControlCanvas::Control

TControlCanvas	Properties	See also

Control specifies the control associated with the control canvas object.

Syntax

__property TControl * Control;

Description

Read Control to gain access to the control associated with the control canvas object. Descendants of TControl that use a control canvas set the Control property to form the association. The control canvas object uses the Control property to get information from its associated control.


TControlCanvas events

TControlCanvas	Alphabetically

Derived from TCanvas

OnChange

 OnChanging


TControlCanvas events

TControlCanvas	By object

OnChange

 OnChanging


TControlCanvas methods

TControlCanvas	Alphabetically

In TControlCanvas

~TControlCanvas

FreeHandle

TControlCanvas

Derived from TCanvas

Arc

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

MoveTo

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextHeight

TextOut

TextRect

TextWidth

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControlCanvas methods

TControlCanvas	By object

~TControlCanvas

Arc

Assign

BrushCopy

Chord

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyRect

DefaultHandler

Dispatch

DrawFocusRect

Draw

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

FreeHandle

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LineTo

MethodAddress

MethodName

MoveTo

NewInstance

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TControlCanvas

TextHeight

TextOut

TextRect

TextWidth


TControlCanvas::FreeHandle

TControlCanvas	Methods	See also

FreeHandle releases the handle to a device context (HDC) used by the control canvas object.

Syntax

void __fastcall FreeHandle(void);

Description

Call FreeHandle to free the HDC used by the control canvas. FreeHandle sets the Handle property to NULL. After calling FreeHandle, an HDC will be re-acquired if any of the drawing methods are called.

Note

Setting the Handle property to NULL does not free the HDC. Set the Handle property to NULL rather than call FreeHandle if the HDC is release by the application.


TControlCanvas::TControlCanvas

TControlCanvas	Methods	See also

TControlCanvas creates a new TControlCanvas object.

Syntax

__fastcall TControlCanvas(void);

Description

Use TControlCanvas to create a new TControlCanvas object.


TControlCanvas::~TControlCanvas

TControlCanvas	Methods	See also

~TControlCanvas frees the memory associated with the TControlCanvas object.

Syntax

__fastcall virtual ~TControlCanvas(void);

Description

Do not call ~TControlCanvas directly. Instead, use the delete keyword on the object, which causes ~TControlCanvas to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCanvas


TControlCanvas example

TControlCanvas


TCustomCheckBox

Hierarchy	Properties	Methods

The TCustomCheckBox component is the abstract base type for all check-box controls, including TCheckBox, TDBCheckBox, and any user-defined check box components.

Header

vcl/stdctrls.hpp

Overview

The properties defined by TCustomCheckBox are all published in the standard Borland C++ Builder check box components. TCustomCheckBox also overrides three protected methods and introduces a protected Toggle method that switches among the valid check-box states.

Protected Properties

Alignment, AllowGrayed, Checked, State

Protected Methods

CreateParams, CreateWindowHandle, CreateWnd, Toggle

Note:

The protected methods and properties of the custom objects that get doct in the generic derived class will need to be added to the fololwing tables.


TCustomCheckBox properties

TCustomCheckBox	Alphabetically	Legend

In TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomCheckBox properties

TCustomCheckBox	By object	Legend

Alignment

Align

AllowGrayed

BoundsRect

Brush

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

State

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomCheckBox::Alignment

TCustomCheckBox	Properties

Syntax

__property Classes::TLeftRight Alignment;


TCustomCheckBox::AllowGrayed

TCustomCheckBox	Properties

Syntax

__property System::Boolean AllowGrayed;


TCustomCheckBox::Checked

TCustomCheckBox	Properties

Syntax

__property System::Boolean Checked;


TCustomCheckBox::State

TCustomCheckBox	Properties

Syntax

__property TCheckBoxState State;


TCustomCheckBox methods

TCustomCheckBox	Alphabetically	Legend

In TCustomCheckBox

~TCustomCheckBox

CreateParams

CreateWindowHandle

CreateWnd

TCustomCheckBox

Toggle

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomCheckBox methods

TCustomCheckBox	By object	Legend

~TCustomCheckBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWindowHandle

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomCheckBox

Toggle

UpdateControlState

Update


TCustomCheckBox::CreateParams

TCustomCheckBox	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomCheckBox::CreateWindowHandle

TCustomCheckBox	Methods

Syntax

virtual void __fastcall CreateWindowHandle(const Controls::TCreateParams &Params);


TCustomCheckBox::CreateWnd

TCustomCheckBox	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomCheckBox::Toggle

TCustomCheckBox	Methods

Syntax

virtual void __fastcall Toggle(void);


TCustomCheckBox::TCustomCheckBox

TCustomCheckBox	Methods	See also

TCustomCheckBox creates a new TCustomCheckBox object.

Syntax

__fastcall virtual TCustomCheckBox(Classes::TComponent *AOwner);

Description

Use TCustomCheckBox to create a new TCustomCheckBox object.


TCustomCheckBox::~TCustomCheckBox

TCustomCheckBox	Methods	See also

~TCustomCheckBox frees the memory associated with the TCustomCheckBox object.

Syntax

__fastcall virtual ~TCustomCheckBox(void);

Description

Do not call ~TCustomCheckBox directly. Instead, use the delete keyword on the object, which causes ~TCustomCheckBox to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TCustomCheckBox example

TCustomCheckBox


TCustomComboBox

Hierarchy	Properties	Methods	Events

The TCustomComboBox component is the abstract base type for all combo-box controls, including TComboBox, TDBComboBox, TDriveComboBox, and TFilterComboBox.

Header

vcl/stdctrls.hpp

Description

All the properties declared in TCustomComboBox are published in TComboBox. In addition to the methods inherited from TWinControl, TCustomComboBox overrides several protected methods and introduces four new protected methods. The ComboWndProc method serves as the window procedure for the combo box component. The Change, DropDown, DrawItem, and MeasureItem methods trigger the OnChange, OnDropDown, OnDrawItem, and OnMeasureItem events, respectively.


TCustomComboBox properties

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

Canvas

DropDownCount

DroppedDown

EditHandle

ItemHeight

ItemIndex

Items

ListHandle

MaxLength

SelLength

SelStart

SelText

Sorted

Style

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomComboBox properties

TCustomComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DropDownCount

DroppedDown

EditHandle

Enabled

Handle

Height

HelpContext

Hint

ItemHeight

ItemIndex

Items

Left

ListHandle

MaxLength

Name

Owner

ParentColor

Parent

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomComboBox::Canvas

TCustomComboBox	Properties

Syntax

__property Graphics::TCanvas * Canvas;


TCustomComboBox::DropDownCount

TCustomComboBox	Properties

The maximum number of items displayed in a drop-down list before a scroll bar is added to the list box.

Syntax

__property System::Integer DropDownCount;

Description

If the number of items to be displayed is less than or equal to DropDownCount, the displayed list contains only those items. For example, if DropDownCount is eight and three items are to be displayed, only those three items are displayed.

If the number of items to be displayed is greater than DropDownCount, the displayed list contains the number of items specified by DropDownCount and a scroll bar is added to the right side of the list box. The scroll bar allows the user to select which items are displayed. For example, if the DropDownCount is eight and eleven items are to be displayed, the first eight items appear in the drop-down list, and a scroll bar is added.

Regardless of the value of DropDownCount or the number of items in the list, a drop-down list box is always displayed. If there are no items in the list, nothing may be selected from the list.


TCustomComboBox::DroppedDown

TCustomComboBox	Properties

Syntax

__property System::Boolean DroppedDown;


TCustomComboBox::EditHandle

TCustomComboBox	Properties

Syntax

__property System::Integer EditHandle;


TCustomComboBox::ItemHeight

TCustomComboBox	Properties

Syntax

__property System::Integer ItemHeight;

When the Style property of a combo box is set to csOwnerDrawFixed, ItemHeight specifies the height (in pixels) of

The ItemHeight property is the height of an item in the combo box list in pixels when the combo box's Style property is csOwnerDrawFixed. If the Style property is any other setting, the value of ItemHeight is ignored. You can control the height of an item in a fixed owner-draw combo box by changing the height of ItemHeight.


TCustomComboBox::ItemIndex

TCustomComboBox	Properties

Syntax

__property System::Integer ItemIndex;


TCustomComboBox::Items

TCustomComboBox	Properties

Syntax

__property Classes::TStrings * Items;


TCustomComboBox::ListHandle

TCustomComboBox	Properties

Syntax

__property System::Integer ListHandle;


TCustomComboBox::MaxLength

TCustomComboBox	Properties

Syntax

__property System::Integer MaxLength;


TCustomComboBox::SelLength

TCustomComboBox	Properties

Syntax

__property System::Integer SelLength;


TCustomComboBox::SelStart

TCustomComboBox	Properties

Syntax

__property System::Integer SelStart;


TCustomComboBox::SelText

TCustomComboBox	Properties

Syntax

__property System::AnsiString SelText;


TCustomComboBox::Sorted

TCustomComboBox	Properties

Syntax

__property System::Boolean Sorted;


TCustomComboBox::Style

TCustomComboBox	Properties

Syntax

__property TComboBoxStyle Style;


TCustomComboBox events

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem


TCustomComboBox events

TCustomComboBox	By object	Legend

OnChange

OnDrawItem

OnDropDown

OnMeasureItem


TCustomComboBox::OnChange

TCustomComboBox	Events

Syntax

__property Classes::TNotifyEvent OnChange;


TCustomComboBox::OnDrawItem

TCustomComboBox	Events

Syntax

__property TDrawItemEvent OnDrawItem;


TCustomComboBox::OnDropDown

TCustomComboBox	Events

Syntax

__property Classes::TNotifyEvent OnDropDown;


TCustomComboBox::OnMeasureItem

TCustomComboBox	Events

Syntax

__property TMeasureItemEvent OnMeasureItem;


TCustomComboBox methods

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

~TCustomComboBox

Change

Clear

ComboWndProc

CreateParams

CreateWnd

DestroyWnd

DrawItem

DropDown

MeasureItem

SelectAll

SetStyle

TCustomComboBox

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomComboBox methods

TCustomComboBox	By object	Legend

~TCustomComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ComboWndProc

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

DrawItem

DropDown

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MeasureItem

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetStyle

SetTextBuf

Show

TCustomComboBox

UpdateControlState

Update

WndProc


TCustomComboBox::Change

TCustomComboBox	Methods

Syntax

virtual void __fastcall Change(void);


TCustomComboBox::Clear

TCustomComboBox	Methods

Deletes all text from the control, or, in the case of collection, list and string objects or outlines, deletes all items.

Syntax

void __fastcall Clear(void);


TCustomComboBox::ComboWndProc

TCustomComboBox	Methods

Syntax

virtual void __fastcall ComboWndProc(Messages::TMessage &Message, System::Integer ComboWnd, System::Pointer


TCustomComboBox::CreateParams

TCustomComboBox	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomComboBox::CreateWnd

TCustomComboBox	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomComboBox::DestroyWnd

TCustomComboBox	Methods

Syntax

virtual void __fastcall DestroyWnd(void);


TCustomComboBox::DrawItem

TCustomComboBox	Methods

Syntax

virtual void __fastcall DrawItem(System::Integer Index, const Windows::TRect &Rect,  TOwnerDrawState


TCustomComboBox::DropDown

TCustomComboBox	Methods

Syntax

virtual void __fastcall DropDown(void);


TCustomComboBox::MeasureItem

TCustomComboBox	Methods

Syntax

virtual void __fastcall MeasureItem(System::Integer Index, System::Integer &Height);


TCustomComboBox::SelectAll

TCustomComboBox	Methods

Selects the entire block of text in the control. If you want to select only part of the text, use the SelStart and SelLength properties.

Syntax

void __fastcall SelectAll(void);


TCustomComboBox::SetStyle

TCustomComboBox	Methods

Syntax

virtual void __fastcall SetStyle(TComboBoxStyle Value);


TCustomComboBox::WndProc

TCustomComboBox	Methods

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);


TCustomComboBox::TCustomComboBox

TCustomComboBox	Methods	See also

TCustomComboBox creates a new TCustomComboBox object.

Syntax

__fastcall virtual TCustomComboBox(Classes::TComponent *AOwner);

Description

Use TCustomComboBox to create a new TCustomComboBox object.


TCustomComboBox::~TCustomComboBox

TCustomComboBox	Methods	See also

~TCustomComboBox frees the memory associated with the TCustomComboBox object.

Syntax

__fastcall virtual ~TCustomComboBox(void);

Description

Do not call ~TCustomComboBox directly. Instead, use the delete keyword on the object, which causes ~TCustomComboBox to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomComboBox example

TCustomComboBox


TCustomControl

Hierarchy	Properties	Methods	See also

The TCustomControl component is the abstract base class from which to derive windowed controls that require the support of a Canvas for drawing complex visual images.

Header

vcl/controls.hpp

Description

Standard windowed controls already "know" how to display themselves, because they are part of Windows. Thus, a button or a check box component descends directly from TWinControl. When creating original windowed controls that do not correspond to standard Windows components, derive them from TCustomControl, rather than directly from TWinControl. TCustomControl makes drawing original controls easier by providing a Canvas property to manage the drawing surface and a virtual Paint method that is called to respond to WM_PAINT messages.

When creating custom controls that don’t need to receive input focus, derive them from TGraphicControl instead of TCustomControl, to avoid the overhead associated with being a windowed control. Painting a windowed control is slower than painting a graphic control.


TCustomControl properties

TCustomControl	Alphabetically	Legend

In TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomControl properties

TCustomControl	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomControl::Canvas

TCustomControl	Properties	See also

The Canvas property is a TCanvas object that presents a drawing surface for the control to draw on.

Syntax

__property Graphics::TCanvas * Canvas;

Description

Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas encapsulates a Windows device context, providing all the tools and methods needed for drawing and painting.

Canvas is a protected property that is usually redeclared as public in descendants of TCustomControl.


TCustomControl methods

TCustomControl	Alphabetically	Legend

In TCustomControl

~TCustomControl

Paint

PaintWindow

TCustomControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomControl methods

TCustomControl	By object	Legend

~TCustomControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

PaintTo

PaintWindow

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomControl

UpdateControlState

Update


TCustomControl::Paint

TCustomControl	Methods	See also

The Paint method renders the image of a custom control.

Syntax

virtual void __fastcall Paint(void);

Description

Override the Paint method to specify how the image of the control should be drawn.

The Paint method for TCustomControl does nothing other than provide an interface for a method that responds to WM_PAINT messages. Paint is called by the PaintWindow method, after that method has supplied the Canvas with the handle to a device context. When creating a custom control, always override Paint to draw the image of the control.


TCustomControl::PaintWindow

TCustomControl	Methods	See also

The PaintWindow method provides a device context to the canvas and renders the image of the control by calling the Paint method.

Syntax

virtual void __fastcall PaintWindow(System::Integer DC);

Description

Override PaintWindow to provide additional responses to the WM_PAINT message.

When a custom controls receives a WM_PAINT message, the PaintWindow method responds. PaintWindow provides a Windows device context for the canvas, calls the Paint method, and finally removes the device context. Override the Paint method to draw the image of the control.


TCustomControl::TCustomControl

TCustomControl	Methods	See also

TCustomControl creates a new TCustomControl object.

Syntax

__fastcall virtual TCustomControl(Classes::TComponent *AOwner);

Description

Use TCustomControl to create a new TCustomControl object.


TCustomControl::~TCustomControl

TCustomControl	Methods	See also

~TCustomControl frees the memory associated with the TCustomControl object.

Syntax

__fastcall virtual ~TCustomControl(void);

Description

Do not call ~TCustomControl directly. Instead, use the delete keyword on the object, which causes ~TCustomControl to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomControl example

TCustomControl


TCustomDBGrid

Hierarchy	Properties	Methods	Events

not doct

Header

vcl/dbgrids.hpp

Note

need to add the protected methods and properties that are doct in the generic derived class to the tables below and need to change the place where the TCustomGrid stuff says it is doct.


TCustomDBGrid properties

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

Columns

DataLink

DataSource

DefaultDrawing

FieldCount

Fields

IndicatorOffset

LayoutLock

Options

ReadOnly

SelectedField

SelectedIndex

SelectedRows

TitleFont

UpdateLock

Derived from TCustomGrid

EditorMode

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomDBGrid properties

TCustomDBGrid	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DataLink

DataSource

DefaultDrawing

DesignInfo

EditorMode

Enabled

FieldCount

Fields

Handle

Height

HelpContext

Hint

IndicatorOffset

LayoutLock

Left

Name

Options

Owner

ParentColor

Parent

ReadOnly

SelectedField

SelectedIndex

SelectedRows

ShowHint

Showing

TabOrder

TabStop

Tag

TitleFont

Top

UpdateLock

Visible

Width


TCustomDBGrid::Columns

TCustomDBGrid	Properties

Syntax

__property TDBGridColumns * Columns;


TCustomDBGrid::DataLink

TCustomDBGrid	Properties

Syntax

__property TGridDataLink * DataLink;


TCustomDBGrid::DataSource

TCustomDBGrid	Properties

Syntax

__property Db::TDataSource * DataSource;


TCustomDBGrid::DefaultDrawing

TCustomDBGrid	Properties

Syntax

__property System::Boolean DefaultDrawing;


TCustomDBGrid::FieldCount

TCustomDBGrid	Properties

Specifies the number of fields (columns) in a dataset.

Syntax

__property System::Integer FieldCount;

The value of the FieldCount property is the number of fields in the dataset displayed in the control.

(check to see if the below info is correct . . . it may not apply in this case:)

It may not be the same as the number of fields in the underlying data set, because you can add calculated fields and remove fields with the fields editor.


TCustomDBGrid::Fields

TCustomDBGrid	Properties

Returns a specific field in the dataset.

Syntax

__property Db::TField * Fields[System::Integer FieldIndex];

Specify the field using the Index parameter. By default, Index values start at 0 with the first field in the data set; if you used the fields editor to create field objects, Index values start at 0 in the order listed in the fields editor. The range for Index is 0.. FieldCount - 1.


TCustomDBGrid::IndicatorOffset

TCustomDBGrid	Properties

Syntax

__property System::Byte IndicatorOffset;


TCustomDBGrid::LayoutLock

TCustomDBGrid	Properties

Syntax

__property System::Byte LayoutLock;


TCustomDBGrid::Options

TCustomDBGrid	Properties

Syntax

__property TDBGridOptions Options;


ParentColor


TCustomDBGrid::ReadOnly

TCustomDBGrid	Properties

Syntax

__property System::Boolean ReadOnly;


TCustomDBGrid::SelectedField

TCustomDBGrid	Properties

Indicates which field is selected in the data grid. Can be NULL.

Syntax

__property Db::TField * SelectedField;


TCustomDBGrid::SelectedIndex

TCustomDBGrid	Properties

Returns the index value of the currently selected field in the displayed dataset.

Syntax

__property System::Integer SelectedIndex;

A value of 0 indicates the first field of the displayed dataset, 1 is the second field, and so on. Returns -1 if currently selected column has no field or if dataset is not open.

SelectedIndex can be used as an index to Fields property array to access a field in the dataset.


TCustomDBGrid::SelectedRows

TCustomDBGrid	Properties

Syntax

__property TBookmarkList * SelectedRows;


TCustomDBGrid::TitleFont

TCustomDBGrid	Properties

Syntax

__property Graphics::TFont * TitleFont;


TCustomDBGrid::UpdateLock

TCustomDBGrid	Properties

Syntax

__property System::Byte UpdateLock;


TCustomDBGrid events

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick


TCustomDBGrid events

TCustomDBGrid	By object	Legend

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick


TCustomDBGrid::OnColEnter

TCustomDBGrid	Events

Syntax

__property Classes::TNotifyEvent OnColEnter;


TCustomDBGrid::OnColExit

TCustomDBGrid	Events

Syntax

__property Classes::TNotifyEvent OnColExit;


TCustomDBGrid::OnColumnMoved

TCustomDBGrid	Events

Syntax

__property Grids::TMovedEvent OnColumnMoved;


TCustomDBGrid::OnDrawColumnCell

TCustomDBGrid	Events

Syntax

__property TDrawColumnCellEvent OnDrawColumnCell;


TCustomDBGrid::OnDrawDataCell

TCustomDBGrid	Events

Syntax

__property TDrawDataCellEvent OnDrawDataCell;


TCustomDBGrid::OnEditButtonClick

TCustomDBGrid	Events

Syntax

__property Classes::TNotifyEvent OnEditButtonClick;


TCustomDBGrid methods

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

~TCustomDBGrid

AcquireLayoutLock

BeginLayout

BeginUpdate

CancelLayout

CanEditAcceptKey

CanEditModify

CanEditShow

ColEnter

ColExit

ColumnMoved

ColWidthsChanged

CreateColumns

CreateEditor

CreateWnd

DataToRawColumn

DefaultDrawColumnCell

DefaultDrawDataCell

DeferLayout

DefineFieldMap

DrawCell

DrawColumnCell

DrawDataCell

EditButtonClick

EndLayout

EndUpdate

GetColField

GetEditLimit

GetEditMask

GetEditText

GetFieldValue

HighlightCell

KeyDown

KeyPress

LayoutChanged

LinkActive

Loaded

MouseDown

Notification

RawToDataColumn

Scroll

SetColumnAttributes

SetEditText

StoreColumns

TCustomDBGrid

TimedScroll

ValidFieldIndex

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDBGrid methods

TCustomDBGrid	By object	Legend

~TCustomDBGrid

AcquireLayoutLock

Assign

BeginDrag

BeginLayout

BeginUpdate

BringToFront

Broadcast

CancelLayout

CanEditAcceptKey

CanEditModify

CanEditShow

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColEnter

ColExit

ColumnMoved

ColWidthsChanged

ContainsControl

ControlAtPos

CreateColumns

CreateEditor

CreateWnd

DataToRawColumn

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

DeferLayout

DefineFieldMap

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

DrawCell

DrawColumnCell

DrawDataCell

EditButtonClick

EnableAlign

EndDrag

EndLayout

EndUpdate

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetColField

GetEditLimit

GetEditMask

GetEditText

GetFieldValue

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

HighlightCell

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

LayoutChanged

LinkActive

Loaded

MethodAddress

MethodName

MouseDown

NewInstance

Notification

PaintTo

Perform

RawToDataColumn

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

Scroll

SendToBack

SetBounds

SetColumnAttributes

SetEditText

SetFocus

SetTextBuf

Show

StoreColumns

TCustomDBGrid

TimedScroll

UpdateControlState

Update

ValidFieldIndex


TCustomDBGrid::AcquireLayoutLock

TCustomDBGrid	Methods

Syntax

System::Boolean __fastcall AcquireLayoutLock(void);


TCustomDBGrid::BeginLayout

TCustomDBGrid	Methods

Syntax

void __fastcall BeginLayout(void);


TCustomDBGrid::BeginUpdate

TCustomDBGrid	Methods

Syntax

void __fastcall BeginUpdate(void);


TCustomDBGrid::CancelLayout

TCustomDBGrid	Methods

Syntax

void __fastcall CancelLayout(void);


TCustomDBGrid::CanEditAcceptKey

TCustomDBGrid	Methods

Syntax

virtual System::Boolean __fastcall CanEditAcceptKey(System::Char Key);


TCustomDBGrid::CanEditModify

TCustomDBGrid	Methods

Syntax

virtual System::Boolean __fastcall CanEditModify(void);


TCustomDBGrid::CanEditShow

TCustomDBGrid	Methods

Syntax

virtual System::Boolean __fastcall CanEditShow(void);


TCustomDBGrid::ColEnter

TCustomDBGrid	Methods

Syntax

virtual void __fastcall ColEnter(void);


TCustomDBGrid::ColExit

TCustomDBGrid	Methods

Syntax

virtual void __fastcall ColExit(void);


TCustomDBGrid::ColumnMoved

TCustomDBGrid	Methods

Syntax

virtual void __fastcall ColumnMoved(System::Longint FromIndex, System::Longint ToIndex);


TCustomDBGrid::ColWidthsChanged

TCustomDBGrid	Methods

Syntax

virtual void __fastcall ColWidthsChanged(void);


TCustomDBGrid::CreateColumns

TCustomDBGrid	Methods

Syntax

virtual TDBGridColumns *__fastcall CreateColumns(void);


TCustomDBGrid::CreateEditor

TCustomDBGrid	Methods

Syntax

virtual Grids::TInplaceEdit *__fastcall CreateEditor(void);


TCustomDBGrid::CreateWnd

TCustomDBGrid	Methods

Syntax

virtual void __fastcall CreateWnd(void);


DataToRawColumns


TCustomDBGrid::DefaultDrawColumnCell

TCustomDBGrid	Methods

Syntax

void __fastcall DefaultDrawColumnCell(const Windows::TRect &Rect, System::Integer DataCol, TColumn *


TCustomDBGrid::DefaultDrawDataCell

TCustomDBGrid	Methods

Syntax

void __fastcall DefaultDrawDataCell(const Windows::TRect &Rect, Db::TField *Field,  Grids::TGridDrawState


TCustomDBGrid::DeferLayout

TCustomDBGrid	Methods

Syntax

void __fastcall DeferLayout(void);


TCustomDBGrid::DefineFieldMap

TCustomDBGrid	Methods

Syntax

virtual void __fastcall DefineFieldMap(void);


TCustomDBGrid::DrawCell

TCustomDBGrid	Methods

Syntax

virtual void __fastcall DrawCell(System::Longint ACol, System::Longint ARow, const Windows::TRect &ARect


TCustomDBGrid::DrawColumnCell

TCustomDBGrid	Methods

Syntax

virtual void __fastcall DrawColumnCell(const Windows::TRect &Rect, System::Integer DataCol, TColumn *


TCustomDBGrid::DrawDataCell

TCustomDBGrid	Methods

Syntax

virtual void __fastcall DrawDataCell(const Windows::TRect &Rect, Db::TField *Field,  Grids::TGridDrawState


TCustomDBGrid::EditButtonClick

TCustomDBGrid	Methods

Syntax

virtual void __fastcall EditButtonClick(void);


TCustomDBGrid::EndLayout

TCustomDBGrid	Methods

Syntax

void __fastcall EndLayout(void);


TCustomDBGrid::EndUpdate

TCustomDBGrid	Methods

Syntax

void __fastcall EndUpdate(void);


TCustomDBGrid::GetColField

TCustomDBGrid	Methods

Syntax

Db::TField *__fastcall GetColField(System::Integer DataCol);


TCustomDBGrid::GetEditLimit

TCustomDBGrid	Methods

Syntax

virtual System::Integer __fastcall GetEditLimit(void);


TCustomDBGrid::GetEditMask

TCustomDBGrid	Methods

Syntax

virtual System::AnsiString __fastcall GetEditMask(System::Longint ACol, System::Longint ARow);


TCustomDBGrid::GetEditText

TCustomDBGrid	Methods

Syntax

virtual System::AnsiString __fastcall GetEditText(System::Longint ACol, System::Longint ARow);


TCustomDBGrid::GetFieldValue

TCustomDBGrid	Methods

Syntax

System::AnsiString __fastcall GetFieldValue(System::Integer ACol);


TCustomDBGrid::HighlightCell

TCustomDBGrid	Methods

Syntax

virtual System::Boolean __fastcall HighlightCell(System::Integer DataCol, System::Integer DataRow,


TCustomDBGrid::KeyDown

TCustomDBGrid	Methods

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);


TCustomDBGrid::KeyPress

TCustomDBGrid	Methods

Syntax

virtual void __fastcall KeyPress(System::Char &Key);


TCustomDBGrid::LayoutChanged

TCustomDBGrid	Methods

Syntax

virtual void __fastcall LayoutChanged(void);


TCustomDBGrid::LinkActive

TCustomDBGrid	Methods

Syntax

virtual void __fastcall LinkActive(System::Boolean Value);


TCustomDBGrid::Loaded

TCustomDBGrid	Methods

Syntax

virtual void __fastcall Loaded(void);


TCustomDBGrid::MouseDown

TCustomDBGrid	Methods

Syntax

virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer


TCustomDBGrid::Notification

TCustomDBGrid	Methods

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation


TCustomDBGrid::RawToDataColumn

TCustomDBGrid	Methods

Syntax

System::Integer __fastcall RawToDataColumn(System::Integer ACol);


TCustomDBGrid::Scroll

TCustomDBGrid	Methods

Syntax

virtual void __fastcall Scroll(System::Integer Distance);


TCustomDBGrid::SetColumnAttributes

TCustomDBGrid	Methods

Syntax

virtual void __fastcall SetColumnAttributes(void);


TCustomDBGrid::SetEditText

TCustomDBGrid	Methods

Syntax

virtual void __fastcall SetEditText(System::Longint ACol, System::Longint ARow, const System::AnsiString


TCustomDBGrid::StoreColumns

TCustomDBGrid	Methods

Syntax

System::Boolean __fastcall StoreColumns(void);


TCustomDBGrid::TimedScroll

TCustomDBGrid	Methods

Syntax

virtual void __fastcall TimedScroll( Grids::TGridScrollDirection Direction);


TCustomDBGrid::ValidFieldIndex

TCustomDBGrid	Methods

Syntax

System::Boolean __fastcall ValidFieldIndex(System::Integer FieldIndex);


TCustomDBGrid::TCustomDBGrid

TCustomDBGrid	Methods	See also

TCustomDBGrid creates a new TCustomDBGrid object.

Syntax

__fastcall virtual TCustomDBGrid(Classes::TComponent *AOwner);

Description

Use TCustomDBGrid to create a new TCustomDBGrid object.


TCustomDBGrid::~TCustomDBGrid

TCustomDBGrid	Methods	See also

~TCustomDBGrid frees the memory associated with the TCustomDBGrid object.

Syntax

__fastcall virtual ~TCustomDBGrid(void);

Description

Do not call ~TCustomDBGrid directly. Instead, use the delete keyword on the object, which causes ~TCustomDBGrid to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TCustomDBGrid example

TCustomDBGrid


TCustomEdit

Hierarchy	Properties	Methods	Events

The TCustomEdit component is the abstract class from which all Borland C++ Builder edit-box and memo components are derived.

Header

vcl/stdctrls.hpp

Description

TCustomEdit encapsulates the fundamental behavior common to all components for editing text in Borland C++ Builder by introducing methods and properties that provide:

•	the ability to perform basic text editing functions such as selecting text, modifying selected text, and case conversions.

•	the ability to respond to changes in the contents of the text.

•	the ability to control the accessibility of the text by making it read-only or introducing a password character to hide the actual value.

Do not create instances of TCustomEdit. Use TCustomEdit as a base class when declaring control objects that permit the user to enter or modify textual data. Properties and methods of TCustomEdit provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomEdit properties

TCustomEdit	Alphabetically	Legend

In TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

HideSelection

MaxLength

Modified

OEMConvert

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomEdit properties

TCustomEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

HideSelection

Hint

Left

MaxLength

Modified

Name

OEMConvert

Owner

ParentColor

Parent

PasswordChar

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TCustomEdit::AutoSelect

TCustomEdit	Properties	See also

AutoSelect determines whether all of the text in the edit control is automatically selected when the control gets focus.

Syntax

__property System::Boolean AutoSelect;

Description

Use AutoSelect when you want all of the text to be selected when the edit control gets focus. AutoSelect only applies to single-line edit controls.

AutoSelect is useful when the user is more likely to replace the text in the edit control than to simply append to it.


TCustomEdit::AutoSize

TCustomEdit	Properties	See also

AutoSize determines whether the height of the edit control automatically resizes to accomodate the text.

Syntax

__property System::Boolean AutoSize;

Description

Use AutoSize to make the edit control adjust its size automatically so that the client area accomodates the height of the text. When AutoSize is false, the edit control will have a fixed height. When AutoSize is true, the size of the control will be readjusted whenever a change occurs that could affect the height of the control, such as a change to the font or border style.

Note

Even with the AutoSize property set to true, the text in the edit control may appear truncated if it extends beyond the width of the edit control.


TCustomEdit::BorderStyle

TCustomEdit	Properties	See also

BorderStyle determines whether the edit control has a single line border around the client area.

Syntax

__property Forms::TBorderStyle BorderStyle;

Description

Use BorderStyle to affect the sharpness with which the client area of the edit control stands out. BorderStyle can have a value of either bsSingle or bsNone. If BorderSyle is bsSingle, the edit control will have a single line border around the client area. If BorderStyle is bsNone, there will be no such line.

Note

BorderStyle interacts with the Ctl3D property to create different visual effects. Try combining different combinations of the two properties to get just the look you want.


TCustomEdit::CharCase

TCustomEdit	Properties	See also

CharCase determines the case of the text within the edit control.

Syntax

__property TEditCharCase CharCase;

Description

Use CharCase to force the contents of the edit control to assume a particular case. The possible values of CharCase are as follows:

Value	Meaning

ecLowerCase	The text is converted to lowercase.

ecNormal	The text appears in mixed case. It is not forced into any case.

ecUpperCase	The text is converted to uppercase.

When CharCase is set to ecLowerCase or ecUpperCase, the case of characters is converted when the user types them into the edit control. Changing the CharCase property to ecLowerCase or ecUpperCase changes the actual contents of the text, not just the appearance. Any case information is lost, and can not be recaptured by changing CharCase to ecNormal.


TCustomEdit::HideSelection

TCustomEdit	Properties	See also

HideSelection determines whether the visual indication of the selected text remains when focus shifts to another control.

Syntax

__property System::Boolean HideSelection;

Description

Set HideSelection to false when it is important to provide visual feedback of the selected portion of the text even when the edit control does not have focus. Set HideSelection to true in order to make the visual indication of selection appear only when the edit control has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to false can lead to an overly busy-looking form if the form contains many edit controls.


TCustomEdit::MaxLength

TCustomEdit	Properties	See also

MaxLength specifies the maximum number of characters the user can enter into the edit control.

Syntax

__property System::Integer MaxLength;

Description

Use MaxLength to limit the number of bytes in the text that can be entered into the edit control. A value of 0 indicates that there is no limit on the length. MaxLength only applies to single-line edit controls.

It is a good idea to use MaxLength to limit the length of the text in an edit control if that text is going to be copied into a fixed-length buffer.

Note

Setting MaxLength will not truncate the existing value of the text, it merely prevents the user from adding more text after reaching the limit of MaxLength bytes.


TCustomEdit::Modified

TCustomEdit	Properties	See also

Modified indicates whether the user has edited the text of the edit control.

Syntax

__property System::Boolean Modified;

Description

Use Modified to determine whether the Text property of the edit control has changed. If an application directly alters the Text property of an edit control, it should set the Modified property to true.


TCustomEdit::OEMConvert

TCustomEdit	Properties	See also

OEMconvert determines whether characters typed into the edit control are converted from ANSI to OEM and then back to ANSI.

Syntax

__property System::Boolean OEMConvert;

Description

To ensure that any characters typed into the edit control can be unambiguously converted into the OEM character set, set OEMconvert to true. This will cause all characters to be converted from ANSI to OEM and then back to ANSI. Set OEMconvert to false to avoid the overhead of this conversion when it does not matter whether the text can be unambiguously mapped to an OEM string.

OEMconvert is most useful when the edit control is used to enter a filename, and the application does not use Unicode filenames.


TCustomEdit::PasswordChar

TCustomEdit	Properties	See also

PasswordChar indicates the character, if any, to be displayed in place of any actual characters in the text.

Syntax

__property System::Char PasswordChar;

Description

Use the PasswordChar property to create an edit control that displays a special character in place of any entered text. If PasswordChar is set to the null character (ANSI character zero), the edit control displays its text normally. If PasswordChar is any other character, the edit control displays PasswordChar in place of each character typed. PasswordChar affects the appearance of the edit control only. The value of the Text property reflects the actual characters that are typed.


TCustomEdit::ReadOnly

TCustomEdit	Properties	See also

ReadOnly determines whether the user can change the text of the edit control.

Syntax

__property System::Boolean ReadOnly;

Description

To restrict the edit control so that it can only display text, set the ReadOnly property to true. Set ReadOnly to false to enable editing of the contents of the edit control.

Setting ReadOnly to true ensures that the text is not altered, while still allowing the user to select text. The selected text can then be manipulated by the application, or copied to the clipboard.


TCustomEdit::SelLength

TCustomEdit	Properties	See also

SelLength is the number of characters that are selected.

Syntax

__property System::Integer SelLength;

Description

Read SelLength to determine the length, in characters, of the selected text. Set SelLength to change the selection to consist of the first SelLength characters starting at SelStart.

Note

Setting SelLength to a value greater than the number of characters from SelStart to the end of the text results in the selection of all characters from SelStart to the end of the text. Reading SelLength immediately after setting it to a value greater than the number of available characters will return the number of characters actually selected, not the value that was just set.


TCustomEdit::SelStart

TCustomEdit	Properties	See also

SelStart is the position of the first selected character in the text.

Syntax

__property System::Integer SelStart;

Description

Read SelStart to determine the position of the first character of selected text, where 0 indicates the first character. If there is no selected text, SelStart indicates the position of the cursor. Set SelStart to remove the current selection and postion the cursor just before the indicated character.

To select a particular range of the text, first set SelStart to position the cursor, and then set SelLength to extend the selection.


TCustomEdit::SelText

TCustomEdit	Properties	See also

SelText is the selected portion of the edit control’s text.

Syntax

__property System::AnsiString SelText;

Description

Read SelText to determine the value of the selected text. Set SelText to replace the selected text by a new string. If there is no selection, but the edit control has focus, set SelText to insert a new string into the text at the cursor.


TCustomEdit events

TCustomEdit	Alphabetically	Legend

In TCustomEdit

OnChange


TCustomEdit events

TCustomEdit	By object	Legend

OnChange


TCustomEdit::OnChange

TCustomEdit	Events	See also

OnChange occurs whenever the text for the edit control may have changed.

Syntax

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action whenever the text for the edit control may have changed. Use the Modified property to see if a change actually occurred. The Text property of the edit control will already be updated to reflect any changes . This event provides the first opportunity to respond to modifications that the user types into the edit control.


TCustomEdit methods

TCustomEdit	Alphabetically	Legend

In TCustomEdit

~TCustomEdit

Change

Clear

ClearSelection

CopyToClipboard

CreateParams

CreateWnd

CutToClipboard

DestroyWnd

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

TCustomEdit

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomEdit methods

TCustomEdit	By object	Legend

~TCustomEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CreateWnd

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TCustomEdit

UpdateControlState

Update


TCustomEdit::Change

TCustomEdit	Methods	See also

Change responds to changes in the Text property by calling the OnChange event handler if it is assigned.

Syntax

virtual void __fastcall Change(void);

Description

Applications do not call the Change method directly. It is triggered automatically by Windows’ events. Change is exposed as a protected method so that derived classes can make additional responses to changes in the Text property beyond invoking the OnChange event handler. Derived classes that override the Change method should be sure to call the inherited method.


TCustomEdit::Clear

TCustomEdit	Methods	See also

Clear deletes all of the text from the edit control.

Syntax

void __fastcall Clear(void);

Description

Use Clear to replace the Text property with an empty string. Clear removes all text, not just the selected text.


TCustomEdit::ClearSelection

TCustomEdit	Methods	See also

ClearSelection removes the selected text from the edit control.

Syntax

void __fastcall ClearSelection(void);

Description

Use ClearSelection to delete the selected text from the edit control. If no text is selected, ClearSelection does nothing. If all of the text is selected, ClearSelection does the same thing as the Clear method.

Note

Calling ClearSelection does the same thing as sending the edit window a WM_CLEAR message.


TCustomEdit::CopyToClipboard

TCustomEdit	Methods	See also

CopyToClipboard copies the selected text in the edit control to the Clipboard in CF_TEXT format.

Syntax

void __fastcall CopyToClipboard(void);

Description

Use CopyToClipboard to replace the contents of the Clipboard with the selected text. CopyToClipbard will not clear the Clipboard if there is no selected text. If no text is selected, CopyToClipboard does nothing.

Note

Calling CopyToClipboard does the same thing as sending the edit window a WM_COPY message.


TCustomEdit::CreateParams

TCustomEdit	Methods	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomEdit overrides the inherited method to specify a scrollable single-line edit control that reflects the current values of the BorderStyle, HideSelections, PasswordChar, and ReadOnly properties.


TCustomEdit::CreateWnd

TCustomEdit	Methods	See also

The CreateWnd method creates a Windows control corresponding to the edit control.

Syntax

virtual void __fastcall CreateWnd(void);

Description

CreateWnd is called when the edit control is created, and whenever a change to the edit control requires the window to be recreated. CreateWnd first calls the inherited CreateWnd, which calls the CreateParams method to initialize the window-creation parameters, and which then calls CreateWindowHandle to create the window handle for the control. CreateWnd then sends the newly created window messages to enforce the MaxLength and PasswordChar properties.


TCustomEdit::CutToClipboard

TCustomEdit	Methods	See also

CutToClipboard copies the selected text in the edit control to the Clipboard in CF_TEXT format and then deletes the selection.

Syntax

void __fastcall CutToClipboard(void);

Description

Use CutToClipboard to replace the contents of the Clipboard with the selected text while clearing the selected text. If no text is selected, CutToClipboard does nothing.


TCustomEdit::DestroyWnd

TCustomEdit	Methods	See also

DestroyWnd destroys the Windows control that corresponds to the edit control.

Syntax

virtual void __fastcall DestroyWnd(void);

Description

Before the window is destroyed, DestroyWnd saves a copy of any window properties that would be needed to recreate the window after it has been destroyed.


TCustomEdit::GetSelTextBuf

TCustomEdit	Methods	See also

GetSelTextBuf copies the selected text into a buffer and returns the number of characters copied.

Syntax

System::Integer __fastcall GetSelTextBuf(System::PChar Buffer, System::Integer BufSize);

Description

Use GetSelTextBuf to copy the selected text into a character buffer. If there is no selection, the buffer receives an empty string. If the selection contains more than (BufSize - 1) characters, only the first (BufSize - 1) characters are copied. GetSelTextBuf returns the number of characters that were actually copied into the buffer.


TCustomEdit::PasteFromClipboard

TCustomEdit	Methods	See also

PasteFromClipboard copies the contents of the Clipboard into edit control, replacing the current selection.

Syntax

void __fastcall PasteFromClipboard(void);

Description

Use PasteFromClipboard to replace the selected text with the contents of the Clipboard, or, if no text is selected, to insert the contents of the Clipboard at the cursor. If the Clipboard is empty, or if it does not contain anything in CF_TEXT format, PasteFromClipbard does nothing.

Note

Calling PasteFromClipboard does the same thing as sending the edit window a WM_PASTE message.


TCustomEdit::SelectAll

TCustomEdit	Methods	See also

SelectAll selects the entire block of text in the edit control.

Syntax

void __fastcall SelectAll(void);

Description

Use SelectAll to select all of the text in the edit control. To select only part of the text, use the SelStart and SelLength properties.


TCustomEdit::SetSelTextBuf

TCustomEdit	Methods	See also

SetSelTextBuf replaces the selected text with a null-terminated string.

Syntax

void __fastcall SetSelTextBuf(System::PChar Buffer);

Description

Use SetSelTextBuf to replace the current selection by the contents of the null-terminated string pointed to by Buffer. If there is no selected text, the contents of Buffer are inserted at the cursor. SetSelTextBuf does the same thing as setting the SelText property, except that it takes a PChar rather than a String.


TCustomEdit::TCustomEdit

TCustomEdit	Methods	See also

TCustomEdit creates a new TCustomEdit object.

Syntax

__fastcall virtual TCustomEdit(Classes::TComponent *AOwner);

Description

Use TCustomEdit to create a new TCustomEdit object.


TCustomEdit::~TCustomEdit

TCustomEdit	Methods	See also

~TCustomEdit frees the memory associated with the TCustomEdit object.

Syntax

__fastcall virtual ~TCustomEdit(void);

Description

Do not call ~TCustomEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomEdit to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomEdit example

TCustomEdit


TCustomGroupBox

Hierarchy	Properties	Methods	See also

TCustomGroupBox is the abstract base class for all group-box components.

Header

vcl/stdctrls.hpp

Description

Group boxes are visual components that act as containers for sets of related controls, such as radio buttons. Group boxes may also contain other group boxes. TCustomGroupBox is the abstract class from which all group-box components—including TGroupBox, TRadioGroup, and TDBRadioGroup—descend.

In addition to the methods it inherits from TCustomControl, TCustomGroupBox overrides the AlignControls method (inherited from TWinControl) to handle positioning of components within the group box. TCustomGroupBox also overrides the Paint and Create methods.


TCustomGroupBox properties

TCustomGroupBox	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomGroupBox properties

TCustomGroupBox	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomGroupBox methods

TCustomGroupBox	Alphabetically	Legend

In TCustomGroupBox

~TCustomGroupBox

Paint

TCustomGroupBox

Derived from TCustomControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomGroupBox methods

TCustomGroupBox	By object	Legend

~TCustomGroupBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomGroupBox

UpdateControlState

Update


TCustomGroupBox::Paint

TCustomGroupBox	Methods	See also

Renders the on-screen image of the group box.

Syntax

virtual void __fastcall Paint(void);

Description

Paint creates a Windows RECT structure, draws a border around it, and calls the Windows DrawText function to fill in the caption. If Ctl3D (a protected property, inherited from TWinControl) is set to true, Paint draws the border with a three-dimensional look.


TCustomGroupBox::TCustomGroupBox

TCustomGroupBox	Methods	See also

TCustomGroupBox creates a new TCustomGroupBox object.

Syntax

__fastcall virtual TCustomGroupBox(Classes::TComponent *AOwner);

Description

Use TCustomGroupBox to create a new TCustomGroupBox object.


TCustomGroupBox::~TCustomGroupBox

TCustomGroupBox	Methods	See also

~TCustomGroupBox frees the memory associated with the TCustomGroupBox object.

Syntax

__fastcall virtual ~TCustomGroupBox(void);

Description

Do not call ~TCustomGroupBox directly. Instead, use the delete keyword on the object, which causes ~TCustomGroupBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomGroupBox example

TCustomGroupBox


TCustomGrid

Hierarchy	Properties	Methods

The TCustomGrid component is the abstract base type for all grids, including TDrawGrid, TStringGrid, TDBGrid, and any user-defined grid components.

Header

vcl/grids.hpp

Overview

In addition to everything it inherits from TCustomControl, TCustomGrid introduces several new properties that are explained in the VCL reference for the grid components such as string grids. TCustomGrid also overrides some of its inherited protected methods and introduces several new methods.

Note:

The protected methods and properties of the custom objects that get doct in the generic derived class will need to be added to the fololwing tables.


TCustomGrid properties

TCustomGrid	Alphabetically	Legend

TCustomGrid	    goRangeSelect]

{bmc protectd.bmp}	Options

In TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

InplaceEditor

LeftCol

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomGrid properties

TCustomGrid	By object	Legend

TCustomGrid	    goRangeSelect]

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

Col

ColWidths

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

InplaceEditor

LeftCol

Left

Name

{bmc protectd.bmp}	Options

Owner

ParentColor

Parent

RowCount

RowHeights

Row

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStops

TabStop

Tag

TopRow

Top

VisibleColCount

VisibleRowCount

Visible

Width


BorderStyle


Col


ColCount


Color


ColWidths


DefaultColWidth


DefaultDrawing


DefaultRowHeight


EditorMode


FixedColor


FixedCols


FixedRows


GridHeight


GridLineWidth


GridWidth


InplaceEditor


LeftCol


Options


ParentColor


Row


RowCount


RowHeights


ScrollBars


Selection


TabStops


TopRow


VisibleColCount


VisibleRowCount


TCustomGrid methods

TCustomGrid	Alphabetically	Legend

In TCustomGrid

~TCustomGrid

AdjustSize

BoxRect

CanEditAcceptKey

CanEditModify

CanEditShow

CanGridAcceptKey

CellRect

ColumnMoved

ColWidthsChanged

CreateEditor

CreateParams

DefineProperties

DeleteColumn

DeleteRow

DoExit

DrawCell

GetEditLimit

GetEditMask

GetEditText

GetGridHeight

GetGridWidth

HideEditor

InvalidateCell

InvalidateCol

InvalidateEditor

InvalidateRow

KeyDown

KeyPress

MouseCoord

MouseDown

MouseMove

MouseUp

MoveColRow

MoveColumn

MoveRow

Paint

RowHeightsChanged

RowMoved

ScrollData

SelectCell

SetEditText

ShowEditor

ShowEditorChar

SizeChanged

Sizing

TCustomGrid

TimedScroll

TopLeftChanged

UpdateDesigner

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomGrid methods

TCustomGrid	By object	Legend

~TCustomGrid

AdjustSize

Assign

BeginDrag

BoxRect

BringToFront

Broadcast

CanEditAcceptKey

CanEditModify

CanEditShow

CanFocus

CanGridAcceptKey

CellRect

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColumnMoved

ColWidthsChanged

ContainsControl

ControlAtPos

CreateEditor

CreateParams

DefaultHandler

DefineProperties

DeleteColumn

DeleteRow

DestroyComponents

Destroying

DisableAlign

Dispatch

DoExit

DragDrop

Dragging

DrawCell

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetEditLimit

GetEditMask

GetEditText

GetGridHeight

GetGridWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

HideEditor

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

InvalidateCell

InvalidateCol

InvalidateEditor

InvalidateRow

Invalidate

KeyDown

KeyPress

MethodAddress

MethodName

MouseCoord

MouseDown

MouseMove

MouseUp

MoveColRow

MoveColumn

MoveRow

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

RowHeightsChanged

RowMoved

ScaleBy

ScreenToClient

ScrollBy

ScrollData

SelectCell

SendToBack

SetBounds

SetEditText

SetFocus

SetTextBuf

ShowEditorChar

ShowEditor

Show

SizeChanged

Sizing

TCustomGrid

TimedScroll

TopLeftChanged

UpdateControlState

UpdateDesigner

Update


TCustomGrid::AdjustSize

TCustomGrid	Methods

Syntax

virtual void __fastcall AdjustSize(System::Longint Index, System::Longint Amount, System::Boolean Rows


TCustomGrid::BoxRect

TCustomGrid	Methods

Syntax

Windows::TRect __fastcall BoxRect(System::Longint ALeft, System::Longint ATop, System::Longint ARight


TCustomGrid::CanEditAcceptKey

TCustomGrid	Methods

Syntax

virtual System::Boolean __fastcall CanEditAcceptKey(System::Char Key);


TCustomGrid::CanEditModify

TCustomGrid	Methods

Syntax

virtual System::Boolean __fastcall CanEditModify(void);


TCustomGrid::CanEditShow

TCustomGrid	Methods

Syntax

virtual System::Boolean __fastcall CanEditShow(void);


TCustomGrid::CanGridAcceptKey

TCustomGrid	Methods

Syntax

virtual System::Boolean __fastcall CanGridAcceptKey(System::Word Key,  Classes::TShiftState Shift);


TCustomGrid::CellRect

TCustomGrid	Methods

Syntax

Windows::TRect __fastcall CellRect(System::Longint ACol, System::Longint ARow);


TCustomGrid::ColumnMoved

TCustomGrid	Methods

Syntax

virtual void __fastcall ColumnMoved(System::Longint FromIndex, System::Longint ToIndex);


TCustomGrid::ColWidthsChanged

TCustomGrid	Methods

Syntax

virtual void __fastcall ColWidthsChanged(void);


TCustomGrid::CreateEditor

TCustomGrid	Methods

Syntax

virtual TInplaceEdit *__fastcall CreateEditor(void);


TCustomGrid::CreateParams

TCustomGrid	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomGrid::DefineProperties

TCustomGrid	Methods

Syntax

virtual void __fastcall DefineProperties(Classes::TFiler *Filer);


TCustomGrid::DeleteColumn

TCustomGrid	Methods

Syntax

void __fastcall DeleteColumn(System::Longint ACol);


TCustomGrid::DeleteRow

TCustomGrid	Methods

Syntax

void __fastcall DeleteRow(System::Longint ARow);


TCustomGrid::DoExit

TCustomGrid	Methods

Syntax

virtual void __fastcall DoExit(void);


TCustomGrid::DrawCell

TCustomGrid	Methods

Syntax

virtual void __fastcall DrawCell(System::Longint ACol, System::Longint ARow, const Windows::TRect &ARect


TCustomGrid::GetEditLimit

TCustomGrid	Methods

Syntax

virtual System::Integer __fastcall GetEditLimit(void);


TCustomGrid::GetEditMask

TCustomGrid	Methods

Syntax

virtual System::AnsiString __fastcall GetEditMask(System::Longint ACol, System::Longint ARow);


TCustomGrid::GetEditText

TCustomGrid	Methods

Syntax

virtual System::AnsiString __fastcall GetEditText(System::Longint ACol, System::Longint ARow);


TCustomGrid::GetGridHeight

TCustomGrid	Methods

Syntax

System::Integer __fastcall GetGridHeight(void);


TCustomGrid::GetGridWidth

TCustomGrid	Methods

Syntax

System::Integer __fastcall GetGridWidth(void);


TCustomGrid::HideEditor

TCustomGrid	Methods

Syntax

void __fastcall HideEditor(void);


TCustomGrid::InvalidateCell

TCustomGrid	Methods

Syntax

void __fastcall InvalidateCell(System::Longint ACol, System::Longint ARow);


TCustomGrid::InvalidateCol

TCustomGrid	Methods

Syntax

void __fastcall InvalidateCol(System::Longint ACol);


TCustomGrid::InvalidateEditor

TCustomGrid	Methods

Syntax

void __fastcall InvalidateEditor(void);


TCustomGrid::InvalidateRow

TCustomGrid	Methods

Syntax

void __fastcall InvalidateRow(System::Longint ARow);


TCustomGrid::KeyDown

TCustomGrid	Methods

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);


TCustomGrid::KeyPress

TCustomGrid	Methods

Syntax

virtual void __fastcall KeyPress(System::Char &Key);


TCustomGrid::MouseCoord

TCustomGrid	Methods

Syntax

TGridCoord __fastcall MouseCoord(System::Integer X, System::Integer Y);


TCustomGrid::MouseDown

TCustomGrid	Methods

Syntax

virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer


TCustomGrid::MouseMove

TCustomGrid	Methods

Syntax

virtual void __fastcall MouseMove( Classes::TShiftState Shift, System::Integer X, System::Integer Y


TCustomGrid::MouseUp

TCustomGrid	Methods

Syntax

virtual void __fastcall MouseUp(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer


TCustomGrid::MoveColRow

TCustomGrid	Methods

Syntax

void __fastcall MoveColRow(System::Longint ACol, System::Longint ARow, System::Boolean MoveAnchor,


TCustomGrid::MoveColumn

TCustomGrid	Methods

Syntax

void __fastcall MoveColumn(System::Longint FromIndex, System::Longint ToIndex);


TCustomGrid::MoveRow

TCustomGrid	Methods

Syntax

void __fastcall MoveRow(System::Longint FromIndex, System::Longint ToIndex);


TCustomGrid::Paint

TCustomGrid	Methods

Syntax

virtual void __fastcall Paint(void);


TCustomGrid::RowHeightsChanged

TCustomGrid	Methods

Syntax

virtual void __fastcall RowHeightsChanged(void);


TCustomGrid::RowMoved

TCustomGrid	Methods

Syntax

virtual void __fastcall RowMoved(System::Longint FromIndex, System::Longint ToIndex);


TCustomGrid::ScrollData

TCustomGrid	Methods

Syntax

void __fastcall ScrollData(System::Integer DX, System::Integer DY);


TCustomGrid::SelectCell

TCustomGrid	Methods

Syntax

virtual System::Boolean __fastcall SelectCell(System::Longint ACol, System::Longint ARow);


TCustomGrid::SetEditText

TCustomGrid	Methods

Syntax

virtual void __fastcall SetEditText(System::Longint ACol, System::Longint ARow, const System::AnsiString


TCustomGrid::ShowEditor

TCustomGrid	Methods

Syntax

void __fastcall ShowEditor(void);


TCustomGrid::ShowEditorChar

TCustomGrid	Methods

Syntax

void __fastcall ShowEditorChar(System::Char Ch);


TCustomGrid::SizeChanged

TCustomGrid	Methods

Syntax

virtual void __fastcall SizeChanged(System::Longint OldColCount, System::Longint OldRowCount);


TCustomGrid::Sizing

TCustomGrid	Methods

Syntax

System::Boolean __fastcall Sizing(System::Integer X, System::Integer Y);


TCustomGrid::TimedScroll

TCustomGrid	Methods

Syntax

virtual void __fastcall TimedScroll( TGridScrollDirection Direction);


TCustomGrid::TopLeftChanged

TCustomGrid	Methods

Syntax

virtual void __fastcall TopLeftChanged(void);


TCustomGrid::UpdateDesigner

TCustomGrid	Methods

Syntax

void __fastcall UpdateDesigner(void);


TCustomGrid::TCustomGrid

TCustomGrid	Methods	See also

TCustomGrid creates a new TCustomGrid object.

Syntax

__fastcall virtual TCustomGrid(Classes::TComponent *AOwner);

Description

Use TCustomGrid to create a new TCustomGrid object.


TCustomGrid::~TCustomGrid

TCustomGrid	Methods	See also

~TCustomGrid frees the memory associated with the TCustomGrid object.

Syntax

__fastcall virtual ~TCustomGrid(void);

Description

Do not call ~TCustomGrid directly. Instead, use the delete keyword on the object, which causes ~TCustomGrid to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomGrid example

TCustomGrid


TCustomHotKey

Hierarchy	Properties	Methods

The TCustomHotKey component is the abstract base type for all hot-key components, including THotKey.

Header

vcl/comctrls.hpp

Overview

All the properties introduced by TCustomHotKey are published in THotKey. All the public and protected methods in TCustomHotKey are overrides of methods inherited from its ancestor, TWinControl.


TCustomHotKey properties

TCustomHotKey	Alphabetically	Legend

In TCustomHotKey

AutoSize

HotKey

InvalidKeys

Modifiers

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomHotKey properties

TCustomHotKey	By object	Legend

Align

AutoSize

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

HotKey

InvalidKeys

Left

Modifiers

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomHotKey::AutoSize

TCustomHotKey	Properties

Syntax

__property System::Boolean AutoSize;

Description


TCustomHotKey::HotKey

TCustomHotKey	Properties	See also

HotKey contains the current key combination of the hot-key control.

Syntax

__property Menus::TShortCut HotKey;

Description

Use Foo to . . . . .

To blah blah blah, set the ...... Choose the ...

Alt+A is the default. To modify the value of the HotKey property either edit it directly or set the value of the Modifiers property. At run-time the HotKey property is reset when the hot key has focus and the user presses valid key combinations.


TCustomHotKey::InvalidKeys

TCustomHotKey	Properties

Syntax

__property THKInvalidKeys InvalidKeys;


TCustomHotKey::Modifiers

TCustomHotKey	Properties

Syntax

__property THKModifiers Modifiers;


TabStop


TCustomHotKey methods

TCustomHotKey	Alphabetically	Legend

In TCustomHotKey

~TCustomHotKey

CreateParams

CreateWnd

TCustomHotKey

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomHotKey methods

TCustomHotKey	By object	Legend

~TCustomHotKey

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomHotKey

UpdateControlState

Update


TCustomHotKey::CreateParams

TCustomHotKey	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomHotKey::CreateWnd

TCustomHotKey	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomHotKey::TCustomHotKey

TCustomHotKey	Methods	See also

TCustomHotKey creates a new TCustomHotKey object.

Syntax

__fastcall virtual TCustomHotKey(Classes::TComponent *AOwner);

Description

Use TCustomHotKey to create a new TCustomHotKey object.


TCustomHotKey::~TCustomHotKey

TCustomHotKey	Methods	See also

~TCustomHotKey frees the memory associated with the TCustomHotKey object.

Syntax

__fastcall virtual ~TCustomHotKey(void);

Description

Do not call ~TCustomHotKey directly. Instead, use the delete keyword on the object, which causes ~TCustomHotKey to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomHotKey example

TCustomHotKey


TCustomImageList

Hierarchy	Properties	Methods	Events	See also

A TCustomImageList is an abstract class that is derived from to provide a collection of same-sized images, each of which can be referred to by its index.

Header

vcl/controls.hpp

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks used to draw images transparently (icon style).


TCustomImageList properties

TCustomImageList	Alphabetically	Legend

In TCustomImageList

AllocBy

BkColor

BlendColor

Count

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TCustomImageList properties

TCustomImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

DesignInfo

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

Width


TCustomImageList::AllocBy

TCustomImageList	Properties	See also

The AllocBy property sets the number of images which the image list will grow by when it needs to resize to make room for new images.

Syntax

__property System::Integer AllocBy;

Description

Use the AllocBy method to specify the number of new images that can be added to the resized image list.


TCustomImageList::BkColor

TCustomImageList	Properties	See also

The BkColor property determines which background color to use when drawing an image.

Syntax

__property Graphics::TColor BkColor;

Description

Setting BKColor to clNone specifies no background color i.e. the image is drawn transparently. Setting BKColor to clDefault specifies using the image lists background color when drawing.


TCustomImageList::BlendColor

TCustomImageList	Properties	See also

The BlendColor property determines which foreground color to use when drawing an image.

Syntax

__property Graphics::TColor BlendColor;

Description

clNone specifies no blend color while clDefault specifies the system highlight color for the foreground color.


TCustomImageList::Count

TCustomImageList	Properties	See also

The Count property returns the number of images in the image list.

Syntax

__property System::Integer Count;

Description

Count can be useful when iterating through the image list.


TCustomImageList::DragCursor

TCustomImageList	Properties	See also

The DragCursor property specifies the current drag cursor that is associated with the image list.

Syntax

__property TCursor DragCursor;

Description

Use the DragCursor property to determine which drag cursor should be displayed when an image in the image list is dragged. When an image is dragged, a new drag image is created by combining the given image (typically a mouse cursor image) with the current drag cursor.


TCustomImageList::Dragging

TCustomImageList	Properties	See also

The Dragging property returns whether an image in the image list is being dragged.

Syntax

__property System::Boolean Dragging;

Description

When Dragging returns true, an image in the image list is being dragged. When Dragging returns false, no image is being dragged.


TCustomImageList::DrawingStyle

TCustomImageList	Properties	See also

The DrawingStyle property specifies the style to be used when the image list is drawing an image.

Syntax

__property TDrawingStyle DrawingStyle;

Description

Use the DrawingStyle property to control how the image is to appear. These are the possible values:

Value	Meaning

dsFocused	Draws the image blending 25% with the system highlight color. This only affects image lists which contain masks.

dsSelected	Draws the image blending 50% with the system highlight color. This only affects image lists which contain masks.

dsNormal	Draws the image using the color specified in the BkColor property. If the BkColor is clNone then the image is drawn transparently using the mask.

dsTransparent	Draws using the mask regardless of the BkColor setting.


TCustomImageList::Handle

TCustomImageList	Properties	See also

The Handle property specifies the handle to the image list.

Syntax

__property System::Integer Handle;

Description

The Handle property allows access to the Windows image list object handle when calling Windows API functions that requires it.


TCustomImageList::Height

TCustomImageList	Properties	See also

The Height property specifies the height of images within the image list.

Syntax

__property System::Integer Height;

Description

Use the Height property to specify the height of images before any are added to the image list. The image list is cleared when this value changes.


TCustomImageList::ImageType

TCustomImageList	Properties	See also

The ImageType property determines whether the image list will use the image or the associated image mask when drawing.

Syntax

__property TImageType ImageType;

Description

Use the ImageType property to control how the image is to appear. These are the possible values

Value	Meaning

itImage	Draws the image.

itMask	Draws the mask.


TCustomImageList::Masked

TCustomImageList	Properties	See also

The Masked property specifies whether the image list contains transparent or non-transparent images.

Syntax

__property System::Boolean Masked;

Description

Set the Masked property to true to specify that the images will contain transparent areas.


TCustomImageList::ShareImages

TCustomImageList	Properties	See also

The ShareImages property specifies whether the image list destroys its handle when the image list is destroyed.

Syntax

__property System::Boolean ShareImages;

Description

Set the ShareImages property to false to ensure that the handle to the image list is freed when the image list is destroyed.


TCustomImageList::Width

TCustomImageList	Properties	See also

The Width property sets the width of images within the image list.

Syntax

__property System::Integer Width;

Description

Use the Width property to specify the width of images before any are added to the image list. The image list is cleared when this value changes.


TCustomImageList events

TCustomImageList	Alphabetically	Legend

In TCustomImageList

OnChange


TCustomImageList events

TCustomImageList	By object	Legend

OnChange


On Changes

The OnChange event is called when the image list changes.

Description

Use the OnChange event to execute some code when the image list changes. Any objects registered with the RegisterChanges method will also be notified.


TCustomImageList methods

TCustomImageList	Alphabetically	Legend

In TCustomImageList

~TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

BeginDrag

Change

Clear

CreateSize

DefineProperties

Delete

DragLock

DragMove

DragUnlock

Draw

DrawOverlay

EndDrag

FileLoad

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetImages

GetMaskBitmap

GetResource

HandleAllocated

HandleNeeded

HideDragImage

Initialize

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResourceLoad

SetDragImage

ShowDragImage

TCustomImageList

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomImageList methods

TCustomImageList	By object	Legend

~TCustomImageList

AddIcon

AddImages

AddMasked

Add

Assign

BeginDrag

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

CreateSize

DefaultHandler

DefineProperties

Delete

DestroyComponents

Destroying

Dispatch

DragLock

DragMove

DragUnlock

DrawOverlay

Draw

EndDrag

FieldAddress

FileLoad

FindComponent

FreeInstance

FreeNotification

Free

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetImages

GetMaskBitmap

GetParentComponent

GetResource

HandleAllocated

HandleNeeded

HasParent

HideDragImage

InheritsFrom

Initialize

InitInstance

InsertComponent

InsertIcon

InsertMasked

Insert

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

ReplaceIcon

ReplaceMasked

Replace

ResourceLoad

SetDragImage

ShowDragImage

TCustomImageList

UnRegisterChanges


TCustomImageList::Add

TCustomImageList	Methods	See also

The Add method adds an Image and its Mask to the image list object. Add returns the index of the added image.

Syntax

System::Integer __fastcall Add(Graphics::TBitmap *Image, Graphics::TBitmap *Mask);

Description

Use the Add method to add images with their masks to an image list. When the Masked property of the image list is false, the second bitmap handle is ignored; it can be set to NULL. Add returns -1 if it fails, 0 if it’s successful.


TCustomImageList::AddIcon

TCustomImageList	Methods	See also

The AddIcon method adds an icon specified by Image to the image list object. AddIcon returns the index of the added image.

Syntax

System::Integer __fastcall AddIcon(Graphics::TIcon *Image);

Description

Use the AddIcon method to add an icon to an image list. AddIcon returns -1 if it fails, 0 if it’s successful.


TCustomImageList::AddImages

TCustomImageList	Methods	See also

The AddImages method adds images from another image list specified by Value to the image list object.

Syntax

void __fastcall AddImages(TCustomImageList *Value);

Description

Use the AddImages method to add the images from another image list. AddImages returns -1 if it fails, 0 if it’s successful.


TCustomImageList::AddMasked

TCustomImageList	Methods	See also

The AddMasked method adds an image to the image list along with a color which is used to generate the transparent mask from the image.

Syntax

System::Integer __fastcall AddMasked(Graphics::TBitmap *Image, Graphics::TColor MaskColor);

Description

AddMasked is similar to Add except that a mask bitmap is not specified. Instead, a color that the system combines with the image bitmap to automatically generate the masks is specified. Each pixel of the specified color in the image bitmap is changed to black, and the corresponding bit in the mask is set to one. As a result, any pixel in the image that matches the specified color is transparent when the image is drawn. AddMasked returns -1 if it fails, 0 if it’s successful.


TCustomImageList::Assign

TCustomImageList	Methods	See also

The Assign method copies the information from one image list to another.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

If Source is another TImageList object, Assign discards any current image information and replaces it with the information from Source. If Source is any other type of object, Assign calls its inherited method. Use this method to copy one object's information to another.


TCustomImageList::BeginDrag

TCustomImageList	Methods	See also

The BeginDrag method starts the dragging of an image.

Syntax

System::Boolean __fastcall BeginDrag(System::Integer Window, System::Integer X, System::Integer Y);

Description

Use the BeginDrag method to start dragging an image set by SetDragImage at the X and Y coordinates of the drag position relative to the upper-left corner of the image. Window is the handle to the image list. BeginDrag returns true if it was successful in starting the drag of the image.


TCustomImageList::Change

TCustomImageList	Methods	See also

The Change method notifies the image list and any objects registered by RegisterChanges that a change has occurred in the image list.

Syntax

virtual void __fastcall Change(void);

Description

Use this method to trigger the OnChange event of the image list and any objects registered with the image list for change notification.


TCustomImageList::Clear

TCustomImageList	Methods	See also

The Clear method clears all images from the image list.

Syntax

void __fastcall Clear(void);

Description

Use the Clear method to remove all images from the image list. Use the Delete method to delete one image from the image list.


TCustomImageList::CreateSize

TCustomImageList	Methods	See also

The CreateSize constructor creates a TImageList object of a specified size.

Syntax

Description

Use the CreateSize constructor to create an image list object with an image size that other than the default of 16 x 16 pixels. The initial size of the image list is determined by the AHeight and AWidth parameters. The height and width can be altered after the image list has been created using the Width and Height properties.


TCustomImageList::DefineProperties

TCustomImageList	Methods	See also

The DefineProperties method calls the inherited DefineProperties method and also defines bitmap data for storage by the filer.

Syntax

virtual void __fastcall DefineProperties(Classes::TFiler *Filer);

Description

The DefineProperties method calls the inherited DefineProperties method and also calls the TFiler DefineBinaryProperty which defines binary data the filer object will store as if the data were a property.


TCustomImageList::Delete

TCustomImageList	Methods	See also

The Delete method deletes a particular image from the image list.

Syntax

void __fastcall Delete(System::Integer Index);

Description

Use the Delete method to delete an image specified by Index in the image list. Use the Clear method to delete all images in the image list.


TCustomImageList::DragLock

TCustomImageList	Methods	See also

The DragLock method associates the drag image with the given Window handle and draws it at the position given by the parameters XPos and YPos while the window is in drag mode. Returns true if successful.

Syntax

System::Boolean __fastcall DragLock(System::Integer Window, System::Integer XPos, System::Integer YPos

Description

Call DragLock to use an image in the image list as a drag image when a particular window is dragged.


TCustomImageList::DragMove

TCustomImageList	Methods	See also

The DragMove method moves the drag image set by SetDragImage to a new position specified by X and Y within its currently associated window while the window is in drag mode. Returns true if successful.

Syntax

System::Boolean __fastcall DragMove(System::Integer X, System::Integer Y);

Description

Use the DragMove method to move the image that is being dragged during a drag-and-drop operation.


TCustomImageList::DragUnlock

TCustomImageList	Methods	See also

The DragUnlock method removes the association between the drag image and a window.

Syntax

void __fastcall DragUnlock(void);

Description

Use the DragUnlock method when an image is no longer needed as a drag image for a particular window.


TCustomImageList::Draw

TCustomImageList	Methods	See also

The Draw method draws the image specified by the Index parameter onto the provided Canvas at position X, Y. The image is drawn according to the style set in the DrawingStyle property.

Syntax

void __fastcall Draw(Graphics::TCanvas *Canvas, System::Integer X, System::Integer Y, System::Integer

Description

Use the Draw method do draw an image.

Example

The following code draws each header section adding text for a title and icons stored in ImageList1. The image list contains as many icons as there are header sections.


TCustomImageList::DrawOverlay

TCustomImageList	Methods	See also

The DrawOverlay method draws an image and an overlay onto the provided Canvas.

Syntax

void __fastcall DrawOverlay(Graphics::TCanvas *Canvas, System::Integer X, System::Integer Y, System::Integer

Description

An overlay mask is an image drawn transparently over another image. Any image can be used as an overlay mask. To draw an overlay mask over an image use the DrawOverlay method with the index of the overlay mask. The Overlay method must be called first to allow an image to be used as an overlay.


TCustomImageList::EndDrag

TCustomImageList	Methods	See also

The EndDrag method ends the drag operation. EndDrag returns true if successful.

Syntax

System::Boolean __fastcall EndDrag(void);

Description

Use EndDrag after BeginDrag has been called to end the drag operation.


TCustomImageList::FileLoad

TCustomImageList	Methods	See also

The FileLoad method loads a file of type TResType into the image list. The MaskColor is used to set the transparent color for the images in the file. Name specifies the file to be loaded.

Syntax

System::Boolean __fastcall FileLoad(TResType ResType,  System::AnsiString Name, Graphics::TColor MaskColor

Description

Use the FileLoad method to load a bitmap, cursor or icon file into an image list. FileLoad returns true if successful.


TCustomImageList::GetBitmap

TCustomImageList	Methods	See also

The GetBitmap method returns the image specified by the Index parameter as a bitmap into the Image parameter.

Syntax

void __fastcall GetBitmap(System::Integer Index, Graphics::TBitmap *Image);

Description

Use the GetBitmap method to obtain a particular image in the image list as a bitmap object.


TCustomImageList::GetHotSpot

TCustomImageList	Methods	See also

The GetHotSpot method returns the hot spot location associated with the current drag image.

Syntax

Windows::TPoint __fastcall GetHotSpot(void);

Description

Use the GetHotSpot method to obtain the position of the hot spot of the current drag image.


TCustomImageList::GetIcon

TCustomImageList	Methods	See also

The GetIcon method returns the image specified by Index as an icon into the Image parameter.

Syntax

void __fastcall GetIcon(System::Integer Index, Graphics::TIcon *Image);

Description

Use the GetIcon method to obtain a particular image in the image list as an icon.


TCustomImageList::GetImageBitmap

TCustomImageList	Methods	See also

The GetImageBitmap method returns a handle to a bitmap containing all of the images in the image list.

Syntax

System::Integer __fastcall GetImageBitmap(void);

Description

Use the GetImageBitmap method to obtain a bitmap that contains all images in the image list. GetImageBitmap returns 0 unsuccessful.


TCustomImageList::GetImages

TCustomImageList	Methods	See also

The GetImages method returns the image and its mask specified by the Index parameter as a bitmap into the Image and Mask parameters respectively.

Syntax

void __fastcall GetImages(System::Integer Index, Graphics::TBitmap *Image, Graphics::TBitmap *Mask)

Description

Use the GetImages method to obtain an image and its mask as bitmaps.


TCustomImageList::GetMaskBitmap

TCustomImageList	Methods	See also

The GetMaskBitmap method returns a handle to a bitmap containing all masks for images in the image list.

Syntax

System::Integer __fastcall GetMaskBitmap(void);

Description

Use the GetMaskBitmap to obtain a bitmap that contains all masks in the image list. GetMaskBitmap returns 0 unsuccessful.


TCustomImageList::GetResource

TCustomImageList	Methods	See also

The GetResource method loads the specified bitmap, cursor, or icon resource into the image list.

Syntax

System::Boolean __fastcall GetResource(TResType ResType,  System::AnsiString Name, System::Integer

Description

Use the GetResource method to load bitmap, cursor, or icon resource of Name into an image list.

ResType specifies the type of graphical resource that is to be loaded into the image list and can be rtBitmap, rtCursor or rtIcon. The MaskColor is used to set the transparent color for the images in the file. LoadFlags specifies how to load the image. A combination of the following values can be used.

Value	Meaning

lrNone 	No specific resource flags.

lrDefaultColor	Use the color format of the display.

lrDefaultSize	Use system metrics for Height and Width if the Width parameter to GetResource is 0. If the Width parameter is 0 and this option is not specified for cursors and icons, the resources width and height will be used.

lrFromFile	Loads the resource from the specified file.

lrMap3DColors	Replaces the images grey shades with the 3D windows colors.

lrTransparent	Replaces the color table entry for the first pixel of the resource with the default window color (COLOR_WINDOW). This applies only to images with color tables.

lrMonoChrome	Loads the resource as black and white.


TCustomImageList::HandleAllocated

TCustomImageList	Methods	See also

The HandleAllocated method returns true if a window handle for the control exists, false if none exists.

Syntax

System::Boolean __fastcall HandleAllocated(void);

Description

Use the HandleAllocated method to determine if a handle exists for the control. HandleAllocated doesn’t create a handle if one doesn’t already exist. Calling the Handle property of a control directly creates a handle automatically if one didn't previously exist.


TCustomImageList::HandleNeeded

TCustomImageList	Methods	See also

The HandleNeeded method creates an image list handle for the image list if one doesn't already exist.

Syntax

void __fastcall HandleNeeded(void);

Description

Use the HandleNeeded method to create an image list handle for the image list when one doesn’t already exist. This method is called automatically when an image list’s handle property is accessed.


TCustomImageList::HideDragImage

TCustomImageList	Methods	See also

The HideDragImage method hides the current drag image if it was previously shown.

Syntax

void __fastcall HideDragImage(void);

Description

Use the HideDragImage method to hide the current drag image.


TCustomImageList::Initialize

TCustomImageList	Methods	See also

The Initialize method sets numerous image list properties to their default values and creates instances of objects used internal to the image list.

Syntax

void __fastcall Initialize(void);

Description

Initialize is called from the Create and CreateSize constructors of the image list.


TCustomImageList::Insert

TCustomImageList	Methods	See also

The Insert method inserts a bitmap and its mask into the image list following the image specified by Index.

Syntax

void __fastcall Insert(System::Integer Index, Graphics::TBitmap *Image, Graphics::TBitmap *Mask);

Description

Use the Insert method to insert a bitmap and its mask into the image list.


TCustomImageList::InsertIcon

TCustomImageList	Methods	See also

The InsertIcon method inserts an icon at the Index + 1 position in the image list.

Syntax

void __fastcall InsertIcon(System::Integer Index, Graphics::TIcon *Image);

Description

Use the InsertIcon method to insert an icon into the image list.


TCustomImageList::InsertMasked

TCustomImageList	Methods	See also

The InsertMasked method inserts a bitmap at the Index + 1 position, creating the mask from the transparent color provided by the parameter MaskColor.

Syntax

void __fastcall InsertMasked(System::Integer Index, Graphics::TBitmap *Image, Graphics::TColor MaskColor

Description

Use the InsertMasked method to insert a masked image into the image list.


TCustomImageList::Move

TCustomImageList	Methods	See also

The Move method moves an image specified by CurIndex in the image list to another position specified by NewIndex within the image list.

Syntax

void __fastcall Move(System::Integer CurIndex, System::Integer NewIndex);

Description

Use the Move method to move an image to another position in the image list.


TCustomImageList::Overlay

TCustomImageList	Methods	See also

The Overlay method adds the index of an image to the list of images to be used as overlay masks. Up to four indices can be added to the list.

Syntax

ImageIndex, TOverlay Overlay);

Description

An overlay mask is an image drawn transparently over another image. Any image can be used as an overlay mask. To draw an overlay mask over an image use the DrawOverlay method with the index of the overlay mask. If successful, Overlay returns true.


TCustomImageList::RegisterChanges

TCustomImageList	Methods	See also

The RegisterChanges method registers an object to be notified when changes occur in the image list.

Syntax

void __fastcall RegisterChanges(TChangeLink *Value);

Description

Use the RegisterChanges method to have an object notified whenever changes occur in the image list. The TChangeLink's OnChange event is called whenever a change in the image list occurs.

Create a change link object for each object that should be notified of changes. Register each object by calling RegisterChanges and passing its change link object as the Value parameter. The OnChange event of all registered change link objects is then triggered when a change occurs in the image list. Any code assigned to the OnChange event handlers will execute.


TCustomImageList::Replace

TCustomImageList	Methods	See also

The Replace method replaces an image in the image list with a new image and mask.

Syntax

void __fastcall Replace(System::Integer Index, Graphics::TBitmap *Image, Graphics::TBitmap *Mask);

Description

Use the Replace method to replace the image at the Index position in the image list with a new Image and overlay Mask.


TCustomImageList::ReplaceIcon

TCustomImageList	Methods	See also

The ReplaceIcon method replaces an image in the image list with an icon.

Syntax

void __fastcall ReplaceIcon(System::Integer Index, Graphics::TIcon *Image);

Description

Use the ReplaceIcon method to replace the Image at the Index position in the image list with a new icon.


TCustomImageList::ReplaceMasked

TCustomImageList	Methods	See also

The ReplaceMasked method replaces an image in the image list with a new image and mask.

Syntax

void __fastcall ReplaceMasked(System::Integer Index, Graphics::TBitmap *NewImage, Graphics::TColor

Description

Use the ReplaceMasked method to replace the image at Index position within the image list with a new image and mask created using the MaskColor for transparency.


TCustomImageList::ResourceLoad

TCustomImageList	Methods	See also

The ResourceLoad method loads a resource into the image list.

Syntax

System::Boolean __fastcall ResourceLoad(TResType ResType,  System::AnsiString Name, Graphics::TColor

Description

Use the ResourceLoad method to load a resource of type TResType into the image list. The MaskColor is used to create the mask for the resulting image.


TCustomImageList::SetDragImage

TCustomImageList	Methods	See also

The SetDragImage method sets an image within the image list to be shown during a drag and drop operation.

Syntax

System::Boolean __fastcall SetDragImage(System::Integer Index, System::Integer HotSpotX, System::Integer

Description

Use the SetDragImage method to set the image specified by Index within the image list to be shown when the image list is being used for drag and drop. The hot spot of the image is specified by HotSpotX and HotSpotY.


TCustomImageList::ShowDragImage

TCustomImageList	Methods	See also

The ShowDragImage method shows the current drag image if it was previously hidden.

Syntax

void __fastcall ShowDragImage(void);

Description

Use ShowDragImage method to show the current drag image if it was previously hidden.


TCustomImageList::UnRegisterChanges

TCustomImageList	Methods	See also

The UnRegisterChanges method removes an object from the list of objects to be notified when the image list changes.

Syntax

void __fastcall UnRegisterChanges(TChangeLink *Value);

Description

Use the UnRegisterChanges method to unregister a TChangeLink object. The object will no longer receive notification when the image list changes.


TCustomImageList::TCustomImageList

TCustomImageList	Methods	See also

TCustomImageList creates a new TCustomImageList object.

Syntax

__fastcall virtual TCustomImageList(Classes::TComponent *AOwner);

Description

Use TCustomImageList to create a new TCustomImageList object.


TCustomImageList::~TCustomImageList

TCustomImageList	Methods	See also

~TCustomImageList frees the memory associated with the TCustomImageList object.

Syntax

__fastcall virtual ~TCustomImageList(void);

Description

Do not call ~TCustomImageList directly. Instead, use the delete keyword on the object, which causes ~TCustomImageList to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomImageList example

TCustomImageList


TCustomLabel

Hierarchy	Properties	Methods

Header

vcl/stdctrls.hpp

Description


TCustomLabel properties

TCustomLabel	Alphabetically	Legend

In TCustomLabel

Alignment

AutoSize

FocusControl

ShowAccelChar

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomLabel properties

TCustomLabel	By object	Legend

Alignment

Align

AutoSize

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

FocusControl

Height

Hint

Left

Name

Owner

Parent

ShowAccelChar

ShowHint

Tag

Top

Transparent

Visible

Width

WordWrap


TCustomLabel::Alignment

TCustomLabel	Properties

Syntax

__property Classes::TAlignment Alignment;

Description


TCustomLabel::AutoSize

TCustomLabel	Properties

Syntax

__property System::Boolean AutoSize;

Description


TCustomLabel::FocusControl

TCustomLabel	Properties

Syntax

__property Controls::TWinControl * FocusControl;

Description


TCustomLabel::ShowAccelChar

TCustomLabel	Properties

Syntax

__property System::Boolean ShowAccelChar;

Description


TCustomLabel::Transparent

TCustomLabel	Properties

Syntax

__property System::Boolean Transparent;

Description


TCustomLabel::WordWrap

TCustomLabel	Properties

Syntax

__property System::Boolean WordWrap;

Description


TCustomLabel methods

TCustomLabel	Alphabetically	Legend

In TCustomLabel

~TCustomLabel

GetLabelText

Notification

Paint

SetAutoSize

TCustomLabel

Derived from TGraphicControl

BeginDrag

Derived from TControl

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomLabel methods

TCustomLabel	By object	Legend

~TCustomLabel

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetLabelText

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Notification

Paint

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetAutoSize

SetBounds

SetTextBuf

Show

TCustomLabel

Update


TCustomLabel::GetLabelText

TCustomLabel	Methods

Syntax

virtual System::AnsiString __fastcall GetLabelText(void);

Description


TCustomLabel::Notification

TCustomLabel	Methods

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation

Description


TCustomLabel::Paint

TCustomLabel	Methods

Syntax

virtual void __fastcall Paint(void);

Description


TCustomLabel::SetAutoSize

TCustomLabel	Methods

Syntax

virtual void __fastcall SetAutoSize(System::Boolean Value);

Description


TCustomLabel::TCustomLabel

TCustomLabel	Methods	See also

TCustomLabel creates a new TCustomLabel object.

Syntax

__fastcall virtual TCustomLabel(Classes::TComponent *AOwner);

Description

Use TCustomLabel to create a new TCustomLabel object.


TCustomLabel::~TCustomLabel

TCustomLabel	Methods	See also

~TCustomLabel frees the memory associated with the TCustomLabel object.

Syntax

__fastcall virtual ~TCustomLabel(void);

Description

Do not call ~TCustomLabel directly. Instead, use the delete keyword on the object, which causes ~TCustomLabel to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TCustomLabel example

TCustomLabel


TCustomListBox

Hierarchy	Properties	Methods	Events	See also

TCustomListBox is the abstract base class type for the list-box objects that are wrappers for Windows list box controls.

Header

vcl/stdctrls.hpp

Description

TCustomListBox is an abstract class that encapsulates behavior common to all list box controls in Borland C++ Builder. List box objects are used to display a scrollable list from which users can select one or more items. Use a list box control to limit the user to selecting from a list of items that is set at design time. Items in the list can also be dynamically added or deleted at run time.

As a wrapper for a list box TCustomListBox introduces methods for:

•	Displaying, sorting, selecting, manipulating and querying items in the list.

•	Creating owner-draw style list boxes that can display graphical images such as icons and bitmaps.

•	Creating multiple-column and multiple-selection lists.

By default TCustomListBox is a standard list box that displays items as text strings. These items are contained in a TStrings object, and the methods of the TStrings object are used to add, insert or delete a string. The following code demonstrates adding a new string to the list box:

List box descendents of TCustomListBox inherit the basic functionality of TCustomListBox. Some descendents also have specialized behavior and can be linked to file, directory, drive or database information. Use these list boxes to easily access and list this type of information.

A combo box is a list box with an edit control and an optional drop down style for the list. Use a combo box to allow users to type their selection into an edit box or to save space on a form by having the list drop down.

For lists of items that require a matrix or expandable tree-like structure use outlines, list views or tree views. These controls allow the grouping of items under column headings or in expandable and contractable rows.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for deriving specialized list box objects.


TCustomListBox properties

TCustomListBox	Alphabetically	Legend

In TCustomListBox

BorderStyle

Canvas

Columns

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomListBox properties

TCustomListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

ExtendedSelect

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

MultiSelect

Name

Owner

ParentColor

Parent

SelCount

Selected

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

TabWidth

Tag

TopIndex

Top

Visible

Width


TCustomListBox::BorderStyle

TCustomListBox	Properties	See also

BorderStyle determines whether the list box has a border.

Syntax

__property Forms::TBorderStyle BorderStyle;

Description

Use BorderStyle to change the appearance of the outer boundary of the list box control. A list box can have a single border or no visible border. The following table lists the possible values for TBorderStyle, which is the type of the BorderStyle property:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TCustomListBox::Canvas

TCustomListBox	Properties	See also

Canvas provides access to a drawing surface that to use when implementing a handler for the OnDrawItem event of an owner-draw list box.

Syntax

__property Graphics::TCanvas * Canvas;

Description

Canvas is only useful for applications that control the drawing of list box items, that is, for owner-draw list boxes. Canvas is used to draw graphical images that can be used as items in a list box.

By default a TControlCanvas object is created for the Canvas property in the list box constructor. To create an owner-draw list box that uses a canvas, set the Style property accordingly.

Example

The following code draws a graphic stored in the Objects property of the Items list of ListBox1. This code would be attached to the OnDrawItem event handler of ListBox1.


TCustomListBox::Columns

TCustomListBox	Properties	See also

Columns specifies the number of columns, in a multi-column list box, that are visible without having to scroll.

Syntax

__property System::Integer Columns;

Description

Use Columns to specify the number of columns, in a multi-column list box, that are visible without having to use the horizontal scrollbar.

Multi-column list boxes have a horizontal scrollbar that allows users to view multiple columns as they wrap. The default value for Columns is 0, meaning that the list box is not multi-column. That is, users can scroll only vertically and the list of items will not wrap.

For Columns values greater than 0, multiple columns accomodate the items as they wrap beyond the bottom of the list box. The Columns property specifies the number of columns that are visible without having to horizontally scroll the list box.

The width of each column depends upon both the Width property and the number of Columns.


TCustomListBox::ExtendedSelect

TCustomListBox	Properties	See also

ExtendedSelect determines if the user can select a sequential range of items in the list box.

Syntax

__property System::Boolean ExtendedSelect;

Description

ExtendedSelect works in conjunction with the MultiSelect property. If ExtendedSelect is true and MultiSelect is true, the user can select an item then hold down the Shift key and select another and all the items in between the two selected items also become selected. If the user doesn’t hold down the Shift or Ctrl key while selecting a second item, the first selected item becomes unselected—in other words, the user must use the Ctrl key to select multiple noncontiguous items, or the Shift key to select a range of items.

If ExtendedSelect is false and MultiSelect is true, the user can select multiple items without using the Shift or Ctrl key, but they can’t select a range of items in one operation.

If MultiSelect is false, the setting of ExtendedSelect has no effect as the user will not be able to select more than one item at a time in the list box.


TCustomListBox::IntegralHeight

TCustomListBox	Properties	See also

IntegralHeight determines whether the list box displays the partial items.

Syntax

__property System::Boolean IntegralHeight;

Description

If IntegralHeight is true, the list box shows only entries that fit completely in the vertical space, and the bottom of the list box coincides with the bottom of the last completely drawn item in the list.

If IntegralHeight is false, the bottom of the list box is determined by its ItemHeight property, and the bottom item in the list might be only partially visible.

If the Style property value of the list box is lsOwnerDrawFixed, the height of the list box at design time is always an increment of the ItemHeight value.

If theStyle property value of the list box is lbOwerDrawVariable, setting the IntegralHeight property to true has no effect.


TCustomListBox::ItemHeight

TCustomListBox	Properties	See also

ItemHeight specifies the height in pixels of an item in an owner-draw list box.

Syntax

__property System::Integer ItemHeight;

Description

Use ItemHeight to control the height of an item in a list box when the Style property is lsOwnerDrawFixed. The ItemHeight property can also affect the height of the list box itself. When the IntegralHeight property is true, the height of the list box is always an increment of the ItemHeight value.

If the Style property is lsStandard or lsOwnerDrawVariable, the value of ItemHeight is ignored.


TCustomListBox::ItemIndex

TCustomListBox	Properties	See also

ItemIndex specifies the ordinal number of the selected item in the list box’s item list.

Syntax

__property System::Integer ItemIndex;

Description

Use ItemIndex to select an item at run time. Set the value of ItemIndex to the index of the item to be selected. The ItemIndex of the first item in the list box is 0. If no item is selected, the value is -1, which is the default value unless MultiSelect is true.

If the value of the MultiSelect property is true the user can select more than one item in the list box. In this case, the ItemIndex value is the index of the selected item that has focus. If MultiSelect is true, ItemIndex defaults to 0.


TCustomListBox::Items

TCustomListBox	Properties	See also

Items contains the strings that appear in the list box.

Syntax

__property Classes::TStrings * Items;

Description

Use Items to add, insert, delete and move items. By default the items in a list box are of type TStrings. Use this item type to access its methods or properties in order to manipulate the items in the list. For example, the following code adds the text in the edit box to the list box as an item:

To add items that are either not strings, such as graphical images, or that are a combination of strings and other items, set the Style property to an owner-draw.

Other list box properties and methods are used with list box items to:

•	Determine their appearance.

•	Determine their selection capabilities

•	Provide information about them.


TCustomListBox::MultiSelect

TCustomListBox	Properties	See also

MultiSelect determines whether the user can select more than one element at a time from the list box.

Syntax

__property System::Boolean MultiSelect;

Description

Set MultiSelect to true to allow the user to select multiple items. If MultiSelect if false, multiple items cannot be selected in the list box at the same time.

MultiSelect allows users to select multiple non-sequential items. It does not allow users to select a range of items in one operation, as does the ExtendedSelect property.

When MultiSelect is true and multiple items are selected, the value of the ItemIndex property, which indicates the index of the Selected item, is the index of the selected item that has focus.


TCustomListBox::SelCount

TCustomListBox	Properties	See also

SelCount reports the number of items that are selected in a list box when multiple selections are allowed.

Syntax

__property System::Integer SelCount;

Description

SelCount is read-only. Use SelCount to find the the number of selected items in the list box when the MultiSelect property is true.

When the MultiSelect property is false, only one item can be selected. If no items are selected, the value of SelCount is 0.


TCustomListBox::Selected

TCustomListBox	Properties	See also

Selected determines whether a particular item is selected in a list box.

Syntax

__property System::Boolean Selected[System::Integer Index];

Description

Use Selected to query the state of a particular item in the list box. If the item specified by the Index parameter is selected in the list box, the value of the Selected property is true. If the specified item is not selected, Selected is false.

The Index parameter is the item referenced by its position in the list box, with the first item having an Index value of 0.

An item is selected when the user highlights it. More than one item in the list box can be selected by setting the MultiSelect property to true. In this case, the Selected item is the one that has focus.


TCustomListBox::Sorted

TCustomListBox	Properties	See also

Sorted specifies whether the items in a list box are arranged alphabetically.

Syntax

__property System::Boolean Sorted;

Description

Use Sorted to sort the items by setting its value to true. If Sorted is false, the items are unsorted. When Sorted is true, items that are added or inserted are automatically into the list box in alphabetical order.


TCustomListBox::Style

TCustomListBox	Properties	See also

Style determines whether the list box is standard or owner-draw.

Syntax

__property TListBoxStyle Style;

Description

Use Style to specify whether the list box is a standard list box that displays text strings, or an owner-draw list box that can display graphical images. By default, Style is lbStandard, meaning that the list box displays each item as a string.

Owner-draw list boxes can display graphical images along with or instead of its strings, and the items can be of either fixed or varying height. To create owner-draw list boxes, set the value of Style to lbOwnerDrawFixed or lbOwnerDrawVariable. The following table lists the values for the TListBoxStyle type of the Style property::

Value	Meaning

lbStandard	All items are strings, with each item the same height.

lbOwnerDrawFixed	Each item in the list box is the height specified by the ItemHeight property.

lbOwnerDrawVariable	Items in the list box can be of varying heights.

Owner-draw list boxes require more programming because the application needs information on how to render the image for each item in the list.

Each time an item is displayed in an lbOwnerDrawFixed list boxes, , the OnDrawItem event occurs. The event handler for OnDrawItem draws the specified item. The ItemHeight property determines the height of all the items.

Each time an item is displayed in an lbOwnerDrawVariable list box, two events occur. The first is the OnMeasureItem event. The code for the OnMeasureItem handler can set the height of each item. Then the OnDrawItem event occurs. The code for the OnDrawItem handler draws each item in the list box using the size specified by the OnMeasureItem handler.


TCustomListBox::TabWidth

TCustomListBox	Properties

TabWidth was a missing entry in the currentVCL ref.

Syntax

__property System::Integer TabWidth;

Description

Use TabWidth to . . .

but there’s readable code for this . . .


TCustomListBox::TopIndex

TCustomListBox	Properties	See also

TopIndex specifies the index number of the item that appears at the top of the list box.

Syntax

__property System::Integer TopIndex;

Description

Use TopIndex property to find or set the first item displayed at the top of the list box. TopIndex can be used, for example, to change the topmost item to a different item in the list.

Example

The following example uses a list box containing a list of strings, a button, and an edit box on a form. When the user runs the application and clicks the button, the third item in the list becomes the first item, and the index value of that item appears in the edit box. The index value displayed is 2, indicating the third item in the list (the first item in the list has an index value of 0):


TCustomListBox events

TCustomListBox	Alphabetically	Legend

In TCustomListBox

OnDrawItem

OnMeasureItem


TCustomListBox events

TCustomListBox	By object	Legend

OnDrawItem

OnMeasureItem


TCustomListBox::OnDrawItem

TCustomListBox	Events	See also

OnDrawItem occurs whenever an item in an owner-draw list box needs to be redisplayed.

Syntax

__property TDrawItemEvent OnDrawItem;

Description

Use OnDrawItem to write a handler for drawing of the items in list boxes with the Style values lbOwnerDrawFixed or lbOwnerDrawVariable. OnDrawItem occurs when the user selects an item or scrolls the list in an owner-draw list box, causing the item to be redrawn. OnDrawItem occurs only for owner-draw list boxes.

OnDrawItem is of type TDrawItemEvent and passes four parameters to its handler describing the item to be drawn:

•	ListBox, specifying a reference to the control containing the item.

•	Index, specifying the index of the item in that control.

•	Rect, specifying a rectangle in which to draw.

•	State, specifying the state of the item (selected, focused or disabled).

The size of the rectangle that contains the item is determined either by the ItemHeight property for fixed owner-drawlist boxes or by the response to the OnMeasureItem event for variable owner-draw list boxes.

The Index parameter is the position of the item in the list box.

Rect is the area in the list box where the item is to be drawn. The Rect parameter automatically provides the proper location of the item within the control’s canvas.

State is the current state of the item in the list box. The TOwnerDrawState type defines the possible values for the State parameter. The fololwing table lists these values::

Value	Meaning

odSelected	The item is selected.

odDisabled	The entire list box is disabled.

odFocused	The item currently has focus.

Example

Here is a typical handler for an OnDrawItem event. In the example, a list box with the lbOwnerDrawFixed style draws a bitmap to the left of each string.


TCustomListBox::OnMeasureItem

TCustomListBox	Events	See also

OnMeasureItem occurs whenever an application needs to redisplay an item in a variable height owner-draw list box.

Syntax

__property TMeasureItemEvent OnMeasureItem;

Description

Use OnMeasureItem to write a handler to measure items to be drawn in a list box with a Style property value of lbOwnerDrawVariable.

OnMeasureItem is of type TMeasureItemEvent which contains three parameters describing the item to measure:

•	Control, specifying the control containing the item.

•	Index, specifying the index of the item in the control.

•	Height, specifying the height of the item.

The Index parameter identifies the position of the item in the list box.

The Height parameter should specify the height in pixels that the given item will occupy in the control. The Height parameter is a var parameter, which initially contains the default height of the item or the height of the item text in the control’s font. The handler can set Height to a value appropriate to the contents of the item, such as the height of a graphical image to be displayed within the item.

After the OnMeasureItem event occurs, the OnDrawItem event occurs, rendering the item with the measured size.

Example

Here is a typical handler for an OnMeasureItem event. The example assumes that a variable owner-draw list box already has bitmaps associated with each of its strings. It sets the height of the item to the height of the associated bitmap if that height is greater than the default height.


TCustomListBox methods

TCustomListBox	Alphabetically	Legend

In TCustomListBox

~TCustomListBox

Clear

CreateParams

CreateWnd

DestroyWnd

DragCanceled

DrawItem

ItemAtPos

ItemRect

MeasureItem

TCustomListBox

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomListBox methods

TCustomListBox	By object	Legend

~TCustomListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragCanceled

DragDrop

Dragging

DrawItem

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MeasureItem

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomListBox

UpdateControlState

Update

WndProc


TCustomListBox::Clear

TCustomListBox	Methods	See also

Clear deletes all items from the list box.

Syntax

void __fastcall Clear(void);

Description

Use Clear to delete all of the items in the list box at once.

Although the items in a standard list box are, by default, of type TStrings, Clear allows the user to delete all of the items without referring to the item type. For example, the code to use the Clear method of the list box is simply:

rather than

which calls the item object’s Clear method and also clears the items.


TCustomListBox::CreateParams

TCustomListBox	Methods	See also

CreateParams initializes the window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

CreateParams is used to pass information, in its Params parameter, to CreateWindowHandle when the list box control is created. The list box CreateWnd method calls the inherited CreateWnd which passes this information in its call to CreateWindowHandle (a protected method inherited from TWinControl).

TCustomListBox overrides CreateParams to customize the representation of the window. It uses information from the list box Columns, ExtendedSelect, IntegralHeight, MultiSelect, Sorted and Style properties and sets WS_HSCROLL, WS_VSCROLL, LBS_HASSTRINGS and LBS_NOTIFY Windows styles for creation of the list box.

When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.

TCreateParams is the type of the Params parameter for CreateParams. It is a data structure holding information pertinent to creating a window handle. CreateWindowHandle processed he fields of the TCreateParams record to become the parameters for a call to the CreateWindowEx API function.


TCustomListBox::CreateWnd

TCustomListBox	Methods	See also

CreateWnd creates a Windows control corresponding to the list box component.

Syntax

virtual void __fastcall CreateWnd(void);

Description

CreateWnd is called automatically by CreateHandle (a protected method inherited from TWinControl). CreateWnd calls the inherited CreateWnd, which calls:

•	CreateParams to initialize the window-creation parameters.

•	CreateWindowHandle to create the window handle for the control.

TCustomListBox CreateWnd additionally sets up the list box position, tabs, items, and columns.


TCustomListBox::DestroyWnd

TCustomListBox	Methods	See also

DestroyWnd saves the list box Items in a string list before calling the inherited DestroyWnd.

Syntax

virtual void __fastcall DestroyWnd(void);

Description

DestroyWnd saves the list box text string items, in the Items property, to internal storage in a TStringList object that it creates. Then it calls the inherited DestroyWnd to destroy the windowed control’s window handle and free associated device contexts.


TCustomListBox::DragCanceled

TCustomListBox	Methods	See also

DragCanceled sends a mouse message cancelling the drag-and-drop opertation.

Syntax

virtual void __fastcall DragCanceled(void);

Description

DragCanceled is called in response to the cancellation of a drag-and-drop operation that had started. Users can cancel the operation by dropping the item over a component that does not accept the item, or by pressing Esc while dragging.

Borland C++ Builder calls the DragCanceled method before invoking the OnEndDrag event.


TCustomListBox::DrawItem

TCustomListBox	Methods	See also

DrawItem is the implementation method for the OnDrawItem event of owner-draw list boxes.

Syntax

virtual void __fastcall DrawItem(System::Integer Index, const Windows::TRect &Rect,  TOwnerDrawState

Description

DrawItem is called whenever a visual aspect of an owner-draw list box changes. The list box calls DrawItem for each visible item in its list, passing the index of the item in the Index parameter.

By default, the DrawItem method for a list box calls any event handler attached to the component's OnDrawItem event. If there is no handler attached, DrawItem fills the rectangle passed in Rect and draws any text associated with the indexed item. The default drawing ignores the State parameter, although State is passed along to attached event handlers.


TCustomListBox::ItemAtPos

TCustomListBox	Methods	See also

ItemAtPos returns the index of the list box item indicated by the coordinates of a point on the control.

Syntax

System::Integer __fastcall ItemAtPos(const Windows::TPoint &Pos, System::Boolean Existing);

Description

Use ItemAtPos to detect if an item exists at a particular point in the control.

The Pos parameter is the point in the control in window coordinates. If Pos is beyond the last item in the list box, the value of the Existing variable determines the returned value. If Existing is set to true, ItemAtPos returns -1, indicating that no item exists at that point. If Existing is set to false, ItemAtPos returns the index of the last item in the list box plus one.


TCustomListBox::ItemRect

TCustomListBox	Methods	See also

ItemRect returns the rectangle that surrounds the item specified in the Item parameter.

Syntax

Windows::TRect __fastcall ItemRect(System::Integer Index);

Description

Use ItemRect to get the coordinants of a particular item in the list box. For example, ItemRect is used internally by the ItemAtPos method.

The Item parameter is the ItemIndex of the item whose position is queried.


TCustomListBox::MeasureItem

TCustomListBox	Methods	See also

MeasureItem is the implementation method for the OnMeasureItem event for an owner-draw list box.

Syntax

virtual void __fastcall MeasureItem(System::Integer Index, System::Integer &Height);

Description

MeasureItem is called whenever a visual aspect of a variable owner-draw list box, with the csOwnerDrawVariable Style set, changes.

Before drawing its items , a variable owner-draw list box calls MeasureItem once for each visible item, passing the index of the item to measure, and the default height of the item. Since Height is a var parameter, MeasureItem can increase or reduce the height of each item as needed.

By default the MeasureItem method does nothing except call any event handler attached to the OnMeasureItem event. Override MeasureItem to change or add functionality to the default behavior.


TCustomListBox::WndProc

TCustomListBox	Methods	See also

WndProc provides some additional behavior for auto drag before calling the inherited method.

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc overrides the inherited WndProc to provide specialized responses to messages that allows the list box to handle auto drag mode itself. Then it calls the inherited WndProc to handle all other messages.

When overriding the WndProc method, be sure to call the inherited WndProc at the end to dispatch any other messages.


TCustomListBox class


TCustomListBox::TCustomListBox

TCustomListBox	Methods	See also

TCustomListBox creates a new TCustomListBox object.

Syntax

__fastcall virtual TCustomListBox(Classes::TComponent *AOwner);

Description

Use TCustomListBox to create a new TCustomListBox object.


TCustomListBox::~TCustomListBox

TCustomListBox	Methods	See also

~TCustomListBox frees the memory associated with the TCustomListBox object.

Syntax

__fastcall virtual ~TCustomListBox(void);

Description

Do not call ~TCustomListBox directly. Instead, use the delete keyword on the object, which causes ~TCustomListBox to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomListBox example

TCustomListBox


TCustomListView

Hierarchy	Properties	Methods	Events

The TCustomListView component is the abstract base type for all list-view components, including TListView.

Header

vcl/comctrls.hpp

Overview

Most of the properties, methods, and events defined in TCustomListView are protected so that you can choose whether to publish them in your own list-view components. TListView publishes nearly all of then, so you can find their explanations in the VCL reference for TListView.


TCustomListView properties

TCustomListView	Alphabetically	Legend

In TCustomListView

AllocBy

BorderStyle

BoundingRect

Column

ColumnClick

Columns

DropTarget

HideSelection

IconOptions

ItemFocused

Items

LargeImages

MultiSelect

ReadOnly

SelCount

Selected

ShowColumnHeaders

SmallImages

SortType

StateImages

TopItem

ViewOrigin

ViewStyle

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomListView properties

TCustomListView	By object	Legend

Align

AllocBy

BorderStyle

BoundingRect

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColumnClick

Columns

Column

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DropTarget

Enabled

Handle

Height

HelpContext

HideSelection

Hint

IconOptions

ItemFocused

Items

LargeImages

Left

MultiSelect

Name

Owner

Parent

ReadOnly

SelCount

Selected

ShowColumnHeaders

ShowHint

Showing

SmallImages

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

ViewOrigin

ViewStyle

VisibleRowCount

Visible

Width


TCustomListView::AllocBy

TCustomListView	Properties

Syntax

__property System::Integer AllocBy;


TCustomListView::BorderStyle

TCustomListView	Properties

Syntax

__property Forms::TBorderStyle BorderStyle;


TCustomListView::ColumnClick

TCustomListView	Properties

Syntax

__property System::Boolean ColumnClick;


TCustomListView::Columns

TCustomListView	Properties

Syntax

__property TListColumns * Columns;


TCustomListView::HideSelection

TCustomListView	Properties

Syntax

__property System::Boolean HideSelection;


TCustomListView::IconOptions

TCustomListView	Properties

Syntax

__property TIconOptions * IconOptions;


TCustomListView::Items

TCustomListView	Properties

Syntax

__property TListItems * Items;


TCustomListView::LargeImages

TCustomListView	Properties

Syntax

__property Controls::TImageList * LargeImages;


TCustomListView::MultiSelect

TCustomListView	Properties

Syntax

__property System::Boolean MultiSelect;


TCustomListView::ReadOnly

TCustomListView	Properties

Syntax

__property System::Boolean ReadOnly;


TCustomListView::ShowColumnHeaders

TCustomListView	Properties

Syntax

__property System::Boolean ShowColumnHeaders;


TCustomListView::SmallImages

TCustomListView	Properties

Syntax

__property Controls::TImageList * SmallImages;


TCustomListView::SortType

TCustomListView	Properties

Syntax

__property TSortType SortType;


TCustomListView::StateImages

TCustomListView	Properties

Syntax

__property Controls::TImageList * StateImages;


TCustomListView::ViewStyle

TCustomListView	Properties

Syntax

__property TViewStyle ViewStyle;


TCustomListView events

TCustomListView	Alphabetically	Legend

In TCustomListView

OnChange

OnChanging

OnColumnClick

OnCompare

OnDeletion

OnEdited

OnEditing

OnInsert


TCustomListView events

TCustomListView	By object	Legend

OnChange

OnChanging

OnColumnClick

OnCompare

OnDeletion

OnEdited

OnEditing

OnInsert


TCustomListView::OnChange

TCustomListView	Events

Syntax

__property TLVChangeEvent OnChange;


TCustomListView::OnChanging

TCustomListView	Events

Syntax

__property TLVChangingEvent OnChanging;


TCustomListView::OnColumnClick

TCustomListView	Events

Syntax

__property TLVColumnClickEvent OnColumnClick;


TCustomListView::OnCompare

TCustomListView	Events

Syntax

__property TLVCompareEvent OnCompare;


TCustomListView::OnDeletion

TCustomListView	Events

Syntax

__property TLVDeletedEvent OnDeletion;


TCustomListView::OnEdited

TCustomListView	Events

Syntax

__property TLVEditedEvent OnEdited;


TCustomListView::OnEditing

TCustomListView	Events

Syntax

__property TLVEditingEvent OnEditing;


TCustomListView::OnInsert

TCustomListView	Events

Syntax

__property TLVDeletedEvent OnInsert;


TCustomListView methods

TCustomListView	Alphabetically	Legend

In TCustomListView

~TCustomListView

AlphaSort

Arrange

CanChange

CanEdit

Change

ColClick

ColumnsShowing

CreateListItem

CreateParams

CreateWnd

CustomSort

Delete

DestroyWnd

DoEndDrag

DoStartDrag

Edit

FindCaption

FindData

GetDragImages

GetItemAt

GetItemIndex

GetNearestItem

GetNextItem

GetSearchString

IsEditing

Notification

Scroll

StringWidth

TCustomListView

UpdateColumn

UpdateColumns

UpdateItems

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomListView methods

TCustomListView	By object	Legend

~TCustomListView

AlphaSort

Arrange

Assign

BeginDrag

BringToFront

Broadcast

CanChange

CanEdit

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColClick

ColumnsShowing

ContainsControl

ControlAtPos

CreateListItem

CreateParams

CreateWnd

CustomSort

DefaultHandler

Delete

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DoEndDrag

DoStartDrag

DragDrop

Dragging

Edit

EnableAlign

EndDrag

FieldAddress

FindCaption

FindComponent

FindData

Focused

FreeInstance

FreeNotification

Free

GetDragImages

GetItemAt

GetItemIndex

GetNearestItem

GetNextItem

GetParentComponent

GetSearchString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

MethodAddress

MethodName

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

Scroll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StringWidth

TCustomListView

UpdateColumns

UpdateColumn

UpdateControlState

UpdateItems

Update

WndProc


TCustomListView::CanChange

TCustomListView	Methods

Syntax

virtual System::Boolean __fastcall CanChange(TListItem *Item, System::Integer Change);


TCustomListView::CanEdit

TCustomListView	Methods

Syntax

virtual System::Boolean __fastcall CanEdit(TListItem *Item);


TCustomListView::Change

TCustomListView	Methods

Syntax

virtual System::Boolean __fastcall CanChange(TListItem *Item, System::Integer Change);


TCustomListView::ColClick

TCustomListView	Methods

Syntax

virtual void __fastcall ColClick(TListColumn *Column);


TCustomListView::ColumnsShowing

TCustomListView	Methods

Syntax

System::Boolean __fastcall ColumnsShowing(void);


TCustomListView::CreateListItem

TCustomListView	Methods

Syntax

virtual TListItem *__fastcall CreateListItem(void);


TCustomListView::CreateParams

TCustomListView	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomListView::CreateWnd

TCustomListView	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomListView::Delete

TCustomListView	Methods

Syntax

virtual void __fastcall Delete(TListItem *Item);


TCustomListView::DestroyWnd

TCustomListView	Methods

Syntax

virtual void __fastcall DestroyWnd(void);


TCustomListView::DoEndDrag

TCustomListView	Methods

Syntax

virtual void __fastcall DoEndDrag(System::TObject *Target, System::Integer X, System::Integer Y);


TCustomListView::DoStartDrag

TCustomListView	Methods

Syntax

virtual void __fastcall DoStartDrag(Controls::TDragObject *&DragObject);


TCustomListView::Edit

TCustomListView	Methods

Syntax

virtual void __fastcall Edit(const Commctrl::TLVItemA &Item);


TCustomListView::GetDragImages

TCustomListView	Methods

Syntax

virtual Controls::TCustomImageList *__fastcall GetDragImages(void);


TCustomListView::GetItemIndex

TCustomListView	Methods

Syntax

System::Integer __fastcall GetItemIndex(TListItem *Value);


TCustomListView::Notification

TCustomListView	Methods

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation


TCustomListView::UpdateColumn

TCustomListView	Methods

Syntax

void __fastcall UpdateColumn(System::Integer Index);


TCustomListView::UpdateColumns

TCustomListView	Methods

Syntax

void __fastcall UpdateColumns(void);


TCustomListView::WndProc

TCustomListView	Methods

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);


TCustomListView::TCustomListView

TCustomListView	Methods	See also

TCustomListView creates a new TCustomListView object.

Syntax

__fastcall virtual TCustomListView(Classes::TComponent *AOwner);

Description

Use TCustomListView to create a new TCustomListView object.


TCustomListView::~TCustomListView

TCustomListView	Methods	See also

~TCustomListView frees the memory associated with the TCustomListView object.

Syntax

__fastcall virtual ~TCustomListView(void);

Description

Do not call ~TCustomListView directly. Instead, use the delete keyword on the object, which causes ~TCustomListView to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomListView example

TCustomListView


TCustomMaskEdit

Hierarchy	Properties	Methods	See also

The TCustomMaskEdit component is the abstract base type for edit controls that provide a mask for checking the validity of text typed into the control.

Header

vcl/mask.hpp

Description

TCustomMaskEdit introduces new properties and methods to expand the capabilities of TCustomEdit for validity checking using an edit mask. To an edit control that takes advantage of the masking capabilities of TCustomMaskEdit, use a TMaskEdit object. To create an edit control that does not validate the input, use a TEdit object instead.

Do not create instances of TCustomMaskEdit. Use TCustomMaskEdit as a base class when declaring control objects that implement a masked edit control. Properties and methods of TCustomMaskEdit provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomMaskEdit properties

TCustomMaskEdit	Alphabetically	Legend

In TCustomMaskEdit

EditMask

EditText

IsMasked

MaskState

MaxLength

Text

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomMaskEdit properties

TCustomMaskEdit	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

EditMask

EditText

Enabled

Handle

Height

HelpContext

Hint

IsMasked

Left

MaskState

MaxLength

Modified

Name

Owner

Parent

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TCustomMaskEdit::EditMask

TCustomMaskEdit	Properties	See also

EditMask is the mask that represents what text is valid for the masked edit control.

Syntax

__property System::AnsiString EditMask;

Description

Use EditMask to restrict the characters a user can enter into the masked edit control to valid characters and formats. If the user attempts to enter a character that is not valid, the edit control does not accept the character. Validation is performed on a character-by-character basis by the ValidateEdit method.

A mask consists of three fields with semicolons separating the fields. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are saved as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

      !	If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.

     >	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

     <	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

     <>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

     \	The character that follows a \ character is a literal character. Use this character when you want to allow any of the mask special characters as a literal in the data.

     L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

     l	The l character permits only an alphabetic character in this position, but doesn't require it.

     A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

     a	The a character permits an alphanumeric character in this position, but doesn't require it.

     C	The C character requires an arbitrary character in this position.

     c	The c character permits an arbitrary character in this position, but doesn't require it.

     0	The 0 character requires a numeric character only in this position.

     9	The 9 character permits a numeric character in this position, but doesn't require it.

     #	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

     :	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of :.

     /	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of /.

     ;	The ; character is used to separate the three fields of the mask.

     _	the _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters must be matched exactly in the edit control. They are inserted automatically, and the cursor skips over them during editing. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask should be included as part of the text for the edit control. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Text property for the edit control would consist of the 10 digits that were entered, rather than the 14 characters that make up the telephone number as it appears in the edit control.

A 0 in the second field indicates that literals should not be included, any other character indicates that they should be included. The character to indicate whether literals should be included can be changed in the EditMask property editor, or programatically by changing the MaskNoSave typed contstant.

The third field of the mask is the character that appears in the edit control for blanks (characters that have not been entered). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in an edit window. However, when a user edits the text in a masked edit control, the cursor selects each blank character in turn, and skips over the space character.

Setting EditMask to an empty string removes the mask.


TCustomMaskEdit::EditText

TCustomMaskEdit	Properties	See also

EditText is the text that appears in the window of the masked edit control.

Syntax

__property System::AnsiString EditText;

Description

EditText is the value of the text for the edit control after it has been formatted using the EditMask. Before the text has been fully entered into a masked edit control, the EditText includes a blank character for each unentered character. As characters are entered, the blank characters in the EditText are replaced by the values typed by the user.

If literal mask characters are included in the text, and no character is substituted for blanks, the values of EditText and Text are the same.

Note

EditText only applies at run-time.


TCustomMaskEdit::IsMasked

TCustomMaskEdit	Properties	See also

IsMasked indicates whether a mask exists for the edit control.

Syntax

__property System::Boolean IsMasked;

Description

Read IsMasked to determine whether the EditMask property has been set. If IsMasked is true, the control has a mask, and input will be validated at run-time. If IsMasked is false, the control does not restrict editing at run-time.


TCustomMaskEdit::MaskState

TCustomMaskEdit	Properties	See also

MaskState indicates state information about how the mask is being applied.

Syntax

__property TMaskedState MaskState;

Description

MaskState is used internally to determine appropriate actions based on how the the mask is currently being applied. MaskState is a set from among the following values:

Value	Meaning

msMasked	A mask has been assigned. MaskState includes msMasked when IsMasked is true.

msReEnter	An invalid character has been rejected and the next edit should be a valid replacement character.

msDBSetText	The text comes from a database field and should not be validated.

MaskState is exposed as a protected property so that derived classes can maintain and use this state information in the implementation of properties and methods.


TCustomMaskEdit::MaxLength

TCustomMaskEdit	Properties	See also

MaxLength specifies the maximum number of characters that can appear in the edit control.

Syntax

__property System::Integer MaxLength;

Description

MaxLength is the length of the EditText. Set MaxLength to limit the number of characters that can appear in the edit control when there is no EditMask. If there is an EditMask, MaxLength is implied by the mask itself, and cannot be changed. The EditText will contain blank characters for every character that has not been entered, with padding at the end or beginning of every optional section, so it is always constant in length.


TCustomMaskEdit::Text

TCustomMaskEdit	Properties	See also

Text is the underlying text for the masked edit control before the mask has been applied.

Syntax

__property System::AnsiString Text;

Description

Use Text to determine the underlying value of the text before it has been formatted by the mask. Text may differ from the EditText that appears in the edit window in that it will not contain the blank characters, spaces will not be replaced by _, and literal characters from the mask may have been removed. When setting Text, the value of the text is formatted using the mask, and the resulting EditText is used to update the window.

If there is no mask, Text is the text that appears in the edit window.


TCustomMaskEdit methods

TCustomMaskEdit	Alphabetically	Legend

In TCustomMaskEdit

~TCustomMaskEdit

CheckCursor

Clear

EditCanModify

GetFirstEditChar

GetLastEditChar

GetMaxChars

GetNextEditChar

GetPriorEditChar

GetSel

GetTextLen

KeyDown

KeyPress

KeyUp

ReformatText

Reset

SetCursor

SetSel

TCustomMaskEdit

ValidateEdit

ValidateError

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMaskEdit methods

TCustomMaskEdit	By object	Legend

~TCustomMaskEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CheckCursor

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditCanModify

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetFirstEditChar

GetLastEditChar

GetMaxChars

GetNextEditChar

GetParentComponent

GetPriorEditChar

GetSel

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

KeyUp

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

ReformatText

Refresh

RemoveComponent

RemoveControl

Repaint

Reset

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetCursor

SetFocus

SetSel

SetSelTextBuf

SetTextBuf

Show

TCustomMaskEdit

UpdateControlState

Update

ValidateEdit

ValidateError


TCustomMaskEdit::CheckCursor

TCustomMaskEdit	Methods	See also

CheckCursor moves the cursor to the closest editable character and selects that character when there is not already a selection.

Syntax

void __fastcall CheckCursor(void);

Description

CheckCursor is called whenever the position of the cursor may have changed. It ensures that there is always a selected character, since editing a masked edit control is really a matter of replacing the blank characters in the mask.


TCustomMaskEdit::Clear

TCustomMaskEdit	Methods	See also

Clear sets the Text property to an empty string.

Syntax

void __fastcall Clear(void);

Description

Use Clear to remove all text that has been entered into the masked edit control. While Clear sets the value of Text to an empty string, it does not clear the EditMask. If there is a mask, EditText will not be empty, but will have all non-literal characters replaced by blanks.


TCustomMaskEdit::EditCanModify

TCustomMaskEdit	Methods	See also

EditCanModify permits the value of the Text to be edited by the user.

Syntax

virtual System::Boolean __fastcall EditCanModify(void);

Description

The EditCanModify method defined by TCustomMaskEdit always returns true, allowing the Text to be edited. EditCanModify exists primarily to provide an interface for a method that can conditionally disallow changes to the Text by returning false.


TCustomMaskEdit::GetFirstEditChar

TCustomMaskEdit	Methods	See also

GetFirstEditChar returns the index in the EditMask of the first non-literal character, where zero is the first character.

Syntax

System::Integer __fastcall GetFirstEditChar(void);

Description

Use GetFirstEditChar to find the first position of the EditMask where the user can modify the EditText. If there is no mask, GetFirstEditChar returns zero.

Use GetFirstEditChar as a starting point for programmatically processing all the non-literal characters in the EditText. Use GetNextEditChar to continue to loop through the editable characters in the EditText, and GetLastEditChar to determine when all non-literal characters have been processed.


TCustomMaskEdit::GetLastEditChar

TCustomMaskEdit	Methods	See also

GetLastEditChar returns the index in the EditMask of the last non-literal character, where zero is the first character.

Syntax

System::Integer __fastcall GetLastEditChar(void);

Description

Use GetLastEditChar to find the last position of the EditMask where the user can modify the EditText. If there is no mask, GetLastEditChar returns the length of the text.


TCustomMaskEdit::GetMaxChars

TCustomMaskEdit	Methods	See also

GetMaxChars returns the length of the EditText.

Syntax

System::Integer __fastcall GetMaxChars(void);

Description

If there is a mask, GetMaxChars returns the length of the EditText, including all blanks. This is the same as MaxLength, since editing in a masked edit control consists of replacing non-literal characters. If there is no mask, GetMaxChars returns the length of the text in the window. In this case, the value returned by GetMaxChars may be less than MaxLength, which is the maximum number of characters that may be entered into the edit window.


TCustomMaskEdit::GetNextEditChar

TCustomMaskEdit	Methods	See also

GetNextEditChar returns the first index of a non-literal character equal to or greater than Offset, where zero is the first character.

Syntax

System::Integer __fastcall GetNextEditChar(System::Integer Offset);

Description

Use GetNextEditChar to find the first position of the EditMask at or following Offset, where the user can modify the EditText. If there is no non-literal character at or following Offset, GetNextEditChar returns MaxLength.

Use GetNextEditChar to loop through the editable characters in the EditText, starting with the value returned by GetFirstEditChar and using GetLastEditChar to determine when all non-literal characters have been processed.


TCustomMaskEdit::GetPriorEditChar

TCustomMaskEdit	Methods	See also

GetPriorEditChar returns the first index of a non-literal character equal to or less than Offset, where zero is the first character.

Syntax

System::Integer __fastcall GetPriorEditChar(System::Integer Offset);

Description

Use GetPriorEditChar to find the first position of the EditMask at or preceding Offset, where the user can modify the EditText. If there is no non-literal character at or preceding Offset, GetPriorEditChar returns the index of the first editable character following Offset.


TCustomMaskEdit::GetSel

TCustomMaskEdit	Methods	See also

GetSel returns the endpoints of the current selection in the EditText.

Syntax

void __fastcall GetSel(System::Integer &SelStart, System::Integer &SelStop);

Description

Use GetSel to obtain the indexes of the first and last selected characters of the EditText, where 0 is the index of the first character. Not all the characters in the selection may be editable, if the mask contains literal characters. Do not use the resulting indexes on the Text property if there is a mask, as the EditText may contain blanks or non-literal characters not found in the Text.

To programmatically change the selected text, use GetNextEditChar to cycle through the editable characters of the selection from SelStart to SelStop.


TCustomMaskEdit::GetTextLen

TCustomMaskEdit	Methods	See also

GetTextLen returns the length of the underlying text.

Syntax

System::Integer __fastcall GetTextLen(void);

Description

Use GetTextLen to determine the length of the underlying text for the masked edit control. The underlying text has not been formatted for display by the mask, and may differ from the EditText that appears in the window.


TCustomMaskEdit::KeyDown

TCustomMaskEdit	Methods	See also

KeyDown supplements the inherited KeyDown to process navigation keys and the Del key.

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);

Description

After calling the inherited KeyDown, KeyDown ensures that moving the cursor within the masked edit control lands the cursor on an editable character, and that deleting the current selection replaces non-literal characters with blanks. Derived objects can override this method to further supplement the processing that takes place when the user presses a key down.


TCustomMaskEdit::KeyPress

TCustomMaskEdit	Methods	See also

KeyPress supplements the inherited method to process the Escape and Enter keys.

Syntax

virtual void __fastcall KeyPress(System::Char &Key);

Description

After calling the inherited KeyPress, KeyPress calls the Reset method in response to the Escape key, or calls the ValidateEdit method in response to the Enter key. Derived classes can override this method to further supplement the processing of specific keystrokes.


TCustomMaskEdit::KeyUp

TCustomMaskEdit	Methods	See also

KeyUp supplements the inherited method to process the Ctrl+Left and Ctrl+Right key combinations.

Syntax

virtual void __fastcall KeyUp(System::Word &Key,  Classes::TShiftState Shift);

Description

After calling the inherited KeyUp, KeyUp makes sure that selection using the Ctrl+Left and Ctrl+Right key combinations ends with an editable selection in the edit window. Derived classes can override this method to further supplement the processing that takes place when the user lets a key up.


TCustomMaskEdit::ReformatText

TCustomMaskEdit	Methods	See also

ReformatText applies the mask NewMask to the underlying text, and updates the internal representation of the mask.

Syntax

void __fastcall ReformatText(const System::AnsiString NewMask);

Description

ReformatText does the bulk of the work of setting the EditMask property at run-time. ReformatText should not be used in place of the EditMask property, however, as it does not deal with the MaskState property or the positioning of the cursor.


TCustomMaskEdit::Reset

TCustomMaskEdit	Methods	See also

Reset returns the EditText to its value at the time when the edit control last lost focus.

Syntax

virtual void __fastcall Reset(void);

Description

Reset cancels out of the most recent edits to the masked edit control. The EditText returns to the value at the time the control last lost focus, not the time when it first regained focus. Thus, Any changes to the EditText that occurred programmatically while the edit control did not have focus will also be thrown away.


TCustomMaskEdit::SetCursor

TCustomMaskEdit	Methods	See also

SetCursor moves the cursor to the first editable character at or before Pos, and selects that character.

Syntax

void __fastcall SetCursor(System::Integer Pos);

Description

SetCursor handles positioning of the cursor in the edit window so that it is always on an editable character. It also ensures that there is always at least one character selected, since editing a masked edit control really consists of replacing the non-literal characters.


TCustomMaskEdit::SetSel

TCustomMaskEdit	Methods	See also

SetSel selects characters in the EditText from SelStart to SelStop.

Syntax

void __fastcall SetSel(System::Integer SelStart, System::Integer SelStop);

Description

SetSel selects the indicated range of characters in the EditText, regardless of whether any of them are editable. If SelStart is the same as SelStop, SetSel positions the cursor at the SelStart character. When using SetSel, take care that the cursor is left in an editable position if the selection is to remain for the user to replace. When using SetSel to create a selection for capturing a portion of the EditText, either through the SelText property or by copying to the Clipboard, return the cursor to an editable postion afterwards, by calling CheckCursor.


TCustomMaskEdit::ValidateEdit

TCustomMaskEdit	Methods	See also

ValidateEdit attempts to validate the EditText against the current mask.

Syntax

void __fastcall ValidateEdit(void);

Description

ValidateEdit attempts to validate the EditText after each keystroke, and when the user attempts to leave the masked edit field. If the EditText does not match the specifications of the EditMask, ValidateEdit calls ValidateError to raise an exception, and returns the cursor to the first position where the EditText did not comply with the EditMask.


TCustomMaskEdit::ValidateError

TCustomMaskEdit	Methods	See also

ValidateError beeps and raises an EDBEditError exception.

Syntax

void __fastcall ValidateError(void);

Description

ValidateEdit calls ValidateError when the EditText fails to comply with the EditMask.


TCustomMaskEdit::TCustomMaskEdit

TCustomMaskEdit	Methods	See also

TCustomMaskEdit creates a new TCustomMaskEdit object.

Syntax

__fastcall virtual TCustomMaskEdit(Classes::TComponent *AOwner);

Description

Use TCustomMaskEdit to create a new TCustomMaskEdit object.


TCustomMaskEdit::~TCustomMaskEdit

TCustomMaskEdit	Methods	See also

~TCustomMaskEdit frees the memory associated with the TCustomMaskEdit object.

Syntax

__fastcall virtual ~TCustomMaskEdit(void);

Description

Do not call ~TCustomMaskEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomMaskEdit to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TCustomMaskEdit example

TCustomMaskEdit


TCustomMemo

Hierarchy	Properties	Methods	See also

The TCustomMemo component is the abstract base type for memo components, which are multiline edit boxes, including TMemo and TDBMemo.

Header

vcl/stdctrls.hpp

Description

TCustomMemo introduces new properties and methods to expand the capabilities of TCustomEdit for handling multiline edit boxes.

Do not create instances of TCustomMemo. Use TCustomMemo as a base class when declaring control objects that impelement a multiline edit control. Properties and methods of TCustomMemo provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomMemo properties

TCustomMemo	Alphabetically	Legend

In TCustomMemo

Alignment

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomMemo properties

TCustomMemo	By object	Legend

Alignment

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Lines

Modified

Name

Owner

Parent

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantReturns

WantTabs

Width

WordWrap


TCustomMemo::Alignment

TCustomMemo	Properties	See also

Alignment determines how the text is aligned within the edit control.

Syntax

__property Classes::TAlignment Alignment;

Description

Use Alignment to align the text within the edit control. Alignment can take one of the following values:

Value	Meaning

taLeftJustify	Align text to the left side of the control

taCenter	Center text horizontally in the control.

taRightJustify	Align text to the right side of the control.


TCustomMemo::Lines

TCustomMemo	Properties	See also

Lines contains the individual lines of text in the edit control.

Syntax

__property Classes::TStrings * Lines;

Description

Use Lines to manipulate the text in the edit control on a line by line basis. Lines is a TStrings object, and so the TStrings methods may be used for Lines to perform such manipulations as counting the lines of text, adding new lines, deleting lines, or replacing lines with new text.

To work with the text as one chunk, use the Text property. To manipulate individual lines of text, the Lines property will work better.


TCustomMemo::ScrollBars

TCustomMemo	Properties	See also

ScrollBars determines whether the edit control has any scroll bars.

Syntax

__property TScrollStyle ScrollBars;

Description

Use ScrollBars to give a multiline edit control horizontal or vertical scroll bars. ScrollBars can take one of the following values::

Value	Meaning

ssNone	The control has no scroll bars.

ssHorizontal	The control has a single scroll bar on the bottom edge.

ssVertical	The control has a single scroll bar on the right edge.

ssBoth	The control has a scroll bar on both the bottom and right edges.


TCustomMemo::WantReturns

TCustomMemo	Properties	See also

WantReturns determines whether the user can insert return characters into the text.

Syntax

__property System::Boolean WantReturns;

Description

Set WantReturns to true to allow users to enter return characters into the text. Set WantReturns to false if you want the return character to go to the form instead. For example, if there is a default button on the form, pressing Enter would choose the button if WantReturns is false. Pressing Enter would add a return character into the text if WantReturns is true.

Note

If WantReturns is false, users can still enter return characters into the text by pressing Ctrl+Enter.


TCustomMemo::WantTabs

TCustomMemo	Properties	See also

WantTabs determines whether the user can insert tab characters into the text.

Syntax

__property System::Boolean WantTabs;

Description

Set WantTabs to true to allow users to enter tab characters into the text. Set WantTabs to false if you want the tab character to select to the next control on the form instead.

Note

If WantTabs is true, users can tab into the edit control, but they can’t tab out.


TCustomMemo::WordWrap

TCustomMemo	Properties	See also

WordWrap determines whether the edit control inserts soft carriage returns so that the text wraps at the right margin.

Syntax

__property System::Boolean WordWrap;

Description

Set WordWrap to true if you want the edit control to wrap the text at the right margin so that it fits into the client area. The wrapping is cosmetic only -- the text does not include any return characters that were not explicitly entered. Set WordWrap to false if you want the edit control to show a separate line only where return characters were explicitly entered into the text.

Note

There should be no use for a horizontal scroll bar if WordWrap is true.


TCustomMemo methods

TCustomMemo	Alphabetically	Legend

In TCustomMemo

~TCustomMemo

CreateParams

CreateWindowHandle

KeyPress

Loaded

SetAlignment

SetLines

SetScrollBars

SetWordWrap

TCustomMemo

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMemo methods

TCustomMemo	By object	Legend

~TCustomMemo

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CreateWindowHandle

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyPress

Loaded

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetAlignment

SetBounds

SetFocus

SetLines

SetScrollBars

SetSelTextBuf

SetTextBuf

SetWordWrap

Show

TCustomMemo

UpdateControlState

Update


TCustomMemo::CreateParams

TCustomMemo	Methods	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomEdit overrides the inherited method to specify a scrollable multiline edit control that reflects the current values of the Alignment, ScrollBars, and WordWrap properties, in addition to the BorderStyle, HideSelections, PasswordChar, and ReadOnly properties that the inherited method implements.


TCustomMemo::CreateWindowHandle

TCustomMemo	Methods	See also

CreateWindowHandle creates a window handle for the edit control.

Syntax

virtual void __fastcall CreateWindowHandle(const Controls::TCreateParams &Params);

Description

CreateWindowHandle overrides the inherited method so as to interpret the Caption in Params as the initial text rather than as a Window caption.


TCustomMemo::KeyPress

TCustomMemo	Methods	See also

KeyPress overrides the default method to ensure that return characters are not entered into the text when WantReturns is false.

Syntax

virtual void __fastcall KeyPress(System::Char &Key);

Description

After calling the inherited KeyPress, which calls the OnKeyPress event handler, KeyPress throws away return characters when WantReturns is false.


TCustomMemo::Loaded

TCustomMemo	Methods

Loaded initializes the Modified property to false after calling the inherited method.

Syntax

virtual void __fastcall Loaded(void);

Description

Loaded overrides the default so that the Modified property will be set to false after loading the text from a stream. Derived classes can override the Loaded method to perform additional initializations after all the parts of the control have been loaded from a stream.


TCustomMemo::SetAlignment

TCustomMemo	Methods	See also

SetAlignment sets the Alignment property.

Syntax

void __fastcall SetAlignment(Classes::TAlignment Value);

Description

SetAlignment is exposed as a protected method so that derived classes can customize their implementation of the Alignment property.


TCustomMemo::SetLines

TCustomMemo	Methods	See also

SetLines sets the Lines property.

Syntax

void __fastcall SetLines(Classes::TStrings *Value);

Description

SetLines is exposed as a protected method so that derived classes can customize their implementation of the Lines property.


TCustomMemo::SetScrollBars

TCustomMemo	Methods	See also

SetScrollBars sets the ScrollBars property.

Syntax

void __fastcall SetScrollBars(TScrollStyle Value);

Description

SetScrollBars is exposed as a protected method so that derived classes can customize their implementation of the ScrollBars property.


TCustomMemo::SetWordWrap

TCustomMemo	Methods	See also

SetWordWrap sets the WordWrap property.

Syntax

void __fastcall SetWordWrap(System::Boolean Value);

Description

SetWordWrap is exposed as a protected method so that derived classes can customize their implementation of the WordWrap property.


TCustomMemo::TCustomMemo

TCustomMemo	Methods	See also

TCustomMemo creates a new TCustomMemo object.

Syntax

__fastcall virtual TCustomMemo(Classes::TComponent *AOwner);

Description

Use TCustomMemo to create a new TCustomMemo object.


TCustomMemo::~TCustomMemo

TCustomMemo	Methods	See also

~TCustomMemo frees the memory associated with the TCustomMemo object.

Syntax

__fastcall virtual ~TCustomMemo(void);

Description

Do not call ~TCustomMemo directly. Instead, use the delete keyword on the object, which causes ~TCustomMemo to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TCustomMemo example

TCustomMemo


TCustomMemoryStream

Hierarchy	Properties	Methods	See also

TCustomMemoryStream is an abstract base class used as the common ancestor for memory streams.

Header

vcl/classes.hpp

Description

Use TCustomMemoryStream as a base class when defining a stream object that can transfer data that is stored in memory. Memory streams are useful for providing I/O access to data that is stored in a less accessible medium. Data can be moved to an internal memory buffer when the memory stream is created. After manipulating the data in a memory stream, the data can be written out to its actual storage medium when the memory stream is destroyed.

Do not instantiate an instance of TCustomMemoryStream. It is an abstract class that implements behavior common to all memory streams. To work with an instance of a memory stream, use one of the descendants of TCustomMemoryStream, such as TMemoryStream or TResourceStream.


TCustomMemoryStream properties

TCustomMemoryStream	Alphabetically	Legend

In TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TCustomMemoryStream properties

TCustomMemoryStream	By object	Legend

Memory

Position

Size


TCustomMemoryStream::Memory

TCustomMemoryStream	Properties	See also

Memory provides direct access to the memory pool allocated for the memory stream.

Syntax

__property System::Pointer Memory;

Description

Use Memory to get access to the memory for the stream. The memory for the stream holds the data that is being transfered by means of the memory stream. Size is the number of bytes of Memory that were allocated, and Position is the current position within Memory.

Note

Memory is a read-only property. Memory can be used to change the contents of the memory, but to set the actual memory the stream works with, descendants of TCustomMemoryStream must assign a pointer to a memory buffer by calling the SetPointer method.


TCustomMemoryStream methods

TCustomMemoryStream	Alphabetically	Legend

In TCustomMemoryStream

~TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

SetPointer

TCustomMemoryStream

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMemoryStream methods

TCustomMemoryStream	By object	Legend

~TCustomMemoryStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

SaveToFile

SaveToStream

Seek

SetPointer

TCustomMemoryStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TCustomMemoryStream::Read

TCustomMemoryStream	Methods	See also

Read reads up to Count bytes from the memory stream into Buffer, and advances the current position of the stream by the number of bytes read.

Syntax

virtual System::Longint __fastcall Read(void *Buffer, System::Longint Count);

Description

Use Read to read the contents of the memory stream into a buffer, starting at the current position. Read will read up to Count bytes from the current position in Memory. If Count bytes extends beyond the end of the memory buffer, Read will only transfer the data up to the end of the associated memory buffer. Read returns the number of bytes actually transferred to Buffer, and advances the current position accordingly. If the return value is less than Count, it means that reading reached the end of the stream data.

All the other data-reading methods of the memory stream (ReadBuffer, ReadComponent) call Read to do the actual reading.

Note

Read treats Count as an upper bound. The ReadBuffer method, by contrast, raises an exception if Count bytes cannot be read.


TCustomMemoryStream::SaveToFile

TCustomMemoryStream	Methods	See also

SaveToFile writes the entire contents of the memory stream to the file with a given file name.

Syntax

void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Use SaveToFile to write the contents of Memory to a file. SaveToFile allows an application to write out the contents of the memory stream without having to explicitly create and free a file stream object. If the named file cannot be created or opened, SaveToFile raises an EFCreateError exception.


TCustomMemoryStream::SaveToStream

TCustomMemoryStream	Methods	See also

SaveToStream writes the entire contents of the memory stream to the stream object specified by Stream.

Syntax

void __fastcall SaveToStream(TStream *Stream);

Description

Use SaveToStream to copy data that is stored in memory into another storage medium. SaveToStream writes the entire contents of Memory into the indicated stream object, starting at the current position in the stream that was passed as a parameter.

When the Stream parameter is a TFileStream object, SaveToStream does much the same thing as the SaveToFile method. However, SaveToStream writes to the current position in the target stream. Thus, for example, SaveToStream can be used to append the contents of Memory to a file stream, rather than replace the contents of the file the way SaveToFile does.

If the entire contents of the memory stream cannot be written to the target stream, SaveToStream raises an EWriteError exception.


TCustomMemoryStream::Seek

TCustomMemoryStream	Methods	See also

Seek moves the current position of the stream by Offset bytes, relative to the origin specified by Origin.

Syntax

virtual System::Longint __fastcall Seek(System::Longint Offset, System::Word Origin);

Description

Use Seek to move the current position within the memory stream by the indicated offset. Seek allows an application to read from or write to a particular location within the Memory associated with the memory stream.

If Offset is a negative number, the seek is backward from the specified origin. The following table shows the different values of Origin and their meanings for seeking.

Table 0.1

Value	Meaning

soFromBeginning	Offset is from the beginning of Memory. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of Memory. Offset must be <= 0 to indicate a number of bytes before the end of the memory buffer.

Seek returns the new value of the Position property.

Note

Seek does no error checking on the value provided for Offset. Do not call seek with an offset that would move the current position less than 0 (before the start of Memory) or greater than Size (beyond the end of the memory buffer).


TCustomMemoryStream::SetPointer

TCustomMemoryStream	Methods	See also

SetPointer replaces the memory buffer associated with the memory stream.

Syntax

void __fastcall SetPointer(System::Pointer Ptr, System::Longint Size);

Description

Use SetPointer to set the internal memory buffer, Memory, to be the value passed in by Ptr. Size is the number of bytes Ptr points to.

Descendants of TCustomMemoryStream should use SetPointer to associate the memory stream with the memory buffer that holds the data for the memory stream.

Note

SetPointer does not free the existing value of Memory, if any, when it replaces the memory buffer. Descendants of TCustomMemoryStream that use SetPointer to replace the stream’s memory pool should free the memory pointed to by the Memory property before calling SetPointer to replace the memory buffer.


TCustomMemoryStream::TCustomMemoryStream

TCustomMemoryStream	Methods	See also

TCustomMemoryStream creates a new TCustomMemoryStream object.

Syntax

__fastcall TCustomMemoryStream(void);

Description

Use TCustomMemoryStream to create a new TCustomMemoryStream object.


TCustomMemoryStream::~TCustomMemoryStream

TCustomMemoryStream	Methods	See also

~TCustomMemoryStream frees the memory associated with the TCustomMemoryStream object.

Syntax

__fastcall virtual ~TCustomMemoryStream(void);

Description

Do not call ~TCustomMemoryStream directly. Instead, use the delete keyword on the object, which causes ~TCustomMemoryStream to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TStream


TCustomMemoryStream example

TCustomMemoryStream


TCustomOutline

Hierarchy	Properties	Methods	Events

The TCustomOutline component is a special abstract grid component derived from TCustomGrid. TCustomOutline is the basis for useful grid components such as TOutline.

Header

vcl/outline.hpp

Overview

Most of the properties and methods defined in TCustomOutline are protected, so that you can choose whether to publish them in your own outline components. TOutline publishes nearly all of them, so you can find their explanations in the VCL reference for TOutline.

In addition to the items published in TOutline, TCustomOutline declares a number of protected implementation methods you might need to override in your outline components.


TCustomOutline properties

TCustomOutline	Alphabetically	Legend

In TCustomOutline

ItemCount

ItemHeight

Items

ItemSeparator

Lines

Options

OutlineStyle

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

SelectedItem

Style

Derived from TCustomGrid

Row

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomOutline properties

TCustomOutline	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

ItemCount

ItemHeight

ItemSeparator

Items

Left

Lines

Name

Options

OutlineStyle

Owner

Parent

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

Row

SelectedItem

ShowHint

Showing

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomOutline::ItemHeight

TCustomOutline	Properties

Syntax

__property System::Integer ItemHeight;


TCustomOutline::ItemSeparator

TCustomOutline	Properties

Syntax

__property System::AnsiString ItemSeparator;


TCustomOutline::Lines

TCustomOutline	Properties

Syntax

__property Classes::TStrings * Lines;


TCustomOutline::Options

TCustomOutline	Properties

Syntax

__property TOutlineOptions Options;


TCustomOutline::OutlineStyle

TCustomOutline	Properties

Syntax

__property TOutlineStyle OutlineStyle;


TCustomOutline::PictureClosed

TCustomOutline	Properties

Syntax

__property Graphics::TBitmap * PictureClosed;


TCustomOutline::PictureLeaf

TCustomOutline	Properties

Syntax

__property Graphics::TBitmap * PictureLeaf;


TCustomOutline::PictureMinus

TCustomOutline	Properties

Syntax

__property Graphics::TBitmap * PictureMinus;


TCustomOutline::PictureOpen

TCustomOutline	Properties

Syntax

__property Graphics::TBitmap * PictureOpen;


TCustomOutline::PicturePlus

TCustomOutline	Properties

Syntax

__property Graphics::TBitmap * PicturePlus;


TCustomOutline::Style

TCustomOutline	Properties

Syntax

__property TOutlineType Style;


TCustomOutline events

TCustomOutline	Alphabetically	Legend

In TCustomOutline

OnCollapse

OnDrawItem

OnExpand


TCustomOutline events

TCustomOutline	By object	Legend

OnCollapse

OnDrawItem

OnExpand


TCustomOutline::OnCollapse

TCustomOutline	Events

Syntax

__property EOutlineChange OnCollapse;


TCustomOutline::OnDrawItem

TCustomOutline	Events

Syntax

__property Stdctrls::TDrawItemEvent OnDrawItem;


TCustomOutline::OnExpand

TCustomOutline	Events

Syntax

__property EOutlineChange OnExpand;


TCustomOutline methods

TCustomOutline	Alphabetically	Legend

In TCustomOutline

~TCustomOutline

Add

AddChild

AddChildObject

AddObject

BadIndex

BeginUpdate

Clear

Click

Collapse

DblClick

DefineProperties

Delete

DeleteNode

DrawCell

EndUpdate

Expand

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetTextItem

GetVisibleNode

Insert

InsertObject

KeyDown

KeyPress

Loaded

LoadFromFile

LoadFromStream

MouseDown

Move

SaveToFile

SaveToStream

SetDisplayWidth

SetGoodIndex

SetLevel

SetUpdateState

TCustomOutline

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomOutline methods

TCustomOutline	By object	Legend

~TCustomOutline

AddChildObject

AddChild

AddObject

Add

Assign

BadIndex

BeginDrag

BeginUpdate

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Click

ClientToScreen

Collapse

ContainsControl

ControlAtPos

DblClick

DefaultHandler

DefineProperties

DeleteNode

Delete

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

DrawCell

EnableAlign

EndDrag

EndUpdate

Expand

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextItem

GetTextLen

GetVisibleNode

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InsertObject

Insert

InstanceSize

Invalidate

KeyDown

KeyPress

Loaded

LoadFromFile

LoadFromStream

MethodAddress

MethodName

MouseDown

Move

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetDisplayWidth

SetFocus

SetGoodIndex

SetLevel

SetTextBuf

SetUpdateState

Show

TCustomOutline

UpdateControlState

Update


TCustomOutline::BadIndex

TCustomOutline	Methods

Syntax

System::Boolean __fastcall BadIndex(TOutlineNode *Value);


TCustomOutline::Click

TCustomOutline	Methods

Syntax

virtual void __fastcall Click(void);


TCustomOutline::Collapse

TCustomOutline	Methods

Syntax

virtual void __fastcall Collapse(System::Longint Index);


TCustomOutline::DblClick

TCustomOutline	Methods

Syntax

virtual void __fastcall DblClick(void);


TCustomOutline::DefineProperties

TCustomOutline	Methods

Syntax

virtual void __fastcall DefineProperties(Classes::TFiler *Filer);


TCustomOutline::DeleteNode

TCustomOutline	Methods

Syntax

void __fastcall DeleteNode(TOutlineNode *Node, System::Longint CurIndex);


TCustomOutline::DrawCell

TCustomOutline	Methods

Syntax

virtual void __fastcall DrawCell(System::Longint ACol, System::Longint ARow, const Windows::TRect &ARect


TCustomOutline::Expand

TCustomOutline	Methods

Syntax

virtual void __fastcall Expand(System::Longint Index);


TCustomOutline::KeyDown

TCustomOutline	Methods

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);


TCustomOutline::KeyPress

TCustomOutline	Methods

Syntax

virtual void __fastcall KeyPress(System::Char &Key);


TCustomOutline::Loaded

TCustomOutline	Methods

Syntax

virtual void __fastcall Loaded(void);


TCustomOutline::MouseDown

TCustomOutline	Methods

Syntax

virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer


TCustomOutline::Move

TCustomOutline	Methods

Syntax

void __fastcall Move(System::Longint Destination, System::Longint Source, TAttachMode AttachMode);


TCustomOutline::SetDisplayWidth

TCustomOutline	Methods

Syntax

void __fastcall SetDisplayWidth(System::Integer Value);


TCustomOutline::SetGoodIndex

TCustomOutline	Methods

Syntax

TOutlineNode *__fastcall SetGoodIndex(TOutlineNode *Value);


TCustomOutline::SetLevel

TCustomOutline	Methods

Syntax

void __fastcall SetLevel(TOutlineNode *Node, System::Cardinal CurLevel, System::Cardinal NewLevel);


TCustomOutline::TCustomOutline

TCustomOutline	Methods	See also

TCustomOutline creates a new TCustomOutline object.

Syntax

__fastcall virtual TCustomOutline(Classes::TComponent *AOwner);

Description

Use TCustomOutline to create a new TCustomOutline object.


TCustomOutline::~TCustomOutline

TCustomOutline	Methods	See also

~TCustomOutline frees the memory associated with the TCustomOutline object.

Syntax

__fastcall virtual ~TCustomOutline(void);

Description

Do not call ~TCustomOutline directly. Instead, use the delete keyword on the object, which causes ~TCustomOutline to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TCustomOutline example

TCustomOutline


TCustomPanel

Hierarchy	Properties	Methods	Events	See also

The TCustomPanel component is the abstract base component type for all panel components in Borland C++ Builder.

Header

vcl/extctrls.hpp

Description

Panel components are controls that are intended to contain other controls, grouping them together. Derive windowed controls that are made up of subcontrols from TCustomPanel.

A panel can be aligned with the form using the Align property so that it maintains the same relative position to the form even when the form is resized. For example, a panel can be aligned so that it always remains on the top of the form no matter how much the user changes the shape and size of the form. This makes panels useful for implementing components that act like tool bars or status bars. For example, construct a tool bar or tool palette by adding speed buttons to a panel that execute commands or set modes in your application.


TCustomPanel properties

TCustomPanel	Alphabetically	Legend

In TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

FullRepaint

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomPanel properties

TCustomPanel	By object	Legend

Alignment

Align

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

FullRepaint

Handle

Height

HelpContext

Hint

Left

Locked

Name

Owner

ParentColor

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomPanel::Alignment

TCustomPanel	Properties	See also

The Alignment property determines how caption is aligned within the panel.

Syntax

__property Classes::TAlignment Alignment;

Description

Use the Alignment property to specify if the caption of a panel appears on the left, right, or center of the panel. For example, to use a panel as a status bar and assign the TApplication.Hint property to the panel’s Caption property, set Alignment to taLeftJustify to place the hint text on the left side of the panel.

These are the possible values:

Value	Meaning

taLeftJustify	Align text to the left side of the panel

taCenter	Center text horizontally in the panel

taRightJustify	Align text to the right side of the panel


TCustomPanel::BevelInner

TCustomPanel	Properties	See also

The BevelInner property determines the style of the inner bevel of a panel.

Syntax

__property TPanelBevel BevelInner;

Description

Use the BevelInner property to provide the panel with the desired three-dimensional bevelled look.

A panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel the number of pixels specified in the BorderWidth property. The width of the bevels, if they are drawn, is the BevelWidth property.

The BevelInner property determines the style of the inner bevel of a panel component. These are the possible values:

Value	Meaning

bvNone	No inner bevel exists.

bvLowered	The inner bevel is lowered.

bvRaised	The inner bevel is raised.


TCustomPanel::BevelOuter

TCustomPanel	Properties	See also

The BevelOuter property determines the style of the outer bevel of a panel.

Syntax

__property TPanelBevel BevelOuter;

Description

Use the BevelOuter property to provide the panel with the desired three-dimensional bevelled look.

A panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel by the number of pixels specified in the BorderWidth proprety. The width of the outer bevel is specified in the BevelWidth property in pixels.

These are the possible values:

Value	Meaning

bvNone	No outer bevel exists.

bvLowered	The outer bevel is lowered.

bvRaised	The outer bevel is raised.


TCustomPanel::BevelWidth

TCustomPanel	Properties	See also

The BevelWidth property determines the width in pixels of both the inner and the outer bevels of a panel.

Syntax

__property TBevelWidth BevelWidth;

Description

Use the BevelWidth to specify how wide the inner or outer bevel should be. Don’t confuse BevelWidth, which is the width of the bevels, with BorderWidth, which is the space between the bevels.

If both the BevelInner and BevelOuter properties are bvNone, BevelWidth has no effect. To remove both bevels, set the BevelInner and BevelOuter properties to bvNone, rather than setting the BevelWidth to 0, as this involves less overhead when painting.


TCustomPanel::BorderStyle

TCustomPanel	Properties	See also

The BorderStyle property determines the style of the line drawn around the perimeter of the panel control.

Syntax

__property Forms::TBorderStyle BorderStyle;

Description

Use the BorderStyle to specify that the panel have no line or have a single-line drawn around the panel. When BorderStyle is bsSingle, a single line is drawn around the panel outside of the outer bevel. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

Don’t confuse the line drawn around the panel with the BorderWidth of the panel. The BorderWidth of the panel is the distance between the outer and inner bevels.


TCustomPanel::BorderWidth

TCustomPanel	Properties	See also

The BorderWidth property determines the distance, in pixels, between the outer and inner bevels.

Syntax

__property TBorderWidth BorderWidth;

Description

Use the BorderWidth property to specify how wide the border around the panel should be in pixels. A value of 0 means no border should appear.

The border of a panel is the area between the outer and inner bevels. It is visible only if the inner bevel is raised or lowered, but affects the inset of the caption within the panel even if BevelInner is bvNone. If the Alignment property is not taCenter, the Caption will be aligned to the inner edge of the border. This is BorderWidth pixels in from the outer bevel if BevelInner is bvNone, or the inner edge of the inner bevel otherwise.

Don’t confuse the border of the panel with line drawn around the panel itself referenced by the BorderStyle property.


TCustomPanel::FullRepaint

TCustomPanel	Properties	See also

The FullRepaint method determines whether the Invalidate method is called when the custom panel receives a WM_SIZE message.

Syntax

__property System::Boolean FullRepaint;

Description

Set FullRepaint to true when you want the panel and all the controls it contains to be repainted when the panel is resized. If FullRepaint is false, the panel and the controls it contains are not repainted.


TCustomPanel::Locked

TCustomPanel	Properties	See also

The Locked property determines whether a panel that is being used as a toolbar is replaced by the OLE object's server's toolbar.

Syntax

__property System::Boolean Locked;

Description

Set the Locked property to false when the panel is used as a toolbar by a TOleContainer component. Any panels aligned to a TOleContainer are assumed to be replaceable toolbars unless the Locked property is true. Prevent the panel from being replaced by an OLE server’s toolbar by setting the panel's Locked property to true.

Note

An application's toolbars must be in panels aligned to a side of the form (that is, their Align properties must be set to alTop, alBottom, alLeft, or alRight).


TCustomPanel events

TCustomPanel	Alphabetically	Legend

In TCustomPanel

OnResize


TCustomPanel events

TCustomPanel	By object	Legend

OnResize


TCustomPanel::OnResize

TCustomPanel	Events	See also

The OnResize event occurs whenever the panel is resized while an application is running.

Syntax

__property Classes::TNotifyEvent OnResize;

Description

Use the OnResize event handler to make something happen when the panel is resized. For example, the panel may want to reposition its child controls when it is resized.


TCustomPanel methods

TCustomPanel	Alphabetically	Legend

In TCustomPanel

~TCustomPanel

AlignControls

CreateParams

Paint

Resize

TCustomPanel

Derived from TCustomControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomPanel methods

TCustomPanel	By object	Legend

~TCustomPanel

AlignControls

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Resize

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomPanel

UpdateControlState

Update


TCustomPanel::AlignControls

TCustomPanel	Methods	See also

The AlignControls method aligns any controls contained within the panel.

Syntax

virtual void __fastcall AlignControls(Controls::TControl *AControl, Windows::TRect &Rect);

Description

Use AlignControls to align all controls within a panel all at once. Specify the area in which you want the controls aligned as the value of the Rect parameter.

AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be NULL. If you specify a control in AControl, that control takes precedence in alignment over other, similarly-aligned controls.


TCustomPanel::CreateParams

TCustomPanel	Methods	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a custom panel creates its Windows representation. When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments. The overriding method shoudl specify the fields of the Params record as desired for the parameters to a call to the CreateWindowEx API function.


TCustomPanel::Paint

TCustomPanel	Methods	See also

The Paint method renders the image of a panel.

Syntax

virtual void __fastcall Paint(void);

Description

Override the Paint method to change the way the panel is drawn. The Paint method for custom panels draws the bevels of the panel, sets the brush and font for the panel, and fills in the interior of the panel before calling the Windows API DrawText function to draw the Caption.


TCustomPanel::Resize

TCustomPanel	Methods	See also

The Resize method is the protected implementation method for the OnResize event of a custom panel control.

Syntax

virtual void __fastcall Resize(void);

Description

Override Resize to provide other responses in addition to the call to the OnResize event handler. The custom control calls Resize in response to the WM_SIZE message, indicating a change in the size of the control or form.

If the panel’s FullRepaint property is true, Resize invalidates the panel before it calls the method assigned to the OnResize event, if one exists.


TCustomPanel::TCustomPanel

TCustomPanel	Methods	See also

TCustomPanel creates a new TCustomPanel object.

Syntax

__fastcall virtual TCustomPanel(Classes::TComponent *AOwner);

Description

Use TCustomPanel to create a new TCustomPanel object.


TCustomPanel::~TCustomPanel

TCustomPanel	Methods	See also

~TCustomPanel frees the memory associated with the TCustomPanel object.

Syntax

__fastcall virtual ~TCustomPanel(void);

Description

Do not call ~TCustomPanel directly. Instead, use the delete keyword on the object, which causes ~TCustomPanel to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomPanel example

TCustomPanel


TCustomRadioGroup

Hierarchy	Properties	Methods	See also

TCustomRadioGroup is the base class for radio-group components.

Header

vcl/extctrls.hpp

Description

Radio groups are collections of radio buttons in a single group box. TCustomRadioGroup is the class from which radio-group components—including TRadioGroup and TDBRadioGroup—descend.

Radio buttons that are contained directly in the same control component are said to be “grouped.” When the user checks a radio button, all other radio buttons in its group become unchecked. Hence, two radio buttons on a form can be checked at the same time only if they are placed in separate subcontainers, such as group boxes.


TCustomRadioGroup properties

TCustomRadioGroup	Alphabetically	Legend

In TCustomRadioGroup

Columns

ItemIndex

Items

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomRadioGroup properties

TCustomRadioGroup	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomRadioGroup::Columns

TCustomRadioGroup	Properties

The number of columns in the radio group.

Syntax

__property System::Integer Columns;

Description

The Columns property determines the number of columns in the radio group. Its value may range from 1 to 16. The default value is 1, which means that the radio buttons are arranged in a single vertical line.


TCustomRadioGroup::ItemIndex

TCustomRadioGroup	Properties

Indicates which radio button in the group is currently selected.

Syntax

__property System::Integer ItemIndex;

Description

ItemIndex holds the ordinal number of the selected radio button in the Items list. (The first button is 0.) The value of ItemIndex changes at run time as the user selects radio buttons. If you want one of the buttons to appear selected when the application starts, assign that button to ItemIndex at design time; otherwise, leave ItemIndex set to the default value of -1, which means that no button is selected.


TCustomRadioGroup::Items

TCustomRadioGroup	Properties	See also

A list of the radio buttons in the radio group.

Syntax

__property Classes::TStrings * Items;

Description

Items holds a TStrings object that lists the captions of the radio buttons in the group. In TCustomRadioGroup descendants TRadioGroup and TDBRadioGroup, where this property is published, you can add or remove radio buttons by editing the Items list from the Object Inspector.

Note

The items in a radio-group object are special instances of TRadioButton generated by TCustomRadioGroup. Independently created TRadioButton instances cannot be included in a radio group.


TCustomRadioGroup methods

TCustomRadioGroup	Alphabetically	Legend

In TCustomRadioGroup

~TCustomRadioGroup

CanModify

GetChildren

ReadState

TCustomRadioGroup

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRadioGroup methods

TCustomRadioGroup	By object	Legend

~TCustomRadioGroup

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetChildren

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

ReadState

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomRadioGroup

UpdateControlState

Update


TCustomRadioGroup::CanModify

TCustomRadioGroup	Methods	See also

Determines whether the user can select a different radio button in the group.

Syntax

virtual System::Boolean __fastcall CanModify(void);

Description

Event handlers call CanModify to verify that the user is allowed to select a different radio button in the group. As defined in TCustomRadioGroup, this method always returns true; you can override it to return false in situations where the user should not be able to make changes.


TCustomRadioGroup::GetChildren

TCustomRadioGroup	Methods	See also

The GetChildren method for TCustomRadioGroup is inoperative.

Syntax

virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);

Description

TCustomRadioGroup overrides TWinControl to disable the GetChildren method.


TCustomRadioGroup::ReadState

TCustomRadioGroup	Methods	See also

Reads the radio-group’s data from a stream.

Syntax

virtual void __fastcall ReadState(Classes::TReader *Reader);

Description

ReadState calls the inherited ReadState method to read the radio group’s published properties and other stored data to a reader object. It then redraws the buttons in the group.


TCustomRadioGroup::TCustomRadioGroup

TCustomRadioGroup	Methods	See also

TCustomRadioGroup creates a new TCustomRadioGroup object.

Syntax

__fastcall virtual TCustomRadioGroup(Classes::TComponent *AOwner);

Description

Use TCustomRadioGroup to create a new TCustomRadioGroup object.


TCustomRadioGroup::~TCustomRadioGroup

TCustomRadioGroup	Methods	See also

~TCustomRadioGroup frees the memory associated with the TCustomRadioGroup object.

Syntax

__fastcall virtual ~TCustomRadioGroup(void);

Description

Do not call ~TCustomRadioGroup directly. Instead, use the delete keyword on the object, which causes ~TCustomRadioGroup to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox


TCustomRadioGroup example

TCustomRadioGroup


TCustomRichEdit

Hierarchy	Properties	Methods	Events	See also

The TCustomRichEdit component is the abstract base type for rich edit components such as TRichEdit.

Header

vcl/comctrls.hpp

Description

TCustomRichEdit introduces new properties and methods to expand the capabilities of TCustomMemo for rich text.

Do not create instances of TCustomRichEdit. Use TCustomRichEdit as a base class when declaring control objects that impelement rich text capabilities in an edit control. Properties and methods of TCustomRichEdit provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomRichEdit properties

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

DefAttributes

DefaultConverter

HideScrollBars

HideSelection

Lines

PageRect

Paragraph

PlainText

SelAttributes

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomRichEdit properties

TCustomRichEdit	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DefAttributes

DefaultConverter

DesignInfo

Enabled

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

Left

Lines

Modified

Name

Owner

PageRect

Paragraph

Parent

PlainText

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TCustomRichEdit::DefAttributes

TCustomRichEdit	Properties	See also

DefAttributes is a TTextAttributes object that describes the rich text characteristics of the default font for the rich edit control

Syntax

Description

Use DefAttributes to discover or set the font characteristics that the rich edit control uses by default for newly inserted text. These are the characteristics of the text before any special attributes have been applied. Once any special attributes have been applied to a portion of text, no text from that point on is considered to have the default attributes, even if the attributes match the DefAttributes.

Consider, for example, a rich edit control that has had no attributes applied. The entire text has the default attributes. Selecting a portion of text in the middle and applying a specific attribute (such as a font change, or italics) will result in three sections: a first section with the default attributes, a middle section with the applied attribute, and a final section with a non-default set of attributes that happen to match the default attributes. Changing the DefAttributes property will affect only the first section.

When inserting new text, the font characteristics of the new text will match the font characteristics at the cursor position, or, if the typing replaces a selection, the font characteristics of the selected text. New text will only have the default attributes when typed into the section of text that has the default attributes.

Note

DefAttributes is available only at run-time.


TCustomRichEdit::DefaultConverter

TCustomRichEdit	Properties	See also

DefaultConverter is the actual class of the TConversion object that is used to convert between native file format and the internal format of a rich text control, when working with files that do not have a registered extension.

Syntax

Description

Use DefaultConverter to specify the type of conversion that will be used when streaming text to or from files that do not have a registered extension. If you do not specify a DefaultConverter, TCustomRichEdit will use TConversion, which performs no actual conversion. The TCustomRichEdit encodes text attributes in rich-text format (RTF). Thus, unrecognized file extensions lead to no conversion, which works for files that contain plain text or any subset of RTF format.

To support streaming to or from files that encode rich text characteristics in some other format, register a conversion format with the file extension used by those files. Use DefaultConverter only if you want to change the conversion that is used for unrecognized file extensions.

Note

Use the Lines property to stream the text to or from a file.


TCustomRichEdit::HideScrollBars

TCustomRichEdit	Properties	See also

HideScrollBars determines whether the scroll bars disappear when not needed.

Syntax

__property System::Boolean HideScrollBars;

Description

Use HideScrollBars to determine whether the scroll bars disappear from the edit control when the text appears completely within the edit window. Set HideScrollBars to false to prevent the scroll bars from flashing on and off when the contents of the rich edit control change.

HideScrollBars does nothing when the ScrollBars property is set to ssNone (The default for a TRichEdit object).


TCustomRichEdit::HideSelection

TCustomRichEdit	Properties	See also

HideSelection determines whether the visual indication of the selected text remains when focus shifts to another control.

Syntax

__property System::Boolean HideSelection;

Description

Set HideSelection to false when it is important to provide visual feedback of the selected portion of the text even when the edit control does not have focus. Set HideSelection to true in order to make the visual indication of selection appear only when the edit control has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to false can lead to an overly busy-looking form if the form contains many edit controls.


TCustomRichEdit::Lines

TCustomRichEdit	Properties	See also

Lines contains the individual lines of text in the rich text edit control.

Syntax

__property Classes::TStrings * Lines;

Description

Use Lines to manipulate the text in the rich text edit control on a line by line basis. Lines is a TStrings object, and so the TStrings methods may be used for Lines to perform such manipulations as counting the lines of text, adding new lines, deleting lines, or replacing lines with new text.

To work with the text as one chunk, use the Text property. To manipulate individual lines of text, the Lines property will work better.


TCustomRichEdit::PageRect

TCustomRichEdit	Properties	See also

PageRect specifies the dimensions, in twips, of the logical page size used when printing the contents of a rich text edit control.

Syntax

Description

Use PageRect to specify the logical page size used when formatting the contents of the rich edit control for printing. Specify the dimensions in twips (1/20 of a point).


TCustomRichEdit::Paragraph

TCustomRichEdit	Properties	See also

Paragraph specifies the formatting information for the current paragraphs.

Syntax

Description

Read Paragraph to get the TParaAttributes object used by the rich edit control to specify paragraph formatting information. Use the TParaAttributes object to read or write the paragraph formatting information for the current paragraph. Paragraph formatting information includes alignment, indentation, numbering, and tabs.

Paragraph is a read-only property, because a TCustomRichEdit object has only one TParaAttributes object, which cannot be changed. The attributes of the current paragraphs, however, can be changed, by setting the properties of the TParaAttributes object. These can be set one by one, or all set to the value of an existing TParaAttributes object by using Paragraph.Assign.

The current paragraphs are the paragraphs that contain the selected text. If no text is selected, the current paragraph is the one containing the cursor.

Note

Paragraph is available only at run-time.


TCustomRichEdit::PlainText

TCustomRichEdit	Properties	See also

PlainText controls whether the rich edit control treats the text as plain text or rich text when streaming to or from a file.

Syntax

__property System::Boolean PlainText;

Description

To write the rich text from the control into a plain text file, set PlainText to true before streaming the text to a file. To ignore the rich text information encoded in a file, set PlainText to true before streaming in the text. To stream in the rich text attributes encoded in a file, or save the encoding of the rich text attributes out to a file, set PlainText to false.

If the rich text attributes of a file are encoded in some format other than rich text format (RTF), it is necessary to use a converter on the text, even when PlainText is true.

Note

Rich edit controls do not directly support streaming. Use the Lines property to stream to or from a file.


TCustomRichEdit::SelAttributes

TCustomRichEdit	Properties	See also

SelAttributes is a TTextAttributes object that describes the rich text characteristics of the selected text in the rich edit control

Syntax

Description

Use SelAttributes to discover or set the font characteristics of the currently selected text. SelAttributes is a TTextAttributes object, which specifies such characteristics as font face, color, size, style, and pitch. To change a single attribute of the currently selected text, read SelAttributes, and set one of its properties. To change all of the attributes of the currently selected text, set SelAttributes to a TTextAttributes object that represents the desired configuration of attributes. If no text is selected, SelAttributes represents the attributes of the cursor position.

When inserting new text, the font characteristics of the new text will match SelAttributes.

Note

SelAttributes is available only at run-time.


TCustomRichEdit events

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange


TCustomRichEdit events

TCustomRichEdit	By object	Legend

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange


TCustomRichEdit::OnProtectChange

TCustomRichEdit	Events	See also

OnProtectChange occors when a user attempts to modify text that has been marked as protected.

Syntax

__property TRichEditProtectChange OnProtectChange;

Description

Write an OnProtectChange event handler to allow modification of text that has the protected attribute. The StartPos and EndPos parameters indicate the beginning and ending of the range of text that would be affected by the modification, where 0 is the first character in the text. To allow the modifcation of protected text to occur, set AllowChange to true.

To set or unset the protected attribute of a section of text, select the text and use the Protected property of the rich edit control’s SelAttributes property. To cause text to have the protected attribute by default, use the Protected property of the rich edit object’s DefAttributes property.


TCustomRichEdit::OnResizeRequest

TCustomRichEdit	Events	See also

OnResizeRequest occors when the text has grown either smaller or larger than the control's window size.

Syntax

__property TRichEditResizeEvent OnResizeRequest;

Description

Write an OnResizeRequest event handler to respond to notifications that the edit control is trying to resize due to changes in the text. The Rect parameter gives the desired bouding rectangle that will display all the text, in screen coordinates.


TCustomRichEdit::OnSaveClipboard

TCustomRichEdit	Events	See also

OnSaveClipboard occurs whenthe edit window is about to be destroyed and the Clipboard contains information from the edit control.

Syntax

__property TRichEditSaveClipboard OnSaveClipboard;

Description

Write an OnSaveClipboard event handler to respond to notifications that the edit window is about to be destroyed and the Clipboard contains information from the edit control. The parameter NumObjects is the number of objects on the Clipboard, and NumChars is the number of characters on the Clipboard. To clear all information about the edit control from the clipboard, set SaveClipboard to false.


TCustomRichEdit::OnSelectionChange

TCustomRichEdit	Events	See also

OnSelectionChange occurs when the current selection changes.

Syntax

__property Classes::TNotifyEvent OnSelectionChange;

Description

Write an OnSelectionChange event handler to respond to changes in the selected text. Changes in selection can occur when the user changes the selection using the mouse or keyboard, or when the selection is changed through the SelText property. Portions of the selection can be changed through the Lines property.


TCustomRichEdit methods

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

~TCustomRichEdit

CreateParams

CreateWnd

DestroyWnd

FindText

Print

RegisterConversionFormat

RequestSize

SelectionChange

TCustomRichEdit

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRichEdit methods

TCustomRichEdit	By object	Legend

~TCustomRichEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CreateWnd

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindText

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

RequestSize

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SelectionChange

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TCustomRichEdit

UpdateControlState

Update


TCustomRichEdit::CreateParams

TCustomRichEdit	Methods	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomRichEdit overrides the inherited method to specify a Windows rich edit control.


TCustomRichEdit::CreateWnd

TCustomRichEdit	Methods	See also

The CreateWnd method creates a Windows control corresponding to the edit control.

Syntax

virtual void __fastcall CreateWnd(void);

Description

CreateWnd is called when the rich edit control is created, and whenever a change to the rich edit control requires the window to be recreated. CreateWnd first calls the inherited CreateWnd, which calls the CreateParams method to initialize the window-creation parameters, and which then calls CreateWindowHandle to create the window handle for the control. CreateWnd then sends the newly created window messages to request notification of windows events, and, if the window is being recreated, reloads the rich text from a memory stream.


TCustomRichEdit::DestroyWnd

TCustomRichEdit	Methods	See also

The DestroyWnd method destroys the rich edit window handle.

Syntax

virtual void __fastcall DestroyWnd(void);

Description

Before the window handle is destroyed, DestroyWnd saves a copy of the control's text in a memory stream, frees any device contexts, and finally calls DestroyWindowHandle.


TCustomRichEdit::FindText

TCustomRichEdit	Methods	See also

FindText searches a given range in the text for a target string.

Syntax

System::Integer __fastcall FindText(const System::AnsiString SearchStr, System::Integer StartPos, System::Integer

Desctription

Use FindText to search a range of text in a rich edit control for a string. The search will start at the position StartPos, where 0 is the first character. Use Options to specifiy whether the search should match whole words only and whether the search should be case sensitive. Use FindText rather than programmatically searching through the text of the control, so as not to be thrown off by the encoding of rich text characterists.


TCustomRichEdit::Print

TCustomRichEdit	Methods	See also

Print formats and prints the contents of the rich edit control.

Syntax

void __fastcall Print(const System::AnsiString Caption);

Description

Use Print to print out the contents of a rich edit control. Use Caption to specify the title that appears on the printed output.


TCustomRichEdit::RegisterConversionFormat

TCustomRichEdit	Methods	See also

RegisterConversionFormat registers an association between a file extension and a TConversion object that can convert between native file format and the internal format of the rich edit control.

Syntax

Description

Rich edit controls encode the text attributes in rich text format (RTF). To read from or write to files that encode the text attributes in some other format, a converter must be used. The converter is a descendent of TConversion that translates between the native file format and RTF while streaming the text in or out. RegisterConversionFormat sets up an association between a file extension and a converter, so that all attempts to stream between a file with that extension and a rich edit control automatically invoke the appropriate converter.

Note

Use the Lines property to stream the text to or from a file.


TCustomRichEdit::RequestSize

TCustomRichEdit	Methods	See also

RequestSize responds to messages from the edit window when the text has grown either smaller or larger than the window size.

Syntax

virtual void __fastcall RequestSize(const Windows::TRect &Rect);

Description

RequestSize merely calls the OnResizeRequest event handler. RequestSize is exposed as a protected method so that derived classes can override it to customize the response to messages about an impending window resize before or after calliong the OnResizeRequest event handler.


TCustomRichEdit::SelectionChange

TCustomRichEdit	Methods	See also

SelectionChange responds to messages from the edit window that the selection has changed.

Syntax

virtual void __fastcall SelectionChange(void);

Description

SelectionChange merely calls the OnSelectionChange event handler. SelectionChange is exposed as a protected method so that derived classes can override it to add additional responses to changes in the current selection beyond calling the OnSelectionChange event handler.


TCustomRichEdit::TCustomRichEdit

TCustomRichEdit	Methods	See also

TCustomRichEdit creates a new TCustomRichEdit object.

Syntax

__fastcall virtual TCustomRichEdit(Classes::TComponent *AOwner);

Description

Use TCustomRichEdit to create a new TCustomRichEdit object.


TCustomRichEdit::~TCustomRichEdit

TCustomRichEdit	Methods	See also

~TCustomRichEdit frees the memory associated with the TCustomRichEdit object.

Syntax

__fastcall virtual ~TCustomRichEdit(void);

Description

Do not call ~TCustomRichEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomRichEdit to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TCustomRichEdit example

TCustomRichEdit


TCustomTabControl

Hierarchy	Properties	Methods	Events

The TCustomTabControl component is the abstract base type for tab-control components such as TTabControl and TPageControl.

Header

vcl/comctrls.hpp

Overview

Most of the properties, methods, and events defined in TCustomTabControl are protected so that you can choose whether to publish them in your own tab control or page control components.


TCustomTabControl properties

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

DisplayRect

MultiLine

TabHeight

TabIndex

Tabs

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomTabControl properties

TCustomTabControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DisplayRect

Enabled

Handle

Height

HelpContext

Hint

Left

MultiLine

Name

Owner

Parent

ShowHint

Showing

TabHeight

TabIndex

TabOrder

Tabs

TabStop

TabWidth

Tag

Top

Visible

Width


TCustomTabControl::DisplayRect

TCustomTabControl	Properties

Syntax

__property Windows::TRect DisplayRect;


TCustomTabControl::MultiLine

TCustomTabControl	Properties

Syntax

__property System::Boolean MultiLine;


TCustomTabControl::TabHeight

TCustomTabControl	Properties

Syntax

__property System::Smallint TabHeight;


TCustomTabControl::TabIndex

TCustomTabControl	Properties

Syntax

__property System::Integer TabIndex;


TCustomTabControl::Tabs

TCustomTabControl	Properties

Syntax

__property Classes::TStrings * Tabs;


TCustomTabControl::TabWidth

TCustomTabControl	Properties

Syntax

__property System::Smallint TabWidth;


TCustomTabControl events

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

OnChange

OnChanging


TCustomTabControl events

TCustomTabControl	By object	Legend

OnChange

OnChanging


TCustomTabControl::OnChange

TCustomTabControl	Events

Syntax

__property Classes::TNotifyEvent OnChange;


TCustomTabControl::OnChanging

TCustomTabControl	Events

Syntax

__property TTabChangingEvent OnChanging;


TCustomTabControl methods

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

~TCustomTabControl

AlignControls

CanChange

Change

CreateParams

CreateWnd

DestroyWnd

TCustomTabControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomTabControl methods

TCustomTabControl	By object	Legend

~TCustomTabControl

AlignControls

Assign

BeginDrag

BringToFront

Broadcast

CanChange

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomTabControl

UpdateControlState

Update


TCustomTabControl::AlignControls

TCustomTabControl	Methods

Syntax

virtual void __fastcall AlignControls(Controls::TControl *AControl, Windows::TRect &Rect);


TCustomTabControl::CanChange

TCustomTabControl	Methods

Syntax

virtual System::Boolean __fastcall CanChange(void);


TCustomTabControl::Change

TCustomTabControl	Methods

Syntax

virtual void __fastcall Change(void);


TCustomTabControl::CreateParams

TCustomTabControl	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomTabControl::CreateWnd

TCustomTabControl	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomTabControl::DestroyWnd

TCustomTabControl	Methods

Syntax

virtual void __fastcall DestroyWnd(void);


TCustomTabControl::TCustomTabControl

TCustomTabControl	Methods	See also

TCustomTabControl creates a new TCustomTabControl object.

Syntax

__fastcall virtual TCustomTabControl(Classes::TComponent *AOwner);

Description

Use TCustomTabControl to create a new TCustomTabControl object.


TCustomTabControl::~TCustomTabControl

TCustomTabControl	Methods	See also

~TCustomTabControl frees the memory associated with the TCustomTabControl object.

Syntax

__fastcall virtual ~TCustomTabControl(void);

Description

Do not call ~TCustomTabControl directly. Instead, use the delete keyword on the object, which causes ~TCustomTabControl to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomTabControl example

TCustomTabControl


TCustomTreeView

Hierarchy	Properties	Methods	Events

The TCustomTreeView component is the abstract base type for tree-view components such as TTreeView.

Header

vcl/comctrls.hpp

Overview

Most of the properties, methods, and events defined in TCustomTreeView are protected so that you can choose whether to publish them in your own tree view components.


TCustomTreeView properties

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

BorderStyle

DropTarget

HideSelection

Images

Indent

Items

ReadOnly

Selected

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

TopItem

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomTreeView properties

TCustomTreeView	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DropTarget

Enabled

Handle

Height

HelpContext

HideSelection

Hint

Images

Indent

Items

Left

Name

Owner

Parent

ReadOnly

Selected

ShowButtons

ShowHint

Showing

ShowLines

ShowRoot

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

Visible

Width


TCustomTreeView::BorderStyle

TCustomTreeView	Properties

Syntax

__property Forms::TBorderStyle BorderStyle;


TCustomTreeView::HideSelection

TCustomTreeView	Properties

Syntax

__property System::Boolean HideSelection;


TCustomTreeView::Images

TCustomTreeView	Properties

Syntax

__property Controls::TImageList * Images;


TCustomTreeView::Indent

TCustomTreeView	Properties

Syntax

__property System::Integer Indent;


TCustomTreeView::Items

TCustomTreeView	Properties

Syntax

__property TTreeNodes * Items;


TCustomTreeView::ReadOnly

TCustomTreeView	Properties

Syntax

__property System::Boolean ReadOnly;


TCustomTreeView::ShowButtons

TCustomTreeView	Properties

Syntax

__property System::Boolean ShowButtons;


TCustomTreeView::ShowLines

TCustomTreeView	Properties

Syntax

__property System::Boolean ShowLines;


TCustomTreeView::ShowRoot

TCustomTreeView	Properties

Syntax

__property System::Boolean ShowRoot;


TCustomTreeView::SortType

TCustomTreeView	Properties

Syntax

__property TSortType SortType;


TCustomTreeView::StateImages

TCustomTreeView	Properties

Syntax

__property Controls::TImageList * StateImages;


TCustomTreeView events

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex


TCustomTreeView events

TCustomTreeView	By object	Legend

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex


TCustomTreeView::OnChange

TCustomTreeView	Events

Syntax

__property TTVChangedEvent OnChange;


TCustomTreeView::OnChanging

TCustomTreeView	Events

Syntax

__property TTVChangingEvent OnChanging;


TCustomTreeView::OnCollapsed

TCustomTreeView	Events

Syntax

__property TTVExpandedEvent OnCollapsed;


TCustomTreeView::OnCollapsing

TCustomTreeView	Events

Syntax

__property TTVCollapsingEvent OnCollapsing;


TCustomTreeView::OnCompare

TCustomTreeView	Events

Syntax

__property TTVCompareEvent OnCompare;


TCustomTreeView::OnDeletion

TCustomTreeView	Events

Syntax

__property TTVExpandedEvent OnDeletion;


TCustomTreeView::OnEdited

TCustomTreeView	Events

Syntax

__property TTVEditedEvent OnEdited;


TCustomTreeView::OnEditing

TCustomTreeView	Events

Syntax

__property TTVEditingEvent OnEditing;


TCustomTreeView::OnExpanded

TCustomTreeView	Events

Syntax

__property TTVExpandedEvent OnExpanded;


TCustomTreeView::OnExpanding

TCustomTreeView	Events

Syntax

__property TTVExpandingEvent OnExpanding;


TCustomTreeView::OnGetImageIndex

TCustomTreeView	Events

Syntax

__property TTVExpandedEvent OnGetImageIndex;


TCustomTreeView::OnGetSelectedIndex

TCustomTreeView	Events

Syntax

__property TTVExpandedEvent OnGetSelectedIndex;


TCustomTreeView methods

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

~TCustomTreeView

AlphaSort

CanChange

CanCollapse

CanEdit

CanExpand

Change

Collapse

CreateNode

CreateParams

CreateWnd

CustomSort

DestroyWnd

DoEndDrag

DoStartDrag

Edit

Expand

FullCollapse

FullExpand

GetDragImages

GetHitTestInfoAt

GetNodeAt

IsEditing

Loaded

LoadFromFile

LoadFromStream

Notification

SaveToFile

SaveToStream

SetDragMode

TCustomTreeView

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomTreeView methods

TCustomTreeView	By object	Legend

~TCustomTreeView

AlphaSort

Assign

BeginDrag

BringToFront

Broadcast

CanChange

CanCollapse

CanEdit

CanExpand

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

Collapse

ContainsControl

ControlAtPos

CreateNode

CreateParams

CreateWnd

CustomSort

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DoEndDrag

DoStartDrag

DragDrop

Dragging

Edit

EnableAlign

EndDrag

Expand

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetDragImages

GetHitTestInfoAt

GetNodeAt

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

Loaded

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetDragMode

SetFocus

SetTextBuf

Show

TCustomTreeView

UpdateControlState

Update

WndProc


TCustomTreeView::CanChange

TCustomTreeView	Methods

Syntax

virtual System::Boolean __fastcall CanChange(TTreeNode *Node);


TCustomTreeView::CanCollapse

TCustomTreeView	Methods

Syntax

virtual System::Boolean __fastcall CanCollapse(TTreeNode *Node);


TCustomTreeView::CanEdit

TCustomTreeView	Methods

Syntax

virtual System::Boolean __fastcall CanEdit(TTreeNode *Node);


TCustomTreeView::CanExpand

TCustomTreeView	Methods

Syntax

virtual System::Boolean __fastcall CanExpand(TTreeNode *Node);


TCustomTreeView::Change

TCustomTreeView	Methods

Syntax

virtual void __fastcall Change(TTreeNode *Node);


TCustomTreeView::Collapse

TCustomTreeView	Methods

Syntax

virtual void __fastcall Collapse(TTreeNode *Node);


TCustomTreeView::CreateNode

TCustomTreeView	Methods

Syntax

virtual TTreeNode *__fastcall CreateNode(void);


TCustomTreeView::CreateParams

TCustomTreeView	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomTreeView::CreateWnd

TCustomTreeView	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomTreeView::DestroyWnd

TCustomTreeView	Methods

Syntax

virtual void __fastcall DestroyWnd(void);


TCustomTreeView::DoEndDrag

TCustomTreeView	Methods

Syntax

virtual void __fastcall DoEndDrag(System::TObject *Target, System::Integer X, System::Integer Y);


TCustomTreeView::DoStartDrag

TCustomTreeView	Methods

Syntax

virtual void __fastcall DoStartDrag(Controls::TDragObject *&DragObject);


TCustomTreeView::Edit

TCustomTreeView	Methods

Syntax

virtual void __fastcall Edit(const Commctrl::TTVItemA &Item);


TCustomTreeView::Expand

TCustomTreeView	Methods

Syntax

virtual void __fastcall Expand(TTreeNode *Node);


TCustomTreeView::GetDragImages

TCustomTreeView	Methods

Syntax

virtual Controls::TCustomImageList *__fastcall GetDragImages(void);


TCustomTreeView::Loaded

TCustomTreeView	Methods

Syntax

virtual void __fastcall Loaded(void);


TCustomTreeView::Notification

TCustomTreeView	Methods

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation


TCustomTreeView::SetDragMode

TCustomTreeView	Methods

Syntax

virtual void __fastcall SetDragMode(Controls::TDragMode Value);


TCustomTreeView::WndProc

TCustomTreeView	Methods

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);


TCustomTreeView::TCustomTreeView

TCustomTreeView	Methods	See also

TCustomTreeView creates a new TCustomTreeView object.

Syntax

__fastcall virtual TCustomTreeView(Classes::TComponent *AOwner);

Description

Use TCustomTreeView to create a new TCustomTreeView object.


TCustomTreeView::~TCustomTreeView

TCustomTreeView	Methods	See also

~TCustomTreeView frees the memory associated with the TCustomTreeView object.

Syntax

__fastcall virtual ~TCustomTreeView(void);

Description

Do not call ~TCustomTreeView directly. Instead, use the delete keyword on the object, which causes ~TCustomTreeView to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomTreeView example

TCustomTreeView


TCustomUpDown

Hierarchy	Properties	Methods	Events

The TCustomUpDown component is the abstract base type for up-down components such as TUpDown.

Header

vcl/comctrls.hpp


TCustomUpDown properties

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

AlignButton

ArrowKeys

Associate

Increment

Max

Min

Orientation

Position

Thousands

Wrap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomUpDown properties

TCustomUpDown	By object	Legend

AlignButton

Align

ArrowKeys

Associate

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Increment

Left

Max

Min

Name

Orientation

Owner

Parent

Position

ShowHint

Showing

TabOrder

TabStop

Tag

Thousands

Top

Visible

Width

Wrap


TCustomUpDown::AlignButton

TCustomUpDown	Properties

Syntax

__property TUDAlignButton AlignButton;


TCustomUpDown::ArrowKeys

TCustomUpDown	Properties

Syntax

__property System::Boolean ArrowKeys;


TCustomUpDown::Associate

TCustomUpDown	Properties

Syntax

__property Controls::TWinControl * Associate;


TCustomUpDown::Increment

TCustomUpDown	Properties

Syntax

__property System::Integer Increment;


TCustomUpDown::Max

TCustomUpDown	Properties

Syntax

__property System::Smallint Max;


TCustomUpDown::Min

TCustomUpDown	Properties

Syntax

__property System::Smallint Min;


TCustomUpDown::Orientation

TCustomUpDown	Properties

Syntax

__property TUDOrientation Orientation;


TCustomUpDown::Position

TCustomUpDown	Properties

Syntax

__property System::Smallint Position;


TCustomUpDown::Thousands

TCustomUpDown	Properties

Syntax

__property System::Boolean Thousands;


TCustomUpDown::Wrap

TCustomUpDown	Properties

Syntax

__property System::Boolean Wrap;


TCustomUpDown events

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

OnChanging

OnClick


TCustomUpDown events

TCustomUpDown	By object	Legend

OnChanging

OnClick


TCustomUpDown::OnChanging

TCustomUpDown	Events

Syntax

__property TUDChangingEvent OnChanging;


TCustomUpDown::OnClick

TCustomUpDown	Events

Syntax

__property TUDClickEvent OnClick;


TCustomUpDown methods

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

~TCustomUpDown

CanChange

Click

CreateParams

CreateWnd

Notification

TCustomUpDown

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomUpDown methods

TCustomUpDown	By object	Legend

~TCustomUpDown

Assign

BeginDrag

BringToFront

Broadcast

CanChange

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomUpDown

UpdateControlState

Update


TCustomUpDown::CanChange

TCustomUpDown	Methods

Syntax

System::Boolean __fastcall CanChange(void);


TCustomUpDown::Click

TCustomUpDown	Methods

Syntax

virtual void __fastcall Click(TUDBtnType Button);


TCustomUpDown::CreateParams

TCustomUpDown	Methods

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomUpDown::CreateWnd

TCustomUpDown	Methods

Syntax

virtual void __fastcall CreateWnd(void);


TCustomUpDown::Notification

TCustomUpDown	Methods

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation


TCustomUpDown::TCustomUpDown

TCustomUpDown	Methods	See also

TCustomUpDown creates a new TCustomUpDown object.

Syntax

__fastcall virtual TCustomUpDown(Classes::TComponent *AOwner);

Description

Use TCustomUpDown to create a new TCustomUpDown object.


TCustomUpDown::~TCustomUpDown

TCustomUpDown	Methods	See also

~TCustomUpDown frees the memory associated with the TCustomUpDown object.

Syntax

__fastcall virtual ~TCustomUpDown(void);

Description

Do not call ~TCustomUpDown directly. Instead, use the delete keyword on the object, which causes ~TCustomUpDown to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomUpDown example

TCustomUpDown


TDatabase

Hierarchy	Properties	Methods	Events

TDatabase provides discrete control over a connection to a single database in a database application.

Header

vcl/db.hpp

Description

Use TDatabase when a database application requires any of the following control over a database connection:

•	Persistent database connections

•	Customized database server logins

•	Transaction control

•	Application-specific BDE aliases

TDatabase is especially important for the control it permits over database transaction processing with the BDE when connected to a remote SQL database server.

Note

Explicit declaration of a TDatabase component for each database connection in an application is optional if the application does not require any of these controls for that connection. If a TDatabase component is not explicitly declared and instantiated for a database connection, a temporary database component with a default set of properties is created for it at run time.


TDatabase properties

TDatabase	Alphabetically	Legend

In TDatabase

AliasName

Connected

DatabaseName

DataSetCount

DataSets

Directory

DriverName

Handle

InTransaction

IsSQLBased

KeepConnection

Locale

LoginPrompt

Params

Session

SessionAlias

SessionName

Temporary

TraceFlags

TransIsolation

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDatabase properties

TDatabase	By object	Legend

AliasName

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Connected

DatabaseName

DataSetCount

DataSets

DesignInfo

Directory

DriverName

Handle

InTransaction

IsSQLBased

KeepConnection

Locale

LoginPrompt

Name

Owner

Params

SessionAlias

SessionName

Session

Tag

Temporary

TraceFlags

TransIsolation


TDatabase::AliasName

TDatabase	Properties	See also

Specifies the Borland Database Engine (BDE) alias used by this database connection.

Syntax

__property System::AnsiString AliasName;

Description

Use AliasName to specify the name of an existing BDE alias for the database component. A BDE alias contains database configuration information for connection to a specific kind of database, such as InterBase, dBASE, or Paradox. The configuration information associated with a BDE alias differs by database type.

If an application sets AliasName, any value previously assigned to the DriverName property is cleared because the alias automatically specifies a driver name as one of its parameters. Other alias connection information is stored in the Params property when AliasName is set.

Note

Attempting to set AliasName when the Connected property is true raises an exception.

Note

An application can specify the DatabaseName, DriverName, and Params properties rather than setting AliasName if the desired BDE alias configuration does not already exist. An application can also provide an application-specific “alias” name by setting DatabaseName when AliasName is already set.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the AliasName.


TDatabase::Connected

TDatabase	Properties	See also

Indicates whether or not a database connection is active.

Syntax

__property System::Boolean Connected;

Description

Set Connected to true to establish a database connection without opening a dataset. Set Connected to false to close a database connection. An application can check Connected to determine the current status of a database connection. If Connected is true, the database connection is active; if false, and the KeepConnection property is also false, then the connection is inactive.

Note

Set KeepConnection to true to avoid having to log in to the server each time a database connection is reopened.


TDatabase::DatabaseName

TDatabase	Properties	See also

Specifies the name of the database to associate with this database component.

Syntax

__property System::AnsiString DatabaseName;

Description

Use DatabaseName to specify the name of the database to use with a database component. If DatabaseName is the same as an existing Borland Database Engine (BDE) alias, then the AliasName and DriverName properties need not be set. If DatabaseName does not match an existing BDE alias, then either the application must also supply a valid alias in the AliasName property in addition to the DatabaseName, or it must supply the DriverName and Params properties.

DatabaseName can be a fully qualified path name when connecting to a Paradox or dBASE database. If a full path name is provided, the application must supply the DriverName and Params properties.

Note

Attempting to set DatabaseName when the Connected property is true raises an exception.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the DatabaseName.


TDatabase::DataSetCount

TDatabase	Properties	See also

Indicates the number of active datasets associated with the database component.

Syntax

__property System::Integer DataSetCount;

Description

Use DataSetCount to determine the number of currently active datasets associated with the database component. As datasets are opened and closed this value changes appropriately.

For example, the following code fragment illustrates how DataSetCount can be used to ensure that an action is taken for every open dataset that is a table:


TDatabase::DataSets

TDatabase	Properties	See also

Provides an indexed array of all active datasets for a database component.

Syntax

void __fastcall ApplyUpdates(const TDBDataSet *DataSets, const System::Integer DataSets_Size);

Description

Use DataSets to access active datasets associated with a database component. An active dataset is one that is currently open. For example, the following code fragment illustrates how DataSets can be used with the DataSetCount property to ensure that an action is taken for every open dataset that is a table:


TDatabase::Directory

TDatabase	Properties	See also

Specifies the working directory for a Paradox or dBASE database.

Syntax

__property System::AnsiString Directory;

Description

Use Directory at run time to change or retrieve the working directory for a Paradox or dBASE database. This is the location these databases use to create temporary tables at run time.

Ordinarily a directory location is specified in the PATH parameter of the database alias (specified by the AliasName property). At run time, however, some applications may need to change the working directory after a database is opened.

To change the value of Directory at run time, a database must already be open, or an exception is raised. Clearing the current value of Directory sets its value to the original working directory specified when the database was first opened.

Note

Do not use Directory when connected to remote databases. An exception is raised in these circumstances. An exception is also raised if an application accesses Directory when the database is closed.


TDatabase::DriverName

TDatabase	Properties	See also

Specifies the name of the BDE driver for the database.

Syntax

__property System::AnsiString DriverName;

Description

Use DriverName to specify the name of the BDE driver to use for databases connections that do not specify an AliasName, but that do specify a DatabaseName. DriverName must be a valid BDE driver (e.g., STANDARD, ORACLE, SYBASE, or INTERBASE).

Note

If an application sets DriverName, it must also specify connection parameters in the Params property. Ordinarily the alias specified in the AliasName property supplies connection parameters, but when DriverName is set, the AliasName property is automatically cleared to avoid BDE driver name contention.

Attempting to set DriverName when the Connected property is true raises an exception.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the DriverName.


TDatabase::Handle

TDatabase	Properties	See also

Specifies the Borland Database Engine (BDE) database handle.

Syntax

__property Bde::hDBIDb Handle;

Description

Use Handle only to bypass TDatabase methods and make direct calls to the directly to the BDE API. Many BDE function calls require a handle parameter. Handle is assigned an initial value when a database is opened.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++ Builder components.


TDatabase::InTransaction

TDatabase	Properties	See also

Indicates whether a database transaction is in progress or not.

Syntax

__property System::Boolean InTransaction;

Description

Examine InTransaction at run-time to determine if a database transaction is currently in progress. InTransaction is true if a transaction is in progress, false otherwise.

The value of InTransaction cannot be changed directly. Calling StartTransaction sets InTransaction to true. Calling Commit or Rollback sets InTransaction to false.


TDatabase::IsSQLBased

TDatabase	Properties	See also

Indicates if a database component is using either the Borland Database Engine (BDE) SQL Links driver or the BDE ODBC socket.

Syntax

__property System::Boolean IsSQLBased;

Description

Examine IsSQLBased at run time to determine if a database connection is using a BDE SQL Links driver, the ODBC socket, or the Paradox, dBASE, and ASCII text file STANDARD driver. If IsSQLBased is true, the connection is using an SQL Links driver or is using the ODBC socket to communicate with a third-party ODBC driver. If the connection uses the STANDARD driver, IsSQLBased is false.


TDatabase::KeepConnection

TDatabase	Properties	See also

Specifies whether an application remains connected to a database even if no datasets are open.

Syntax

__property System::Boolean KeepConnection;

Description

Use KeepConnection to specify whether an application remains connected to a database even if no datasets are currently open. When KeepConnection is true (the default) the connection is maintained. For connections to remote database servers, or for applications that frequently open and close datasets, set KeepConnection to true to reduce network traffic, speed up applications, and avoid logging in to the server each time the connection is reestablished.

When KeepConnection is false a connection is dropped when there are no open datasets. Dropping a connection releases system resources allocated to the connection, but if a dataset is later opened that uses the database, the connection must be reestablished and initialized.

Note

The KeepConnection setting for temporary database components created automatically by Borland C++ Builder as needed is determined by the KeepConnections property of TSession.


TDatabase::Locale

TDatabase	Properties	See also

Identifies the Borland Database Engine (BDE) language driver for the database component.

Syntax

__property System::Pointer Locale;

Description

Examine Locale to determine the BDE language driver used by the database component. Applications that make direct calls to the BDE may also need to pass Locale information as an API function parameter.

Language driver information may also be available as one of the values in the Params property when a database component is using a BDE alias.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++ Builder components.


TDatabase::LoginPrompt

TDatabase	Properties	See also

Indicates whether or not to display a standard Login dialog box when establishing a database connection.

Syntax

__property System::Boolean LoginPrompt;

Description

Use LoginPrompt to control the login method for remote database connections. If true, (the default), the standard Borland C++ Builder Login dialog box opens when the application attempts to connect to a database. The standard Login dialog box prompts for a valid user name and password. If the entries provided by the user are not valid, the connection fails.

If an application sets LoginPrompt to false, then user name and password values must be supplied either in an OnLogin event, or as USERNAME and PASSWORD parameters in the Params property.

Note

Storing hard-coded user name and password entries in the Params property or in code for an OnLogin event can compromise server security.


TDatabase::Params

TDatabase	Properties	See also

Contains database connection parameters for the Borland Database Engine (BDE) alias associated with the database component.

Syntax

__property Classes::TStrings * Params;

Description

Use Params to examine or specify database connection parameters, such as path name, server name, schema-caching size, language driver, user name, and password. Actual parameters in Params differ depending on the current BDE alias and driver for the database component.

Params is a list of string items, each representing a different database connection parameter. If the AliasName property specifies a valid BDE alias, then Params automatically contains the parameters defined for that alias. If, instead of providing an alias, an application uses the DriverName property to provide a local alias, the application must provide Params values directly.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set Params.


TDatabase::Session

TDatabase	Properties	See also

Points to the session component with which this database component is associated.

Syntax

__property TSession * Session;

Description

Use Session to determine the session component that controls the database component. By default, a database component is associated with the default session component, Session, that is automatically created for all database applications. To assign a database component to a different session in a multi-threaded application, specify the name of a different session component in the SessionName property.


TDatabase::SessionAlias

TDatabase	Properties	See also

Specifies whether or not a database component is using a session alias.

Syntax

__property System::Boolean SessionAlias;

Description

Examine SessionAlias to see if a database component is using a session alias. If SessionAlias is true, a session alias is in use. If false, a session alias is not in use.

A session alias is automatically created for a database component if it uses the DriverName and Params properties instead of the AliasName property, and the Params property contains any parameters. A session alias may also be created if an application permits the user to log into a server using a different user name than the one specified in the Params property.

A session alias exists only while the application is running. It is not stored in the BDE configuration file, and cannot be accessed from outside the application.


TDatabase::SessionName

TDatabase	Properties	See also

Identifies the name of the session used by this database component.

Syntax

__property System::AnsiString SessionName;

Description

Use SessionName to specify the session with which a database component is associated. If SessionName is blank, a database component is automatically associated with the default session, Session.

To associate a database component with a different session in a database application SessionName must matches the SessionName property of an existing session component.


TDatabase::Temporary

TDatabase	Properties	See also

Indicates whether a database component is a temporary one, created by the system as needed, or a persistent one explicitly created, managed, and freed within the application.

Syntax

__property System::Boolean Temporary;

Description

Examine Temporary to determine if a database component is a temporary one, created by the system as needed, or a persistent one explicitly created, managed, and freed within the application. Temporary is true if the system created the component, false otherwise.

A temporary database component is created when a dataset is opened and the dataset is not already associated with an existing database component. If Temporary remains true, then a temporary database component is freed when the dataset is closed. An application can prevent the destruction of a temporary database component by setting Temporary to false while the dataset is active, but the application is then responsible for closing the database when it is no longer needed.


TDatabase::TraceFlags

TDatabase	Properties	See also

Specifies the database operations to track with the SQL Monitor at run time.

Syntax

__property TTraceFlags TraceFlags;

Description

Use TraceFlags to specify which database operations the SQL Monitor should track in an application at run time. TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning when working with remote SQL database servers.

Note

Normally trace options are set from the SQL Monitor rather than setting TraceFlags in application code.

The initial value of a database component’s TraceFlags property is determined by the TraceFlags property of the session component that owns it.

The TTraceFlags type defines the individual values that can be included in the TraceFlags property. The following table summarizes those values:

Values	Meaning

tfQPrepare	Monitor Prepare statements.

tfQExecute	Monitor ExecSQL statements.

tfError	Monitor server error messages. Such messages may include an error code.

tfStmt	Monitor all SQL statements.

tfConnect	Monitor database connect and disconnect operations, including allocation of connection handles, and freeing connection handles.

tfTransact	Monitor transaction statements, such as StartTransaction, Commit, and Rollback.

tfBlob	Monitor operations on blob data types.

tfMisc	Monitor any statements not covered by other flag options.

tfVendor	Monitor direct API function calls to the database server.

Because TraceFlags is a set property, an application can specify different combinations of flags to monitor different combinations of statements. For example, the following statement limits monitoring to database connections and SQL statement preparation:


TDatabase::TransIsolation

TDatabase	Properties	See also

Specifies the transaction isolation level for transactions managed by the Borland Database Engine (BDE).

Syntax

__property TTransIsolation TransIsolation;

Description

Use TransIsolation to specify the transaction isolation level for database transactions managed by the BDE. Transaction isolation level determines how a transaction interacts with other simultaneous transactions when they work with the same tables, and how much a transaction sees of the work performed by other transactions.

Note

Applications that use passthrough SQL for handling transactions must pass a transaction isolation level directly to the database server using the appropriate SQL statement.

TransIsolation can be any one of the three values summarized in the following table:

Isolation level	Meaning

tiDirtyRead	Permits reading of uncommitted changes made to the database by other simultaneous transactions. Uncommitted changes are not permanent, and might be rolled back (undone) at any time. At this level a transaction is least isolated from the effects of other transactions.

tiReadCommitted	Permits reading of committed (permanent) changes made to the database by other simultaneous transactions. This is the default TransIsolation property value.

tiRepeatableRead	Permits a single, one-time reading of the database. The transaction cannot see any subsequent changes made by other simultaneous transactions. This isolation level guarantees that once a transaction reads a record, its view of that record does not change unless it makes a modification to the record itself. At this level, a transaction is most isolated from other transactions.

Different database servers support different levels of transaction isolation. If an application sets TransIsolation to an unsupported level for a remote SQL server, the BDE uses the next highest level supported by that server. The following table summarizes the isolation levels supported by the servers recognized by the BDE:

Server	Specified Level	Actual Level

Oracle	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiReadCommitted
tiReadCommitted
tiRepeatableRead (READONLY)

Sybase, MS-SQL	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiReadCommitted
tiReadCommitted
Not supported

DB2	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiDirtyRead
tiReadCommitted
tiRepeatableRead

Informix	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiDirtyRead
tiReadCommitted
tiRepeatableRead

InterBase	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiReadCommitted
tiReadCommitted
tiRepeatableRead

Paradox, dBASE	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiDirtyRead
Not supported
Not supported

Note

For local transactions against Paradox and dBASE, TransIsolation must be set to tiDirtyRead. Otherwise, an exception is raised.

If an application uses ODBC to interface with a server, the ODBC driver must also support the isolation level. For more information about supported isolation levels, see the documentation for the ODBC driver in question.


TDatabase events

TDatabase	Alphabetically	Legend

In TDatabase

OnLogin


TDatabase events

TDatabase	By object	Legend

OnLogin


TDatabase::OnLogin

TDatabase	Events	See also

OnLogin occurs when an application connects to a database.

Syntax

__property TLoginEvent OnLogin;

Description

Write an OnLogin event handler to take specific actions when an application attempts to connect to a database. By default, when an OnLogin event occurs, the current USERNAME is read from the Params property, and a standard Login dialog box opens. The dialog prompts for a user name and password combination, and then uses the values entered by the user to set the USERNAME and PASSWORD values in the Params property. These values are then passed to the remote server.

Applications that provide alternative OnLogin event handlers must set the USERNAME and PASSWORD values in LoginParams, but once a connection is established, the PASSWORD value can be discarded to avoid compromising server security.


TDatabase methods

TDatabase	Alphabetically

In TDatabase

~TDatabase

ApplyUpdates

Close

CloseDataSets

Commit

FlushSchemaCache

Open

Rollback

StartTransaction

TDatabase

ValidateName

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDatabase methods

TDatabase	By object

~TDatabase

ApplyUpdates

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDataSets

Close

Commit

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FlushSchemaCache

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

Rollback

StartTransaction

TDatabase

ValidateName


TDatabase::ApplyUpdates

TDatabase	Methods	See also

Posts pending cached updates for specified datasets to the database server.

Syntax

void __fastcall ApplyUpdates(const TDBDataSet *DataSets, const System::Integer DataSets_Size);

Description

Call ApplyUpdates to post pending cached updates for a specific set of open datasets to the database server. ApplyUpdates is only meaningful if the CachedUpdates property of a specified dataset is true.

DataSets is a list of dataset names specifying the datasets for which to post pending updates. DataSets need not list every currently open dataset. For each listed dataset ApplyUpdates calls the dataset’s ApplyUpdates and CommitUpdates methods to post that dataset’s pending cached updates.

Applying updates is a two-phase process that takes place within the context of the database component’s transaction control. When an application calls ApplyUpdates, the following events take place:

1	A database transaction starts.

2	Cached updates are written to the database (Phase 1).

If the database write is successful:

1	Database changes are committed, ending the transaction.

2	Cached updates are committed, clearing the internal cache buffer (Phase 2).

If the database write fails database changes are rolled back, ending the transaction.

The two-phased approach allows for effective error recovery, especially when updating multiple and interrelated datasets (for example, the datasets associated with a master/detail form).


TDatabase::Close

TDatabase	Methods	See also

Closes all open datasets associated with the database component and disconnects from the database server.

Syntax

void __fastcall Close(void);

Description

Call Close to disconnect from a database server. Disconnecting frees system resources allocated to the connection.

Note

Close is called automatically when there are no more open datasets associated with the database component and the KeepConnection property is false. A database connection can also be closed by setting the Connected property to false.


TDatabase::CloseDataSets

TDatabase	Methods	See also

Closes all datasets associated with the database component without disconnecting from the database server.

Syntax

void __fastcall CloseDataSets(void);

Description

Call CloseDataSets to close all active datasets without disconnecting from the database server. Ordinarily, when an application calls Close, all datasets are closed, and the connection to the database server is dropped. Calling CloseDataSets instead of Close ensures that an application can close all active datasets without having to reconnect to the database server at a later time.


TDatabase::Commit

TDatabase	Methods	See also

Permanently stores updates, insertions, and deletions of data associated with the current transaction, and ends the current transactions.

Syntax

void __fastcall Commit(void);

Description

Call Commit to permanently store to the database server all updates, insertions, and deletions of data associated with the current transaction and then end the transaction. The current transaction is the last transaction started by calling StartTransaction.

Note

Before calling Commit, an application may check the status of the InTransaction property. If an application calls Commit and there is no current transaction, an exception is raised.


TDatabase::FlushSchemaCache

TDatabase	Methods	See also

Flushes the cached schema information for a table.

Syntax

void __fastcall FlushSchemaCache(const System::AnsiString TableName);

Description

Call FlushSchemaCache if the schema information for an SQL table is changed (for example, because a field, index, or table is added to or dropped from a database).

When an application opens an SQL table, schema information that describes the field names, field types, and index information is stored in memory. If an application changes the schema for an SQL table, it should call FlushSchemaCache to update the schema information in memory.


TDatabase::Open

TDatabase	Methods	See also

Connects to a database server.

Syntax

void __fastcall Open(void);

Description

Call Open to establish a connection to a local or remote database server. Open verifies that the database specified by the DatabaseName or Directory properties exists, and that the user name and password are valid. If so, it connects to the database. If an OnLogin event exists for the database component, it is executed. Otherwise, the default Login dialog box appears.

Note

Setting Connected to true also connects to the database server.


TDatabase::Rollback

TDatabase	Methods	See also

Cancels all updates, insertions, and deletions for the current transaction and ends the transaction.

Syntax

void __fastcall Rollback(void);

Description

Call Rollback to cancel all updates, insertions, and deletions for the current transaction and to end the transaction. The current transaction is the last transaction started by calling StartTransaction.

Note

Before calling Rollback, an application may check the status of the InTransaction property. If an application calls Rollback and there is no current transaction, an exception is raised.


TDatabase::StartTransaction

TDatabase	Methods	See also

Begins a new transaction against the database server.

Syntax

void __fastcall StartTransaction(void);

Description

Call StartTransaction to begin a new transaction against the database server. Before calling StartTransaction, an application should check the status of the InTransaction property. If InTransaction is true, indicating that a transaction is already in progress, a subsequent call to StartTransaction without first calling Commit or Rollback to end the current transaction raises an exception.

Updates, insertions, and deletions that take place after a call to StartTransaction are held by the server until an application calls Commit to save the changes or Rollback is to cancel them.


TDatabase::ValidateName

TDatabase	Methods	See also

Raises an exception if a specified database is already open in the active session.

Syntax

void __fastcall ValidateName(const System::AnsiString Name);

Description

Call ValidateName to prevent duplicate access to a database from within a single session. Name is a string containing the name of the database to test. If the database is already open, ValidateName raises the EDatabaseError exception. If the database is not open, the procedure returns, and the application continues processing.

Note

Most applications should not need to call this method directly. It is called automatically each time a database is opened.


TDatabase::TDatabase

TDatabase	Methods	See also

TDatabase creates a new TDatabase object.

Syntax

__fastcall virtual TDatabase(Classes::TComponent *AOwner);

Description

Use TDatabase to create a new TDatabase object.


TDatabase::~TDatabase

TDatabase	Methods	See also

~TDatabase frees the memory associated with the TDatabase object.

Syntax

__fastcall virtual ~TDatabase(void);

Description

Do not call ~TDatabase directly. Instead, use the delete keyword on the object, which causes ~TDatabase to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDatabase example

TDatabase


TDataLink

Hierarchy	Properties	Methods	See also

TDataLink is a helper class used by data-aware objects to coordinate the actions of TDataSource and TDataSet, and to respond to data events.

Header

vcl/db.hpp

Description

Use TDataLink or one of its descendents in any data-aware object that implements a DataSource property to represent its link to a dataset, or that needs to respond to data events.

The constructor of the data-aware object should call the constructor of TDataLink, and initialize any relevant properties. The data-aware object can then link to a TDataSource by using the DataSource property of the TDataLink.

Data-aware objects that link to a single field in a dataset should use a TFieldDataLink instead.


TDataLink properties

TDataLink	Alphabetically	Legend

In TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TDataLink properties

TDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TDataLink::Active

TDataLink	Properties	See also

Active specifies whether or not the dataset that the TDataLink manages is active.

Syntax

__property System::Boolean Active;

Description

Read Active to determine whether the dataset for this TDataLink is Active. When Active is false, the dataset is closed, and the dataset cannot read data from or write data to the database. When Active is true, data can be read from and written to the dataset.


TDataLink::ActiveRecord

TDataLink	Properties	See also

ActiveRecord specifies the index of the current record within the internal set of records buffer maintained by the dataset for the Owner of the TDataLink object.

Syntax

__property System::Integer ActiveRecord;

Description

Use ActiveRecord to discover or set the current record in the set of one or more records managed by the dataset. The set of records managed by the dataset corresponds to the number of records from the dataset visible at one time. For example, when the TDataLink object is owned by a data-aware grid, the set of records managed by the dataset corresponds to the number of rows shown by the grid, and the ActiveRecord represents the current row.


TDataLink::BufferCount

TDataLink	Properties	See also

BufferCount specifies the size of the set of records maintained by the dataset for the Owner of the TDataLink object.

Syntax

__property System::Integer BufferCount;

Description

Set BufferCount to tell the dataset how many records to buffer together to service the owner of the TDataLink object. For example, a data-aware grid sets BufferCount to the number of rows visible in the grid.

Read BufferCount to iterate through all the records buffered by the dataset for the owner of the TDataLink object. For example, A data-aware object can paint itself by cycling through the set of records, moving the ActiveRecord to visit each record in turn.


TDataLink::DataSet

TDataLink	Properties	See also

DataSet specifies the DataSet object which represents the data in the database that this TDataLink is tracking.

Syntax

__property TDataSet * DataSet;

Description

Read DataSet to determine the dataset that this TDataLink is helping to manage. The TDataLink responds to data events that are received by the DataSet, and makes changes to the dataset on behalf of the object that owns the TDataLink object..


TDataLink::DataSource

TDataLink	Properties	See also

DataSource specifies the TDataSource object that the Owner of the TDataLink uses to connect to the dataset.

Syntax

__property TDataSource * DataSource;

Description

Use DataSource to determine or set the TDataSource object that connects to the dataset. TDataLink responds to data events that the DataSource receives.

Note

To implement the DataSource property of a data-aware object which owns a TDataLink or its descendant, create a method that gets or sets the DataSource property of the TDataLink-derived member.


TDataLink::DataSourceFixed

TDataLink	Properties	See also

DataSourceFixed indicates whether the DataSource property can be set.

Syntax

__property System::Boolean DataSourceFixed;

Description

Use DataSourceFixed to determine whether the DataSource property can be changed. By default, DataSourceFixed is false, allowing the DataSource property to be changed.

Before performing data operations when there is a chance that an asynchronous event might change the DataSource before the operation completes, set DataSourceFixed to true to ensure that the DataSource is constant throughout the operation. Once the data operation is complete, DataSourceFixed can be set back to false.

Set DataSourceFixed to prevent the DataSource of a data-aware object that owns the TDataLink from being changed once it is set.


TDataLink::Editing

TDataLink	Properties	See also

Editing indicates whether the DataSource is in edit mode.

Syntax

__property System::Boolean Editing;

Description

Read Editing to determine whether the DataSource is inserting a new record into the dataset, or modifying the current record. To change the dataset into edit mode, and hence the Editing property to true, use the Edit method.


TDataLink::ReadOnly

TDataLink	Properties	See also

ReadOnly indicates whether the dataset for this TDataLink can be modified.

Syntax

__property System::Boolean ReadOnly;

Description

Use ReadOnly to determine whether the dataset for this TDataLink can be modified. Setting ReadOnly to true causes any subsequent calls to the Edit method to fail, and changes the DataSource out of an editing state if it is in one. Setting ReadOnly to false enables changes to the data in the dataset.


TDataLink::RecordCount

TDataLink	Properties	See also

RecordCount indicates the number of records in the internal record buffer maintained for the Owner of the TDataLink object by the dataset.

Syntax

__property System::Integer RecordCount;

Description

Read RecordCount to determine the number of actual records in the buffer maintained by the dataset for the Owner of this TDataLink. In most cases, this is the same as BufferCount. RecordCount indicates the number of records actually in the record buffer of the dataset, as opposed to the number of records that the dataset can possibly maintain. For example, a data-aware grid with four rows could have one record actually showing data. In this case, BufferCount would be 4, while RecordCount would be 1.


TDataLink methods

TDataLink	Alphabetically	Legend

In TDataLink

~TDataLink

ActiveChanged

CheckBrowseMode

DataSetChanged

DataSetScrolled

Edit

EditingChanged

FocusControl

LayoutChanged

RecordChanged

TDataLink

UpdateData

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataLink methods

TDataLink	By object	Legend

~TDataLink

ActiveChanged

Assign

CheckBrowseMode

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DataSetScrolled

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FocusControl

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

TDataLink

UpdateData

UpdateRecord


TDataLink::ActiveChanged

TDataLink	Methods	See also

ActiveChanged responds to changes in the Active property.

Syntax

virtual void __fastcall ActiveChanged(void);

Description

The ActiveChanged method defined by TDataLink does nothing other than provide an interface for a method that can respond to changes in the Active Property. Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink::CheckBrowseMode

TDataLink	Methods	See also

CheckBrowseMode allows the data-aware object to respond just before an event that changes the dataset.

Syntax

virtual void __fastcall CheckBrowseMode(void);

Description

The CheckBrowseMode method defined by TDataLink does nothing other than provide an interface for a method that can update any state information just before a change to the dataset occurs. Derived objects that do not need to respond to these events can allow the inherited method to ignore them.


TDataLink::DataSetChanged

TDataLink	Methods	See also

DataSetChanged responds to changes in the dataset.

Syntax

virtual void __fastcall DataSetChanged(void);

Description

DataSetChanged responds to changes to the contents of the dataset. Anything that changes the contents of the dataset, whether it be editing the data, inserting or deleting records, or changing the key triggers this method. Changes specific to the representation of the data within the data-aware object, such as scrolling the dataset or changing the layout of data elements within the object, also trigger this method. DataSetChanged simply calls RecordChanged. Derived classes can override this procedure to make additional adjustments to changes in the dataset.


TDataLink::DataSetScrolled

TDataLink	Methods	See also

DataSetScrolled allows a response to scrolling the representation of the dataset within the data-aware object.

Syntax

virtual void __fastcall DataSetScrolled(System::Integer Distance);

Description

DataSetScrolled ignores the Distance parameter and simply calls DataSetChanged. Derived classes can override this procedure to make additional adjustments when the dataset scrolls.


TDataLink::Edit

TDataLink	Methods	See also

Edit attempts to drive the DataSource into an editing state if it is not already in one.

Syntax

System::Boolean __fastcall Edit(void);

Description

Use Edit to try to ensure that the current record can be modified. A return value of true indicates that the DataSource was already in an editing state, or that it was successfully changed to allow editing. A return value of false indicates that the DataSource could not be changed to allow editing. For example, if the ReadOnly property is true, Edit will fail to allow editing, and return false.


TDataLink::EditingChanged

TDataLink	Methods	See also

EditingChanged responds to changes in the editing state of the DataSource.

Syntax

virtual void __fastcall EditingChanged(void);

Description

The EditingChanged method defined by TDataLink does nothing other than provide an interface for a method that can respond to changes in the editing state of the DataSource. EditingChanged is called immediately after the Editing property has changed its value. Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink::FocusControl

TDataLink	Methods	See also

FocusControl provides an interface for a method to force focus to the data-aware component associated with the TDataLink.

Syntax

virtual void __fastcall FocusControl(TFieldRef Field);

Description

The FocusControl method defined by TDataLink does nothing other than provide an interface for a method that can force the input focus to a data-aware object associated witht the TDataLink. Derived objects that do not need this capability can allow the inherited method to ignore the request.


TDataLink::LayoutChanged

TDataLink	Methods	See also

LayoutChanged responds to changes in the representation of the data by the data-aware object.

Syntax

virtual void __fastcall LayoutChanged(void);

Description

The LayoutChanged method simply calls the DataSetChanged method. LayoutChanged is intended to provide an interface for a method that can respond after changes in the representation of the data by the data-aware object. An example of such a change would be changing the number or order of the columns in a TCustomDBGrid.


TDataLink::RecordChanged

TDataLink	Methods	See also

RecordChanged responds to changes in the contents of the current record or field of the dataset.

Syntax

virtual void __fastcall RecordChanged(TField *Field);

Description

The RecordChanged method defined by TDataLink does nothing other than provide an interface for a method that can respond to changes to the contents of the current record. RecordChanged is called after changes have been posted to the current record in the dataset, and from DataSetChanged.

The Field parameter indicates which field of the current record has changed in value. If Field is NULL, any number of fields within the current record may have changed.

Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink::UpdateData

TDataLink	Methods	See also

UpdateData provides an interface for posting any edits to the dataset, while temporarily preventing calls to RecordChanged that might arise from posting the edits.

Syntax

virtual void __fastcall UpdateData(void);

Description

The UpdateData method defined by TDataLink does nothing other than provide an interface for a method that posts updates to the current dataset while avoiding calls to RecordChanged that posting the changes may trigger. Derived objects that do not need to post edits to the dataset can allow the inherited method to ignore them.


TDataLink::UpdateRecord

TDataLink	Methods	See also

UpdateRecord responds to notifications that edits should be posted to the dataset.

Syntax

void __fastcall UpdateRecord(void);

Description

UpdateRecord simply calls UpdateData after guarding against calls to RecordChanged which may arise while UpdateData is executing.


TDataLink::TDataLink

TDataLink	Methods	See also

TDataLink creates a new TDataLink object.

Syntax

__fastcall TDataLink(void);

Description

Use TDataLink to create a new TDataLink object.


TDataLink::~TDataLink

TDataLink	Methods	See also

~TDataLink frees the memory associated with the TDataLink object.

Syntax

__fastcall virtual ~TDataLink(void);

Description

Do not call ~TDataLink directly. Instead, use the delete keyword on the object, which causes ~TDataLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TDataLink example

TDataLink


TDataModule

Hierarchy	Properties	Methods	Events

Header

vcl/forms.hpp

Description


TDataModule properties

TDataModule	Alphabetically	Legend

In TDataModule

DesignOffset

DesignSize

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDataModule properties

TDataModule	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

Owner

Tag


TDataModule::DesignOffset

TDataModule	Properties

Syntax

__property Windows::TPoint DesignOffset;

Description


TDataModule::DesignSize

TDataModule	Properties

Syntax

__property Windows::TPoint DesignSize;

Description


TDataModule events

TDataModule	Alphabetically	Legend

In TDataModule

OnCreate

OnDestroy


TDataModule events

TDataModule	By object	Legend

OnCreate

OnDestroy


TDataModule::OnCreate

TDataModule	Events

Syntax

__property Classes::TNotifyEvent OnCreate;

Description


TDataModule::OnDestroy

TDataModule	Events

Syntax

__property Classes::TNotifyEvent OnDestroy;

Description


TDataModule methods

TDataModule	Alphabetically

In TDataModule

~TDataModule

CreateNew

TDataModule

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataModule methods

TDataModule	By object

~TDataModule

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateNew

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDataModule


TDataModule::CreateNew

TDataModule	Methods

Syntax

Description


TDataModule::TDataModule

TDataModule	Methods	See also

TDataModule creates a new TDataModule object.

Syntax

__fastcall virtual TDataModule(Classes::TComponent *AOwner);

Description

Use TDataModule to create a new TDataModule object.


TDataModule::~TDataModule

TDataModule	Methods	See also

~TDataModule frees the memory associated with the TDataModule object.

Syntax

__fastcall virtual ~TDataModule(void);

Description

Do not call ~TDataModule directly. Instead, use the delete keyword on the object, which causes ~TDataModule to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataModule example

TDataModule


TDataSet

Hierarchy	Properties	Methods	Events	See also

TDataSet is the abstract class for all dataset components that represent data in tables in a database.

Header

vcl/db.hpp

Description

TDataSet is the object that encapsulates the data in a database, such as a table or a result set returned by a query. An application never directly creates or uses TDataSet. Instead it reads or writes data to a database by using the descendants of TDataSet and TDBDataSet: TTable, TQuery, and TStoredProc.

Developers who derive custom dataset objects should derive them from TDataSet or TDBDataSet, depending on their needs. Developers who are deriving custom dataset objects that bypass the Borland Database Engine (BDE) should derive from TDataSet. TDBDataSet adds BDE support for database connections and session management to the fundamental dataset support in TDataSet.


TDataSet properties

TDataSet	Alphabetically	Legend

In TDataSet

Active

AutoCalcFields

BOF

Bookmark

CachedUpdates

CanModify

DataSource

DefaultFields

Designer

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDataSet properties

TDataSet	By object	Legend

Active

AutoCalcFields

BOF

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSource

DefaultFields

Designer

DesignInfo

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

KeySize

Locale

Modified

Owner

RecNo

RecordCount

RecordSize

State

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending


TDataSet::Active

TDataSet	Properties	See also

Specifies whether or not a dataset is open.

Syntax

__property System::Boolean Active;

Description

Use Active to determine or set a dataset’s connection to data in a database. When Active is false, the dataset is closed; the dataset cannot read data from or write data to the database. When Active is true, data can be read from and written to the database.

Setting Active to true:

•	Triggers the BeforeOpen event handler if one is defined for the dataset.

•	Sets the dataset state to dsBrowse.

•	Opens a Borland Database Engine (BDE) cursor into the dataset.

•	Triggers the After Open event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and the cursor is closed.

An application must set Active to false before changing other properties that affect the status of the database or the controls that display data in an application. For example, to change the DataSource property for a dataset, Active must first be set to false, ensuring that the dataset is closed. Setting Active to false puts the dataset into dsInactive state and closes the BDE cursor.

Note

Calling the Open method sets Active to true; calling the Close method sets Active to false.


TDataSet::AutoCalcFields

TDataSet	Properties	See also

Determines when the OnCalcFields event is triggered.

Syntax

__property System::Boolean AutoCalcFields;

Description

Set AutoCalcFields to control when the OnCalcFields event is triggered to update calculated fields during dataset processing. A calculated field is one that derives its value from the values of one or more fields in the dataset, sometime with additional processing. When AutoCalcFields is true, OnCalcFields is triggered when:

•	A dataset is opened.

•	Focus moves from one visual control to another, or from one column to another is a data-aware grid control.

•	A record is retrieved from a database.

To reduce the frequency with which OnCalcFields is called, set AutoCalcFields to false. When AutoCalcFields is false, OnCalcFields is only called when Post is called. If an application permits users to change data, OnCalcFields is frequently triggered. In these cases an application may set AutoCalcFields to false to reduce the frequency with which AutoCalcFields is called.


TDataSet::BOF

TDataSet	Properties	See also

Indicates whether or not a cursor is positioned at the first record in a dataset.

Syntax

__property System::Boolean BOF;

Description

Test BOF to determine if the cursor is positioned at the first record in a dataset. If BOF is true, the cursor is unequivocally on the first row in the dataset. BOF is true when an application:

•	Opens a dataset.

•	Calls a dataset’s First method.

•	Call a dataset’s Prior method, and the method fails (because the cursor is already on the first row in the dataset).

•	Calls SetRange on an empty range or dataset.

BOF is false in all other cases. An application should assume BOF is false unless one of the conditions above is met and the application tests the property directly.

Tip

If both BOF and EOF are true, a dataset or range is empty.


TDataSet::Bookmark

TDataSet	Properties	See also

Specifies the current bookmark in the dataset.

Syntax

void __fastcall FreeBookmark(System::Pointer Bookmark);

Description

Bookmark gets or sets the current bookmark in a dataset. A bookmark provides a convenient way to mark a location in a dataset so that an application can easily return to that location quickly. An application can read Bookmark to determine the current bookmark, and it can set Bookmark to a specific value to change the current bookmark.


TDataSet::CachedUpdates

TDataSet	Properties	See also

Specifies whether or not cached updates are enabled for a dataset.

Syntax

__property System::Boolean CachedUpdates;

Description

CachedUpdates enables or disables the use of cached updates for a dataset. If CachedUpdates is true, cached updates are enabled. If CachedUpdates is false, cached updates are disabled.

When cached updates are enabled, updates to a dataset (such as posting changes, inserting new records, or deleting records), are stored in an internal cache on the client machine instead of being written directly to the dataset’s underlying database tables. When changes are complete, an application writes all cached changes to the database in the context of a single transaction.

Cached updates are most useful to client applications working with remote database servers. The main benefits of enabling cached updates are:

•	Fewer transactions and shorter transaction times.

•	Minimization of network traffic.

The potential drawbacks of enabling cached updates are:

•	Other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database.

•	Other applications cannot access data changes made by an application until its cached updates are applied to the database.


TDataSet::CanModify

TDataSet	Properties	See also

Indicates whether or not the database underlying a dataset permits write access to data.

Syntax

__property System::Boolean CanModify;

Description

Examine CanModify to determine if the database underlying a dataset permits write access to data. When a database connection is established, a dataset typically requests write access. CanModiy indicates whether or not write access is granted. If CanModiy is true, data can be modified and written to the database server. If CanModify is false, data can be viewed, but not modified.

Note

Restrictions on write access for a given user may still prevent writing to an SQL database server even if CanModify is true.


TDataSet::DataSource

TDataSet	Properties	See also

Returns NULL for datasets that cannot specify a data source.

Syntax

void __fastcall AddDataSource(TDataSource *DataSource);

Description

DataSource is a property that returns NULL if a dataset cannot specify its own data source.

Descendant dataset objects that support specifying a data source redeclare and implement methods for getting and setting the DataSource property.


TDataSet::DefaultFields

TDataSet	Properties	See also

Indicates whether or not a dataset’s underlying field components are generated dynamically when the dataset is opened.

Syntax

__property System::Boolean DefaultFields;

Description

Read DefaultFields to determine whether or not a dataset uses dynamically generated field components, or persistent field components. If DefaultFields is true, the dataset uses dynamically allocated field components. If DefaultFields is false, the dataset uses persistent field components.

A dataset always creates dynamic field components based on the structure of its underlying database table or tables when the dataset is opened unless persistent field components are assigned to a dataset at design time using the Fields editor.


TDataSet::Designer

TDataSet	Properties	See also

Returns a NULL pointer to the dataset designer for the dataset.

Syntax

__property TDataSetDesigner * Designer;

Description

Designer is a property that returns NULL for a dataset that does not specify a dataset designer. A dataset designer, such as the Fields editor, enables a developer to specify the fields that belong to a dataset at design time.

Descendant dataset objects that support specifying a data set designer redeclare and implement methods for getting and setting the Designer property.


TDataSet::EOF

TDataSet	Properties	See also

Indicates whether or not a cursor is positioned at the last record in a dataset.

Syntax

__property System::Boolean Eof;

Description

Test EOF to determine if the cursor is positioned at the last record in a dataset. If EOF is true, the cursor is unequivocally on the last row in the dataset. EOF is true when an application:

•	Opens an empty dataset.

•	Calls a dataset’s Last method.

•	Call a dataset’s Next method, and the method fails (because the cursor is already on the last row in the dataset).

•	Calls SetRange on an empty range or dataset.

EOF is false in all other cases. An application should assume EOF is false unless one of the conditions above is met and the application tests the property directly.

Tip

If both EOF and BOF are true, a dataset or range is empty.


TDataSet::ExpIndex

TDataSet	Properties

Indicates whether or not a dataset is using a dBASE expression index.

Syntax

__property System::Boolean ExpIndex;

Description

Read ExpIndex to determine if a dataset is using a dBASE expression index. If ExpIndex is true, an expression index is in use; otherwise ExpIndex is false.


TDataSet::FieldCount

TDataSet	Properties	See also

Indicates the number of field components associated with the dataset.

Syntax

__property System::Integer FieldCount;

Description

Examine FieldCount to determine the number of fields associated with the dataset. For datasets with dynamically-created fields, FieldCount may differ each time a dataset is opened. For datasets with persistent fields, FieldCount should be unchanged each time a dataset is open.


TDataSet::FieldDefs

TDataSet	Properties	See also

Points to the list of field definitions for the dataset.

Syntax

__property TFieldDefs * FieldDefs;

Description

FieldDefs points to an internal list of field definitions for a dataset. While an application can examine FieldDefs to explore the field definitions for a dataset, it should not change these definitions FieldDefs is primarily intended for internal use by the other properties, events, and methods of TDataSet and its descendants.

To access fields and field values in a dataset, use the Fields and FieldValues properties, and the FieldsByName method.


TDataSet::Fields

TDataSet	Properties	See also

Provides an indexed array of all field components for a dataset.

Syntax

Bde::hDBIFilter __fastcall CreateLookupFilter(Classes::TList *Fields, const System::Variant &Values

Description

Use Fields to access field components by index number. Fields is a zero-based array. If fields are generated dynamically at run time, the order of field components in Fields corresponds directly to the order of columns in the table or tables underlying a dataset. If a dataset uses persistent fields, then the order of field components corresponds to the ordering of fields specified in the Fields editor at design time.

Accessing fields with the Fields property is useful for applications that:

•	Iterate over some or all fields in a dataset.

•	Work with underlying tables whose internal data structure is unknown at run time.

If an application knows the data types of individual fields, then it can read or write individual field values through the Fields property. For example, the following statement assigns a field value to the Text property of an edit box:

The next statements assigns a value from an edit box to a field:

Note

The preferred method for retrieving and assigning field values is to use the FieldValues property.


TDataSet::FieldValues

TDataSet	Properties	See also

Provides access to the values for all fields in the current record for the dataset

Syntax

__property System::Variant FieldValues[System::AnsiString FieldName];

Description

Use FieldValues to read and write values for fields in a dataset. FieldName is the name of a field to read from or write to, and must be enclosed in single quotes.

FieldValues accepts or returns a Variant type, so it can be used with fields of any type. For example, the following statement writes the value from an edit box into an integer field:

The next statements reads a string value from a field into an edit box:


TDataSet::Filter

TDataSet	Properties	See also

Specifies the text of the current filter for a dataset.

Syntax

void __fastcall SetFilterHandle(Bde::hDBIFilter &Filter, Bde::hDBIFilter Value);

Description

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available to an application. Filter contains the string that describes the filter condition. For example, the following filter condition displays only those records where the State field is 'CA' or 'MA':

Note

Applications can set Filter at run time to change the filtering condition for a dataset at (for example, in response to user input). Such applications should not also use the OnFilterRecord event handler unless they can guarantee that the interaction of the Filter property and the filter test conditions in the event handler do not result in an empty filter set.


TDataSet::Filtered

TDataSet	Properties	See also

Specifies whether or not filtering is active for a dataset.

Syntax

__property System::Boolean Filtered;

Description

Check Filtered to determine whether or not dataset filtering is in effect. If Filtered is true, then filtering is active. Otherwise Filtered is false. To apply filter conditions specified in the Filter property or the OnFilterRecord event handler, set Filtered to true.

Note

When filtering is enabled, user edits to a record may mean that the record no longer meets a filter’s test condition. The next time the record is retrieved from the dataset while the filter is in effect, the record may seem to disappear. If that happens, the next record that passes the filter condition becomes the current record.


TDataSet::FIlterOptions

TDataSet	Properties	See also

Specifies whether or not filtering is case insensitive, and whether or not partial comparisons are permitted when filtering records.

Syntax

__property TFilterOptions FilterOptions;

Description

Set FilterOptions to specify whether or not filtering is case insensitive when filtering on string or character fields, and whether or not partial comparisons for matching filter conditions is allowed.

By default, FilterOptions is set to an empty set. For filters based on string fields, set FilterOptions to foCaseInsensitive to catch all variations on a string regardless of capitalization. For filter conditions based on multiple conditions or fields, set FilterOptions to foNoPartialCompare to force exact matches only on comparison. As with all sets, both filter conditions can be set at the same time.


TDataSet::Found

TDataSet	Properties	See also

Indicates whether or not moving to a different record is successful or not.

Syntax

__property System::Boolean Found;

Description

Check the status of Found to determine if a call to FindFirst, FindLast, FindNext, FindPrior, First, Last, Next, or Prior succeeds. If Found is true, success is indicated. If false, the move to a different record failed.


TDataSet::Handle

TDataSet	Properties	See also

Specifies the Borland Database Engine (BDE) cursor handle for the dataset.

Syntax

__property Bde::hDBICur Handle;

Description

Use Handle only to bypass TDataSet methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a dataset is opened.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++ Builder components.


TDataSet::KeySize

TDataSet	Properties	See also

Indicates the size of the current key used for the dataset.

Syntax

__property System::Word KeySize;

Description

Examine KeySize to determine the size of the current key used for the dataset. KeySize corresponds to the size of the key fields in the primary index for the dataset. For dBASE tables that use expression indexes, KeySize corresponds to the size of the expression index.


TDataSet::Locale

TDataSet	Properties	See also

Identifies the Borland Database Engine (BDE) language driver for the dataset.

Syntax

__property System::Pointer Locale;

Description

Examine Locale to determine the BDE language driver for the dataset. Applications that make direct calls to the BDE API may need to pass Locale information as a function parameter.

Language driver information may also be available as one of the values in the Params property of the database component that owns the dataset.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++ Builder components.


TDataSet::Modified

TDataSet	Properties	See also

Indicates whether or not the current record is modified.

Syntax

__property System::Boolean Modified;

Description

Check Modified to determine if the current record is modified. If Modified is true, the current record is modified. If false, the current record is not modified.

Note

In general, an application need not check the status of Modified. Properties, events, and methods of TDataSet and its descendants that modify records generally check this status automatically and take appropriate actions based on its value.


TDataSet::RecNo

TDataSet	Properties	See also

Indicates the current record in the dataset.

Syntax

System::Smallint __stdcall RecordFilter(System::Pointer RecBuf, System::Integer RecNo);

Description

Examine RecNo to determine the record number of the current record in the dataset. Applications might use this property with RecordCount to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, Next, and Prior.


TDataSet::RecordCount

TDataSet	Properties	See also

Indicates the total number of records associated with the dataset.

Syntax

__property System::Longint RecordCount;

Description

Examine RecordCount to determine the total number of records in the dataset. Applications might use this property with RecNo to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, and Prior.


TDataSet::RecordSize

TDataSet	Properties	See also

Indicates the size of a record in the dataset.

Syntax

__property System::Word RecordSize;

Description

Examine RecordSize to determine the physical size, in bytes, of the buffer Borland C++ Builder allocates to hold a record in the dataset. When a dataset is opened, the Open procedure requests record-buffer size information from the Borland Database Engine (BDE) and stores the returned information in RecordSize. Borland C++ Builder uses this information internally. Applications seldom, if ever, require this information.


TDataSet::State

TDataSet	Properties	See also

Indicates the current operating mode of the dataset.

Syntax

__property TDataSetState State;

Description

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data. The following table lists all possible values for State and describes what they indicate:

Value	Meaning

dsInactive	Dataset is closed, so its data is unavailable.

dsBrowse	Data can be viewed, but not changed. This is the default state of an open dataset.

dsEdit	Current record can be modified.

dsInsert	A new record can be inserted.

dsSetKey	TTable only. Record searching is enabled, or a SetRange operation is under way. A restricted set of data can be viewed, and no data can be edited or inserted.

dsCalcFields	An OnCalcFields event is in progress. Noncalculated fields cannot be edited, and new records cannot be inserted.

dsUpdateNew	Cached update processing in progress. No data can be edited or inserted.

dsUpdateOld	Cached update processing in progress. No data can be edited or inserted.

dsFilter	An OnFilterRecord event is in progress. A restricted set of data can be viewed. No data can edited or inserted.

Opening a dataset changes State from dsInactive to dsBrowse. An application can call Edit to put a dataset into dsEdit state, or call Insert to put a dataset into dsInsert state. If a dataset is a TTable object, an application can call SetKey or SetRange to put the dataset into dsSetKey state.

Posting or cancelling edits, insertions, or deletions, changes State from its current state to dsBrowse. Closing a dataset changes its state to dsInactive.

Some states, such as dsCalcFields, dsFilter, dsUpdateNew, and dsUpdateOld cannot be seen or set directly by an application. These states are automatically set when OnCalcField and OnFilterRecord events occur, or when cached updates are processed.


TDataSet::UpdateObject

TDataSet	Properties	See also

Specifies the update object component used to update a read-only result set when cached updates are enabled.

Syntax

__property TDataSetUpdateObject * UpdateObject;

Description

Use UpdateObject to specify the TUpdateObject component to use in an application that must be able to update a read-only result set returned by the Borland Database Engine (BDE).

The BDE always attempts to provide an updateable, or “live” query result unless an application specifically requests a read-only view of data. In some cases, such as a query made against multiple tables, a live result set cannot be returned. In these cases, UpdateObject can be used to specify a helper object that performs updates as a separate transaction that is transparent to the application.


TDataSet::UpdateRecordTypes

TDataSet	Properties	See also

Specifies the type of records visible in a dataset when cached updates are enabled.

Syntax

__property TUpdateRecordTypes UpdateRecordTypes;

Description

Use UpdateRecordTypes to specify the records that are visible in a dataset when cached updates are enabled. UpdateRecordTypes is a set that can have the following values:

Value	Meaning

rtModified	Modified records are visible.

rtInserted	Inserted records are visible.

rtDeleted	Deleted records are visible.

rtUnmodified	Unmodified records are visible.

By default, a dataset is created with an UpdateRecordTypes set of [rtModified, rtInserted, rtUnmodified], meaning that all existing, edited, or inserted records are visible to the user.

An application that must cycle through a dataset to undelete records may change UpdateRecordTypes as part of an undelete method, so that deleted records are “visible” long enough to restore them to their previously undeleted conditions.

An application might also use UpdateRecordTypes like a filter to temporarily limit visible records to those added or inserted by the user during the current session.


TDataSet::UpdatesPending

TDataSet	Properties	See also

Indicates whether or not the cached updates buffer contains records that are not yet applied.

Syntax

__property System::Boolean UpdatesPending;

Description

Examine UpdatesPending to check the status of the cached updates buffer. If UpdatesPending is true, then there are edited, deleted, or inserted records to apply to the database. If UpdatesPending is false, there are no records in the buffer.


TDataSet events

TDataSet	Alphabetically	Legend

In TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDataSet events

TDataSet	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDataSet::AfterCancel

TDataSet	Events	See also

AfterCancel occurs after an application completes a request to cancel modifications to the current record.

Syntax

__property TDataSetNotifyEvent AfterCancel;

Description

Write an AfterCancel event handler to take specific action after an application cancels changes to the current record. AfterCancel is called by the Cancel method after it updates the BDE cursor position, releases the lock on the current record if necessary, and sets the dataset state to dsBrowse. If an application requires additional processing before returning control to a user after a Cancel event, code it in the AfterCancel event.


TDataSet::AfterClose

TDataSet	Events	See also

AfterClose occurs after an application closes a dataset.

Syntax

__property TDataSetNotifyEvent AfterClose;

Description

Write an AfterClose event handler to take specific action immediately after an application closes a dataset. For example, as a security measure, an application might clear a PASSWORD entry from the Params property of a database component when the dataset is closed.

AfterClose is called after a dataset is closed and the dataset state is set to dsInactive.


TDataSet::AfterDelete

TDataSet	Events	See also

AfterDelete occurs after an application deletes a record.

Syntax

__property TDataSetNotifyEvent AfterDelete;

Description

Write an AfterDelete event handler to take specific action immediately after an application deletes the current record in a dataset. AfterDelete is called by Delete after it deletes the record, sets the dataset state to dsBrowse, and repositions the cursor on the record prior to the one just deleted.


TDataSet::AfterEdit

TDataSet	Events	See also

AfterEdit occurs after an application edits a record.

Syntax

__property TDataSetNotifyEvent AfterEdit;

Description

Write an AfterEdit event handler to take specific action immediately after an application edits a record. AfterEdit is called by Edit after it enables editing of a record, recalculates calculated fields, and calls the data event handler to process a record change.


TDataSet::AfterInsert

TDataSet	Events	See also

AfterInsert occurs after an application inserts a new record.

Syntax

__property TDataSetNotifyEvent AfterInsert;

Description

Write an AfterInsert event handler to take specific action immediately after an application inserts a record. AfterInsert is called by Insert and Append after inserting or appending a new record.


TDataSet::AfterOpen

TDataSet	Events	See also

AfterOpen occurs after an application completes opening a dataset and before any data access occurs.

Syntax

__property TDataSetNotifyEvent AfterOpen;

Description

Write an AfterOpen event handler to take specific action immediately after an application opens the dataset. AfterOpen is called after the BDE cursor for the dataset is opened and the dataset is put into dsBrowse state. For example, an AfterOpen event handler might check the system registry to determine the last record touched in the dataset the previous time the application ran, and position the cursor at that record.


TDataSet::AfterPost

TDataSet	Events	See also

AfterPost occurs after an application writes the current record to the database or cache and before the dataset is returned to browse state.

Syntax

__property TDataSetNotifyEvent AfterPost;

Description

Write an AfterPost event handler to take specific action immediately after an application posts a change to the current record. AfterPost is called after a modification, deletion, or insertion is made to a record.


TDataSet::BeforeCancel

TDataSet	Events	See also

BeforeCancel occurs before an application executes a request to cancel changes to the current record.

Syntax

__property TDataSetNotifyEvent BeforeCancel;

Description

Write a BeforeCancel event to take specific action before an application carries out a request to cancel changes. BeforeCancel is called by the Cancel method before it cancels a dataset operation such as Edit, Insert, or Delete.

An application might use the BeforeCancel event to record a user’s changes in an undo buffer.


TDataSet::BeforeClose

TDataSet	Events	See also

BeforeClose occurs before an application executes a request to close the dataset.

Syntax

__property TDataSetNotifyEvent BeforeClose;

Description

Write a BeforeClose event to take specific action before an application closes a dataset. Calling Close or setting the Active property to false results in a call to the BeforeClose event handler.


TDataSet::BeforeDelete

TDataSet	Events	See also

BeforeDelete occurs before an application attempts to delete the current record.

Syntax

__property TDataSetNotifyEvent BeforeDelete;

Description

Write a BeforeDelete event handler to take specific action before an application deletes the current record. BeforeDelete is called by Delete before it actually deletes a record.

Making use of this event an application might, for example, display a dialog box asking for confirmation before deleting the record. On denial of confirmation, the application could abort the deletion by calling the Abort procedure.


TDataSet::BeforeEdit

TDataSet	Events	See also

BeforeEdit occurs before an application enters edit mode for the current record.

Syntax

__property TDataSetNotifyEvent BeforeEdit;

Description

Write a BeforeEdit event handler to take specific action before an application enables editing of the current record. For example, an application might keep a log of database edits, and therefore might record the edit request, time, and user in a BeforeEdit event before entering edit state.


TDataSet::BeforeInsert

TDataSet	Events	See also

BeforeInsert occurs before an application enters insert mode.

Syntax

__property TDataSetNotifyEvent BeforeInsert;

Description

Write a BeforeInsert event handler to take specific action before an application inserts or appends a new record. BeforeInsert is called by Insert or Append before they set the dataset into dsInsert state.


TDataSet::BeforeOpen

TDataSet	Events	See also

BeforeOpen occurs before an application executes a request to open a dataset.

Syntax

__property TDataSetNotifyEvent BeforeOpen;

Description

Write a BeforeOpen event handler to take specific action before an application opens a dataset for viewing or editing. BeforeOpen is triggered when an application sets the Active property to true for a dataset or an application calls Open.


TDataSet::BeforePost

TDataSet	Events	See also

BeforePost occurs before an application posts changes for the current record to the database or cache.

Syntax

__property TDataSetNotifyEvent BeforePost;

Description

Write a BeforePost event handler to take specific action before an application posts dataset changes to the database. BeforePost is triggered when an application calls the Post method. Post checks to make sure all required fields are present, then calls BeforePost before posting the record.

An application might use BeforePost to perform validity checks on data changes before posting them to the database. If it encountered a validity problem, it could call Abort to cancel the Post operation.


TDataSet::OnCalcFields

TDataSet	Events	See also

OnCalcFields occurs when an application recalculates calculated fields.

Syntax

__property TDataSetNotifyEvent OnCalcFields;

Description

Write an OnCalcFields event handler to take specific action when an application recalculates calculated fields. A calculated field is one that derives its value from the values in one or more fields in the dataset, sometimes with additional processing.

OnCalcFields is called frequently, so the code it contains should be brief.

When the AutoCalcFields property is true, OnCalcFields is triggered when:

•	A dataset is opened.

•	Focus moves from one visual control to another, or from one column to another is a data-aware grid control.

•	A record is retrieved from a database.

Note

When the AutoCalcFields property is true, OnCalcFields should not modify the dataset (or a linked dataset if it is part of a master-detail relationship), because such modifications retrigger the OnCalcField event, leading to recursion.

To reduce the frequency with which OnCalcFields is called, set AutoCalcFields to false. When AutoCalcFields is false, OnCalcFields is only called when Post is called. If an application permits users to change data, OnCalcFields is frequently triggered. In these cases an application may set AutoCalcFields to false to reduce the frequency with which AutoCalcFields is called.


TDataSet::OnDeleteError

TDataSet	Events	See also

OnDeleteError occurs when an application attempts to delete a record and an exception is raised.

Syntax

__property TDataSetErrorEvent OnDeleteError;

Description

Write an OnDeleteError event handler to handle exceptions that occur when an attempt to delete a record fails. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the handler should respond to the error. The following table summarizes the settings for Action and what they mean:

Value	Meaning

daFail	Aborts the delete operation and displays an error message.

daAbort	Aborts the delete operation without displaying a message.

daRetry	Repeats the delete operation. Correct the error condition inside the error handler before setting Action to daRetry.

When OnDeleteError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the delete operation is tried again.

If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet::OnEditError

TDataSet	Events	See also

OnEditError occurs when an application attempts to modify or insert a record and an exception is raised.

Syntax

__property TDataSetErrorEvent OnEditError;

Description

Write an OnEditError event handler to handle exceptions that occur when an attempt to edit a record fails. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the handler should respond to the error. The following table summarizes the settings for Action and what they mean:

Value	Meaning

daFail	Aborts the edit operation and displays an error message.

daAbort	Aborts the edit operation without displaying a message.

daRetry	Repeats the edit operation. Correct the error condition inside the error handler before setting Action to daRetry.

When OnEditError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the edit operation is tried again.

If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet::OnFilterRecord

TDataSet	Events	See also

OnFilterRecord occurs each time a different record in the dataset becomes the current record and filtering is enabled.

Syntax

__property TFilterRecordEvent OnFilterRecord;

Description

Write an OnFilterRecord event handler to test each record in a dataset for against a test condition that determines whether or not the record is visible to the application.

To indicate whether or not a record passes the filter condition, a filter handler must set the Accept parameter to true to include a record, or false to exclude it. For example, the following filter displays only those records with a State field set to “CA”:

Filtering is enabled if the Filtered property is true. When an application is processing a filter, the State property for the dataset is dsFilter. The FilterOptions property controls case sensitivity and filtering on partial comparisons.

Note

Applications can also specify a filter using the Filter property. The Filter property supplements the OnFilterRecord event handler. Be certain of the interactions between the Filter property and the OnFilterRecord event handler if they are used simultaneously in an application.


TDataSet::OnNewRecord

TDataSet	Events	See also

OnNewRecord occurs when an application inserts or appends a new dataset record.

Syntax

__property TDataSetNotifyEvent OnNewRecord;

Description

Write an OnNewRecord event handler to take specific actions as an application inserts or appends a new record. OnNewRecord is called as part of the actual insert or append process. An application might use the OnNewRecord event as a way of implementing cascading insertions in related datasets.


TDataSet::OnPostError

TDataSet	Events	See also

OnPostError occurs when an application attempts to modify or insert a record and an exception is raised.

Syntax

__property TDataSetErrorEvent OnPostError;

Description

Write an OnPostError event handler to handle exceptions that occur when an attempt to edit a record fails. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the handler should respond to the error. The following table summarizes the settings for Action and what they mean:

Value	Meaning

daFail	Aborts the post operation and displays an error message.

daAbort	Aborts the post operation without displaying a message.

daRetry	Repeats the post operation. Correct the error condition inside the error handler before setting Action to daRetry.

When OnPostError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the edit operation is tried again.

If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet::OnServerYield

TDataSet	Events	See also

OnServerYield occurs during processing of a query on a remote database server when the server sends a yield call back to the Borland Database Engine (BDE).

Syntax

__property TOnServerYieldEvent OnServerYield;

Description

Write an OnServerYield event handler to respond to a BDE callback generated when a database server yields temporary control to the BDE during a query operation. When it receives such control, it calls OnServerYield if the handler exists.

To continue processing the query, OnServerYield should set the AbortQuery parameter to false. To end query processing set AbortQuery to true.

Note

Currently, only Sybase yields control during query processing.


TDataSet::OnUpdateError

TDataSet	Events	See also

OnUpdateError occurs if an exception is generated when cached updates are applied to a database.

Syntax

__property TUpdateErrorEvent OnUpdateError;

Description

Write an OnUpdateError event handler to respond to exceptions generated when cached updates are applied to a database.

Because there is a delay between the time a record is first cached and the time cached updates are applied, there is a possibility that another application may change one or more of the same records in the database before the cached changes can be applied. The Borland Database Engine (BDE) checks for this condition and raises an exception. Borland C++ Builder responds by calling the OnUpdateError event handler if it exists.

DataSet is the name of the dataset to which updates are applied.

E is a pointer to a EDBEngineError object from which an application can extract an error message and the actual cause of the error condition. An OnUpdateError handler can use this information to determine how to respond to the error condition.

UpdateKind describes the type of update that generated the error. The following table lists the possible values for UpdateKind and what they indicate:

Value	Meaning

ukModify	Editing an existing record caused an error.

ukInsert	Inserting or appending a new record caused an error.

ukDelete	Deleting an existing record raised an error.

UpdateAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, UpdateAction is always set to uaFail. If OnUpdateError can handle or correct the error, set UpdateAction to uaRetry before exiting the error handler. The following table lists the possible values for UpdateAction and what they indicate:

Value	Meaning

uaAbort	Aborts the update operation without displaying an error message.

uaApplied	Not used in error handling routines.

uaFail	Aborts the update operation and displays an error message.

uaRetry	Repeats the update operation that originally raised the error condition.

uaSkip	Skips updating the record that raised the error condition, and leaves the unapplied changes in the cache.

Note

If a call to ApplyUpdates raises an exception and ApplyUpdates is not called within the context of a try...except block, an error message is displayed. If an OnUpdateError handler cannot correct the error condition and leaves UpdateAction set to uaFail, the error message is displayed twice. To prevent redisplay, set UpdateAction to uaAbort in the error handler.

Note

The code in an OnUpdateError handler must not call any methods that make a different record the current one.


TDataSet::OnUpdateRecord

TDataSet	Events	See also

OnUpdateRecord occurs when cached updates are applied to a record.

Syntax

__property TUpdateRecordEvent OnUpdateRecord;

Description

Write an OnUpdateRecord event handler to process updates that cannot be handled by a single update component, such as implementation of cascading updates, insertions, or deletions. This handler is also useful for applications that require additional control over parameter substitution in update components.

DataSet is the name of the dataset to which updates are applied.

UpdateKind describes the type of update to perform. The following table lists the possible values for UpdateKind and what they indicate:

Value	Meaning

ukModify	Edit an existing record.

ukInsert	Insert or append a new record.

ukDelete	Delete an existing record.

UpdateAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, UpdateAction is always set to uaFail. If OnUpdateRecord is successful, it should set UpdateAction to uaApplied before exiting. The following table lists the possible values for UpdateAction and what they indicate:

Value	Meaning

uaAbort	Abort the update operation without displaying an error message.

uaApplied	Update is applied. Free update record from cache.

uaFail	Aborts the update operation and displays an error message.

uaRetry	Not used for record updates.

uaSkip	Update is skipped. Leave update record in the cache.

Note

The code in an OnUpdateRecord handler must not call any methods that make a different record the current one.


TDataSet methods

TDataSet	Alphabetically

In TDataSet

~TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

TDataSet

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSet methods

TDataSet	By object

~TDataSet

ActiveBuffer

AppendRecord

Append

ApplyUpdates

Assign

Cancel

CancelUpdates

CheckBrowseMode

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

DefaultHandler

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SetDetailFields

SetFields

TDataSet

UpdateCursorPos

UpdateRecord

UpdateStatus


TDataSet::ActiveBuffer

TDataSet	Methods	See also

Returns a pointer to the buffer for the current record.

Syntax

System::PChar __fastcall ActiveBuffer(void);

Description

ActiveBuffer is used internally by many dataset methods to ensure that the active buffer points to the buffer for the current record. If an application uses existing dataset methods, the active buffer is always set correctly, so there is usually no need to call ActiveBuffer directly.

ActiveBuffer is also used by bookmarking methods to index into the current record buffer to retrieve bookmark information.

Applications that provide custom dataset routines may need to call ActiveBuffer to update the buffer pointer, especially when iterating through a set of records in the dataset. Even in these cases, if custom routines call methods such as Next or Prior, the active buffer is automatically set.


TDataSet::Append

TDataSet	Methods	See also

Adds a new, empty record to the end of the dataset.

Syntax

Append);

Description

Call Append to:

1	Open a new, empty record at the end of the dataset.

2	Set the current record to the new record.

After a call to Append, an application can enable users to enter data in the fields of the record, and can then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly appended record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.

•	For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.


TDataSet::AppendRecord

TDataSet	Methods	See also

Adds a new, populated record to the end of the dataset and posts it to the database.

Syntax

void __fastcall AppendRecord(const TVarRec *Values, const System::Integer Values_Size);

Description

Call AppendRecord to create a new, empty record at the end of the dataset, populate it with the field values in Values, and post the values to the database. A newly appended record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.

•	For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly appended record becomes the current record.


TDataSet::ApplyUpdates

TDataSet	Methods	See also

Writes a dataset’s pending cached updates to the database.

Syntax

void __fastcall ApplyUpdates(void);

Description

Call ApplyUpdates to write a dataset’s pending cached updates to a database. This method passes cached data to the database for storage, but the changes are not committed to the database. An application must explicitly call the database component’s Commit method to commit the changes to the database if the write is successful, or call the database’s Rollback method to undo the changes if there is an error.

Following a successful write to the database, and following a successful call to the database’s Commit method, an application should call the CommitUpdates method to clear the cached update buffer.

Note

To apply pending cached updates for two or more datasets associated with a database component, call the database component’s ApplyUpdates method rather than calling each individual dataset’s ApplyUpdates method. The database component’s ApplyUpdates method takes care of committing and rolling back transactions and clearing the cache when the operation is successful.

Example

The following procedure illustrates how to apply a dataset’s cached updates to a database in response to a button click:


TDataSet::Cancel

TDataSet	Methods	See also

Cancels modifications to the current record if those changes are not yet posted.

Syntax

void __fastcall Cancel(void);

Description

Call Cancel to undo modifications made to one or more fields belonging to the current record. As long as those changes are not already posted to the database, Cancel returns the record to its previous state, and sets the dataset state to dsBrowse.

Typically Cancel is used to back out of changes in response to user request, or in field validation routines that back out illegal field values. The TDBNavigator object contains a Cancel button that triggers a call to Cancel.


TDataSet::CancelUpdates

TDataSet	Methods	See also

Clears all pending cached updates from the cache and restores the dataset its prior state.

Syntax

void __fastcall CancelUpdates(void);

Description

Call CancelUpdates to clear all pending cached updates from the cache and restore the dataset to the state it was in when the table was opened, cached updates were last enabled, or updates were last successfully applied to the database.

When a dataset is closed, or the CachedUpdates property is set to false, CancelUpdates is called automatically.

Note

To undo changes to a single record, call RevertRecord.


TDataSet::CheckBrowseMode

TDataSet	Methods	See also

Automatically posts or cancels data changes when an application calls a method that changes which record in a dataset is the current record.

Syntax

void __fastcall CheckBrowseMode(void);

Description

CheckBrowseMode is used internally by many dataset methods to ensure that modifications to the current record are posted to the database when a dataset’s state is dsEdit, dsInsert, or dsSetKey state and a method is called that switches to a different record.

If State is dsEdit or dsInsert, CheckBrowseMode calls UpdateRecord, and then, if the Modified property for the dataset is true, CheckBrowseMode calls Post. If Modified is false, CheckBrowseMode calls Cancel.

If State is dsSetKey, CheckBrowseMode calls Post.

If State is dsInactive, CheckBrowseMode raises an exception.

If an application uses existing dataset methods, CheckBrowseMode is always called when necessary, so there is usually no need to call CheckBrowseMode directly.

Applications that provide custom dataset routines may need to call CheckBrowseMode inside those routines to guarantee that changes are posted to the database when switching to a different record.


TDataSet::ClearFields

TDataSet	Methods	See also

Clears the contents of all fields for the current record.

Syntax

void __fastcall ClearFields(void);

Description

Call ClearFields to erase the current contents of all fields for the current record. If the dataset is not in either dsInsert or dsEdit state, ClearFields raises an exception. Otherwise it calls the DataEvent event handler to invoke CheckBrowseMode, and then calls the BDE to initialize all fields for the record, effectively clearing them. If a SetKey operation is not under way, ClearFields recalculates all calculated fields, and calls the DataEvent handler with a parameter indicating that the record has changed. The DataEvent handler, in turn, calls the OnDataChange event handler for the data source component associated with the dataset.


TDataSet::Close

TDataSet	Methods	See also

Closes a dataset.

Syntax

void __fastcall Close(void);

Description

Call Close to set the Active property of a dataset to false. When Active is false, the dataset is closed; the dataset cannot read data from or write data to the database.

An application must set Active to false before changing other properties that affect the status of the database or the controls that display data in an application. For example, to change the DataSource property for a dataset, Active must first be set to false, ensuring that the dataset is closed. Setting Active to false puts the dataset into dsInactive state and closes the BDE cursor.


TDataSet::CommitUpdates

TDataSet	Methods	See also

Clears the cached updates buffer.

Syntax

void __fastcall CommitUpdates(void);

Description

Call CommitUpdates to clear the cached updates buffer after both a successful call to ApplyUpdates and a database component’s Commit method. Clearing the cache after applying updates ensures that the cache is empty except for records that could not be processed and were skipped by the OnUpdateRecord or OnUpdateError event handlers. An application can attempt to modify the records still in the cache.

Record modifications made after a call to CommitUpdates repopulate the cached update buffer and require a subsequent call to ApplyUpdates to move them to the database.

Note

Applications that use a database component’s ApplyUpdates method to apply and commit pending updates for all datasets associated with the database component do not need to call CommitUpdates.

Example

The following procedure illustrates how to apply a dataset’s cached updates to a database and clear the cached updates buffer in response to a button click:


TDataSet::ControlsDisabled

TDataSet	Methods	See also

Determines if display of data in data-aware controls is currently disabled for the dataset.

Syntax

System::Boolean __fastcall ControlsDisabled(void);

Description

Call ControlsDisabled to determine if the display of data in data-aware controls is currently disabled for the dataset. Applications should disable controls to improve performance and prevent display flicker during an automated iteration through a large number of records in the dataset. In complex applications, the same controls may be disabled by different processes simultaneously. ControlsDisabled enables an application to check on the current status of control display. For example, the following code reenables controls for a given dataset:


TDataSet::CursorPosChanged

TDataSet	Methods	See also

Sets the Borland Database Engine (BDE) cursor position in the dataset to -1.

Syntax

void __fastcall CursorPosChanged(void);

Description

CurPosChanged is an internal method that set the value for the BDE cursor position in the dataset to -1, which is not a valid cursor position. CurPosChanged is called by the Locate and Lookup methods prior to searching for a requested record. These methods, if successful, should reposition the cursor at the first matching record found.


TDataSet::Delete

TDataSet	Methods	See also

Deletes the current record and positions the cursor on the next record.

Syntax

void __fastcall Delete(void);

Description

Call Delete to remove the current record from the database. If the dataset is inactive, Delete raises an exception. Otherwise Delete:

•	Verifies that the dataset is not empty (and raises an exception if it is).

•	Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

•	Triggers the BeforeDelete event handler.

•	Calls the Borland Database Engine (BDE) to delete the record.

•	Frees the buffers allocated for the record.

•	Puts the dataset into dsBrowse mode.

•	Resynchronizes the dataset to position the cursor on the next undeleted record.

•	Calls the AfterDelete event handler.


TDataSet::DisableControls

TDataSet	Methods	See also

Disables data display in data-aware controls associated with the dataset through a data source component.

Syntax

void __fastcall DisableControls(void);

Description

Call DisableControls to prevent data display in data-aware controls prior to iterating through a large number of records in the dataset. Disabling controls prevents flicker in controls during rapid iteration through the dataset and its speeds performance because data does not need to be written to the display.

If controls are not already disabled, DisableControls records the current state of the dataset, sets the enabling event for the dataset to deDataSetChange, and increments the dataset’s disabled count variable. Otherwise, DisableControls just increments the disabled count variable.

The enabling event and disabled count variable are used internally by other methods and objects to determine whether or not to display data in data-aware controls. When the disable count variable is greater than zero, data is not displayed.

Usually DisableControls is called within the context of a try...finally block that reenables the controls even if an exception occurs. For example:

Note

DisableControls can safely be called when controls are already disabled. In complex applications there may be separate operations that are sometimes nested, both of which need to disable controls.


TDataSet::Edit

TDataSet	Methods	See also

Enables editing of data in the dataset.

Syntax

void __fastcall Edit(void);

Description

Call Edit to permit editing of the current record in a dataset. Edit determines the current state of the dataset. If the dataset is empty, Edit calls Insert. Otherwise Edit:

•	Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

•	Triggers the BeforeEdit event handler.

•	Retrieves the record and sets a lock on it if possible.

•	Puts the dataset into dsEdit state, enabling the application or user to modify fields in the record.

•	Triggers the record change event.

•	Triggers the AfterEdit event handler.


TDataSet::EnableControls

TDataSet	Methods	See also

Enables data display in data-aware controls associated with the dataset through a data source component.

Syntax

void __fastcall EnableControls(void);

Description

Call EnableControls to permit data display in data-aware controls after a prior call to DisableControls. EnableControls decrements the disabled count variable for the dataset if it is not already zero. If the disable count variable is zero, EnableControls updates the current state of the dataset, if necessary, and then call an event handler for renabling data display.

Usually EnableControls is called within the context of a try...finally block to reenables controls even if an exception occurs while controls are disabled. For example:


TDataSet::FetchAll

TDataSet	Methods	See also

Retrieves all records from the current cursor position to the end of the file and stores them locally.

Syntax

void __fastcall FetchAll(void);

Description

Call FetchAll to reduce network traffic when using cached updates. FetchAll calls CheckBrowseMode to post any pending changes, and then retrieves all records from the current cursor position to the end of the file, and store them locally.

Ordinarily when cached updates are enabled, a transaction retrieves only as much data as it needs for display purposes. Each new fetch starts a new, read-only transaction. To consolidate transactions and reduce network traffic, an application can call FetchAll to retrieve all data in a single transaction.

Note

To retrieve all records for a dataset, call First before calling FetchAll.

If filtering is enabled for a dataset, FetchAll retrieves only those records that match the filter criteria.

Note

Using FetchAll is not always appropriate. For example, when an application accesses a database used by many simultaneous clients and there is a high degree of contention for updating the same records, fetching all records at once may not be advantageous because some fetched records may be changed by other applications. Always weigh the advantages of reduced network traffic against the need for reduced record contention.


TDataSet::FieldByName

TDataSet	Methods	See also

Finds a field based on a specified field name.

Syntax

TField *__fastcall FieldByName(const System::AnsiString FieldName);

Description

Call FieldByName to retrieve field information for a field when only the field’s name is known. FieldName is the name of an existing field. FieldByName returns the TField component for the specified field.

An application can access specific properties and methods of the field directly. For example, the following statement determines if a specified field is a calculated field or not:

FieldByName is especially useful at design time for developers who are creating database applications, but who do not have access to the underlying table.

Note

To retrieve or set the value for a specific field, call the default dataset method FieldValues instead of FieldByName.


TDataSet::FindField

TDataSet	Methods	See also

Searches for a specified field object in the dataset.

Syntax

TField *__fastcall FindField(const System::AnsiString FieldName);

Description

Call FindField to determine if a specified field component exists in a dataset. FieldName is the name of the field for which to search. If FindField finds a field with a matching name, it returns the TField component for the specified field. Otherwise it returns NULL.

FindField is a useful function to call prior to calling other dataset methods, such as FieldByName, that require a valid field name as a parameter.


TDataSet::FindFirst

TDataSet	Methods	See also

Positions the cursor on the first record in a filtered dataset.

Syntax

System::Boolean __fastcall FindFirst(void);

Description

Call FindFirst to refetch the records in a filtered dataset and position the cursor on the first record in the set. FindFirst posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the first record in the filtered set.

If successful, FindFirst returns true, and the cursor is positioned on the first record. If a record is not found, FindFirst returns false, and cursor position is unchanged.

Note

Call FindFirst, rather than First, to reapply a filter to the dataset before repositioning the cursor. FindFirst guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::FindLast

TDataSet	Methods	See also

Positions the cursor on the last record in a filtered dataset.

Syntax

System::Boolean __fastcall FindLast(void);

Description

Call FindLast to refetch the records in a filtered dataset and position the cursor on the last record in the set. FindLast posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the last record in the filtered set.

If successful, FindLast returns true, and the cursor is positioned on the last record. If a record is not found, FindLast returns false, and cursor position is unchanged.

Note

Call FindLast, rather than Last, to reapply a filter to the dataset before repositioning the cursor. FindLast guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::FindNext

TDataSet	Methods	See also

Positions the cursor on the next record in a filtered dataset.

Syntax

System::Boolean __fastcall FindNext(void);

Description

Call FindNext to refetch the records in a filtered dataset and position the cursor on the next record in the set. FindNext posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the next record in the filtered set.

If successful, FindNext returns true, and the cursor is positioned on the next record. If a record is not found, FindNext returns false, and cursor position is unchanged.

Note

Call FindNext, rather than Next, to reapply a filter to the dataset before repositioning the cursor. FindNext guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::FindPrior

TDataSet	Methods	See also

Positions the cursor on the previous record in a filtered dataset.

Syntax

System::Boolean __fastcall FindPrior(void);

Description

Call FindPrior to refetch the records in a filtered dataset and position the cursor on the previous record in the set. FindPrior posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the previous record in the filtered set.

If successful, FindPrior returns true, and the cursor is positioned on the previous record. If a record is not found, FindPrior returns false, and cursor position is unchanged.

Note

Call FindPrior, rather than Prior, to reapply a filter to the dataset before repositioning the cursor. FindPrior guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::First

TDataSet	Methods	See also

Positions the cursor on the first record in the dataset.

Syntax

void __fastcall First(void);

Description

Call First to position the cursor on the first record in the dataset and make it the current record. First posts any changes to the current record and:

•	Clears the record buffers.

•	Sets the cursor to the beginning of the dataset file.

•	Fetches the first record, positions the cursor on it, and makes it the current record.

•	Fetches any additional records required for display, such as those needed to fill out a grid control.

•	Sets the BOF property to true.

•	Triggers an event handler for dataset change events.


TDataSet::FreeBookmark

TDataSet	Methods	See also

Frees the resources allocated for a specified bookmark.

Syntax

void __fastcall FreeBookmark(System::Pointer Bookmark);

Description

Call FreeBookmark to:

Free an existing bookmark before reassigning it.

Release the memory allocated for a specified bookmark when the bookmark is no longer needed.


TDataSet::GetBookmark

TDataSet	Methods	See also

Allocates a bookmark for the current cursor position in the dataset.

Syntax

System::Pointer __fastcall GetBookmark(void);

Description

Call GetBookmark to establish a bookmark for the current record in the dataset. Establishing a bookmark for a record enables an application to return to that record in the dataset at any time while the bookmark exists.

GetBookmark requires that a variable of type TBookmark already be declared in an application. Use GetBookmark to assign the variable a value that can be referenced by subsequent calls to GotoBookmark and FreeBookmark.


TDataSet::GetCurrentRecord

TDataSet	Methods	See also

Retrieves the current record into a buffer.

Syntax

System::Boolean __fastcall GetCurrentRecord(System::PChar Buffer);

Description

Most applications should not need to call GetCurrentRecord. TDataSet automatically allocates a buffer for the active record. Borland C++ Builder uses GetCurrentRecord only when allocating a record buffer for a TBlobStream object that represents a blob field.

Call GetCurrentRecord to copy the current record into a buffer allocated by the application. Buffer must be at least as big as the record size indicated by the RecordSize property. For example, the following code fragment, taken from the constructor for TBlobStream, demonstrates how to allocate a local buffer for a blob stream, and link it to a blob field object based on the current dataset’s RecordSize property:


TDataSet::GetFieldList

TDataSet	Methods	See also

Retrieves a specified set of field objects into a list.

Syntax

void __fastcall GetFieldList(Classes::TList *List, const System::AnsiString FieldNames);

Description

Call GetFieldList to copy a specifies set of field objects into a list object created and maintained by the application.

List is the TList object into which to copy the field objects. FieldNames is a string containing the name of the fields to copy. Each field name in the string must be separated from other field names with a semicolon. GetFieldList builds a list that contains only the field objects for which it finds a matching name in the dataset’s list of field objects.

Note

Applications do not normally have to call GetFieldList to copy field objects. Field objects are directly accessible through the dataset itself. In some cases, however, it can be useful to work with a copy of a field object or its data instead of working on the actual object in the dataset. In these cases, GetFieldList is useful.


TDataSet::GetFieldNames

TDataSet	Methods	See also

Retrieves a list of names for all fields in a dataset.

Syntax

void __fastcall GetFieldNames(Classes::TStrings *List);

Description

Call GetFieldNames to get a list of names for all fields in a dataset. List is a TStrings object created and maintained by the application.

Retrieving a list of field names is especially useful for applications that work with datasets whose field objects are created dynamically at run time. By retrieving a list of field names, the application can be restricted to working only with fields that exist at run time.


TDataSet::GotoBookmark

TDataSet	Methods	See also

Positions the cursor on the record pointed to by a specified bookmark.

Syntax

void __fastcall GotoBookmark(System::Pointer Bookmark);

Description

Call GotoBookmark to position the cursor on the record pointed to by a specified bookmark that was originally set by GetBookmark. Bookmark indicates the bookmark to use for positioning the cursor.


TDataSet::Insert

TDataSet	Methods	See also

Inserts a new, empty record in the dataset.

Syntax

void __fastcall Insert(void);

Description

Call Insert to:

1	Open a new, empty record in the dataset.

2	Set the current record to the new record.

After a call to Insert, an application can enable users to enter data in the fields of the record, and can then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly inserted record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is inserted into the dataset at the current cursor position.

•	For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.


TDataSet::InsertRecord

TDataSet	Methods	See also

Inserts a new, populated record to the dataset and posts it to the database.

Syntax

void __fastcall InsertRecord(const TVarRec *Values, const System::Integer Values_Size);

Description

Call InsertRecord to create a new, empty record at in the dataset, populate it with the field values in Values, and post the values to the database. A newly inserted record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is inserted into the dataset at the current cursor position.

•	For SQL databases, the physical location of the insert is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly inserted record becomes the current record.


TDataSet::IsLinkedTo

TDataSet	Methods	See also

Checks that a dataset is linked to a specified data source.

Syntax

System::Boolean __fastcall IsLinkedTo(TDataSource *DataSource);

Description

Call IsLinkedTo to verify that a dataset is linked to a specific data source. DataSource is the name of the data source to which the dataset should be linked.

If the dataset already uses the specified data source, IsLinkedTo returns true. If the dataset does not use the specified data source, but the data source exists, then IsLinkedTo sets the DataSource property of the dataset component to the one specified in the DataSource parameter, and returns true.

If the dataset does not use the specified data source, and the data source does not already have a dataset of its own, IsLinkedTo returns false.


TDataSet::Last

TDataSet	Methods	See also

Positions the cursor on the last record in the dataset.

Syntax

void __fastcall Last(void);

Description

Call Last to position the cursor on the last record in the dataset and make it the current record. Last posts any changes to the current record and:

•	Clears the record buffers.

•	Sets the cursor to the end of the dataset file.

•	Fetches the last record, positions the cursor on it, and makes it the current record.

•	Fetches any additional records required for display, such as those needed to fill out a grid control.

•	Sets the EOF property to true.

•	Triggers an event handler for dataset change events.


TDataSet::Locate

TDataSet	Methods	See also

Searches the dataset for a specified record and makes that record the current record.

Syntax

System::Boolean __fastcall Locate(const System::AnsiString KeyFields, const System::Variant &KeyValues

Description

Call Locate to search a dataset for a specific record and position the cursor on it. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine. For example:

Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate finds the first record that fulfills at least some initial part of the KeyValues criteria for record matching. If Options is an empty set, or if the KeyFields are not string fields, Options is ignored.

Locate returns true if it finds a matching record, and makes that record the current one. Otherwise Locate returns false.

Locate uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed and the index is compatible with the specified search options, Locate uses the index. Otherwise Locate creates a filter for the search.


TDataSet::Lookup

TDataSet	Methods	See also

Retrieves field values from a record that matches specified search values.

Syntax

System::Variant __fastcall Lookup(const System::AnsiString KeyFields, const System::Variant &KeyValues

Description

Call Lookup to retrieve values for specified fields from a record that matches search criteria. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine.

ResultFields is a string containing a semicolon-delimited list of field names whose values should be returned from the matching record.

Lookup returns a variant array containing the values from the fields specified in ResultFields.

Lookup uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed, Lookup uses the index. Otherwise Lookup creates a filter for the search.


TDataSet::MoveBy

TDataSet	Methods	See also

Positions the cursor on a record relative to the current record in the dataset.

Syntax

System::Integer __fastcall MoveBy(System::Integer Distance);

Description

Call MoveBy to position the cursor on a record relative to the current record in the dataset. Distance indicates the number of records to move. A positive value for Distance indicates forward progress through the dataset, while a negative value indicates backward progress. For example, the following statement moves backward through the dataset by 10 records:

MoveBy posts any changes to the current record and:

•	Sets the BOF and EOF properties to false.

•	If Distance is positive, repeatedly fetches subsequent records, if possible, decrementing Distance until it is zero, positions the cursor on the last record fetched, and makes it the current record. If an attempt is made to move past the end of the file, MoveBy sets EOF to true.

•	If Distance is negative, repeatedly fetches previous records, if possible, incrementing Distance until it is zero, positions the cursor on the last record fetched, and makes it the current record. If an attempt is made to move past the start of the file, MoveBy sets BOF to true.

•	Triggers an event handler for dataset scrolling events.

•	Returns the actual number of records moved. In most cases, Result is the absolute value of Distance, but if MoveBy encounters the beginning-of-file or end-of-file before moving Distance records, Result will be less than the absolute value of Distance.


TDataSet::Next

TDataSet	Methods	See also

Positions the cursor on the next record in the dataset.

Syntax

void __fastcall Next(void);

Description

Call Next to position the cursor on the next record in the dataset and make it the current record. Next posts any changes to the current record and:

•	Sets the BOF and EOF properties to false.

•	Fetches the next record if possible, positions the cursor on it, and makes it the current record.

•	Sets the EOF property to true if the cursor was already on the last record in the dataset.

•	Triggers an event handler for dataset scrolling events.


TDataSet::Open

TDataSet	Methods	See also

Opens the dataset.

Syntax

void __fastcall Open(void);

Description

Call Open to set the Active property for the dataset to true. When Active is true, data can be read from and written to the database.

Setting Active to true:

•	Triggers the BeforeOpen event handler if one is defined for the dataset.

•	Sets the dataset state to dsBrowse.

•	Opens a Borland Database Engine (BDE) cursor into the dataset.

•	Triggers the After Open event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and the cursor is closed.


TDataSet::Post

TDataSet	Methods	See also

Writes a modified record to the database or cached update buffer.

Syntax

void __fastcall Post(void);

Description

Call Post to write a modified record to the database or cached update buffer. Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.

Post calls UpdateRecord to trigger a record update data event or raise an exception if the dataset is not in a state that permits modification. If the State property for the dataset is dsEdit or dsInsert, Post also performs the following actions:

•	Triggers a check browse mode data event.

•	Verifies that all required fields for the record contain values.

•	Calls the BeforePost event handler.

•	Posts the record to the database or cache.

•	Frees the buffers allocated to the fields for the record.

•	Sets the State property to dsBrowse.

•	Calls Resync to fetch the current record and any other records needed for display purposes.

•	Calls the AfterPost event handler.

If State is dsSetKey, Post cleans up the key buffers and puts the dataset into dsBrowse state.


TDataSet::Prior

TDataSet	Methods	See also

Positions the cursor on the previous record in the dataset.

Syntax

void __fastcall Prior(void);

Description

Call Prior to position the cursor on the previous record in the dataset and make it the current record. Prior posts any changes to the current record and:

•	Sets the BOF and EOF properties to false.

•	Fetches the previous record if possible, positions the cursor on it, and makes it the current record.

•	Sets the BOF property to true if the cursor was already on the first record in the dataset.

•	Triggers an event handler for dataset scrolling events.


TDataSet::Refresh

TDataSet	Methods	See also

Refetches data from the database to update a dataset’s view of data.

Syntax

void __fastcall Refresh(void);

Description

Call Refresh to ensure that an application has the latest data from a database. For example, when an application turns off filtering for a dataset, it immediately call Refresh to display all records in the dataset, not just those that used to meet the filter condition.

Refresh performs the following actions:

•	Calls CheckBrowseMode to post any pending changes.

•	Calls UpdateCursorPos to update the cursor position in the dataset.

•	Calls the Borland Database Engine (BDE) to enable rereading of data.

•	Calls Resync to fetch the current record and any other records necessary for display.


TDataSet::Resync

TDataSet	Methods	See also

Refetches the current record and the records that precede and follow it.

Syntax

void __fastcall Resync( TResyncMode Mode);

Description

Resync is an internal routine used by other dataset methods to fetch records following operations that change the type of records visible in a dataset, such as turning filtering on or off. An application can also call Resync at any time to be sure it has the latest view on data in the database.

Mode indicates optional processing that Resync should handle.

If Mode contains rmExact, Resync sets the current record number to -1 and refetches the current record. Otherwise Resync attempts to fetch the current record, and a record that precedes and follows the current record. If these operations fail, Resync clears the record buffers, executes a data change event, and exits.

If Mode contains rmCenter, Resync attempts to determine how many prior and subsequent records to fetch based on the total number of records in the dataset.

Regardless of Mode, Resync also activates the buffers for the current record, retrieves prior and subsequent records for display purposes, and triggers a dataset change event.	Ugh! This is definitely winging it for most of Resync. Mode is particularly unclear. When you review this, you might want to call me to walk me through what’s really going on. Thanks!


TDataSet::RevertRecord

TDataSet	Methods	See also

Restores the current record in the dataset to an unmodified state when cached updates are enabled.

Syntax

void __fastcall RevertRecord(void);

Description

Call RevertRecord to undo changes made to the current record when cached updates are enabled. With minor coding, RevertRecord can be used to undelete records when cached updates are enabled, as the following procedure demonstrates:

Note

To undo all changes to all pending updates in the cache, call CancelUpdates.


TDataSet::SetDetailFields

TDataSet	Methods	See also

Sets the detail fields for a master/detail relationship.	The code here is definitely clear as mud. What’s really going on?

Syntax

void __fastcall SetDetailFields(Classes::TList *MasterFields);

Description

Use SetDetailFields to assign fields for a master/detail relationship. MasterFields is a TList object created and maintained by the application. Each list item must be an existing TField object.


TDataSet::SetFields

TDataSet	Methods	See also

Sets the values for all fields in a record

Syntax

void __fastcall SetFields(const TVarRec *Values, const System::Integer Values_Size);

Description

Call SetFields to set values for some or all fields in the current record at the same time.

Values contains the values to insert into each field. Values are assigned to the record based on the order of columns in the table or tables underlying the dataset. These values can be literals, variables, NULL, or NULL. If Values contains fewer values than there are fields in the record, all records for which values are not provided are assigned a NULL value. A NULL value overwrites any existing value in such fields.

Before calling SetFields, call Edit to put the dataset into dsEdit state. After calling SetFields, call Post to write the changes to the database.

Note

To set values for some fields while retaining existing values for others, pass NULL for each field that should not change.


TDataSet::UpdateCursorPos

TDataSet	Methods	See also

Positions the cursor on the current record.

Syntax

void __fastcall UpdateCursorPos(void);

Description

UpdateCursorPos is an internal routine used by many dataset methods to ensure that the cursor is positioned on the current record. Normally an application should not need to call UpdateCursorPos. Typically UpdateCursorPos is called whenever the current record might change as a result of moving to a different record, posting changes, or enabling or disabling filtering.


TDataSet::UpdateRecord

TDataSet	Methods	See also

Triggers a data event for a record update.

Syntax

void __fastcall UpdateRecord(void);

Description

UpdateRecord is an internal routine used by some dataset methods to trigger an OnUpdateRecord event if cached updates are enabled. Applications should not need to call UpdateRecord directly unless they provide custom dataset methods that bypass dataset methods.


TDataSet::UpdateStatus

TDataSet	Methods	See also

Reports the current update status for the dataset.

Syntax

TUpdateStatus __fastcall UpdateStatus(void);

Description

Call UpdateStatus to determine the current update status for the dataset when cached updates are enabled. Update status can change frequently as records are edited, inserted, or deleted. UpdateStatus offers a convenient method for applications to assess the current status before undertaking or completing operations that depend on the update status of the dataset.


TDataSet::TDataSet

TDataSet	Methods	See also

TDataSet creates a new TDataSet object.

Syntax

__fastcall virtual TDataSet(Classes::TComponent *AOwner);

Description

Use TDataSet to create a new TDataSet object.


TDataSet::~TDataSet

TDataSet	Methods	See also

~TDataSet frees the memory associated with the TDataSet object.

Syntax

__fastcall virtual ~TDataSet(void);

Description

Do not call ~TDataSet directly. Instead, use the delete keyword on the object, which causes ~TDataSet to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataSet example

TDataSet


TDataSource

Hierarchy	Properties	Methods	Events

TDataSource provides an interface between a dataset component and data-aware controls on a form.

Header

vcl/db.hpp

Description

Use TDataSource to provide a conduit between a dataset and data-aware controls on a form that enable display, navigation, and editing of the data underlying the dataset.

All datasets must be associated with a data source component if their data is to be displayed and manipulated in data-aware controls. Similarly, each data-aware control needs to be associated with a data source component in order for the control to receive and manipulate data.

Data source components also link datasets in master-detail relationships.


TDataSource properties

TDataSource	Alphabetically	Legend

In TDataSource

AutoEdit

DataSet

Enabled

State

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDataSource properties

TDataSource	By object	Legend

AutoEdit

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DesignInfo

Enabled

Name

Owner

State

Tag


TDataSource::AutoEdit

TDataSource	Properties	See also

Determines if a data source component automatically calls a dataset’s Edit method when a data-aware control associated with the data source receives focus.

Syntax

__property System::Boolean AutoEdit;

Description

AutoEdit is true by default. If AutoEdit is true, then when a user attempts to modify the data displayed by the control the underlying dataset’s Edit method is called.

Set AutoEdit to false to protect data from unintentional modification. Even if AutoEdit is false, an application can call a dataset’s Edit method directly to permit data modification.


TDataSource::DataSet

TDataSource	Properties	See also

Specifies the dataset for which the data source component serves as a conduit to data-aware controls.

Syntax

System::Boolean __fastcall IsLinkedTo(TDataSet *DataSet);

Description

Set DataSet to the name of an existing dataset component either at design time, or at run time. By changing the value of DataSet at run time an application can effectively use the same data-aware controls to display and edit data in different data sets.

Note

To links a dataset that resides in a data module to a form at design-time, choose File | Use unit.


TDataSource::Enabled

TDataSource	Properties	See also

Determines if the data-aware controls associated with the data source component display data.

Syntax

__property System::Boolean Enabled;

Description

Use Enabled to control whether or not data-aware controls connected to a data source display data. If Enabled is true (the default), data are displayed. If Enabled is false, all controls associated with the data source are blank.

Note

While an application can set Enabled to false to blank out data-aware controls during processing of multiple records, a better choice is to use the TDataSet EnableControls and DisableControls methods. Using these methods prevents the controls from blanking out during processing.


TDataSource::State

TDataSource	Properties	See also

Reads the current state of the dataset component associated with a data source component.

Syntax

__property TDataSetState State;

Description

Examine State to determine the current state of the dataset associated with a data source component. The state of a dataset indicates the action, if any, taking place against the dataset. The following table summarizes possible values for State:

State	Meaning

dsInactive	Dataset is closed, DataSet property is unassigned, or Enabled property is false.

dsBrowse	Dataset is open for viewing. This is the default state for a dataset.

dsEdit	Dataset is open. The current record can be modified.

dsInsert	Dataset is open. A new record is being inserted.

dsSetKey	Dataset is open. Searching for records based on indexed fields is enabled, or a SetRange operation is in progress. In either case a restricted set of data can be viewed. No data can be modified.

dsCalcFields	Dataset is open, and an OnCalcFields event is in progress. Fields that are not calculated cannot be modified.

dsFilter	Dataset is open, and a filter operation is in progress. A restricted set of data can be viewed. No data can be modified.

These values correspond to the values for a dataset’s State property and are identical to them except that when Enabled is false or DataSet is unassigned, State is dsInactive regardless of the actual state of the dataset.


TDataSource events

TDataSource	Alphabetically	Legend

In TDataSource

OnDataChange

OnStateChange

OnUpdateData


TDataSource events

TDataSource	By object	Legend

OnDataChange

OnStateChange

OnUpdateData


TDataSource::OnDataChange

TDataSource	Events	See also

OnDataChange occurs when the current record has been edited and the application moves from one field or record to another in a dataset associated with the data source component.

Syntax

__property TDataChangeEvent OnDataChange;

Description

Write an OnDataChange event handler to take specific actions when a field in the current record has been edited and an application moves from one field or record to another in a dataset associated with a data source component. For example, methods that can trigger this event include the Next or Prior methods for the dataset.

Data-aware controls notify a data source of a data change because of:

•	Scrolling to a new record.

•	Modifications to a field’s data.

The Field parameter is NULL if more than one of the fields changed simultaneously, such as when moving from one record to another. Otherwise, Field indicates the edited field.

OnDataChange is especially useful in applications that must synchronize data display in controls that are not data aware.


TDataSource::OnStateChange

TDataSource	Events	See also

OnStateChange occurs when the state of a data source component’s dataset changes.

Syntax

__property Classes::TNotifyEvent OnStateChange;

Description

Write an OnStateChange event handler to take specific actions when the State property changes for a dataset associated with a data source component.

During the course of a normal connection to a database, a dataset’s state changes frequently. For example, each time a user starts editing a field in a data-aware control the dataset’s State property is changed from dsBrowse to dsEdit if the State is not already dsEdit. An OnStateChange event handler might respond to changes in state by taking actions such as disabling or enabling menu items or buttons.


TDataSource::OnUpdateData

TDataSource	Events	See also

OnUpdateData occurs when the data in the current record is about to be updated.

Syntax

__property Classes::TNotifyEvent OnUpdateData;

Description

Write an OnUpdateData event handler to take specific actions prior to posting data changes to the database. If an application posts changes to the database and an OnUpdateData event handler exists, the handler is called before the dataset’s Post method is executed. An OnUpdateData event handler might be useful for performing additional data processing or validation before posting.


TDataSource methods

TDataSource	Alphabetically

In TDataSource

~TDataSource

Edit

IsLinkedTo

TDataSource

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSource methods

TDataSource	By object

~TDataSource

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Edit

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsLinkedTo

MethodAddress

MethodName

NewInstance

RemoveComponent

TDataSource


TDataSource::Edit

TDataSource	Methods	See also

Determines whether or not to call the Edit method for a dataset associated with a data source component.

Syntax

void __fastcall Edit(void);

Description

Call Edit to enable a data source component to control a user’s ability to edit a dataset associated with the data source. Edit checks that the AutoEdit property of the data source is true and that its State property is dsBrowse before calling the dataset’s Edit method. Checking these properties before calling the dataset’s Edit method ensures that the dataset is in a state that supports editing, and that the data source allows editing as well.


TDataSource::IsLinkedTo

TDataSource	Methods	See also

Checks that a data source is linked to a specified dataset.

Syntax

System::Boolean __fastcall IsLinkedTo(TDataSet *DataSet);

Description

Call IsLinkedTo to verify that a data source is linked to a specific dataset. DataSet is the name of the dataset to which the data source should be linked.

If the data source already uses the specified dataset, IsLinkedTo returns true. If the data source does not use the specified dataset, but the dataset exists, then IsLinkedTo sets the DataSet property of the data source component to the one specified in the DataSet parameter, and returns true.

If the data source does not use the specified dataset, and the dataset does not already have a data source of its own, IsLinkedTo returns false.

Note

IsLinkedTo is a low-level method mainly of interest to component developers who need to detect circular data references. Otherwise IsLinkedTo should not be called directly.


TDataSource::TDataSource

TDataSource	Methods	See also

TDataSource creates a new TDataSource object.

Syntax

__fastcall virtual TDataSource(Classes::TComponent *AOwner);

Description

Use TDataSource to create a new TDataSource object.


TDataSource::~TDataSource

TDataSource	Methods	See also

~TDataSource frees the memory associated with the TDataSource object.

Syntax

__fastcall virtual ~TDataSource(void);

Description

Do not call ~TDataSource directly. Instead, use the delete keyword on the object, which causes ~TDataSource to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataSource example

TDataSource


TDateField

Hierarchy	Properties	Methods	Events	See also

A TDateField object represents a date field in a dataset.

Header

vcl/dbtables.hpp

Description

Date fields contain date values.

TDateField differs from its immediate ancestor TDateTimeField only in having a DataType of ftDate. While the underlying physical format for a date field in a database differs from that of a date-time field, TDateField uses a TDateTime value to store and manipulate date values.

As a descendent of TDateTimeField, TDateField includes many properties, methods, and events that are useful for managing the value and properties of a temporal field in a database.


TDateField properties

TDateField	Alphabetically	Legend

Derived from TDateTimeField

AsDateTime

AsFloat

AsString

AsVariant

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDateField properties

TDateField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TDateField events

TDateField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDateField events

TDateField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDateField methods

TDateField	Alphabetically

In TDateField

~TDateField

TDateField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateField methods

TDateField	By object

~TDateField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TDateField


TDateField::TDateField

TDateField	Methods	See also

TDateField creates a new TDateField object.

Syntax

__fastcall virtual TDateField(Classes::TComponent *AOwner);

Description

Use TDateField to create a new TDateField object.


TDateField::~TDateField

TDateField	Methods	See also

~TDateField frees the memory associated with the TDateField object.

Syntax

__fastcall virtual ~TDateField(void);

Description

Do not call ~TDateField directly. Instead, use the delete keyword on the object, which causes ~TDateField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TDateTimeField


TDateField example

TDateField


TDateTimeField

Hierarchy	Properties	Methods	Events	See also

A TDateTimeField component represents a date-time field in a dataset.

Header

vcl/dbtables.hpp

Description

Date-time fields contain combined date and time information, sometimes called timestamps.

TDateTimeField introduces new properties to convert between date-time values and other data types, and to format the value of a date-time field for display. As a descendent of TField, TDateTimeField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.

TDateTimeField is also the director ancestor of two other date-time field types: TDateField and TTimeField.


TDateTimeField properties

TDateTimeField	Alphabetically	Legend

In TDateTimeField

AsDateTime

AsFloat

AsString

AsVariant

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDateTimeField properties

TDateTimeField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TDateTimeField::AsDateTime

TDateTimeField	Properties	See also

AsDateTime converts the value of the date-time field to or from a date-time value.

Syntax

Description

Use AsDateTime to:

•	Assign a date-time value to a date-time field.

•	Assign the date-time field value to a date-time variable.

The time portion of the date-time value is ignored when setting the AsDateTime property on a field where the DataType is ftDate . The date portion of the date-time value is ignored when setting the AsDateTime property on a field where the DataType is ftTime.

Similarly, reading the AsDateTime property of a field with DataType set to ftDate yields a date-time value of 12:00 am on the date value of the field. Reading the AsDateTime property of a field with DataType set to ftTime yields a date-time value of the time value of the field on 12/30/1899.

Reading or setting the AsDateTime property for a field with DataType set to ftDateTime treats both the date and time portions of the date-time value as meaningful.

AsDateTime uses date-time values stored in the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

Following are some examples of TDateTime values and their corresponding dates and times:

Value	Date and time

  0	   12/30/1899 12:00 am

  2.75	   1/1/1900 6:00 pm

  -1.25	   12/29/1899 6:00 am

  35065	   1/1/1996 12:00 am

To find the fractional number of days between two dates, simply subtract the two values. Likewise, to increment a date and time value by a certain fractional number of days, simply add the fractional number to the date and time value.

Note

Because TDateTimeField stores date and time values in the TDateTime type, AsDateTime is the same as Value for date-time fields. Use AsDateTime when working with field components where the actual class of the object is not known.


TDateTimeField::AsFloat

TDateTimeField	Properties	See also

AsFloat converts the value of the date-time field to or from a floating-point value.

Syntax

Description

Use AsFloat to:

•	Assign a floating-point value to a date-time field.

•	Assign the date-time field value to a floating-point variable.

For example, this code assigns a floating-point value to date-time field value:

To assign date-time field value to a floating-point value, use code similar to this:

TDateTimeField converts dates to the number of days that have passed since 12/30/1899. Time values are converted to the fraction of a 24-hour day that has elapsed. The floating point value for a date-time quantity is the sum of the date and time values.

The fractional (time) portion of the floating-point value is ignored when setting the AsFloat property on a field where the DataType is ftDate . The integral (date) portion of the floating-point value is ignored when setting the AsFloat property on a field where the DataType is ftTime.

Similarly, reading the AsFloat property of a field with DataType set to ftDate yields a floating-point value with no fractional (time) part. Reading the AsFloat property of a field with DataType set to ftTime yields a floating-point value greater than -1 and less than 1.


TDateTimeField::AsString

TDateTimeField	Properties	See also

AsString converts the value of the date-time field to or from a string.

Syntax

Description

Use AsString to:

•	Assign a string to a date-time field.

•	Assign the date-time field value to a string.

For example, this code assigns a string to date-time field value:

To assign date-time field value to a floating-point variable, use code similar to this:

If the DataType property value of the date-time field is ftDate, setting the AsString property uses the StrToDate function to convert the string to a date value. If the DataType is ftTime, setting the AsString property uses the StrToTime function. If the DataType is ftDateTime, setting the AsString property uses the StrToDateTime function.

If the DisplayFormat property has been set, reading the AsString property will yield the value of the date-time field formatted according to the DisplayFormat. If DisplayFormat has not been set, reading the AsString property will yield the value of the date-time field formatted using the date and time format specifications as set in the Windows Control Panel.


TDateTimeField::AsVariant

TDateTimeField	Properties	See also

AsVariant converts the value of a date-time field to or from a variant value.

Syntax

Description

Use AsVariant to:

•	Assign the date-time field value to variant variable.

•	Assign a variant value to the date-time field.

Using variants is useful when you don't know the actual field type and don't want to use one of the other As... properties to convert the field value to another type.


TDateTimeField::DisplayFormat

TDateTimeField	Properties	See also

DisplayFormat contains the string that overrides the automatic formatting of the date-time field for display purposes.

Syntax

__property System::AnsiString DisplayFormat;

Description

Use DisplayFormat to specify a formatting string that is used to format the value in a date-time field when the field’s value appears as a string.

If DisplayFormat is not assigned a string, the value is formatted according to the default specifications set in the Windows Control Panel.

Construct a DisplayFormat string using these format specifiers:.

Specifier	Displays

c	Displays the date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.

d	Displays the day as a number without a leading zero (1-31).

dd	Displays the day as a number with a leading zero (01-31).

ddd	Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.

dddd	Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.

ddddd	Displays the date using the format given by the ShortDateFormat global variable.

dddddd	Displays the date using the format given by the LongDateFormat global variable.

m	Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm	Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm	Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.

mmmm	Displays the month as a full name (January-December) using the strings given by the LongMonthNames global variable.

yy	Displays the year as a two-digit number (00-99).

yyyy	Displays the year as a four-digit number (0000-9999).

h	Displays the hour without a leading zero (0-23).

hh	Displays the hour with a leading zero (00-23).

n	Displays the minute without a leading zero (0-59).

nn	Displays the minute with a leading zero (00-59).

s	Displays the second without a leading zero (0-59).

ss	Displays the second with a leading zero (00-59).

t	Displays the time using the format given by the ShortTimeFormat global variable.

tt	Displays the time using the format given by the LongTimeFormat global variable.

am/pm	Uses the 12-hour clock for the preceding h or hh specifier, and displays "am" for any hour before noon, and "pm" for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

a/p	Uses the 12-hour clock for the preceding h or hh specifier, and displays "a" for any hour before noon, and "p" for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

ampm	Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon.

/	Displays the date separator character given by the DateSeparator global variable.

:	Displays the time separator character given by the TimeSeparator global variable.

'xx'/"xx"	Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting.

Format specifiers may be written in upper case as well as in lower case letters; both produce the same result.

If the string given by the Format parameter is empty, the date and time value is formatted as if a "c" format specifier had been given.


TDateTimeField::Value

TDateTimeField	Properties	See also

Value is the value of the data in the date-time field.

Syntax

System::Boolean __fastcall GetValue(System::TDateTime &Value);

Description

Use Value to read data directly from and write data directly to a date-time field component at run time. TDateTimeField components store and manipulate their data as TDateTime values. Thus, for date-time fields, the Value property is the same as the AsDateTime property.


TDateTimeField events

TDateTimeField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDateTimeField events

TDateTimeField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDateTimeField methods

TDateTimeField	Alphabetically

In TDateTimeField

~TDateTimeField

TDateTimeField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateTimeField methods

TDateTimeField	By object

~TDateTimeField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TDateTimeField


TDateTimeField::TDateTimeField

TDateTimeField	Methods	See also

TDateTimeField creates a new TDateTimeField object.

Syntax

__fastcall virtual TDateTimeField(Classes::TComponent *AOwner);

Description

Use TDateTimeField to create a new TDateTimeField object.


TDateTimeField::~TDateTimeField

TDateTimeField	Methods	See also

~TDateTimeField frees the memory associated with the TDateTimeField object.

Syntax

__fastcall virtual ~TDateTimeField(void);

Description

Do not call ~TDateTimeField directly. Instead, use the delete keyword on the object, which causes ~TDateTimeField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TDateTimeField example

TDateTimeField


TDataSetDesigner

Hierarchy	Properties	Methods

Header

vcl/db.hpp

Description


TDataSetDesigner properties

TDataSetDesigner	Alphabetically	Legend

In TDataSetDesigner

DataSet


TDataSetDesigner properties

TDataSetDesigner	By object	Legend

DataSet


TDataSetDesigner::DataSet

TDataSetDesigner	Properties

Syntax

__fastcall TDataSetDesigner(TDataSet *DataSet);

Description


TDataSetDesigner methods

TDataSetDesigner	Alphabetically

In TDataSetDesigner

~TDataSetDesigner

BeginDesign

DataEvent

EndDesign

TDataSetDesigner

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetDesigner methods

TDataSetDesigner	By object

~TDataSetDesigner

BeginDesign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataEvent

DefaultHandler

Dispatch

EndDesign

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TDataSetDesigner


TDataSetDesigner::BeginDesign

TDataSetDesigner	Methods

Syntax

void __fastcall BeginDesign(void);

Description


TDataSetDesigner::DataEvent

TDataSetDesigner	Methods

Syntax

virtual void __fastcall DataEvent(TDataEvent Event, System::Longint Info);

Description


TDataSetDesigner::EndDesign

TDataSetDesigner	Methods

Syntax

void __fastcall EndDesign(void);

Description


TDataSetDesigner::TDataSetDesigner

TDataSetDesigner	Methods	See also

TDataSetDesigner creates a new TDataSetDesigner object.

Syntax

__fastcall TDataSetDesigner(TDataSet *DataSet);

Description

Use TDataSetDesigner to create a new TDataSetDesigner object.


TDataSetDesigner::~TDataSetDesigner

TDataSetDesigner	Methods	See also

~TDataSetDesigner frees the memory associated with the TDataSetDesigner object.

Syntax

__fastcall virtual ~TDataSetDesigner(void);

Description

Do not call ~TDataSetDesigner directly. Instead, use the delete keyword on the object, which causes ~TDataSetDesigner to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TDataSetDesigner example

TDataSetDesigner


TDataSourceLink

Hierarchy	Properties	Methods	See also

TDataSourceLink is a helper object that helps manage data events for a TDBLookupControl object.

Header

vcl/dbctrls.hpp

Description

TDataSourceLink is tailored to work with a TDBLookupControl. It should only be used by the TDBLookupControl class.


TDataSourceLink properties

TDataSourceLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TDataSourceLink properties

TDataSourceLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TDataSourceLink methods

TDataSourceLink	Alphabetically	Legend

In TDataSourceLink

~TDataSourceLink

ActiveChanged

RecordChanged

TDataSourceLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSourceLink methods

TDataSourceLink	By object	Legend

~TDataSourceLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RecordChanged

TDataSourceLink

UpdateRecord


TDataSourceLink::ActiveChanged

TDataSourceLink	Methods	See also

ActiveChanged informs the TDBLookupControl of changes in the Active property of its DataSource.

Syntax

virtual void __fastcall ActiveChanged(void);

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the DataLinkActiveChanged method of the TDBLookupControl object that owns this TDataSourceLink.


TDataSourceLink::RecordChanged

TDataSourceLink	Methods	See also

RecordChanged informs the TDBLookupControl of changes in the current record or field of the DataSource.

Syntax

virtual void __fastcall RecordChanged(Db::TField *Field);

Description

Applications should not call RecordChanged directly. It is triggered automatically after changes in the contents of the current record. RecordChanged calls the DataLinkRecordChanged method of the TDBLookupContol object that owns this TDataSourceLink.


TDataSourceLink::TDataSourceLink

TDataSourceLink	Methods	See also

TDataSourceLink creates a new TDataSourceLink object.

Syntax

__fastcall TDataSourceLink(void);

Description

Use TDataSourceLink to create a new TDataSourceLink object.


TDataSourceLink::~TDataSourceLink

TDataSourceLink	Methods	See also

~TDataSourceLink frees the memory associated with the TDataSourceLink object.

Syntax

__fastcall virtual ~TDataSourceLink(void);

Description

Do not call ~TDataSourceLink directly. Instead, use the delete keyword on the object, which causes ~TDataSourceLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TDataSourceLink example

TDataSourceLink


TDBCheckBox

Hierarchy	Properties	Methods	Events

A TDBCheckBox component is an indirect descendent of TWinControl. A check box presents an option to the user; the user can check it to select the option, or uncheck it to deselect the option. A database check box (TDBCheckBox) is much like an ordinary check box (TCheckBox), except that it is aware of the data in a particular field of a dataset.

Header

vcl/dbctrls.hpp

You can link a database check box with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the check box’s DataSource property. Specify the field in the dataset you want to access as the value of the check box’s DataField property.

If the contents of a field in the current record of the dataset equals the string of the ValueChecked property, the database check box is checked. If the contents matches the string specified as the value of the ValueUnchecked property, the check box is unchecked.

When the user checks or unchecks a database check box, the string specified as the value of the ValueChecked or ValueUnchecked property becomes the value of the field in the dataset, as long as the value of the ReadOnly property is false and the dataset is in edit mode. If you want the user to be able to view the data in the field but not modify it, set ReadOnly to true.

If your application doesn’t require the data-aware capabilities of TDBCheckBox, use the check box (TCheckBox) component instead to conserve system resources.


TDBCheckBox properties

TDBCheckBox	Alphabetically	Legend

In TDBCheckBox

DataField

DataSource

Field

ReadOnly

ValueChecked

ValueUnchecked

Derived from TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBCheckBox properties

TDBCheckBox	By object	Legend

Alignment

Align

AllowGrayed

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ShowHint

Showing

State

TabOrder

TabStop

Tag

Top

ValueChecked

ValueUnchecked

Visible

Width


TDBCheckBox::DataField

TDBCheckBox	Properties

Identifies the field from which the data-aware control displays data

Syntax

__property System::AnsiString DataField;

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.


TDBCheckBox::DataSource

TDBCheckBox	Properties

Determines where the component obtains the data to display.

Syntax

__property Db::TDataSource * DataSource;

Specify the data source component that identifies the dataset the data is found in.


TDBCheckBox::Field

TDBCheckBox	Properties

Returns the TField object the data-aware control is linked to.

Syntax

__property Db::TField * Field;

Use the Field object when you want to change the value of the data in the field programmatically.


TDBCheckBox::ReadOnly

TDBCheckBox	Properties

Determines if the user can change the contents of the control.

Syntax

__property System::Boolean ReadOnly;

The ReadOnly property determines if the user can change the contents of the control. If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

The ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBCheckBox events

TDBCheckBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBCheckBox events

TDBCheckBox	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TDBCheckBox methods

TDBCheckBox	Alphabetically

In TDBCheckBox

~TDBCheckBox

TDBCheckBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCheckBox methods

TDBCheckBox	By object

~TDBCheckBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBCheckBox

UpdateControlState

Update


TDBCheckBox::TDBCheckBox

TDBCheckBox	Methods	See also

TDBCheckBox creates a new TDBCheckBox object.

Syntax

__fastcall virtual TDBCheckBox(Classes::TComponent *AOwner);

Description

Use TDBCheckBox to create a new TDBCheckBox object.


TDBCheckBox::~TDBCheckBox

TDBCheckBox	Methods	See also

~TDBCheckBox frees the memory associated with the TDBCheckBox object.

Syntax

__fastcall virtual ~TDBCheckBox(void);

Description

Do not call ~TDBCheckBox directly. Instead, use the delete keyword on the object, which causes ~TDBCheckBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TCustomCheckBox


TDBCheckBox example

TDBCheckBox


TDBComboBox

Hierarchy	Properties	Methods	Events

A TDBComboBox component is an indirect descendent of TWinControl. It is a data-aware combo box control. It allows the user to change the value of the field of the current record in a dataset either by selecting an item from a list or by typing in the edit box part of the control. The selected item or entered text becomes the new value of the field if the database combo box’s ReadOnly property is false.

Header

vcl/dbctrls.hpp

How a database combo box appears and behaves depends on the value of its Style property.

You can link the database combo box with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the memo’s DataSource property. Specify the field in the dataset you want to access as the value of the DataField property.

You specify the values the user can choose from in the combo box with the Items property. For example, if you want the user to choose from five different values in the combo box list, specify five strings as the value of Items. Just as with an ordinary combo box, you can add, delete, and insert items to it using the Add, Delete, and Insert methods of the Items object, which is of type TStrings. For example, to add a string to a database combo box, you could write this line of RefSyn:

The ItemIndex property indicates which item in the database combo box is selected.

Sort the items in the list with the Sorted property.

At run time, you can select all the text in the edit box of the database combo box with the SelectAll method. To find out which text the user selected, or to replace selected text, use the SelText property. To select only part of the text or to find out what part of the text is selected, use the SelStart and SelLength properties.


TDBComboBox properties

TDBComboBox	Alphabetically	Legend

In TDBComboBox

DataField

DataSource

Field

Items

ReadOnly

Style

Derived from TCustomComboBox

Canvas

DropDownCount

DroppedDown

ItemHeight

ItemIndex

SelLength

SelStart

SelText

Sorted

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBComboBox properties

TDBComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

DropDownCount

DroppedDown

Enabled

Field

Font

Handle

Height

HelpContext

Hint

ItemHeight

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TDBComboBox::DataField

TDBComboBox	Properties

Identifies the field from which the data-aware control displays data.

Syntax

__property System::AnsiString DataField;

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.


TDBComboBox::DataSource

TDBComboBox	Properties

Determines where the component obtains the data to display.

Syntax

__property Db::TDataSource * DataSource;

Specify the data source component that identifies the dataset the data is found in.


TDBComboBox::Field

TDBComboBox	Properties

Returns the TField object the database combo box is linked to.

Syntax

__property Db::TField * Field;

The Field property returns the TField object the data-aware control is linked to. Use the Field object when you want to change the value of the data in the field programmatically.


TDBComboBox::Items

TDBComboBox	Properties

Contains the strings that appear in the database combo box.

Syntax

__property Items;

Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object.

The ItemIndex property determines which item is selected, if any.

To determine if a particular item in the list of strings that makes up the Items property for a combo box is selected, use the Selected property.


TDBComboBox::ReadOnly

TDBComboBox	Properties

Determines if the user can change the contents of the control.

Syntax

__property System::Boolean ReadOnly;

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents.

The ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBComboBox::Style

TDBComboBox	Properties

Determines how a combo box displays its items.

Syntax

__property Style;

By default, Style is csDropDown, meaning that the combo box displays each item as a string in a drop-downthat items can be graphical of either fixed or varying height. You can set Style to any of list. By changing the value of Style, you can create owner-draw combo boxes, meaning the following values:

Value	Meaning

csDropDown	Creates a drop-down list with an edit box in which the user can enter text. All items are strings, with each item having the same height.For database combo boxes, the combo box displays the contents of the field of the current records. The user can choose another item from the drop-down list and change the value of the field or type a new value in the edit box.

csSimple	Creates an edit box with no list. For database combo boxes, the current contents of the linked field displays in the combo box. The user can change the contents of the field by typing in a new value.

csDropDownList	Creates a drop-down list with no attached edit box, so the user can't edit an item or type in a new item. All items are strings, with each item having the same height.For database combo boxes, the edit box is blank unless the current contents of the field matches one of the specified Items in the drop-down list. The user can change the contents of the field only by selecting one of the strings from the drop-down list.

csOwnerDrawFixed	Each item in the combo box is the height specified by the ItemHeight property.For database combo boxes, the combo box is blank unless the current contents of the field matches one of the specified Items in the drop-down list. The user can change the contents of the field only by selecting one of the strings from the drop-down list.

csOwnerDrawVariable	Items in the combo box can be of varying heights.For database combo boxes, the combo box is blank unless the current contents of the field matches one of the specified Items in the drop-down list. The user can change the contents of the field only by selecting one of the strings from the drop-down list.

Owner-draw combo boxes can display items other than strings. For example, a combo box could display graphical images along with or instead of its strings. Owner-draw combo boxes require more programming, however, as the application needs information on how to render the image for each item in the list.

Each time an item is displayed in an csOwnerDrawFixed combo box, the OnDrawItem event occurs. The event handler for OnDrawItem draws the specified item. The ItemHeight property determines the height of all the items.

Each time an item is displayed in an csOwnerDrawVariable combo box, two events occur. The first is the OnMeasureItem event. The event handler for OnMeasureItem can set the height of each item. Then the OnDrawItem event occurs. The OnDrawItem handler draws each item in the list box using the size specified by the OnMeasureItem handler.


TDBComboBox events

TDBComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBComboBox events

TDBComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnStartDrag


OnChange


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnDrawItem


OnDropDown


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMeasureItem


OnStartDrag


TDBComboBox methods

TDBComboBox	Alphabetically

In TDBComboBox

~TDBComboBox

TDBComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBComboBox methods

TDBComboBox	By object

~TDBComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBComboBox

UpdateControlState

Update


TDBComboBox::TDBComboBox

TDBComboBox	Methods	See also

TDBComboBox creates a new TDBComboBox object.

Syntax

__fastcall virtual TDBComboBox(Classes::TComponent *AOwner);

Description

Use TDBComboBox to create a new TDBComboBox object.


TDBComboBox::~TDBComboBox

TDBComboBox	Methods	See also

~TDBComboBox frees the memory associated with the TDBComboBox object.

Syntax

__fastcall virtual ~TDBComboBox(void);

Description

Do not call ~TDBComboBox directly. Instead, use the delete keyword on the object, which causes ~TDBComboBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TDBComboBox example

TDBComboBox


TDBCtrlPanel

Hierarchy	Properties	Methods

Header

vcl/dbcgrids.hpp

Description


TDBCtrlPanel properties

TDBCtrlPanel	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBCtrlPanel properties

TDBCtrlPanel	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TDBCtrlPanel methods

TDBCtrlPanel	Alphabetically

In TDBCtrlPanel

~TDBCtrlPanel

TDBCtrlPanel

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlPanel methods

TDBCtrlPanel	By object

~TDBCtrlPanel

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBCtrlPanel

UpdateControlState

Update


TDBCtrlPanel::TDBCtrlPanel

TDBCtrlPanel	Methods	See also

TDBCtrlPanel creates a new TDBCtrlPanel object.

Syntax

__fastcall TDBCtrlPanel(TDBCtrlGrid *DBCtrlGrid);

Description

Use TDBCtrlPanel to create a new TDBCtrlPanel object.


TDBCtrlPanel::~TDBCtrlPanel

TDBCtrlPanel	Methods	See also

~TDBCtrlPanel frees the memory associated with the TDBCtrlPanel object.

Syntax

__fastcall virtual ~TDBCtrlPanel(void);

Description

Do not call ~TDBCtrlPanel directly. Instead, use the delete keyword on the object, which causes ~TDBCtrlPanel to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TDBCtrlPanel example

TDBCtrlPanel


TDBCtrlGrid

Hierarchy	Properties	Methods	Events

TDBCtrlGrid displays multiple records from a data source. Unlike the TDBGrid component, which displays each record in a single row, you control the layout and appearance of each record in a TDBCtrlGrid. Each record is displayed in its own panel; you design one panel at design time and TDBCtrlGrid replicates that panel for each record displayed.

Header

vcl/dbcgrids.hpp

Like all data-aware controls, TDBCtrlGrid’s DataSource property tells it where to get the data it displays.

You can resize the panels by setting the PanelHeight and PanelWidth properties. Set the ColCount and RowCount properties to change the dimensions of the grid.

If you want records to be displayed across columns, then wrap to multiple rows, set the grid’s Orientation property to roHorizontal. The default of roVertical displays records down then across (in columns).

By default, each record’s panel has a raised border. If you don’t want a border, set the PanelBorder property to rbNone.

By default, when the grid gets the focus, it shows a dotted focus rectangle around the panel containing the current record. If you don’t want a focus rectangle, set the ShowFocus property to false.

If you don’t want the user to be able to insert or delete records into the attached dataset, set the AllowInsert or AllowDelete properties to false.

Call the DoKey method to simulate a key press. Add an OnPaintPanel event handler if you want to customize how a panel is painted. TDBCtrlGrid is a direct descendent of TWinControl.


TDBCtrlGrid properties

TDBCtrlGrid	Alphabetically	Legend

In TDBCtrlGrid

AllowDelete

AllowInsert

Canvas

ColCount

DataSource

EditMode

Orientation

PanelBorder

PanelCount

PanelHeight

PanelIndex

PanelWidth

RowCount

ShowFocus

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBCtrlGrid properties

TDBCtrlGrid	By object	Legend

Align

AllowDelete

AllowInsert

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DataSource

DesignInfo

DragCursor

DragMode

EditMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Orientation

Owner

PanelBorder

PanelCount

PanelHeight

PanelIndex

PanelWidth

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

RowCount

ShowFocus

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TDBCtrlGrid::AllowDelete

TDBCtrlGrid	Properties

Determines whether the user can delete the current record by pressing Ctrl+Delete.

Syntax

__property System::Boolean AllowDelete;

If true (the default), the user can delete the current record by pressing Ctrl+Delete. You can get the same effect in RefSyn by calling DoKey with the rkDelete parameter. If false, TDBCtrlGrid won't delete records, though you can still do so by calling the attached dataset's Delete method.


TDBCtrlGrid::AllowInsert

TDBCtrlGrid	Properties

Determines whether the user can insert new records with the Insert key or append new records with the Ctrl_Insert key combination.

Syntax

__property System::Boolean AllowInsert;

If AllowInsert is true (the default), the user can insert or append new records by pressing Insert or Ctrl+Insert (respectively) while not editing a record. You can get the same effect with RefSyn by calling DoKey with a parameter of gkInsert or gkAppend.

If AllowInsert is false, TDBCtrlGrid won't insert or append new records, though you can still do so by calling the attached dataset's Insert or Append methods.


TDBCtrlGrid::Canvas

TDBCtrlGrid	Properties

Provides you access to a drawing surface.

Syntax

__property Graphics::TCanvas * Canvas;

You can use the Canvas when implementing a handler for the OnDrawCell or OnDrawDataCell event of a grid control.


TDBCtrlGrid::ColCount

TDBCtrlGrid	Properties

Specifies the number of columns of panels shown in the grid.

Syntax

__property System::Integer ColCount;

When you set the ColCount property, the grid resizes itself to fit the new number of columns; PanelWidth doesn't change.


TDBCtrlGrid::DataSource

TDBCtrlGrid	Properties

Determines where the data control grid obtains its data to display.

Syntax

__property Db::TDataSource * DataSource;

Specify the data source component that identifies the dataset the data is found in.


TDBCtrlGrid::EditMode

TDBCtrlGrid	Properties

Determines whether the user is editing the current record.

Syntax

__property System::Boolean EditMode;

When EditMode is true, the user is editing the current record. The user can toggle EditMode by pressing F2 or Enter.


TDBCtrlGrid::Orientation

TDBCtrlGrid	Properties

Determines how multiple records wrap within the grid.

Syntax

__property TDBCtrlGridOrientation Orientation;

Set Orientation to roVertical (the default) to have the panels ordered across, then down (in rows with a vertical scroll bar). When you set Orientation to roHorizontal, panels go down, then across (in columns with a horizontal scroll bar).

The TDBCtrlGridOrientation type defines the possible values for the Orientation property of the TDBCtrlGrid component, which are described in the following table:

Value	Description

goVertical	Panels go down, then across (in columns)

goHorizontal	Panels go across, then down (in rows)


TDBCtrlGrid::PanelBorder

TDBCtrlGrid	Properties

Controls the type of border drawn around each panel.

Syntax

__property TDBCtrlGridBorder PanelBorder;

The default value of gbRaised draws a raised border. Set PanelBorder to gbNone to eliminate the border.

The TDBCtrlGridBorder type defines the possible values for the PanelBorder property of the TDBCtrlGrid component, as described in the following table:

Value	Description

gbNone	No border

gbRaised	Raised border


TDBCtrlGrid::PanelCount

TDBCtrlGrid	Properties

Indicates the number of panels visible in the grid.

Syntax

__property System::Integer PanelCount;


TDBCtrlGrid::PanelHeight

TDBCtrlGrid	Properties

Represents the height in pixels of each panel.

Syntax

__property System::Integer PanelHeight;

When you set the PanelHeight property, the grid resizes itself to fit the new panel height.


TDBCtrlGrid::PanelIndex

TDBCtrlGrid	Properties

Specifies which panel (in the range 0..PanelCount - 1) shows the current record.

Syntax

__property System::Integer PanelIndex;

When you set this property, the record displayed in the specified panel is made the current record and the panel is made visible.


TDBCtrlGrid::PanelWidth

TDBCtrlGrid	Properties

Specifies the width in pixels of each panel.

Syntax

__property System::Integer PanelWidth;

When you set the PanelWidth property, the grid resizes itself to fit the new panel width.


TDBCtrlGrid::RowCount

TDBCtrlGrid	Properties

Specifies the number of rows of panels displayed in the grid.

Syntax

__property System::Integer RowCount;

When you set the RowCount property, the grid resizes itself to fit the new number of rows; PanelHeight doesn't change.


TDBCtrlGrid::ShowFocus

TDBCtrlGrid	Properties

Specifies whether to draw a focus rectangle inside the panel containing the current record.

Syntax

__property System::Boolean ShowFocus;


TDBCtrlGrid events

TDBCtrlGrid	Alphabetically	Legend

In TDBCtrlGrid

OnPaintPanel

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBCtrlGrid events

TDBCtrlGrid	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaintPanel

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


TDBCtrlGrid::OnPaintPanel

TDBCtrlGrid	Events

Syntax

__property TPaintPanelEvent OnPaintPanel;


OnStartDrag


TDBCtrlGrid methods

TDBCtrlGrid	Alphabetically

In TDBCtrlGrid

~TDBCtrlGrid

DoKey

GetTabOrderList

KeyDown

TDBCtrlGrid

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlGrid methods

TDBCtrlGrid	By object

~TDBCtrlGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DoKey

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBCtrlGrid

UpdateControlState

Update


TDBCtrlGrid::DoKey

TDBCtrlGrid	Methods

Implements the record-grid component's responses to a number of standard keystrokes.

Syntax

void __fastcall DoKey(TDBCtrlGridKey Key);

The DoKey method You can create your own keystroke mappings by calling DoKey from a handler for the OnKeyPress event.


TDBCtrlGrid::GetTabOrderList

TDBCtrlGrid	Methods

[THIS ENTRY IF NOT FOR THIS OVERRIDE BUT FOR TWINCONTROL - THE GENERIC ENTRY]

Syntax

virtual void __fastcall GetTabOrderList(Classes::TList *List);

Builds a list of controls in tab order.

The GetTabOrderList method builds a list of controls in tab order by iterating through the windowed control's internal tab-order list, adding each of the controls to List, including any controls contained in those controls. The result is a list of all the controls and their owned controls, in tab order.

The FindNextControl method calls GetTabOrderList to build a complete list of the controls that might be "next."


TDBCtrlGrid::KeyDown

TDBCtrlGrid	Methods

[THIS ENTRY IF NOT FOR THIS OVERRIDE BUT FOR TWINCONTROL - THE GENERIC ENTRY]

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);

Calls any event handler attached to the OnKeyDown event.

The KeyDown method is the protected implementation method for a windowed control's OnKeyDown event.  The KeyDown method inherited from TWinControl does nothing except call any event handler attached to the OnKeyDown event. You can override KeyDown to provide other responses in addition to the inherited event-handler call.

A windowed control calls KeyDown in response to a key-down message (WM_KEYDOWN) from Windows. The actual sequence is that the message goes to a private message handler that calls the DoKeyDown method.  If DoKeyDown determines that the control should, in fact, process the character, it deRefSyns the parameters of the key-down message and passes the key RefSyn and shift-key state to KeyDown in the Key and Shift parameters, respectively.

Either KeyDown  or the OnKeyDown event handler it calls can suppress further processing of a key by setting the Key parameter to zero.


TDBCtrlGrid::TDBCtrlGrid

TDBCtrlGrid	Methods	See also

TDBCtrlGrid creates a new TDBCtrlGrid object.

Syntax

__fastcall virtual TDBCtrlGrid(Classes::TComponent *AOwner);

Description

Use TDBCtrlGrid to create a new TDBCtrlGrid object.


TDBCtrlGrid::~TDBCtrlGrid

TDBCtrlGrid	Methods	See also

~TDBCtrlGrid frees the memory associated with the TDBCtrlGrid object.

Syntax

__fastcall virtual ~TDBCtrlGrid(void);

Description

Do not call ~TDBCtrlGrid directly. Instead, use the delete keyword on the object, which causes ~TDBCtrlGrid to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TDBCtrlGrid example

TDBCtrlGrid


TDBCtrlGridLink

Hierarchy	Properties	Methods	See also

TDBCtrlGridLink is a helper object that helps manage data events for a TDBCtrlGrid object.

Header

vcl/dbcgrids.hpp

Description

TDBCtrlGridLink is tailored to work with a TDBCtrlGrid. It should only be used by the TDBCtrlGrid class.


TDBCtrlGridLink properties

TDBCtrlGridLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TDBCtrlGridLink properties

TDBCtrlGridLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TDBCtrlGridLink methods

TDBCtrlGridLink	Alphabetically	Legend

In TDBCtrlGridLink

~TDBCtrlGridLink

ActiveChanged

DataSetChanged

TDBCtrlGridLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlGridLink methods

TDBCtrlGridLink	By object	Legend

~TDBCtrlGridLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TDBCtrlGridLink

UpdateRecord


TDBCtrlGridLink::ActiveChanged

TDBCtrlGridLink	Methods	See also

ActiveChanged informs the TDBCtrlGrid of changes in the Active property.

Syntax

virtual void __fastcall ActiveChanged(void);

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the DataSetChanged method of the TDBCtrlGrid object that owns this TDBCtrlGridLink.


TDBCtrlGridLink::DataSetChanged

TDBCtrlGridLink	Methods	See also

DataSetChanged informs the TDBCtrlGrid of changes to the dataset.

Syntax

virtual void __fastcall DataSetChanged(void);

Description

Applications should not call the DataSetChanged method directly. DataSetChanged will be called automatically when the contents of the dataset change. When the dataset scrolls or the representation of the dataset by the TDBCtrlGrid changes, DataSetChanged will be called indirectly. DataSetChanged informs the TDBCtrlGrid object of the change by calling its DataSetChanged method.


TDBCtrlGridLink::TDBCtrlGridLink

TDBCtrlGridLink	Methods	See also

TDBCtrlGridLink creates a new TDBCtrlGridLink object.

Syntax

__fastcall TDBCtrlGridLink(TDBCtrlGrid *DBCtrlGrid);

Description

Use TDBCtrlGridLink to create a new TDBCtrlGridLink object.


TDBCtrlGridLink::~TDBCtrlGridLink

TDBCtrlGridLink	Methods	See also

~TDBCtrlGridLink frees the memory associated with the TDBCtrlGridLink object.

Syntax

__fastcall virtual ~TDBCtrlGridLink(void);

Description

Do not call ~TDBCtrlGridLink directly. Instead, use the delete keyword on the object, which causes ~TDBCtrlGridLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TDBCtrlGridLink example

TDBCtrlGridLink


TDBDataSet

Hierarchy	Properties	Methods	Events

Header

vcl/db.hpp

Description


TDBDataSet properties

TDBDataSet	Alphabetically	Legend

In TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

Derived from TDataSet

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

DataSource

DefaultFields

Designer

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBDataSet properties

TDBDataSet	By object	Legend

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

KeySize

Locale

Modified

Name

Owner

RecNo

RecordCount

RecordSize

SessionName

State

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending


TDBDataSet::Database

TDBDataSet	Properties

Syntax

__property TDatabase * Database;

Description


TDBDataSet::DatabaseName

TDBDataSet	Properties

Syntax

__property System::AnsiString DatabaseName;

Description


TDBDataSet::DBHandle

TDBDataSet	Properties

Syntax

__property Bde::hDBIDb DBHandle;

Description


TDBDataSet::DBLocale

TDBDataSet	Properties

Syntax

__property System::Pointer DBLocale;

Description


TDBDataSet::DBSession

TDBDataSet	Properties

Syntax

__property TSession * DBSession;

Description


TDBDataSet::SessionName

TDBDataSet	Properties

Syntax

__property System::AnsiString SessionName;

Description


TDBDataSet events

TDBDataSet	Alphabetically	Legend

Derived from TDataSet

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDBDataSet events

TDBDataSet	By object	Legend

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDBDataSet methods

TDBDataSet	Alphabetically

In TDBDataSet

~TDBDataSet

CheckOpen

TDBDataSet

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBDataSet methods

TDBDataSet	By object

~TDBDataSet

ActiveBuffer

AppendRecord

Append

ApplyUpdates

Assign

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

DefaultHandler

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SetDetailFields

SetFields

TDBDataSet

UpdateCursorPos

UpdateRecord

UpdateStatus


TDBDataSet::CheckOpen

TDBDataSet	Methods

Syntax

System::Boolean __fastcall CheckOpen(System::Word Status);

Description


TDBDataSet::TDBDataSet

TDBDataSet	Methods	See also

TDBDataSet creates a new TDBDataSet object.

Syntax

__fastcall virtual TDBDataSet(Classes::TComponent *AOwner);

Description

Use TDBDataSet to create a new TDBDataSet object.


TDBDataSet::~TDBDataSet

TDBDataSet	Methods	See also

~TDBDataSet frees the memory associated with the TDBDataSet object.

Syntax

__fastcall virtual ~TDBDataSet(void);

Description

Do not call ~TDBDataSet directly. Instead, use the delete keyword on the object, which causes ~TDBDataSet to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet


TDBDataSet example

TDBDataSet


TDBEdit

Hierarchy	Properties	Methods	Events	See also

A TDBEdit object is a single-line edit control that can display and edit a field in a dataset.

Header

vcl/dbctrls.hpp

Description

Use a TDBEdit object to enable users to edit a database field. TDBEdit uses a mask to restrict input to data that is valid for the database field. TDBEdit uses the Text property to represent the contents of the field.

TDBEdit permits only a single line of text. If the field may contain lengthy data that would require multiple lines, consider using a TDBMemo object.

If the application doesn’t require the data-aware capabilities of TDBEdit, use an edit control (TEdit), or a masked edit control (TMaskEdit) instead, to conserve system resources.


TDBEdit properties

TDBEdit	Alphabetically	Legend

In TDBEdit

DataField

DataSource

Field

ReadOnly

Derived from TCustomMaskEdit

EditText

IsMasked

MaxLength

Text

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

Modified

PasswordChar

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBEdit properties

TDBEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

EditText

Enabled

Field

Font

Handle

Height

HelpContext

Hint

IsMasked

Left

MaxLength

Modified

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TDBEdit::DataField

TDBEdit	Properties	See also

DataField specifies the field from which the edit control displays data.

Syntax

__property System::AnsiString DataField;

Description

Use DataField to bind the edit control to a field in the dataset. To fully specify a database field, both the dataset and the field within that dataset must be defined. The DataSource property of the edit box control specifies the dataset which contains the DataField.

If the DataField refers to a database field that contains integer or floating-point data, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.


TDBEdit::DataSource

TDBEdit	Properties	See also

DataSource links the edit control to the dataset that contains the field it represents.

Syntax

__property Db::TDataSource * DataSource;

Description

Use DataSource to link the edit control to a dataset in which the data can be found. To fully specify a database field for the edit control, both the dataset and a field within that dataset must be defined. Use the DataField property to specify the particular field within the dataset.


TDBEdit::Field

TDBEdit	Properties	See also

Field specifies the TField object for the database field the edit box represents.

Syntax

__property Db::TField * Field;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically. Use the Text property instead if you want to change the contents of the edit window without immediately posting the changes to the dataset. Changing the Text property allows the user to cancel the changes.


TDBEdit::ReadOnly

TDBEdit	Properties	See also

ReadOnly determines whether the user can use the database edit box to change the value of the field in the current record.

Syntax

__property System::Boolean ReadOnly;

Description

Set ReadOnly to true to prevent the user from changing the contents of the database field. When ReadOnly is true, the edit control is used only to display the contents of the field. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBEdit events

TDBEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBEdit events

TDBEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBEdit methods

TDBEdit	Alphabetically	Legend

In TDBEdit

~TDBEdit

Change

EditCanModify

KeyDown

KeyPress

Notification

Reset

TDBEdit

Derived from TCustomMaskEdit

Clear

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBEdit methods

TDBEdit	By object	Legend

~TDBEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditCanModify

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

MethodAddress

MethodName

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Reset

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TDBEdit

UpdateControlState

Update

ValidateEdit


TDBEdit::Change

TDBEdit	Methods	See also

Change keeps track of the fact that the text has been modified, before letting the inherited method call the OnChange event handler if it is assigned.

Syntax

virtual void __fastcall Change(void);

Description

Change is a protected method. Applications can not call it directly. It is triggered automatically by Windows’ events. Change responds to these events by internally keeping track of the fact that the text has been modified. This information can then be used to know whether there are any changes to post to the dataset or remove when if the user requests a reset.


TDBEdit::EditCanModify

TDBEdit	Methods	See also

EditCanModify allows or disallows editing of the text depending on whether the dataset is in edit mode.

Syntax

virtual System::Boolean __fastcall EditCanModify(void);

Description

EditCanModify overrides the inherited method so that the control will only allow edits when the dataset is in edit mode. If the edit control should never allow edits, the ReadOnly property should be set.

Note

EditCanModify is a protected method. Applications can not call it directly.


TDBEdit::KeyDown

TDBEdit	Methods	See also

KeyDown supplements the inherited method to drive the dataset into edit mode when the user presses Del or Shift+Insert.

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.

Note

KeyDown is a protected method. Applications can not call it directly. It is called automatically in response to Windows events.


TDBEdit::KeyPress

TDBEdit	Methods	See also

KeyPress supplements the inherited method to handle any keystokes that alter the state of the edit control.

Syntax

virtual void __fastcall KeyPress(System::Char &Key);

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

Pressing the Escape key causes KeyPress to callReset, throwing away all unposted edits.

Note

KeyPress is a protected method. Applications can not call it directly. It is called automatically in response to Windows events.


TDBEdit::Notification

TDBEdit	Methods	See also

Notification overrides the inherited method to respond to opRemove notifications on the DataSource.

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to NULL.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.

Note

Notification is a protected method. Applications can not call it directly.


TDBEdit::Reset

TDBEdit	Methods	See also

Reset cancels all unposted edits.

Syntax

virtual void __fastcall Reset(void);

Description

Reset overrides the default method to cancel all unposted edits to the dataset when the user presses the Escape key.

Note

Reset is a protected method. Applications can not call it directly. It is called automatically when the user presses the Escape key.


TDBEdit::TDBEdit

TDBEdit	Methods	See also

TDBEdit creates a new TDBEdit object.

Syntax

__fastcall virtual TDBEdit(Classes::TComponent *AOwner);

Description

Use TDBEdit to create a new TDBEdit object.


TDBEdit::~TDBEdit

TDBEdit	Methods	See also

~TDBEdit frees the memory associated with the TDBEdit object.

Syntax

__fastcall virtual ~TDBEdit(void);

Description

Do not call ~TDBEdit directly. Instead, use the delete keyword on the object, which causes ~TDBEdit to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TDBEdit example

TDBEdit


TDBError

Hierarchy	Properties	Methods	See also

TDBError is used by the EDBEngineError exception class to represent Borland Database Engine errors.

Header

vcl/db.hpp

Description

An EDBEngineError exception is raised when Borland Database Engine errors occur. EDBEngineError reads the stack of BDE errors and creates a separate TDBError object to represent each one. These TDBError objects are contained in the Errors property of EDBEngineError.


TDBError properties

TDBError	Alphabetically	Legend

In TDBError

Category

ErrorCode

Message

NativeError

SubCode


TDBError properties

TDBError	By object	Legend

Category

ErrorCode

Message

NativeError

SubCode


TDBError::Category

TDBError	Properties

The category of the error referenced by ErrorCode.

Syntax

__property System::Byte Category;

Description

Category contains the first part of the BDE error code.


TDBError::ErrorCode

TDBError	Properties	See also

The error code returned by the BDE.

Syntax

__fastcall TDBError(EDBEngineError *Owner, System::Word ErrorCode, System::Longint NativeError, System::PChar

Description

ErrorCode is the error code returned by the BDE. It consists of a Category and a SubCode.

DBIResult is a special type used by the DBIError procedure to hold BDE error codes.


TDBError::Message

TDBError	Properties

The text of the error message.

Syntax

Message);

Description

Message contains the remote server message for native (server) errors, or the BDE message associated with ErrorCode for non-server errors.


TDBError::NativeError

TDBError	Properties

The remote error code returned from the server.

Syntax

__fastcall TDBError(EDBEngineError *Owner, System::Word ErrorCode, System::Longint NativeError, System::PChar

Description

If NativeError is 0, the error is not a server error.


TDBError::SubCode

TDBError	Properties

The subcode of the error referenced by ErrorCode.

Syntax

__property System::Byte SubCode;

Description

SubCode contains the subcode of the BDE error code.


TDBError methods

TDBError	Alphabetically

In TDBError

~TDBError

TDBError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBError methods

TDBError	By object

~TDBError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TDBError


TDBError::TDBError

TDBError	Methods	See also

TDBError creates a new TDBError object.

Syntax

__fastcall TDBError(EDBEngineError *Owner, System::Word ErrorCode, System::Longint NativeError, System::PChar

Description

Use TDBError to create a new TDBError object.


TDBError::~TDBError

TDBError	Methods	See also

~TDBError frees the memory associated with the TDBError object.

Syntax

__fastcall virtual ~TDBError(void);

Description

Do not call ~TDBError directly. Instead, use the delete keyword on the object, which causes ~TDBError to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TDBError example

TDBError


TDBGridColumns

Hierarchy	Properties	Methods	See also

TDBGridColumns is a container for TColumn objects.

Header

vcl/dbgrids.hpp

Description

Each TDBGridColumns holds a collection of TColumn objects in a data grid (TDBGrid). TDBGridColumns maintains an index of the columns in its Items array. The Count property contains the number of columns in the collection. At design time, use the data grid’s Columns editor to add, remove, or modify columns.


TDBGridColumns properties

TDBGridColumns	Alphabetically	Legend

In TDBGridColumns

Grid

Items

State

Derived from TCollection

Count


TDBGridColumns properties

TDBGridColumns	By object	Legend

Count

Grid

Items

State


TDBGridColumns::Grid

TDBGridColumns	Properties	See also

The data-grid control to which the TDBGridColumns instance belongs.

Syntax

__fastcall TDBGridColumns(TCustomDBGrid *Grid, System::TMetaClass * ColumnClass);

Description

The read-only Grid property indicates which data-grid control (TDBGrid) owns the TDBGridColumns object.


TDBGridColumns::Items

TDBGridColumns	Properties

An index of the columns in the collection.

Syntax

__property TColumn * Items[System::Integer Index];

Description

The value of the Index parameter corresponds to the Index property of TColumn. It represents the position of the column in the data grid.


TDBGridColumns::State

TDBGridColumns	Properties	See also

Determines whether the columns in the data grid are dependent on the dataset fields.

Syntax

__property TDBGridColumnsState State;

Description

If State is set to csDefault, columns in the data grid are generated dynamically from information in the grid’s associated dataset. The appearance, order, and other properties of the columns are determined by the dataset fields. Changes made to the columns are reflected in the dataset fields, and vice versa.

If State is set to csCustomized, many properties of the data-grid columns are independent of the associated dataset. For example, a column’s title caption is, by default, the same as the associated field’s DisplayLabel property; if State is csCustomized, however, the column title’s Caption property and the field’s DisplayLabel property can be changed independently. In fact, a customized (or “persistent”) column need not be associated with a dataset field at all.

Note

If you use the Columns editor to configure data-grid columns, State is automatically set to csCustomized. Changing the State property at run time deletes all existing columns.


TDBGridColumns methods

TDBGridColumns	Alphabetically

In TDBGridColumns

~TDBGridColumns

Add

RebuildColumns

RestoreDefaults

TDBGridColumns

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBGridColumns methods

TDBGridColumns	By object

~TDBGridColumns

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RebuildColumns

RestoreDefaults

TDBGridColumns


TDBGridColumns::Add

TDBGridColumns	Methods	See also

Creates a new TColumn instance and adds it to the Items array.

Syntax

TColumn *__fastcall Add(void);

Description

Add returns the new column. At design time, use the data grid’s Columns editor to add columns to the grid.


TDBGridColumns::RebuildColumns

TDBGridColumns	Methods

Deletes existing columns and generates new columns from the dataset associated with the grid.

Syntax

void __fastcall RebuildColumns(void);

Description

RebuildColumns initializes the TDBGridColumns object by deleting all existing columns, then creating new ones from the grid’s associated dataset. If the grid is not connected to a dataset, RebuildColumns simply deletes any existing columns.


TDBGridColumns::RestoreDefaults

TDBGridColumns	Methods	See also

Restores all columns to their default settings.

Syntax

void __fastcall RestoreDefaults(void);

Description

RestoreDefaults iterates through the Items array, calling the RestoreDefaults method for each TColumn object. This method removes all changes made to properties of the TColumn objects and restores the default settings.


TDBGridColumns::TDBGridColumns

TDBGridColumns	Methods	See also

TDBGridColumns creates a new TDBGridColumns object.

Syntax

__fastcall TDBGridColumns(TCustomDBGrid *Grid, System::TMetaClass * ColumnClass);

Description

Use TDBGridColumns to create a new TDBGridColumns object.


TDBGridColumns::~TDBGridColumns

TDBGridColumns	Methods	See also

~TDBGridColumns frees the memory associated with the TDBGridColumns object.

Syntax

__fastcall virtual ~TDBGridColumns(void);

Description

Do not call ~TDBGridColumns directly. Instead, use the delete keyword on the object, which causes ~TDBGridColumns to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TDBGridColumns example

TDBGridColumns


TDBGrid

Hierarchy	Properties	Methods	Events

The TDBGrid component is an indirect descendent of TWinControl. It can access the data in a database table or query and display it in a grid. Your application can use the data grid to insert, delete, or edit data in the database, or simply to display it.

Header

vcl/dbgrids.hpp

The most convenient way to move through data in a data grid and to insert, delete, and edit data is to use the database navigator (TDBNavigator) with the data grid.

The Fields property is an array of all the fields in the dataset displayed in the data grid. To determine which field is the currently selected field, use the SelectedField property. Use the FieldCount property to find out how many fields in the dataset are displayed in the data grid.

You can change the appearance and behavior of a data grid by changing the value of the Options property. For example, you can choose to allow the user to use the Tab key to move to a new column, or you can decide to display grid lines between columns, but not between rows.

If you want the user to be able only to view the data and not to edit it, set the ReadOnly property to true. If you want the user to be able to edit the data, set ReadOnly to false. Also, the dataset must be in Edit state, and the ReadOnly property of the data must be false. The user can cancel an edit by pressing Esc.

Users don’t really insert or edit the data in a field using the data grid until they move to a different record or close the application. Your application can also post edits using RefSyn within event handlers such as OnColExit or OnColEnter.

The value of the TitleFont property determines which font is used to display the column headings.

To customize the order the fields appear in the grid, use the Fields editor.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TDBGrid properties

TDBGrid	Alphabetically	Legend

TCustomDBGrid	    dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]

{bmc publishd.bmp}	Options

In TDBGrid

ReadOnly

Derived from TCustomDBGrid

Columns

DataSource

DefaultDrawing

FieldCount

Fields

SelectedField

SelectedIndex

SelectedRows

TitleFont

Derived from TCustomGrid

BorderStyle

EditorMode

FixedColor

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBGrid properties

TDBGrid	By object	Legend

TCustomDBGrid	    dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataSource

DefaultDrawing

DesignInfo

DragCursor

DragMode

EditorMode

Enabled

FieldCount

Fields

FixedColor

Font

Handle

Height

HelpContext

Hint

Left

Name

{bmc publishd.bmp}	Options

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

SelectedField

SelectedIndex

SelectedRows

ShowHint

Showing

TabOrder

TabStop

Tag

TitleFont

Top

Visible

Width


ReadOnly

Determines whether the user can modify the data in the data grid.

If ReadOnly is false, the user can modify the contents.

When the ReadOnly property of a data grid is true, the user can no longer use the Insert key to insert a new row in the grid, nor can the user append a new row at the end of the data grid with the Down Arrow key.


TDBGrid events

TDBGrid	Alphabetically	Legend

Derived from TCustomDBGrid

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBGrid events

TDBGrid	By object	Legend

OnColEnter

OnColExit

OnColumnMoved

OnDblClick

OnDragDrop

OnDragOver

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


OnColEnter


OnColExit


OnColumnMoved


OnDblClick


OnDragDrop


OnDragOver


OnDrawColumnCell


OnDrawDataCell


OnEditButtonClick


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnStartDrag


TDBGrid methods

TDBGrid	Alphabetically

In TDBGrid

~TDBGrid

TDBGrid

Derived from TCustomDBGrid

DefaultDrawColumnCell

DefaultDrawDataCell

ValidFieldIndex

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBGrid methods

TDBGrid	By object

~TDBGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBGrid

UpdateControlState

Update

ValidFieldIndex


TDBGrid::TDBGrid

TDBGrid	Methods	See also

TDBGrid creates a new TDBGrid object.

Syntax

__fastcall virtual TDBGrid(Classes::TComponent *AOwner);

Description

Use TDBGrid to create a new TDBGrid object.


TDBGrid::~TDBGrid

TDBGrid	Methods	See also

~TDBGrid frees the memory associated with the TDBGrid object.

Syntax

__fastcall virtual ~TDBGrid(void);

Description

Do not call ~TDBGrid directly. Instead, use the delete keyword on the object, which causes ~TDBGrid to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomDBGrid


TDBGrid example

TDBGrid


TDBImage

Hierarchy	Properties	Methods	Events

The TDBImage component is an indirect descendent of TWinControl. It displays a graphic image from a BLOB (binary large object) stored in a field of the current record of a dataset. You can also modify the image if the ReadOnly property is set to false.

Header

vcl/dbctrls.hpp

You can link the database image with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the image’s DataSource property. Specify the field in the dataset you want to access as the value of the image’s DataField property.

You can control when the image appears in the database control with the AutoDisplay property.

You can change the size at which the BLOB is displayed by using the Stretch property.

You can cut, copy, and paste images in the database image control. While your application is running and the database image control has the focus, use the Windows cut, copy, and paste keys (Ctrl+X, Ctrl+C, and Ctrl+V). If you change your mind, you can return to the original state of the database image control by pressing Esc before moving to another record.

If your application doesn’t require the data-aware capabilities of TDBImage, use a database image control (TImage) instead to conserve system resources.


TDBImage properties

TDBImage	Alphabetically	Legend

In TDBImage

AutoDisplay

BorderStyle

Center

DataField

DataSource

Field

Picture

QuickDraw

ReadOnly

Stretch

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBImage properties

TDBImage	By object	Legend

Align

AutoDisplay

BorderStyle

BoundsRect

Brush

Center

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

Picture

PopupMenu

QuickDraw

ReadOnly

ShowHint

Showing

Stretch

TabOrder

TabStop

Tag

Top

Visible

Width


TDBImage::AutoDisplay

TDBImage	Properties

Determines whether to automatically display the contents of a memo or graphic BLOB in a or database image control.

Syntax

__property System::Boolean AutoDisplay;

If AutoDisplay is true (the default value), the image automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is false, the image clears whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter. In addition, by calling the LoadMemo method of a database memo or the LoadPicture method of a database image you can ensure that the control is showing data.

You might want to change the value of AutoDisplay to false if the automatic loading of BLOB fields seems to take too long.


TDBImage::BorderStyle

TDBImage	Properties

Determines whether the database image has a border.

Syntax

__property Forms::TBorderStyle BorderStyle;

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TDBImage::Center

TDBImage	Properties

Determines whether an image is centered in the image control.

Syntax

__property System::Boolean Center;

If Center is true, the image is centered. If Center is false, the image aligns with the top left corner of the control. The default value is true.


TDBImage::DataField

TDBImage	Properties

Specifies the field from which the database image displays data.

Syntax

__property System::AnsiString DataField;

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the image control specifies which data source component.


TDBImage::DataSource

TDBImage	Properties

Determines where the component obtains the data to display.

Syntax

__property Db::TDataSource * DataSource;

Specify the data source component that identifies the dataset the data is found in.


TDBImage::Field

TDBImage	Properties

Returns the TField component the database image is linked to.

Syntax

__property Db::TField * Field;

Use the Field object when you want to change the value of the data in the field programmatically.


TDBImage::Picture

TDBImage	Properties

Determines the image that appears on the database image control.

Syntax

__property Graphics::TPicture * Picture;

The property value is a TPicture object which can contain an icon, metafile, bitmap graphic, or user-defined graphic object.


TDBImage::QuickDraw

TDBImage	Properties

Specifies whether the image is displayed using a palette.

Syntax

__property System::Boolean QuickDraw;

If false, a palette is used, to provide the best possible image quality at the expense of additional processing time. If true, no special palette is used, which is faster, but results in poorer picture quality, especially with 256-color images on a 256-color video driver.


TDBImage::ReadOnly

TDBImage	Properties

Determines if the user can change the contents of the database image.

Syntax

__property System::Boolean ReadOnly;

The ReadOnly property determines if the user can change the contents of the control. If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents.

The ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBImage::Stretch

TDBImage	Properties

Determines whether bitmaps and metafiles assume the size and shape of the database image.

Syntax

__property System::Boolean Stretch;

When Stretch is true and the the image control is resized, the image resizes also. Stretch will also resize an image to fit into a smaller image control. The Stretch property has no effect on icons.

If you prefer to have the image control resize to fit the native size of the image, set the AutoSize property to true.


TDBImage events

TDBImage	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBImage events

TDBImage	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TDBImage methods

TDBImage	Alphabetically

In TDBImage

~TDBImage

CopyToClipboard

CutToClipboard

LoadPicture

PasteFromClipboard

TDBImage

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBImage methods

TDBImage	By object

~TDBImage

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

LoadPicture

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBImage

UpdateControlState

Update


TDBImage::CopyToClipboard

TDBImage	Methods

Copies the image of the database image component to the Clipboard.

Syntax

void __fastcall CopyToClipboard(void);

The CopyToClipboard method copies the image of the database image component to the Clipboard.


TDBImage::CutToClipboard

TDBImage	Methods

Deletes the image in the control and copies it to the Clipboard, replacing the contents of the Clipboard.

Syntax

void __fastcall CutToClipboard(void);


TDBImage::LoadPicture

TDBImage	Methods

Loads the image specified as the value of the Picture property into the database image control.

Syntax

void __fastcall LoadPicture(void);

If the value of the AutoDisplay property is false, the image of a database image control is not automatically loaded. If AutoDisplay is false, you can control when the image is loaded at run time by calling LoadPicture when you want the image to appear in the control.


TDBImage::PasteFromClipboard

TDBImage	Methods

Copies the contents of the Clipboard to the control, inserting the contents where the cursor is positioned.

Syntax

void __fastcall PasteFromClipboard(void);


TDBImage::TDBImage

TDBImage	Methods	See also

TDBImage creates a new TDBImage object.

Syntax

__fastcall virtual TDBImage(Classes::TComponent *AOwner);

Description

Use TDBImage to create a new TDBImage object.


TDBImage::~TDBImage

TDBImage	Methods	See also

~TDBImage frees the memory associated with the TDBImage object.

Syntax

__fastcall virtual ~TDBImage(void);

Description

Do not call ~TDBImage directly. Instead, use the delete keyword on the object, which causes ~TDBImage to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TDBImage example

TDBImage


TDBListBox

Hierarchy	Properties	Methods	Events	See also

The TDBListBox component is a data-aware list boxthat allows the user to change the value of the field of the current record in a dataset by selecting an item from a list. The selected item becomes the new value of the field.

Header

vcl/dbctrls.hpp

Link the database list box with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the memo’s DataSource property. Specify the field in the dataset you want to access as the value of the DataField property.

You specify the values the user can choose from in the list box with the Items property. For example, if you want the user to choose from five different values in the list box, specify five strings as the value of Items. Just as with an ordinary list box, you can add, delete, and insert items in the list box using the Add, Delete, and Insert methods of the Items object, which is of type TStrings. For example, to add a string to a database list box, you could write this line of RefSyn:

DBListBox1.Items.Add(‘New item’);

The ItemIndex property indicates which item in the list box is selected. If you want to prevent the user from being able to select an item in the list box, set the ReadOnly property to false.

If your application doesn’t require the data-aware capabilities of TDBListBox, use a list box (TListBox) instead to conserve system resources.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for you own list box object.

Related objects

For related list controls see TListBox, Related objects.


TDBListBox properties

TDBListBox	Alphabetically	Legend

In TDBListBox

DataField

DataSource

Field

Items

ReadOnly

Derived from TCustomListBox

BorderStyle

Canvas

IntegralHeight

ItemHeight

ItemIndex

SelCount

Selected

Style

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBListBox properties

TDBListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

SelCount

Selected

ShowHint

Showing

Style

TabOrder

TabStop

Tag

TopIndex

Top

Visible

Width


TDBListBox::DataField

TDBListBox	Properties	See also

Identifies the field from which the data-aware control displays data.

Syntax

__property System::AnsiString DataField;

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.

If the DataField value of a database edit box (TDBEdit) is an integer or floating-point value, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.


TDBListBox::DataSource

TDBListBox	Properties	See also

Determines where the component obtains the data to display.

Syntax

__property Db::TDataSource * DataSource;

Specify the data source component that identifies the dataset the data is found in.


TDBListBox::Field

TDBListBox	Properties	See also

Syntax

__property Db::TField * Field;


TDBListBox::Items

TDBListBox	Properties	See also

Contains the strings that appear in the list box.

Syntax

__property Items;

(WEIRD) check out the synatx on this one, it’s like write only

Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object.

The ItemIndex property determines which item is selected, if any. To determine if a particular item in the list of strings that makes up the Items property for a list box is selected, use the Selected property.

The following example uses an edit box, a list box, and a button on a form. When the user clicks the button, the text in the edit box is added to the list box:

Example


TDBListBox::ReadOnly

TDBListBox	Properties	See also

Determines if the user can change the contents of the control.

Syntax

__property System::Boolean ReadOnly;

If ReadOnly is true, the user can’t change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

For data-aware controls, the ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field’s value as long as the dataset is in edit mode.

When the ReadOnly property of a data grid is true, the user can no longer use the Insert key to insert a new row in the grid, nor can the user append a new row at the end of the data grid with the Down Arrow key.


TDBListBox events

TDBListBox	Alphabetically	Legend

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBListBox events

TDBListBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnDrawItem


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMeasureItem


OnMouseDown


ONMouseMove


OnMouseUp


OnStartDrag


TDBListBox methods

TDBListBox	Alphabetically

In TDBListBox

~TDBListBox

TDBListBox

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBListBox methods

TDBListBox	By object

~TDBListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBListBox

UpdateControlState

Update


TDBListBox::TDBListBox

TDBListBox	Methods	See also

TDBListBox creates a new TDBListBox object.

Syntax

__fastcall virtual TDBListBox(Classes::TComponent *AOwner);

Description

Use TDBListBox to create a new TDBListBox object.


TDBListBox::~TDBListBox

TDBListBox	Methods	See also

~TDBListBox frees the memory associated with the TDBListBox object.

Syntax

__fastcall virtual ~TDBListBox(void);

Description

Do not call ~TDBListBox directly. Instead, use the delete keyword on the object, which causes ~TDBListBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TDBListBox example

TDBListBox


TDBLookupComboBox

Hierarchy	Properties	Methods	Events

TDBLookupComboBox lets you provide the user with a convenient drop-down list of lookup items for filling in fields that require data from another dataset.

Header

vcl/dbctrls.hpp

Set the DataSource property to the data source that will receive the user’s selection. Set the DataField to either the field to receive the user’s selection or a lookup field. If you set DataField to a lookup field, you don’t need to set any other properties, as TDBLookupComboBox is smart enough to pick up the settings it needs from the lookup field.

Set the ListSource property to the data source of the table holding the lookup items. Set KeyField to the field you want copied into DataField. Set ListField to display a field other than KeyField in the combo box.

In addition to these properties and methods, this component also has the properties and methods that apply to all components.


TDBLookupComboBox properties

TDBLookupComboBox	Alphabetically	Legend

In TDBLookupComboBox

DropDownAlign

DropDownRows

DropDownWidth

ListVisible

ReadOnly

Text

Derived from TDBLookupControl

DataField

DataSource

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBLookupComboBox properties

TDBLookupComboBox	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

DropDownAlign

DropDownRows

DropDownWidth

Enabled

Font

Handle

Height

HelpContext

Hint

KeyField

KeyValue

Left

ListFieldIndex

ListField

ListSource

ListVisible

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TDBLookupComboBox::DropDownAlign

TDBLookupComboBox	Properties

Specifies how the drop-down list is aligned relative to its edit box

Syntax

__property TDropDownAlign DropDownAlign;


TDBLookupComboBox::DropDownRows

TDBLookupComboBox	Properties

Specifies the number of lines of text to display in the drop-down list of the TDBLookupComboBox.

Syntax

__property System::Integer DropDownRows;


TDBLookupComboBox::DropDownWidth

TDBLookupComboBox	Properties

Determines how wide the drop-down list of the combo box is in pixels.

Syntax

__property System::Integer DropDownWidth;

The default value is 0, which means the drop-down list is the same width as the combo box.

The DropDownWidth property is useful when you are displaying multiple fields, and therefore, multiple columns in the database lookup combo box.


Field

Returns the TField component the database lookup combo box is linked to.

Use the Field component when you want to change the value of the data in the field programmatically.


TDBLookupComboBox::ListVisible

TDBLookupComboBox	Properties

Determines whether the database lookup combo box is open or "dropped-down".

Syntax

__property System::Boolean ListVisible;

If ListVisible is true, the combo box is open; if ListVisible is false, the combo box is closed.


TDBLookupComboBox::ReadOnly

TDBLookupComboBox	Properties

Determines if the user can change the contents of the database lookup combo box.

Syntax

__property ReadOnly;

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

The ReadOnly property determines whether the user can use the database lookup combo box to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBLookupComboBox::Text

TDBLookupComboBox	Properties

Text is the value of the field of the current record.

Syntax

__property System::AnsiString Text;


TDBLookupComboBox events

TDBLookupComboBox	Alphabetically	Legend

In TDBLookupComboBox

OnCloseUp

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBLookupComboBox events

TDBLookupComboBox	By object	Legend

OnClick

OnCloseUp

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


TDBLookupComboBox::OnCloseUp

TDBLookupComboBox	Events

Syntax

__property Classes::TNotifyEvent OnCloseUp;


OnDragDrop


OnDragOver


TDBLookupComboBox::OnDropDown

TDBLookupComboBox	Events

Syntax

__property Classes::TNotifyEvent OnDropDown;


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TDBLookupComboBox methods

TDBLookupComboBox	Alphabetically

In TDBLookupComboBox

~TDBLookupComboBox

CloseUp

DropDown

TDBLookupComboBox

Derived from TDBLookupControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupComboBox methods

TDBLookupComboBox	By object

~TDBLookupComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseUp

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

DropDown

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBLookupComboBox

UpdateControlState

Update


TDBLookupComboBox::CloseUp

TDBLookupComboBox	Methods

Closes an opened or "dropped-down" database lookup combo box.

Syntax

void __fastcall CloseUp(System::Boolean Accept);

The Accept parameter determines whether to modify the DataField with the selected value in the combo box.


TDBLookupComboBox::DropDown

TDBLookupComboBox	Methods

Opens or "drops down" the database lookup combo box so that the user has a list of values to choose from.

Syntax

void __fastcall DropDown(void);


TDBLookupComboBox::TDBLookupComboBox

TDBLookupComboBox	Methods	See also

TDBLookupComboBox creates a new TDBLookupComboBox object.

Syntax

__fastcall virtual TDBLookupComboBox(Classes::TComponent *AOwner);

Description

Use TDBLookupComboBox to create a new TDBLookupComboBox object.


TDBLookupComboBox::~TDBLookupComboBox

TDBLookupComboBox	Methods	See also

~TDBLookupComboBox frees the memory associated with the TDBLookupComboBox object.

Syntax

__fastcall virtual ~TDBLookupComboBox(void);

Description

Do not call ~TDBLookupComboBox directly. Instead, use the delete keyword on the object, which causes ~TDBLookupComboBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TDBLookupControl


TDBLookupComboBox example

TDBLookupComboBox


TDBLookupControl

Hierarchy	Properties	Methods

Header

vcl/dbctrls.hpp

Description


TDBLookupControl properties

TDBLookupControl	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBLookupControl properties

TDBLookupControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TDBLookupControl methods

TDBLookupControl	Alphabetically

In TDBLookupControl

~TDBLookupControl

TDBLookupControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupControl methods

TDBLookupControl	By object

~TDBLookupControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBLookupControl

UpdateControlState

Update


TDBLookupControl::TDBLookupControl

TDBLookupControl	Methods	See also

TDBLookupControl creates a new TDBLookupControl object.

Syntax

__fastcall virtual TDBLookupControl(Classes::TComponent *AOwner);

Description

Use TDBLookupControl to create a new TDBLookupControl object.


TDBLookupControl::~TDBLookupControl

TDBLookupControl	Methods	See also

~TDBLookupControl frees the memory associated with the TDBLookupControl object.

Syntax

__fastcall virtual ~TDBLookupControl(void);

Description

Do not call ~TDBLookupControl directly. Instead, use the delete keyword on the object, which causes ~TDBLookupControl to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TDBLookupControl example

TDBLookupControl


TDBLookupListBox

Hierarchy	Properties	Methods	Events

TDBLookupListBox lets you provide the user with a convenient list of lookup items for filling in fields that require data from another dataset.

Header

vcl/dbctrls.hpp

Set the DataSource property to the data source that will receive the user’s selection. Set the DataField to either the field to receive the user’s selection or a lookup field. If you set DataField to a lookup field, you don’t need to set any other properties, as TDBLookupListBox is smart enough to pick up the settings it needs from the lookup field.

Set the ListSource property to the data source of the table holding the lookup items. Set KeyField to the field you want copied into DataField. Set ListField to display a field other than KeyField in the list box.


TDBLookupListBox properties

TDBLookupListBox	Alphabetically	Legend

In TDBLookupListBox

BorderStyle

ReadOnly

RowCount

Derived from TDBLookupControl

DataField

DataSource

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBLookupListBox properties

TDBLookupListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

KeyField

KeyValue

Left

ListFieldIndex

ListField

ListSource

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

RowCount

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TDBLookupListBox::BorderStyle

TDBLookupListBox	Properties

Determines whether the database lookup list box has a border.

Syntax

__property Forms::TBorderStyle BorderStyle;

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TDBLookupListBox::ReadOnly

TDBLookupListBox	Properties

Determines if the user can change the contents of the database lookup list box.

Syntax

__property ReadOnly;

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

The ReadOnly property determines whether the user can use the database lookup list box to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBLookupListBox::RowCount

TDBLookupListBox	Properties

Determines how many rows are visible in the list box.

Syntax

__property System::Integer RowCount;

If you set this property, the list box is resized to match the specified number or rows. Likewise, if you resize the list box (such as by changing its Height property), the RowCount property is adjusted to match the new height.


TDBLookupListBox events

TDBLookupListBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBLookupListBox events

TDBLookupListBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TDBLookupListBox methods

TDBLookupListBox	Alphabetically

In TDBLookupListBox

~TDBLookupListBox

TDBLookupListBox

Derived from TDBLookupControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupListBox methods

TDBLookupListBox	By object

~TDBLookupListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBLookupListBox

UpdateControlState

Update


TDBLookupListBox::TDBLookupListBox

TDBLookupListBox	Methods	See also

TDBLookupListBox creates a new TDBLookupListBox object.

Syntax

__fastcall virtual TDBLookupListBox(Classes::TComponent *AOwner);

Description

Use TDBLookupListBox to create a new TDBLookupListBox object.


TDBLookupListBox::~TDBLookupListBox

TDBLookupListBox	Methods	See also

~TDBLookupListBox frees the memory associated with the TDBLookupListBox object.

Syntax

__fastcall virtual ~TDBLookupListBox(void);

Description

Do not call ~TDBLookupListBox directly. Instead, use the delete keyword on the object, which causes ~TDBLookupListBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TDBLookupControl


TDBLookupListBox example

TDBLookupListBox


TLoginDialog

Hierarchy	Properties	Methods	Events	See also

TLoginDialog is a login dialog box that can be used to provide login security within an application.

Header

vcl/dblogdlg.hpp

Description

Use TLoginDialog to provide login security within an application. Usually a TLoginDialog object is created with the LoginDialogEx function and is used to provide secure access to local database tables. However, TLoginDialog can also be used as a base object for other types of login dialog boxes.


TLoginDialog properties

TLoginDialog	Alphabetically	Legend

Derived from TForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

Designer

DropTarget

FormStyle

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

ObjectMenuItem

OleFormObject

Parent

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TLoginDialog properties

TLoginDialog	By object	Legend

ActiveControl

ActiveMDIChild

ActiveOleControl

Active

Align

AutoScroll

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DropTarget

Enabled

Font

FormStyle

Handle

Height

HelpContext

Hint

HorzScrollBar

Icon

KeyPreview

Left

MDIChildCount

MDIChildren

Menu

ModalResult

Name

ObjectMenuItem

OleFormObject

Owner

Parent

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TileMode

Top

VertScrollBar

Visible

Width

WindowMenu

WindowState


TLoginDialog events

TLoginDialog	Alphabetically	Legend

Derived from TForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnResize

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TLoginDialog events

TLoginDialog	By object	Legend

OnActivate

OnClick

OnCloseQuery

OnClose

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TLoginDialog methods

TLoginDialog	Alphabetically

In TLoginDialog

~TLoginDialog

TLoginDialog

Derived from TForm

ArrangeIcons

Cascade

Close

CloseQuery

CreateNew

DefocusControl

FocusControl

GetFormImage

Hide

Next

Previous

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

Tile

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLoginDialog methods

TLoginDialog	By object

~TLoginDialog

ArrangeIcons

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseQuery

Close

ContainsControl

ControlAtPos

CreateNew

DefaultHandler

DefocusControl

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FocusControl

Focused

FreeInstance

FreeNotification

Free

GetFormImage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocusedControl

SetFocus

SetTextBuf

ShowModal

Show

Tile

TLoginDialog

UpdateControlState

Update


TLoginDialog::TLoginDialog

TLoginDialog	Methods	See also

TLoginDialog creates a new TLoginDialog object.

Syntax

__fastcall virtual TLoginDialog(Classes::TComponent *AOwner);

Description

Use TLoginDialog to create a new TLoginDialog object.


TLoginDialog::~TLoginDialog

TLoginDialog	Methods	See also

~TLoginDialog frees the memory associated with the TLoginDialog object.

Syntax

__fastcall virtual ~TLoginDialog(void);

Description

Do not call ~TLoginDialog directly. Instead, use the delete keyword on the object, which causes ~TLoginDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TForm


TLoginDialog example

TLoginDialog


TDBMemo

Hierarchy	Properties	Methods	Events	See also

A TDBMemo component is a multiline edit control that can display and edit a field in a dataset.

Header

vcl/dbctrls.hpp

Description

Use a TDBMemo component to enable users to edit a field that contains lengthy textual data or to simply display the contents of such a field. TDBMemo uses the Text property to represent the contents of the field.

TDBMemo permits multiple lines of text. Thus, TDBMemo is appropriate for long alphanumeric fields or text BLOBs (binary large objects). For short alphanumeric fields, consider using a TDBEdit component instead.

If the application doesn’t require the data-aware capabilities of TDBMemo, use a memo control (TMemo) instead, to conserve system resources.


TDBMemo properties

TDBMemo	Alphabetically	Legend

In TDBMemo

AutoDisplay

DataField

DataSource

Field

ReadOnly

Derived from TCustomMemo

Alignment

Lines

ScrollBars

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

MaxLength

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBMemo properties

TDBMemo	By object	Legend

Alignment

Align

AutoDisplay

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

Left

Lines

MaxLength

Modified

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantTabs

Width

WordWrap


TDBMemo::AutoDisplay

TDBMemo	Properties	See also

AutoDisplay determines whether to automatically display the contents of a memo or graphic BLOB in a database memo.

Syntax

__property System::Boolean AutoDisplay;

Description

If AutoDisplay is true, the control automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is false, the control shows only the field name whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter.

The effect of AutoDisplay is not purely cosmetic. The data shown by the TDBMemo is the value of the Text property. When AutoDisplay is false, if the data changes, the value of the Text property changes to the name of the field. Thus, if AutoDisplay is false, applications should be cautious about using the value of the Text property to ascertain the value of the underlying field.

Calling the LoadMemo method causes Text to update to the current value of the BLOB field. This change will also be reflected in the appearance of the control on screen.

Change the value of AutoDisplay to false if the automatic loading of BLOB fields seems to take too long.

Note

AutoDisplay only applies to BLOB fields. If the control is bound to another type of text field, AutoDisplay has no effect.


TDBMemo::DataField

TDBMemo	Properties	See also

DataField specifies the name of the field for which the database memo displays data.

Syntax

__property System::AnsiString DataField;

Description

Use DataField to link the memo control to a field in the dataset. Just setting DataField by itself will not link the memo control to a database field. Additionally, the dataset which contains the field must be specified by setting the DataSource property.


TDBMemo::DataSource

TDBMemo	Properties	See also

DataSource links the memo control to the dataset that contains the field for which the memo control displays data.

Syntax

__property Db::TDataSource * DataSource;

Description

Link the memo control with a dataset by setting DataSource to a data source component that identifies the desired data set. Specify which field within the dataset contains the memo data using the DataField property.


TDBMemo::Field

TDBMemo	Properties	See also

Field specifies the TField component the database memo is linked to.

Syntax

__property Db::TField * Field;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically. Use the Text property instead if you want to change the contents of the edit window without immediately posting the changes to the dataset. Changing the Text property allows the user to cancel the changes.


TDBMemo::ReadOnly

TDBMemo	Properties	See also

ReadOnly determines if the user can change the contents of the database memo.

Syntax

__property System::Boolean ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents.

The ReadOnly property determines whether the user can use the database memo to change the value of the field of the current record, or if the control only displays the value. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBMemo events

TDBMemo	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBMemo events

TDBMemo	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBMemo methods

TDBMemo	Alphabetically	Legend

In TDBMemo

~TDBMemo

Change

KeyDown

KeyPress

LoadMemo

Notification

TDBMemo

WndProc

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBMemo methods

TDBMemo	By object	Legend

~TDBMemo

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

LoadMemo

MethodAddress

MethodName

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TDBMemo

UpdateControlState

Update

WndProc


TDBMemo::Change

TDBMemo	Methods	See also

Change informs the data source of changes to the value of the text, before invoking the OnChange event handler.

Syntax

virtual void __fastcall Change(void);

Description

Applications do not call the Change method directly. It is triggered automatically by Windows’ events. Derived classes can override the Change method to make additional responses to changes in the Text property. Any class that overrides the Change method should call the inherited method as well.


TDBMemo::KeyDown

TDBMemo	Methods	See also

KeyDown overrides the inherited method to put the dataset in an editing state if the user types Del or Shift+Insert.

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. If the memo control is not linked to a dataset, KeyDown thows away the keystroke. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.


TDBMemo::KeyPress

TDBMemo	Methods	See also

KeyPress overrides the inherited method to handle any keystokes that alter the state of the edit control.

Syntax

virtual void __fastcall KeyPress(System::Char &Key);

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

If the field for the memo control is a text BLOB, pressing the Pause key causes KeyPress to call the LoadMemo method. Pressing the Escape key causes KeyPress to throw away unposted edits.


TDBMemo::LoadMemo

TDBMemo	Methods	See also

LoadMemo loads the text BLOB fromthe field in the database into the memo control.

Syntax

void __fastcall LoadMemo(void);

Description

LoadMemo allows an application to control when the memo control displays the actual contents of a text BLOB field. Use LoadMemo to update the text in the memo control to the value of the field in the current record. LoadMemo only works with text BLOB fields, when the AutoDisplay property is false, so that the value of the field is not loaded automatically.


TDBMemo::Notification

TDBMemo	Methods	See also

Notification overrides the inherited method to respond to opRemove notifications on the DataSource.

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to NULL.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.


TDBMemo::WndProc

TDBMemo	Methods	See also

WndProc provides specific message responses for the memo control.

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc overrides the WndProc for TWinControl to handle window messages that are specific to the painting of a TDBMemo control, and sends all others to the inherited WndProc.

Derived classes that override WndProc to provide specialized responses to messages should call the inherited WndProc at the end to dispatch any other messages.


TDBMemo::TDBMemo

TDBMemo	Methods	See also

TDBMemo creates a new TDBMemo object.

Syntax

__fastcall virtual TDBMemo(Classes::TComponent *AOwner);

Description

Use TDBMemo to create a new TDBMemo object.


TDBMemo::~TDBMemo

TDBMemo	Methods	See also

~TDBMemo frees the memory associated with the TDBMemo object.

Syntax

__fastcall virtual ~TDBMemo(void);

Description

Do not call ~TDBMemo directly. Instead, use the delete keyword on the object, which causes ~TDBMemo to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TDBMemo example

TDBMemo


TDBNavigator

Hierarchy	Properties	Methods	Events	See also

The TDBNavigator component (a database navigator) is used to move through the data in a dataset and perform operations on the data, such as inserting a blank record or posting a record.

Header

vcl/dbctrls.hpp

Description

Use the database navigator on forms that contain data-aware controls, such as TDBGrid or TDBEdit. TDBNavigator provides the user with control over the dataset when editing or viewing the data.

When the user chooses one of the navigator buttons, the appropriate action occurs on the dataset the navigator is linked to. For example, if the user clicks the Insert button, a blank record is inserted in the dataset.

TDBNavigator can show any or all of the following buttons:

Button	Purpose

First	Sets the current record to the first record in the dataset, disables the First and Prior buttons, and enables the Next and last buttons if they are disabled.

Prior	Sets the current record to the previous record and enables the Last and Next buttons if they are disabled.

Next	Sets the current record to the next record and enables the First and Prior buttons if they are disabled.

Last	Sets the current record to the last record in the dataset, disables the Last and Next buttons, and enables the First and Prior buttons if they are disabled.

Insert	Inserts a new record before the current record, and sets the dataset into Insert and Edit states.

Delete	Deletes the current record and makes the next record the current record.

Edit	Puts the dataset into Edit state so that the current record can be modified.

Post	Writes changes in the current record to the database.

Cancel	Cancels edits to the current record, restores the record display to its condition prior to editing, and turns off Insert and Edit states if they are active.

Refresh	Refreshes the buffered data in the associated dataset. For TQuery components, this button is disabled unless the RequestLive property is true.


TDBNavigator properties

TDBNavigator	Alphabetically	Legend

In TDBNavigator

ConfirmDelete

DataSource

Hints

Visible

VisibleButtons

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBNavigator properties

TDBNavigator	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConfirmDelete

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Handle

Height

HelpContext

Hints

Hint

Left

Name

Owner

ParentCtl3D

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VisibleButtons

Visible

Width


TDBNavigator::ConfirmDelete

TDBNavigator	Properties	See also

The ConfirmDelete property determines whether a message box appears asking the user to confirm the deletion when the user uses the database navigator to delete the current record in the dataset.

Syntax

__property System::Boolean ConfirmDelete;

Description

Use the ConfirmDelete property to help prevent the user from accidentally deleting a record from the dataset.

If ConfirmDelete is true, a message box appears when the user presses the delete button and the record isn't deleted unless the user chooses the OK button. If ConfirmDelete is false, no message box appears and the record is simply deleted.


TDBNavigator::DataSource

TDBNavigator	Properties	See also

The DataSource property links the navigator to the dataset which it controls.

Syntax

__property Db::TDataSource * DataSource;

Description

Use the DataSource property to link the database navigator with a dataset. Specify the data source component that identifies the dataset the data is found in.


TDBNavigator::Hints

TDBNavigator	Properties	See also

The Hints property provides a way to customize the Help Hints for the buttons on the database navigator.

Syntax

__property Classes::TStrings * Hints;

Description

Use the Hints property to supply Help Hints of your choosing for the individual navigator buttons. Each button has a default Help Hint. Hints allow the values of any or all of these default Help Hints to be replaced by customized hints.

Hints is a string list. Each hint is a string. The first string in the string list becomes the Help Hint for the first button on the navigator (the First button). The seventh hint becomes the Help Hint for the seventh button (the Edit button).

When specifying Hints at runtime, enter an empty string ('') for any Help Hint that should keep the default value. Simply leave the line blank when using the string list property editor of the Object Inspector for the Hints property.

Note

To have the Help Hints appear at run time, set the ShowHint property to true.


Visble

The Visible property determines whether the database navigator appears onscreen.

Description

Use the Visible property to control when the navigator appears. When Visible is true, the navigator appears. If Visible is false, the navigator is not visible. Calling the Show method sets the control's Visible property true, but it also performs other actions to ensure that the user can see the control.


TDBNavigator::VisibleButtons

TDBNavigator	Properties	See also

The VisibleButtons property array determines which buttons appear on the database navigator.

Syntax

__property TButtonSet VisibleButtons;

Description

Use VisibleButtons to select which buttons appear on the navigator. Leave any of the navigator buttons out of the VisibleButtons set to hide those buttons and thereby prevent the user from performing certain operations. For example, to only allow the user to view the records in the dataset, VisibleButtons should include only the nbFirst, nbPrior, nbNext, and nbLast

The following buttons are available for VisibleButtons.

Button	Value	Action

First	nbFirst	Go to the first record

Prior	nbPrior	Go to the previous record

Next	nbNext	Go to the next record

Last	nbLast	Go to the last record

Insert	nbInsert	Insert a blank record

Delete	nbDelete	Deletes the current record

Edit	nbEdit	Permits editing of the current record

Post	nbPost	Posts the current record

Cancel	nbCancel	Cancels the current edit

Refresh	nbRefresh	Refreshes the data in the dataset


TDBNavigator events

TDBNavigator	Alphabetically	Legend

In TDBNavigator

OnClick

Derived from TCustomPanel

OnResize

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBNavigator events

TDBNavigator	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnResize

OnStartDrag


TDBNavigator::OnClick

TDBNavigator	Events	See also

The OnClick event occurs when the database navigator is clicked.

Syntax

__property ENavClick OnClick;

Use the OnClick event handler to write code that responds to the click event. Because the buttons on the navigator already have default actions that occur when they are clicked, it isn’t necessary to write an OnClick event handler.

The OnClick event occurs when

•	The user clicks one the buttons on the navigator with the mouse

•	The user presses Spacebar while the navigator has focus.

•	The BtnClick method is called.

Note

The OnClick event is triggered after the default action for the clicked button occurs.


TDBNavigator methods

TDBNavigator	Alphabetically

In TDBNavigator

~TDBNavigator

BtnClick

SetBounds

TDBNavigator

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBNavigator methods

TDBNavigator	By object

~TDBNavigator

Assign

BeginDrag

BringToFront

Broadcast

BtnClick

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBNavigator

UpdateControlState

Update


TDBNavigator::BtnClick

TDBNavigator	Methods	See also

The BtnClick method simulates a button click on the database navigator, invoking the action of the button.

Syntax

void __fastcall BtnClick(TNavigateBtn Index);

Description

Use BtnClick when you want the application, not the user, to control the database navigator. Call BtnClick, specifying a TNavigateBtn type as the value of the Index parameter, to invoke the command associated with the selected button.

Calling BtnClick triggers the navigator’s OnClick event after the default action of the button.


TDBNavigator::SetBounds

TDBNavigator	Methods	See also

The SetBounds sets the database navigator's boundary properties all at one time.

Syntax

virtual void __fastcall SetBounds(System::Integer ALeft, System::Integer ATop, System::Integer AWidth

Description

Call SetBounds when to set more than one of the navigator’s boundary properties at a time. The Left, Top, Width, and Height properties are set to the values passed in the ALeft, ATop, AWidth, and AHeight parameters, respectively. SetBounds arranges the buttons on the navigator to fit within the boundaries.

Although you can always set the individual boundaries, using SetBounds makes several changes at once without rearranging the buttons for each change.


TDBNavigator::TDBNavigator

TDBNavigator	Methods	See also

TDBNavigator creates a new TDBNavigator object.

Syntax

__fastcall virtual TDBNavigator(Classes::TComponent *AOwner);

Description

Use TDBNavigator to create a new TDBNavigator object.


TDBNavigator::~TDBNavigator

TDBNavigator	Methods	See also

~TDBNavigator frees the memory associated with the TDBNavigator object.

Syntax

__fastcall virtual ~TDBNavigator(void);

Description

Do not call ~TDBNavigator directly. Instead, use the delete keyword on the object, which causes ~TDBNavigator to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


TDBNavigator example

TDBNavigator


TDBRadioGroup

Hierarchy	Properties	Methods	Events	See also

TDBRadioGroup represents a group of radio buttons connected to a database.

Header

vcl/dbctrls.hpp

Description

A TDBRadioGroup object is a special group box for displaying data-aware radio buttons. Radio buttons that are contained directly in the same control component are said to be “grouped”; when a radio button is checked, all other radio buttons in its group become unchecked. Database radio groups provide an easy way to ensure that the user enters one (or at most one) of the options presented for a field. You can also use them to display data from fields that have only a few possible values.

Link a radio group to a database just as you would any other data-aware control: Set the value of its DataSource property to the name of a TDataSource object that points to the appropriate dataset. Then specify the field in the dataset that you want to access as the value of the DataField property.

To add radio buttons to a TDBRadioGroup, edit the Items property in the Object Inspector. Each string in Items makes a radio button appear in the group box with the string as its caption. The ItemIndex property indicates which radio button is currently selected.

When the user selects a radio button, the “value” of the selected button becomes the contents of the linked field for the current record in the dataset. Specify values for the buttons by editing the Values property in the Object Inspector; the first string in Values corresponds to the first string in Items, and so forth. If no Values strings are set, each button’s caption serves as its value.

You can display the radio buttons in a single column or in multiple columns by setting the value of the Columns property.


TDBRadioGroup properties

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

DataField

DataSource

Field

Items

ReadOnly

Value

Values

Derived from TCustomRadioGroup

Columns

ItemIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBRadioGroup properties

TDBRadioGroup	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Values

Value

Visible

Width


TDBRadioGroup::DataField

TDBRadioGroup	Properties	See also

The field from which the radio group displays data.

Syntax

__property System::AnsiString DataField;

Description

Use DataField to specify the name of the database field that the radio group will represent.


TDBRadioGroup::DataSource

TDBRadioGroup	Properties	See also

Determines where the database radio group obtains the data to display.

Syntax

__property Db::TDataSource * DataSource;

Description

DataSource holds a TDataSource object that points to a dataset component, such as a table. The dataset component should be linked to the database you want to access.


TDBRadioGroup::Field

TDBRadioGroup	Properties	See also

The TField component that the radio group is linked to.

Syntax

__property Db::TField * Field;

Description

Field holds the TField object that the linked dataset component creates to access the database.


TDBRadioGroup::Items

TDBRadioGroup	Properties	See also

A list of the radio buttons in the radio group.

Syntax

__property Items;

Description

Items holds a TStrings object that lists the captions of the radio buttons in the group. (You can add or remove radio buttons by editing the Items list from the Object Inspector.) These captions become the “values” of the radio buttons, unless you override them in the Values property; when a button is selected, its value becomes the content of the linked field for the current record in the database.


TDBRadioGroup::ReadOnly

TDBRadioGroup	Properties	See also

Determines whether the user can select a different radio button in the group, and hence modify the data in the field.

Syntax

__property System::Boolean ReadOnly;

Description

If ReadOnly is true, the radio group displays data from the current record, but cannot be used to change the contents of the field. The default is false.


TDBRadioGroup::Value

TDBRadioGroup	Properties

The content of the linked field for the current record in the database.

Syntax

void __fastcall SetDataField(const System::AnsiString Value);

Description

Value holds the content of the linked field for the current record. If the user selects a different radio button, the Value property changes.


TDBRadioGroup::Values

TDBRadioGroup	Properties	See also

Overrides the buttons’ captions to determine the values of the radio buttons.

Syntax

__property Classes::TStrings * Values;

Description

When the user selects a radio button, the “value” of that button is written to the linked field in the database. By default, the value of a button is simply the caption that appears next to it on the screen, as determined by the Items property.

In some cases, you may want the values of the radio buttons to differ from their captions. For example, if you use radio buttons to represent a database field whose content can be “Y” or “N”, you may want the buttons’ captions to be “Yes” and “No”. In this case, you would enter “Yes” and “No” in the Items list, and enter “Y” and “N” in the Values list.

You can edit the Values list in the Object Inspector, just as you would the Items list. To keep the buttons’ captions as their values, leave the Values property empty.


TDBRadioGroup events

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

OnChange

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBRadioGroup events

TDBRadioGroup	By object	Legend

OnChange

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnStartDrag


TDBRadioGroup::OnChange

TDBRadioGroup	Events	See also

OnChange occurs when the user changes the data in the linked field.

Syntax

__property Classes::TNotifyEvent OnChange;

Description

The OnChange event occurs when a change is made to the contents of the database field accessed by the radio group. Use an OnChange event handler to implement any special processing that you want to execute when the radio group is updated.


TDBRadioGroup methods

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

~TDBRadioGroup

CanModify

TDBRadioGroup

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBRadioGroup methods

TDBRadioGroup	By object	Legend

~TDBRadioGroup

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBRadioGroup

UpdateControlState

Update


TDBRadioGroup::CanModify

TDBRadioGroup	Methods	See also

Determines whether the user can select a different radio button in the group.

Syntax

virtual System::Boolean __fastcall CanModify(void);

Description

CanModify returns true if the radio group is linked to an editable data source and ReadOnly is set to false.


TDBRadioGroup::TDBRadioGroup

TDBRadioGroup	Methods	See also

TDBRadioGroup creates a new TDBRadioGroup object.

Syntax

__fastcall virtual TDBRadioGroup(Classes::TComponent *AOwner);

Description

Use TDBRadioGroup to create a new TDBRadioGroup object.


TDBRadioGroup::~TDBRadioGroup

TDBRadioGroup	Methods	See also

~TDBRadioGroup frees the memory associated with the TDBRadioGroup object.

Syntax

__fastcall virtual ~TDBRadioGroup(void);

Description

Do not call ~TDBRadioGroup directly. Instead, use the delete keyword on the object, which causes ~TDBRadioGroup to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox

TCustomRadioGroup


TDBRadioGroup example

TDBRadioGroup


TDBText

Hierarchy	Properties	Methods	Events

The TDBText component is an indirect descendent of TGraphicControl. It is a data-aware control that displays text on a form. Your application can display the contents of a field in the current record of a dataset in a database text control, but the user won’t be able to modify the field’s contents.

Header

vcl/dbctrls.hpp

Link the database text control with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the label’s DataSource property. Specify the field in the dataset you want to access as the value of the label’s DataField property.

How the text of the caption aligns within the label is determined by the value of the Alignment property. You can have the text control resize automatically to fit a changing caption if you set the AutoSize property to true. If you prefer to have the text wrap, set WordWrap to true.

If you want a database text control to appear on top of a graphic, but you want to be able to see through the control so that part of the graphic isn’t hidden, set the Transparent property to true.

If your application doesn’t require the data-aware capabilities of TDBText, you should use the label component (TLabel) instead to conserve system resources.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all controls.


TDBText properties

TDBText	Alphabetically	Legend

In TDBText

AutoSize

DataField

DataSource

Field

Derived from TCustomLabel

Alignment

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBText properties

TDBText	By object	Legend

Alignment

Align

AutoSize

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Height

Hint

Left

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Tag

Top

Transparent

Visible

Width

WordWrap


TDBText::AutoSize

TDBText	Properties

Determines whether the database text control automatically resizes to the width and length of the current string.

Syntax

__property AutoSize;

When the AutoSize property is true, the database text control resizes to the width and length of the current string in the component’s Caption property. If you type in text while AutoSize is true, the the control grows for each character you type. If you change the font size of the text, the control resizes to the new font size. When AutoSize is false, the size of the control is not affected by the length of the string in its Caption property.


TDBText::DataField

TDBText	Properties

Identifes the field from which the data-aware control displays data.

Syntax

__property System::AnsiString DataField;

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.


TDBText::DataSource

TDBText	Properties

Determines where database text control obtains its data to display.

Syntax

__property Db::TDataSource * DataSource;

Specify the data source component that identifies the dataset the data is found in.


TDBText::Field

TDBText	Properties

Returns the TField component the database text control is linked to.

Syntax

__property Db::TField * Field;

Use the Field object when you want to change the value of the data in the field programmatically.


TDBText events

TDBText	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBText events

TDBText	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TDBText methods

TDBText	Alphabetically

In TDBText

~TDBText

TDBText

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBText methods

TDBText	By object

~TDBText

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TDBText

Update


TDBText::TDBText

TDBText	Methods	See also

TDBText creates a new TDBText object.

Syntax

__fastcall virtual TDBText(Classes::TComponent *AOwner);

Description

Use TDBText to create a new TDBText object.


TDBText::~TDBText

TDBText	Methods	See also

~TDBText frees the memory associated with the TDBText object.

Syntax

__fastcall virtual ~TDBText(void);

Description

Do not call ~TDBText directly. Instead, use the delete keyword on the object, which causes ~TDBText to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TCustomLabel


TDBText example

TDBText


TDdeClientConv

Hierarchy	Properties	Methods	Events

A TDDEClientConv component establishes a DDE conversation with a DDE server application. Use it in conjunction with a TDDEClientItem component to make your application a DDE client.

Header

vcl/ddeman.hpp

To link to a DDE server application, define the DDE conversation by specifying the server application name in the DDEService property and the topic of the DDE conversation in the DDETopic property. To establish a link at design time, click the ellipsis (...) button for DDEService or DDETopic in the Object Inspector and choose Paste Link in the DDE Info dialog box. To establish a link at run time, specify the service and topic with the Setlink method.

To send data to the DDE server, use the PokeData or ExecuteMacro methods. PokeData sends a text string to the linked item in the DDE server. ExecuteMacro sends a text string containing a macro command to be processed by the DDE server.

You can change the way a DDE conversation is established by specifying the ConnectMode property. If ConnectMode is ddeAutomatic, the client attempts to establish the conversation when the TDDEClientConv component is created at run time. If ConnectMode is ddeManual, you must write RefSyn that executes the OpenLink method to establish the DDE conversation.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components. A TDDEClientConv component is a direct descendent of TComponent.


TDdeClientConv properties

TDdeClientConv	Alphabetically	Legend

In TDdeClientConv

ConnectMode

Conv

DataMode

DdeFmt

DdeService

DdeTopic

FormatChars

ServiceApplication

WaitStat

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeClientConv properties

TDdeClientConv	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConnectMode

Conv

DataMode

DdeFmt

DdeService

DdeTopic

DesignInfo

FormatChars

Name

Owner

ServiceApplication

Tag

WaitStat


TDdeClientConv::ConnectMode

TDdeClientConv	Properties

Determines the type of connection to establish when initiating a link with a DDE server application.

Syntax

__property TDataMode ConnectMode;

These are the possible values:

Value	Meaning

ddeAutomatic	The link is automatically established when the form containing the TDDEClient component is created at run time. This is the default value.

ddeManual	The link is established only when the OpenLink method is called.


TDdeClientConv::Conv

TDdeClientConv	Properties

Contains the handle for the current DDE conversation.

Syntax

__property System::Longint Conv;

If you need to use a Windows API function that requires a handle for a DDE conversation, you can pass the handle in the Conv property of a TDdeClientConv component.


TDdeClientConv::DataMode

TDdeClientConv	Properties

[NOT DOCUMENTED IN CURRENT HELP SYSTEM]

Syntax

__property TDataMode DataMode;


TDdeClientConv::DdeFmt

TDdeClientConv	Properties

Contains an integer value representing the standard clipboard format used for submitting or requesting a data item.

Syntax

__property System::Integer DdeFmt;


DdeService

Specifies the DDE server application to be linked to a DDE client.

Typically, DDEService is the file name (and path, if necessary) of the DDE server application's main executable file without the .EXE extension. If the DDE server is an Borland C++ Builder application, DDEService is the project name without the .DPR or .EXE extension. For example, to link to a TDDEServerConv component in PROJ1.DPR, set DDEService to 'PROJ1'.

See the documentation for the DDE server application for the specific information about specifying DDEService.

At design time, you can specify DDEService either by typing the DDE server application name in the object inspector or by choosing Paste Link in the DDE Info dialog box.


TDdeClientConv::DdeTopic

TDdeClientConv	Properties

Specifies the topic of a DDE conversation

Syntax

__property System::AnsiString DdeTopic;

Typically, DDETopic is a filename (and path, if necessary) used by the application specified in DDEService. If the DDE server is an Borland C++ Builder application, by default DDETopic is the caption of the form containing the linked component. For example, to link to a component on a form named Form1, set DDETopic to 'Form1'. However, if the DDE client is linked to a TDDEServerConv component, DDETopic is the name of the server conversation component instead of the form caption. For example, to link to DDEServerConv1, set DDETopic to 'DDEServerConv1'.

See the documentation for the DDE server application for the specific information about specifying DDETopic.

At design time, you can specify DDETopic either by typing the DDE server application name in the object inspector or by choosing Paste Link in the DDE Info dialog box.


TDdeClientConv::FormatChars

TDdeClientConv	Properties

Determines if certain characters are filtered out of text data transferred from a DDE server application.

Syntax

__property System::Boolean FormatChars;

Some DDE server applications transfer backspaces, linefeeds, carriage returns, and tabs with the text data. Sometimes, this can cause incorrect spacing, line breaks, or characters in the DDE client data. If this is the case, the characters should be filtered. The default value of FormatChars is false.

If false, all text characters of the linked data from the DDE server appear in the linked data in the DDE client. If true, ASCII characters 8 (backspace), 9 (tab), 10 (linefeed), and 13 (carriage return) are filtered out and won't appear in the DDE client data.


TDdeClientConv::ServiceApplication

TDdeClientConv	Properties

Specifies the main executable file name (and path, if necessary) of a DDE server application, without the .EXE extension.

Syntax

__property System::AnsiString ServiceApplication;

Typically, this is the same value as the DDEService property. Sometimes, however, DDEService is a value other than the DDE server application's executable file name. In either case, ServiceApplication must be specified for Borland C++ Builder to run an inactive DDE server to establish a DDE conversation.


WaitState


Chloe read this!!!!!

I assume the name of this property is WaitState. The table had it as WaitStat. I changed it in the table and entered WaitState here. Please check if what I did is correct. Not doct in current Help - Linda


TDdeClientConv events

TDdeClientConv	Alphabetically	Legend

In TDdeClientConv

OnClose

OnOpen


TDdeClientConv events

TDdeClientConv	By object	Legend

OnClose

OnOpen


TDdeClientConv::OnClose

TDdeClientConv	Events

Syntax

__property Classes::TNotifyEvent OnClose;


TDdeClientConv::OnOpen

TDdeClientConv	Events

Syntax

__property Classes::TNotifyEvent OnOpen;


TDdeClientConv methods

TDdeClientConv	Alphabetically

In TDdeClientConv

~TDdeClientConv

CloseLink

ExecuteMacro

ExecuteMacroLines

OpenLink

PasteLink

PokeData

PokeDataLines

RequestData

SetLink

StartAdvise

TDdeClientConv

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeClientConv methods

TDdeClientConv	By object

~TDdeClientConv

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseLink

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecuteMacroLines

ExecuteMacro

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

OpenLink

PasteLink

PokeDataLines

PokeData

RemoveComponent

RequestData

SetLink

StartAdvise

TDdeClientConv


TDdeClientConv::CloseLink

TDdeClientConv	Methods

Terminates an ongoing DDE conversation.

Syntax

void __fastcall CloseLink(void);

After a link is closed, no DDE communication can take place between the DDE client and server until another link is opened.


TDdeClientConv::ExecuteMacro

TDdeClientConv	Methods

Attempts to send a macro command string to a DDE server application.

Syntax

System::Boolean __fastcall ExecuteMacro(System::PChar Cmd, System::Boolean waitFlg);

ExecuteMacro returns true if the macro was successfully passed to the DDE server application. If ExecuteMacro was unable to send a command string, ExecuteMacro returns false.

Cmd is a null-terminated string that contains the macro to be executed by the DDE server application. The actual value of Cmd depends on the DDE server application. See the documentation of the DDE server application for the command strings it will accept.

WaitFlg determines if your application should wait until the DDE server application finishes executing the macro before allowing another successful call to ExecuteMacro or the ExecuteMacroLines, PokeData, or PokeDataLines methods. If WaitFlg is set to true, subsequent calls to these methods before the DDE server application completes the first macro do not send data to the DDE server and return false. If WaitFlg is set to false, subsequent calls to these methods before the DDE server application completes the first macro do attempt to send data to the DDE server.

If you need to send a macro command string list rather than a single string, use the ExecuteMacroLines method.

Note:	Depending on the DDE server, attempting to execute a macro or poke data before the DDE server application completes the first macro might cause the first macro to execute unsuccessfully or produce unpredictable results. See the documentation of the DDE server application for the results of sending command strings or poking data before macro execution has completed.


TDdeClientConv::ExecuteMacroLines

TDdeClientConv	Methods

Attempts to send a macro command string list to a DDE server application.

Syntax

System::Boolean __fastcall ExecuteMacroLines(Classes::TStrings *Cmd, System::Boolean waitFlg);

ExecuteMacroLines returns true if the macro was successfully passed to the DDE server application. If ExecuteMacroLines was unable to send a command string list, ExecuteMacroLines returns false.

Cmd contains the macro to be executed by the DDE server application. WaitFlg determines if your application should wait until the DDE server application finishes executing the macro before allowing another successful call to ExecuteMacroLines or the ExecuteMacro, PokeData, or PokeDataLines methods.

Use ExecuteMacroLines to execute a macro command string list rather than a single macro command string (which is what the ExecuteMacro method passes for its Cmd parameter).


TDdeClientConv::OpenLink

TDdeClientConv	Methods

Initiates a new DDE conversation.

Syntax

System::Boolean __fastcall OpenLink(void);

If the conversation was successfully opened, an OnOpen event occurs and OpenLink returns true. If the conversation wasn't successfully opened, OpenLink returns false.


TDdeClientConv::PasteLink

TDdeClientConv	Methods

Creates a DDE link to the current Clipboard object.

Syntax

System::Boolean __fastcall PasteLink(void);

PasteLink returns true if the link is successfully established.


TDdeClientConv::PokeData

TDdeClientConv	Methods

Sends data to a DDE server application.

Syntax

System::Boolean __fastcall PokeData(const System::AnsiString Item, System::PChar Data);

Text data from a linked control in the DDE client application is transferred to the linked section of the DDE server application. Item specifies the linked item in the DDE server. Data is a null-terminated string that specifies the text data to transfer to the DDE server.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeData returns true if the data was successfully transferred, or false if the data was not successfully transferred.

If you need to poke a string list rather than a single string, use the PokeDataLines method.

Note

If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to true prior to calling PokeData, you must wait until the server application has completed executing the macro before calling PokeData. Depending on the DDE server application, calling PokeData before the DDE server application has completed executing the macro might cause the macro to execute unsuccessfully or produce unpredictable results.


TDdeClientConv::PokeDataLines

TDdeClientConv	Methods

Sends data to a DDE server application.

Syntax

System::Boolean __fastcall PokeDataLines(const System::AnsiString Item, Classes::TStrings *Data);

Text data from a linked control in the DDE client application is transferred to the linked section of the DDE server application. Item specifies the linked item in the DDE server. Data is a TStrings object that specifies the text data to transfer to the DDE server.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeDataLines returns true if the data was successfully transferred, or false if the data was not successfully transferred.

If you need to poke a single string rather than a string list, use the PokeData method.

Note

If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to true prior to calling PokeDataLines, you must wait until the server application has completed executing the macro before calling PokeDataLines. Depending on the DDE server application, calling PokeDataLines before the DDE server application has completed executing the macro might cause the macro to execute unsuccessfully or produce unpredictable results.


TDdeClientConv::RequestData

TDdeClientConv	Methods

Requests data from a DDE server.

Syntax

System::PChar __fastcall RequestData(const System::AnsiString Item);

Call RequestData when you want your DDE client application to receive data from the server once, instead of being updated continually. Another reason to use RequestData is that some DDE servers contain DDE items that can't be continually updated; the only way for your client to access these items is to explicitly request the data.

Item specifies the DDE server item you want data from. The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is an Borland C++ Builder application, Item is the name of the linked DDE server component.

Note

See the documentation for the DDE server application for the specific information about specifying DDEItem.

RequestData returns a null-terminated PChar string which contains the value of the item requested of the DDE server. RequestData automatically allocates memory to store this data, but you must dispose of the PChar string returned by RequestData after you have finished processing it. This is done with the StrDispose function.


TDdeClientConv::SetLink

TDdeClientConv	Methods

Specifies the service and topic of a DDE conversation and attempts to open the link if ConnectMode is ddeAutomatic.

Syntax

System::Boolean __fastcall SetLink(const System::AnsiString Service, const System::AnsiString Topic

The Service parameter defines the DDE service and is assigned to the DDEService property. The Topic parameter defines the DDE topic and is assigned to the DDETopic property.

If ConnectMode is ddeManual, you must call OpenLink to initiate the conversation after calling SetLink.


TDdeClientConv::StartAdvise

TDdeClientConv	Methods

Starts an advise loop for all of the DDEClientItems associated with the current DDE conversation.

Syntax

System::Boolean __fastcall StartAdvise(void);

The StartAdvise function starts an advise loop for all of the DDEClientItems associated with the current DDE conversation.  StartAdvise returns true if loop startup is successful.


TDdeClientConv::TDdeClientConv

TDdeClientConv	Methods	See also

TDdeClientConv creates a new TDdeClientConv object.

Syntax

__fastcall virtual TDdeClientConv(Classes::TComponent *AOwner);

Description

Use TDdeClientConv to create a new TDdeClientConv object.


TDdeClientConv::~TDdeClientConv

TDdeClientConv	Methods	See also

~TDdeClientConv frees the memory associated with the TDdeClientConv object.

Syntax

__fastcall virtual ~TDdeClientConv(void);

Description

Do not call ~TDdeClientConv directly. Instead, use the delete keyword on the object, which causes ~TDdeClientConv to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeClientConv example

TDdeClientConv


TDdeClientItem

Hierarchy	Properties	Methods	Events

A TDDEClientItem component defines the item of a DDE conversation. Use it in conjunction with a TDDEClientConv component to make your application a DDE client.

Header

vcl/ddeman.hpp

To link to a DDE conversation, specify the name of a TDDEClientConv component in the DDEConv property. The DDE item of the conversation should be specified in the DDEItem property. If the TDDEClientConv component has established a link with a DDE server, the server will automatically and continually update the client until the conversation is terminated.

The actual text data to exchange with the DDE server is specified in the Text property. When the server updates your DDE client, the new data will be automatically stored in the Text property. Whenever Text is updated, an OnChange event occurs. For text data longer than the 255 character limit of Text, use the Lines property to specify the text data to exchange.

In addition to these properties and events, this component also has the properties and methods that apply to all components. A TDDEClientItem component is a direct descendent of TComponent.


TDdeClientItem properties

TDdeClientItem	Alphabetically	Legend

In TDdeClientItem

DdeConv

DdeItem

Lines

Text

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeClientItem properties

TDdeClientItem	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DdeConv

DdeItem

DesignInfo

Lines

Name

Owner

Tag

Text


TDdeClientItem::DDEConv

TDdeClientItem	Properties

Specifies the DDE client conversation component to associate with the DDE client item component.

Syntax

__property TDdeClientConv * DdeConv;

The value of DDEConv is the name of the DDE client conversation component that defines the DDE conversation.


TDdeClientItem::DDEItem

TDdeClientItem	Properties

Specifies the item of a DDE conversation.

Syntax

__property System::AnsiString DdeItem;

The value of DDEItem depends on the linked DDE server application. DDEItem is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is a Borland C++ Builder application, DDEItem is the name of the linked DDE server component. For example, to link to a DDE server component named DDEServer1, set DDEItem to 'DDEServer1'.

See the documentation for the DDE server application for the specific information about specifying DDEItem.

At design time, you can specify DDEItem either by typing the item string in the object inspector or by pasting a link using the DDE Info dialog box, which appears if you click the ellipsis (...) button for DDEService or DDETopic in the Object Inspector. After you choose Paste Link in the DDE Info dialog box, you can choose the item from a list of possible items for DDEItem in the object inspector if link information is still on the Clipboard.


TDdeClientItem::Lines

TDdeClientItem	Properties

Contains the text data to exchange in a DDE conversation.

Syntax

__property Classes::TStrings * Lines;

Lines specifies the text that is updated by the DDE server application. When Lines is changed, an OnChange event occurs.

Lines corresponds to the Text property. Whenever the value of Lines or Text is changed, the other is updated so that the first line of Lines is always equal to Text.

If the Lines property is of a TDDEClientItem component, you can also send the text in Lines directly to the DDE server by poking data with the PokeDataLines method.


TDdeClientItem::Text

TDdeClientItem	Properties

Contains the text data to exchange in a DDE conversation.

Syntax

__property System::AnsiString Text;

For TDDEClientItem components, Text specifies the text that is updated by the DDE server application. When Text is changed, an OnChange event occurs.

Text corresponds to the Lines property. Whenever the value of Text or Lines is changed, the other is updated so that the first line of Lines is always equal to Text.

If the Text property is of a TDDEClientItem component, you can also send the text in Text directly to the DDE server by poking data with the PokeData method.


TDdeClientItem events

TDdeClientItem	Alphabetically	Legend

In TDdeClientItem

OnChange


TDdeClientItem events

TDdeClientItem	By object	Legend

OnChange


TDdeClientItem::OnChange

TDdeClientItem	Events

Syntax

__property Classes::TNotifyEvent OnChange;


TDdeClientItem methods

TDdeClientItem	Alphabetically

In TDdeClientItem

~TDdeClientItem

TDdeClientItem

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeClientItem methods

TDdeClientItem	By object

~TDdeClientItem

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDdeClientItem


TDdeClientItem::TDdeClientItem

TDdeClientItem	Methods	See also

TDdeClientItem creates a new TDdeClientItem object.

Syntax

__fastcall virtual TDdeClientItem(Classes::TComponent *AOwner);

Description

Use TDdeClientItem to create a new TDdeClientItem object.


TDdeClientItem::~TDdeClientItem

TDdeClientItem	Methods	See also

~TDdeClientItem frees the memory associated with the TDdeClientItem object.

Syntax

__fastcall virtual ~TDdeClientItem(void);

Description

Do not call ~TDdeClientItem directly. Instead, use the delete keyword on the object, which causes ~TDdeClientItem to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeClientItem example

TDdeClientItem


TDDEMgr

Hierarchy	Properties	Methods

Header

vcl/ddeman.hpp

Description


TDDEMgr properties

TDDEMgr	Alphabetically	Legend

Derived from TDdeMgr

AppName

DdeInstId

LinkClipFmt

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDDEMgr properties

TDDEMgr	By object	Legend

AppName

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DdeInstId

DesignInfo

LinkClipFmt

Name

Owner

Tag


AppName

Description


DdeInstId

Description


LinkClipFmt

Description


TDDEMgr methods

TDDEMgr	Alphabetically

In TDDEMgr

~TDDEMgr

TDDEMgr

Derived from TDdeMgr

GetExeName

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDDEMgr methods

TDDEMgr	By object

~TDDEMgr

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetExeName

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDDEMgr


 GetExeName

Description


TDDEMgr::TDDEMgr

TDDEMgr	Methods	See also

TDDEMgr creates a new TDDEMgr object.

Syntax

__fastcall virtual TDdeMgr(Classes::TComponent *AOwner);

Description

Use TDDEMgr to create a new TDDEMgr object.


TDDEMgr::~TDDEMgr

TDDEMgr	Methods	See also

~TDDEMgr frees the memory associated with the TDDEMgr object.

Syntax

__fastcall virtual ~TDdeMgr(void);

Description

Do not call ~TDDEMgr directly. Instead, use the delete keyword on the object, which causes ~TDDEMgr to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TDDEMgr example

TDDEMgr


TDdeServerItem

Hierarchy	Properties	Methods	Events

A TDDEServerItem component defines the item of a DDE conversation. Use it by itself, or optionally, with a TDDEServerConv component to make your application a DDE server.

Header

vcl/ddeman.hpp

To use a TDDEServerItem component with a TDDEServerConv component, specify the name of a TDDEServerConv component in the ServerConv property.

The actual text data to exchange with the DDE client is specified in the Text property. When the client requests an update, your server sends the contents of the Text property to the client. When the Text property is modified, either by your own application or when the client pokes data, an OnChange event occurs. For text data longer than the 255-character limit of Text, use the Lines property to specify the data to exchange.

To test a link with a DDE client, use the CopyToClipboard method. This method will copy the contents of Text (or Lines), as well as DDE link information to the Clipboard. Then, if the DDE client can paste links, you can activate the client and paste the DDE data into the client application.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components. A TDDEServerItem component is a direct descendent of TComponent.


TDdeServerItem properties

TDdeServerItem	Alphabetically	Legend

In TDdeServerItem

Fmt

Lines

ServerConv

Text

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeServerItem properties

TDdeServerItem	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Fmt

Lines

Name

Owner

ServerConv

Tag

Text


TDdeServerItem::Fmt

TDdeServerItem	Properties

[NOT IN HELP FILE]

Syntax

__property System::Integer Fmt;


TDdeServerItem::Lines

TDdeServerItem	Properties

Contains the text data to exchange in a DDE conversation.

Syntax

__property Classes::TStrings * Lines;

For TDDEClientItem components, Lines specifies the text that is updated by the DDE server application. For TDDEServerItem components, Lines specifies the text that is sent to any DDE clients when the value of Lines changes or when a client requests to be updated. When Lines is changed, an OnChange event occurs.

Lines corresponds to the Text property. Whenever the value of Lines or Text is changed, the other is updated so that the first line of Lines is always equal to Text.

If the Lines property is of a TDDEClientItem component, you can also send the text in Lines directly to the DDE server by poking data with the PokeDataLines method.

If the Lines property is of a TDDEServerItem component, the DDE client can change Lines by poking data. The poked data replaces the contents of Lines and an OnChange event occurs.


TDdeServerItem::ServerConv

TDdeServerItem	Properties

Specifies the DDE server conversation component to associate with the DDE server item component.

Syntax

__property TDdeServerConv * ServerConv;

The value of ServerConv is the name of the DDE server conversation component that defines the DDE conversation.


TDdeServerItem::Text

TDdeServerItem	Properties

Contains the text data to exchange in a DDE conversation.

Syntax

__property System::AnsiString Text;

Text specifies the text that is sent to any DDE clients when the value of Text changes or when a client requests an update. When Text is changed, an OnChange event occurs.

Text corresponds to the Lines property. Whenever the value of Text or Lines is changed, the other is updated so that the first line of Lines is always equal to Text.

The DDE client can change Text by poking data. The poked data replaces the contents of Text and an OnChange event occurs.


TDdeServerItem events

TDdeServerItem	Alphabetically	Legend

In TDdeServerItem

OnChange

OnPokeData


TDdeServerItem events

TDdeServerItem	By object	Legend

OnChange

OnPokeData


TDdeServerItem::OnChange

TDdeServerItem	Events

Syntax

__property Classes::TNotifyEvent OnChange;


TDdeServerItem::OnPokeData

TDdeServerItem	Events

Syntax

__property Classes::TNotifyEvent OnPokeData;


TDdeServerItem methods

TDdeServerItem	Alphabetically

In TDdeServerItem

~TDdeServerItem

Change

CopyToClipboard

PokeData

TDdeServerItem

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeServerItem methods

TDdeServerItem	By object

~TDdeServerItem

Assign

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyToClipboard

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

PokeData

RemoveComponent

TDdeServerItem


TDdeServerItem::Change

TDdeServerItem	Methods

[NOT IN HELP SYSTEM]

Syntax

virtual void __fastcall Change(void);


TDdeServerItem::CopyToClipboard

TDdeServerItem	Methods

Copies the text data specified in the Text or Lines property of a DDE server item component to the Windows Clipboard, as well as DDE link information.

Syntax

void __fastcall CopyToClipboard(void);

You can then create a link by activating the DDE client application, selecting the topic and item of the DDE conversation, and executing an Edit|Paste Link command, or its equivalent in the command structure of the DDE client application.

CopyToClipboard can be used to create a DDE link at run-time only. To create a link at design time, select the DDE server item component and choose Edit|Copy from the menu. Then, activate the DDE server application and paste the link according to the rules of the DDE server application. See the documentation for the DDE server application for specific information about pasting the link.

If the Clear parameter is true, the prior contents of the Clipboard are deleted before CopyToClipboard places its data on the Clipboard. If Clear is false, the Clipboard won't be cleared before the copy.


TDdeServerItem::PokeData

TDdeServerItem	Methods

[DOCUMENTED ONLY UNDER TDDECLIENTITEM, SO CHECK THIS OUT]

Syntax

System::Longint __fastcall PokeData(System::Longint Data);

The PokeData method sends data to a DDE server application. Text data from a linked control in the DDE client application is transferred to the linked section of the DDE server application. Item specifies the linked item in the DDE server. Data is a null-terminated string that specifies the text data to transfer to the DDE server.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeData returns true if the data was successfully transferred, or false if the data was not successfully transferred.

If you need to poke a string list rather than a single string, use the PokeDataLines method.

Note:	If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to true prior to calling PokeData, you must wait until the server application has completed executing the macro before calling PokeData. Depending on the DDE server application, calling PokeData before the DDE server application has completed executing the macro might cause the macro to execute unsuccessfully or produce unpredictable results.


TDdeServerItem::TDdeServerItem

TDdeServerItem	Methods	See also

TDdeServerItem creates a new TDdeServerItem object.

Syntax

__fastcall virtual TDdeServerItem(Classes::TComponent *AOwner);

Description

Use TDdeServerItem to create a new TDdeServerItem object.


TDdeServerItem::~TDdeServerItem

TDdeServerItem	Methods	See also

~TDdeServerItem frees the memory associated with the TDdeServerItem object.

Syntax

__fastcall virtual ~TDdeServerItem(void);

Description

Do not call ~TDdeServerItem directly. Instead, use the delete keyword on the object, which causes ~TDdeServerItem to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeServerItem example

TDdeServerItem


TDdeServerConv

Hierarchy	Properties	Methods	Events

A TDDEServerConv component establishes a DDE conversation with a DDE client application. Use it in conjunction with a TDDEServerItem component to make your application a DDE server.

Header

vcl/ddeman.hpp

If the DDE client sends a macro to your DDE server application, an OnExecuteMacro event occurs. You should write RefSyn in the OnExecuteMacro event handler to process this macro.

Using a TDDEServerConv component is optional. If you don’t use a TDDEServerConv component, the client can still request an update directly from the TDDEServerItem component.

If you use a TDDEServerConv component, the DDE topic of the conversation is the value of the Name property of the TDDEServerConv component. If you don’t use a TDDEServerConv component, the DDE topic of the conversation is the value of the Caption property of the form containing the TDDEServerItem component.

You should use a TDDEServerConv component with a TDDEServerItem component when the client might send a macro, or when the Caption of the form containing the TDDEServerItem might not be unique or constant at run time.

In addition to these properties and events, this component also has the properties and methods that apply to all components. A TDDEServerConv component is a direct descendent of TComponent.


TDdeServerConv properties

TDdeServerConv	Alphabetically	Legend

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeServerConv properties

TDdeServerConv	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeServerConv events

TDdeServerConv	Alphabetically	Legend

In TDdeServerConv

OnClose

OnExecuteMacro

OnOpen


TDdeServerConv events

TDdeServerConv	By object	Legend

OnClose

OnExecuteMacro

OnOpen


TDdeServerConv::OnClose

TDdeServerConv	Events

Syntax

__property Classes::TNotifyEvent OnClose;


TDdeServerConv::OnExecuteMacro

TDdeServerConv	Events

Syntax

__property TMacroEvent OnExecuteMacro;


TDdeServerConv::OnOpen

TDdeServerConv	Events

Syntax

__property Classes::TNotifyEvent OnOpen;


TDdeServerConv methods

TDdeServerConv	Alphabetically

In TDdeServerConv

~TDdeServerConv

ExecuteMacro

TDdeServerConv

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeServerConv methods

TDdeServerConv	By object

~TDdeServerConv

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecuteMacro

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDdeServerConv


TDdeServerConv::ExecuteMacro

TDdeServerConv	Methods

[THIS WAS THE ONLY ENTRY FOR EXECUTEMACRO BUT THE HELP FILE SAID IT APPLIED TO TDDECLIENTCONV.]

Syntax

System::Longint __fastcall ExecuteMacro(System::Longint Data);

The ExecuteMacro method attempts to send a macro command string to a DDE server application. ExecuteMacro returns true if the macro was successfully passed to the DDE server application. If ExecuteMacro was unable to send a command string, ExecuteMacro returns false.

Cmd is a null-terminated string that contains the macro to be executed by the DDE server application. The actual value of Cmd depends on the DDE server application. See the documentation of the DDE server application for the command strings it will accept.

WaitFlg determines if your application should wait until the DDE server application finishes executing the macro before allowing another successful call to ExecuteMacro or the ExecuteMacroLines, PokeData, or PokeDataLines methods. If WaitFlg is set to true, subsequent calls to these methods before the DDE server application completes the first macro do not send data to the DDE server and return false. If WaitFlg is set to false, subsequent calls to these methods before the DDE server application completes the first macro do attempt to send data to the DDE server.

If you need to send a macro command string list rather than a single string, use the ExecuteMacroLines method.

Note

Depending on the DDE server, attempting to execute a macro or poke data before the DDE server application completes the first macro might cause the first macro to execute unsuccessfully or produce unpredictable results. See the documentation of the DDE server application for the results of sending command strings or poking data before macro execution has completed.


TDdeServerConv::TDdeServerConv

TDdeServerConv	Methods	See also

TDdeServerConv creates a new TDdeServerConv object.

Syntax

__fastcall virtual TDdeServerConv(Classes::TComponent *AOwner);

Description

Use TDdeServerConv to create a new TDdeServerConv object.


TDdeServerConv::~TDdeServerConv

TDdeServerConv	Methods	See also

~TDdeServerConv frees the memory associated with the TDdeServerConv object.

Syntax

__fastcall virtual ~TDdeServerConv(void);

Description

Do not call ~TDdeServerConv directly. Instead, use the delete keyword on the object, which causes ~TDdeServerConv to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeServerConv example

TDdeServerConv


TDesigner

Hierarchy	Properties	Methods

The TDesigner object is an abstract object type derived directly from TObject. It provides the basis for all form designers in the Borland C++ Builder environment, most importantly, TFormDesigner. The abstract designer object provides two properties used by all designer objects and defines five abstract methods that working designer objects must override.

Header

vcl/forms.hpp


TDesigner properties

TDesigner	Alphabetically

In TDesigner

Form

IsControl


TDesigner properties

TDesigner	By object

Form

IsControl


TDesigner::Form

TDesigner	Properties

Provides a reference to the form currently being designed

Syntax

__property TForm * Form;


TDesigner::IsControl

TDesigner	Properties

Reflects whether the form is in its form state or its control state

Syntax

__property System::Boolean IsControl;


TDesigner methods

TDesigner	Alphabetically

In TDesigner

~TDesigner

IsDesignMsg

Modified

Notification

PaintGrid

TDesigner

ValidateRename

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDesigner methods

TDesigner	By object

~TDesigner

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

IsDesignMsg

MethodAddress

MethodName

Modified

NewInstance

Notification

PaintGrid

TDesigner

ValidateRename


TDesigner::IsDesignMsg

TDesigner	Methods

Called for each message sent to a component in the designer.

Syntax

virtual System::Boolean __fastcall IsDesignMsg(Controls::TControl *Sender, Messages::TMessage &Message

Returns true if the message is a design message, meaning one the designer should handle for the component.


TDesigner::Modified

TDesigner	Methods

Property and component editors call this method whenever anything in a component changes, allowing the designer to reflect the change.

Syntax

virtual void __fastcall Modified(void);


TDesigner::Notification

TDesigner	Methods

Called by the Notification method of the form being designed, allowing the designer to respond to all the same notifications as the form.

Syntax

virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation


TDesigner::PaintGrid

TDesigner	Methods

Called whenever the designer needs to paint the alignment grid on the form's canvas.

Syntax

virtual void __fastcall PaintGrid(void);


TDesigner::ValidateRename

TDesigner	Methods

Called by the form's ValidateRename method, generally to provide tighter restrictions on renaming, such as prohibiting reserved words.

Syntax

virtual void __fastcall ValidateRename(Classes::TComponent *AComponent, const System::AnsiString CurName


TDesigner::TDesigner

TDesigner	Methods	See also

TDesigner creates a new TDesigner object.

Syntax

__fastcall TDesigner(void);

Description

Use TDesigner to create a new TDesigner object.


TDesigner::~TDesigner

TDesigner	Methods	See also

~TDesigner frees the memory associated with the TDesigner object.

Syntax

__fastcall virtual ~TDesigner(void);

Description

Do not call ~TDesigner directly. Instead, use the delete keyword on the object, which causes ~TDesigner to be invoked automatically.


Hierarchy

TObject


TDesigner example

TDesigner


TDirectoryListBox

Hierarchy	Properties	Methods	Events	See also

TDirectoryListBox is a specialized list box that is aware of the directory structure of the current drive.

Header

vcl/filectrl.hpp

Overview

When the application runs, the user can use the directory list box to change directories, which changes the value of the Directory property.

The Drive property determines on which drive the list box displays the directory structure. When the value of Drive changes, the Directory value also changes to the current directory on the specified drive.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for you own list box object.

Related objects

Specialized list boxes have the basic functionality of TListBox, but can also be linked to file, directory, drive or database information. Use these list boxes if you want to easily access and list this type of information.

A combo box is a list box with an edit control and an optional drop down style for the list. Use a combo box when you want to allow users to type their selection into an edit box or to save space on a form by having the list drop down.

For lists of items that require a matrix or expandable tree-like structure use outlines, list views or tree views. These controls allow you to group items under column headings or in expandable and contractable rows.


TDirectoryListBox properties

TDirectoryListBox	Alphabetically	Legend

In TDirectoryListBox

CaseSensitive

Directory

DirLabel

Drive

FileList

PreserveCase

Derived from TCustomListBox

Canvas

Columns

IntegralHeight

ItemHeight

ItemIndex

Items

SelCount

Selected

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDirectoryListBox properties

TDirectoryListBox	By object	Legend

Align

BoundsRect

Brush

Canvas

CaseSensitive

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

Directory

DirLabel

DragCursor

DragMode

Drive

Enabled

FileList

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

PreserveCase

SelCount

Selected

ShowHint

Showing

TabOrder

TabStop

Tag

TopIndex

Top

Visible

Width


TDirectoryListBox::CaseSensitive

TDirectoryListBox	Properties

not in the current doc set.

Syntax

__property System::Boolean CaseSensitive;


TDirectoryListBox::Directory

TDirectoryListBox	Properties	See also

Determines the current directory for the directory list box control.

Syntax

__property System::AnsiString Directory;

The directory list box displays the value of the Directory property as the current directory in the list box. Examine the example to see how a directory list box and a file list box can work together through their Directory properties.

Example

If you have a file list box and a directory list box on a form, this RefSyn changes the current directory in the directory list box and displays the files in that directory in the file list box when the user changes directories using the directory list box:


TDirectoryListBox::DirLabel

TDirectoryListBox	Properties	See also

Provides a simple way to display the current directory as the caption of a label control.

Syntax

__property Stdctrls::TLabel * DirLabel;

When the current directory changes in the directory list box, the change is reflected in the caption of the label.

Specify the label you want updated with the current directory as the value of the DirLabel property.

Example

This example uses a button, an edit box, a label, a drive combo box, a directory list box, a file list box, and a filter combo box on a form. When the user clicks the button, the rest of the controls of the form begin working together like the controls in an Open or Save dialog box.


TDirectoryListBox::Drive

TDirectoryListBox	Properties	See also

Determines which drive the list box displays the directory structure on.

Syntax

__property System::Char Drive;

When the value of Drive changes, the Directory value changes also to the current directory on the specified drive.

Example

The following example assumes that a drive combo box, a file list box, and a directory list box are on a form. This RefSyn changes the drive displayed in the drive combo box, displays the current directory of the selected drive in the directory list box, and displays the files in the current directory of the selected drive in the file list box when the user selects a drive in the drive combo box:


TDirectoryListBox::FileList

TDirectoryListBox	Properties	See also

Provides a simple way to connect a directory list box with a file list box.

Syntax

__property TFileListBox * FileList;

Once the two controls are connected and new directory is selected as the current directory using a directory list box, the file list box displays the files in the current directory. Specify the file list box in which you want to display the files in the directory selected in the directory list box as the value of the FileList property.

Example

This example uses a button, an edit box, a label, a drive combo box, a directory list box, a file list box, and a filter combo box on a form. When the user clicks the button, the rest of the controls on the form begin working together like the controls in an open or save dialog box.


TDirectoryListBox::PreserveCase

TDirectoryListBox	Properties

not in the current doc set.

Syntax

__property System::Boolean PreserveCase;


TDirectoryListBox events

TDirectoryListBox	Alphabetically	Legend

In TDirectoryListBox

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDirectoryListBox events

TDirectoryListBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDirectoryListBox::OnChange

TDirectoryListBox	Events

OnChange occurs when the user selects a new directory with the mouse or keyboard when the user moves the selection bar and presses enter.

Syntax

__property Classes::TNotifyEvent OnChange;

Description

occurs when the main value or values of the component are modified. For the directory list box control OnChange

Another way to accomplish the same thing is to assign a file list box as the value of the FileList property. If you use the DirLabel property, you can have the caption of the label display the current directory.

You can synchronize a directory list box with a file list box (TFileListBox), so that when the user uses a directory list box to change directories, the file list box displays the files in the new directory. This is the event handler for the OnChange event for the directory list box:


TDirectoryListBox methods

TDirectoryListBox	Alphabetically

In TDirectoryListBox

~TDirectoryListBox

DisplayCase

FileCompareText

GetItemPath

OpenCurrent

TDirectoryListBox

Update

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDirectoryListBox methods

TDirectoryListBox	By object

~TDirectoryListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DisplayCase

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FileCompareText

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetItemPath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

OpenCurrent

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDirectoryListBox

UpdateControlState

Update


TDirectoryListBox::DisplayCase

TDirectoryListBox	Methods

not in the current doc set.

Syntax

System::AnsiString __fastcall DisplayCase(const System::AnsiString S);


TDirectoryListBox::FileCompareText

TDirectoryListBox	Methods

not in the current doc set.

Syntax

System::Integer __fastcall FileCompareText(const System::AnsiString A, const System::AnsiString B);


TDirectoryListBox::GetItemPath

TDirectoryListBox	Methods	See also

Returns as a string the path of a directory in the directory list box.

Syntax

System::AnsiString __fastcall GetItemPath(System::Integer Index);

Specify the directory with the Index value using the first directory in the list that has an index value of 0.

Example

This example uses a directory list box, a button, and a label on a form. When the user selects a directory in the directory list box and clicks the button, the selected directory opens, and the path of the second directory displayed in the list box appears as the caption of the label.


TDirectoryListBox::OpenCurrent

TDirectoryListBox	Methods

Opens the directory selected in the directory list box, as if the user had double-clicked the directory.

Syntax

void __fastcall OpenCurrent(void);

Example

This example uses a directory list box, a button, and a label on a form. When the user selects a directory in the directory list box and clicks the button, the selected directory opens, and the path of the second directory displayed in the list box appears as the caption of the label.


TDirectoryListBox::Update

TDirectoryListBox	Methods

Updates and refreshes the directory list for the directory list box control.

Syntax

void __fastcall Update(void);

Example

The following sample RefSyn sets the directory of DirectoryListBox1 to C:\TEMP when the form is created. When Button1 is pressed, a subdirectory called MYDIR is added to C:\TEMP, but note that it is not updated in DirectoryListBox1 until Button2 is pressed and Update is called.


TDirectoryListBox::TDirectoryListBox

TDirectoryListBox	Methods	See also

TDirectoryListBox creates a new TDirectoryListBox object.

Syntax

__fastcall virtual TDirectoryListBox(Classes::TComponent *AOwner);

Description

Use TDirectoryListBox to create a new TDirectoryListBox object.


TDirectoryListBox::~TDirectoryListBox

TDirectoryListBox	Methods	See also

~TDirectoryListBox frees the memory associated with the TDirectoryListBox object.

Syntax

__fastcall virtual ~TDirectoryListBox(void);

Description

Do not call ~TDirectoryListBox directly. Instead, use the delete keyword on the object, which causes ~TDirectoryListBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TDirectoryListBox example

TDirectoryListBox


TDragObject

Hierarchy	Methods	See also

The TDragObject is a base class used for drag and drop operations in Borland C++ Builder.

Header

vcl/controls.hpp

Description

Use TDragObject to implement drag and drop of objects between DLL’s in Borland C++ Builder by deriving from TDragObject and overriding its virtual methods as needed. Create the custom drag object in the OnStartDrag event. Use the public IsDragObject function within a target’s OnDragOver event when accepting a drag drop.

TDragControlObject is derived from TDragObject and implements normal drag and drop behavior for controls within an EXE.


TDragObject methods

TDragObject	Alphabetically	Legend

In TDragObject

~TDragObject

Finished

GetDragCursor

GetDragImages

GetName

HideDragImage

Instance

ShowDragImage

TDragObject

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDragObject methods

TDragObject	By object	Legend

~TDragObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Finished

FreeInstance

Free

GetDragCursor

GetDragImages

GetName

HideDragImage

InheritsFrom

InitInstance

InstanceSize

Instance

MethodAddress

MethodName

NewInstance

ShowDragImage

TDragObject


TDragObject::Finished

TDragObject	Methods	See also

Finished is called when the mouse is released indicating the drag operation is complete.

Syntax

virtual void __fastcall Finished(System::TObject *Target, System::Integer X, System::Integer Y, System::Boolean

Description

Finished does nothing by default, but can be overridden to provide more meaningful behavior. The Target is the object (possibly in a different DLL) that accepted the drag. Target can be NULL. Accepted returns true if the Target accepted the drag and drop. Finished is overridden and implemented in TDragControlObject.


TDragObject::GetDragCursor

TDragObject	Methods	See also

GetDragCursor is called whenever the mouse is moved to retrieve which cursor should be currently displayed.

Syntax

virtual TCursor __fastcall GetDragCursor(System::Boolean Accepted, System::Integer X, System::Integer

Description

If the target control at the X, Y position (in pixels) accepts the drag (Accepted is true), the drag object sets the drag cursor to the control's DragCursor property; otherwise, crNoDrop cursor is displayed by default.


TDragObject::GetDragImages

TDragObject	Methods	See also

GetDragImages is called at the beginning of a drag and drop operation and returns the control's image list containing the image to be displayed while dragging.

Syntax

virtual TCustomImageList *__fastcall GetDragImages(void);

Description

The image list normally contains only one image, and the VCL automatically creates and maintains the image list. This can be NULL, and only the cursor used.


TDragObject::GetName

TDragObject	Methods	See also

GetName returns a name string identifying the drag operation.

Syntax

virtual System::AnsiString __fastcall GetName(void);

Description

By default GetName returns the name of the class, but can be overridden to return a more meaningful string.


TDragObject::HideDragImage

TDragObject	Methods	See also

HideDragImage is a virtual method which contains no functionality in its implementation.

Syntax

virtual void __fastcall HideDragImage(void);

Description

HideDragImage is a virtual method and can therefore be overridden in a class derived from TDragObject. HideDragImage is overridden in the derived class TDragControlObject.


TDragObject::Instance

TDragObject	Methods	See also

The Instance method returns the instance (module) handle of the EXE or DLL that created the drag object.

Syntax

virtual System::Integer __fastcall Instance(void);


TDragObject::ShowDragImage

TDragObject	Methods	See also

ShowDragImage is a virtual method which contains no functionality in its implementation.

Syntax

virtual void __fastcall ShowDragImage(void);

Description

ShowDragImage is a virtual method and can therefore be overridden in a class derived from TDragObject. ShowDragImage is overridden in the derived class TDragControlObject.


TDragObject::TDragObject

TDragObject	Methods	See also

TDragObject creates a new TDragObject object.

Syntax

__fastcall TDragObject(void);

Description

Use TDragObject to create a new TDragObject object.


TDragObject::~TDragObject

TDragObject	Methods	See also

~TDragObject frees the memory associated with the TDragObject object.

Syntax

__fastcall virtual ~TDragObject(void);

Description

Do not call ~TDragObject directly. Instead, use the delete keyword on the object, which causes ~TDragObject to be invoked automatically.


Scope

Protected


Hierarchy

TObject


TDragObject example

TDragObject


TDrawGrid

Hierarchy	Properties	Methods	Events

A TDrawGrid component is an indirect descendent of TWinControl. It is a grid control that permits the display of an existing data structure in column and row format.

Header

vcl/grids.hpp

The grid uses the OnDrawCell event to fill in the cells of the grid. If the DefaultDrawing property is false, the RefSyn you write in the OnDrawCell event handler draws in the cells. If DefaultDrawing is true, the contents of the cells are automatically drawn using the default background and the Canvas of the grid and is initialized so that the background color is the brush color and the font has the default font color. If the cell is part of the selection, the background color is changed to the selection color and the pen color is changed to the selected text color.

You can obtain the drawing area of a cell with the CellRect method. The MouseToCell method returns the column and row coordinates of the cell the mouse cursor is in.

You can determine which cell is selected in the grid by checking the value of the Selection property.

You can change the appearance and behavior of a data grid by changing the value of the Options property. For example, you can choose to allow the user to use the Tab key to move to a new column, you can decide to display grid lines between columns but not between rows, or let the user edit the data displayed in the grid.

Several properties affect the appearance of the grid. The DefaultColWidth and DefaultRowHeight properties determine the default widths and heights of the columns and rows. You can change the width or height of a specific column or row with the ColWidths and RowHeights properties. You can choose to have fixed or nonscrolling columns and rows with the FixedCols and FixedRows properties, and you can assign the color of the fixed columns and rows with the FixedColor property. Set the width of the grid lines with the GridLineWidth property. Add scroll bars to the grid with the ScrollBars property.

You can determine which row is currently the top row in the grid, or set a specified row to be the top row with the TopRow property. To determine which column is the first visible column in the grid, use the LeftCol property. The values of the VisibleColCount and VisibleRowCount properties are the number of columns and rows visible in the grid.


TDrawGrid properties

TDrawGrid	Alphabetically	Legend

Derived from TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDrawGrid properties

TDrawGrid	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

Col

ColWidths

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

DragCursor

DragMode

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

Font

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

LeftCol

Left

Name

Options

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

RowCount

RowHeights

Row

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStops

TabStop

Tag

TopRow

Top

VisibleColCount

VisibleRowCount

Visible

Width


TDrawGrid events

TDrawGrid	Alphabetically	Legend

In TDrawGrid

OnColumnMoved

OnDrawCell

OnGetEditMask

OnGetEditText

OnRowMoved

OnSelectCell

OnSetEditText

OnTopLeftChanged

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDrawGrid events

TDrawGrid	By object	Legend

OnClick

OnColumnMoved

OnDblClick

OnDragDrop

OnDragOver

OnDrawCell

OnEndDrag

OnEnter

OnExit

OnGetEditMask

OnGetEditText

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnRowMoved

OnSelectCell

OnSetEditText

OnStartDrag

OnTopLeftChanged


TDrawGrid::OnColumnMoved

TDrawGrid	Events

Syntax

__property TMovedEvent OnColumnMoved;

Description


TDrawGrid::OnDrawCell

TDrawGrid	Events

Syntax

__property TDrawCellEvent OnDrawCell;

Description


TDrawGrid::OnGetEditMask

TDrawGrid	Events

Syntax

__property TGetEditEvent OnGetEditMask;

Description


TDrawGrid::OnGetEditText

TDrawGrid	Events

Syntax

__property TGetEditEvent OnGetEditText;

Description


TDrawGrid::OnSetEditText

TDrawGrid	Events

Syntax

__property TSetEditEvent OnSetEditText;

Description


TDrawGrid::OnTopLeftChanged

TDrawGrid	Events

Syntax

__property Classes::TNotifyEvent OnTopLeftChanged;

Description


TDrawGrid methods

TDrawGrid	Alphabetically

In TDrawGrid

~TDrawGrid

CellRect

MouseToCell

TDrawGrid

Derived from TCustomGrid

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDrawGrid methods

TDrawGrid	By object

~TDrawGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CellRect

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

MouseToCell

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDrawGrid

UpdateControlState

Update


TDrawGrid::CellRect

TDrawGrid	Methods

Creates a rectangle of type TRect for the cell defined by the column ACol and the row ARow.

Syntax

Windows::TRect __fastcall CellRect(System::Longint ACol, System::Longint ARow);

Description


TDrawGrid::MouseToCell

TDrawGrid	Methods

Returns the column and row of the cell the mouse pointer is positioned on.

Syntax

void __fastcall MouseToCell(System::Integer X, System::Integer Y, System::Longint &ACol, System::Longint

Description

The X and Y parameters are the screen coordinates of the mouse pointer. The ACol parameter is the number of the column where the mouse pointer is positioned, and the ARow parameter is the number of the row.


TDrawGrid::TDrawGrid

TDrawGrid	Methods	See also

TDrawGrid creates a new TDrawGrid object.

Syntax

__fastcall virtual TDrawGrid(Classes::TComponent *AOwner);

Description

Use TDrawGrid to create a new TDrawGrid object.


TDrawGrid::~TDrawGrid

TDrawGrid	Methods	See also

~TDrawGrid frees the memory associated with the TDrawGrid object.

Syntax

__fastcall virtual ~TDrawGrid(void);

Description

Do not call ~TDrawGrid directly. Instead, use the delete keyword on the object, which causes ~TDrawGrid to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TDrawGrid example

TDrawGrid


TDragControlObject

Hierarchy	Properties	Methods	See also

TDragControlObject object provides for normal drag and drop operations.

Header

vcl/controls.hpp

Description

TDragControlObject object is used to perform normal drag and drop operations within Borland C++ Builder. When TDragControlObject is used the OnDragOver and OnDragDrop events receive the control being dragged as the Sender, instead of the drag object itself.

To facilitate drag and drop between DLL’s, subclass TDragObject object.


TDragControlObject properties

TDragControlObject	Alphabetically	Legend

In TDragControlObject

Control


TDragControlObject properties

TDragControlObject	By object	Legend

Control


TDragControlObject::Control

TDragControlObject	Properties	See also

The Control property returns the control that is being dragged in the drag and drop operation.

Syntax

__property TControl * Control;

Description

Control is useful in determining which control is currently being dragged.


TDragControlObject methods

TDragControlObject	Alphabetically

In TDragControlObject

~TDragControlObject

Finished

GetDragCursor

GetDragImages

HideDragImage

ShowDragImage

TDragControlObject

Derived from TDragObject

GetName

Instance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDragControlObject methods

TDragControlObject	By object

~TDragControlObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Finished

FreeInstance

Free

GetDragCursor

GetDragImages

GetName

HideDragImage

InheritsFrom

InitInstance

InstanceSize

Instance

MethodAddress

MethodName

NewInstance

ShowDragImage

TDragControlObject


TDragControlObject::Finished

TDragControlObject	Methods	See also

Finished ends a drag and drop operation and calls the OnEndDrag event handler.

Syntax

virtual void __fastcall Finished(System::TObject *Target, System::Integer X, System::Integer Y, System::Boolean

Description

Accepted indicates whether the Target control at X, Y position accepts the drag and drop operation. If the control does not accept the drag and drop, the control’s DragCanceled method is called before the OnEndDrag event handler.


TDragControlObject::GetDragCursor

TDragControlObject	Methods	See also

GetDragCursor returns the correct drag cursor that should be displayed at the X, Y position for the drag and drop operation.

Syntax

virtual TCursor __fastcall GetDragCursor(System::Boolean Accepted, System::Integer X, System::Integer

Description

If the control at the X, Y position accepts the drag (in an OnDragOver event handler), the drag object sets the drag cursor to the control's DragCursor property; otherwise, it displays the crNoDrop cursor.


TDragControlObject::GetDragImages

TDragControlObject	Methods	See also

GetDragImages returns the control's image list containing the image to be displayed while dragging.

Syntax

virtual TCustomImageList *__fastcall GetDragImages(void);

Description

GetDragImages calls a control’s GetDragImages method. An image list normally contains only one image, and the VCL automatically creates and maintains the image list. For most controls in the VCL GetDragImages returns NULL unless the method has been overridden to do otherwise as in the TCustomTreeView.


TDragControlObject::HideDragImage

TDragControlObject	Methods	See also

The HideDragImage method hides the image used in the drag cursor.

Syntax

virtual void __fastcall HideDragImage(void);

Description

If the control being dragged contains an image list containing an image for dragging, it will be hidden. This allows control over when a drag image is displayed.


TDragControlObject::ShowDragImage

TDragControlObject	Methods	See also

The ShowDragImage method shows the image used in the drag cursor.

Syntax

virtual void __fastcall ShowDragImage(void);

Description

If the control being dragged contains an image list containing an image for dragging, it will be show. This allows control over when a drag image is shown.


TDragControlObject::TDragControlObject

TDragControlObject	Methods	See also

TDragControlObject creates a new TDragControlObject object.

Syntax

__fastcall TDragControlObject(TControl *AControl);

Description

Use TDragControlObject to create a new TDragControlObject object.


TDragControlObject::~TDragControlObject

TDragControlObject	Methods	See also

~TDragControlObject frees the memory associated with the TDragControlObject object.

Syntax

__fastcall virtual ~TDragControlObject(void);

Description

Do not call ~TDragControlObject directly. Instead, use the delete keyword on the object, which causes ~TDragControlObject to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TDragObject


TDragControlObject example

TDragControlObject


TDriveComboBox

Hierarchy	Properties	Methods	Events

The TDriveComboBox component is an indirect descendent of TWinControl. It is a specialized combo box that displays all the drives available when the application runs. When the user uses the combo box to select another drive, the value of the Drive property changes.

Header

vcl/filectrl.hpp

You can specify whether the text in the drive combo box is uppercase or lowercase with the TextCase property.

If your application uses the drive combo box with a directory list box and a file list box, you can synchronize them with this RefSyn written in the drive combo box OnChange event handler and in the directory list box OnChange event handler:

procedure TForm1.DriveComboBox1Change(Sender: TObject);

procedure TForm1.DirectoryListBox1Change(Sender: TObject);

Now when the user selects a new drive using the drive combo box, the directory list box and the file list box are updated also.

Another way to accomplish the same task is to set the DirList property of the drive combo box and the FileList property of the directory list box.


TDriveComboBox properties

TDriveComboBox	Alphabetically	Legend

In TDriveComboBox

DirList

Drive

TextCase

Derived from TCustomComboBox

Canvas

DroppedDown

ItemIndex

Items

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDriveComboBox properties

TDriveComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DirList

DragCursor

DragMode

Drive

DroppedDown

Enabled

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TextCase

Text

Top

Visible

Width


TDriveComboBox::DirList

TDriveComboBox	Properties

Provides a simple way to connect a drive combo box with a directory list box.

Syntax

__property TDirectoryListBox * DirList;

When a new drive is selected in the drive combo box, the specified directory list box updates to display the directory structure and the current directory on the new drive.

Specify the directory list box you want updated as the value of DirList.


TDriveComboBox::Drive

TDriveComboBox	Properties

Determines which drive is displayed in the edit control of the combo box.

Syntax

__property System::Char Drive;

When the user uses the drive combo box to select a new drive, the selected drive becomes the value of the Drive property. The value of the Text property also changes to the new volume name when the Drive property value changes.


TDriveComboBox::TextCase

TDriveComboBox	Properties

Determines if the volume name in the Text property appears in uppercase or lowercase.

Syntax

__property TTextCase TextCase;

The TextCase property determines if the volume name in the Text property appears in uppercase or lowercase. These are the possible values:

Value	Meaning

tcLowerCase	The volume name specified in the Text property is displayed in lowercase letters.

tcUpperCase	The volume name specified in the Text property is displayed in uppercase letters.

The default value is tcLowerCase. If you use the Object Inspector to change the value to tcUpperCase, you won't see the results until your application runs.


TDriveComboBox events

TDriveComboBox	Alphabetically	Legend

In TDriveComboBox

OnChange

Derived from TCustomComboBox

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDriveComboBox events

TDriveComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TDriveComboBox::OnChange

TDriveComboBox	Events

Syntax

__property Classes::TNotifyEvent OnChange;


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnDropDown


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnStartDrag


TDriveComboBox methods

TDriveComboBox	Alphabetically

In TDriveComboBox

~TDriveComboBox

TDriveComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDriveComboBox methods

TDriveComboBox	By object

~TDriveComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDriveComboBox

UpdateControlState

Update


TDriveComboBox::TDriveComboBox

TDriveComboBox	Methods	See also

TDriveComboBox creates a new TDriveComboBox object.

Syntax

__fastcall virtual TDriveComboBox(Classes::TComponent *AOwner);

Description

Use TDriveComboBox to create a new TDriveComboBox object.


TDriveComboBox::~TDriveComboBox

TDriveComboBox	Methods	See also

~TDriveComboBox frees the memory associated with the TDriveComboBox object.

Syntax

__fastcall virtual ~TDriveComboBox(void);

Description

Do not call ~TDriveComboBox directly. Instead, use the delete keyword on the object, which causes ~TDriveComboBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TDriveComboBox example

TDriveComboBox


EBitsError

Hierarchy	Properties	Methods	See also

EBitsError is the exception class for invalid attempts to access an array of Boolean values.

Header

vcl/classes.hpp

Description

EBitsError is raised when an application attempts to access a Boolean array (an instance of the TBits class) using an index value that is too large or too small. This can occur when the value of the Index parameter of the Bits property is

•	Less than zero.

•	Equal to or greater than the Size property.


EBitsError properties

EBitsError	Alphabetically

Derived from Exception

HelpContext

Message


EBitsError properties

EBitsError	By object

HelpContext

Message


EBitsError methods

EBitsError	Alphabetically

In EBitsError

~EBitsError

EBitsError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EBitsError methods

EBitsError	By object

~EBitsError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EBitsError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EBitsError::EBitsError

EBitsError	Methods	See also

EBitsError creates a new EBitsError object.

Syntax

__fastcall EBitsError(const System::AnsiString Msg);

Description

Use EBitsError to create a new EBitsError object.


EBitsError::~EBitsError

EBitsError	Methods	See also

~EBitsError frees the memory associated with the EBitsError object.

Syntax

__fastcall virtual ~EBitsError(void);

Description

Do not call ~EBitsError directly. Instead, use the delete keyword on the object, which causes ~EBitsError to be invoked automatically.


Hierarchy

TObject

Exception


EBitsError example

EBitsError


EClassNotFound

Hierarchy	Properties	Methods	See also

EClassNotFound is the exception class for the failure to find a specified component when reading from a stream.

Header

vcl/classes.hpp

Description

EClassNotFound is raised if a class name that has not been linked into the current application is encountered when reading a component from a stream. This can happen when a component exists on a form, but has been removed from the type declaration.


EClassNotFound properties

EClassNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EClassNotFound properties

EClassNotFound	By object

HelpContext

Message


EClassNotFound methods

EClassNotFound	Alphabetically

In EClassNotFound

~EClassNotFound

EClassNotFound

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EClassNotFound methods

EClassNotFound	By object

~EClassNotFound

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EClassNotFound

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EClassNotFound::EClassNotFound

EClassNotFound	Methods	See also

EClassNotFound creates a new EClassNotFound object.

Syntax

__fastcall EClassNotFound(const System::AnsiString Msg);

Description

Use EClassNotFound to create a new EClassNotFound object.


EClassNotFound::~EClassNotFound

EClassNotFound	Methods	See also

~EClassNotFound frees the memory associated with the EClassNotFound object.

Syntax

__fastcall virtual ~EClassNotFound(void);

Description

Do not call ~EClassNotFound directly. Instead, use the delete keyword on the object, which causes ~EClassNotFound to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EClassNotFound example

EClassNotFound


EDatabaseError

Hierarchy	Properties	Methods	See also

EDatabaseError is the exception class for database errors.

Header

vcl/db.hpp

Description

EDatabaseError is raised when a component detects a database error. Use EDatabaseError in an exception handling block or to create a database exception.


EDatabaseError properties

EDatabaseError	Alphabetically

Derived from Exception

HelpContext

Message


EDatabaseError properties

EDatabaseError	By object

HelpContext

Message


EDatabaseError methods

EDatabaseError	Alphabetically

In EDatabaseError

~EDatabaseError

EDatabaseError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDatabaseError methods

EDatabaseError	By object

~EDatabaseError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EDatabaseError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDatabaseError::EDatabaseError

EDatabaseError	Methods	See also

EDatabaseError creates a new EDatabaseError object.

Syntax

__fastcall EDatabaseError(const System::AnsiString Msg);

Description

Use EDatabaseError to create a new EDatabaseError object.


EDatabaseError::~EDatabaseError

EDatabaseError	Methods	See also

~EDatabaseError frees the memory associated with the EDatabaseError object.

Syntax

__fastcall virtual ~EDatabaseError(void);

Description

Do not call ~EDatabaseError directly. Instead, use the delete keyword on the object, which causes ~EDatabaseError to be invoked automatically.


Hierarchy

TObject

Exception


EDatabaseError example

EDatabaseError


EDBEditError

Hierarchy	Properties	Methods	See also

EDBEditError is the exception class for data that are incompatible with a specified mask.

Header

vcl/mask.hpp

Description

EDBEditError is raised when an application attempts to use data that are incompatible with the mask specified for a field.

A mask restricts the data that can be put into an edit box or data field. Use the EditMask property to specify a mask.


EDBEditError properties

EDBEditError	Alphabetically

Derived from Exception

HelpContext

Message


EDBEditError properties

EDBEditError	By object

HelpContext

Message


EDBEditError methods

EDBEditError	Alphabetically

In EDBEditError

~EDBEditError

EDBEditError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEditError methods

EDBEditError	By object

~EDBEditError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EDBEditError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEditError::EDBEditError

EDBEditError	Methods	See also

EDBEditError creates a new EDBEditError object.

Syntax

__fastcall EDBEditError(const System::AnsiString Msg);

Description

Use EDBEditError to create a new EDBEditError object.


EDBEditError::~EDBEditError

EDBEditError	Methods	See also

~EDBEditError frees the memory associated with the EDBEditError object.

Syntax

__fastcall virtual ~EDBEditError(void);

Description

Do not call ~EDBEditError directly. Instead, use the delete keyword on the object, which causes ~EDBEditError to be invoked automatically.


Hierarchy

TObject

Exception


EDBEditError example

EDBEditError


EDBEngineError

Hierarchy	Properties	Methods	See also

EDBEngineError is the exception class for Borland Database Engine errors.

Header

vcl/db.hpp

Description

EDBEngineError is raised whenever a BDE error occurs. Its Errors property contains TDBError objects.


EDBEngineError properties

EDBEngineError	Alphabetically	Legend

In EDBEngineError

ErrorCount

Errors

Derived from Exception

HelpContext

Message


EDBEngineError properties

EDBEngineError	By object	Legend

ErrorCount

Errors

HelpContext

Message


EDBEngineError::ErrorCount

EDBEngineError	Properties

The total number of errors contained in the Errors property.

Syntax

__property System::Integer ErrorCount;


Errors

A list of the entire Borland Database Engine error stack.

Description

Errors is an index of TDBError objects. The first error has an index value of 0.


EDBEngineError methods

EDBEngineError	Alphabetically

In EDBEngineError

~EDBEngineError

EDBEngineError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEngineError methods

EDBEngineError	By object

~EDBEngineError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EDBEngineError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEngineError::EDBEngineError

EDBEngineError	Methods	See also

EDBEngineError creates a new EDBEngineError object.

Syntax

__fastcall EDBEngineError(System::Word ErrorCode);

Description

Use EDBEngineError to create a new EDBEngineError object.


EDBEngineError::~EDBEngineError

EDBEngineError	Methods	See also

~EDBEngineError frees the memory associated with the EDBEngineError object.

Syntax

__fastcall virtual ~EDBEngineError(void);

Description

Do not call ~EDBEngineError directly. Instead, use the delete keyword on the object, which causes ~EDBEngineError to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

Exception

EDatabaseError


EDBEngineError example

EDBEngineError


TEdit

Hierarchy	Properties	Methods	Events	See also

TEdit is a wrapper for a Windows single-line edit control.

Header

vcl/stdctrls.hpp

Description

Use a TEdit component to put a standard Windows edit control on your form. Edit controls are used to retrieve information from the user, because the user can type data into an edit controls. Edit Controls can also display information to the user.

TEdit implements the generic behavior introduced in TCustomEdit. TEdit publishes many of the properties inherited from TCustomEdit, but does not introduce any new behavior. For specialized edit controls, use other descendent classes of TCustomEdit or derive from it.


TEdit properties

TEdit	Alphabetically	Legend

In TEdit

ReadOnly

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

HideSelection

MaxLength

Modified

OEMConvert

PasswordChar

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TEdit properties

TEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

Left

MaxLength

Modified

Name

OEMConvert

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TEdit events

TEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TEdit events

TEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TEdit methods

TEdit	Alphabetically

In TEdit

~TEdit

TEdit

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TEdit methods

TEdit	By object

~TEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TEdit

UpdateControlState

Update


TEdit::TEdit

TEdit	Methods	See also

TEdit creates a new TEdit object.

Syntax

__fastcall virtual TEdit(Classes::TComponent *AOwner);

Description

Use TEdit to create a new TEdit object.


TEdit::~TEdit

TEdit	Methods	See also

~TEdit frees the memory associated with the TEdit object.

Syntax

__fastcall virtual ~TEdit(void);

Description

Do not call ~TEdit directly. Instead, use the delete keyword on the object, which causes ~TEdit to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TEdit example

TEdit


EFCreateError

Hierarchy	Properties	Methods	See also

EFCreateError is the exception class for streaming file-creation errors.

Header

vcl/classes.hpp

Description

EFCreateError is raised when an application unsuccessfully attempts to create a file. This can occur, for example, if a user specifies an invalid file name, or specifies the name of an existing file that cannot be overwritten because the user lacks appropriate access permission.


EFCreateError properties

EFCreateError	Alphabetically

Derived from Exception

HelpContext

Message


EFCreateError properties

EFCreateError	By object

HelpContext

Message


EFCreateError methods

EFCreateError	Alphabetically

In EFCreateError

~EFCreateError

EFCreateError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFCreateError methods

EFCreateError	By object

~EFCreateError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EFCreateError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFCreateError::EFCreateError

EFCreateError	Methods	See also

EFCreateError creates a new EFCreateError object.

Syntax

__fastcall EFCreateError(const System::AnsiString Msg);

Description

Use EFCreateError to create a new EFCreateError object.


EFCreateError::~EFCreateError

EFCreateError	Methods	See also

~EFCreateError frees the memory associated with the EFCreateError object.

Syntax

__fastcall virtual ~EFCreateError(void);

Description

Do not call ~EFCreateError directly. Instead, use the delete keyword on the object, which causes ~EFCreateError to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError


EFCreateError example

EFCreateError


EFilerError

Hierarchy	Properties	Methods	See also

EFilerError is the exception class for file stream errors.

Header

vcl/classes.hpp

Description

EFilerError is raised when an attempt is made to register the same class twice.

EFilerError is also the immediate ancestor of the following exceptions that occur when reading or writing streams:

Exception	Description

EReadError	Cannot read the specified number of bytes

EWriteError	Cannot write the specified number of bytes

EClassNotFound	Component is not linked to application

EInvalidImage	Cannot read a resource file

EMethodNotFound	Cannot find the implementation of a method


EFilerError properties

EFilerError	Alphabetically

Derived from Exception

HelpContext

Message


EFilerError properties

EFilerError	By object

HelpContext

Message


EFilerError methods

EFilerError	Alphabetically

In EFilerError

~EFilerError

EFilerError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFilerError methods

EFilerError	By object

~EFilerError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EFilerError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFilerError::EFilerError

EFilerError	Methods	See also

EFilerError creates a new EFilerError object.

Syntax

__fastcall EFilerError(const System::AnsiString Msg);

Description

Use EFilerError to create a new EFilerError object.


EFilerError::~EFilerError

EFilerError	Methods	See also

~EFilerError frees the memory associated with the EFilerError object.

Syntax

__fastcall virtual ~EFilerError(void);

Description

Do not call ~EFilerError directly. Instead, use the delete keyword on the object, which causes ~EFilerError to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError


EFilerError example

EFilerError


EFOpenError

Hierarchy	Properties	Methods	See also

EFOpenError is the exception class for file-opening errors during streaming.

Header

vcl/classes.hpp

Description

EFOpenError is raised when an application cannot open a specified file. This can occur, for example, because the file doesn’t exist or is not in the directory where the application is searching for it.


EFOpenError properties

EFOpenError	Alphabetically

Derived from Exception

HelpContext

Message


EFOpenError properties

EFOpenError	By object

HelpContext

Message


EFOpenError methods

EFOpenError	Alphabetically

In EFOpenError

~EFOpenError

EFOpenError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFOpenError methods

EFOpenError	By object

~EFOpenError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EFOpenError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFOpenError::EFOpenError

EFOpenError	Methods	See also

EFOpenError creates a new EFOpenError object.

Syntax

__fastcall EFOpenError(const System::AnsiString Msg);

Description

Use EFOpenError to create a new EFOpenError object.


EFOpenError::~EFOpenError

EFOpenError	Methods	See also

~EFOpenError frees the memory associated with the EFOpenError object.

Syntax

__fastcall virtual ~EFOpenError(void);

Description

Do not call ~EFOpenError directly. Instead, use the delete keyword on the object, which causes ~EFOpenError to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError


EFOpenError example

EFOpenError


EInvalidGridOperation

Hierarchy	Properties	Methods	See also

EInvalidGridOperation is the exception class for illegal grid operations.

Header

vcl/grids.hpp

Description

EInvalidGridOperation is raised when an application attempts an illegal operation on a grid. For example, EInvalidGridOperation is raised if an application tries to access a cell or column that does not exist within the grid.


EInvalidGridOperation properties

EInvalidGridOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGridOperation properties

EInvalidGridOperation	By object

HelpContext

Message


EInvalidGridOperation methods

EInvalidGridOperation	Alphabetically

In EInvalidGridOperation

~EInvalidGridOperation

EInvalidGridOperation

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGridOperation methods

EInvalidGridOperation	By object

~EInvalidGridOperation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EInvalidGridOperation

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGridOperation::EInvalidGridOperation

EInvalidGridOperation	Methods	See also

EInvalidGridOperation creates a new EInvalidGridOperation object.

Syntax

__fastcall EInvalidGridOperation(const System::AnsiString Msg);

Description

Use EInvalidGridOperation to create a new EInvalidGridOperation object.


EInvalidGridOperation::~EInvalidGridOperation

EInvalidGridOperation	Methods	See also

~EInvalidGridOperation frees the memory associated with the EInvalidGridOperation object.

Syntax

__fastcall virtual ~EInvalidGridOperation(void);

Description

Do not call ~EInvalidGridOperation directly. Instead, use the delete keyword on the object, which causes ~EInvalidGridOperation to be invoked automatically.


Hierarchy

TObject

Exception


EInvalidGridOperation example

EInvalidGridOperation


EInvalidGraphicOperation

Hierarchy	Properties	Methods	See also

EInvalidGraphicOperation is the exception class for illegal operations on graphics.

Header

vcl/graphics.hpp

Description

EInvalidGraphicOperation is raised when an illegal operation is attempted on a graphic. For example, an EInvalidGraphicOperation exception is raised when an application attempts to resize an icon or copy an icon to the clipboard.


EInvalidGraphicOperation properties

EInvalidGraphicOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGraphicOperation properties

EInvalidGraphicOperation	By object

HelpContext

Message


EInvalidGraphicOperation methods

EInvalidGraphicOperation	Alphabetically

In EInvalidGraphicOperation

~EInvalidGraphicOperation

EInvalidGraphicOperation

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphicOperation methods

EInvalidGraphicOperation	By object

~EInvalidGraphicOperation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EInvalidGraphicOperation

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphicOperation::EInvalidGraphicOperation

EInvalidGraphicOperation	Methods	See also

EInvalidGraphicOperation creates a new EInvalidGraphicOperation object.

Syntax

__fastcall EInvalidGraphicOperation(const System::AnsiString Msg);

Description

Use EInvalidGraphicOperation to create a new EInvalidGraphicOperation object.


EInvalidGraphicOperation::~EInvalidGraphicOperation

EInvalidGraphicOperation	Methods	See also

~EInvalidGraphicOperation frees the memory associated with the EInvalidGraphicOperation object.

Syntax

__fastcall virtual ~EInvalidGraphicOperation(void);

Description

Do not call ~EInvalidGraphicOperation directly. Instead, use the delete keyword on the object, which causes ~EInvalidGraphicOperation to be invoked automatically.


Hierarchy

TObject

Exception


EInvalidGraphicOperation example

EInvalidGraphicOperation


EInvalidGraphic

Hierarchy	Properties	Methods

EInvalidGraphic is the exception class for unrecognized graphic files.

Header

vcl/graphics.hpp

Description

EInvalidGraphic is raised when

•	An application attempts to load a file that is not a valid bitmap, icon, metafile, or user-defined graphic type into a picture.

•	An application attempts to load a file with an unrecognized extension.


•	An image does not match the format specified in a call to LoadFromClipboardFormat or SaveToClipboardFormat.


EInvalidGraphic properties

EInvalidGraphic	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGraphic properties

EInvalidGraphic	By object

HelpContext

Message


EInvalidGraphic methods

EInvalidGraphic	Alphabetically

In EInvalidGraphic

~EInvalidGraphic

EInvalidGraphic

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphic methods

EInvalidGraphic	By object

~EInvalidGraphic

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EInvalidGraphic

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphic::EInvalidGraphic

EInvalidGraphic	Methods	See also

EInvalidGraphic creates a new EInvalidGraphic object.

Syntax

__fastcall EInvalidGraphic(const System::AnsiString Msg);

Description

Use EInvalidGraphic to create a new EInvalidGraphic object.


EInvalidGraphic::~EInvalidGraphic

EInvalidGraphic	Methods	See also

~EInvalidGraphic frees the memory associated with the EInvalidGraphic object.

Syntax

__fastcall virtual ~EInvalidGraphic(void);

Description

Do not call ~EInvalidGraphic directly. Instead, use the delete keyword on the object, which causes ~EInvalidGraphic to be invoked automatically.


Hierarchy

TObject

Exception


EInvalidGraphic example

EInvalidGraphic


EInvalidImage

Hierarchy	Properties	Methods	See also

EInvalidImage is the exception class for unsuccessful attempts to read resource files.

Header

vcl/classes.hpp

Description

EInvalidImage is raised when an application cannot read a resource file. This occurs most often because the specified file is not a resource file.

This error can occur if the TStream object’s read and write methods are used inconsistently. Always use ReadComponentRes to read components written with WriteComponentRes, and ReadComponent to read components written with WriteComponent. Failure to use the corresponding read and write methods can result in EInvalidImage exceptions.


EInvalidImage properties

EInvalidImage	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidImage properties

EInvalidImage	By object

HelpContext

Message


EInvalidImage methods

EInvalidImage	Alphabetically

In EInvalidImage

~EInvalidImage

EInvalidImage

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidImage methods

EInvalidImage	By object

~EInvalidImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EInvalidImage

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidImage::EInvalidImage

EInvalidImage	Methods	See also

EInvalidImage creates a new EInvalidImage object.

Syntax

__fastcall EInvalidImage(const System::AnsiString Msg);

Description

Use EInvalidImage to create a new EInvalidImage object.


EInvalidImage::~EInvalidImage

EInvalidImage	Methods	See also

~EInvalidImage frees the memory associated with the EInvalidImage object.

Syntax

__fastcall virtual ~EInvalidImage(void);

Description

Do not call ~EInvalidImage directly. Instead, use the delete keyword on the object, which causes ~EInvalidImage to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EInvalidImage example

EInvalidImage


EInvalidOperation

Hierarchy	Properties	Methods	See also

EInvalidOperation is the exception class for invalid operations on a component.

Header

vcl/controls.hpp

Description

EInvalidOperation is raised when an application attempts an operation that requires a window handle on a component does not have a parent (Parent = NULL). This exception can also occur if a drag-and-drop operation is attempted from a form (for example, Form1.BeginDrag).

Note

Do not confuse this object with EInvalidOp.


EInvalidOperation properties

EInvalidOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidOperation properties

EInvalidOperation	By object

HelpContext

Message


EInvalidOperation methods

EInvalidOperation	Alphabetically

In EInvalidOperation

~EInvalidOperation

EInvalidOperation

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidOperation methods

EInvalidOperation	By object

~EInvalidOperation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EInvalidOperation

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidOperation::EInvalidOperation

EInvalidOperation	Methods	See also

EInvalidOperation creates a new EInvalidOperation object.

Syntax

__fastcall EInvalidOperation(const System::AnsiString Msg);

Description

Use EInvalidOperation to create a new EInvalidOperation object.


EInvalidOperation::~EInvalidOperation

EInvalidOperation	Methods	See also

~EInvalidOperation frees the memory associated with the EInvalidOperation object.

Syntax

__fastcall virtual ~EInvalidOperation(void);

Description

Do not call ~EInvalidOperation directly. Instead, use the delete keyword on the object, which causes ~EInvalidOperation to be invoked automatically.


Hierarchy

TObject

Exception


EInvalidOperation example

EInvalidOperation


EListError

Hierarchy	Properties	Methods	See also

EListError is the exception class for list and string errors.

Header

vcl/classes.hpp

Description

EListError is raised when an error is made in a list, string, or TStringList object. This exception commonly occurs when an application refers to an item that is out of the list’s range.

EListError also occurs if an application tries to add a duplicate string to a TStringList object when the value of the Duplicates property is dupError.

An EListError exception is raised when an application attempts to insert a string into a sorted string list, since the insertion of a string at a specified position may put the list out of order.


EListError properties

EListError	Alphabetically

Derived from Exception

HelpContext

Message


EListError properties

EListError	By object

HelpContext

Message


EListError methods

EListError	Alphabetically

In EListError

~EListError

EListError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EListError methods

EListError	By object

~EListError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EListError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EListError::EListError

EListError	Methods	See also

EListError creates a new EListError object.

Syntax

__fastcall EListError(const System::AnsiString Msg);

Description

Use EListError to create a new EListError object.


EListError::~EListError

EListError	Methods	See also

~EListError frees the memory associated with the EListError object.

Syntax

__fastcall virtual ~EListError(void);

Description

Do not call ~EListError directly. Instead, use the delete keyword on the object, which causes ~EListError to be invoked automatically.


Hierarchy

TObject

Exception


EListError example

EListError


EMCIDeviceError

Hierarchy	Properties	Methods	See also

EMCIDeviceError is the exception class for devices that provide a Media Control Interface (MCI) driver.

Header

vcl/mplayer.hpp

Description

EMCIDeviceError is raised if an error occurs when accessing a multimedia device. The most common cause for the exception is trying to access a multimedia device before it has been opened with the TMediaPlayer.Open method.


EMCIDeviceError properties

EMCIDeviceError	Alphabetically

Derived from Exception

HelpContext

Message


EMCIDeviceError properties

EMCIDeviceError	By object

HelpContext

Message


EMCIDeviceError methods

EMCIDeviceError	Alphabetically

In EMCIDeviceError

~EMCIDeviceError

EMCIDeviceError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMCIDeviceError methods

EMCIDeviceError	By object

~EMCIDeviceError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EMCIDeviceError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMCIDeviceError::EMCIDeviceError

EMCIDeviceError	Methods	See also

EMCIDeviceError creates a new EMCIDeviceError object.

Syntax

__fastcall EMCIDeviceError(const System::AnsiString Msg);

Description

Use EMCIDeviceError to create a new EMCIDeviceError object.


EMCIDeviceError::~EMCIDeviceError

EMCIDeviceError	Methods	See also

~EMCIDeviceError frees the memory associated with the EMCIDeviceError object.

Syntax

__fastcall virtual ~EMCIDeviceError(void);

Description

Do not call ~EMCIDeviceError directly. Instead, use the delete keyword on the object, which causes ~EMCIDeviceError to be invoked automatically.


Hierarchy

TObject

Exception


EMCIDeviceError example

EMCIDeviceError


EMenuError

Hierarchy	Properties	Methods	See also

EMenuError is the exception class for errors involving menu items.

Header

vcl/menus.hpp

Description

EMenuError is raised if an error occurs while an application is working with menu items. For example, an EMenuError exception occurs if an application attempts to delete a menu item that doesn’t exist.


EMenuError properties

EMenuError	Alphabetically

Derived from Exception

HelpContext

Message


EMenuError properties

EMenuError	By object

HelpContext

Message


EMenuError methods

EMenuError	Alphabetically

In EMenuError

~EMenuError

EMenuError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMenuError methods

EMenuError	By object

~EMenuError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EMenuError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMenuError::EMenuError

EMenuError	Methods	See also

EMenuError creates a new EMenuError object.

Syntax

__fastcall EMenuError(const System::AnsiString Msg);

Description

Use EMenuError to create a new EMenuError object.


EMenuError::~EMenuError

EMenuError	Methods	See also

~EMenuError frees the memory associated with the EMenuError object.

Syntax

__fastcall virtual ~EMenuError(void);

Description

Do not call ~EMenuError directly. Instead, use the delete keyword on the object, which causes ~EMenuError to be invoked automatically.


Hierarchy

TObject

Exception


EMenuError example

EMenuError


EMethodNotFound

Hierarchy	Properties	Methods	See also

EMethodNotFound is the exception class for the failure to find a specified method when reading from a stream.

Header

vcl/classes.hpp

Description

EMethodNotFound is raised when a method is used by an application, but its implementation cannot be found.

Note

This exception is raised only at design time.


EMethodNotFound properties

EMethodNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EMethodNotFound properties

EMethodNotFound	By object

HelpContext

Message


EMethodNotFound methods

EMethodNotFound	Alphabetically

In EMethodNotFound

~EMethodNotFound

EMethodNotFound

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMethodNotFound methods

EMethodNotFound	By object

~EMethodNotFound

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EMethodNotFound

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMethodNotFound::EMethodNotFound

EMethodNotFound	Methods	See also

EMethodNotFound creates a new EMethodNotFound object.

Syntax

__fastcall EMethodNotFound(const System::AnsiString Msg);

Description

Use EMethodNotFound to create a new EMethodNotFound object.


EMethodNotFound::~EMethodNotFound

EMethodNotFound	Methods	See also

~EMethodNotFound frees the memory associated with the EMethodNotFound object.

Syntax

__fastcall virtual ~EMethodNotFound(void);

Description

Do not call ~EMethodNotFound directly. Instead, use the delete keyword on the object, which causes ~EMethodNotFound to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EMethodNotFound example

EMethodNotFound


TEnumPropDesc

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TEnumPropDesc methods

TEnumPropDesc	Alphabetically

In TEnumPropDesc

~TEnumPropDesc

GetStrings

StringToValue

TEnumPropDesc

ValueToString

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TEnumPropDesc methods

TEnumPropDesc	By object

~TEnumPropDesc

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetStrings

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

StringToValue

TEnumPropDesc

ValueToString


TEnumPropDesc::GetStrings

TEnumPropDesc	Methods

Syntax

void __fastcall GetStrings(Classes::TGetStrProc Proc);

Description


TEnumPropDesc::StringToValue

TEnumPropDesc	Methods

Syntax

System::Integer __fastcall StringToValue(const System::AnsiString S);

Description


TEnumPropDesc::ValueToString

TEnumPropDesc	Methods

Syntax

System::AnsiString __fastcall ValueToString(System::Integer V);

Description


TEnumPropDesc::TEnumPropDesc

TEnumPropDesc	Methods	See also

TEnumPropDesc creates a new TEnumPropDesc object.

Syntax

__fastcall TEnumPropDesc(System::Integer DispID, System::Integer ValueCount, Ole2::ITypeInfo *TypeInfo

Description

Use TEnumPropDesc to create a new TEnumPropDesc object.


TEnumPropDesc::~TEnumPropDesc

TEnumPropDesc	Methods	See also

~TEnumPropDesc frees the memory associated with the TEnumPropDesc object.

Syntax

__fastcall virtual ~TEnumPropDesc(void);

Description

Do not call ~TEnumPropDesc directly. Instead, use the delete keyword on the object, which causes ~TEnumPropDesc to be invoked automatically.


Hierarchy

TObject


TEnumPropDesc example

TEnumPropDesc


EOleCtrlError

Hierarchy	Properties	Methods	See also

EOleCtrlError is the exception class for OCX controls.

Header

vcl/olectrls.hpp

Description

EOleCtrlError is raised when an application cannot link to an OCX component.


EOleCtrlError properties

EOleCtrlError	Alphabetically

Derived from Exception

HelpContext

Message


EOleCtrlError properties

EOleCtrlError	By object

HelpContext

Message


EOleCtrlError methods

EOleCtrlError	Alphabetically

In EOleCtrlError

~EOleCtrlError

EOleCtrlError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleCtrlError methods

EOleCtrlError	By object

~EOleCtrlError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EOleCtrlError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleCtrlError::EOleCtrlError

EOleCtrlError	Methods	See also

EOleCtrlError creates a new EOleCtrlError object.

Syntax

__fastcall EOleCtrlError(const System::AnsiString Msg);

Description

Use EOleCtrlError to create a new EOleCtrlError object.


EOleCtrlError::~EOleCtrlError

EOleCtrlError	Methods	See also

~EOleCtrlError frees the memory associated with the EOleCtrlError object.

Syntax

__fastcall virtual ~EOleCtrlError(void);

Description

Do not call ~EOleCtrlError directly. Instead, use the delete keyword on the object, which causes ~EOleCtrlError to be invoked automatically.


Hierarchy

TObject

Exception


EOleCtrlError example

EOleCtrlError


EOleError

Hierarchy	Properties	Methods	See also

EOleError is the exception class for OLE automation errors.

Header

vcl/oleauto.hpp

Description

EOleError is raised when an application cannot access an OLE automation object.


EOleError properties

EOleError	Alphabetically

Derived from Exception

HelpContext

Message


EOleError properties

EOleError	By object

HelpContext

Message


EOleError methods

EOleError	Alphabetically

In EOleError

~EOleError

EOleError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleError methods

EOleError	By object

~EOleError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EOleError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleError::EOleError

EOleError	Methods	See also

EOleError creates a new EOleError object.

Syntax

__fastcall EOleError(const System::AnsiString Msg);

Description

Use EOleError to create a new EOleError object.


EOleError::~EOleError

EOleError	Methods	See also

~EOleError frees the memory associated with the EOleError object.

Syntax

__fastcall virtual ~EOleError(void);

Description

Do not call ~EOleError directly. Instead, use the delete keyword on the object, which causes ~EOleError to be invoked automatically.


Hierarchy

TObject

Exception


EOleError example

EOleError


EOleException

Hierarchy	Properties	Methods	See also

EOleException encapsulates exceptions raised by OLE automation servers.

Header

vcl/oleauto.hpp

Description

EOleException is raised when an OLE automation server generates an exception during runtime. It captures essential information about the exception, including the source of the error, error code, description, help file, and ID number for context-sensitive help. The error description and ID number (if available) are included in a message generated by CreateHelp; the other information is stored in the Source, ErrorCode, and HelpFile properties defined for EOleException.


EOleException properties

EOleException	Alphabetically	Legend

In EOleException

ErrorCode

HelpFile

Source

Derived from Exception

HelpContext

Message


EOleException properties

EOleException	By object	Legend

ErrorCode

HelpContext

HelpFile

Message

Source


EOleException::ErrorCode

EOleException	Properties

The error code passed from the source of the exception.

Syntax

__property System::Integer ErrorCode;

Description

ErrorCode contains the numerical error code passed from the application that raised the exception.


EOleException::HelpFile

EOleException	Properties

The name and location of the help file that contains information about the error that occurred.

Syntax

__property System::AnsiString HelpFile;

Description

HelpFile lists the name and complete directory path of the help file that contains information about the error.


EOleException::Source

EOleException	Properties

The source of the exception.

Syntax

__property System::AnsiString Source;

Description

Source gives the source of the exception. Usually, this is the name of an application program.


EOleException methods

EOleException	Alphabetically

In EOleException

~EOleException

EOleException

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleException methods

EOleException	By object

~EOleException

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EOleException

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleException::EOleException

EOleException	Methods	See also

EOleException creates a new EOleException object.

Syntax

__fastcall EOleException(const Ole2::TExcepInfo &ExcepInfo);

Description

Use EOleException to create a new EOleException object.


EOleException::~EOleException

EOleException	Methods	See also

~EOleException frees the memory associated with the EOleException object.

Syntax

__fastcall virtual ~EOleException(void);

Description

Do not call ~EOleException directly. Instead, use the delete keyword on the object, which causes ~EOleException to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

Exception

EOleError


EOleException example

EOleException


EOleSysError

Hierarchy	Properties	Methods	See also

EOleSysError is the exception class for OLE API errors.

Header

vcl/oleauto.hpp

Description

EOleSysError is raised when the OLE API returns an error at run time.


EOleSysError properties

EOleSysError	Alphabetically	Legend

In EOleSysError

ErrorCode

Derived from Exception

HelpContext

Message


EOleSysError properties

EOleSysError	By object	Legend

ErrorCode

HelpContext

Message


EOleSysError::ErrorCode

EOleSysError	Properties

The numerical error code returned by the API.

Syntax

__fastcall EOleSysError(System::Integer ErrorCode, System::Integer Dummy1, System::Integer Dummy2);

Description

ErrorCode is the numerical error code returned by the OLE API.


EOleSysError methods

EOleSysError	Alphabetically

In EOleSysError

~EOleSysError

EOleSysError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleSysError methods

EOleSysError	By object

~EOleSysError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EOleSysError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleSysError::EOleSysError

EOleSysError	Methods	See also

EOleSysError creates a new EOleSysError object.

Syntax

__fastcall EOleSysError(System::Integer ErrorCode, System::Integer Dummy1, System::Integer Dummy2);

Description

Use EOleSysError to create a new EOleSysError object.


EOleSysError::~EOleSysError

EOleSysError	Methods	See also

~EOleSysError frees the memory associated with the EOleSysError object.

Syntax

__fastcall virtual ~EOleSysError(void);

Description

Do not call ~EOleSysError directly. Instead, use the delete keyword on the object, which causes ~EOleSysError to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

Exception

EOleError


EOleSysError example

EOleSysError


EOutlineError

Hierarchy	Properties	Methods	See also

EOutlineError is the exception class for outline components.

Header

vcl/outline.hpp

Description

EOutlineError is raised when an error occurs as an application works with an outline component. For example, an EOutlineError exception occurs when an application

•	Attempts to access an outline using an invalid node index.

•	Attempts to expand a node whose parent isn’t expanded.

•	Attempts to load items from a file using an invalid file extension.


EOutlineError properties

EOutlineError	Alphabetically

Derived from Exception

HelpContext

Message


EOutlineError properties

EOutlineError	By object

HelpContext

Message


EOutlineError methods

EOutlineError	Alphabetically

In EOutlineError

~EOutlineError

EOutlineError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutlineError methods

EOutlineError	By object

~EOutlineError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EOutlineError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutlineError::EOutlineError

EOutlineError	Methods	See also

EOutlineError creates a new EOutlineError object.

Syntax

__fastcall EOutlineError(const System::AnsiString Msg);

Description

Use EOutlineError to create a new EOutlineError object.


EOutlineError::~EOutlineError

EOutlineError	Methods	See also

~EOutlineError frees the memory associated with the EOutlineError object.

Syntax

__fastcall virtual ~EOutlineError(void);

Description

Do not call ~EOutlineError directly. Instead, use the delete keyword on the object, which causes ~EOutlineError to be invoked automatically.


Hierarchy

TObject

Exception


EOutlineError example

EOutlineError


EOutOfResources

Hierarchy	Properties	Methods	See also

EOutOfResources is the exception class for unsuccessful attempts to allocate Windows handles.

Header

vcl/controls.hpp

Description

EOutOfResources is raised when an application attempts to create a Windows handle and Windows has no more handles to allocate.


EOutOfResources properties

EOutOfResources	Alphabetically

Derived from Exception

HelpContext

Message


EOutOfResources properties

EOutOfResources	By object

HelpContext

Message


EOutOfResources methods

EOutOfResources	Alphabetically

In EOutOfResources

~EOutOfResources

EOutOfResources

Derived from EOutOfMemory

FreeInstance

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutOfResources methods

EOutOfResources	By object

~EOutOfResources

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EOutOfResources

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutOfResources::EOutOfResources

EOutOfResources	Methods	See also

EOutOfResources creates a new EOutOfResources object.

Syntax

__fastcall EOutOfResources(const System::AnsiString Msg);

Description

Use EOutOfResources to create a new EOutOfResources object.


EOutOfResources::~EOutOfResources

EOutOfResources	Methods	See also

~EOutOfResources frees the memory associated with the EOutOfResources object.

Syntax

__fastcall virtual ~EOutOfResources(void);

Description

Do not call ~EOutOfResources directly. Instead, use the delete keyword on the object, which causes ~EOutOfResources to be invoked automatically.


Hierarchy

TObject

Exception

EOutOfMemory


EOutOfResources example

EOutOfResources


EParserError

Hierarchy	Properties	Methods	See also

EParserError is the exception class for text-to-binary streaming conversion errors.

Header

vcl/classes.hpp

Description

EParserError is raised when an error occurs during text-to-binary conversion, usually due to a syntax error in the source text.


EParserError properties

EParserError	Alphabetically

Derived from Exception

HelpContext

Message


EParserError properties

EParserError	By object

HelpContext

Message


EParserError methods

EParserError	Alphabetically

In EParserError

~EParserError

EParserError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EParserError methods

EParserError	By object

~EParserError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EParserError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EParserError::EParserError

EParserError	Methods	See also

EParserError creates a new EParserError object.

Syntax

__fastcall EParserError(const System::AnsiString Msg);

Description

Use EParserError to create a new EParserError object.


EParserError::~EParserError

EParserError	Methods	See also

~EParserError frees the memory associated with the EParserError object.

Syntax

__fastcall virtual ~EParserError(void);

Description

Do not call ~EParserError directly. Instead, use the delete keyword on the object, which causes ~EParserError to be invoked automatically.


Hierarchy

TObject

Exception


EParserError example

EParserError


EPrinter

Hierarchy	Properties	Methods

EPrinter is the exception class for printing errors.

Header

vcl/printers.hpp

Description

EPrinter is raised when a printing error occurs. For example, if an application attempts to use a printer that doesn’t exist, or if a job can’t be sent to the printer for some other reason, an EPrinter exception is raised.


EPrinter properties

EPrinter	Alphabetically

Derived from Exception

HelpContext

Message


EPrinter properties

EPrinter	By object

HelpContext

Message


EPrinter methods

EPrinter	Alphabetically

In EPrinter

~EPrinter

EPrinter

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPrinter methods

EPrinter	By object

~EPrinter

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EPrinter

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPrinter::EPrinter

EPrinter	Methods	See also

EPrinter creates a new EPrinter object.

Syntax

__fastcall EPrinter(const System::AnsiString Msg);

Description

Use EPrinter to create a new EPrinter object.


EPrinter::~EPrinter

EPrinter	Methods	See also

~EPrinter frees the memory associated with the EPrinter object.

Syntax

__fastcall virtual ~EPrinter(void);

Description

Do not call ~EPrinter directly. Instead, use the delete keyword on the object, which causes ~EPrinter to be invoked automatically.


Hierarchy

TObject

Exception


EPrinter example

EPrinter


EPropertyError

Hierarchy	Properties	Methods	See also

EPropertyError is the exception class for unsuccessful attempts to set the value of a property.

Header

vcl/dsgnintf.hpp

Description

EPropertyError is raised by the SetValue (or Edit) methods of property-editor objects when they cannot set a requested property value. This usually occurs because the requested value is out of range or of an invalid data type.


EPropertyError properties

EPropertyError	Alphabetically

Derived from Exception

HelpContext

Message


EPropertyError properties

EPropertyError	By object

HelpContext

Message


EPropertyError methods

EPropertyError	Alphabetically

In EPropertyError

~EPropertyError

EPropertyError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropertyError methods

EPropertyError	By object

~EPropertyError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EPropertyError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropertyError::EPropertyError

EPropertyError	Methods	See also

EPropertyError creates a new EPropertyError object.

Syntax

__fastcall EPropertyError(const System::AnsiString Msg);

Description

Use EPropertyError to create a new EPropertyError object.


EPropertyError::~EPropertyError

EPropertyError	Methods	See also

~EPropertyError frees the memory associated with the EPropertyError object.

Syntax

__fastcall virtual ~EPropertyError(void);

Description

Do not call ~EPropertyError directly. Instead, use the delete keyword on the object, which causes ~EPropertyError to be invoked automatically.


Hierarchy

TObject

Exception


EPropertyError example

EPropertyError


EReadError

Hierarchy	Properties	Methods	See also

EReadError is the exception class for unsuccessful attempts to read data from a stream.

Header

vcl/classes.hpp

Description

EReadError is raised when an application attempts to read data from a stream but cannot read the specified number of bytes.

An EReadError exception may also be raised if Borland C++ Builder is unable to read a property while creating a form. This can occur because a component reads the form resource incorrectly, or because the resource is corrupt.


EReadError properties

EReadError	Alphabetically

Derived from Exception

HelpContext

Message


EReadError properties

EReadError	By object

HelpContext

Message


EReadError methods

EReadError	Alphabetically

In EReadError

~EReadError

EReadError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EReadError methods

EReadError	By object

~EReadError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EReadError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EReadError::EReadError

EReadError	Methods	See also

EReadError creates a new EReadError object.

Syntax

__fastcall EReadError(const System::AnsiString Msg);

Description

Use EReadError to create a new EReadError object.


EReadError::~EReadError

EReadError	Methods	See also

~EReadError frees the memory associated with the EReadError object.

Syntax

__fastcall virtual ~EReadError(void);

Description

Do not call ~EReadError directly. Instead, use the delete keyword on the object, which causes ~EReadError to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EReadError example

EReadError


ERegistryException

Hierarchy	Properties	Methods	See also

ERegistryException is the exception class for registry errors.

Header

vcl/registry.hpp

Description

ERegistryException is raised when an application cannot

•	Create a new key in the registry.

•	Read a data value associated with a key.

•	Read a binary data value associated with a key into a local buffer.

•	Write a data value to a key.

Key creation fails when an application attempts to create a subkey under a key for which it does not have KEY_CREATE_SUB_KEY security access.

Reading a data value associated with a key fails when an application does not have KEY_READ security access, or because the application attempts to read the wrong kind of data from a key, such as reading string data from an integer data value.

Reading a binary data value into a local buffer fails when an application does not allocate a buffer large enough for the data.

Writing a data value to a key fails because an application does not have KEY_WRITE security access for the current key.


ERegistryException properties

ERegistryException	Alphabetically

Derived from Exception

HelpContext

Message


ERegistryException properties

ERegistryException	By object

HelpContext

Message


ERegistryException methods

ERegistryException	Alphabetically

In ERegistryException

~ERegistryException

ERegistryException

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ERegistryException methods

ERegistryException	By object

~ERegistryException

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

ERegistryException

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ERegistryException::ERegistryException

ERegistryException	Methods	See also

ERegistryException creates a new ERegistryException object.

Syntax

__fastcall ERegistryException(const System::AnsiString Msg);

Description

Use ERegistryException to create a new ERegistryException object.


ERegistryException::~ERegistryException

ERegistryException	Methods	See also

~ERegistryException frees the memory associated with the ERegistryException object.

Syntax

__fastcall virtual ~ERegistryException(void);

Description

Do not call ~ERegistryException directly. Instead, use the delete keyword on the object, which causes ~ERegistryException to be invoked automatically.


Hierarchy

TObject

Exception


ERegistryException example

ERegistryException


EReportError

Hierarchy	Properties	Methods	See also

EReportError is the exception class for invalid attempts to connect a report to a database.

Header

vcl/report.hpp

Description

EReportError is raised when a report component (TReport) cannot connect to a database because the specified server type is invalid.


EReportError properties

EReportError	Alphabetically

Derived from Exception

HelpContext

Message


EReportError properties

EReportError	By object

HelpContext

Message


EReportError methods

EReportError	Alphabetically

In EReportError

~EReportError

EReportError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EReportError methods

EReportError	By object

~EReportError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EReportError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EReportError::EReportError

EReportError	Methods	See also

EReportError creates a new EReportError object.

Syntax

__fastcall EReportError(const System::AnsiString Msg);

Description

Use EReportError to create a new EReportError object.


EReportError::~EReportError

EReportError	Methods	See also

~EReportError frees the memory associated with the EReportError object.

Syntax

__fastcall virtual ~EReportError(void);

Description

Do not call ~EReportError directly. Instead, use the delete keyword on the object, which causes ~EReportError to be invoked automatically.


Hierarchy

TObject

Exception


EReportError example

EReportError


EResNotFound

Hierarchy	Properties	Methods	See also

EResNotFound is the exception class for unlocatable resources.

Header

vcl/classes.hpp

Description

EResNotFound is raised when Borland C++ Builder cannot find a specified resource (such as a form, bitmap, or icon) in a .DFM or .RES file, or when the resource is not linked into the application.

If you receive this exception on startup of an application, or when you create a form, check the form’s .PAS file for the {$R *.DFM} compiler directive. If this directive is missing or commented out, the .DFM file will not be included in the executable and an EResNotFound exception will be generated.


EResNotFound properties

EResNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EResNotFound properties

EResNotFound	By object

HelpContext

Message


EResNotFound methods

EResNotFound	Alphabetically

In EResNotFound

~EResNotFound

EResNotFound

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EResNotFound methods

EResNotFound	By object

~EResNotFound

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EResNotFound

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EResNotFound::EResNotFound

EResNotFound	Methods	See also

EResNotFound creates a new EResNotFound object.

Syntax

__fastcall EResNotFound(const System::AnsiString Msg);

Description

Use EResNotFound to create a new EResNotFound object.


EResNotFound::~EResNotFound

EResNotFound	Methods	See also

~EResNotFound frees the memory associated with the EResNotFound object.

Syntax

__fastcall virtual ~EResNotFound(void);

Description

Do not call ~EResNotFound directly. Instead, use the delete keyword on the object, which causes ~EResNotFound to be invoked automatically.


Hierarchy

TObject

Exception


EResNotFound example

EResNotFound


EStringListError

Hierarchy	Properties	Methods	See also

EStringListError is the exception class for invalid list-box references.

Header

vcl/classes.hpp

Description

EStringListError is raised when an application attempts to access a list box (for example, to add an item) using an invalid index.


EStringListError properties

EStringListError	Alphabetically

Derived from Exception

HelpContext

Message


EStringListError properties

EStringListError	By object

HelpContext

Message


EStringListError methods

EStringListError	Alphabetically

In EStringListError

~EStringListError

EStringListError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStringListError methods

EStringListError	By object

~EStringListError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EStringListError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStringListError::EStringListError

EStringListError	Methods	See also

EStringListError creates a new EStringListError object.

Syntax

__fastcall EStringListError(const System::AnsiString Msg);

Description

Use EStringListError to create a new EStringListError object.


EStringListError::~EStringListError

EStringListError	Methods	See also

~EStringListError frees the memory associated with the EStringListError object.

Syntax

__fastcall virtual ~EStringListError(void);

Description

Do not call ~EStringListError directly. Instead, use the delete keyword on the object, which causes ~EStringListError to be invoked automatically.


Hierarchy

TObject

Exception


EStringListError example

EStringListError


EStreamError

Hierarchy	Properties	Methods	See also

EStreamError is the exception class for streaming errors.

Header

vcl/classes.hpp

Description

EStreamError is the ancestor from which all streaming exception classes descend. EStreamError is itself raised when resources cannot be allocated for a memory stream.


EStreamError properties

EStreamError	Alphabetically

Derived from Exception

HelpContext

Message


EStreamError properties

EStreamError	By object

HelpContext

Message


EStreamError methods

EStreamError	Alphabetically

In EStreamError

~EStreamError

EStreamError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStreamError methods

EStreamError	By object

~EStreamError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EStreamError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStreamError::EStreamError

EStreamError	Methods	See also

EStreamError creates a new EStreamError object.

Syntax

__fastcall EStreamError(const System::AnsiString Msg);

Description

Use EStreamError to create a new EStreamError object.


EStreamError::~EStreamError

EStreamError	Methods	See also

~EStreamError frees the memory associated with the EStreamError object.

Syntax

__fastcall virtual ~EStreamError(void);

Description

Do not call ~EStreamError directly. Instead, use the delete keyword on the object, which causes ~EStreamError to be invoked automatically.


Hierarchy

TObject

Exception


EStreamError example

EStreamError


EThread

Hierarchy	Properties	Methods	See also

EThread is the exception class for thread synchronization errors.

Header

vcl/classes.hpp

Description

EThread is raised when conflicts arise in multithreaded applications. This can occur if Synchronize is called before a previous call to it has completed execution.


EThread properties

EThread	Alphabetically

Derived from Exception

HelpContext

Message


EThread properties

EThread	By object

HelpContext

Message


EThread methods

EThread	Alphabetically

In EThread

~EThread

EThread

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EThread methods

EThread	By object

~EThread

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EThread

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EThread::EThread

EThread	Methods	See also

EThread creates a new EThread object.

Syntax

__fastcall EThread(const System::AnsiString Msg);

Description

Use EThread to create a new EThread object.


EThread::~EThread

EThread	Methods	See also

~EThread frees the memory associated with the EThread object.

Syntax

__fastcall virtual ~EThread(void);

Description

Do not call ~EThread directly. Instead, use the delete keyword on the object, which causes ~EThread to be invoked automatically.


Hierarchy

TObject

Exception


EThread example

EThread


ETreeViewError

Hierarchy	Properties	Methods	See also

ETreeViewError is the exception class for unsuccessful attempts to access a tree view node.

Header

vcl/comctrls.hpp

Description

ETreeViewError is raised when an invalid index is requested from a TTreeView component.


ETreeViewError properties

ETreeViewError	Alphabetically

Derived from Exception

HelpContext

Message


ETreeViewError properties

ETreeViewError	By object

HelpContext

Message


ETreeViewError methods

ETreeViewError	Alphabetically

In ETreeViewError

~ETreeViewError

ETreeViewError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ETreeViewError methods

ETreeViewError	By object

~ETreeViewError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

ETreeViewError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ETreeViewError::ETreeViewError

ETreeViewError	Methods	See also

ETreeViewError creates a new ETreeViewError object.

Syntax

__fastcall ETreeViewError(const System::AnsiString Msg);

Description

Use ETreeViewError to create a new ETreeViewError object.


ETreeViewError::~ETreeViewError

ETreeViewError	Methods	See also

~ETreeViewError frees the memory associated with the ETreeViewError object.

Syntax

__fastcall virtual ~ETreeViewError(void);

Description

Do not call ~ETreeViewError directly. Instead, use the delete keyword on the object, which causes ~ETreeViewError to be invoked automatically.


Hierarchy

TObject

Exception


ETreeViewError example

ETreeViewError


TEventDispatch

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TEventDispatch methods

TEventDispatch	Alphabetically

In TEventDispatch

~TEventDispatch

AddRef

GetIDsOfNames

GetTypeInfo

GetTypeInfoCount

Invoke

QueryInterface

Release

TEventDispatch

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TEventDispatch methods

TEventDispatch	By object

~TEventDispatch

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetIDsOfNames

GetTypeInfoCount

GetTypeInfo

InheritsFrom

InitInstance

InstanceSize

Invoke

MethodAddress

MethodName

NewInstance

QueryInterface

Release

TEventDispatch


TEventDispatch::AddRef

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TEventDispatch::GetIDsOfNames

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall GetIDsOfNames(const Ole2::TGUID &iid, Ole2::POleStrList rgszNames

Description


TEventDispatch::GetTypeInfo

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall GetTypeInfo(System::Integer itinfo, System::Longint lcid, Ole2::ITypeInfo *

Description


TEventDispatch::GetTypeInfoCount

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall GetTypeInfoCount(System::Integer &ctinfo);

Description


TEventDispatch::Invoke

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall Invoke(System::Longint dispIDMember, const Ole2::TGUID &iid, System::Longint

Description


TEventDispatch::QueryInterface

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TEventDispatch::Release

TEventDispatch	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TEventDispatch::TEventDispatch

TEventDispatch	Methods	See also

TEventDispatch creates a new TEventDispatch object.

Syntax

__fastcall TEventDispatch(TOleControl *Control);

Description

Use TEventDispatch to create a new TEventDispatch object.


TEventDispatch::~TEventDispatch

TEventDispatch	Methods	See also

~TEventDispatch frees the memory associated with the TEventDispatch object.

Syntax

__fastcall virtual ~TEventDispatch(void);

Description

Do not call ~TEventDispatch directly. Instead, use the delete keyword on the object, which causes ~TEventDispatch to be invoked automatically.


Hierarchy

TObject

IUnknown

IDispatch


TEventDispatch example

TEventDispatch


EWriteError

Hierarchy	Properties	Methods	See also

EWriteError is the exception class for unsuccessful attempts to write data to a stream.

Header

vcl/classes.hpp

Description

EWriteError is raised when:

•	The WriteBuffer method of a stream object is unable to write the specified number of bytes.

•	The IDE is unable to write one of a component’s properties to a stream. This can occur when you try to save a form at design time.


EWriteError properties

EWriteError	Alphabetically

Derived from Exception

HelpContext

Message


EWriteError properties

EWriteError	By object

HelpContext

Message


EWriteError methods

EWriteError	Alphabetically

In EWriteError

~EWriteError

EWriteError

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EWriteError methods

EWriteError	By object

~EWriteError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Dispatch

EWriteError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EWriteError::EWriteError

EWriteError	Methods	See also

EWriteError creates a new EWriteError object.

Syntax

__fastcall EWriteError(const System::AnsiString Msg);

Description

Use EWriteError to create a new EWriteError object.


EWriteError::~EWriteError

EWriteError	Methods	See also

~EWriteError frees the memory associated with the EWriteError object.

Syntax

__fastcall virtual ~EWriteError(void);

Description

Do not call ~EWriteError directly. Instead, use the delete keyword on the object, which causes ~EWriteError to be invoked automatically.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EWriteError example

EWriteError


TField

Hierarchy	Properties	Methods	Events	See also

The TField component is the common ancestor of all the field components in a dataset.

Header

vcl/db.hpp

Description

TField is an abstract object that encapsulates the fundamental behavior common to all field components. It introduces the properites, events, and methods that are used to:

•	Change the value of a field in a dataset.

•	Convert the value of a field from one data type to another.

•	Validate data as the user enters data for a field.

•	Define how the data in the field appears as it is displayed or edited.

•	Calculate the value of a field from code written in the OnCalcFields event of the dataset.

•	Look up the field’s value in another dataset.

Do not create instances of TField. TField descendants are created automatically each time a dataset is activated. These descendants can be dynamic (the default) or persistent. Dynamic field components mirror the actual columns in an underlying physical table at the time a dataset is opened. Persistent field components are created at design time using the Fields editor to specify fields in the dataset, their properties, and their ordering.

Creating persistent field components guarantees that each time an application runs, it uses and displays the same columns, in the same order, every time, even if the physical structure of the underlying database changes. If a column on which a persistent field component is based is deleted or changed, then Borland C++ Builder generates an exception rather than opening the table against a nonexistent column or mismatched data.

A field in a dataset is always one of the following TField descendants:

•	TStringField

•	TIntegerField

•	TSmallintField

•	TWordField

•	TFloatField

•	TAutoIncField

•	TCurrencyField

•	TBCDField

•	TBooleanField

•	TDateTimeField

•	TDateField

•	TTimeField

•	TBlobField

•	TBytesField

•	TVarBytesField

•	TMemoField

•	TGraphicField


TField properties

TField	Alphabetically	Legend

In TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TField properties

TField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TField::Alignment

TField	Properties	See also

Alignment determines how the field’s data is displayed within a data-aware control.

Syntax

__property Classes::TAlignment Alignment;

Description

Use Alignment to specify the position of the field’s data within data-aware controls. These are the possible values:

Value	Meaning

taLeftJustify	Align data to the left side of the control

taCenter	Center data horizontally in the control

taRightJustify	Align data to the right side of the control


TField::AsBoolean

TField	Properties	See also

TField raises an exception whenever an attempt is made to get or set the AsBoolean property.

Syntax

__property System::Boolean AsBoolean;

Description

AsBoolean provides a property to read the value of the field’s data into a boolean, or to assign a boolean value to the contents of the field. TField does not support boolean values, and raises an exception whenever an attempt is made to get or set the AsBoolean property.

Descendents of TField that represent boolean fields or that support conversions between the field’s Value property and a boolean value, override AsBoolean to read and write the value of the field as a boolean value.


TField::AsCurrency

TField	Properties	See also

TField raises an exception whenever an attempt is made to get or set the AsCurrency property.

Syntax

__property System::Currency AsCurrency;

Description

AsCurrency provides a property to read the value of the field’s data into an object or variable of type Currency, or to assign a Currency value to the contents of the field. TField does not support Currency values, and raises an exception whenever an attempt is made to get or set the AsCurrency property.

Descendents of TField that represent currency fields or that support conversions between the field’s Value property and a Currency value, override AsCurrency to read and write the value of the field as a Currency value.


TField::AsDateTime

TField	Properties	See also

TField raises an exception whenever an attempt is made to get or set the AsDateTime property.

Syntax

__property System::TDateTime AsDateTime;

Description

AsDateTime provides a property to read the value of the field’s data into an object or variable of type TDateTime, or to assign a TDateTime value to the contents of the field. TField does not support TDateTime values, and raises an exception whenever an attempt is made to get or set the AsDateTime property.

Descendents of TField that represent datetime (timestamp) fields or that support conversions between the field’s Value property and a TDateTime value, override AsDateTime to read and write the value of the field as a TDateTime value.


TField::AsFloat

TField	Properties	See also

TField raises an exception whenever an attempt is made to get or set the AsFloat property.

Syntax

__property System::Double AsFloat;

Description

AsFloat provides a property to read the value of the field’s data into a Double, or to assign a Double value to the contents of the field. TField does not support floating point values, and raises an exception whenever an attempt is made to get or set the AsFloat property.

Descendents of TField that represent floating point numeric fields or that support conversions between the field’s Value property and a Double value, override AsFloat to read and write the value of the field as a Double value.


TField::AsInteger

TField	Properties	See also

TField raises an exception whenever an attempt is made to get or set the AsInteger property.

Syntax

__property System::Longint AsInteger;

Description

AsInteger provides a property to read the value of the field’s data into an integer, or to assign an integer value to the contents of the field. TField does not support integer values, and raises an exception whenever an attempt is made to get or set the AsInteger property.

Descendents of TField that represent integer fields or that support conversions between the field’s Value property and an integer value, override AsInteger to read and write the value of the field as an integer value.


TField::AsString

TField	Properties	See also

AsString is the abbreviated class name of the field component.

Syntax

__property System::AnsiString AsString;

Description

Reading the AsString property returns the abbreviated class name of the field component enclosed in parentheses. The abbreviated class name is built by stripping the leading ‘T’ from the class name and removing the trailing word ‘FIELD’, except in the case of TField, where that would leave an empty string. For TField, the abbreviated class name is ‘FIELD’. Trying to set the AsString property raises an exception.

Descendents of TField that represent string fields or that support conversions between the field’s Value property and a string, override AsString to read and write the value of the field as a different, more meaningful, string.


TField::AsVariant

TField	Properties	See also

AsVariant is the Value of the field expressed as type Variant.

Syntax

__property System::Variant AsVariant;

Description

AsVariant provides a property to read the value of the field’s data into a Variant, or to assign a Variant value to the contents of the field. TField does not support Variant values, and raises an exception whenever an attempt is made to read the AsVariant property. TField raises an exception whenever an attempt is made to set the AsVariant property, unless the Variant is of type varNull, in which case TField calls the Clear method.

Descendents of TField implement the AsVariant method to get or set the value of the field as a Variant.


TField::AttributeSet

TField	Properties	See also

AttributeSet is the name of the attribute set in the data dictionary to apply to a field component.

Syntax

__property System::AnsiString AttributeSet;

Description

An attribute set defines the display and format properties of a field component displayed in a data-aware control at design time.

Attribute sets are stored in the data dictionary by name so that at design time developers can create and apply the same set of attributes to different field components in one or more datasets. When an attribute set is assigned to a field component at design time and that field component is owned by a TQuery or TStoredProc dataset component, AttributeSet contains the name of the assigned attribute set.


BDECalcField	removed for version 3

BDECalcField indicates whether or not the field is a BDE calculated field based on a query that returns a live data set.

Description

Check the value of the BDECalcField property to determine if a field component’s value is calculated by the Borland Database Engine based on a query that returns a live result set. If BDECalcField is true, the the field value is calculated by the BDE. Calculated fields are not stored or retrieved from the physical table underlying a dataset. They exist only in the application.

For example, the following SQL statement includes a BDE calculated field (ONHAND * COST):

If the TQuery object that uses this SQL statement has its RequestLive proprety set to true, the TQuery will include a TField for the calculated field which has the BDECalcField property set to true.

Do not confuse BDECalcField with the Calculated property. The value of a BDE calculated field is based on a query that returns a live data set, while a calculated field’s value is calculated within the OnCalcField event handler of the dataset.

Note

When BDECalcField is true, the field can be edited, but the changes are discarded. To prevent editing, set the ReadOnly property to true.


TField::Calculated

TField	Properties	See also

Calculated determines whether the value of the field is calculated by the OnCalcFields event handler of a dataset.

Syntax

__property System::Boolean Calculated;

Description

Use Calculated to determine if the field is a calculated field. When Calculated is true and the OnCalcFields event occurs, the code in the OnCalcFields event handler executes. The default value is false.

The value of a Calculated field is not stored in or retrieved from the physical tables underlying a dataset. Instead, Calculated fields are calculated for each record in the table by the dataset's OnCalcFields event handler, which typically uses expressions involving values from other fields in the record to generate a value for each calculated field.

For example, a table might have non-calculated fields for Quantity and UnitPrice, and a calculated field for ExtendedPrice, which would be calculated by multiplying the values of the Quantity and UnitPrice fields.

Note

Do not change the setting of Calculated in application code. Calculated is automatically set to true by the Fields editor at design time if a field’s value is specified as calculated.


TField::CanModify

TField	Properties	See also

CanModify specifies if a field can be modified.

Syntax

__property System::Boolean CanModify;

Description

Check CanModify to determine if a field’s data can be edited. CanModify is true only if the ReadOnly property is false, and the dataset for this field component allows write access to the corresponding database field.


TField::DataSet

TField	Properties	See also

DataSet identifies the dataset to which a field component belongs.

Syntax

__property TDataSet * DataSet;

Description

Check the value of the DataSet property to determine the dataset to which the field component belongs. Applications should not directly assign the DataSet property of a field. It is assigned automatically when the field is created from a field def component.


TField::DataSize

TField	Properties	See also

DataSize is the amount of memory that is needed to store a field component’s value.

Syntax

__property System::Word DataSize;

Description

Check DataSize to determine the number of bytes required to store a field component’s value. Use DataSize when reading the field value into a buffer to ensure that the buffer is sufficiently large. The value of DataSize returned by TField depends on the DataType of the field component, and sometimes on the value of the Size property:

DataType	Value of DataSize

ftBoolean	2

ftSmallInt	2

ftWord	2

ftAutoInc	4

ftDate	4

ftInteger	4

ftTime	4

ftCurrency	8

ftDateTime	8

ftFloat	8

ftBCD	34

ftString	Size + 1(but not more than 8192 characters)

ftVarBytes	Size + 2

ftBytes	Size

ftBlob	0

ftDBaseOle	0

ftFmtMemo	0

ftGraphic	0

ftMemo	0

ftParadoxOle	0

ftTypedBinary	0

ftUnknown	0

Note

A value of zero for the DataSize property indicates that the maximum amount of memory needed to store the field’s value is undetermined.


TField::DataType

TField	Properties	See also

DataType identifies the data type of the field component.

Syntax

__property TFieldType DataType;

Description

Read the DataType property to learn the type of the data the field contains. The DataType property is equal to one of the following values:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-coded Decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large OBject field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field


TField::DisplayLabel

TField	Properties	See also

DisplayLabel contains the text for a field component to display in the column heading of a data grid.

Syntax

__property System::AnsiString DisplayLabel;

Description

Set DisplayLabel to assign column headings to a data grid. The column headings of the data grid use the DisplayName property. Setting DisplayLabel changes DisplayName from FieldName to the string specified as DisplayLabel.


TField::DisplayName

TField	Properties	See also

DisplayName returns the name of the field for display purposes.

Syntax

__property System::AnsiString DisplayName;

Description

Use DisplayName when displaying a string that represents the field to the user. For example, when raising an exception concerning the field, format an error string that includes the DisplayName to refer to the field.

If DisplayLabel is defined, DisplayName is the same as DisplayLabel. Otherwise, DisplayName is the same as the FieldName property.


TField::DisplayText

TField	Properties	See also

DisplayText is the string representation of a field’s value to display in a data-aware control.

Syntax

virtual void __fastcall GetText( System::AnsiString &Text, System::Boolean DisplayText);

Description

DisplayText is a read-only string representation of a field’s value to display in a data-aware control. If an OnGetText event handler is assigned, DisplayText is the value returned by the OnGetText event handler when the DisplayText parameter is true. Otherwise, DisplayText is the value of the AsString property.

DisplayText is the string representation of the field’s Value property when it is not being edited. When the field is being edited, use the Text property.


TField::DisplayWidth

TField	Properties	See also

DisplayWidth specifies the number of characters that should be used to display a field’s value by a cooperating data-aware control.

Syntax

__property System::Integer DisplayWidth;

Description

Set DisplayWidth to control how many characters are used to calculate the column width for the field when it is displayed by a TDBLookupListBox object or a descendant if TCustomDBGrid. The actual width of columns is determined by the average character width. If the data-aware control that displays the field is not using a fixed pitch font, DisplayWidth may indicate more or fewer characters than will fit in the column for any given string.

Note

The DisplayWidth property has no effect if there is an explicit Columns value for the field in a TDBGrid object.


TField::EditMask

TField	Properties	See also

EditMask contains the mask that is used to restrict the data that can be entered into a data field.

Syntax

__property System::AnsiString EditMask;

Description

Use EditMask to restrict the characters the user can enter to valid characters and formats. If the user attempts to enter a character that is not valid, the character is not accepted. Validation is performed on a character-by-character basis. Use an OnValidate event to validate the entire input, just before it is posted to the database.

A mask consists of three fields with semicolons separating the fields. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are included as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

      !	If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.

     >	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

     <	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

     <>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

     \	The character that follows a \ character is a literal character. Use this character when you want to allow any of the mask special characters as a literal in the data.

     L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

     l	The l character permits only an alphabetic character in this position, but doesn't require it.

     A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

     a	The a character permits an alphanumeric character in this position, but doesn't require it.

     C	The C character requires an arbitrary character in this position.

     c	The c character permits an arbitrary character in this position, but doesn't require it.

     0	The 0 character requires a numeric character only in this position.

     9	The 9 character permits a numeric character in this position, but doesn't require it.

     #	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

     :	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of :.

     /	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of /.

     ;	The ; character is used to separate the three fields of the mask.

     _	the _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters must be matched exactly when entering data for the field. They are inserted automatically, and the cursor skips over them during editing. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask should be included as part of the Value property of the field. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Value property for the field would consist of the 10 digits that were entered, rather than the 14 characters that make up the telephone number as it appears to the user.

A 0 in the second field indicates that literals should not be included, any other character indicates that they should be included. The character to indicate whether literals should be included can be changed in the EditMask property editor, or programatically by changing the MaskNoSave typed contstant.

The third field of the mask is the character that appears in the edit control for blanks (characters that have not been entered). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in an edit window. However, when a user the data for the field, the cursor selects each blank character in turn, and skips over the space character.

Setting EditMask to an empty string removes the mask.


TField::FieldKind

TField	Properties	See also

FieldKind indicates whether a field represents a column in a dataset, a calculated field, or a lookup field.

Syntax

__property TFieldKind FieldKind;

Description

Use FieldKindto determine if a field is a data field, a calculated field, or a lookup field. The value of FieldKind can be changed programmatically, but in practice FieldKind is automatically set at design time when creating Field components with the Fields editor.

The FieldKind property can take one of the following values:

Value	Description

fkData	Field represents a physical field in a database table

fkCalculated	Field is calculated

fkLookup	Field is a lookup field

Note

Fields calculated by the Borland Database Engine to display the results of a query that returns a live dataset have a FieldKind of fkData, not fkCalculated.


TField::FieldName

TField	Properties	See also

FieldName is the name of the physical column in the underlying dataset to which a field component is bound.

Syntax

__property System::AnsiString FieldName;

Description

FieldName is used by the TFieldDef object when creating a field component, to specify which field in underlying dataset the field component represents. FieldName is used when displaying references to the field to users, unless a DisplayLabel has been set. For calculated fields, supply a FieldName when defining the field. For non-calculated fields, an EDatabaseError exception occurs if a FieldName is not a column name in the physical table.


TField::FieldNo

TField	Properties	See also

FieldNo is the ordinal of the field component’s actual column in the physical table underlying a dataset.

Syntax

__property System::Integer FieldNo;

Description

Read FieldNo to learn a field component’s ordinal position in the table underlying the dataset, wher 1 is the first field. Use the FieldNo property to specify the field only in programs that make direct calls to the Borland Database Engine.

Note

Don’t confuse FieldNo, which is the field component’s ordinal position in the physical database table, with Index, the field components position in the dataset’s Fields property.


TField::Index

TField	Properties	See also

Index is the field component’s index number into the Fields property of the dataset.

Syntax

__property System::Integer Index;

Description

Use the Index property to:

•	Find the position of the field in the dataset.

•	Change the order of a field's position in the dataset by changing the value of Index. Changing the Index value affects the order in which fields are displayed in data grids, but not the position of the fields in the physical database tables.

Note

The field order can also be changed by dragging and dropping fields in the Fields editor at design time.


TField::IsIndexField

TField	Properties	See also

IsIndexField specifies whether a field is an index field.

Syntax

__property System::Boolean IsIndexField;

Description

Use the IsIndexField to determine if a field is an index field. If IsIndex is true, a field is one of the fields that makes up the index on the underlying database table. If IsIndexField is false, the field is not an index field. A field component must be an index field to serve as one of the field components for the LookupKeyFields in a lookup table.


TField::IsNull

TField	Properties	See also

IsNull determines if the field has a value assigned to it.

Syntax

__property System::Boolean IsNull;

Description

Use IsNull to determine if the field contains a value. If IsNull is true, the field doesn’t have a value. If IsNull is false, the field has a value.


TField::KeyFields

TField	Properties	See also

KeyFields identifies the field or fields in the dataset that must be matched in the lookup dataset when doing a lookup.

Syntax

__property System::AnsiString KeyFields;

Description

Set KeyFields only on lookup fields (fields where FieldKind is fkLookup and Lookup is true). KeyFields specifies the field or fields to match when a lookup occurs. To use more than one field, separate each field name with a semicolon. The specified fields must be of the same types as the corresponding fields in LookupKeyFields, or the lookup fails.

The values of the KeyFields in the DataSet are matched with the values of the LookupKeyFields in the LookupDataSet to determine a particular record of the lookup table. The value of the LookupResultField on that record becomes the Value property for the field component.


TField::Lookup

TField	Properties	See also

Lookup determines whether the field is specified as a lookup field.

Syntax

__property System::Boolean Lookup;

Description

Use Lookup to determine if a field is a lookup field.

If Lookup is false, the field is not a lookup field. If Lookup is true, the field is a lookup field and the FieldKind is ftLookup.

If the field is a lookup field, the KeyFields property indicates which fields in the dataset must match the LookupKeyFields in the LookupDataSet, to identify a record in the LookupDataSet. The value of the LookupResultField for that record becomes the Value of the field component.


TField::LookupDataSet

TField	Properties	See also

LookupDataSet identifies the dataset used to look up field values.

Syntax

__property TDataSet * LookupDataSet;

Description

Use LookupDataSet to specify the dataset to use for looking up field values in a field with a FieldKind of fkLookup.

When a field component is a lookup field, the Value of the field component is the value of the LookupResultField in the LookupDataSet. The record in the LookupDataSet that contains the correct value is found by matching the LookupKeyFields in the LookupDataSet with the current values of the KeyFields in the DataSet.


TField::LookupKeyFields

TField	Properties	See also

LookupKeyFields identifies the field or fields in the lookup dataset to match when doing a lookup.

Syntax

__property System::AnsiString LookupKeyFields;

Description

Only use LookupKeyFields on field components with a FieldKind of fkLookup. LookupKeyFields are the fields in the index of the LookupDataSet whose values must match the KeyFields in the field component’s DataSet.

To specify more than one field, separate each field name with a semicolon. The fields specified in LookupKeyFields must be of the same types as the corresponding fields in KeyFields, or the lookup can't work.

Matching the values of the LookupKeyFields in the LookupDataSet with the values of the KeyFields in the DataSet determines a specific record in the LookupDataSet. The Value of the field component is the value of the LookupResultField in the indicated record.


TField::LookupResultField

TField	Properties	See also

LookupResultField identifies the field from the lookup dataset whose value becomes the Value property of the field component.

Syntax

__property System::AnsiString LookupResultField;

Description

Use LookupResultField to specify a single field in the LookupDataSet whose value becomes the value of the field component. The field component must have a FieldKind of fkLookup, and the DataType of the field component must be the same as the data type of the LookupResultField.

When a field component is a lookup field, the Value of the field component is the value of the LookupResultField in the LookupDataSet. The record in the LookupDataSet that contains the correct value is found by matching the LookupKeyFields in the LookupDataSet with the current values of the KeyFields in the DataSet.


TField::NewValue

TField	Properties	See also

NewValue represents the current value of the field component including pending cached updates.

Syntax

__property System::Variant NewValue;

Description

Use NewValue to examine or change the current value to a field when in the process of applying cached updates. If the current field value is causing a problem, such as a key violation in an OnUpdateError event handler when applying the cached update, assign a new value of NewValue to correct the problem.

NewValue is the same as Value, except when applying cached updates. Setting NewValue in an OnUpdateError event handler or in an OnUpdateRecord event handler will cause NewValue to differ from Value until the cached updates have finished being posted to the underlying database table.


TField::OldValue

TField	Properties	See also

OldValue represents the original value of the field (as a Variant) before any pending cached updates changed it.

Syntax

__property System::Variant OldValue;

Description

Read the OldValue property to examine or retrieve the original value of the field before any cached updates have been applied. For example this code replaces current pending changes with a field’s original value:

Once cached updates are applied successfully, the old field value can not be retrieved.


TField::ReadOnly

TField	Properties	See also

ReadOnly determines whether the field can be modified.

Syntax

__property System::Boolean ReadOnly;

Description

Set ReadOnly to true to prevent a field from being modified. In a data grid, tabbing from field to field skips over ReadOnly fields.

To learn whether a field can be modified, use the CanModify property instead. CanModify reflects not only the value of the ReadOnly property, but also any restrictions imposed by the underlying dataset.


TField::Required

TField	Properties	See also

Required specifies whether a nonblank value for a field is required.

Syntax

__property System::Boolean Required;

Description

Use Required to find out if a field requires a value or if the field can be blank.

If a field is created with the Fields editor, then this property is set based on the underlying table. Applications that set Required to true for fields that must have values (for example, a password or part number), but for which the underlying table does not require the field, must write an OnValidate event handler to enforce the property.

When the Required property reflects a property of the underlying database table, trying to post a NULL value will cause an exception to be raised. Applications that set the Required property to true when the underlying table does not require the field, should raise an exception on NULL values in the OnValidate event handler in order to achieve the same result.


TField::Size

TField	Properties	See also

Size indicates the size used in the definition of the physical database field for data types that support different sizes.

Syntax

__property System::Word Size;

Description

The interpretation of Size depends on the data type. Size is the size associated with the field by the Borland DataBase Engine. The meaning of Size for different data types is given in the following table:

DataType	Meaning of Size

ftBoolean	Size is not used; its value is always 0.

ftSmallInt	Size is not used; its value is always 0.

ftWord	Size is not used; its value is always 0.

ftAutoInc	Size is not used; its value is always 0.

ftDate	Size is not used; its value is always 0.

ftInteger	Size is not used; its value is always 0.

ftTime	Size is not used; its value is always 0.

ftCurrency	Size is not used; its value is always 0.

ftDateTime	Size is not used; its value is always 0.

ftFloat	Size is not used; its value is always 0.

ftBCD	Size is the number of digits after the decimal place.

ftString	Size is the maximum number of characters in the string.

ftVarBytes	Size is the maximum number of bytes of data, not counting the first two bytes which indicate the actual number of bytes of data that were used.

ftBytes	Size is the maximum number of bytes of data.

ftBlob	Size is the number of bytes from the BLOB that are stored in the record buffer.

ftDBaseOle	Size is the number of bytes from the DBase OLE BLOB that are stored in the record buffer.

ftFmtMemo	Size is the number of bytes from the memo that are stored in the record buffer.

ftGraphic	Size is the number of bytes from the image that are stored in the record buffer.

ftMemo	Size is the number of characters from the memo that are stored in the record buffer.

ftParadoxOle	Size is the number of bytes from the Paradox OLE BLOB that are stored in the record buffer.

ftTypedBinary	Size is the number of bytes from the BLOB that are stored in the record buffer.

ftUnknown	Size is not used; its value is always 0.


TField::Text

TField	Properties

Text contains the string to display in a data-aware control when the field is in edit mode.

Syntax

virtual void __fastcall GetText( System::AnsiString &Text, System::Boolean DisplayText);

Description

Data-aware controls rely on the Text property to provide the editing format for each field. If an OnGetText event handler is assigned, Text is the value returned by the OnGetText event handler when the DisplayText parameter is false. Otherwise, Text is the value of the AsString property.

Note

Text can differ from the DisplayText property if the field should have a different string representation when the value is being edited. To implement two different string representations of a field’s value, use the OnGetText event handler.

Note

OnGetText event, DisplayText property, Value property, AsString property


TField::Value

TField	Properties	See also

Value contains the actual data in a field component.

Syntax

void __fastcall SetAlignment(Classes::TAlignment Value);

Description

Use Value to read data directly from and write data directly to a field component at run time. For example, use the Value property to affect the contents of a field that is not Visible.

Except when posting cached updates, Value is the same as the NewValue property.


TField::Visible

TField	Properties	See also

Visible determines whether the field appears in a data grid.

Syntax

__property System::Boolean Visible;

Description

To hide a field in a data grid, set Visible to false. If Visible is true, the field appears in the grid.

Note

The Visible property has no effect if the grid has an explicit Columns value for the field.


TField events

TField	Alphabetically	Legend

In TField

OnChange

OnGetText

OnSetText

OnValidate


TField events

TField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TField::OnChange

TField	Events	See also

The OnChange event occurs immediately after the data in the field is has been written to the record buffer.

Syntax

__property TFieldNotifyEvent OnChange;

Description

Write an OnChange event handler to respond to any changes in the field’s data. OnChange allows a response once the data has been successfully posted to the underlying database table.

When writing the value of a field to the current record buffer, the following steps occur:

1	The OnValidate event handler is called to validate the data.

2	If the OnValidate event handler accepts the current Value, the data is written to the record buffer.

3	If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.


TField::OnGetText

TField	Events	See also

The OnGetText event occurs whenever the DisplayText or Text properties of the field are referenced.

Syntax

__property TFieldGetTextEvent OnGetText;

Description

Write an OnGetText handler to perform custom processing for the DisplayText and Text properties. Use OnGetText to format the Value of the field differently when it must be edited from the format used when simply displaying the value, or use OnGetText to display something other than the field’s value when it is displayed.

The Sender parameter is self, the field component. The Text parameter receives the formatted text that is used by the DisplayText or Text property. The DisplayText parameter indicates whether the text will be used for display purposes only, or whether the string will be used for editing purposes.

If there is no OnGetText handler, the value of the DisplayText and Text properties is simply the value of the AsString property.


TField::OnSetText

TField	Events	See also

The OnSetText occurs whenever the Text property is assigned a value.

Syntax

__property TFieldSetTextEvent OnSetText;

Description

Write an OnSetText event handler to specify processing that occurs whenever Text receives a new value. If there is an OnGetText event handler that formats the Value of the field in some special way for editing purposes, OnSetText should reverse the process when parsing the edited string.

If there is no OnSetText handler, the Text property will be set by setting the AsString property.


TField::OnValidate

TField	Events	See also

The OnValidate event occurs just before the data is written to the record buffer.

Syntax

__property TFieldNotifyEvent OnValidate;

Description

Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer. The EditMask property allows validation of the data on a character by character basis while it is being entered by the user. OnValidate allows an application to validate the data as a whole.

When the value of a field component is assigned programatically, validation by the EditMask is bypassed, since there is no data-aware control to enforce adherence to the mask. OnValidate allows an application to validate such data before it is posted to the database table.

To reject the current value of the field from the OnValidate event handler, raise an exception.

When writing the value of a field to the current record buffer, the following steps occur:

1	The OnValidate event handler is called to validate the data.

2	If the OnValidate event handler does not raise an exception, the data is written to the current record buffer.

3	If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.


TField methods

TField	Alphabetically

In TField

~TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

TField

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TField methods

TField	By object

~TField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TField


TField::Assign

TField	Methods	See also

Assign assigns the Value property of one field to another or assigns another object to the field component.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Use Assign to copy the Value property from one field to another. The fields must have compatible data types.

When Source is another field object, Assign calls the AssignValue method, using the Source field’s Value property. Calling Assign with the Source parameter set to NULL assigns a blank value to the field component. Calling Assign with any other object type calls the inherited method, which allows assignment from objects that implement a TField object in their AssignTo method.


TField::AssignValue

TField	Methods	See also

AssignValue sets the field to Value using one of the AsInteger, AsBoolean, AsString or AsFloat properties, depending on the type of Value.

Syntax

void __fastcall AssignValue(const System::TVarRec &Value);

Description

Use AssignValue to assign a value to a field using the As... conversion properties. The property used depends on the type of the Value parameter:

Value	As... property used

vtInteger	AsInteger

vtBoolean	AsBoolean

vtChar	AsString

vtExtended	AsFloat

vtString	AsString

vtPChar	AsString

vtAnsiString	AsString

vtCurrency	AsCurrency

vtVariant	AsVariant

If Value is not one of the types in the table, but is of type TObject or a TObject descendant, AssignValue uses the Assign method to assign the value to the field.


TField::Clear

TField	Methods	See also

Clear sets the value of the field to NULL.

Syntax

virtual void __fastcall Clear(void);

Description

Call the Clear method to give the field a blank value.


TField::FocusControl

TField	Methods	See also

FocusControl enables a field component to force a form’s focus to the first data-aware component associated with the field component.

Syntax

void __fastcall FocusControl(void);

Description

Call FocusControl to switch the focus of the form to a data-aware control associated with the field. Because it’s possible that the field’s value can change even if its associated data-aware control doesn’t have the focus, calling FocusControl can aid in drawing attention to the new value when it fails to be validated.


TField::GetData

TField	Methods	See also

GetData returns the unformatted data from the field.

Syntax

System::Boolean __fastcall GetData(System::Pointer Buffer);

Description

Call GetData to return the unformatted, untranslated, and uninterpreted data in a field to a buffer.

Unlike the DisplayText, Text, or As.. properties, GetData performs no translation or interpretation of the data. Buffer must have sufficient space allocated for the data. Use the DataSize property to determine the space required. If the data is NULL, GetData returns false and no data is transferred to Buffer. Otherwise, GetData returns true.

Note

GetData cannot be used to read data from BLOB fields.


TField::IsValidChar

TField	Methods	See also

IsValidChar determines if a particular character entered in the field is valid for the field.

Syntax

virtual System::Boolean __fastcall IsValidChar(System::Char InputChar);

Description

The IsValidChar method for TField always returns true, indicating that the character is valid for the field. Derived classes may override IsValidChar to restrict input to characters that are supported by the DataType. For example, integer fields override IsValidChar to restrict input to digits and the + and - characters.


TField::SetData

TField	Methods	See also

SetData assigns unformatted data to the field.

Syntax

void __fastcall SetData(System::Pointer Buffer);

Description

Use SetData to assign data to a field in the format that is used by the underlying database table. Ultimately, any method of setting the data for the field component calls SetData, once the data has been parsed into the physical format expected by the database table.

SetData calls the OnValidate event handler before writing the data to the current record buffer. If the data is successfully written, SetData calls the OnChange event handler.

Note

SetData should not be used by descendents of TField that implement BLOB field types.


TField::SetFieldType

TField	Methods	See also

SetFieldType provides the interface for a method that can set the DataType for the field.

Syntax

virtual void __fastcall SetFieldType(TFieldType Value);

Description

SetFieldType does nothing other than provide an interface for derived classes to override to implement a method that sets the DataType for the field component. SetFieldType is useful for derived classes that can support more than one underlying data type. For example, a TBlobField may support ftBlob, ftFmtMemo, ftParadoxOle, ftDBaseOle, or ftTypedBinary.


TField::TField

TField	Methods	See also

TField creates a new TField object.

Syntax

__fastcall virtual TField(Classes::TComponent *AOwner);

Description

Use TField to create a new TField object.


TField::~TField

TField	Methods	See also

~TField frees the memory associated with the TField object.

Syntax

__fastcall virtual ~TField(void);

Description

Do not call ~TField directly. Instead, use the delete keyword on the object, which causes ~TField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TField example

TField


TFieldDef

Hierarchy	Properties	Methods	See also

The TFieldDef object is a field definition that corresponds to a physical field of a record in a table underlying a dataset.

Header

vcl/db.hpp

Description

A field definition is automatically created for each field in a dataset. A field definition has a corresponding TField object, but not all TField objects have a corresponding field definition object. For example, calculated fields do not have field definition objects.

There are two primary reasons for working with TFieldDef objects:

•	To obtain information about field types in a table without opening the table.

•	To create a new table from scratch.

Each field definition is held in the Items property of a TFieldDefs object, which contains all the field definitions for a dataset.

Use the properties and methods of TFieldDef determine the characteristics of the physical field it corresponds to in dataset.

The TFieldDef object is a direct descendent of TObject, and therefore has all methods that apply to all objects.


TFieldDef properties

TFieldDef	Alphabetically	Legend

In TFieldDef

BDECalcField

DataType

FieldClass

FieldNo

Name

Required

Size


TFieldDef properties

TFieldDef	By object	Legend

BDECalcField

DataType

FieldClass

FieldNo

Name

Required

Size


TFieldDef::BDECalcField

TFieldDef	Properties	See also

BDECalcField determines if the field is a field whose value is calculated by the Borland Database Engine.

Syntax

__property System::Boolean BDECalcField;

Description

Read BDECalcField to find out if the field is a BDE calculated field. BDE calculated fields are calculated by the Borland Database Engine in a live query view. If the field is a BDE calculated field, BDECalcField returns true; otherwise it returns false.

For example, in the following SQL statement, the dataset includes a field for the calculated value ONHAND * COST.

When the TQuery object has its RequestLive property set to true, the field definition for that calculated value will have BDECalcField set to true.

When BDECalcField is true, the field value can be edited, but the changes are discarded. To prevent editing, set ReadOnly for the field to true.

BDECalcField is a read-only property.


TFieldDef::DataType

TFieldDef	Properties	See also

DataType determines the type of a physical field.

Syntax

__fastcall TFieldDef(TFieldDefs *Owner, const System::AnsiString Name, TFieldType DataType, System::Word

Description

Use DataType to find out what type of data the field contains. These are the possible values:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-coded decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large OBject field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field

DataType is a read-only property.


TFieldDef::FieldClass

TFieldDef	Properties	See also

FieldClass determines the class of the field object that corresponds to this field definition object.

Syntax

__property System::TMetaClass * FieldClass;

Description

Use FieldClass to find out the class of field object this field definition object corresponds to. The FieldClass is determined by the DataType of the field. For example, if the DataType is ftString, the FieldClass is TStringField.

The field object created from the field definition by the CreateField method is an instance of the FieldClass.

FieldClass is a read-only property.


TFieldDef::FieldNo

TFieldDef	Properties	See also

FieldNo identifies the physical field number used by the Borland Database Engine to reference the field.

Syntax

Size, System::Boolean Required, System::Integer FieldNo);

Description

Use FieldNo to find out where the physical field the field definition references is in the set of fields in the table. For example, if the value of FieldNo is 2, then the field is the second field in the table.

FieldNo is a read-only property.


TFieldDef::Name

TFieldDef	Properties	See also

Name is the name of the physical field within the underlying table.

Syntax

__fastcall TFieldDef(TFieldDefs *Owner, const System::AnsiString Name, TFieldType DataType, System::Word

Description

Use the Name to determine the name of the physical field in the table.

Name is a read-only property.


TFieldDef::Required

TFieldDef	Properties	See also

Required reports whether a value for a physical field in an underlying table is required.

Syntax

Size, System::Boolean Required, System::Integer FieldNo);

Description

Use Required to find out if a field in a table must have a value. If Required is true, the field must have a value. If Required is false, the field can be left blank.

Required is a read-only property.


TFieldDef::Size

TFieldDef	Properties	See also

Size reports the size associated with the field in the physical database table.

Syntax

Size, System::Boolean Required, System::Integer FieldNo);

Description

Use Size to determine the size associated with the corresponding physical field.

Size is meaningful only for a field definition object with one of the following TFieldType values: ftString, ftBCD, ftBytes, ftVarBytes, ftBlob, ftMemo or ftGraphic. For string and byte fields, Size is the number of bytes reserved in the table for the field. For a BCD field, Size is the number of digits following the decimal point. For a BLOB, memo, or graphic field, Size is the number of bytes from the field’s value that are stored in the actual database table.

Size is a read-only property.


TFieldDef methods

TFieldDef	Alphabetically

In TFieldDef

~TFieldDef

CreateField

TFieldDef

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldDef methods

TFieldDef	By object

~TFieldDef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateField

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFieldDef


TFieldDef::CreateField

TFieldDef	Methods	See also

CreateField creates a TField component of the appropriate type that matches the specifications of the TFieldDef object.

Syntax

TField *__fastcall CreateField(Classes::TComponent *Owner);

Description

A dataset object calls CreateField to create the field components from the field definitions objects. Applications need never call CreateField directly.


TFieldDef::TFieldDef

TFieldDef	Methods	See also

TFieldDef creates a new TFieldDef object.

Syntax

__fastcall TFieldDef(TFieldDefs *Owner, const System::AnsiString Name, TFieldType DataType, System::Word

Description

Use TFieldDef to create a new TFieldDef object.


TFieldDef::~TFieldDef

TFieldDef	Methods	See also

~TFieldDef frees the memory associated with the TFieldDef object.

Syntax

__fastcall virtual ~TFieldDef(void);

Description

Do not call ~TFieldDef directly. Instead, use the delete keyword on the object, which causes ~TFieldDef to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TFieldDef example

TFieldDef


TFieldDefs

Hierarchy	Properties	Methods	See also

A TFieldDefs object holds the field definition (TFieldDef) objects that represent the physical fields underlying a dataset.

Header

vcl/db.hpp

Description

TFieldDefs is used by a data set to manage the field definitions it uses to create field objects that correspond to fields in the database table. TTable objects also use TFieldDefs when creating a new database table.

Use the properties and methods of TFieldDefs to:

•	Access a specific field definition.

•	Add or delete field definitions from the list.

•	Find out how many fields are defined.

•	Copy a set of field definitions to another table.


TFieldDefs properties

TFieldDefs	Alphabetically	Legend

In TFieldDefs

Count

Items


TFieldDefs properties

TFieldDefs	By object	Legend

Count

Items


TFieldDefs::Count

TFieldDefs	Properties	See also

Count specifies the total number of TFieldDef objects owned by this TFieldDefs object.

Syntax

__property System::Integer Count;

Description

Use the Count property to determine how many field definitions contained in this TFieldDefs object. For example, use Count to iterate through all the field definitions in the Items array.

Count is a read-only property. The value of Count is changed indirectly when adding or deleting field definitions.


TFieldDefs::Items

TFieldDefs	Properties	See also

Items is an array of pointers to the field definitions that describe each physical field in the dataset.

Syntax

__property TFieldDef * Items[System::Integer Index];

Description

Use Items to access a particular field definition. Specify the field definition to access with the Index parameter. Index is an integer identifying the field definition’s position in the list of field definitions, in the range 0 to Count - 1.

Items is a read-only property. The value of Items is changed indirectly when adding or deleting field definitions.


TFieldDefs methods

TFieldDefs	Alphabetically

In TFieldDefs

~TFieldDefs

Add

AddFieldDesc

Assign

Clear

Find

IndexOf

TFieldDefs

Update

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldDefs methods

TFieldDefs	By object

~TFieldDefs

AddFieldDesc

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

Find

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFieldDefs

Update


TFieldDefs::Add

TFieldDefs	Methods	See also

Add creates a new field definition object and adds it to the Items property of this TFieldDefs object.

Syntax

void __fastcall Add(const System::AnsiString Name, TFieldType DataType, System::Word Size, System::Boolean

Description

Use Add only when creating a new table, as the Items property array is filled automatically when a dataset is opened.

Add uses the values passed in the Name, DataType, Size, and Required parameters and assigns them to the respective properties of the new field definition object.

If field definition with same name already exists, an EDatabaseError exception is raised.


TFieldDefs::AddFieldDesc

TFieldDefs	Methods	See also

AddFieldDesc creates a new field definition object and adds it to the Items property array for this TFieldDefs object.

Syntax

void __fastcall AddFieldDesc(const Bde::FLDDesc &FieldDesc, System::Boolean Required, System::Word

Description

Applications should not need to use this method. It is used by the dataset to fill the Items property array when the database table is opened.

To change the Items array in response to changes in the dataset, use the Update method instead.

AddFieldDesc uses the information provided by the Borland Database Engine for the FieldDesc parameter.


TFieldDefs::Assign

TFieldDefs	Methods	See also

Assign copies a set of field definition objects to the Items property array from another TFieldDefs object.

Syntax

void __fastcall Assign(TFieldDefs *FieldDefs);

Description

Use Assign to copy one TFieldDefs object to another. The field definitions are copied to the Items property array. Specify the TFieldDefs object as the value of the FieldDefs parameter.

If Items previously had pointers to field definitions, these pointers are freed before Items is refilled.


TFieldDefs::Clear

TFieldDefs	Methods	See also

Clear frees all of the entries in the Items property.

Syntax

void __fastcall Clear(void);

Description

Call Clear to remove all the field definition objects from this TFieldDefs object.


TFieldDefs::Find

TFieldDefs	Methods	See also

Find locates a field definition in the Items array from the name of the field.

Syntax

TFieldDef *__fastcall Find(const System::AnsiString Name);

Description

Call Find to obtain information about a particular field definition. Specify the name of the field as the value of the Name parameter.


TFieldDefs::IndexOf

TFieldDefs	Methods	See also

IndexOf finds the index number of a field definition in the Items array from the name of the field.

Syntax

System::Integer __fastcall IndexOf(const System::AnsiString Name);

Description

Use the IndexOf method to locate the position of a field definition in the Items property array. IndexOf returns a value from zero (the first position) to Count - 1. Specify the name of the field as the value of the Name parameter.


TFieldDefs::Update

TFieldDefs	Methods	See also

Update refreshes the field definitions in the Items property array to reflect the current state of the physical fields underlying the dataset.

Syntax

void __fastcall Update(void);

Description

Call Update to refresh the field definitions when the structure of the underlying dataset may have changed. Update updates the field definitions without opening the dataset.


TFieldDefs::TFieldDefs

TFieldDefs	Methods	See also

TFieldDefs creates a new TFieldDefs object.

Syntax

__fastcall TFieldDefs(TDataSet *DataSet);

Description

Use TFieldDefs to create a new TFieldDefs object.


TFieldDefs::~TFieldDefs

TFieldDefs	Methods	See also

~TFieldDefs frees the memory associated with the TFieldDefs object.

Syntax

__fastcall virtual ~TFieldDefs(void);

Description

Do not call ~TFieldDefs directly. Instead, use the delete keyword on the object, which causes ~TFieldDefs to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TFieldDefs example

TFieldDefs


TFileListBox

Hierarchy	Properties	Methods	Events	See also

TFileListBox is a specialized list box that lists all the files in the current directory.

Header

vcl/filectrl.hpp

Overview

To display files in a different directory, change the value of the Directory property.

You can have icons next to the filenames to help identify the type of file. For example, an executable file displays a different icon than a word processing document. To make the icons appear, set ShowGlyphs to true.

You decide which file types you want to appear in the list box using the Mask property, which displays only the files that match the Mask string. For example, you can choose to display only executable files and source RefSyn files.

You can also decide which files display in the file list box by their file attributes. For example, you can choose to display hidden and system files as well as regular files, or you can choose to see read-only files only. Use the FileType property to select the file types according to their file attributes.

You can have the file selected in the file list box appear as the text of an edit box if you specify a value for the FileEdit property.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for you own list box object.

Related objects

Specialized list boxes have the basic functionality of TListBox, but can also be linked to file, directory, drive or database information. Use these list boxes if you want to easily access and list this type of information.

A combo box is a list box with an edit control and an optional drop down style for the list. Use a combo box when you want to allow users to type their selection into an edit box or to save space on a form by having the list drop down.

For lists of items that require a matrix or expandable tree-like structure use outlines, list views or tree views. These controls allow you to group items under column headings or in expandable and contractable rows.


TFileListBox properties

TFileListBox	Alphabetically	Legend

In TFileListBox

Directory

Drive

FileEdit

FileName

FileType

Mask

ShowGlyphs

Derived from TCustomListBox

Canvas

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TFileListBox properties

TFileListBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

Directory

DragCursor

DragMode

Drive

Enabled

ExtendedSelect

FileEdit

FileName

FileType

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

Mask

MultiSelect

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelCount

Selected

ShowGlyphs

ShowHint

Showing

TabOrder

TabStop

Tag

TopIndex

Top

Visible

Width


TFileListBox::Directory

TFileListBox	Properties	See also

Determines the current directory for the file list box and directory list box components.

Syntax

__property System::AnsiString Directory;

The file list box displays the files in the directory specified in the Directory property. The directory list box displays the value of the Directory property as the current directory in the list box.

Examine the example to see how a directory list box and a file list box can work together through their Directory properties.

Example

If you have a file list box and a directory list box on a form, this RefSyn changes the current directory in the directory list box and displays the files in that directory in the file list box when the user changes directories using the directory list box:


TFileListBox::Drive

TFileListBox	Properties	See also

Determines which drive the list box displayed the files on.

Syntax

__property System::Char Drive;

When the value of Drive changes, the Directory value also changes to the current directory on the specified drive.

Example

The following example assumes that a drive combo box, a file list box, and a directory list box are on a form. This RefSyn changes the drive displayed in the drive combo box, displays the current directory of the selected drive in the directory list box, and displays the files in the current directory of the selected drive in the file list box when the user selects a drive in the drive combo box:


TFileListBox::FileEdit

TFileListBox	Properties	See also

Provides a simple way to display a file selected in a file list box as the text of an edit box, as is commonly done in Open and Save dialog boxes.

Syntax

__property Stdctrls::TEdit * FileEdit;

If no file is selected in the file list box, the text of the edit box is the current value of the file list box’s Mask property.

Specify the edit box you want the mask or selected file to appear in as the value of the FileEdit property.

Example

This example uses a button, an edit box, a label, a drive combo box, a directory list box, a file list box, and a filter combo box on a form. When the user clicks the button, the rest of the controls of the form begin working together like the controls in an Open or Save dialog box.


TFileListBox::FileName

TFileListBox	Properties	See also

The FileName property contains the name of the selected file in the list box, including the path name.

Syntax

__property System::AnsiString FileName;

Example

This example uses a file list box and a label on a form. When the user selects a file in the file list box, the name of the file appears as the caption of the label.


TFileListBox::FileType

TFileListBox	Properties	See also

Determines which files are displayed in the file list box based on the attributes of the files.

Syntax

__property TFileType FileType;

Because FileType is of type TFileType, which is a set of file attributes, FileType can contain multiple values. For example, if the value of FileType is a set containing the values ftReadOnly and ftHidden, only files that have the read-only and hidden attributes are displayed in the list box. These are the values that can occur in the FileType property:

Value	Meaning

ftReadOnly	When ftReadOnly is true, the list box can display files with the read-only attribute.

ftHidden	When ftHidden is true, the list box can display files with the hidden attribute.

ftSystem	When ftSystem is true, the list box can display files with the system attribute.

ftVolumeID	When ftVolumeID is true, the list box can display the volume name.

ftDirectory	When ftDirectory is true, the list box can display directories.

ftArchive	When ftArchive is true, the list box can display files with archive attribute.

ftNormal	When ftNormal is true, the list box can display files with no attributes.

If you use the Object Inspector to change the value of FileType, click the FileType property to see the attribute values. Then you can set each value to true or false, which builds the FileType set.

Example

This example uses a file list box on a form. When the application runs, only read-only files, directories, volume IDs, and files with no attributes appear in the list box.


TFileListBox::Mask

TFileListBox	Properties

Determines which files are displayed in the file list box.

Syntax

__property System::AnsiString Mask;

A file mask or file filter is a filename that usually includes wildcard characters (*.PAS, for example). Only files that match the mask are displayed in list box. The file mask *.* displays all files, which is the default value.

You can specify multiple file masks. Separate the file mask specifications with semicolons. For example, *.PAS; *.EXE.

Example

This example uses a file list box on a form. When the application runs, the list box displays only files with a .PAS file extension:

See also

Filter property


ShowGlyph

Determines whether glyphs (bitmaps) appear next to the file names listed in the file list box.

If ShowGlyphs is true, the glyphs appear; if ShowGlyphs is false, the glyphs don’t appear. The default value is false.

Example

If the files in the list box don’t have the glyphs next to them, this line of RefSyn redisplays the files with the glyphs included:


TFileListBox events

TFileListBox	Alphabetically	Legend

In TFileListBox

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TFileListBox events

TFileListBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TFileListBox::OnChange

TFileListBox	Events

Specifies which event handler should execute when the contents of a component or object changes.

Syntax

__property Classes::TNotifyEvent OnChange;

For components, OnChange occurs when the main value or values of the component are modified. For example, OnChange occurs when the Text property of an edit box is modified.


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TFileListBox methods

TFileListBox	Alphabetically

In TFileListBox

~TFileListBox

ApplyFilePath

TFileListBox

Update

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFileListBox methods

TFileListBox	By object

~TFileListBox

ApplyFilePath

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TFileListBox

UpdateControlState

Update


TFileListBox::ApplyFilePath

TFileListBox	Methods	See also

ApplyFileEditText is intended to be used in a dialog box that approximates the utility and behavior of an Open dialog box.

Syntax

virtual void __fastcall ApplyFilePath(const System::AnsiString EditText);

Such a dialog box would contain a file list box (TFileListBox), a directory list box (TDirectoryListBox), a drive combo box (TDriveComboBox), a filter combo box TFilterComboBox, a label, and an edit box where the user can type a filename including a full directory path. When the user then chooses the OK button, you would like all the controls to update with the information the user entered in the edit box. For example, you would want the directory list box to change to the directory specified in the path the user typed, and you want the drive combo box to change to the correct drive if the path included a different drive letter.

If the file list box, directory list box, drive combo box, filter combo box, label, and edit box are connected using the FileEdit, FileList, DirLabel, and DirList properties, your application can call ApplyFilePath to update the controls with the text the user entered in the edit box.

The user can enter any of these strings in the edit box: a filename, with or without a path, a drive only, a drive and directory only, relative paths, or a file mask using wildcard characters. In all cases, the ApplyFilePath method updates the controls as you would expect. For example, if the user includes a directory name, the directory list box makes that directory the current one.

The EditText parameter is the text within the edit box.

Example

This example uses a file list box, a directory list box, a filter combo box, a drive combo box, a label, an edit box, and a button on a form. When the user runs the application and enters a path or filename in the edit box, all the controls update:


TFileListBox::Update

TFileListBox	Methods

Updates and refreshes the directory list for the file list box control.

Syntax

void __fastcall Update(void);


TFileListBox::TFileListBox

TFileListBox	Methods	See also

TFileListBox creates a new TFileListBox object.

Syntax

__fastcall virtual TFileListBox(Classes::TComponent *AOwner);

Description

Use TFileListBox to create a new TFileListBox object.


TFileListBox::~TFileListBox

TFileListBox	Methods	See also

~TFileListBox frees the memory associated with the TFileListBox object.

Syntax

__fastcall virtual ~TFileListBox(void);

Description

Do not call ~TFileListBox directly. Instead, use the delete keyword on the object, which causes ~TFileListBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TFileListBox example

TFileListBox


TFiler

Hierarchy	Properties	Methods	See also

TFiler is the abstract base class for reader and writer objects that are used for streaming components and their properties in forms and inherited forms.

Header

vcl/classes.hpp

Description

TFiler is an object that works inherently with stream and component objects. It defines the internal mechanics of the streaming system in Borland C++ Builder for reading or writing data associated with components to a stream object. TReader and TWriter implement, for their own purposes, what the filer defines.

A filer type is used as a parameter to component methods requiring either a read or writer object, depending upon whether the data is read from or written to a stream. Every filer has an associated stream object that is passed as a parameter to its constructor. It is these associated stream objects that are usually responsible for creating filer descendent objects.

TFiler properties provide support for managing the streaming of owned components. Filer objects are used to read and write the properties of component objects to and from a stream as data. Filer objects provide buffering of data to speed read and write operations.

TFiler introduces abstract methods that are customized by its descendent reader and writer objects. These include methods for defining properties that enable an object to store hidden or complex data as if they were actual properties of the object. These methods inherently interact with those of the component and stream objects.

Note

Most of the filer properties and methods have public visiblity for convenience within the Borland C++ Builder streaming system. The majority of them are never called directly by the user in an application.


TFiler properties

TFiler	Alphabetically

In TFiler

Ancestor

IgnoreChildren

Root


TFiler properties

TFiler	By object

Ancestor

IgnoreChildren

Root


TFiler::Ancestor

TFiler	Properties	See also

Ancestor is used when writing components in inherited forms to determine whether to write the properties of the inherited components.

Syntax

__property TPersistent * Ancestor;

Description

Do not call Ancestor directly. It is used internally by the methods of writer objects to write components in inherited forms.

Since the writer object only needs to write the values of properties that differ from those inherited, it tracks each inherited component in Ancestor and compares properties before writing. If Ancestor is NULL, there is no corresponding inherited component, and the writer object writes the component out to the stream completely.

Ancestor is always NULL, except during calls to WriteDescendent and WriteDescendentRes, since these methods are called for descendent objects that have an Ancestor object.

In general the Ancestor of a component will be NULL except when writing forms created with Visual From Inheritance. Borland C++ Builder uses WriteDescendentRes to write such forms to the stream.

When writing or overriding a DefineProperties method, be aware that Ancestor might be set, and it might be necessary to write or not write properties, as appropriate. Normally, DefineProperty read procedures are oblivious to the Ancestor.


TFiler::IgnoreChildren

TFiler	Properties	See also

IgnoreChildren enables a writer object to save a component without saving the components it owns.

Syntax

__property System::Boolean IgnoreChildren;

Description

Users rarely call IgnoreChildren directly. It is used internally to specify whether or not to write owned components when streaming the component. A few components will change Root while streaming, but this is rare.

If IgnoreChildren is true, the writer writes a component without writing any child components it owns. If IgnoreChildren is false, the writer object writes all owned objects to the stream.


TFiler::Root

TFiler	Properties	See also

Root indicates to the filer object which object is the root, or ultimate owner, of the objects read or written by the filer.

Syntax

__property TComponent * Root;

Description

Do not call Root directly. It is used internally to find the root object when streaming owned components. Root represents the ultimate owner of all the components being streamed during the current streaming process.

The ReadRootComponent and WriteRootComponent methods set Root before reading or writing their components and owned components.


TFiler methods

TFiler	Alphabetically

In TFiler

~TFiler

DefineBinaryProperty

DefineProperty

FlushBuffer

TFiler

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFiler methods

TFiler	By object

~TFiler

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineBinaryProperty

DefineProperty

Dispatch

FieldAddress

FlushBuffer

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFiler


TFiler::DefineBinaryProperty

TFiler	Methods	See also

TFiler introduces DefineBinaryProperty as an abstract method.

Syntax

virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, TStreamProc ReadData, TStreamProc

Description

Each descendant filer object declares a DefineBinaryProperty method that defines the binary data that the descendent object reades or writes as if the data were a property.


TFiler::DefineProperty

TFiler	Methods	See also

TFiler introduces DefineProperty as an abstract method.

Syntax

virtual void __fastcall DefineProperty(const System::AnsiString Name, TReaderProc ReadData, TWriterProc

Description

Each descendant filer object declares a DefineProperty method that defines the data that the descendent object will read or write as if the data were a property.


TFiler::FlushBuffer

TFiler	Methods

TFiler introduces FlushBuffer as an abstract method.

Syntax

virtual void __fastcall FlushBuffer(void);

Description

Each descendant filer object defines a FlushBuffer method to provide practical implementations for synchronizing the filer object’s buffer with the the associated stream.


TFiler::TFiler

TFiler	Methods	See also

TFiler creates a new TFiler object.

Syntax

__fastcall TFiler(TStream *Stream, System::Integer BufSize);

Description

Use TFiler to create a new TFiler object.


TFiler::~TFiler

TFiler	Methods	See also

~TFiler frees the memory associated with the TFiler object.

Syntax

__fastcall virtual ~TFiler(void);

Description

Do not call ~TFiler directly. Instead, use the delete keyword on the object, which causes ~TFiler to be invoked automatically.


Hierarchy

TObject


TFiler example

TFiler


TFileStream

Hierarchy	Properties	Methods	See also

The TFileStream object is a stream object that enables applications to read from and write to a file on disk.

Header

vcl/classes.hpp

Description

Use TFileStream to access the information in disk files. TFileStream will open a named file and provide methods to read from or write to it. If an application already has a handle to the file, opened in the appropriate mode, use THandleStream instead.


TFileStream properties

TFileStream	Alphabetically	Legend

Derived from THandleStream

Handle

Derived from TStream

Position

Size


TFileStream properties

TFileStream	By object	Legend

Handle

Position

Size


TFileStream methods

TFileStream	Alphabetically

In TFileStream

~TFileStream

TFileStream

Derived from THandleStream

Read

Seek

Write

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFileStream methods

TFileStream	By object

~TFileStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

TFileStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TFileStream::TFileStream

TFileStream	Methods	See also

TFileStream creates a new TFileStream object.

Syntax

__fastcall TFileStream(const System::AnsiString FileName, System::Word Mode);

Description

Use TFileStream to create a new TFileStream object.


TFileStream::~TFileStream

TFileStream	Methods	See also

~TFileStream frees the memory associated with the TFileStream object.

Syntax

__fastcall virtual ~TFileStream(void);

Description

Do not call ~TFileStream directly. Instead, use the delete keyword on the object, which causes ~TFileStream to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TStream

THandleStream


TFileStream example

TFileStream


TFindDialog

Hierarchy	Properties	Methods	Events

The TFindDialog component is an indirect descendent of TComponent. It provides a Find dialog box to your application. Users can use the Find dialog box to search for text in a file.

Header

vcl/dialogs.hpp

Description

Display the Find dialog box by calling the Execute method.

The text your application is searching for is the value of the FindText property.

To determine which search options are available in the Find dialog box, use the Options property. For example, you can have a Match Case check box appear in the dialog box or hide it, and you can disable or enable the Whole Word check box.

When the user enters the text to search for in the dialog box and chooses Find Next, the OnFind event occurs. Within the OnFind event handler, write the code that searches for the text specified as the value of FindText. Your code should use the Options values to determine how the user wants the search conducted.


TFindDialog properties

TFindDialog	Alphabetically	Legend

In TFindDialog

FindText

Handle

Left

Options

Position

Top

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TFindDialog properties

TFindDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

FindText

Handle

HelpContext

Left

Name

Options

Owner

Position

Tag

Top


TFindDialog::FindText

TFindDialog	Properties

Contains the search string.

Syntax

__property System::AnsiString FindText;

Description


TFindDialog::Handle

TFindDialog	Properties

Provides access to the window handle of the Find dialog box, incase you need to call a Windows API function that requires a handle.

Syntax

__property System::Integer Handle;

Description


TFindDialog::Options

TFindDialog	Properties

Determines how the Find dialog box appears and behaves.

Syntax

__property TFindOptions Options;

Description

These are the possible values that can be contained in the Options set:

Value	Meaning

frDisableMatchCase	When true, the Match Case check box is dimmed and users cannot check it. When it is false, users can check the Match Case check box.

frDisableUpDown	When true, the Direction Up and Down buttons are dimmed and the user cannot select either of them. When it is false, users can select one of the Direction Up and Down buttons. Only affects the Find dialog box.

frDisableWholeWord	When true, the Match Whole Word check box is dimmed and user cannot select it. When it is false, users can check the check box.

frDown	When true, the Down button is selected in the dialog box and the search direction is down. When frDown is false, the Up button is selected, and the search direction is up. frDown can be set a design time, or users can change its value at run time when they use the dialog box.

frFindNext	This is a flag that is set when the user chooses the Find Next button. When frFindNext is true, your application should search for the string in the FindText property.

frHideMatchCase	When true, the Match Case check box is not visible in the dialog box. When it is false, the Match Case check box is visible.

frHideWholeWord	When true, the Match Whole Word check box is not visible in the dialog box. When it is false, the Match Whole Word check box is visible.

frHideUpDown	When true, the Direction Up and Down buttons are not visible in the dialog box. When it is false, the Direction Up and Down buttons are visible. Only affects the Find dialog box.

frMatchCase	When true, the Match Case check box is checked. When it is false, the Match Case check box is unchecked. You can set frMatchCase at design time, or users can change the value at run time.

frReplace	frReplace is a flag set by the system that indicates your application should replace the current occurrence of the FindText string with the ReplaceText string. frReplace applies only to the Replace dialog box.

frReplaceAll	frReplaceAll is a flag set by the system that indicates your application should replace all occurrences of the FindText string with the ReplaceText string.

frReplace	All applies only to the Replace dialog box.

frShowHelp	When true, a Help button appears in the dialog box when the dialog box displays. When frShowHelp is false, no Help button is present.


TFindDialog::Position

TFindDialog	Properties

Determines where the Find dialog box appears onscreen.

Syntax

__property Windows::TPoint Position;

Description


TFindDialog::Top

TFindDialog	Properties

Determines the Y coordinate of the top left corner in pixels of the Find dialog box, relative to the form.

Syntax

__property System::Integer Top;

Description


TFindDialog events

TFindDialog	Alphabetically	Legend

In TFindDialog

OnFind


TFindDialog events

TFindDialog	By object	Legend

OnFind


TFindDialog::OnFind

TFindDialog	Events

Syntax

__property Classes::TNotifyEvent OnFind;

Description


TFindDialog methods

TFindDialog	Alphabetically

In TFindDialog

~TFindDialog

CloseDialog

Execute

TFindDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFindDialog methods

TFindDialog	By object

~TFindDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDialog

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TFindDialog


TFindDialog::CloseDialog

TFindDialog	Methods

Closes the Find dialog box.

Syntax

void __fastcall CloseDialog(void);

Description


TFindDialog::Execute

TFindDialog	Methods

Displays the Find dialog box.

Syntax

System::Boolean __fastcall Execute(void);

Description


TFindDialog::TFindDialog

TFindDialog	Methods	See also

TFindDialog creates a new TFindDialog object.

Syntax

__fastcall virtual TFindDialog(Classes::TComponent *AOwner);

Description

Use TFindDialog to create a new TFindDialog object.


TFindDialog::~TFindDialog

TFindDialog	Methods	See also

~TFindDialog frees the memory associated with the TFindDialog object.

Syntax

__fastcall virtual ~TFindDialog(void);

Description

Do not call ~TFindDialog directly. Instead, use the delete keyword on the object, which causes ~TFindDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TFindDialog example

TFindDialog


TFieldDataLink

Hierarchy	Properties	Methods	Events	See also

TFieldDataLink is a helper object that helps a data-aware window control manage its link to a TField object and respond to data events.

Header

vcl/dbtables.hpp

Description

Use TFieldDataLink  as a member in any data-aware object that needs to link to a TField object and  respond to data events or track database information. The data-aware object must be a descendent of  TWinControl.

The constructor of the data-aware object should call the constructor of the TFieldDataLink member, and initialize any relevant event-handlers. The data-aware object can then link to a TField object by using the FieldName property of the TFieldDataLink and can link to a dataset by using the DataSource property of the TFieldDataLink.


TFieldDataLink properties

TFieldDataLink	Alphabetically	Legend

In TFieldDataLink

CanModify

Control

Editing

Field

FieldName

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

ReadOnly

RecordCount


TFieldDataLink properties

TFieldDataLink	By object	Legend

ActiveRecord

Active

BufferCount

CanModify

Control

DataSet

DataSourceFixed

DataSource

Editing

FieldName

Field

ReadOnly

RecordCount


TFieldDataLink::CanModify

TFieldDataLink	Properties	See also

CanModify indicates whether the field in the database table managed by TFieldDataLink can be altered by the Control.

Syntax

__property System::Boolean CanModify;

Description

Read CanModify to find out whether the Control that owns this TFieldDataLink is able to alter the data in the database that this field represents.  CanModify may be false because the control is read-only, or because the underlying field does not permit updates.


TFieldDataLink::Control

TFieldDataLink	Properties	See also

Control is the data-aware descenent of  TWinControl that uses this TFieldDataLink to manage responses to data events and the link to a TField object.

Syntax

__property Controls::TWinControl * Control;

Description

This property should only be set by descendents of TWinControl that use a TFieldDataLink to manage the link to a TField object.  These data-aware window controls can set the Control property of their TFieldDataLink member to self in their own constructors, after calling the TFieldDataLink constructor.  The Control property can then be used to access methods of the window  control when processing data events.


TFieldDataLink::Editing

TFieldDataLink	Properties	See also

Editing indicates whether the dataset which contains  the field associated with this TFieldDataLink is in edit mode.

Syntax

__property System::Boolean Editing;

Description

Use Editing to determine whether the value of the field associated with this TDataLink can currently be edited.  If Editing is false, calling the Edit method may drive the dataset into edit mode.  This may not be successful, however,  if the field cannot be edited.  For example, if the CanModify property is false, Editing will always be false.


TFieldDataLink::Field

TFieldDataLink	Properties	See also

Field is the TField Object that represents the field in the underlying database table managed by this TFieldDataLink.

Syntax

virtual void __fastcall FocusControl(Db::TFieldRef Field);

Description

Read Field when you want access to the field component to which this TFieldDataLink’s Control is bound.

Note

Before using Field to alter the value of a field’s contents, applications should check the CanModify property, as the Field component will not be aware of all constraints to edits for this TFieldDataLink.


TFieldDataLink::FieldName

TFieldDataLink	Properties	See also

FieldName is the name of the field to which this TFieldDataLink’s Control is bound.

Syntax

__property System::AnsiString FieldName;

Description

Use FieldName to implement the FieldName property of the data-aware control that owns the TFieldDataLink.  Setting FieldName causes the TFieldDataLink, and hence the control, to bind to the field in the dataset with that name.


TFieldDataLink events

TFieldDataLink	Alphabetically

In TFieldDataLink

OnActiveChange

OnDataChange

OnEditingChange

OnUpdateData


TFieldDataLink events

TFieldDataLink	By object

OnActiveChange

OnDataChange

OnEditingChange

OnUpdateData


TFieldDataLink::OnActiveChange

TFieldDataLink	Events	See also

OnActiveChange  occurs when the Active property of the TFieldDataLink changes.

Syntax

__property Classes::TNotifyEvent OnActiveChange;

Description

Write an OnActiveChange event handler to take specific action immediately after the dataset transitions into or out of an active state. OnActiveChange is particularly useful for updating objects to reflect changes that occurred while the dataset was not active, as the object can not respond to events while its TFieldDataLink is not Active .


TFieldDataLink::OnDataChange

TFieldDataLink	Events	See also

OnDataChange occurs when the contents of the dataset change.

Syntax

__property Classes::TNotifyEvent OnDataChange;

Description

Write an OnDataChange event handler to take specific action when there is a change to the contents of the field. OnDataChange allows the control object to respond when the dataset sends out notifications that the data has changed.


TFieldDataLink::OnEditingChange

TFieldDataLink	Events	See also

EditingChanged occurs after the DataSource transitions into or out of an editng state.

Syntax

__property Classes::TNotifyEvent OnEditingChange;

Description

Write an OnEditingChange event handler to take specific action when the DataSource transitions into or out of an editing state.  This can be used to create visual indications of the editing state in the control that uses this TFieldDataLink.


TFieldDataLink::OnUpdateData

TFieldDataLink	Events	See also

OnUpdateData occurs when it is time to post any pending changes to the dataset.

Syntax

__property Classes::TNotifyEvent OnUpdateData;

Description

Write an OnUpdateData event handler to post the data in the representation of the field to the underlying dataset.  Posting the data from  within OnUpdateData will not trigger a call to OnDataChange.


TFieldDataLink methods

TFieldDataLink	Alphabetically	Legend

In TFieldDataLink

~TFieldDataLink

ActiveChanged

Edit

EditingChanged

FocusControl

LayoutChanged

Modified

RecordChanged

Reset

TFieldDataLink

UpdateData

Derived from TDataLink

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldDataLink methods

TFieldDataLink	By object	Legend

~TFieldDataLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FocusControl

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

TFieldDataLink

UpdateData

UpdateRecord


TFieldDataLink::ActiveChanged

TFieldDataLink	Methods	See also

ActiveChanged overrides the inherited ActiveChanged method so that the TFieldDataLink only responds to changes in the Active property if an OnActiveChanged event handler is assigned.

Syntax

virtual void __fastcall ActiveChanged(void);

Description

Changes to the Active property trigger the ActiveChanged method.  If an OnActiveChanged event handler is assigned, ActiveChanged calls this event handler.  If ActiveChanged is triggered by a transition into an active state, then before calling the event handler, ActiveChanged makes sure that the Field for this TFieldDataLink is still valid.


TFieldDataLink::Edit

TFieldDataLink	Methods	See also

Edit attempts to drive the DataSource into an editing state if it is not already in one.

Syntax

System::Boolean __fastcall Edit(void);

Description

Use Edit to try to ensure that the contents of the field can be modified. A return value of true indicates that the field was already in an editing state, or that the DataSource was successfully changed to allow editing. A return value of false indicates that the DataSource could not be changed to allow editing. For example, if the CanModify property is false, Edit will fail to allow editing, and return false.


TFieldDataLink::EditingChanged

TFieldDataLink	Methods	See also

EditingChanged enforces the CanModify property when the field binding changes.

Syntax

virtual void __fastcall EditingChanged(void);

Description

Changing the field binding can change the validity of the CanModify property, since individual field components can disallow edits.  If the TFieldDataLink is in an editing state when the Field property is changed, EditingChanged checks the CanModify property.  If CanModify is false, it changes back out of the editing state.

Note

This differs significantly from the inherited EditingChanged method of TDataLink.  The  functionality of the inherited method is replaced in TFieldDataLink by the OnEditingChange event handler.


TFieldDataLink::FocusControl

TFieldDataLink	Methods	See also

FocusControl sets the input focus to Control.

Syntax

virtual void __fastcall FocusControl(Db::TFieldRef Field);

Description

Call FocusControl to give the Control associated with this TFieldDataLink object the input focus.  FocusControl checks whether the Control can receive input focus, and if so, calls its SetFocus method to move focus to the Control.


TFieldDataLink::LayoutChanged

TFieldDataLink	Methods	See also

LayoutChanged makes sure that the Field property is still valid after changes in the  layout of a container of the Control for this TFieldDataLink.

Syntax

virtual void __fastcall LayoutChanged(void);

Description

Call LayoutChanged when making changes to the layout of one of the containers of the Control for this TFieldDataLink that might change the validity of its field binding.  For example, if the Control were embedded within a TCustomDBGrid, and one of the columns were deleted, the Field property for the Control might become invalid.


TFieldDataLink::Modified

TFieldDataLink	Methods	See also

Modified keeps track of when changes are made to the data for this field that have not yet been posted to the database.

Syntax

void __fastcall Modified(void);

Description

Call Modified when the Control for this TFieldDataLink begins processing edits.


TFieldDataLink::RecordChanged

TFieldDataLink	Methods	See also

RecordChanged calls the OnDataChange event handler when the contents of the current record in the dataset change.

Syntax

virtual void __fastcall RecordChanged(Db::TField *Field);

Description

Applications do not need to call the RecordChanged method.  It is triggered automatically when the contents of the current record change.  RecordChanged calls the OnDataChange event handler if there is one.


TFieldDataLink::Reset

TFieldDataLink	Methods	See also

Reset calls the OnDataChange event handler to allow it to cancel out of pending changes to the field before they are posted.

Syntax

void __fastcall Reset(void);

Description

The Control that owns a TFieldDataLink calls its Reset method to process a UI action that cancels edits to the field.  Reset calls the OnDataChange event handler if it is assigned, which can then take any necessary action to process the cancellation of edits.


TFieldDataLink::UpdateData

TFieldDataLink	Methods	See also

UpdateData calls the OnUpdateData event handler so that the data-aware control can post any pending edits to the dataset.

Syntax

virtual void __fastcall UpdateData(void);

Description

UpdateData overrides the default UpdateData method to call the OnUpdateData event handler that has been assigned.


TFieldDataLink::TFieldDataLink

TFieldDataLink	Methods	See also

TFieldDataLink creates a new TFieldDataLink object.

Syntax

__fastcall TFieldDataLink(void);

Description

Use TFieldDataLink to create a new TFieldDataLink object.


TFieldDataLink::~TFieldDataLink

TFieldDataLink	Methods	See also

~TFieldDataLink frees the memory associated with the TFieldDataLink object.

Syntax

__fastcall virtual ~TFieldDataLink(void);

Description

Do not call ~TFieldDataLink directly. Instead, use the delete keyword on the object, which causes ~TFieldDataLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TFieldDataLink example

TFieldDataLink


TFloatField

Hierarchy	Properties	Methods	Events	See also

A TFloatField component represents a field that contains floating-point values in a dataset.

Header

vcl/dbtables.hpp

Description

Floating-point fields can hold values in the range from (positive or negative) 5.0 * 10e-324 to 1.7 * 10e308 with an accuracy of 15 to 16 digits.

TFloatField introduces new properties to convert between floating-point values and other data types, and to limit the range or precision of valid values that the field will permit, and to affect the formatting of the value for display purposes. As a descendent of TNumericField, TFloatField includes many properties, methods, and events that are useful for managing the value and properties of a numeric field in a database.

TFloatField is the director ancestor of the TCurrencyField component.


TFloatField properties

TFloatField	Alphabetically	Legend

In TFloatField

AsFloat

AsInteger

AsString

AsVariant

Currency

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TFloatField properties

TFloatField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Currency

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

Precision

ReadOnly

Required

Size

Tag

Text

Value

Visible


TFloatField::AsFloat

TFloatField	Properties	See also

AsFloat gets or sets the value of the floating-point field.

Syntax

Description

Floating-point values need no conversion, because the native storage format of a floating point field is a Double. AsFloat provides a uniform interface that allows applications to get or set floating-point values with generic field components when the internal storage format of the data is not known.

If the value assigned to the field does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TFloatField::AsInteger

TFloatField	Properties	See also

AsInteger converts the value of the floating-point field to or from an integer value.

Syntax

Description

Use AsInteger to:

•	Assign an integer value to the floating-point field.

•	Assign the floating-point field value to an integer.

AsInteger converts floating point values to integers by truncating the decimal portion. If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, then an EDatabaseError exception is raised.


TFloatField::AsString

TFloatField	Properties	See also

AsString converts the value of a floating-point field to or from a string value.

Syntax

Description

Use AsString to:

•	Assign the floating-point field value to string value.

•	Assign a string value to the floating-point field.

For example, this code assigns a string value to floating-point field value:

To assign floating-point field value to a string, use code similar to this:

If the string assigned to the field does not represent a valid floating-point value within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TFloatField::AsVariant

TFloatField	Properties	See also

AsVariant converts the value of a floating-point field to or from a variant value.

Syntax

Description

Use AsVariant to:

•	Assign the floating-point field value to variant value.

•	Assign a variant value to the floating-point field.

Using variants is useful when you don't know the actual field type and don't want to use one of the other As... properties to convert the field value to another type.

If the value assigned to the field does not fall within the range specified with MinValue and MaxValue properties, an EDatabaseError exception is raised.


TFloatField::Currency

TFloatField	Properties	See also

Currency determines whether the value in the field should be formatted as a currency value.

Syntax

__property System::Boolean currency;

Description

Use the Currency property to influence how the value in the field should be formatted for viewing and editing in a data-aware control.

The format of the field for display purposes uses the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, then Currency determines how the field is formatted for display. If Currency is true, the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is false, the value is formatted with the ffGeneral format.

The format of the field for editing purposes uses the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, then Currency determines how the field is formatted for editing. If Currency is true, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is false, the value is formatted with the ffGeneral format.


TFloatField::MaxValue

TFloatField	Properties	See also

MaxValue limits the maximum value in the floating-point field.

Syntax

__property System::Double MaxValue;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.


TFloatField::MinValue

TFloatField	Properties	See also

MinValue limits the minimum value in the floating-point field.

Syntax

__property System::Double MinValue;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.


TFloatField::Precision

TFloatField	Properties	See also

Precision determines the precision used in formatting the value in a float-point field.

Syntax

__property System::Integer Precision;

Description

Use Precision set the number of digits beyond the decimal point the value should be formatted to before rounding begins. Precision affects the formatting of the floating-point value when it is displayed as a text string, not the actual floating point value that is stored in the field.

The default value of Precision is 15 decimal places.


TFloatField::Value

TFloatField	Properties	See also

Value is the actual data in the floating-point field.

Syntax

void __fastcall SetCurrency(System::Boolean Value);

Description

Use Value to read data directly from and write data directly to a floating-point component at run time. Using the Value property is the same as using the AsFloat property. Use Value when you know the field component is a floating-point field. Use AsFloat when working with a generic field component.


TFloatField events

TFloatField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TFloatField events

TFloatField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TFloatField methods

TFloatField	Alphabetically

In TFloatField

~TFloatField

IsValidChar

TFloatField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFloatField methods

TFloatField	By object

~TFloatField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TFloatField


TFloatField::IsValidChar

TFloatField	Methods	See also

IsValidChar determines if the specified character is valid in a floating-point field.

Syntax

virtual System::Boolean __fastcall IsValidChar(System::Char Ch);

Description

Call IsValidChar to determine if a character specified as the value of the InputChar is a valid character in a floating-point field.

Valid characters for a floating-point field are +, -, E, e, 0 to 9, and whatever character is specified as the decimal separator. If InputChar is one of these characters, IsValidChar returns true. For all other characters, IsValidChar returns false.

IsValidChar is used by data-aware controls to determine if a particular character entered in the field is valid for the field.


TFloatField::TFloatField

TFloatField	Methods	See also

TFloatField creates a new TFloatField object.

Syntax

__fastcall virtual TFloatField(Classes::TComponent *AOwner);

Description

Use TFloatField to create a new TFloatField object.


TFloatField::~TFloatField

TFloatField	Methods	See also

~TFloatField frees the memory associated with the TFloatField object.

Syntax

__fastcall virtual ~TFloatField(void);

Description

Do not call ~TFloatField directly. Instead, use the delete keyword on the object, which causes ~TFloatField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TFloatField example

TFloatField


TFilterComboBox

Hierarchy	Properties	Methods	Events

TFilterComboBox is a specialized combo box that is used to present the user with a choice of file filters. Specify the filters you want to appear in the filter combo box with the Filter property. The filter the user selects is the value of the Mask property.

Header

vcl/filectrl.hpp

Most commonly, a filter combo box is used with a file list box (TFileListBox). Your application can have the file filter the user selects in the filter combo box determine which files appear in the file list box. If you place this line of RefSyn in an OnChange event handler of the filter combo box, any change in the filter combo box is reflected in the file list box:

Another way to accomplish the same task is to set the FileList property of the filter combo box to the file list box you want affected with a change of filters.


TFilterComboBox properties

TFilterComboBox	Alphabetically	Legend

In TFilterComboBox

FileList

Filter

Mask

Derived from TCustomComboBox

Canvas

DroppedDown

ItemIndex

Items

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TFilterComboBox properties

TFilterComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DroppedDown

Enabled

FileList

Filter

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Mask

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TFilterComboBox::FileList

TFilterComboBox	Properties

Provides a simple way to connect a filter combo box with a file list box.

Syntax

__property TFileListBox * FileList;

Once the two controls are connected and a new filter is selected using a filter combo box, the file list box displays the files that match the selected filter. Specify the file list box you want to display the files matching the selected filter as the value of the FileList property.


TFilterComboBox::Filter

TFilterComboBox	Properties

Determines the file masks displayed in the filter combo box.

Syntax

__property System::AnsiString Filter;

A file mask or file filter is a file name that usually includes wildcard characters (*.PAS, for example). When your application runs, the file filter the user selects in the filter combo box becomes the value of the Mask property. To specify a file filter, assign a filter string as the value of Filter. To create the string, follow these steps:

1	Type some meaningful text to indicate the type of file.

2	Type a | character (this is the "pipe" or "or" character).

3	Type the file filter.

Don't put in any spaces around the | character in the string.

Here's an example:

If you entered this string, the string "Text files" appears in the filter combo box.

You can specify multiple file filters so that a list of filters appears in the filter combo box from which the user can select. To specify multiple file filters,

1	Type a file filter as shown previously.

2	Type another file filter in the same way, but separate the second file filter from the first with the | character.

3	Continue adding as many file filters as you like, separating them with the | character. The string can be up to 255 characters.

Here's an example of three file filters specified as the value of the Filter property:

Note that the previous example includes the file filters in parentheses in the text parts. This isn't required, but it's a common convention that helps users understand what to expect when they select a file filter.

You can string multiple wildcard file filters together if you separate them with semicolons:


TFilterComboBox::Mask

TFilterComboBox	Properties

Returns the string selected as the filter in the filter combo box.

Syntax

__property System::AnsiString Mask;


TFilterComboBox events

TFilterComboBox	Alphabetically	Legend

In TFilterComboBox

OnChange

Derived from TCustomComboBox

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TFilterComboBox events

TFilterComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TFilterComboBox::OnChange

TFilterComboBox	Events

Syntax

__property Classes::TNotifyEvent OnChange;


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnDropDown


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnStartDrag


TFilterComboBox methods

TFilterComboBox	Alphabetically

In TFilterComboBox

~TFilterComboBox

TFilterComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFilterComboBox methods

TFilterComboBox	By object

~TFilterComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TFilterComboBox

UpdateControlState

Update


TFilterComboBox::TFilterComboBox

TFilterComboBox	Methods	See also

TFilterComboBox creates a new TFilterComboBox object.

Syntax

__fastcall virtual TFilterComboBox(Classes::TComponent *AOwner);

Description

Use TFilterComboBox to create a new TFilterComboBox object.


TFilterComboBox::~TFilterComboBox

TFilterComboBox	Methods	See also

~TFilterComboBox frees the memory associated with the TFilterComboBox object.

Syntax

__fastcall virtual ~TFilterComboBox(void);

Description

Do not call ~TFilterComboBox directly. Instead, use the delete keyword on the object, which causes ~TFilterComboBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TFilterComboBox example

TFilterComboBox


TFolderBitmap

Hierarchy	Properties	Methods	Events

Header

vcl/filectrl.hpp

Description


TFolderBitmap properties

TFolderBitmap	Alphabetically	Legend

Derived from TBitmap

Canvas

Empty

Handle

Height

IgnorePalette

Monochrome

Palette

TransparentColor

Width

Derived from TGraphic

Modified


TFolderBitmap properties

TFolderBitmap	By object	Legend

Canvas

Empty

Handle

Height

IgnorePalette

Modified

Monochrome

Palette

TransparentColor

Width


TFolderBitmap events

TFolderBitmap	Alphabetically

Derived from TGraphic

OnChange


TFolderBitmap events

TFolderBitmap	By object

OnChange


TFolderBitmap methods

TFolderBitmap	Alphabetically

In TFolderBitmap

~TFolderBitmap

TFolderBitmap

Derived from TBitmap

Assign

Dormant

FreeImage

LoadFromClipboardFormat

LoadFromResourceID

LoadFromResourceName

LoadFromStream

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToStream

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFolderBitmap methods

TFolderBitmap	By object

~TFolderBitmap

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Dormant

FieldAddress

FreeImage

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromResourceID

LoadFromResourceName

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToFile

SaveToStream

TFolderBitmap


TFolderBitmap::TFolderBitmap

TFolderBitmap	Methods	See also

TFolderBitmap creates a new TFolderBitmap object.

Syntax

__fastcall TFolderBitmap(void);

Description

Use TFolderBitmap to create a new TFolderBitmap object.


TFolderBitmap::~TFolderBitmap

TFolderBitmap	Methods	See also

~TFolderBitmap frees the memory associated with the TFolderBitmap object.

Syntax

__fastcall virtual ~TFolderBitmap(void);

Description

Do not call ~TFolderBitmap directly. Instead, use the delete keyword on the object, which causes ~TFolderBitmap to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic

TBitmap


TFolderBitmap example

TFolderBitmap


TFont

Hierarchy	Properties	Methods	Events

A TFont object defines the appearance of text. TFont encapsulates a Windows HFONT.

Header

vcl/graphics.hpp

A TFont object defines a set of characters by specifying their height, font family (typeface) name, and so on. The height is specified by the Height property. The typeface is specified by the Name property. The size in points is specified by the Size property. The color is specified by the Color property. The attributes of the font (bold, italic, and so on) are specified by the Style property.

When a font is modified, an OnChange event occurs.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects. A TFont object is an indirect descendent of TPersistent.


TFont properties

TFont	Alphabetically	Legend

In TFont

Color

Handle

Height

Name

Pitch

PixelsPerInch

Size

Style


TFont properties

TFont	By object	Legend

Color

Handle

Height

Name

Pitch

PixelsPerInch

Size

Style


TFont::Color

TFont	Properties

Determines the color of the text.

Syntax

__property TColor Color;

These are the possible color values::

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 only: Text color for tooltip controls

clInfoBk 	Windows 95 only: Background color for tooltip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.


TFont::Handle

TFont	Properties

Provides access to the Windows GDI font object handle.

Syntax

__property System::Integer Handle;

If you need to use a Windows API function that requires the handle of a font object, you could pass the handle from the Handle property of a TFont object.


TFont::Height

TFont	Properties

Determines the height of the font.

Syntax

__property System::Integer Height;

The height of the font, which is the size of the font minus the internal leading that appears at the top of the font. Whenever you specify a font height in pixels, use the Height property. If you are concerned with the size of the font in points--use the Size property instead of Height. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels--which includes the internal leading--when displaying a font on the screen.

Borland C++ Builder determines the value of the Height property using this formula:

Font.Height = -Font.Size * 72 / Font.PixelsPerInch

Therefore, whenever you enter a positive value for the Height property, the font's Size property value changes to a negative number. Conversely, if you enter a positive value for the Size property, the font's Height property changes to a negative number. Positive Height includes the internal leading and negative excludes it.


TFont::Name

TFont	Properties

Identifies the typeface of the font.

Syntax

__property TFontName Name;


Pitch

Specifies the pitch or width of the characters of a font.

The Pitch property specifies the pitch or width of the characters of a font. Characters with variable pitch can have varying widths. For example, the following characters are in a variable pitch font. Note that the width of ten 'i' characters is less than the width of ten 'M' characters.

iiiiiiiiii

MMMMMMMMMM

The following characters are in a fixed-pitch font. Note that ten 'i' characters are the same width as ten 'M' characters:

Here are the possible values for Pitch:

Value	Meaning

fpDefault	The font pitch is set to the default value, which depends on the font specified in the Name property.

fpFixed	The font pitch is set to fixed. All characters in the font have the same width.

fpVariable	The font pitch is set to variable. The characters in the font have different widths.


TFont::PixelsPerInch

TFont	Properties

Used by Borland C++ Builder to ensure that when a font is copied from the form's canvas to the printer, the font is the same size in points.

Syntax

__property System::Integer PixelsPerInch;

For example, if the font is 8 points on the screen, Borland C++ Builder makes sure the font is 8 points when it is printed. The PixelsPerInch property affects printer fonts only and should not be modified.

If you want to modify the size of a font, use the Size or Height properties.


TFont::Size

TFont	Properties

Specifies the size of the font in points.

Syntax

__property System::Integer Size;

Size the height of the font plus the font's excluding internal leading. If you are concerned with the height of the font on the screen--the number of pixels the font needs--use the Height property instead. If you want to specify a font's height using pixels, use the Size property.

Borland C++ Builder calculates Size using this formula:

Font.Size = -Font.Height * Font.PixelsPerInch / 72

Therefore, whenever you enter a point size in the Size property, you'll notice the Height property changes to a negative value. Conversely, if you enter a positive Height value, the Size property value changes to a negative value.


TFont::Style

TFont	Properties

Determines whether the font is normal, italic, underlined, bold, and so on.

Syntax

__property TFontStyles Style;

These are the possible values of Style:

Value	Meaning

fsBold	The font is boldfaced.

fsItalic	The font is italicized.

fsUnderline	The font is underlined.

fsStrikeout	The font is displayed with a horizontal line through it.

The Style property is a set, so it can contain multiple values. For example, a font could be both boldfaced and italicized.


TFont events

TFont	Alphabetically

Derived from TGraphicsObject

OnChange


TFont events

TFont	By object

OnChange


OnChange


TFont methods

TFont	Alphabetically

In TFont

~TFont

Assign

TFont

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFont methods

TFont	By object

~TFont

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFont


TFont::Assign

TFont	Methods

[GENERIC]

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assigns a font object to another.

The Assign method assigns one object to another. The general form of a call to Assign is

which tells the Destination object to assign the contents of the Source object to itself.

In general, the statement "Destination = Source" is not the same as the statement "Destination.Assign(Source)". The statement "Destination = Source" makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object references by Source into the object referenced by Destination.

If Destination is a property of some object, however, and that property is not a reference to another object (such as the ActiveControl property of a form, or the DataSource property of a data-aware control), then the statement "Destination = Source" is the same as "Destination.Assign(Source)". Consider these statements:

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at run time only if the objects involved "know" how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at run time.

An object of one type can always be assigned to another object of the same type. In addition, Assign supports the following special cases:

•	If Destination is of type TPicture then Source can be of type TBitmap, TIcon, or TMetafile.

•	If Destination is of type TBitmap, TIcon, or TMetafile then Source can be of type TPicture if the Graphic property of the picture is of the same type as Destination.

•	If Destination is of type TBlobField then Source can be of type TBitmap, TPicture, or TStrings.


TFont::TFont

TFont	Methods	See also

TFont creates a new TFont object.

Syntax

__fastcall TFont(void);

Description

Use TFont to create a new TFont object.


TFont::~TFont

TFont	Methods	See also

~TFont frees the memory associated with the TFont object.

Syntax

__fastcall virtual ~TFont(void);

Description

Do not call ~TFont directly. Instead, use the delete keyword on the object, which causes ~TFont to be invoked automatically.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TFont example

TFont


TFontDialog

Hierarchy	Properties	Methods	Events

The TFontDialog component makes a Font dialog box available to your application. The purpose of the dialog box is to allow a user to select a font and set attributes of that font. When the user selects a font and chooses OK in the dialog box, the user’s font selection is stored in the dialog box’s Font property, which you can then process as you want.

Header

vcl/dialogs.hpp

Description

Display the Font dialog box by calling the Execute method.

You choose which device you want a font change to affect with the Device property.

You can use the Options property to customize how the Font dialog box appears and behaves. For example, you can specify that a Help button be included in the dialog box or that only true Type fonts appear in the list of fonts.


TFontDialog properties

TFontDialog	Alphabetically	Legend

In TFontDialog

Device

Font

MaxFontSize

MinFontSize

Options

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TFontDialog properties

TFontDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

Device

Font

HelpContext

MaxFontSize

MinFontSize

Name

Options

Owner

Tag


TFontDialog::Device

TFontDialog	Properties

Selects the device from which to retrieve the list of available fonts.

Syntax

__property TFontDialogDevice Device;

Description

These are the possible values:

Value	Meaning

fdScreen	Retrieve from the screen

fdPrinter	Retrieve from the printer


TFontDialog::Font

TFontDialog	Properties

The font the Font dialog box returns when the user uses the dialog box to select a font.

Syntax

__property Graphics::TFont * Font;

Description

Your application can then use this returned Font value for further processing.


TFontDialog::MaxFontSize

TFontDialog	Properties

[ISN’T THERE A DEFAULT SIZE?]

Syntax

__property System::Integer MaxFontSize;

Determines the largest font size available in the Font dialog box.

Description

Use the MaxFontSize property when you want to limit the font sizes available to the user. To limit the font sizes available, the Options set property of the Font dialog box must also contain the value fdLimitSize. If fdLimitSize is false, setting the MaxFontSize property has no affect on number of fonts available in the Font dialog box.


TFontDialog::MinFontSize

TFontDialog	Properties

[ISN’T THERE A DEFAULT SIZE?]

Syntax

__property System::Integer MinFontSize;

Determines the smallest font size available in the Font dialog box.

Description

Use the MinFontSize property when you want to limit the font sizes available to the user. To limit the font sizes available, the Options set property of the Font dialog box must also contain the value fdLimitSize. If fdLimitSize is false, setting the MinFontSize property has no affect on number of fonts available in the Font dialog box.


TFontDialog::Options

TFontDialog	Properties

Determines how a Font dialog box appears and behaves.

Syntax

__property TFontDialogOptions Options;

Description

These are the possible values that can be included in the Options set for the Fonts dialog box:

Value	Meaning

fdAnsiOnly	If true, the user can select fonts that use the Windows character set only; that is, the user can't choose a font that contains only symbols because they aren't displayed in the Font combo box.

fdApplyButton	The apply button appears automatically if there is an event handler for the OnApply event, in which case the flag is ignored. If there is no event handler for OnApply, then the flag controls the appearance of the button.

fdEffects	If true, the Effects check boxes and the Color list box appear in the Font dialog box. The user uses the Effects check boxes to specify strikeout or underlined text and the Color list box to select a color for the selected font. If fdEffects is false, the Effects check boxes and Color list box don't appear in the Font dialog box.

fdFixedPitchOnly	If true, only monospaced fonts are displayed in the Font combo box.

fdForceFontExist	If true and the user enters a font name in the Font combo box and chooses OK, a message dialog box appears informing the user the font name is invalid.

fdLimitSize	If true, the MinFontSize and MaxFontSize properties can limit the number of fonts available in the dialog box.

fdNoFaceSel	If true, when the dialog box appears, no font name is selected in the Font combo box.

fdNoOEMFonts	If true, only fonts that aren't vector fonts are displayed in the Font combo box.

fdScalableOnly	If true, only fonts that can be scaled are displayed in the Font combo box.

fdNoSimulations	If true, only fonts that aren't GDI font simulations are displayed in the Font combo box.

fdNoSizeSel	If true, when the dialog box appears, no size is selected in the Size combo box.

fdNoStyleSel	If true, when the dialog box appears, no style is selected in the Style combo box.

fdNoVectorFonts	Same as fdNoOEMFonts.

fdShowHelp	If true, a Help button appears in the dialog box.

fdTrueTypeOnly	If true, only TrueType fonts are displayed in the Font list box.

fdWysiwyg	If true, only fonts that are available to both the printer and the screen appear in the Font combo box.


TFontDialog events

TFontDialog	Alphabetically	Legend

In TFontDialog

OnApply


TFontDialog events

TFontDialog	By object	Legend

OnApply


TFontDialog::OnApply

TFontDialog	Events

Syntax

__property TFDApplyEvent OnApply;

Description


TFontDialog methods

TFontDialog	Alphabetically

In TFontDialog

~TFontDialog

Execute

TFontDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFontDialog methods

TFontDialog	By object

~TFontDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TFontDialog


TFontDialog::Execute

TFontDialog	Methods

Displays the Font dialog box.

Syntax

System::Boolean __fastcall Execute(void);

Description


TFontDialog::TFontDialog

TFontDialog	Methods	See also

TFontDialog creates a new TFontDialog object.

Syntax

__fastcall virtual TFontDialog(Classes::TComponent *AOwner);

Description

Use TFontDialog to create a new TFontDialog object.


TFontDialog::~TFontDialog

TFontDialog	Methods	See also

~TFontDialog frees the memory associated with the TFontDialog object.

Syntax

__fastcall virtual ~TFontDialog(void);

Description

Do not call ~TFontDialog directly. Instead, use the delete keyword on the object, which causes ~TFontDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TFontDialog example

TFontDialog


TForm

Hierarchy	Properties	Methods	Events	See also

TForm is the component for a standard application window (form).

Header

vcl/forms.hpp

Description

Use TForm to create a form, such as a main window, dialog box, or MDI child. The form can contain other objects, such as TButton, TCheckBox, and TComboBox objects.

Examples of forms include TLoginDialog and TPasswordDialog objects.


TForm properties

TForm	Alphabetically	Legend

In TForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientWidth

Designer

DropTarget

FormStyle

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

ObjectMenuItem

OleFormObject

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientRect

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TForm properties

TForm	By object	Legend

ActiveControl

ActiveMDIChild

ActiveOleControl

Active

Align

AutoScroll

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DropTarget

Enabled

Font

FormStyle

Handle

Height

HelpContext

Hint

HorzScrollBar

Icon

KeyPreview

Left

MDIChildCount

MDIChildren

Menu

ModalResult

Name

ObjectMenuItem

OleFormObject

Owner

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TileMode

Top

VertScrollBar

Visible

Width

WindowMenu

WindowState


TForm::Active

TForm	Properties	See also

Active is a Boolean value that specifies whether the form has focus.

Syntax

__property System::Boolean Active;

Description

Use Active to determine whether the form has focus.

If Active is true , the form has focus; if Active is false, the form does not have focus.


TForm::ActiveControl

TForm	Properties	See also

ActiveControl is the control that has focus on the form.

Syntax

__property Controls::TWinControl * ActiveControl;

Description

Use ActiveControl to get or set the control that has focus on the form.

If the form does not have focus, ActiveControl is the control on the form that will receive focus when the form receives focus.

Note

When focus shifts to another control, ActiveControl is updated before the OnExit event occurs.

Only one control can have focus at a given time in an application.


TForm::ActiveMDIChild

TForm	Properties	See also

ActiveMDIChild is the MDI child that has focus.

Syntax

__property TForm * ActiveMDIChild;

Description

Use ActiveMDIChild to get the MDI child that has focus.

If the form is not an MDI parent (that is, if the FormStyle property of the form is not fsMDIForm), ActiveMDIChild returns NULL.


TForm::ActiveOleControl

TForm	Properties	See also

ActiveOLEControl is an OLE control on the form that reacts to changes in focus.

Syntax

__property Controls::TWinControl * ActiveOleControl;

Description

Use ActiveOLEControl to get or set an OLE control on the form that reacts to changes in focus.

If ActiveOLEControl is not NULL, the user interface for the specified OLE control is deactivated when it is not focused. Also, when the form receives or loses focus, the document window for the specified OLE control is activated or deactivated respectively.


TForm::BorderIcons

TForm	Properties

BorderIcons is a set of values that specify which icons appear on the title bar of the form.

Syntax

__property TBorderIcons BorderIcons;

Description

Use BorderIcons to get or set the icons that appear on the title bar of the form. BorderIcons can consist of any of the following TBorderIcons values:

Value	Meaning

biSystemMenu	The form has a Control menu (also known as a System menu)

biMinimize	The form has a Minimize button

biMaximize	The form has a Maximize button

biHelp	The form shows help in pop-up windows, rather than in a main Help window. If biMinimize and biMaximize are excluded, a question mark appears in the form's title bar; otherwise,no question mark appears.


TForm::BorderStyle

TForm	Properties

BorderStyle is a set of values that specify the appearance and behavior of the form border.

Syntax

__property TFormBorderStyle BorderStyle;

Description

Use BorderStyle to get or set the appearance and behavior of the form border. BorderStyle can consist of any of the following TFormBorderStyle values:

Value	Meaning

bsDialog	Not resizeable; standard dialog box border

bsSingle	Not resizeable; single-line border

bsNone	Not resizeable; no visible border line

bsSizeable	Standard resizeable border

bsToolWindow	like bsSingle but with a smaller caption

bsSizeToolWin	like bsSizeable with a smaller caption

Note

Changing the border style of an MDI child form to bsDialog or bsNone has no effect.


TForm::Canvas

TForm	Properties	See also

Canvas is the drawing area of the application.

Syntax

__property Graphics::TCanvas * Canvas;

Description

Use TCanvas to get the drawing area of the application. Canvas is often used in the OnPaint event handler.


TForm::ClientHandle

TForm	Properties

ClientHandle is the handle (HWND) for the form’s internal MDI client window.

Syntax

__property System::Integer ClientHandle;

Description

Use ClientHandle to get the handle for the form’s internal MDI client window.

ClientHandle is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::ClientHeight

TForm	Properties	See also

ClientHeight is the height (in pixels) of the form’s client area.

Syntax

__property ClientHeight;

Description

Use ClientHeight to get or set the height (in pixels) of the form’s client area. The client area is the usable area inside the form's border.


ClientRect

ClientRect is the form’s client area.

Description

Use ClientHeight to get or set the form’s client area. The client area is the usable area inside the form's border.

ClientRect is equivalent to Rect(0,0,ClientWidth, ClientHeight).


TForm::ClientWidth

TForm	Properties	See also

ClientWidth is an integer that represents the width (in pixels) of the form’s client area.

Syntax

__property ClientWidth;

Description

Use ClientWidth to get or set the width (in pixels) of the form’s client area. The client area is the usable area inside the form's border.


TForm::Designer

TForm	Properties	See also

Designer is the designer for the form.

Syntax

__property TDesigner * Designer;

Description

Use Designer to get or set the designer for the form.


TForm::DropTarget

TForm	Properties

DropTarget is a Boolean value that specifies whether the form is the target of a drag-and-drop operation.

Syntax

__property System::Boolean DropTarget;

Description

Use DropTarget to get or set whether the form is the target of a drag-and-drop operation.


TForm::FormStyle

TForm	Properties

FormStyle is a set of values that represent the form’s style.

Syntax

__property TFormStyle FormStyle;

Description

Use FormStyle to get or set the form’s style. FormStyle can consist of any combination of the following TFormStyle values:

Value	Meaning

fsNormal	The form is neither an MDI parent window nor an MDI child window.

fsMDIChild	The form is an MDI child window.

fsMDIForm	The form is an MDI parent window.

fsStayOnTop	This form remains on top of other forms in the project, except any others that also have FormStyle set to fsStayOnTop.

Note

It is not advisable to change FormStyle at run-time.

If the form is the main form of an MDI application, its FormStyle property must be set to fsMDIForm.


TForm::Icon

TForm	Properties

Icon is the form’s icon.

Syntax

__property Graphics::TIcon * Icon;

Description

Use Icon to get or set the form’s icon. The form’s icon is displayed when the form is minimized.

Note

If Icon is not set, the form uses the application's icon.


TForm::KeyPreview

TForm	Properties	See also

KeyPreview is a Boolean value that specifies whether keyboard events should occur on the form before they occur on the active control.

Syntax

__property System::Boolean KeyPreview;

Description

If KeyPreview is true, keyboard events occur on the form before they occur on the active control. (The active control is specified by the ActiveControl property.)

Navigation keys (Tab, BackTab, the arrow keys, and so on) are unaffected by KeyPreview because they do not fire keyboard events.

If KeyPreview is false, keyboard events occur on the active control.

KeyPreview is false by default.


TForm::MDIChildCount

TForm	Properties

MDIChildCount is the number of open MDI child forms.

Syntax

__property System::Integer MDIChildCount;

Description

Use MDIChildCount to get the number of open MDI child forms.

MDIChildCount is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::MDIChildren

TForm	Properties

MDIChildren is an array of MDI child forms.

Syntax

__property TForm * MDIChildren[System::Integer I];

Description

Use MDIChildren to access a child form.

I is the index of the child form to access. The index corresponds to the child form’s z-order, starting at zero. For example, to access the first child form in the z-order, set I to 0.

MDIChildChildren is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::Menu

TForm	Properties	See also

Menu is the form’s main menu.

Syntax

__property Menus::TMainMenu * Menu;

Description

Use Menu to get or set the form’s main menu.

Menu is set to the first TMainMenu component added to the form at design-time.


TForm::ModalResult

TForm	Properties	See also

ModalResult is a value that, when non-zero, closes the form when it is displayed modally.

Syntax

__property TModalResult ModalResult;

Description

Use ModalResult to close the form when it is displayed modally.

By default, ModalResult is 0. Set ModalResult to any nonzero value to close the form. The value assigned to ModalResult becomes the return value of the ShowModal function call used to display the form.

ModalResult can be one of the following TModalResult values:

Constant	Value

mrNone	0

mrOk	idOK

mrCancel	idCancel

mrAbort	idAbort

mrRetry	idRetry

mrIgnore	idIgnore

mrYes	idYes

mrNo	idNo

mrAll	mrNo + 1


TForm::ObjectMenuItem

TForm	Properties

ObjectMenuItem is an OLE object menu item that reacts to selections of OLE objects.

Syntax

__property Menus::TMenuItem * ObjectMenuItem;

Description

Use ObjectMenuItem to get or set a menu item that becomes enabled or disabled when an OLE object on the form is selected or unselected respectively.

The OLE object menu item can be used for standard OLE commands, such as Activate or Convert. (The implementations of these commands are provided by the OLE server.)


TForm::OleFormObject

TForm	Properties

OleFormObject is a TOleFormObject object that

Syntax

__property TOleFormObject * OleFormObject;

Description

Use OleFormObject to


TForm::PixelsPerInch

TForm	Properties	See also

PixelsPerInch is a value that represents the proportion of the font on the system on which the form was designed.

Syntax

__property System::Integer PixelsPerInch;

Description

Use PixelsPerInch at run-time to change how the form is scaled to the current screen resolution. If PixelsPerInch is changed from its default value, the form will not have the same proportion on every screen resolution.

At design-time, PixelsPerInch is set automatically when the form is saved. Changes to PixelsPerInch in the Object Inspector are seen at run-time only.

The form’s Scaled property must be true for PixelsPerInch to have any effect.


TForm::Position

TForm	Properties

Position is a value that represents the size and placement of the form.

Syntax

__property TPosition Position;

Description

Use Position to get or set the size and placement of the form. Position can have one of the following TPosition values:

Value	Meaning

poDesigned	The form appears positioned on the screen and with the same height and width as it had at design time.

poDefault	The form appears in a position on the screen and with a height and width determined by Windows. Each time you run the application, the form moves slightly down and to the right. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poDefaultPosOnly	The form displays with the size you created it at design time, but Windows chooses its position on the screen. Each time you run the application, the form moves slightly down and to the right. When the form can no longer move down and to the right and keep the same size while remaining entirely visible on the screen, the form displays at the top-left corner of the screen.

poDefaultSizeOnly	The form appears in the position you left it at design time, but Windows chooses its size. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poScreenCenter	The form remains the size you left it at design time, but is positioned in the center of the screen.


TForm::PrintScale

TForm	Properties

PrintScale is a value that represents the proportions of a printed form.

Syntax

__property TPrintScale PrintScale;

Description

Use PrintScale to get or set the proportions of the printed form. PrintScale can have one of the following TPrintScale values:

Value	Meaning

poNone	No special scaling occurs; therefore, the printed form and how the form appears onscreen may appear squished or stretched.

poProportional	The form is printed so that the printed image is approximately the same visible size as on the screen (WYSIWYG). The form image is scaled so that the printed image is approximately the same visible size as on the screen.

poPrintToFit	The form is printed using the same screen proportions, but in a size that just fits the printed page.


TForm::Scaled

TForm	Properties	See also

Scaled is a Boolean value that specifies whether the form is sized according to the value of the PixelsPerInch property.

Syntax

__property System::Boolean Scaled;

Description

If Scaled is true , and the value of PixelsPerInch differs from the current system settings, the form is scaled to a new size. If Scaled is false, no scaling occurs.


TForm::TileMode

TForm	Properties	See also

TileMode is a value that represents how an MDI child form is arranged when the Tile method is called.

Syntax

__property TTileMode TileMode;

Description

TileMode can have one of the following TTileMode values:

Value	Meaning

tbHorizontal	Each form stretches across the width of the parent form

tbVertical	Each form stretches along the height of the parent form

TileMode is meaningful only if the form is an MDI child (that is, if the form’s FormStyle property is set to fsMDIChild).


TForm::Visible

TForm	Properties	See also

Visible is a Boolean value that indicates whether the form is visible.

Syntax

__property Visible;

Description

Use Visible to get or set whether the form is visible.

If Visible is true, the form is visible -- unless it is completely obscured by other forms. If Visible is false, the form is not visible.

You can set Visible to true and bring the form to the surface of other forms by calling the Show or ShowModal method.


TForm::WindowMenu

TForm	Properties

WindowMenu is the Window menu for an MDI parent form.

Syntax

__property Menus::TMenuItem * WindowMenu;

Description

Use WindowMenu to get or set the Window menu for an MDI parent form. The Window menu is a standard menu in MDI applications. It contains commands that let the user manage the windows in the application. Menu items usually include Cascade, Arrange Icons, Tile, and so on.

The Window menu also lists (at the bottom) the child windows that are currently open in the application. When the user selects one of these windows from the menu, the window becomes the active window in the application.

Although this menu is commonly called the Window menu, it can have any name that corresponds to an existing menu item on the menu bar. The names of open child forms are merged onto the menu automatically at run-time.

WindowMenu is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::WindowState

TForm	Properties	See also

WindowState is a value that represents how the form appears on the screen.

Syntax

__property TWindowState WindowState;

Description

Use WindowMenu to get or set whether the form appears on the screen in its minimized, maximized, or normal state.

WindowState can have one of the following TWindowState values:

Value	Meaning

wsNormal	The form appears in its normal state (that is, its non-minimized, non-maximized state).

wsMinimized	The form appears in its minimized state.

wsMaximized	The form appears in its maximized state.


TForm events

TForm	Alphabetically	Legend

In TForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnResize

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TForm events

TForm	By object	Legend

OnActivate

OnClick

OnCloseQuery

OnClose

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TForm::OnActivate

TForm	Events

OnActivate occurs when the form receives focus.

Syntax

__property Classes::TNotifyEvent OnActivate;

Description

Use OnActivate to perform special processing when the form receives focus.


OnClick

OnClick occurs when the form is clicked.

Description

Use OnClick to perform special processing when the form is clicked.


TForm::OnClose

TForm	Events

OnClose occurs when the form closes.

Syntax

__property TCloseEvent OnClose;

Description

Use OnClose to perform special processing when the form closes.


TForm::OnCloseQuery

TForm	Events

OnCloseQuery occurs during the OnClose event.

Syntax

__property TCloseQueryEvent OnCloseQuery;

Description

Use OnCloseQuery to specify the conditions under which the form can close.


TForm::OnCreate

TForm	Events

OnCreate occurs when the form is created.

Syntax

__property Classes::TNotifyEvent OnCreate;

Description

Use OnCreate to to perform special processing when the form receives focus.


OnDblClick

OnDblClick occurs when the form is double-clicked.

Description

Use OnDblClick to perform special processing when the form is double-clicked.


TForm::OnDeactivate

TForm	Events

OnDeactivate occurs when the form loses focus.

Syntax

__property Classes::TNotifyEvent OnDeactivate;

Description

Use OnDeactivate to to perform special processing when the form loses focus.


TForm::OnDestroy

TForm	Events

OnDestroy occurs when the form is destroyed.

Syntax

__property Classes::TNotifyEvent OnDestroy;

Description

Use OnDestroy to to perform special processing when the form is destroyed.


OnDragDrop

OnDragDrop occurs when the form is the target of a drag-and-drop operation.

Description

Use OnDragDrop to perform special processing when the form is the target of a drag-and-drop operation.


OnDragOver

OnDragOver occurs when the form is beneath a drag operation.

Description

Use OnDragOver to perform special processing when the form is beneath a drag operation.


TForm::OnHide

TForm	Events

OnHide occurs when the form is hidden (that is, when the form’s Visible property is set to false).

Syntax

__property Classes::TNotifyEvent OnHide;

Description

Use OnHide to perform special processing when the form is hidden (that is, when the form’s Visible property is set to false).


OnKeyDown

OnKeyDown occurs when a key is held down while the form has focus.

Description

Use OnKeyDown to perform special processing when a key is held down while the form has focus.


OnKeyPress

OnKeyPress occurs when a key is pressed while the form has focus.

Description

Use OnKeyPress to perform special processing when a key is pressed while the form has focus.


OnKeyUp

OnKeyUp occurs when a key is released (after being pressed or held down) while the form has focus.

Description

Use OnKeyPress to perform special processing when a key is released (after being pressed or held down) while the form has focus.


OnMouseDown

OnMouseDown occurs when a mouse key is pressed while the form has focus.

Description

Use OnMouseDown to perform special processing when a mouse key is pressed while the form has focus.


OnMouseMove

OnMouseMove occurs when the mouse moves while the form has focus.

Description

Use OnMouseDown to perform special processing when the mouse moves while the form has focus.


OnMouseUp

OnMouseUp occurs when a mouse button is released while the form has focus.

Description

Use OnMouseUp to perform special processing when a mouse button is released while the form has focus..


TForm::OnPaint

TForm	Events

OnPaint occurs when the form is redrawn.

Syntax

__property Classes::TNotifyEvent OnPaint;

Description

Use OnPaint to perform special processing when the form is redrawn.


TForm::OnResize

TForm	Events

OnResize occurs when the form is resized.

Syntax

__property Classes::TNotifyEvent OnResize;

Description

Use OnResize to perform special processing when the form is resized.


TForm::OnShow

TForm	Events

OnShow occurs when the form is shown (that is, when the form’s Visible property is set to true).

Syntax

__property Classes::TNotifyEvent OnShow;

Description

Use OnShow to perform special processing when the form is shown (that is, when the form’s Visible property is set to true).


TForm methods

TForm	Alphabetically

In TForm

~TForm

ArrangeIcons

Cascade

Close

CloseQuery

CreateNew

DefocusControl

FocusControl

GetFormImage

Hide

Next

Previous

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

TForm

Tile

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TForm methods

TForm	By object

~TForm

ArrangeIcons

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseQuery

Close

ContainsControl

ControlAtPos

CreateNew

DefaultHandler

DefocusControl

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FocusControl

Focused

FreeInstance

FreeNotification

Free

GetFormImage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocusedControl

SetFocus

SetTextBuf

ShowModal

Show

TForm

Tile

UpdateControlState

Update


TForm::ArrangeIcons

TForm	Methods

ArrangeIcons arranges the icons of minimized MDI child forms.

Syntax

void __fastcall ArrangeIcons(void);

Description

Use ArrangeIcons to arrange the icons of minimized MDI child forms so they are evenly spaced and don't overlap.

ArrangeIcons works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Cascade

TForm	Methods

Cascade arranges MDI child forms so they overlap.

Syntax

void __fastcall Cascade(void);

Description

Use Cascade to arrange MDI child forms so they overlap.

Cascade works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Close

TForm	Methods	See also

Close closes a form.

Syntax

void __fastcall Close(void);

Description

Use Close to close a form.

Close calls the CloseQuery method to determine if the form can close. If CloseQuery returns false, the close operation is aborted. Otherwise, the OnClose event occurs.

The CloseAction parameter of the OnClose event controls how the form is actually closed.

Note

When the main form of the application is closed, the application terminates.


TForm::CloseQuery

TForm	Methods	See also

CloseQuery returns a Boolean value specifying whether the form can close.

Syntax

System::Boolean __fastcall CloseQuery(void);

Description

Use CloseQuery to determine whether the form can close. If the form can close, CloseQuery returns true; otherwise, CloseQuery returns false.

For an MDI parent form, CloseQuery calls the CloseQuery method on the form’s MDI children to determine the return value.


TForm::CreateNew

TForm	Methods	See also

CreateNew creates and initializes a new TForm object.

Syntax

Description

Use CreateNew to create and initialize a new TForm object.

AOwner is the owner of the TForm object.

CreateNew performs the following tasks:

•	Calls the TScrollingWinControl.Create method, passing it AOwner.

•	Sets the Left, Top, Width, and Height properties to 0, 0, 320, and 240, respectively.

•	Sets the WindowState property to wsNormal, the Visible property to false, and the Ctrl3d property to true, the BorderIcons property to [biSystemMenu, biMinimize, biMaximize], and the BorderStyle property to bsSizeable.

•	Allocates memory for the Icon and Canvas properties.

•	Sets the Icon.OnChange event to IconChanged.

•	Sets the TControl.ControlStyle property to [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks].

•	Sets the Canvas.Control property to Self.

•	Sets the PixelsPerInch property to the value of the Screen.PixelsPerInch property and the PrintScale property to poProportional.

•	Calls the Screen.AddForm method, passing it Self.


TForm::DefocusControl

TForm	Methods	See also

DefocusControl removes focus from a control on the form.

Syntax

void __fastcall DefocusControl(Controls::TWinControl *Control, System::Boolean Removing);

Description

Use DefocusControl to remove focus from a control on the form.

Control is the control from which to remove focus. If Control is the form’s active control, the form’s ActiveControl property is set to NULL.

Removing is a Boolean value specifying whether to set focus to the control’s parent.


TForm::FocusControl

TForm	Methods	See also

FocusControl sets focus to a control on the form.

Syntax

void __fastcall FocusControl(Controls::TWinControl *Control);

Description

Use FocusControl to set focus to a control on the form.

Control is a TWinControl object encapsulating the control upon which to set focus.


TForm::GetFormImage

TForm	Methods	See also

GetFormImage is a bitmap of the form as it appears when printed.

Syntax

Graphics::TBitmap *__fastcall GetFormImage(void);


TForm::Hide

TForm	Methods	See also

Hide hides the form.

Syntax

void __fastcall Hide(void);

Description

Hide sets the Visible property to false..


TForm::Next

TForm	Methods

Next sets focus to the next MDI child form.

Syntax

void __fastcall Next(void);

Description

Use Next to set focus the next MDI child form.

Next works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Previous

TForm	Methods

Previous sets focus to the previous MDI child form.

Syntax

void __fastcall Previous(void);

Description

Use Previous to set focus the previous MDI child form.

Previous works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Print

TForm	Methods	See also

Print prints the form.

Syntax

void __fastcall Print(void);


TForm::Release

TForm	Methods

Release destroys the form and frees its associated memory.

Syntax

void __fastcall Release(void);

Description

Use Release to destroy the form and free its associated memory.

Release is much like the Free method except that Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing.


TForm::SendCancelMode

TForm	Methods

SendCancelMode cancels modes on the form.

Syntax

void __fastcall SendCancelMode(Controls::TControl *Sender);

Description

Use SendCancelMode to release the mouse capture and cancel scroll bar input and menu processing on the form.


TForm::SetFocus

TForm	Methods	See also

SetFocus sets focus to the form.

Syntax

virtual void __fastcall SetFocus(void);

Description

Use SetFocus to set focus to the form.

SetFocus calls the SetFocus method of the active control, if one exists.

To determine whether the form has focus, use the Active property.


TForm::SetFocusedControl

TForm	Methods	See also

SetFocusedControl sets focus to a control on the form.

Syntax

System::Boolean __fastcall SetFocusedControl(Controls::TWinControl *Control);

Description

Use SetFocusedControl to set focus to a control on the form.


TForm::Show

TForm	Methods	See also

Show shows the form.

Syntax

void __fastcall Show(void);

Description

Use Show to set the form’s Visible property to true and to bring the form to the front of other forms on the screen.


TForm::ShowModal

TForm	Methods	See also

ShowModal shows a form as a modal form.

Syntax

System::Integer __fastcall ShowModal(void);

Description

Use ShowModal to show a form as a modal form, which means the user must put the form away before the application can continue to run.

To close a modal form, set its ModalResult property to a nonzero value.

ShowModal returns the ModalResult property of the form.


TForm::Tile

TForm	Methods	See also

Tile arranges MDI child forms so that they are all the same size.

Syntax

void __fastcall Tile(void);

Description

Use Tile to arrange MDI child forms so that they are all the same size. Tiled forms completely fill up the client area of the parent form. How the forms arrange themselves depends upon the values of their TileMode properties.

Tile works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::TForm

TForm	Methods	See also

TForm creates a new TForm object.

Syntax

__fastcall virtual TForm(Classes::TComponent *AOwner);

Description

Use TForm to create a new TForm object.


TForm::~TForm

TForm	Methods	See also

~TForm frees the memory associated with the TForm object.

Syntax

__fastcall virtual ~TForm(void);

Description

Do not call ~TForm directly. Instead, use the delete keyword on the object, which causes ~TForm to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TForm example

TForm


TGraphicField

Hierarchy	Properties	Methods	Events	See also

The TGraphicField component represents a graphics field in a dataset.

Header

vcl/dbtables.hpp

Description

Graphics fields are a form of binary large object (BLOB) field where the data includes a BLOB header describing the encoding of the graphical value. TGraphicField differs from its immediate ancestor TBlobField only in having a DataType of ftGraphic. As a descendent of TBlobField, TGraphicField includes many properties, methods, and events that are useful for managing the value and properties of a BLOB field in a database.


TGraphicField properties

TGraphicField	Alphabetically	Legend

Derived from TBlobField

AsString

AsVariant

BlobType

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TGraphicField properties

TGraphicField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

BlobType

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TGraphicField events

TGraphicField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TGraphicField events

TGraphicField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TGraphicField methods

TGraphicField	Alphabetically

In TGraphicField

~TGraphicField

TGraphicField

Derived from TBlobField

Assign

Clear

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

SetText

Derived from TField

AssignValue

FocusControl

GetData

IsValidChar

SetData

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicField methods

TGraphicField	By object

~TGraphicField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SaveToFile

SaveToStream

SetData

SetFieldType

SetText

TGraphicField


TGraphicField::TGraphicField

TGraphicField	Methods	See also

TGraphicField creates a new TGraphicField object.

Syntax

__fastcall virtual TGraphicField(Classes::TComponent *AOwner);

Description

Use TGraphicField to create a new TGraphicField object.


TGraphicField::~TGraphicField

TGraphicField	Methods	See also

~TGraphicField frees the memory associated with the TGraphicField object.

Syntax

__fastcall virtual ~TGraphicField(void);

Description

Do not call ~TGraphicField directly. Instead, use the delete keyword on the object, which causes ~TGraphicField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBlobField


TGraphicField example

TGraphicField


TGraphic

Hierarchy	Properties	Methods	Events	See also

MAIN ISSUE IS THAT WE NEED TO EXPLAIN HOW THE TPICTURE WORKS WITH THE DESCENDENTS OF TGRAPHIC AND THEN ALSO MAKE A COMMENT ABOUT THE CLIPBOARD (PROBABLY)

Header

vcl/graphics.hpp

TGraphic is the abstract base class type for Borland C++ Builder graphic objects such as icons, bitmaps and metafiles that can store and display visual images.

Description

TGraphic encapsulates methods . . . . For this purpose TGraphic defines methods that provide for . . . Properties of TGraphic provide information about the state and size of the graphic image.

TGraphic also introduces methods that work with TPicture objects and the Clipboard . . .

As an abstract class TGraphic cannot be instantiated. Descendent graphic objects . . . For . . . choose a descendent graphic object according to the specific . . . needs.

When the type of graphic (bitmap, icon, or metafile) is known, store the graphic in its specific type object (TBitmap, TIcon, or TMetafile, respectively). Otherwise, use a TPicture object which can hold any type of TGraphic.


TGraphic properties

TGraphic	Alphabetically	Legend

In TGraphic

Empty

Height

Modified

Width


TGraphic properties

TGraphic	By object	Legend

Empty

Height

Modified

Width


TGraphic::Empty

TGraphic	Properties

Empty specifies whether the graphics object contains a graphic.

Syntax

__property System::Boolean Empty;

Description

Each descendent graphic object defines its own ‘Get’ method to access the Empty property. OK


TGraphic::Height

TGraphic	Properties

Height specifies the vertical size of the graphic in pixels.

Syntax

__property System::Integer Height;

Description

Each descendent graphic object defines its own ‘Get’ and ‘Set’ methods to access the Height property. OK


TGraphic::Modified

TGraphic	Properties

Modified specifies if the graphics object has been changed or edited.

Syntax

__property System::Boolean Modified;

Description

If Modified is true, the graphics object has changed. If Modified is false, the graphics object is in the same state as when the object was loaded.

The Modified property indicates only if bitmap objects have been modified. Modified is not true if the graphics object contains an icon or metafile graphic, even if they have been modified. (WEIRD, i dont see this)

If the graphics object was modified, save the changes to a file with the SaveToFile method. The next time the application runs, it can load the graphic from the file with the LoadFromFile method.


TGraphic::Width

TGraphic	Properties

Width determines the maximum width of the graphics object in pixels.

Syntax

__property System::Integer Width;

Description

Each descendent graphic object defines its own ‘Get’ and ‘Set’ methods to access the Width property. OK


TGraphic events

TGraphic	Alphabetically

In TGraphic

OnChange


TGraphic events

TGraphic	By object

OnChange


TGraphic::OnChange

TGraphic	Events

OnChange occurs when a bitmap is modified.

Syntax

__property Classes::TNotifyEvent OnChange;

Description

Use OnChange to write a handler to

see modified . . . NOT-OK


TGraphic methods

TGraphic	Alphabetically

In TGraphic

~TGraphic

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

SaveToClipboardFormat

SaveToFile

SaveToStream

TGraphic

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphic methods

TGraphic	By object

~TGraphic

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SaveToClipboardFormat

SaveToFile

SaveToStream

TGraphic


TGraphic::LoadFromClipboardFormat

TGraphic	Methods	See also

TGraphic introduces LoadFromClipboardFormat as an abstract method.

Syntax

virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer

Description

Each descendent graphic object defines a LoadFromClipboardFormat method that replaces the current graphic image with the graphic indicated by AData, which it loads from the Clipboard.

(this has to do with TPicture and the RegisterClipboardFormat method too) . . . The format for the new graphic object must be registered with the Clipboard in the RegisterClipboardFormat method, or an exception is raised. NOT-OK


TGraphic::LoadFromFile

TGraphic	Methods

LoadFromFile loads a graphic object stored in a file.

Syntax

virtual void __fastcall LoadFromFile(const System::AnsiString Filename);

Description

LoadFromFile reads the file specified in FileName and loads the data into the graphics object. NOT-OK


TGraphic::LoadFromStream

TGraphic	Methods

TGraphic introduces LoadFromStream as an abstract method.

Syntax

virtual void __fastcall LoadFromStream(Classes::TStream *Stream);

Description

Each descendent graphic object defines a LoadFromStream method that loads a graphics object from Stream. OK


TGraphic::SaveToClipboardFormat

TGraphic	Methods

TGraphic introduces SaveToClipboardFormat as an abstract method.

Syntax

virtual void __fastcall SaveToClipboardFormat(System::Word &AFormat, System::Integer &AData, System::Integer

Description


TGraphic::SaveToFile

TGraphic	Methods

SaveToFile saves a graphics object to a file.

Syntax

virtual void __fastcall SaveToFile(const System::AnsiString Filename);

Description

SaveToFile specifies the file to save as the value of FileName. NOT-OK


TGraphic::SaveToStream

TGraphic	Methods

TGraphic introduces SaveToStream as an abstract method.

Syntax

virtual void __fastcall SaveToStream(Classes::TStream *Stream);

Description

Each descendent graphic object defines a SaveToStream method that saves a the object to a Stream. OK


TGraphic::TGraphic

TGraphic	Methods	See also

TGraphic creates a new TGraphic object.

Syntax

__fastcall virtual TGraphic(void);

Description

Use TGraphic to create a new TGraphic object.


TGraphic::~TGraphic

TGraphic	Methods	See also

~TGraphic frees the memory associated with the TGraphic object.

Syntax

__fastcall virtual ~TGraphic(void);

Description

Do not call ~TGraphic directly. Instead, use the delete keyword on the object, which causes ~TGraphic to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TGraphic example

TGraphic


TGraphicsObject

Hierarchy	Methods	Events

A TGraphicsObject object is the abstract base class for the Borland C++ Builder encapsulation of the three main Windows graphics tools: the TBrush, TFont, and TPen objects.

Header

vcl/graphics.hpp

In addition to these methods and events, this object also has the methods that apply to all objects. A TGraphicsObject object is a direct descendent of TPersistent.


TGraphicsObject events

TGraphicsObject	Alphabetically

In TGraphicsObject

OnChange


TGraphicsObject events

TGraphicsObject	By object

OnChange


TGraphicsObject::OnChange

TGraphicsObject	Events

Syntax

__property Classes::TNotifyEvent OnChange;


TGraphicsObject methods

TGraphicsObject	Alphabetically

In TGraphicsObject

~TGraphicsObject

TGraphicsObject

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicsObject methods

TGraphicsObject	By object

~TGraphicsObject

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TGraphicsObject


TGraphicsObject::TGraphicsObject

TGraphicsObject	Methods	See also

TGraphicsObject creates a new TGraphicsObject object.

Syntax

__fastcall TGraphicsObject(void);

Description

Use TGraphicsObject to create a new TGraphicsObject object.


TGraphicsObject::~TGraphicsObject

TGraphicsObject	Methods	See also

~TGraphicsObject frees the memory associated with the TGraphicsObject object.

Syntax

__fastcall virtual ~TGraphicsObject(void);

Description

Do not call ~TGraphicsObject directly. Instead, use the delete keyword on the object, which causes ~TGraphicsObject to be invoked automatically.


Hierarchy

TObject

TPersistent


TGraphicsObject example

TGraphicsObject


TGridDataLink

Hierarchy	Properties	Methods	See also

TGridDataLink is a helper object that helps manage data events and that maintains the field mapping for a TCustomDBGrid object.

Header

vcl/dbgrids.hpp

Description

TGridDataLink is tailored to work with a TCustomDBGrid. It should only be used by the TCustomDBGrid class.


TGridDataLink properties

TGridDataLink	Alphabetically	Legend

In TGridDataLink

DefaultFields

FieldCount

Fields

SparseMap

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TGridDataLink properties

TGridDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

DefaultFields

Editing

FieldCount

Fields

ReadOnly

RecordCount

SparseMap


TGridDataLink::DefaultFields

TGridDataLink	Properties	See also

DefaultFields indicates whether the dataset’s underlying field components are generated dynamically when the dataset is opened.

Syntax

__property System::Boolean DefaultFields;

Description

Read DefaultFields to determine whether or not a dataset uses dynamically generated field components, or persistent field components. If DefaultFields is true, the dataset uses dynamically allocated field components. If DefaultFields is false, the dataset uses persistent field components or the custom field mapping contains unmapped fields.


TGridDataLink::FieldCount

TGridDataLink	Properties	See also

FieldCount indicates the number of entries in the field map.

Syntax

__property System::Integer FieldCount;

Description

Read FieldCount to determine the number of entries in the field map. Used in conjunction with the Fields property, this is useful for applications that need to iterate over all of the mapped fields.

In design mode, FieldCount is the same as the number of columns in the TCustomDBGrid. In run mode, FieldCount can be greater than the number of columns. The field map can contain undefined fields, which do not appear as columns at runtime.


TGridDataLink::Fields

TGridDataLink	Properties	See also

Fields provides access to all the field components contained in in the field map.

Syntax

__property Db::TField * Fields[System::Integer I];

Description

Use Fields to access field components by index number. Fields is a zero-based array. If the SparseMap property is true, the field map may contain undefined fields. For these entries, Fields returns NULL.

If an application needs to access all the field components for each column of the TCustomDBGrid in order, Fields can be used in conjunction with the FieldCount property:


TGridDataLink::SparseMap

TGridDataLink	Properties	See also

SparseMap indicates that the TCustomDBGrid has customized the field map and that it may contain undefined fields.

Syntax

__property System::Boolean SparseMap;

Description

Read SparseMap to determine whether the field map is not a simple reflection of the underlying dataset. The TCustomDBGrid sets SparseMap when it builds the field map. SparseMap is false if the TCustomDBGrid builds a default field map directly from the dataset. Any changes to the field components associated with each column cause TCustomDBGrid to change SparseMap to true. When SparseMap is true, the field map may contain undefined fields if the column attributes indicate an invalid field name or an unassigned field component.


TGridDataLink methods

TGridDataLink	Alphabetically	Legend

In TGridDataLink

~TGridDataLink

ActiveChanged

AddMapping

ClearMapping

DataSetChanged

DataSetScrolled

EditingChanged

FocusControl

GetMappedIndex

LayoutChanged

Modified

RecordChanged

Reset

TGridDataLink

UpdateData

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGridDataLink methods

TGridDataLink	By object	Legend

~TGridDataLink

ActiveChanged

AddMapping

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearMapping

DataSetChanged

DataSetScrolled

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FocusControl

FreeInstance

Free

GetMappedIndex

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

TGridDataLink

UpdateData

UpdateRecord


TGridDataLink::ActiveChanged

TGridDataLink	Methods	See also

ActiveChanged informs the TCustomDBGrid of changes in the Active property.

Syntax

virtual void __fastcall ActiveChanged(void);

procedure ActiveChanged; override;

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the LinkActive method of the TCustomDBGrid object that owns this TGridDataLink.


TGridDataLink::AddMapping

TGridDataLink	Methods	See also

AddMapping adds a field component to the end of the field map.

Syntax

System::Boolean __fastcall AddMapping(const System::AnsiString FieldName);

Description

Applications should not call AddMapping directly, as this would cause the field map to become out of sync with the columns in the TCustomDBGrid. The TCustomDBGrid calls AddMapping iteratively to build a field map that corresponds to its columns.


TGridDataLink::ClearMapping

TGridDataLink	Methods	See also

ClearMapping empties the field map and frees any associated memory.

Syntax

void __fastcall ClearMapping(void);

Description

Applications should not call ClearMapping directly, as this would cause the field map to become out of sync with the columns of the TCustomDBGrid. The TCustomDBGrid calls ClearMapping first, every time it regenerates the field map.


TGridDataLink::DataSetChanged

TGridDataLink	Methods	See also

DataSetChanged informs the TCustomDBGrid of changes to the dataset.

Syntax

virtual void __fastcall DataSetChanged(void);

Description

Applications should not call DataSetChanged directly. Changes to the contents of the dataset trigger this method automatically. DataSetChanged informs the TCustomDBGrid of changes to the dataset by calling its DataChanged method.


TGridDataLink::DataSetScrolled

TGridDataLink	Methods	See also

DataSetScrolled informs the TCustomDBGrid that the dataset has finished scrolling.

Syntax

virtual void __fastcall DataSetScrolled(System::Integer Distance);

Description

Applications should not call the DataSetScrolled procedure directly. This procedure is called automatically after the dataset for the TCustomDBGrid scrolls. TGridDataLink informs the TCustomDBGrid that a scroll of the dataset has just occurred by calling its Scroll method.


TGridDataLink::EditingChanged

TGridDataLink	Methods	See also

EditingChanged informs the TCustomDBGrid of changes in the editing state of the dataset.

Syntax

virtual void __fastcall EditingChanged(void);

Description

Applications should not call the EditingChanged procedure directly. Changes in the Editing property trigger this procedure, which in turn calls the EditingChanged method of the TCustomDBGrid object that owns this TGridDataLink.


TGridDataLink::FocusControl

TGridDataLink	Methods	See also

FocusControl brings up the editor and gives a field control in the TCustomDBGrid focus.

Syntax

virtual void __fastcall FocusControl(Db::TFieldRef Field);

Description

Call the FocusControl procedure to bring up the editor for the representation of Field in the TCustomDBGrid. FocusControl causes Field to be selected in the TCustomDBGrid, and then tells the TCustomDBGrid to bring up the editor.


TGridDataLink::GetMappedIndex

TGridDataLink	Methods	See also

GetMappedIndex provides the index of a field component in the dataset that corresponds to an index within the field map.

Syntax

System::Integer __fastcall GetMappedIndex(System::Integer ColIndex);

Use GetMappedIndex on an index into the field map to get an index into the dataset for the same field component. Both the field map and the dataset are zero-based arrays. If an entry in the field map is an undefined field, GetMappedIndex returns -1.


TGridDataLink::LayoutChanged

TGridDataLink	Methods	See also

LayoutChanged informs the TCustomDBGrid after the layout of the TCustomDBGrid has changed in a way that affects the representation of the dataset.

Syntax

virtual void __fastcall LayoutChanged(void);

Description

Applications should not call the LayoutChanged method directly. The TCustomDBGrid that owns the TGridDataLink calls this method automatically when there are changes to the layout that affect the representation of the dataset. LayoutChanged allows the TCustomDBGrid to respond to these changes by calling its LayoutChanged method.


TGridDataLink::Modified

TGridDataLink	Methods	See also

Modified keeps track of whether there are changes to the data which have not been posted to the database.

Syntax

void __fastcall Modified(void);

Description

Applications should not call Modified directly. Modified is called automatically whenever the TCustomDBGrid starts editing one of its fields. Modified allows the TGridDataLink to keep track of whether there are any edits that have not been posted.


TGridDataLink::RecordChanged

TGridDataLink	Methods	See also

RecordChanged informs the TCustomDBGrid of changes in the current record or field of the DataSource.

Syntax

virtual void __fastcall RecordChanged(Db::TField *Field);

Description

Applications should not call RecordChanged directly. It is called automatically when the contents of the current record change. RecordChanged informs the TCustomDBGrid of these changes by calling its RecordChanged method so that it can make any necessary updates to its display.


TGridDataLink::Reset

TGridDataLink	Methods	See also

Reset cancels out of any pending edits to the dataset that have not been posted.

Syntax

void __fastcall Reset(void);

Description

Reset is triggered by user actions that cancel out of any pending edits to the dataset.


TGridDataLink::UpdateData

TGridDataLink	Methods	See also

UpdateData allows the TCustomDBGrid to post changes to the dataset.

Syntax

virtual void __fastcall UpdateData(void);

Description

Applications should not call the UpdateData procedure directly. It is called automatically when pending changes need to be posted to the dataset. UpdateData calls the UpdateData method of the TCustomDBGrid object that owns this TGridDataLink.


TGridDataLink::TGridDataLink

TGridDataLink	Methods	See also

TGridDataLink creates a new TGridDataLink object.

Syntax

__fastcall TGridDataLink(TCustomDBGrid *AGrid);

Description

Use TGridDataLink to create a new TGridDataLink object.


TGridDataLink::~TGridDataLink

TGridDataLink	Methods	See also

~TGridDataLink frees the memory associated with the TGridDataLink object.

Syntax

__fastcall virtual ~TGridDataLink(void);

Description

Do not call ~TGridDataLink directly. Instead, use the delete keyword on the object, which causes ~TGridDataLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TGridDataLink example

TGridDataLink


TGroupBox

Hierarchy	Properties	Methods	Events	See also

TGroupBox creates a Windows group box.

Header

vcl/stdctrls.hpp

Description

The TGroupBox component represents a standard Windows group box, used to group related controls on a form. When you place another control component within a group box, the group box becomes the parent of that component.


TGroupBox properties

TGroupBox	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TGroupBox properties

TGroupBox	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TGroupBox events

TGroupBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TGroupBox events

TGroupBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TGroupBox methods

TGroupBox	Alphabetically

In TGroupBox

~TGroupBox

TGroupBox

Derived from TCustomGroupBox

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGroupBox methods

TGroupBox	By object

~TGroupBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TGroupBox

UpdateControlState

Update


TGroupBox::TGroupBox

TGroupBox	Methods	See also

TGroupBox creates a new TGroupBox object.

Syntax

__fastcall virtual TGroupBox(Classes::TComponent *AOwner);

Description

Use TGroupBox to create a new TGroupBox object.


TGroupBox::~TGroupBox

TGroupBox	Methods	See also

~TGroupBox frees the memory associated with the TGroupBox object.

Syntax

__fastcall virtual ~TGroupBox(void);

Description

Do not call ~TGroupBox directly. Instead, use the delete keyword on the object, which causes ~TGroupBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox


TGroupBox example

TGroupBox


TGraphicControl

Hierarchy	Properties	Methods	See also

The TGraphicControl component is an abstract nonwindowed control used to derive nonwindowed custom controls.

Header

vcl/controls.hpp

Description

The primary purpose of most graphic controls is to display text or graphics. Borland C++ Builder controls that descend from TGraphicControl include TBevel, TImage, TPaintBox, TShape, TSpeedButton, and TCustomLabel, from which TDBText and TLabel are derived.

In addition to everything inherited from the abstract TControl component, TGraphicControl provides a Canvas property that provides ready access to the control's drawing surface and a virtual Paint method called in response to WM_PAINT messages received by a parent control.

Graphic controls cannot receive the input focus, nor can they contain other controls. Because a graphic control doesn’t need a Windows handle, it’s demand on system resources is lessened and painting a graphic control is quicker than painting a windowed control.

To create a control that can receive input focus or contain other controls, but which needs a Canvas property and a Paint method, derive a class from TCustomControl.


TGraphicControl properties

TGraphicControl	Alphabetically	Legend

In TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TGraphicControl properties

TGraphicControl	By object	Legend

Align

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

Height

Hint

Left

Name

Owner

Parent

ShowHint

Tag

Top

Visible

Width


TGraphicControl::Canvas

TGraphicControl	Properties	See also

The Canvas property is a TCanvas object that presents a drawing surface for the graphic control to draw on.

Syntax

__property Graphics::TCanvas * Canvas;

Description

Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas encapsulates a Windows device context, providing all the tools and methods needed for drawing and painting.

Since TGraphicControl does not have a window handle, when Canvas needs a window handle in order to obtain a handle to a device context, it uses the window of the control’s Parent.

Canvas is a protected property that can be redeclared as public in descendants of TGraphicControl.


TGraphicControl methods

TGraphicControl	Alphabetically	Legend

In TGraphicControl

~TGraphicControl

Paint

TGraphicControl

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicControl methods

TGraphicControl	By object	Legend

~TGraphicControl

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TGraphicControl

Update


TGraphicControl::Paint

TGraphicControl	Methods	See also

The Paint method of TGraphicControl provides an interface for a method that renders the image of the graphic control.

Syntax

virtual void __fastcall Paint(void);

Description

A graphic control receives WM_PAINT messages from its Parent, when the Parent wants the graphic control to paint itself. Graphic controls respond to WM_PAINT messages by initializing the control's canvas and calling the Paint method. Override the Paint method to specify how the image of the control should be drawn.

The Paint method does nothing more than provide an interface to be overridden by derived objects so that they can draw an image of themselves. All graphic controls that can be instantiated must override Paint to draw the image of the control.


TGraphicControl::TGraphicControl

TGraphicControl	Methods	See also

TGraphicControl creates a new TGraphicControl object.

Syntax

__fastcall virtual TGraphicControl(Classes::TComponent *AOwner);

Description

Use TGraphicControl to create a new TGraphicControl object.


TGraphicControl::~TGraphicControl

TGraphicControl	Methods	See also

~TGraphicControl frees the memory associated with the TGraphicControl object.

Syntax

__fastcall virtual ~TGraphicControl(void);

Description

Do not call ~TGraphicControl directly. Instead, use the delete keyword on the object, which causes ~TGraphicControl to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl


TGraphicControl example

TGraphicControl


THeaderControl

Hierarchy	Properties	Methods	Events	See also

THeaderControl is a containter for THeaderSection objects. It provides a set of resizable column headers.

Header

vcl/comctrls.hpp

Description

A THeaderControl is a set of column headers that the user can resize at run time. Each header is represented by a THeaderSection object listed in the Sections property.

The header sections can be positioned above columns or fields of information. For example, header sections could be placed over a list box (TListBox). Because THeaderControl provides a generic header element that can be paired with virtually any other visual component, run-time manipulation of the header sections is not automatically extended to the components beneath it; if, for example, you want the column beneath a header section to be resized whenever the header section is resized, you will have to write a custom OnSectionResize event handler to accomplish this.


THeaderControl properties

THeaderControl	Alphabetically	Legend

In THeaderControl

Canvas

Sections

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THeaderControl properties

THeaderControl	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

Sections

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THeaderControl::Canvas

THeaderControl	Properties	See also

Provides run-time access to the header control’s drawing surface.

Syntax

__property Graphics::TCanvas * Canvas;

Description

The read-only Canvas property provides access to the header control’s drawing surface that you can use when implementing a handler for the OnDrawSection event.


THeaderControl::Sections

THeaderControl	Properties	See also

A list of header sections (column headings).

Syntax

__property THeaderSections * Sections;

Description

The Sections property holds a THeaderSections—that is, a collection of THeaderSection objects. At design time, you can add, remove, or modify header sections with the Sections editor. To open the Sections editor, select the Sections property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.


THeaderControl events

THeaderControl	Alphabetically	Legend

In THeaderControl

OnDrawSection

OnResize

OnSectionClick

OnSectionResize

OnSectionTrack

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


THeaderControl events

THeaderControl	By object	Legend

OnDragDrop

OnDragOver

OnDrawSection

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnSectionClick

OnSectionResize

OnSectionTrack

OnStartDrag


THeaderControl::OnDrawSection

THeaderControl	Events	See also

OnDrawSection occurs when a header section needs to be redrawn.

Syntax

__property TDrawSectionEvent OnDrawSection;

Description

The OnDrawSection event occurs when a header section needs to be redisplayed—for example, when the user selects or resizes a section. OnDrawSection occurs only if the header section’s Style property is set to hsOwnerDraw.

TDrawSectionEvent is the type of the OnDrawSection property.


THeaderControl::OnResize

THeaderControl	Events	See also

OnResize occurs when the header control is resized.

Syntax

__property Classes::TNotifyEvent OnResize;

Description

The OnResize event occurs when the size of the header control changes at runtime.


THeaderControl::OnSectionClick

THeaderControl	Events	See also

OnSectionClick occurs when one of the header control’s sections is clicked.

Syntax

__property TSectionNotifyEvent OnSectionClick;

Description

The OnSectionClick event occurs when a header section is clicked at run time. To disable a section from being clicked set its AllowClick property to false.

TSectionNotifyEvent is the type of the OnSectionClick and OnSectionResize events.


THeaderControl::OnSectionResize

THeaderControl	Events	See also

OnSectionResize occurs when one of the header control’s sections is resized.

Syntax

__property TSectionNotifyEvent OnSectionResize;

Description

The OnSectionResize event occurs when a header section is resized at run time. This happens when the user positions the mouse pointer between two sections and drags their border to the right or left.

TSectionNotifyEvent is the type of the OnSectionClick and OnSectionResize events.


THeaderControl::OnSectionTrack

THeaderControl	Events	See also

OnSectionTrack occurs as one of the header control’s sections is being resized.

Syntax

__property TSectionTrackEvent OnSectionTrack;

Description

The OnSectionTrack event tracks the dragging of a header section’s border as it happens. OnSectionTrack occurs when the mouse pointer is positioned between two header sections and the left mouse button is depressed.

OnSectionTrack is of type TSectionTrackEvent, whose Width and State parameters indicate the size of the header section (in pixels) and the status of the event. The State property can take three values:

Value	Meaning

tsTrackBegin	The border has not yet been dragged.

tsTrackMove	The border is being dragged.

tsTrackEnd	The border is no longer being dragged.

Use OnSectionTrack when you want something to happen at run time as a header section is being resized.


THeaderControl methods

THeaderControl	Alphabetically

In THeaderControl

~THeaderControl

THeaderControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderControl methods

THeaderControl	By object

~THeaderControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

THeaderControl

UpdateControlState

Update


THeaderControl::THeaderControl

THeaderControl	Methods	See also

THeaderControl creates a new THeaderControl object.

Syntax

__fastcall virtual THeaderControl(Classes::TComponent *AOwner);

Description

Use THeaderControl to create a new THeaderControl object.


THeaderControl::~THeaderControl

THeaderControl	Methods	See also

~THeaderControl frees the memory associated with the THeaderControl object.

Syntax

__fastcall virtual ~THeaderControl(void);

Description

Do not call ~THeaderControl directly. Instead, use the delete keyword on the object, which causes ~THeaderControl to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


THeaderControl example

THeaderControl


THeaderSection

Hierarchy	Properties	Methods	See also

THeaderSection represents a section of a header control.

Header

vcl/comctrls.hpp

Description

Each THeaderControl uses a THeaderSections to maintain a collection of THeaderSection objects.


THeaderSection properties

THeaderSection	Alphabetically	Legend

In THeaderSection

Alignment

AllowClick

Left

MaxWidth

MinWidth

Right

Style

Text

Width

Derived from TCollectionItem

Collection

Index


THeaderSection properties

THeaderSection	By object	Legend

Alignment

AllowClick

Collection

Index

Left

MaxWidth

MinWidth

Right

Style

Text

Width


THeaderSection::Alignment

THeaderSection	Properties	See also

Specifies how text is aligned within the header section.

Syntax

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the header section.

taCenter	Center text in the header section.

taRightJustify	Align text on the right side of the header section.


THeaderSection::AllowClick

THeaderSection	Properties	See also

Allows section to be clicked at run time.

Syntax

__property System::Boolean AllowClick;

Description

If AllowClick is set to true (the default), the header section can be clicked with the mouse at run time. Header sections behave like buttons when clicked: They loose their raised borders and appear depressed on the form. To attach functionality to the clicking of header sections, write an event handler for the header control’s OnSectionClick event.


THeaderSection::Left

THeaderSection	Properties	See also

The horizontal position of the header section’s left edge.

Syntax

__property System::Integer Left;

Description

The Left property is the horizontal coordinate of the header section’s left edge, relative to the left border of the the header control and measured in pixels.


THeaderSection::MaxWidth

THeaderSection	Properties	See also

The maximum width of the header section.

Syntax

__property System::Integer MaxWidth;

Description

Sets the maximum width, in pixels, for the header section. If MaxWidth = MinWidth, the header section cannot be resized at run time.


THeaderSection::MinWidth

THeaderSection	Properties	See also

The minimum width of the header section.

Syntax

__property System::Integer MinWidth;

Description

Sets the minimum width, in pixels, for the header section. If MinWidth = MaxWidth, the header section cannot be resized at run time.


THeaderSection::Right

THeaderSection	Properties	See also

The horizontal position of the header section’s right edge.

Syntax

__property System::Integer Right;

Description

The Right property is the horizontal coordinate of the header section’s right edge, relative to the left border of the the header control and measured in pixels. The Right value is the value of Left plus the value of Width.


THeaderSection::Style

THeaderSection	Properties	See also

Determines how the header section’s text is displayed.

Syntax

__property THeaderSectionStyle Style;

Description

If Style is set to hsText (the default), the string contained in the Text property is displayed in the header section, using the alignment specified by Alignment. The font is determined by the header control’s Font property.

If Style is set to hsOwnerDraw, the content displayed in the header section is drawn at run time on the header control’s canvas by code in a THeaderControl.OnDrawSection event handler.


THeaderSection::Text

THeaderSection	Properties	See also

The header section’s caption.

Syntax

__property System::AnsiString Text;

The Text property contains a string that identifies the header section or the column beneath it. If Style is set to hsText, the value of Text appears in the header section.


THeaderSection::Width

THeaderSection	Properties	See also

The width of the header section.

Syntax

__property System::Integer Width;

Description

The Width property determines the default width of the header section, in pixels. Header sections can be resized at run time by dragging their borders.


THeaderSection methods

THeaderSection	Alphabetically

In THeaderSection

~THeaderSection

Assign

THeaderSection

Derived from TCollectionItem

ClassInfo

Derived from TObject

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderSection methods

THeaderSection	By object

~THeaderSection

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

THeaderSection


THeaderSection::Assign

THeaderSection	Methods	See also

Copies the contents of the source header section to a new header section.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Assign creates a new header section with the same Alignment, AllowClick, MaxWidth, MinWidth, Style, Text, and Width values as the source object.


THeaderSection::THeaderSection

THeaderSection	Methods	See also

THeaderSection creates a new THeaderSection object.

Syntax

__fastcall virtual THeaderSection(Classes::TCollection *Collection);

Description

Use THeaderSection to create a new THeaderSection object.


THeaderSection::~THeaderSection

THeaderSection	Methods	See also

~THeaderSection frees the memory associated with the THeaderSection object.

Syntax

__fastcall virtual ~THeaderSection(void);

Description

Do not call ~THeaderSection directly. Instead, use the delete keyword on the object, which causes ~THeaderSection to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


THeaderSection example

THeaderSection


THeaderSections

Hierarchy	Properties	Methods	See also

THeaderSections is a container for THeaderSection objects.

Header

vcl/comctrls.hpp

Description

Each THeaderSections holds a collection of THeaderSection objects in a THeaderControl. THeaderSections maintains an index of the header sections in its Items array. The Count property contains the number of header sections in the collection. At design time, use the header control’s Sections editor to add, remove, or modify header sections.


THeaderSections properties

THeaderSections	Alphabetically	Legend

In THeaderSections

Items

Derived from TCollection

Count


THeaderSections properties

THeaderSections	By object	Legend

Count

Items


THeaderSections::Items

THeaderSections	Properties	See also

An index of the header sections in the collection.

Syntax

__property THeaderSection * Items[System::Integer Index];

Description

The value of the Index parameter corresponds to the Index property of THeaderSection. It represents the position of the header section in the header.


THeaderSections methods

THeaderSections	Alphabetically

In THeaderSections

~THeaderSections

Add

THeaderSections

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderSections methods

THeaderSections	By object

~THeaderSections

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

THeaderSections


THeaderSections::Add

THeaderSections	Methods	See also

Creates a new THeaderSection instance and adds it to the Items array.

Syntax

THeaderSection *__fastcall Add(void);

Description

Add returns the new header section. At design time, use the header control’s Sections editor to add sections to the header.


THeaderSections::THeaderSections

THeaderSections	Methods	See also

THeaderSections creates a new THeaderSections object.

Syntax

__fastcall THeaderSections(THeaderControl *HeaderControl);

Description

Use THeaderSections to create a new THeaderSections object.


THeaderSections::~THeaderSections

THeaderSections	Methods	See also

~THeaderSections frees the memory associated with the THeaderSections object.

Syntax

__fastcall virtual ~THeaderSections(void);

Description

Do not call ~THeaderSections directly. Instead, use the delete keyword on the object, which causes ~THeaderSections to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


THeaderSections example

THeaderSections


THeader

Hierarchy	Properties	Methods	Events

The THeader component is a sectioned visual control that displays text and allows each section to be resized with the mouse. THeader is provided for backward compatibility.  Use THeaderControl component in Microsoft Windows 95 and Windows NT applications.

Header

vcl/extctrls.hpp

At design time, resize a section by clicking the right mouse button on a section border and dragging to the new size. At run time, the user can resize the header by clicking and dragging with the left mouse button. The widths of the other sections that are not resized remain unchanged.

The Sections property specifies the sections of a header. The AllowResize property enables or prevents the user from resizing sections at run time. When a section is resized, an OnSizing event occurs. After a section has been resized, an OnSized event occurs.

To use a header you should attach RefSyn to these event handlers. One use would be to align text under a header. When the header is resized, you would realign the text in the OnSized event handler. To move the text as the header is being resized, realign the text in the OnSizing event handler.


THeader properties

THeader	Alphabetically	Legend

In THeader

AllowResize

BorderStyle

Sections

SectionWidth

Width

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THeader properties

THeader	By object	Legend

Align

AllowResize

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

Sections

SectionWidth

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THeader::AllowResize

THeader	Properties

Determines if the user can modify the size of the header at run time with the mouse.

Syntax

__property System::Boolean AllowResize;

If AllowResize is false, the sections within a header can't be resized. If AllowResize is true, clicking a border of a header section and dragging it left or right changes the width of the section. The default value is true.


THeader::BorderStyle

THeader	Properties

Determines whether the header control has a border.

Syntax

__property Forms::TBorderStyle BorderStyle;

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

If you set the AutoSize property of an edit box or hot-key to true, the edit box or hot-key resizes automatically when the font size of the text changes. You must set the value of the BorderStyle property to fsSingle, or else AutoSize has no effect.


THeader::Sections

THeader	Properties

Alist of strings that contain the text for the sections of a header.

Syntax

__property Classes::TStrings * Sections;

The number of lines of the string list determines the number of sections of the header. If the string list is empty, the header has one blank section. If this string list contains one or more lines, the text of each lineis in its own section. The first line is in the leftmost section, the second line is in the next section to the right, and so on.


THeader::SectionWidth

THeader	Properties

Determines the width in pixels of the sections of a header.

Syntax

__property System::Integer SectionWidth[System::Integer X];

X is an index into the sections, from 0 to the number of sections - 1. For example, the index of the first section is 0, the second section is 1, and so on.


THeader::Width

THeader	Properties

Determines the horizontal size of the control or form in pixels.

Syntax

When you increase the Width property value, the form or control becomes wider. If you decrease the value, the form or control becomes narrower.

[DOUBLE CHECK THIS INFO BELOW . . . IT MIGHT APPLY TO THEADERCONTROLS INSTEAD OF THEADERS]

If the width is set to a value too narrow to show even one character of text then the first character and the ellipsis will appear to the right of the section boundary of that header section.


THeader events

THeader	Alphabetically	Legend

In THeader

OnSized

OnSizing


THeader events

THeader	By object	Legend

OnSized

OnSizing


THeader::OnSized

THeader	Events

Syntax

__property TSectionEvent OnSized;


THeader::OnSizing

THeader	Events

Syntax

__property TSectionEvent OnSizing;


THeader methods

THeader	Alphabetically

In THeader

~THeader

THeader

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeader methods

THeader	By object

~THeader

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

THeader

UpdateControlState

Update


THeader::THeader

THeader	Methods	See also

THeader creates a new THeader object.

Syntax

__fastcall virtual THeader(Classes::TComponent *AOwner);

Description

Use THeader to create a new THeader object.


THeader::~THeader

THeader	Methods	See also

~THeader frees the memory associated with the THeader object.

Syntax

__fastcall virtual ~THeader(void);

Description

Do not call ~THeader directly. Instead, use the delete keyword on the object, which causes ~THeader to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


THeader example

THeader


THintWindow

Hierarchy	Properties	Methods

The THintWindow component is a a simple custom control descended from TCustomControl. A hint window is the small popup window that appears over a control at run time if that control has its ShowHint property set to true.

Header

vcl/controls.hpp

In addition to everything inherited from TCustomControl, THintWindow provides several properties and methods. The hint window makes public the inherited Canvas, Caption, and Color properties. THintWindow overrides the protected CreateParams and Paint methods and introduces three new methods: ActivateHint, which the application uses to display a hint window, IsHintMsg, which allows the hint window to monitor application messages so it can determine when to disappear, and ReleaseHandle, which destroys the hint window's window handle.

If you want to derive a new kind of hint-window component for your applications, derive a new type from THintWindow, override methods as needed, and then assign the new type to the HintWindowClass variable at application startup.


THintWindow properties

THintWindow	Alphabetically	Legend

Derived from TCustomControl

Canvas

Derived from TWinControl

public, read-only	Brush

public, read-only	ClientOrigin

public, read-only	ClientRect

public, read-only	ControlCount

public, read-only	Controls

public, read-only	Handle

published	HelpContext

public, read-only	Showing

public	TabOrder

public	TabStop

Derived from TControl

public	Align

public	BoundsRect

public	Caption

public	ClientHeight

public	ClientWidth

public	Color

public	ControlState

public	ControlStyle

published	Cursor

public	Enabled

published	Height

published	Hint

published	Left

published	Name

public	Parent

public	ShowHint

published	Top

public	Visible

published	Width

Derived from TComponent

public, read-only	ComponentCount

public	ComponentIndex

public, read-only	Components

public, read-only	ComponentState

public, read-only	ComponentStyle

public	DesignInfo

public, read-only	Owner

published	Tag


THintWindow properties

THintWindow	By object	Legend

public, read-only	Brush

public, read-only	ClientOrigin

public, read-only	ClientRect

public, read-only	ControlCount

public, read-only	Controls

public, read-only	Handle

published	HelpContext

public, read-only	Showing

public	TabOrder

public	TabStop

public	Align

public	BoundsRect

public	Caption

public	ClientHeight

public	ClientWidth

public	Color

public	ControlState

public	ControlStyle

published	Cursor

public	Enabled

published	Height

published	Hint

published	Left

published	Name

public	Parent

public	ShowHint

published	Top

public	Visible

published	Width

public, read-only	ComponentCount

public	ComponentIndex

public, read-only	Components

public, read-only	ComponentState

public, read-only	ComponentStyle

public	DesignInfo

public, read-only	Owner

published	Tag

Canvas


THintWindow methods

THintWindow	Alphabetically	Legend

In THintWindow

~THintWindow

ActivateHint

IsHintMsg

ReleaseHandle

public	THintWindow

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THintWindow methods

THintWindow	By object	Legend

public	THintWindow

~THintWindow

ActivateHint

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsHintMsg

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

ReleaseHandle

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

UpdateControlState

Update


THintWindow::ActivateHint

THintWindow	Methods

The ActivateHint method activates the hint window, setting its caption to the string passed in AHint and its bounding rectangle to Rect. By default, ActivateHint calls the SetWindowPos API function to display the hint window.

Syntax

virtual void __fastcall ActivateHint(const Windows::TRect &Rect, const System::AnsiString AHint);

After activation, all aplication messages go through the hint window's IsHintMsg method, which determines whether to deactivate the hint window.

To change the appearance of the hint window, override the hint window's Paint method. The hint window should not modify the rectangle passed in Rect, since the application has explicitly set the rectangle.


THintWindow::IsHintMsg

THintWindow	Methods

The IsHintMsg method checks application messages while the hint window is on the screen (after the call to ActivateHint). Upon seeing a mouse, keyboard, command, or activation message, IsHintMsg returns true, causing the application to hide the hint window.

Syntax

virtual System::Boolean __fastcall IsHintMsg(Windows::TMsg &Msg);


ReleaseHandle

The ReleaseHandle method calls the DestroyHandle method to destroy the window handle used by the hint window.


THintWindow::THintWindow

THintWindow	Methods	See also

THintWindow creates a new THintWindow object.

Syntax

__fastcall virtual THintWindow(Classes::TComponent *AOwner);

Description

Use THintWindow to create a new THintWindow object.


THintWindow::~THintWindow

THintWindow	Methods	See also

~THintWindow frees the memory associated with the THintWindow object.

Syntax

__fastcall virtual ~THintWindow(void);

Description

Do not call ~THintWindow directly. Instead, use the delete keyword on the object, which causes ~THintWindow to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


THintWindow example

THintWindow


THandleStream

Hierarchy	Properties	Methods	See also

The THandleStream object is a stream object that enables applications to read from and write to files that are identified by a file handle.

Header

vcl/classes.hpp

Description

Use THandleStream to access files that have already been opened. Opening a file provides a file handle that is used to identify the file associated with a THandleStream object. For example, to get the date a file was created, an application must open the file, obtain a handle, and use that handle to call the FileGetDate function. THandleStream allows applications to use a uniform stream interface when performing file I/O.

When working with files that are not already opened, use TFileStream instead.


THandleStream properties

THandleStream	Alphabetically	Legend

In THandleStream

Handle

Derived from TStream

Position

Size


THandleStream properties

THandleStream	By object	Legend

Handle

Position

Size


THandleStream::Handle

THandleStream	Properties	See also

Handle specifies the file handle for the file the stream reads from and writes to.

Syntax

__property System::Integer Handle;

Description

Read Handle to get the file handle for calling file management functions that require one. To read from or write to the file, use the methods of the THandleStream object.

Handle is a read-only property. The handle property cannot be changed to allow the handle stream to switch from reading to writing or vice versa. For example, to change from a file handle that is opened in read-only mode to one that is opened in write mode:

1	Free the stream object.

2	Call FileClose to close the file.

3	Re-open the file in write mode, and use the handle to create a new instance of a handle stream. Alternately, open a TFileStream object for the file, specifying a write mode for the stream.

Note

Do not call the FileClose function on the Handle until after the THandleStream object has been destroyed.


THandleStream methods

THandleStream	Alphabetically

In THandleStream

~THandleStream

Read

Seek

THandleStream

Write

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THandleStream methods

THandleStream	By object

~THandleStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

THandleStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


THandleStream::Read

THandleStream	Methods	See also

Read reads up to Count bytes of data from the disk file associated with the handle stream into Buffer.

Syntax

virtual System::Longint __fastcall Read(void *Buffer, System::Longint Count);

Description

Use Read to read data from the disk file associated with the handle stream when the number of bytes in the file is not known. Read transfers up to Count bytes from the file, starting at the current postion, and then advances the current postion in the file by the number of bytes actually transferred. Read returns the number of bytes actually transferred, which may be less than Count if the end of file marker is encountered.

All other data-reading methods of a handle stream (ReadBuffer, ReadComponent) call Read to do the actual reading.

Note

Do not call Read if the file handle was obtained by opening the file in fmOpenWrite mode.


THandleStream::Seek

THandleStream	Methods	See also

Seek resets the current position of the handle stream.

Syntax

virtual System::Longint __fastcall Seek(System::Longint Offset, System::Word Origin);

Description

Use Seek to move the current position within the file associated with the handle stream by the indicated offset. Seek allows an application to read from or write to a particular location within the file.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values::

Value	Meaning

soFromBeginning	Offset is from the beginning of the file. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the file. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the file. Offset must be <= 0 to indicate a number of bytes before the end of the file.

Seek returns the new value of the Position property, the new current position in the file.


THandleStream::Write

THandleStream	Methods	See also

Write writes Count bytes from the Buffer to the current position in the file.

Syntax

virtual System::Longint __fastcall Write(const void *Buffer, System::Longint Count);

Description

Use Write to write Count bytes to the file associated with the handle stream, starting at the current position. After writing to the file, Write advances the current position in the file by the number bytes written, and returns the number of bytes written.

All other data-writing methods of a handle stream (WriteBuffer, WriteComponent) call Write to do the actual writing.

Note

Do not call Write if the file handle was obtained by opening the file in fmOpenRead mode.


THandleStream::THandleStream

THandleStream	Methods	See also

THandleStream creates a new THandleStream object.

Syntax

__fastcall THandleStream(System::Integer AHandle);

Description

Use THandleStream to create a new THandleStream object.


THandleStream::~THandleStream

THandleStream	Methods	See also

~THandleStream frees the memory associated with the THandleStream object.

Syntax

__fastcall virtual ~THandleStream(void);

Description

Do not call ~THandleStream directly. Instead, use the delete keyword on the object, which causes ~THandleStream to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TStream


THandleStream example

THandleStream


THotKey

Hierarchy	Properties	Methods	Events

The THotKey component is used to set a shortcut property at run time. The user can enter a key combination, typically consisting of a modifier key (such as Ctrl, Alt, or Shift) and an accompanying key (such as a character key, an arrow key, a function key, etc.), into the hot-key control. The hot key is associated with another control by assigning its HotKey property to the desired control’s shortcut property.

Header

vcl/comctrls.hpp

To select a key combination at design-time use the HotKey and Modifiers properties. The names of the keys will appear in the hot-key control. To invalidate specific modifier keys use the InvalidKeys property. To change the key combination at run-time hold down the Alt, Ctrl or Shift keys or combinations of them and type a letter or number. The HotKey property can then be assigned to the shortcut property of a menu item, for example.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls. The THotKey component is an indirect descendent of TWinControl.


THotKey properties

THotKey	Alphabetically	Legend

Derived from TCustomHotKey

AutoSize

HotKey

InvalidKeys

Modifiers

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THotKey properties

THotKey	By object	Legend

Align

AutoSize

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

HotKey

InvalidKeys

Left

Modifiers

Name

Owner

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THotKey events

THotKey	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnMouseDown

OnMouseMove

OnMouseUp


THotKey events

THotKey	By object	Legend

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


THotKey methods

THotKey	Alphabetically

In THotKey

~THotKey

THotKey

Derived from TCustomHotKey

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THotKey methods

THotKey	By object

~THotKey

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

THotKey

UpdateControlState

Update


THotKey::THotKey

THotKey	Methods	See also

THotKey creates a new THotKey object.

Syntax

__fastcall virtual THotKey(Classes::TComponent *AOwner);

Description

Use THotKey to create a new THotKey object.


THotKey::~THotKey

THotKey	Methods	See also

~THotKey frees the memory associated with the THotKey object.

Syntax

__fastcall virtual ~THotKey(void);

Description

Do not call ~THotKey directly. Instead, use the delete keyword on the object, which causes ~THotKey to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomHotKey


THotKey example

THotKey


TIconOptions

Hierarchy	Properties	Methods

The TIconOptions object contains properties pertaining to the icons displayed in a list view. The ViewStyle of the list view must be set to either vsIcon or vsSmallIcons for these options to apply. Use the Arrangement property to have the icons align at the top or the left of the list view. Set AutoArrange to true to have the icons arranged automatically when icons are added, moved, deleted or otherwise redrawn. Set WrapText to true to have the caption of the item wrap rather than display on one line when it exceeds the width of the icon.

Header

vcl/comctrls.hpp

In addition to these properties, methods, and events, this object also has the methods that apply to all objects.


TIconOptions properties

TIconOptions	Alphabetically	Legend

In TIconOptions

Arrangement

AutoArrange

WrapText


TIconOptions properties

TIconOptions	By object	Legend

Arrangement

AutoArrange

WrapText


TIconOptions::Arrangement

TIconOptions	Properties

Determines where the items are to be aligned in the list view.

Syntax

__property TIconArrangement Arrangement;

The Arrangement property of the IconOptions object for the list view allows you to specify a TIconArrangement. The list view must have a ViewStyle of vsIcon or vsSmallIcon to have an alignment for icons take affect. These are the possible values of Arrangement:

Value	Meaning

iaTop	Items are aligned left to right in rows at the top of the list view control

iaLeft	Items are aligned in columns top to bottom at the left of the list view control


TIconOptions::AutoArrange

TIconOptions	Properties

Determines if icons in a list view are automatically arranged when a list item is added, removed, or moved.

Syntax

__property System::Boolean AutoArrange;

The list view must have its ViewStyle property set to vsIcon, or setting this property has no effect. If AutoArrange is true, the icons are automatically arranged. If AutoArrange is false, the icons are not arranged automatically.


TIconOptions::WrapText

TIconOptions	Properties

Determines whether the item’s caption wraps around or is displayed all on one line.

Syntax

__property System::Boolean WrapText;

The list view must have its ViewStyle property set to vsIcon, or setting this property has no effect. If WrapText is true, the text wraps. If WrapText is false, the text is displayed all on one line.


TIconOptions methods

TIconOptions	Alphabetically

In TIconOptions

~TIconOptions

TIconOptions

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIconOptions methods

TIconOptions	By object

~TIconOptions

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIconOptions


TIconOptions::TIconOptions

TIconOptions	Methods	See also

TIconOptions creates a new TIconOptions object.

Syntax

__fastcall TIconOptions(TCustomListView *AOwner);

Description

Use TIconOptions to create a new TIconOptions object.


TIconOptions::~TIconOptions

TIconOptions	Methods	See also

~TIconOptions frees the memory associated with the TIconOptions object.

Syntax

__fastcall virtual ~TIconOptions(void);

Description

Do not call ~TIconOptions directly. Instead, use the delete keyword on the object, which causes ~TIconOptions to be invoked automatically.


Scope

Published


Hierarchy

TObject

TPersistent


TIconOptions example

TIconOptions


TIcon

Hierarchy	Properties	Methods	Events

TIcon is an encapsulation of a Windows HICON.

Header

vcl/graphics.hpp

Description

TIcon contains an icon graphic (.ICO file format).

The height and width in pixels of the icon are specified by the Height and Width properties, respectively.

To load an icon from a file, call the LoadFromFile method. To save an icon to a file, call SaveToFile.

To draw an icon on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TIcon as a parameter.

When the icon is modified, an OnChange event occurs.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects. A TIcon object is an indirect descendent of TPersistent.


TIcon properties

TIcon	Alphabetically	Legend

In TIcon

Empty

Handle

Height

Width

Derived from TGraphic

Modified


TIcon properties

TIcon	By object	Legend

Empty

Handle

Height

Modified

Width


Emtpy

Specifies whether the icon object contains an icon.

Description

If Empty is true, no icon has been loaded into the icon object. If Empty is false, an icon object does contain an icon.


TIcon::Handle

TIcon	Properties

Provides access to the Windows GDI icon handle, so for accessing the GDI bitmap object.

Syntax

__property System::Integer Handle;

Description

To use a Windows API function that requires the handle of an icon object, pass the handle from the Handle property of an TIcon object.


TIcon::Height

TIcon	Properties

Specifies the vertical size of the icon in pixels.

Syntax

Description


TIcon::Width

TIcon	Properties

Specifies the horizontal size of the icon in pixels.

Syntax

Description


TIcon events

TIcon	Alphabetically

Derived from TGraphic

OnChange


TIcon events

TIcon	By object

OnChange


TIcon methods

TIcon	Alphabetically

In TIcon

~TIcon

Assign

LoadFromStream

ReleaseHandle

SaveToStream

TIcon

Derived from TGraphic

LoadFromClipboardFormat

LoadFromFile

SaveToClipboardFormat

SaveToFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIcon methods

TIcon	By object

~TIcon

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

SaveToClipboardFormat

SaveToFile

SaveToStream

TIcon


TIcon::Assign

TIcon	Methods

[GENERIC - modified for TIcon - the last paragraph]

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assigns an object to the icon.

The Assign method assigns one object to another. The general form of a call to Assign is

Description

which tells the Destination object to assign the contents of the Source object to itself.

In general, the statement "Destination = Source" is not the same as the statement "Destination.Assign(Source)". The statement "Destination = Source" makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object references by Source into the object referenced by Destination.

If Destination is a property of some object, however, and that property is not a reference to another object (such as the ActiveControl property of a form, or the DataSource property of a data-aware control), then the statement "Destination = Source" is the same as "Destination.Assign(Source)". Consider these statements:

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at run time only if the objects involved "know" how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at run time.

An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is an icon.


TIcon::LoadFromStream

TIcon	Methods

LoadFromStream loads the icon from a stream.

Syntax

virtual void __fastcall LoadFromStream(Classes::TStream *Stream);

Description

Specify the stream from which the icon is to be loaded as the value of Stream.


TIcon::ReleaseHandle

TIcon	Methods

Returns the handle to the icon so that the TIcon object no longer knows about the handle.

Syntax

System::Integer __fastcall ReleaseHandle(void);

Description


TIcon::SaveToStream

TIcon	Methods

Saves the icon to a stream.

Syntax

virtual void __fastcall SaveToStream(Classes::TStream *Stream);

Description

Specify the stream to save the icon to as the value of Stream.


TIcon::TIcon

TIcon	Methods	See also

TIcon creates a new TIcon object.

Syntax

__fastcall virtual TIcon(void);

Description

Use TIcon to create a new TIcon object.


TIcon::~TIcon

TIcon	Methods	See also

~TIcon frees the memory associated with the TIcon object.

Syntax

__fastcall virtual ~TIcon(void);

Description

Do not call ~TIcon directly. Instead, use the delete keyword on the object, which causes ~TIcon to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TIcon example

TIcon


TIconImage

Hierarchy	Methods

Header

vcl/graphics.hpp

Description


TIconImage methods

TIconImage	Alphabetically

In TIconImage

~TIconImage

TIconImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIconImage methods

TIconImage	By object

~TIconImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIconImage


TIconImage::TIconImage

TIconImage	Methods	See also

TIconImage creates a new TIconImage object.

Syntax

__fastcall TIconImage(void);

Description

Use TIconImage to create a new TIconImage object.


TIconImage::~TIconImage

TIconImage	Methods	See also

~TIconImage frees the memory associated with the TIconImage object.

Syntax

__fastcall virtual ~TIconImage(void);

Description

Do not call ~TIconImage directly. Instead, use the delete keyword on the object, which causes ~TIconImage to be invoked automatically.


Hierarchy

TObject

TInternalImage


TIconImage example

TIconImage


TImage

Hierarchy	Properties	Methods	Events

The TImage component displays a graphical image on a form. The image that appears is the value of the Picture property. If you want the image control to resize to fit the current image, set the AutoSize property to true. If you want to resize the image to completely fill an image control when the control is larger than the native size of the image, use the Stretch property.

Header

vcl/extctrls.hpp

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all controls.


TImage properties

TImage	Alphabetically	Legend

In TImage

AutoSize

Canvas

Center

Picture

Stretch

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TImage properties

TImage	By object	Legend

Align

AutoSize

BoundsRect

Canvas

Center

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Owner

ParentShowHint

Parent

Picture

PopupMenu

ShowHint

Stretch

Tag

Top

Visible

Width


TImage::AutoSize

TImage	Properties

Determines whether the image resizes to accommodate the image it contains.

Syntax

__property System::Boolean AutoSize;

When the AutoSize property is true, the image control resizes to accommodate the image it contains (specified by the Picture property). When AutoSize is false, the image control remains the same size, regardless of the size of the image. If the image control is smaller than the image, only the portion of the picture that fits inside the image component will be visible.

Note

You must remember to set the AutoSize property to true before loading the picture, or AutoSize has no effect.

To resize the image to fill an image control completely when the control is larger than the native size of the image, use the Stretch property.


TImage::Picture

TImage	Properties

Determines the image that appears on the image control.

Syntax

__property Graphics::TPicture * Picture;

The property value is a TPicture object which can contain an icon, metafile, bitmap graphic, or user-defined graphic object.


TImage events

TImage	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TImage events

TImage	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TImage methods

TImage	Alphabetically

In TImage

~TImage

TImage

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TImage methods

TImage	By object

~TImage

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TImage

Update


TImage::TImage

TImage	Methods	See also

TImage creates a new TImage object.

Syntax

__fastcall virtual TImage(Classes::TComponent *AOwner);

Description

Use TImage to create a new TImage object.


TImage::~TImage

TImage	Methods	See also

~TImage frees the memory associated with the TImage object.

Syntax

__fastcall virtual ~TImage(void);

Description

Do not call ~TImage directly. Instead, use the delete keyword on the object, which causes ~TImage to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TImage example

TImage


TImageList

Hierarchy	Properties	Methods	Events	See also

The TImageList component is a collection of same-sized images, each of which can be referred to by its index.

Header

vcl/controls.hpp

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks used to draw images transparently (icon style).

The image list is capable of holding a large number of same sized images and retrieving them via their index within the range 0 to n - 1. The image list also has methods to facilitate storing, retrieving, and drawing of the stored images.

The TImageList is derived from TCustomImageList and exposes many of the protected properties and methods of the TCustomImageList.


TImageList properties

TImageList	Alphabetically	Legend

Derived from TCustomImageList

AllocBy

BkColor

BlendColor

Count

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TImageList properties

TImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

DesignInfo

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

Width


TImageList events

TImageList	Alphabetically	Legend

Derived from TCustomImageList

OnChange


TImageList events

TImageList	By object	Legend

OnChange


TImageList methods

TImageList	Alphabetically

In TImageList

~TImageList

TImageList

Derived from TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

BeginDrag

Clear

CreateSize

Delete

DragLock

DragMove

DragUnlock

Draw

DrawOverlay

EndDrag

FileLoad

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetMaskBitmap

GetResource

HandleAllocated

HideDragImage

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResourceLoad

SetDragImage

ShowDragImage

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TImageList methods

TImageList	By object

~TImageList

AddIcon

AddImages

AddMasked

Add

Assign

BeginDrag

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

CreateSize

DefaultHandler

Delete

DestroyComponents

Destroying

Dispatch

DragLock

DragMove

DragUnlock

DrawOverlay

Draw

EndDrag

FieldAddress

FileLoad

FindComponent

FreeInstance

FreeNotification

Free

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetMaskBitmap

GetParentComponent

GetResource

HandleAllocated

HasParent

HideDragImage

InheritsFrom

InitInstance

InsertComponent

InsertIcon

InsertMasked

Insert

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

ReplaceIcon

ReplaceMasked

Replace

ResourceLoad

SetDragImage

ShowDragImage

TImageList

UnRegisterChanges


TImageList::TImageList

TImageList	Methods	See also

TImageList creates a new TImageList object.

Syntax

__fastcall virtual TImageList(Classes::TComponent *AOwner);

Description

Use TImageList to create a new TImageList object.


TImageList::~TImageList

TImageList	Methods	See also

~TImageList frees the memory associated with the TImageList object.

Syntax

__fastcall virtual ~TImageList(void);

Description

Do not call ~TImageList directly. Instead, use the delete keyword on the object, which causes ~TImageList to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomImageList


TImageList example

TImageList


TIndexDef

Hierarchy	Properties	Methods	See also

The TIndexDef object is an index definition that describes an index in a database table.

Header

vcl/dbtables.hpp

Description

Use the properties and methods of an index definition to:

•	Determine the name of an index.

•	Identify the fields that make up the index, or the dBASE expression that orders the index.

•	Determine the characteristics of the index.

TIndexDef is used by TTable objects when creating or managing the indexes of a database table.


TIndexDef properties

TIndexDef	Alphabetically	Legend

In TIndexDef

Expression

Fields

Name

Options

Source


TIndexDef properties

TIndexDef	By object	Legend

Expression

Fields

Name

Options

Source


TIndexDef::Expression

TIndexDef	Properties	See also

Expression contains the string that is a dBASE key expression.

Syntax

__property System::AnsiString Expression;

Description

Read Expression to learn the key expression of a dBASE expression index.

A key expression for a dBASE table is a field name, or a combination of field names, functions, and operators that specifies how the index orders records in the table. If the table is not a dBASE table, Expression is an empty string.

If the Options property set does not contain the value ixExpression, the Expression property string returned is an empty string. To learn the fields in an index that is not a dBASE expression index, use the Fields property.

Note

For more information about key expressions, see your dBASE documentation.


TIndexDef::Fields

TIndexDef	Properties	See also

Fields identifies the fields that comprise the index.

Syntax

__fastcall TIndexDef(TIndexDefs *Owner, const System::AnsiString Name, const System::AnsiString Fields

Description

Read Fields to determine the fields that make up the index. The string returned can be either the names of the fields, or the numbers of the field. When numbers are used, the numbers correspond to the physical field numbers in the table; Multiple fields in the string are separated by semicolons (";").

If the index is based on a dBASE key expression, the Fields property does not specify the fields that make up the index. Thus, if the Options property set contains the ixExpression value, Fields returns an empty string. To determine the specification of a dBASE expression index, use the Expression property instead.


TIndexDef::Name

TIndexDef	Properties	See also

Name identifies the name of the index definition.

Syntax

__fastcall TIndexDef(TIndexDefs *Owner, const System::AnsiString Name, const System::AnsiString Fields

Description

Use Name to determine the name of the index. This value is the name used by the physical database tables to identify the index.

Note

For dBASE maintained indexes, Name refers to the tag name of the index. For Paradox tables, the Name of the primary key is an empty string.


TIndexDef::Options

TIndexDef	Properties	See also

Options describes the characteristics of the index.

Syntax

,  TIndexOptions Options);

Description

Read Options to learn the attributes of the index. Options is a set, which can be empty, or can contain one or more of these values:

Value	Description

ixPrimary	The index is the primary index of the table.

ixUnique	Each value in the index is unique; there are no duplicates.

ixDescending	The index is in descending order.

ixExpression	The index order depends of a dBASE key expression.

ixCaseInsensitive	The index is case insensitive.

Note

Different database drivers may support only a subset of these options. For example, with dBASE tables, ixCaseInsensitive is not supported.


TIndexDef::Source

TIndexDef	Properties	See also

Source contains the name of an dBASE maintained index.

Syntax

__property System::AnsiString Source;

Description

When the table uses dBASE .MDX indexes, Name indicates the index tag name and Source is the name of the index file. Source is applicable to dBASE table indexes only.


TIndexDef methods

TIndexDef	Alphabetically

In TIndexDef

~TIndexDef

TIndexDef

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIndexDef methods

TIndexDef	By object

~TIndexDef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIndexDef


TIndexDef::TIndexDef

TIndexDef	Methods	See also

TIndexDef creates a new TIndexDef object.

Syntax

__fastcall TIndexDef(TIndexDefs *Owner, const System::AnsiString Name, const System::AnsiString Fields

Description

Use TIndexDef to create a new TIndexDef object.


TIndexDef::~TIndexDef

TIndexDef	Methods	See also

~TIndexDef frees the memory associated with the TIndexDef object.

Syntax

__fastcall virtual ~TIndexDef(void);

Description

Do not call ~TIndexDef directly. Instead, use the delete keyword on the object, which causes ~TIndexDef to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TIndexDef example

TIndexDef


TIndexDefs

Hierarchy	Properties	Methods	See also

The TIndexDefs object holds the list of available index definitions for a table.

Header

vcl/dbtables.hpp

Description

Use the properties and methods of TIndexDefs to:

•	Access a specific index definition.

•	Determine how many index definitions this TIndexDefs object contains.

•	Add or delete index definitions.

•	Copy all index definitions from one TIndexDefs to another.

TIndexDefs is used by TTable objects when creating or managing the indexes of a database table.


TIndexDefs properties

TIndexDefs	Alphabetically	Legend

In TIndexDefs

Count

Items


TIndexDefs properties

TIndexDefs	By object	Legend

Count

Items


TIndexDefs::Count

TIndexDefs	Properties	See also

Count specifies the number of index definitions in this TIndexDefs object.

Syntax

__property System::Integer Count;

Description

Read Count to learn the number of indexes associated with the dataset. To iterate through all the index definitions in the Items array, use Count to control the loop variable.

Count is a read-only property. The value of Count is changed indirectly when adding or deleting index definitions.


TIndexDefs::Items

TIndexDefs	Properties	See also

Items is an array of pointers to the index definitions that describe each index of a table.

Syntax

__property TIndexDef * Items[System::Integer Index];

Description

Use Items to access a particular index definition. Specify the index definition to access with the Index parameter. Index is an integer identifying the index definition’s position in the list of index definitions, in the range 0 to Count - 1.

Items is a read-only property. The value of Items is changed indirectly when adding or deleting index definitions.


TIndexDefs methods

TIndexDefs	Alphabetically

In TIndexDefs

~TIndexDefs

Add

Assign

Clear

FindIndexForFields

IndexOf

TIndexDefs

Update

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIndexDefs methods

TIndexDefs	By object

~TIndexDefs

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

FindIndexForFields

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIndexDefs

Update


TIndexDefs::Add

TIndexDefs	Methods	See also

Add creates a new index definition object and adds it to the Items property of this TIndexDefs object.

Syntax

void __fastcall Add(const System::AnsiString Name, const System::AnsiString Fields,  TIndexOptions

Description

Applications should not need to call this method. When the dataset is opened, it calls Add to fill the Items array.

To add an index to the dataset, use the AddIndex method of the TTable object. To change the array of indexes when a new index has been added to the dataset, use the Update method instead.

Add creates an index definition and assigns the values passed in the Name, Fields, and Options parameters to the TIndexDef properties of the same names.

If an index definition with same name already exists, an EDatabaseError exception is raised.

The TIndexOptions type is the set of values that can be used in creating a new index. Options is a set, which can be empty, or can contain one or more of these values:

Value	Description

ixPrimary	The index is the primary index of the table.

ixUnique	Each value in the index is unique; there are no duplicates.

ixDescending	The index is in descending order.

ixExpression	The index order depends of a dBASE key expression.

ixCaseInsensitive	The index is case insensitive.

Note

Different database drivers may support only a subset of these options. For example, with dBASE tables, ixCaseInsensitive is not supported.


TIndexDefs::Assign

TIndexDefs	Methods	See also

Assign creates a new set of TIndexDef objects in Items array from the IndexDefs parameter.

Syntax

void __fastcall Assign(TIndexDefs *IndexDefs);

Description

Use Assign to copy one TIndexDefs object to another.

Assign removes all the index definitions for the Items property array and then copies the index definitions to Items. Specify the TIndexDefs object as the value of the IndexDefs parameter.


TIndexDefs::Clear

TIndexDefs	Methods	See also

Clear removes and frees all the index definitions in the Items property.

Syntax

void __fastcall Clear(void);

Description

Call Clear to remove all index definitions from the list of index definitions held in the Items array.


TIndexDefs::FindIndexForFields

TIndexDefs	Methods	See also

FindIndexForFields locates an index definition in the Items property array.

Syntax

TIndexDef *__fastcall FindIndexForFields(const System::AnsiString Fields);

Description

Use FindIndexForFields to search for the index that starts with the fields specified in the Fields parameter. If more than one field comprises the index, separate the fields with semicolons.

FindIndexForFields returns the index definition that exactly matches the specified fields in the order specified, if it exists. If no exact match is found, FindIndexForFields returns the first index that begins with the indicated fields. If no match can be found, FindIndexForFields raises an exception.


TIndexDefs::IndexOf

TIndexDefs	Methods	See also

IndexOf returns the position of the index definition in the Items property array.

Syntax

System::Integer __fastcall IndexOf(const System::AnsiString Name);

Description

Call IndexOf to determine the position of the index definition in the Items property array. IndexOf returns a value from zero (the first index definition) to Count - 1. Specify the name of the index as the value of the Name parameter.

If no index definition with the specified Name, the return value is -1.

Note

IndexOf finds an index based on the Name of the index. FindIndexForFields locates an index based on the names of the fields that comprise the index.


TIndexDefs::Update

TIndexDefs	Methods	See also

Update refreshes index definitions in Items to reflect the current state of the table.

Syntax

void __fastcall Update(void);

Description

Call Update when the set of indexes for the table may have changed. Update refreshes the index definitions without opening the table.


TIndexDefs::TIndexDefs

TIndexDefs	Methods	See also

TIndexDefs creates a new TIndexDefs object.

Syntax

__fastcall TIndexDefs(TTable *Table);

Description

Use TIndexDefs to create a new TIndexDefs object.


TIndexDefs::~TIndexDefs

TIndexDefs	Methods	See also

~TIndexDefs frees the memory associated with the TIndexDefs object.

Syntax

__fastcall virtual ~TIndexDefs(void);

Description

Do not call ~TIndexDefs directly. Instead, use the delete keyword on the object, which causes ~TIndexDefs to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TIndexDefs example

TIndexDefs


TIndexFiles

Hierarchy	Properties	Methods	Events

Header

vcl/dbtables.hpp

Description


TIndexFiles properties

TIndexFiles	Alphabetically	Legend

Derived from TStringList

Count

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

Text

Values


TIndexFiles properties

TIndexFiles	By object	Legend

CommaText

Count

Duplicates

Names

Objects

Sorted

Strings

Text

Values


TIndexFiles events

TIndexFiles	Alphabetically

Derived from TStringList

OnChange

OnChanging


TIndexFiles events

TIndexFiles	By object

OnChange

OnChanging


TIndexFiles methods

TIndexFiles	Alphabetically

In TIndexFiles

~TIndexFiles

Add

Clear

Delete

Insert

TIndexFiles

Derived from TStringList

Exchange

Find

IndexOf

Sort

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIndexFiles methods

TIndexFiles	By object

~TIndexFiles

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Find

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SaveToFile

SaveToStream

SetText

Sort

TIndexFiles


TIndexFiles::Add

TIndexFiles	Methods

Syntax

virtual System::Integer __fastcall Add(const System::AnsiString S);

Description


TIndexFiles::Clear

TIndexFiles	Methods

Syntax

virtual void __fastcall Clear(void);

Description


TIndexFiles::Insert

TIndexFiles	Methods

Syntax

virtual void __fastcall Insert(System::Integer Index, const System::AnsiString S);

Description


TIndexFiles::TIndexFiles

TIndexFiles	Methods	See also

TIndexFiles creates a new TIndexFiles object.

Syntax

__fastcall TIndexFiles(TTable *AOwner);

Description

Use TIndexFiles to create a new TIndexFiles object.


TIndexFiles::~TIndexFiles

TIndexFiles	Methods	See also

~TIndexFiles frees the memory associated with the TIndexFiles object.

Syntax

__fastcall virtual ~TIndexFiles(void);

Description

Do not call ~TIndexFiles directly. Instead, use the delete keyword on the object, which causes ~TIndexFiles to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings

TStringList


TIndexFiles example

TIndexFiles


TIniFile

Hierarchy	Properties	Methods	See also

TIniFile is a low-level wrapper for the 16-bit Windows 3.x INI file system that enables storage and retrieval of application-specific information and settings in an application-specific INI file.

Header

vcl/inifiles.hpp

Description

TIniFile enables handling the storage and retrieval of application-specific information and settings in a Windows 3.x INI file. The INI file text format is the standard way for Windows 3.x applications to store and retrieve application settings from session to session. An INI file stores information in logical groupings, called “sections.” For example, the WIN.INI file contains a section called “[Desktop]”. Within each section, actual data values are stored in named keys. Keys take the form:

The FileName passed to a TIniFile object when it is created is the name of the INI file for the application.

TIniFile provides a property and methods for reading from and writing to specific INI files, and for deleting entire sections in an INI file. In addition to these properties and methods, TIniFile inherits the methods of TObject.

Note

TIniFile is supported only for migration purposes and backward compatibility. Windows 95/NT replaces INI files with a system registry where all applications store and retrieve their settings. Applications that target Windows 95/NT should use the system registry instead of INI files. Borland C++ Builder provides two objects for handling the system registry. TRegistry encapsulates the system registry. TRegIniFile also encapsulates the registry, but provides an easier migration path for existing Windows 3.1 applications that are upgraded to Windows 95/NT.


TIniFile properties

TIniFile	Alphabetically	Legend

In TIniFile

FileName


TIniFile properties

TIniFile	By object	Legend

FileName


TIniFile::FileName

TIniFile	Properties	See also

Contains the name of the INI file from which to read and to which to write application-specific information.

Syntax

__fastcall TIniFile(const System::AnsiString FileName);

Description

Use FileName to examine the name of the INI file used by the application for its application settings and information. The methods that read and write INI file information automatically handle opening and closing the file specified by FileName.

Note

Usually INI files are stored in the \WINDOWS directory. To work with an INI file in another location, specify the full path name of the file in the FileName parameter passed to the Create method of TIniFile.


TIniFile methods

TIniFile	Alphabetically

In TIniFile

~TIniFile

DeleteKey

EraseSection

ReadBool

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

TIniFile

WriteBool

WriteInteger

WriteString

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIniFile methods

TIniFile	By object

~TIniFile

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DeleteKey

Dispatch

EraseSection

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBool

ReadInteger

ReadSections

ReadSection

ReadSectionValues

ReadString

TIniFile

WriteBool

WriteInteger

WriteString


TIniFile::DeleteKey

TIniFile	Methods	See also

Erases the data value that is associated with an INI file entry.

Syntax

void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident);

Description

Call DeleteKey to erase a data value associated with an INI file entry. Section is string containing the name of an INI file section, and Ident is a string containing the name of the key from for which to set a NULL value.

Note

Attempting to erase a data value in a non-existent section or attempting to erase data from a non-existent key are not errors. In these cases, DeleteKey creates the section and key and sets its initial value to an empty value.


TIniFile::EraseSection

TIniFile	Methods	See also

Erases an entire section of an INI file.

Syntax

void __fastcall EraseSection(const System::AnsiString Section);

Description

Call EraseSection to remove a section, all its keys, and their data values from an INI file. Section identifies the INI file section to remove. If a section cannot be removed, an exception is raised.


TIniFile::ReadBool

TIniFile	Methods	See also

Retrieves a Boolean value from an INI file.

Syntax

System::Boolean __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident

Description

Call ReadBool to read a Boolean value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the Boolean value. Default is the Boolean value to return if the:

•	Section does not exist.

•	Key does not exist.

•	Data value for the key is not assigned.


TIniFile::ReadInteger

TIniFile	Methods	See also

Retrieves an integer value from an INI file.

Syntax

System::Longint __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident

Description

Call ReadInteger to read an integer value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the integer value to return if the:

•	Section does not exist.

•	Key does not exist.

•	Data value for the key is not assigned.


TIniFile::ReadSection

TIniFile	Methods	See also

Reads all the key names from a specified section of an INI file into a string list.

Syntax

void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings *Strings);

Description

Call ReadSection to retrieve the names of all keys within a specified section of an INI file into a string list object.

Section identifies the section from which to retrieve a list of key names. Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile::ReadSections

TIniFile	Methods	See also

Reads the names of all sections in an INI file into a string list.

Syntax

void __fastcall ReadSections(Classes::TStrings *Strings);

Description

Call ReadSections to retrieve the names of all sections in an INI file into a string list object.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile::ReadSectionValues

TIniFile	Methods	See also

Reads the values from all keys within a section of an INI file into a string list.

Syntax

void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings *Strings);

Description

Call ReadSectionValues to read the values from all keys within a specified section of an INI file into a string list object. Section identifies the section in the file from which to read key values. Strings is the string list object into which to read the values.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile::ReadString

TIniFile	Methods	See also

Retrieves a string value from an INI file.

Syntax

System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString

Description

Call ReadString to read a string value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the:

•	Section does not exist.

•	Key does not exist.

•	Data value for the key is not assigned.


TIniFile::WriteBool

TIniFile	Methods	See also

Writes a Boolean value to an INI file.

Syntax

void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident, System::Boolean

Description

Call WriteBool to write a Boolean value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the Boolean value to write.

Note

Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteBool creates the section and key and sets its initial value to Value.


TIniFile::WriteInteger

TIniFile	Methods	See also

Writes an integer value to an INI file.

Syntax

void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident, System::Longint

Description

Call WriteInteger to write an integer value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the integer value to write.

Note

Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteInteger creates the section and key and sets its initial value to Value.


TIniFile::WriteString

TIniFile	Methods	See also

Writes a string value to an INI file.

Syntax

void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident, const System::AnsiString

Description

Call WriteString to write a string value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the string value to write.

Note

Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteString creates the section and key and sets its initial value to Value.


TIniFile::TIniFile

TIniFile	Methods	See also

TIniFile creates a new TIniFile object.

Syntax

__fastcall TIniFile(const System::AnsiString FileName);

Description

Use TIniFile to create a new TIniFile object.


TIniFile::~TIniFile

TIniFile	Methods	See also

~TIniFile frees the memory associated with the TIniFile object.

Syntax

__fastcall virtual ~TIniFile(void);

Description

Do not call ~TIniFile directly. Instead, use the delete keyword on the object, which causes ~TIniFile to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TIniFile example

TIniFile


TInplaceEdit

Hierarchy	Properties	Methods	See also

TInplaceEdit provides text editing capabilities for grid controls.

Header

vcl/grids.hpp

Description

TInplaceEdit is a helper object tailored to work with grid controls.  It provides a multiline editing window that appears in the appropriate cell of a grid control. TInplaceEdit provides  services so that the grid can influence the response of the control to user actions, and can move or resize the editing window as cells are moved or resized.  The TInplaceEdit window has no border constructor Create(AOwner: TComponent); override;TInplaceEdit is not a data-aware control, but can work with a data-aware grid such as TDBGrid, allowing the grid to fetch or post the text, and allowing the grid to impose a mask to limit the  text of the edit control to data that is valid.


TInplaceEdit properties

TInplaceEdit	Alphabetically	Legend

In TInplaceEdit

Grid

Derived from TCustomMaskEdit

EditText

IsMasked

Text

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TInplaceEdit properties

TInplaceEdit	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

EditText

Enabled

Grid

Handle

Height

HelpContext

Hint

IsMasked

Left

Modified

Name

Owner

Parent

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TInplaceEdit::Grid

TInplaceEdit	Properties	See also

Grid specifies the grid object that owns and controls this TInplaceEdit.

Syntax

__property TCustomGrid * Grid;

Description

Read Grid to obtain the grid object for which TInplaceEdit provides editing services.  TInplaceEdit uses the Grid property so that it can receive information about the text to be edited and so that it can pass on relevent events.


TInplaceEdit methods

TInplaceEdit	Alphabetically	Legend

In TInplaceEdit

~TInplaceEdit

BoundsChanged

CreateParams

DblClick

Deselect

EditCanModify

Hide

Invalidate

KeyDown

KeyPress

KeyUp

Move

PosEqual

SetFocus

TInplaceEdit

UpdateContents

UpdateLoc

WndProc

Derived from TCustomMaskEdit

Clear

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInplaceEdit methods

TInplaceEdit	By object	Legend

~TInplaceEdit

Assign

BeginDrag

BoundsChanged

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CutToClipboard

DblClick

DefaultHandler

Deselect

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditCanModify

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

KeyUp

MethodAddress

MethodName

Move

NewInstance

PaintTo

PasteFromClipboard

Perform

PosEqual

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TInplaceEdit

UpdateContents

UpdateControlState

UpdateLoc

Update

ValidateEdit

WndProc


TInplaceEdit::BoundsChanged

TInplaceEdit	Methods	See also

BoundsChanged sets a slight indentation in the text area of the window after the grid repositions the edit control.

Syntax

virtual void __fastcall BoundsChanged(void);

Description

BoundsChanged re-initializes the editing window after the control has been moved or resized.  It creates a slight indentation in the text formatting area so that the contents of the editor do not appear to crowd the edges of the cell.

BoundsChanged is exposed as a protected method so that derived objects can add further enhancements when the editing window changes size or location.


TInplaceEdit::CreateParams

TInplaceEdit	Methods	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TInplaceEdit overrides the inherited method to specify a multiline edit control.


TInplaceEdit::DblClick

TInplaceEdit	Methods	See also

DblClick informs the grid when the user double-clicks in the edit window.

Syntax

virtual void __fastcall DblClick(void);

procedure DblClick; override;

Description

DblClick is called when the user double-clicks in the edit window.  DblClick simply passes the event on to the grid.  The grid must interpret and respond to the double-click.  If the edit window needs to respond to the double-click, the grid must trigger the response by calling a method or setting a property of the TInplaceEdit.


TInplaceEdit::Deselect

TInplaceEdit	Methods	See also

Deselect removes the selection from the edit window.

Syntax

void __fastcall Deselect(void);

Description

Use Deselect to cause all text in the edit window to be unselected.  Deselect simply changes the selection, it does not change the actual text.


TInplaceEdit::Hide

TInplaceEdit	Methods	See also

Hide hides the edit control window and moves input focus to the grid.

Syntax

void __fastcall Hide(void);

Description

Hide makes the edit control window invisible without destroying it.  Hide also moves the input focus from the editor window to the grid, so that the invisible window does not swallow keyboard events.

The grid calls  Hide to hide the edit window when changing  out of edit mode.  It also calls Hide when scrolling the cell that is being edited out of the grid window.


TInplaceEdit::Invalidate

TInplaceEdit	Methods	See also

Invalidate invalidats the edit window and the corresponding portion of the grid window.

Syntax

void __fastcall Invalidate(void);

Description

Invalidate ensures that the portion of the grid window under the edit control is invalidated at the same time as the edit window.  This is important when the edit window is hidden or destroyed so that the grid window can repaint the cell that was covered by the edit window.


TInplaceEdit::KeyDown

TInplaceEdit	Methods	See also

KeyDown overrides the inherited method to pass many keystrokes on to the grid.

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);

Description

When the user presses a key, KeyDown checks whether the KeyDown event should be processed by the edit control or the grid.  The Enter key is always passed on to the grid.  The F2 key calls Deselect to remove the current selection.  Navigation keystrokes are passed on to the grid when the movement cannot be accomodated within the text window.  For example, if the user types Left when the cursor is already at the left edge of the edit window, the keystroke is passed to the grid which moves focus to the previous cell.  If the cursor is in the middle of a line, the keystroke is processed by the edit window, which moves left a single character.

KeyDown calls the OnKeyDown event handler for the grid, if there is one, before calling the inherited KeyDown for the edit control.


TInplaceEdit::KeyPress

TInplaceEdit	Methods	See also

KeyPress overrides the inherited method to give the grid first chance at handling the keystroke.

Syntax

virtual void __fastcall KeyPress(System::Char &Key);

Description

KeyPress allows the grid to handle the keystroke, and only processes keystrokes that the grid does not fully handle.  If the grid is not in edit mode after handling the keystroke,  KeyPress throws away the keystroke.  Keystroke processes the Return Key and calls the inherited method to handle all other unprocessed keystrokes.

Pressing the Return key causes KeyPress to select all the text, unless it is already selected, in which case it causes KeyPress to deselect all the text.


TInplaceEdit::KeyUp

TInplaceEdit	Methods	See also

KeyUp overrides the inherited method to pass all KeyUp events to the grid.

Syntax

virtual void __fastcall KeyUp(System::Word &Key,  Classes::TShiftState Shift);

Description

The inplace edit contol does not process the KeyUp event at all.  It simply passes this event on to the grid, which may or may not process the event.


TInplaceEdit::Move

TInplaceEdit	Methods	See also

Move changes the position of the edit window and repaints the contents.

Syntax

void __fastcall Move(const Windows::TRect &Loc);

Description

The grid calls Move to move the edit window to the indicated rectangle when the corresponding cell moves or resizes.  The position of Loc is relative to the grid’s client area.


TInplaceEdit::PosEqual

TInplaceEdit	Methods	See also

PosEqual indicates whether the edit window has the size and position indicated by Rect.

Syntax

System::Boolean __fastcall PosEqual(const Windows::TRect &Rect);

Description

Use PosEqual to determine if the edit window occupies a particular rectangle, where Rect is given in global coordinates.  PosEqual can be used to determine whether the inplace edit control represents a particular cell in the grid, by checking the bounding rectangle of the cell.


TInplaceEdit::SetFocus

TInplaceEdit	Methods	See also

SetFocus gives the editor window input focus if it is visible.

Syntax

void __fastcall SetFocus(void);

Description

Use SetFocus to cause keyboard events to go to the editor window.  Focus will not move to the window if  it is hidden by a call to the Hide method.


TInplaceEdit::UpdateContents

TInplaceEdit	Methods	See also

UpdateContents sets the EditMask and Text to the values specified by the grid.

Syntax

virtual void __fastcall UpdateContents(void);

Description

UpdateContents calls the GetEditMask and GetEditText methods of the grid, and sets the EditMask and Text properties accordingly.  UpdateContents allows the grid to bring up the inplace edit control with the contents of a particular cell, and to impose a mask to restrict the editor to valid input for the particular cell.


TInplaceEdit::UpdateLoc

TInplaceEdit	Methods	See also

UpdateLoc changes the position of the edit window but does not repaint the contents.

Syntax

void __fastcall UpdateLoc(const Windows::TRect &Loc);

Description

The grid calls UpdateLoc to move the edit window when the grid is moved.  Unlike the Move method, UpdateLoc does not invalidate the edit window to cause a repaint.


TInplaceEdit::WndProc

TInplaceEdit	Methods	See also

WndProc supplements the inherited method to add special processing to some Windows messages.

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc is the first method that receives messages for a Borland C++ Builder control.

WndProc for TInplaceEdit passes focus events on to the grid.  It calls the inherited method for all other Windows messages.  WndProc converts mouse clicks to double clicks when the first click was received by the grid within the double-click time period.


TInplaceEdit::TInplaceEdit

TInplaceEdit	Methods	See also

TInplaceEdit creates a new TInplaceEdit object.

Syntax

__fastcall virtual TInplaceEdit(Classes::TComponent *AOwner);

Description

Use TInplaceEdit to create a new TInplaceEdit object.


TInplaceEdit::~TInplaceEdit

TInplaceEdit	Methods	See also

~TInplaceEdit frees the memory associated with the TInplaceEdit object.

Syntax

__fastcall virtual ~TInplaceEdit(void);

Description

Do not call ~TInplaceEdit directly. Instead, use the delete keyword on the object, which causes ~TInplaceEdit to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TInplaceEdit example

TInplaceEdit


TIntegerField

Hierarchy	Properties	Methods	Events	See also

A TIntegerField component represents a signed 32-bit integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Integer fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are frequently used to hold values that are large, signed whole numbers.

TIntegerField introduces new properties to convert between integer values and other data types, and to limit the range of valid integers that the field will permit. As a descendent of TNumericField, TIntegerField includes many properties, methods, and events that are useful for managing the value and properties of a numeric field in a database.

TIntegerField is the director ancestor of three other field types that represent whole numbers: TAutoIncField, TSmallintField, and TWordField.


TIntegerField properties

TIntegerField	Alphabetically	Legend

In TIntegerField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TIntegerField properties

TIntegerField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TIntegerField::AsFloat

TIntegerField	Properties	See also

AsFloat converts the value of the integer field to or from a floating-point value.

Syntax

Description

Use AsFloat to:

•	Assign the integer field value to a floating-point variable.

•	Round a floating-point value to an integer value and assign it to an integer field.

For example, this code assigns a floating-point value to an integer field value, rounding the value to 12:

To assign an integer field value to a floating-point value, use code similar to this:

If the value assigned to the field does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField::AsInteger

TIntegerField	Properties	See also

AsInteger gets or sets the value of an integer field.

Syntax

Description

Long integer values need no conversion, because the native storage format of an integer field is a 32-bit integer. AsInteger provides a uniform interface that allows applications to get or set integer values with generic field components when the internal storage format of the data is not known.

If the value assigned to the field does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField::AsString

TIntegerField	Properties	See also

AsString converts the value of an integer field to or from a string value.

Syntax

Description

Use AsString to:

•	Assign the integer field value to string variable.

•	Assign a string value to the integer field.

For example, this code assigns a string value to an integer field value:

To assign an integer field value to a stringvalue, use code similar to this:

If the string assigned to the field does not represent a valid integer value, an EDatabaseError exception is raised. Also, if the assigned string does not convert to an integer value that falls within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField::AsVariant

TIntegerField	Properties	See also

AsVariant converts the value of an integer field to or from a variant value.

Syntax

Description

Use AsVariant to:

•	Assign the integer field value to variant variable.

•	Assign a variant value to the integer field.

Using variants is useful when you don't know the actual field type and don't want to use one of the other As... properties to convert the field value to another type.

If the value assigned to the field can not be converted to a valid integer or does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField::MaxValue

TIntegerField	Properties	See also

MaxValue limits the maximum value in the integer field.

Syntax

__property System::Longint MaxValue;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.

Newly created integer fields have a MaxValue of 2147483647. The MaxValue of an integer field cannot exceed this value.


TIntegerField::MinValue

TIntegerField	Properties	See also

MinValue limits the minimum value in the integer field.

Syntax

__property System::Longint MinValue;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.

Newly created integer fields have a MinValue of -2147483648. The MinValue of an integer field cannot exceed this value.


TIntegerField::Value

TIntegerField	Properties	See also

Value is the actual data in the integer field.

Syntax

void __fastcall CheckRange(System::Longint Value, System::Longint Min, System::Longint Max);

Description

Use Value to read data directly from and write data directly to a integer field. Using the Value property is the same as using the AsInteger property. Use Value when you know the field component is a 32-bit integer field. Use AsInteger when working with a generic field component.


TIntegerField events

TIntegerField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TIntegerField events

TIntegerField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TIntegerField methods

TIntegerField	Alphabetically

In TIntegerField

~TIntegerField

IsValidChar

TIntegerField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIntegerField methods

TIntegerField	By object

~TIntegerField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TIntegerField


TIntegerField::IsValidChar

TIntegerField	Methods	See also

IsValidChar determines if the specified character is valid in an integer field.

Syntax

virtual System::Boolean __fastcall IsValidChar(System::Char Ch);

Description

Call IsValidChar to determine if a character specified as the value of the InputChar is a valid character in the string representation of an integer field.

Valid characters for an integer field are '+', '-' and the digits from '0' to '9'. If InputChar is one of these characters, IsValidChar returns true. For all other characters, IsValidChar returns false.

IsValidChar is used by many data-aware controls to determine if a particular character entered in the field is valid for the field.


TIntegerField::TIntegerField

TIntegerField	Methods	See also

TIntegerField creates a new TIntegerField object.

Syntax

__fastcall virtual TIntegerField(Classes::TComponent *AOwner);

Description

Use TIntegerField to create a new TIntegerField object.


TIntegerField::~TIntegerField

TIntegerField	Methods	See also

~TIntegerField frees the memory associated with the TIntegerField object.

Syntax

__fastcall virtual ~TIntegerField(void);

Description

Do not call ~TIntegerField directly. Instead, use the delete keyword on the object, which causes ~TIntegerField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TIntegerField example

TIntegerField


TInternalImage

Hierarchy	Methods

Header

vcl/graphics.hpp

Description


TInternalImage methods

TInternalImage	Alphabetically

In TInternalImage

~TInternalImage

TInternalImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInternalImage methods

TInternalImage	By object

~TInternalImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TInternalImage


TInternalImage::TInternalImage

TInternalImage	Methods	See also

TInternalImage creates a new TInternalImage object.

Syntax

__fastcall TInternalImage(void);

Description

Use TInternalImage to create a new TInternalImage object.


TInternalImage::~TInternalImage

TInternalImage	Methods	See also

~TInternalImage frees the memory associated with the TInternalImage object.

Syntax

__fastcall virtual ~TInternalImage(void);

Description

Do not call ~TInternalImage directly. Instead, use the delete keyword on the object, which causes ~TInternalImage to be invoked automatically.


Hierarchy

TObject


TInternalImage example

TInternalImage


TLabel

Hierarchy	Properties	Methods	Events

The TLabel component is a nonwindowed control that displays text on a form. Usually this text labels some other control.

Header

vcl/stdctrls.hpp

The text of a label is the value of its Caption property. Within the caption, you can include an accelerator key. When the user presses the accelerator key, the control that is the value of the label’s FocusControl becomes the active control on the form.

How the text of the caption aligns within the label is determined by the value of the Alignment property. You can have the label resize automatically to fit a changing caption if you set the AutoSize property to true. If you prefer to have the text wrap, set WordWrap to true.

If you want a label to appear on top of a graphic, but you want to be able to see through the label so that part of the graphic isn’t hidden, set the Transparent property to true.

The TLabel component is an indirect descendent of TGraphicControl. In addition to the following properties, methods, and events, this component also has the properties and methods that apply to all controls.


TLabel properties

TLabel	Alphabetically	Legend

Derived from TCustomLabel

Alignment

AutoSize

FocusControl

ShowAccelChar

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TLabel properties

TLabel	By object	Legend

Alignment

Align

AutoSize

BoundsRect

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

FocusControl

Font

Height

Hint

Left

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ShowAccelChar

ShowHint

Tag

Top

Transparent

Visible

Width

WordWrap


TLabel events

TLabel	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TLabel events

TLabel	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TLabel methods

TLabel	Alphabetically

In TLabel

~TLabel

TLabel

Derived from TCustomLabel

BeginDrag

Derived from TControl

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLabel methods

TLabel	By object

~TLabel

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TLabel

Update


TLabel::TLabel

TLabel	Methods	See also

TLabel creates a new TLabel object.

Syntax

__fastcall virtual TLabel(Classes::TComponent *AOwner);

Description

Use TLabel to create a new TLabel object.


TLabel::~TLabel

TLabel	Methods	See also

~TLabel frees the memory associated with the TLabel object.

Syntax

__fastcall virtual ~TLabel(void);

Description

Do not call ~TLabel directly. Instead, use the delete keyword on the object, which causes ~TLabel to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TCustomLabel


TLabel example

TLabel


TList

Hierarchy	Properties	Methods

The TList object is used to maintain lists of objects.

Header

vcl/classes.hpp

The List property is a list of pointers to all the objects in the list. You can access a particular item referenced in the list using the Items property. To find the position of an item in the list, use the IndexOf method.

You can add, delete, insert, remove, move, and exchange items in the list using the Add, Delete, Insert, Remove, Move, and Exchange methods. Use the Count property to determine how many items are in the list.

Use the Sort method to perform a Quick Sort on the list. Use the First method to move to the beginning of the list, and use the Last method to move to the end of the list.

The number of items the list can maintain is determined by the value of the Capacity property. If you need to increase the size of the list, call the Expand method. You can remove all NULL pointers in the list with the Pack method.

In addition to these properties and methods, this object also has the methods that apply to all objects.


TList properties

TList	Alphabetically	Legend

In TList

Capacity

Count

Items

List


TList properties

TList	By object	Legend

Capacity

Count

Items

List


TList::Capacity

TList	Properties

Contains the allocated size of the array of pointers maintained by a TList object.

Syntax

__property System::Integer Capacity;

This is different from the Count property, which contains the number of entries that are actually in use. The value of the Capacity property is always greater than or equal to the value of the Count property.

When setting the Capacity property, an EOutOfMemory exception occurs if there is not enough memory to expand the list to its new size.

When an element is added to a list whose Capacity and Count are equal (indicating that all allocated entries are in use), the Capacity is automatically increased by 16 elements. In situations where you are going to be adding a known number of elements to a list, you can reduce memory reallocations by first increasing the list's capacity. For example,

The assignment to Capacity before the for loop ensures that each of the following Add operations doesn't cause the list to be reallocated, which in turn means that the Add operations are guaranteed to never raise an exception.


TList::Count

TList	Properties

Contains the number of items in a list.

Syntax

__property System::Integer Count;


TList::Items

TList	Properties

The Items array property lets you access a specific pointer kept in the List property of a list object.

Syntax

__property System::Pointer Items[System::Integer Index];

Using the Index parameter of Items you can access a list item by its position in the list.


TList::List

TList	Properties

Stores a list of pointers that reference objects of any type.

Syntax

__property PPointerList List;

The elements of the TPointerList array each point to an item of the list.


TList methods

TList	Alphabetically

In TList

~TList

Add

Clear

Delete

Exchange

Expand

First

IndexOf

Insert

Last

Move

Pack

Remove

Sort

TList

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TList methods

TList	By object

~TList

Add

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

Exchange

Expand

FieldAddress

First

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

Sort

TList


TList::Add

TList	Methods

Adds a new item to the end of a list.

Syntax

System::Integer __fastcall Add(System::Pointer Item);

Add returns the position of the item in the list stored in the Items property; the first item in the list has a value of 0. Specify the item you want added to the list as the value of the Item parameter.


TList::Clear

TList	Methods

Deletes all items from the list.

Syntax

void __fastcall Clear(void);


TList::Delete

TList	Methods

Removes the item specified with the Index parameter.

Syntax

void __fastcall Delete(System::Integer Index);

The index is zero-based, so the first item has an Index value of 0, the second item has an Index value of 1, and so on. When the item is deleted in a list object, the list contains a NULL value in the item's position in the list.


TList::Exchange

TList	Methods

Exchanges the position of two items in the list of a list object.

Syntax

void __fastcall Exchange(System::Integer Index1, System::Integer Index2);

The items are specified with their index values in the Index1 and Index2 parameters. Because the indexes are zero-based, the first item in the list has an index value of 0, the second item has an index value of 1, and so on.


TList::Expand

TList	Methods

Increases the maximum size of the list maintained by a list object, creating more space to add new list items and incrementing the value of the Capacity property.

Syntax

TList *__fastcall Expand(void);

If the value of the Capacity property is greater than 8, the Expand method increases the capacity of the list by 16. If the value of Capacity is greater than 4, but less than 9, then the capacity of the list increases by 8. Finally if the value of Capacity is less than 4, then the capacity of the list grows by 4.

The returned value is the expanded list.


TList::First

TList	Methods

Returns a pointer that points to the first item referenced in the List property, which is indexed by Items[0].

Syntax

System::Pointer __fastcall First(void);


TList::IndexOf

TList	Methods

Returns the position of an item in a list kept by the List property.

Syntax

System::Integer __fastcall IndexOf(System::Pointer Item);

The first position in a list is 0. If an item is not in the list, IndexOf returns -1.


TList::Insert

TList	Methods

Inserts an item into the list of items stored in the List property of a list object.

Syntax

void __fastcall Insert(System::Integer Index, System::Pointer Item);

Specify the item to insert as the value of the Item parameter. Specify the position in the list where you want the item inserted as the value of the Index parameter. The index is zero-based, so the first position in the list has an index value of 0.

If your application calls Insert when the list of items is sorted, an EListError exception is raised.


TList::Last

TList	Methods

Returns a pointer that points to the last item referenced in the List property of a list object.

Syntax

System::Pointer __fastcall Last(void);


TList::Move

TList	Methods

Changes the position of an item in the list of a list object by giving the item a new index value.

Syntax

void __fastcall Move(System::Integer CurIndex, System::Integer NewIndex);

The CurIndex parameter is the item's current index, and the NewIndex parameter is the item's new index value.


TList::Pack

TList	Methods

Deletes all NULL items from the list of pointers kept by the List property of a list object.

Syntax

void __fastcall Pack(void);


TList::Remove

TList	Methods

Deletes the item referenced in the Item parameter from the list of pointers stored in the List property of a list object.

Syntax

System::Integer __fastcall Remove(System::Pointer Item);

The value returned is the position of the item in the list of pointers before it was removed. After an item is removed, all of the items that follow it are moved up in index position and the number of items in the list is reduced by one.


TList::Sort

TList	Methods

Performs a Quick Sort on the list based on the return results of Compare.

Syntax

void __fastcall Sort(TListSortCompare Compare);

Compare will return < 0 if Item1 is less and Item2, 0 if they are equal and > 0 if Item1 is greater than Item2.


TList::TList

TList	Methods	See also

TList creates a new TList object.

Syntax

__fastcall TList(void);

Description

Use TList to create a new TList object.


TList::~TList

TList	Methods	See also

~TList frees the memory associated with the TList object.

Syntax

__fastcall virtual ~TList(void);

Description

Do not call ~TList directly. Instead, use the delete keyword on the object, which causes ~TList to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TList example

TList


TListBox

Hierarchy	Properties	Methods	Events

TListBox is a wrapper for a Windows list box control.

Header

vcl/stdctrls.hpp

Description

TListBox implements the generic behavior introduced in TCustomListbox. TListBox publishes many of the properties inherited from TCustomListBox, but does not introduce any new behavior.

Use TListBox to display a scrollable list of items that users can select, add or delete. For specialized list boxes use other descendent classes of TCustomListBox or derive from it.


TListBox properties

TListBox	Alphabetically	Legend

Derived from TCustomListBox

BorderStyle

Canvas

Columns

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TListBox properties

TListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

ExtendedSelect

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

MultiSelect

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelCount

Selected

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

TabWidth

Tag

TopIndex

Top

Visible

Width


TListBox events

TListBox	Alphabetically	Legend

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListBox events

TListBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListBox methods

TListBox	Alphabetically

In TListBox

~TListBox

TListBox

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListBox methods

TListBox	By object

~TListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TListBox

UpdateControlState

Update


TListBox::TListBox

TListBox	Methods	See also

TListBox creates a new TListBox object.

Syntax

__fastcall virtual TListBox(Classes::TComponent *AOwner);

Description

Use TListBox to create a new TListBox object.


TListBox::~TListBox

TListBox	Methods	See also

~TListBox frees the memory associated with the TListBox object.

Syntax

__fastcall virtual ~TListBox(void);

Description

Do not call ~TListBox directly. Instead, use the delete keyword on the object, which causes ~TListBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TListBox example

TListBox


TListItem

Hierarchy	Properties	Methods

The TListItem object is an individual item of a TListView control. A list view item is represented as a line, or row of the list view.

Header

vcl/comctrls.hpp

A list item contains a Caption and Data defined by your application. Caption contains a string, and Data contains a pointer to a data structure to be associated with each list item. Use the Delete method to delete a list item. If the ReadOnly property is false, the user is allowed to edit the Caption.

Each item is identified by a unique Index. Index corresponds to the index of the Items property of the TListView control. The MakeVisible method scrolls a list item into view if the item is not in view. The ListView property specifies the list view that is the owner of the item. The SubItems property gives access to the sub items of the list item.

The Focused property determines whether the item has the focus, that is, it’s surrounded by a standard focus rectangle. Only one item can have the focus. The Selected property determines whether the list item is selected. The DropTarget property specifies if the item is the target of a drag and drop operation.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects.


TListItem properties

TListItem	Alphabetically	Legend

In TListItem

Caption

Cut

Data

DropTarget

Focused

Handle

ImageIndex

Index

Left

ListView

OverlayIndex

Owner

Selected

StateIndex

SubItems

Top


TListItem properties

TListItem	By object	Legend

Caption

Cut

Data

DropTarget

Focused

Handle

ImageIndex

Index

Left

ListView

OverlayIndex

Owner

Selected

StateIndex

SubItems

Top


TListItem::Cut

TListItem	Properties

Determines if the list item is selected as part of a cut and paste operation.

Syntax

__property System::Boolean Cut;

Description

If Cut is true, the item is selected as part of a cut and paste operation. If Cut is false, the list item is not selected.


TListItem::Data

TListItem	Properties

Specifies any data you want associated with a list item.

Syntax

__property System::Pointer Data;

Description


TListItem::DropTarget

TListItem	Properties

Determines whether the list item in the list view is selected as a drag and drop target.

Syntax

__property System::Boolean DropTarget;

Description

When DropTarget is true, the list item is drawn in the style used to indicate a drag and drop target.


TListItem::Focused

TListItem	Properties

Determines whether the list item has the focus.

Syntax

__property System::Boolean Focused;

Description

A list item with the focus has is surrounded by a standard focus rectangle. Only one list item can have the focus at a time in a list view.


TListItem::Handle

TListItem	Properties

Returns the Handle property of the list view control that owns the list item.

Syntax

__property System::Integer Handle;

Description


TListItem::ImageIndex

TListItem	Properties

Determines which image from the image list is displayed when a list item is not currently selected.

Syntax

__property System::Integer ImageIndex;

Description

An image list is used by a list view component when either LargeImages or SmallImages is set. If LargeImages is set, then the ViewStyle must be set to vsIcon to show the images. If Largeimages is set, then the ViewStyle must be set to vsSmallIcon, vsReport or vsList to show the images.

The default image (when the item is not selected) for an individual item in the list view will be the first image in the image list, unless another one is specified with ImageIndex.


TListItem::Index

TListItem	Properties

Uniquely identifies each list item in a list view.

Syntax

System::Boolean __fastcall GetState(System::Integer Index);

Description

The first item has an index of 0, and subsequent items are numbered sequentially.


TListItem::Left

TListItem	Properties

Determines the horizontal coordinate of the left edge of a list item relative to the list view in pixels.

Syntax

__property System::Integer Left;

Description


TListItem::ListView

TListItem	Properties

Specifies the list view control that is the owner of the list item.

Syntax

__property TCustomListView * ListView;

Description


TListItem::OverlayIndex

TListItem	Properties

Determines which image from the image list is to be used as an overlay mask.

Syntax

__property System::Integer OverlayIndex;

Description

An overlay mask is an image drawn transparently over another image in the list view. For example, to indicate that an item is no longer available you could use an overlay image that puts an X over the current item's image.

An image list is usedby a list view component when either LargeImages or SmallImages is set. If LargeImages is set, then the ViewStyle must be set to vsIcon to show the images. If LargeImages is set, then the ViewStyle must be set to vsSmallIcon, vsReport or vsList to show the images.


TListItem::Owner

TListItem	Properties

Indicates which TListItems object owns the list item.

Syntax

__property TListItems * Owner;

Description


TListItem::Selected

TListItem	Properties

Determines whether a list item is selected.

Syntax

__property System::Boolean Selected;

Description

When Selected is true, the list item is selected. When Selected is false, the list item is not selected. The appearance of a selected item depends on whether it has the focus and whether the system colors are used for selection. When an item is selected, the list view's OnChanging and OnChanged events are triggered.


TListItem::StateIndex

TListItem	Properties

Indicates which image from the StateImages image list to display for the item.

Syntax

__property System::Integer StateIndex;

Description

Use a state image when you want to display an additional image to the left of the list item's icon. For exmple, the following RefSyn sets the selected items state state index:


TListItem::SubItems

TListItem	Properties

Contains the strings that appear as sub items to the list items in the list view control.

Syntax

__property Classes::TStrings * SubItems;

Description

To add a new subitem, use the SubItem's Add method. SubItems are only visible when the list view's ViewStyle property is set to vsReport.

Example

The following example adds a new sub item to the selected list item in the list view control.


TListItem::Top

TListItem	Properties

Positions a list item within the list view.

Syntax

__property System::Integer Top;

Description

The Top property moves an item vertically to a specified position in pixels within the list view control's client area. The ViewStyle of the list view must be set to vsIcon or vsSmallIcons.


TListItem methods

TListItem	Alphabetically

In TListItem

~TListItem

CancelEdit

Delete

DisplayRect

EditCaption

GetPosition

MakeVisible

SetPosition

TListItem

Update

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListItem methods

TListItem	By object

~TListItem

Assign

CancelEdit

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Delete

Dispatch

DisplayRect

EditCaption

FieldAddress

FreeInstance

Free

GetPosition

InheritsFrom

InitInstance

InstanceSize

MakeVisible

MethodAddress

MethodName

NewInstance

SetPosition

TListItem

Update


TListItem::CancelEdit

TListItem	Methods

Cancels the editing of an list item's text in a list view.

Syntax

void __fastcall CancelEdit(void);

Description


TListItem::Delete

TListItem	Methods

Deletes the list item from a list view.

Syntax

void __fastcall Delete(void);

Description


TListItem::DisplayRect

TListItem	Methods

Returns the bounding rectangle (TRect record) for a list item in a list view control.

Syntax

Windows::TRect __fastcall DisplayRect(TDisplayCode Code);

Description

The RefSyn parameter specifies the display type when retrieving the bounding rectangle for all or part of an item in the list view. These are the possible values for the RefSyn parameter.

Value	Meaning

drBounds	Returns the bounding rectangle of the entire list item, including the icon and label.

drIcon	Returns the bounding rectangle of the icon or small icon

drLabel	Returns the bounding rectangle of the item text

drSelectBounds	Returns the union of the icon and label rectangles, but excludes columns in details view


TListItem::EditCaption

TListItem	Methods

Begins in-place editing of the specified list item's text.

Syntax

System::Boolean __fastcall EditCaption(void);

Description

The method implicitly selects and focuses the specified item.


TListItem::GetPosition

TListItem	Methods

Returns the position of the list item as a point.

Syntax

Windows::TPoint __fastcall GetPosition(void);

Description

The position returned is the upper left coordinate of the list item.


TListItem::MakeVisible

TListItem	Methods

Scrolls the list view, if necessary, to ensure a list item is in view.

Syntax

void __fastcall MakeVisible(System::Boolean PartialOK);

Description

The PartialOK parameter specifies whether the item must be entirely visible. If this parameter is true, no scrolling occurs if the item is at least partially visible. If PartialOK is false, the list item the entire list item is visible in the list view.


TListItem::SetPosition

TListItem	Methods

Positions a list item in a list view control.

Syntax

void __fastcall SetPosition(const Windows::TPoint &Value);

Description

SetPosition moves a list item to a specified position in a list view control. The list view control must be have its ViewStyle property set to either vsIcon or vsSmallIcon. Specify the point you want to move the list item to as the value of the Value parameter. The point is the set of coordinates for the upper-left corner of the list item relative to the list view control. For example, this RefSyn moves the selected list item to position 5, 5 in the list view:


TListItem::Update

TListItem	Methods

Updates a list view item display.

Syntax

void __fastcall Update(void);

Description


TListItem::TListItem

TListItem	Methods	See also

TListItem creates a new TListItem object.

Syntax

__fastcall TListItem(TListItems *AOwner);

Description

Use TListItem to create a new TListItem object.


TListItem::~TListItem

TListItem	Methods	See also

~TListItem frees the memory associated with the TListItem object.

Syntax

__fastcall virtual ~TListItem(void);

Description

Do not call ~TListItem directly. Instead, use the delete keyword on the object, which causes ~TListItem to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TListItem example

TListItem


TListView

Hierarchy	Properties	Methods	Events

Header

vcl/comctrls.hpp

Description

The TListView component is a list of items that can be displayed in a variety of ways. The ViewStyle property determines whether items are displayed in columns with column headers and sub-items, or vertically or horizontally, with small or large icons.

The Items property allows you to Add, Delete, modify the Caption, add SubItems, and pick icon images for the items in the list view. Use the Columns property to add columns to the list view. To see the column headers, set the ViewStyle to vsReport and set the ShowColumnHeaders property to true. The ColumnClick property specifies whether the column header behaves like a button. The OnColumnClick event occurs when the user has clicked on a column heading and ColumnClick is set to true.

When using the list view with a ViewStyle of vsIcon, icons from the image list specified in the LargeImages property are used. In the IconOptions property, the AutoArrange property arranges the icons in the list view automatically as needed, the Arrangement property specifies where the icons are aligned in the list view, and the WrapText property specifies whether to wrap the text of the item’s Caption if it would go beyond the width of the icon. When using a ViewStyle of vsSmallIcon, icons from the image list specified in the SmallImages property are used.

To allow editing of the caption of a list item, set ReadOnly to false. The OnEditing and OnEdited events occur when the user begins and finishes editing the caption, respectively.

The TListView component is an indirect descendent of TWinControl. In addition to the following properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TListView properties

TListView	Alphabetically	Legend

In TListView

ReadOnly

Derived from TCustomListView

AllocBy

BorderStyle

BoundingRect

Column

ColumnClick

Columns

DropTarget

HideSelection

IconOptions

ItemFocused

Items

LargeImages

MultiSelect

SelCount

Selected

ShowColumnHeaders

SmallImages

SortType

StateImages

TopItem

ViewOrigin

ViewStyle

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TListView properties

TListView	By object	Legend

Align

AllocBy

BorderStyle

BoundingRect

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ColumnClick

Columns

Column

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DropTarget

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

IconOptions

ItemFocused

Items

LargeImages

Left

MultiSelect

Name

Owner

ParentShowHint

Parent

PopupMenu

ReadOnly

SelCount

Selected

ShowColumnHeaders

ShowHint

Showing

SmallImages

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

ViewOrigin

ViewStyle

VisibleRowCount

Visible

Width


TListView::ReadOnly

TListView	Properties

Determines if the use can change the contents of the control.

Syntax

__property ReadOnly;

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.


TListView events

TListView	Alphabetically	Legend

Derived from TCustomListView

OnChange

OnChanging

OnColumnClick

OnCompare

OnDeletion

OnEdited

OnEditing

OnInsert

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListView events

TListView	By object	Legend

OnChange

OnChanging

OnClick

OnColumnClick

OnCompare

OnDblClick

OnDeletion

OnDragDrop

OnDragOver

OnEdited

OnEditing

OnEndDrag

OnEnter

OnExit

OnInsert

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnChange


OnChanging


OnClick


OnColumnClick


OnCompare


OnDblClick


OnDeletion


OnDragDrop


OnDragOver


OnEdited


OnEditing


OnEndDrag


OnEnter


OnExit


OnInsert


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TListView methods

TListView	Alphabetically

In TListView

~TListView

TListView

Derived from TCustomListView

AlphaSort

Arrange

CustomSort

FindCaption

FindData

GetItemAt

GetNearestItem

GetNextItem

GetSearchString

IsEditing

Scroll

StringWidth

UpdateItems

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListView methods

TListView	By object

~TListView

AlphaSort

Arrange

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CustomSort

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindCaption

FindComponent

FindData

Focused

FreeInstance

FreeNotification

Free

GetItemAt

GetNearestItem

GetNextItem

GetParentComponent

GetSearchString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

Scroll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StringWidth

TListView

UpdateControlState

UpdateItems

Update


TListView::TListView

TListView	Methods	See also

TListView creates a new TListView object.

Syntax

__fastcall virtual TListView(Classes::TComponent *AOwner);

Description

Use TListView to create a new TListView object.


TListView::~TListView

TListView	Methods	See also

~TListView frees the memory associated with the TListView object.

Syntax

__fastcall virtual ~TListView(void);

Description

Do not call ~TListView directly. Instead, use the delete keyword on the object, which causes ~TListView to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListView


TListView example

TListView


TListColumn

Hierarchy	Properties	Methods	See also

TListColumn represents a column in a list view.

Header

vcl/comctrls.hpp

Description

Each TListView uses a TListColumns to maintain a collection of TListColumn objects.


TListColumn properties

TListColumn	Alphabetically	Legend

In TListColumn

Alignment

Caption

Width

WidthType

Derived from TCollectionItem

Collection

Index


TListColumn properties

TListColumn	By object	Legend

Alignment

Caption

Collection

Index

Width

WidthType


TListColumn::Alignment

TListColumn	Properties	See also

Specifies how the caption is aligned within the list column.

Syntax

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align caption on the left side of the column.

taCenter	Center caption in the column.

taRightJustify	Align caption on the right side of the column.


TListColumn::Caption

TListColumn	Properties	See also

The text that appears at the top of the column.

Syntax

__property System::AnsiString Caption;

Description

The Caption property contains a text string that identifies the list column. If the list-view control’s ViewStyle and ShowColumnHeaders properties are set to vsReport and true, respectively, the value of Caption appears at the top of the column.


TListColumn::Width

TListColumn	Properties	See also

The width of the column.

Syntax

__property TWidth Width;

Description

The Width property determines the width of the list column, in pixels.

If Width is assigned the value -1, the list column is automatically resized to accommodate the text in the column. If Width is assigned the value -2, the list column is automatically resized to accommodate the column header (that is, the text in the Caption property). For more readable code, use the global ColumnTextWidth and ColumnHeaderWidth constants when assigning negative values to Width:

Constant	Value	Meaning

ColumnTextWidth	-1	Column is resized to fit text.

ColumnHeaderWidth	-2	Column is resized to fit header only.

For example, the following statement causes the leftmost column of ListView1 to be resized automatically to accommodate its text:

In the form designer, the same thing can be accomplished by opening the Columns editor for ListView1, selecting the first list column, and typing -1 next to Width in the Object Inspector.

When a column is automatically resized, the value of Width changes to indicate the actual column width. The read-only WidthType property, however, retains its value of -1 or -2.


TListColumn::WidthType

TListColumn	Properties	See also

Indicates whether the column is sized automatically.

Syntax

__property TWidth WidthType;

Description

The read-only WidthType property is set to the same value as Width. WidthType, however, retains its negative value when Width changes automatically.

If WidthType returns -1, the list column is automatically resized to accommodate the text in the column. If WidthType returns -2, the list column is automatically resized to accommodate the column header. If WidthType returns a nonnegative value, the column is not resized automatically; in this case, the value of Width and WidthType should be the same.

To enable automatic column resizing, assign the value -1 or -2 directly to Width.


TListColumn methods

TListColumn	Alphabetically

In TListColumn

~TListColumn

Assign

TListColumn

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListColumn methods

TListColumn	By object

~TListColumn

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TListColumn


TListColumn::Assign

TListColumn	Methods	See also

Copies the contents of the source list-column instance to a new list-column instance.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assign creates a new list column with the same Alignment, Width, and Caption values as the source object.


TListColumn::TListColumn

TListColumn	Methods	See also

TListColumn creates a new TListColumn object.

Syntax

__fastcall virtual TListColumn(Classes::TCollection *Collection);

Description

Use TListColumn to create a new TListColumn object.


TListColumn::~TListColumn

TListColumn	Methods	See also

~TListColumn frees the memory associated with the TListColumn object.

Syntax

__fastcall virtual ~TListColumn(void);

Description

Do not call ~TListColumn directly. Instead, use the delete keyword on the object, which causes ~TListColumn to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TListColumn example

TListColumn


TListColumns

Hierarchy	Properties	Methods	See also

TListColumns is a container for TListColumn objects.

Header

vcl/comctrls.hpp

Description

Each TListColumns holds a collection of TListColumn objects in a TListView. TListColumns maintains an index of the list columns in its Items array. The Count property contains the number of list columns in the collection. At design time, use the list-view control’s Columns editor to add, remove, or modify columns.


TListColumns properties

TListColumns	Alphabetically	Legend

In TListColumns

Items

Owner

Derived from TCollection

Count


TListColumns properties

TListColumns	By object	Legend

Count

Items

Owner


TListColumns::Items

TListColumns	Properties	See also

An index of the list columns in the collection.

Syntax

__property TListColumn * Items[System::Integer Index];

Description

The value of the Index parameter corresponds to the Index property of TListColumn. It represents the position of the column in the list view.


TListColumns::Owner

TListColumns	Properties	See also

The list-view control to which the TListColumns instance belongs.

Syntax

__property TCustomListView * Owner;

Description

The read-only Owner property indicates which list-view control owns the TListColumns object.


TListColumns methods

TListColumns	Alphabetically

In TListColumns

~TListColumns

Add

TListColumns

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListColumns methods

TListColumns	By object

~TListColumns

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TListColumns


TListColumns::Add

TListColumns	Methods	See also

Creates a new TListColumn instance and adds it to the Items array.

Syntax

TListColumn *__fastcall Add(void);

Description

Add returns the new list column. At design time, use the list-view control’s Columns editor to add columns to the list view.


TListColumns::TListColumns

TListColumns	Methods	See also

TListColumns creates a new TListColumns object.

Syntax

__fastcall TListColumns(TCustomListView *AOwner);

Description

Use TListColumns to create a new TListColumns object.


TListColumns::~TListColumns

TListColumns	Methods	See also

~TListColumns frees the memory associated with the TListColumns object.

Syntax

__fastcall virtual ~TListColumns(void);

Description

Do not call ~TListColumns directly. Instead, use the delete keyword on the object, which causes ~TListColumns to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TListColumns example

TListColumns


TListItems

Hierarchy	Properties	Methods	See also

The TListItems object maintains a list of list items (TListItem objects) that appear in a list view control.

Header

vcl/comctrls.hpp

Description

A list view control is a window that displays a collection of list items, each list item consisting of an icon and a label. All list items that appear in the list view control are stored in a list items object.


TListItems properties

TListItems	Alphabetically	Legend

In TListItems

Count

Handle

Item

Owner


TListItems properties

TListItems	By object	Legend

Count

Handle

Item

Owner


TListItems::Count

TListItems	Properties

The Count property reports the number of items in a TListItems object.

Syntax


TListItems::Handle

TListItems	Properties

The Handle property gives access to the Windows handle for TListItems.

Syntax


TListItems::Item

TListItems	Properties

The Item property provides access to a list item in a TListItems object.

Syntax

__property TListItem * Item[System::Integer Index];

Description


TListItems::Owner

TListItems	Properties

The Owner property indicates the list view object that owns the list items object.

Syntax


TListItems methods

TListItems	Alphabetically

In TListItems

~TListItems

Add

Assign

BeginUpdate

Clear

Delete

EndUpdate

IndexOf

Insert

TListItems

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListItems methods

TListItems	By object

~TListItems

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

TListItems


TListItems::Add

TListItems	Methods

Adds a new list item to the list view control.

Syntax

TListItem *__fastcall Add(void);

Description


TListItems::Assign

TListItems	Methods

The Assign method assigns an object to a list items object.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description


TListItems::BeginUpdate

TListItems	Methods

The BeginUpdate method prevents the updating of the list items object until the EndUpdate method is called.

Syntax

void __fastcall BeginUpdate(void);

Description

Use BeginUpdate to prevent the screen from being repainted when new items are added, deleted, or inserted. List view items affected by the changes will have invalid Index values until EndUpdate is called.


TListItems::Clear

TListItems	Methods

The Clear method removes all items from the list items object.

Syntax

void __fastcall Clear(void);


 EndUpdate


TListItems::IndexOf

TListItems	Methods

Returns the position of a list item in a list items object.

Syntax

System::Integer __fastcall IndexOf(TListItem *Value);


TListItems::Insert

TListItems	Methods

Inserts a list item (TListItem object) into the list view.

Syntax

TListItem *__fastcall Insert(System::Integer Index);


TListItems::TListItems

TListItems	Methods	See also

TListItems creates a new TListItems object.

Syntax

__fastcall TListItems(TCustomListView *AOwner);

Description

Use TListItems to create a new TListItems object.


TListItems::~TListItems

TListItems	Methods	See also

~TListItems frees the memory associated with the TListItems object.

Syntax

__fastcall virtual ~TListItems(void);

Description

Do not call ~TListItems directly. Instead, use the delete keyword on the object, which causes ~TListItems to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TListItems example

TListItems


TListSourceLink

Hierarchy	Properties	Methods	See also

TListSourceLink is a helper object that helps manage data events for the ListSource for a TDBLookupControl object.

Header

vcl/dbctrls.hpp

Description

TListSourceLink is tailored to work with a TDBLookupControl. It should only be used by the TDBLookupControl class.


TListSourceLink properties

TListSourceLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TListSourceLink properties

TListSourceLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TListSourceLink methods

TListSourceLink	Alphabetically	Legend

In TListSourceLink

~TListSourceLink

ActiveChanged

DataSetChanged

TListSourceLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListSourceLink methods

TListSourceLink	By object	Legend

~TListSourceLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TListSourceLink

UpdateRecord


TListSourceLink::ActiveChanged

TListSourceLink	Methods	See also

ActiveChanged informs the TDBLookupControl of changes in the Active property of the dataset that it maintains for the ListSource.

Syntax

virtual void __fastcall ActiveChanged(void);

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property of the dataset which the TDBLookupControl uses to populate its list trigger this procedure, which in turn calls the ListLinkActiveChanged method of the TDBLookupControl object that owns this TListSourceLink.


TListSourceLink::DataSetChanged

TListSourceLink	Methods	See also

DataSetChanged informs the TDBLookupControl of changes to the dataset that the TDBLookupControl uses to populate its list.

Syntax

virtual void __fastcall DataSetChanged(void);

Description

Applications should not call the DataSetChanged procedure directly. These calls will be triggered automatically by the dataset. DataSetChanged informs the TListSourceLink of dataset changes by calling its ListLinkDataChanged method.


TListSourceLink::TListSourceLink

TListSourceLink	Methods	See also

TListSourceLink creates a new TListSourceLink object.

Syntax

__fastcall TListSourceLink(void);

Description

Use TListSourceLink to create a new TListSourceLink object.


TListSourceLink::~TListSourceLink

TListSourceLink	Methods	See also

~TListSourceLink frees the memory associated with the TListSourceLink object.

Syntax

__fastcall virtual ~TListSourceLink(void);

Description

Do not call ~TListSourceLink directly. Instead, use the delete keyword on the object, which causes ~TListSourceLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TListSourceLink example

TListSourceLink


TMainMenu

Hierarchy	Properties	Methods

The MainMenu component encapsulates a menu bar and its accompanying drop-down menus for a form. To begin designing a menu, add a main menu component to your form, and double-click the component. See the topic Menu Designer.

Header

vcl/menus.hpp

The items on the menu bar and in its drop-down menus are specified with the Items object, a property of a main menu. The Items object is of type TMenuItem. Your application can use the Items property to access a particular command on the menu. To find out how many itmes a MainMenu or MenuItem contains use Menu.Items.Count.

You can choose to have the menus of one form merge with those of another using the AutoMerge property and the Merge and Unmerge methods.

The MainMenu component is an indirect descendent of TComponent. In addition to the following properties and methods, this component also has the properties and methods that apply to all components.


TMainMenu properties

TMainMenu	Alphabetically	Legend

In TMainMenu

AutoMerge

Handle

Derived from TMenu

Items

WindowHandle

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMainMenu properties

TMainMenu	By object	Legend

AutoMerge

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Handle

Items

Name

Owner

Tag

WindowHandle


TMainMenu::AutoMerge

TMainMenu	Properties

Determines if the main menus (TMainMenu) of forms other than the main form merge with the main menu of the main form in non-MDI applications at run time.

Syntax

__property System::Boolean AutoMerge;

To merge the form's menus with the main menu in the main form, set the AutoMerge property of each main menu you want merged to true. Make sure that the AutoMerge property of the main menu you are merging with other menus remains false. How menus merge depends on the value of the GroupIndex property for each menu item.

If the application is an MDI application (the FormStyle properties are set so the main form is a parent form and subsequent forms are child forms), menu merging occurs automatically and you don't need to use the AutoMergeproperty.

Example

This example uses two forms with a main menu and a button on each form. Using the Object Inspector, set the GroupIndex value for each menu item on the menu bar in the second form to a number greater than 0. When the application runs and the user clicks the button on the first form, the main menu on the second form merges with the main menu of the first form. When the user clicks the button on the second form, the form closes.

This is the RefSyn for the button-click event handler on the second form:

To run this example, you must add Unit2 to the uses clause of Unit1.


TMainMenu::Handle

TMainMenu	Properties

Provides access to the menu’s window handle, so you can call a Windows API function that requires such a handle.

Syntax

void __fastcall SetOle2MenuHandle(System::Integer Handle);

Example

The following RefSyn uses the Windows API function HiliteMenuItem to highlight the first menu item in MainMenu1 on Form1.


TMainMenu methods

TMainMenu	Alphabetically

In TMainMenu

~TMainMenu

GetOle2AcceleratorTable

Merge

PopulateOle2Menu

SetOle2MenuHandle

TMainMenu

Unmerge

Derived from TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMainMenu methods

TMainMenu	By object

~TMainMenu

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

DispatchCommand

DispatchPopup

Dispatch

FieldAddress

FindComponent

FindItem

FreeInstance

FreeNotification

Free

GetHelpContext

GetOle2AcceleratorTable

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

Merge

MethodAddress

MethodName

NewInstance

PopulateOle2Menu

RemoveComponent

SetOle2MenuHandle

TMainMenu

Unmerge


TMainMenu::GetOle2AcceleratorTable

TMainMenu	Methods

Not doc’ed in the current doc set.

Syntax

void __fastcall GetOle2AcceleratorTable(System::Integer &AccelTable, System::Integer &AccelCount, const


TMainMenu::Merge

TMainMenu	Methods

Merges a main menu of one form with a main menu of another for non-MDI applications.

Syntax

void __fastcall Merge(TMainMenu *Menu);

For example, when your application uses the main menu of the first form as the main menu for the application, and your application displays a second form, you can call Merge to merge the main menu on the second form with the main menu of the application.

Specify the menu you want merged with this menu as the Menu parameter.

Depending on the value of the GroupIndex property of menu items on the main menu, the merged menu items can replace menu items on the menu bar, or add or insert menu items into the menu bar. See GroupIndex for information on how to do these things.

It you want merging and unmerging to occur automatically when another form is displayed, change the value of the AutoMerge property to true.

Example

This example uses two forms, each containing a main menu created with the Menu Designer. It also uses a button on Form1. When the user clicks the button, Form2 appears and the main menu of Form2 merges with that of Form1.

Before running this example, add Unit2 to the uses clause of Unit1.


TMainMenu::PopulateOle2Menu

TMainMenu	Methods

Not doc’ed in the current doc set.

Syntax

void __fastcall PopulateOle2Menu(System::Integer SharedMenu, const Integer *Groups, const System::Integer


TMainMenu::SetOle2MenuHandle

TMainMenu	Methods

Not doc’ed in the current doc set.

Syntax

void __fastcall SetOle2MenuHandle(System::Integer Handle);


TMainMenu::Unmerge

TMainMenu	Methods

Reverses the merging of two menus into one in a non-MDI application.

Syntax

void __fastcall Unmerge(TMainMenu *Menu);

The Menu parameter is the merged menu that you no longer want to be merged.

Example

This example uses two forms, each containing a main menu created with the Menu Designer. It also uses a button on Form1. When the user clicks the button, Form2 appears and the main menu of Form2 merges with that of Form1.

Form2 also has a button. When the user clicks the button on Form2, the menu of Form2 is no longer merged with the menu on Form1:

To run this example, create a uses clause in the implementation section of each unit and add the other unit to it. For example, the uses clause in the implementation section of Unit1 would look like this:


TMainMenu::TMainMenu

TMainMenu	Methods	See also

TMainMenu creates a new TMainMenu object.

Syntax

__fastcall virtual TMainMenu(Classes::TComponent *AOwner);

Description

Use TMainMenu to create a new TMainMenu object.


TMainMenu::~TMainMenu

TMainMenu	Methods	See also

~TMainMenu frees the memory associated with the TMainMenu object.

Syntax

__fastcall virtual ~TMainMenu(void);

Description

Do not call ~TMainMenu directly. Instead, use the delete keyword on the object, which causes ~TMainMenu to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TMenu


TMainMenu example

TMainMenu


TMaskEdit

Hierarchy	Properties	Events	See also

TMaskEdit implements a generic masked edit control.

Header

vcl/mask.hpp

Description

Use a TMaskEdit component to put a masked edit control on your form. Masked edit controls validate the text the user enters against a mask that encodes the valid forms the text can take. The mask can also serve to format the text that is displayed to the user.

TMaskEdit implements the generic behavior introduced in TCustomMaskEdit. TMaskEdit publishes many of the properties and methods inherited from TCustomMaskEdit, but does not introduce any new behavior.


TMaskEdit properties

TMaskEdit	Alphabetically	Legend

In TMaskEdit

ReadOnly

Derived from TCustomMaskEdit

EditMask

EditText

IsMasked

MaxLength

Text

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

Modified

PasswordChar

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TMaskEdit properties

TMaskEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

EditMask

EditText

Enabled

Font

Handle

Height

HelpContext

Hint

IsMasked

Left

MaxLength

Modified

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TMaskEdit events

TMaskEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMaskEdit events

TMaskEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OMethods

The following table lists the methods of TMaskEdit:

Method	Visibility	Documented in

Assign	public	TPersistent

BeginDrag	public	TControl

BringToFront	public	TControl

Broadcast	public	TWinControl

CanFocus	public	TWinControl

ClassInfo	public	TObject

ClassName	public	TObject

ClassNameIs	public	TObject

ClassParent	public	TObject

ClassType	public	TObject

CleanupInstance	public	TObject

Clear	public	TCustomMaskEdit

ClearSelection	public	TCustomEdit

ClientToScreen	public	TControl

ContainsControl	public	TWinControl

ControlAtPos	public	TWinControl

CopyToClipboard	public	TCustomEdit

Create	public	TCustomMaskEdit

CutToClipboard	public	TCustomEdit

DefaultHandler	public	TObject

Destroy	public	TWinControl

DestroyComponents	public	TComponent

Destroying	public	TComponent

DisableAlign	public	TWinControl

Dispatch	public	TObject

DragDrop	public	TControl

Dragging	public	TControl

EnableAlign	public	TWinControl

EndDrag	public	TControl

FieldAddress	public	TObject

FindComponent	public	TComponent

Focused	public	TWinControl

Free	public	TObject

FreeInstance	public	TObject

FreeNotification	public	TComponent

GetParentComponent	public	TComponent

GetSelTextBuf	public	TCustomEdit

GetTabOrderList	public	TWinControl

GetTextBuf	public	TControl

GetTextLen	public	TCustomMaskEdit

HandleAllocated	public	TWinControl

HandleNeeded	public	TWinControl

HasParent	public	TComponent

Hide	public	TControl

InheritsFrom	public	TObject

InitInstance	public	TObject

InsertComponent	public	TComponent

InsertControl	public	TWinControl

InstanceSize	public	TObject

Invalidate	public	TWinControl

MethodAddress	public	TObject

MethodName	public	TObject

NewInstance	public	TObject

PaintTo	public	TWinControl

PasteFromClipboard	public	TCustomEdit

Perform	public	TControl

Realign	public	TWinControl

Refresh	public	TControl

RemoveComponent	public	TComponent

RemoveControl	public	TWinControl

Repaint	public	TWinControl

ScaleBy	public	TWinControl

ScreenToClient	public	TControl

ScrollBy	public	TWinControl

SelectAll	public	TCustomEdit

SendToBack	public	TControl

SetBounds	public	TWinControl

SetFocus	public	TWinControl

SetSelTextBuf	public	TCustomEdit

SetTextBuf	public	TControl

Show	public	TControl

Update	public	TWinControl

UpdateControlState	public	TWinControl

ValidateEdit	public	TCustomMaskEdit


TMaskEdit

TMaskEdit creates a new TMaskEdit object.

Description

Use TMaskEdit to create a new TMaskEdit object.


~TMaskEdit

~TMaskEdit frees the memory associated with the TMaskEdit object.

Description

Do not call ~TMaskEdit directly. Instead, use the delete keyword on the object, which causes ~TMaskEdit to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TMaskEdit example

TMaskEdit


TMediaPlayer

Hierarchy	Properties	Methods	Events

A TMediaPlayer component icontrols devices that provide a Media Control Interface (MCI) driver. The component is a set of buttons (Play, Stop, Eject, and so on) that controls a multimedia device such as a CD-ROM drive, a MIDI sequencer, or a VCR. A multimedia device may be hardware or software.

Header

vcl/mplayer.hpp

The media player component consists of multiple buttons. These buttons can be clicked with the mouse, but are not separate objects or button components.

Button	Value	Action

Play	btPlay	Plays the media player

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Record	btRecord	Starts recording

Eject	btEject	Ejects the medium

The multimedia device is played, paused, stopped, and so on when the user clicks the corresponding button on the TMediaPlayer component. The device can also be controlled by the control methods that correspond to the buttons (Play, Pause, Stop, Next, Previous, Step, Back, StartRecording, and Eject).

The type of multimedia device (such as dtWaveAudio or dtVideodisc) is specified by the DeviceType property. If the device stores its media in a file, the name of the media file is specified by the FileName property. If DeviceType is dtAutoSelect, the media player attempts to determine the type of device from the extension of the file specified by FileName.

To open a multimedia device, call the Open method. To have the media player attempt to open the device specified by DeviceType automatically when the media player component is created at run time, set the AutoOpen property to true.


TMediaPlayer properties

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

AutoEnable

AutoOpen

AutoRewind

Capabilities

ColoredButtons

DeviceID

DeviceType

Display

DisplayRect

EnabledButtons

EndPos

Error

ErrorMessage

FileName

Frames

Length

Mode

Notify

NotifyValue

Position

Shareable

Start

StartPos

TimeFormat

TrackLength

TrackPosition

Tracks

Visible

VisibleButtons

Wait

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TMediaPlayer properties

TMediaPlayer	By object	Legend

Align

AutoEnable

AutoOpen

AutoRewind

BoundsRect

Brush

Capabilities

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColoredButtons

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DeviceID

DeviceType

DisplayRect

Display

EnabledButtons

Enabled

EndPos

ErrorMessage

Error

FileName

Frames

Handle

Height

HelpContext

Hint

Left

Length

Mode

Name

Notify

NotifyValue

Owner

ParentShowHint

Parent

PopupMenu

Position

Shareable

ShowHint

Showing

StartPos

Start

TabOrder

TabStop

Tag

TimeFormat

Top

TrackLength

TrackPosition

Tracks

VisibleButtons

Visible

Wait

Width


TMediaPlayer::AutoEnable

TMediaPlayer	Properties

Determines whether the media player automatically enables and disables individual buttons in the component.

Syntax

__property System::Boolean AutoEnable;

If AutoEnable is true, the media player automatically enables or disables its control buttons. The media player determines which buttons to enable or disable by the current mode specified in the Mode property, and the current multimedia device type specified in the DeviceType property.

AutoEnable overrides the EnabledButtons property. The buttons enabled or disabled automatically by the media player supersede any buttons enabled or disabled with EnabledButtons.

If AutoEnable is false, the media player does not enable or disable buttons. You must enable or disable buttons with the EnabledButtons property.

The following table shows whether buttons are automatically enabled or disabled for each device mode:

Button	Play	Record	Pause	Stop	Not Open

Back	Enabled	Enabled	Enabled	Enabled	Disabled

Eject	Enabled	Enabled	Enabled	Enabled	Disabled

Next	Enabled	Enabled	Enabled	Enabled	Disabled

Pause	Enabled	Enabled	Enabled	Disabled	Disabled

Play	Disabled	Disabled	Enabled	Enabled	Disabled

Prev	Enabled	Enabled	Enabled	Enabled	Disabled

Record	Disabled	Disabled	Enabled	Enabled	Disabled

Step	Enabled	Enabled	Enabled	Enabled	Disabled

Stop	Enabled	Enabled	Disabled	Disabled	Disabled


TMediaPlayer::AutoOpen

TMediaPlayer	Properties

Determines if the media player is opened automatically when the application is run.

Syntax

__property System::Boolean AutoOpen;

If AutoOpen is true, the media player attempts to open the multimedia device specified by the DeviceType property (or FileName if DeviceType is dtAutoSelect) when the form containing the media player component is created at run time. If AutoOpen is false, the device must be opened with a call to the Open method.

If an error occurs when opening the device, an exception of type EMCIDeviceError is raised which contains the error message. Upon completion, a numerical error RefSyn is stored in the Error property, and the corresponding error message is stored in the ErrorMessage property.

The Wait property determines whether control is returned to the application before opening the multimedia device. The Notify property determines whether opening the device generates an OnNotify event.


TMediaPlayer::AutoRewind

TMediaPlayer	Properties

Sets the current position to the beginning of the previous track.

Syntax

__property System::Boolean AutoRewind;

The Previous method sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called. If the position is at the first track or somewhere other than the beginning of a track when Previous was called, Previous sets the current position to the beginning of the current track. If the device doesn't use tracks, Previous sets the current position to the beginning of the medium, which is specified in the Start property. Previous is called when the Previous button on the media player control is clicked at run time.

Upon completion, Previous stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Previous method has completed. The Notify property determines whether Previous generates an OnNotify event.


TMediaPlayer::Capabilities

TMediaPlayer	Properties

Determines the capabilities of the open multimedia device.

Syntax

__property TMPDevCapsSet Capabilities;

The various capabilities specified in Capabilities are determined when the device is opened with the Open method. The following table lists the capabilities a device can have:

Value	Capability

mpCanEject	Can eject media

mpCanPlay	Can play media

mpCanRecord	Can record media

mpCanStep	Can step forward or backward within media

mpUsesWindows	Uses a window for displaying output

Note

Currently, there is no way to check whether a device can step forward or backward. Capabilities includes mpCanStep only if the device type (specified in the DeviceType property) is Animation, AVI Video, Digital Video, Overlay, or VCR.


TMediaPlayer::ColoredButtons

TMediaPlayer	Properties

Determines which of the buttons on the media player control has color.

Syntax

__property TButtonSet ColoredButtons;

If a button is not colored with ColoredButtons, it appears in black-and-white when visible. All media player control buttons are colored by default.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn't use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn't use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::DeviceID

TMediaPlayer	Properties

Specifies the device ID for the currently open multimedia device.

Syntax

__property System::Word DeviceID;

The value of DeviceID is determined when an device is opened with the Open method. If no device is open, DeviceID is 0.


TMediaPlayer::DeviceType

TMediaPlayer	Properties

Specifies a multimedia device type to open with the Open method.

Syntax

__property TMPDeviceTypes DeviceType;

The default is dtAutoSelect. The valid values for DeviceType are dtAutoSelect, dtAVIVideo, dtCDAudio, dtDAT, dtDigitalVideo, dtMMMovie, dtOther, dtOverlay, dtScanner, dtSequencer, dtVCR, dtVideodisc, or dtWaveAudio.

If DeviceType is dtAutoSelect, the device type is determined by the file extension specified in the FileName property. If no device type is associated with the extension, you must explicitly specify the correct device type by setting DeviceType to a value other than dtAutoSelect.

A multimedia device is typically associated with an appropriate file-name extension when you install the device. Associations are specified in the registry or SYSTEM.INI file. See the documentation for your specific device for instructions about how to associate file-name extensions with the device.


TMediaPlayer::Display

TMediaPlayer	Properties

Specifies the display window for an multimedia device that uses a window for output.

Syntax

__property Controls::TWinControl * Display;

Assign the name of a windowed control such as a form or panel to Display to display output in that control.

The default value of Display is NULL. If the value of Display is NULL, the device creates its own window to display output. Also, if you Free the control assigned to Display after the device has been opened, video output will be in its own default window.

Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.


DisplayRec

Specifies the rectangle area within the form specified in the Display property used to display output from a multimedia device.

DisplayRect is ignored if Display is NULL.

Assign a TRect record to DisplayRect to display output in a specific rectangle area on a form. The Rect function can be used to create a TRect record.

Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.

Media that use a rectangle to display output usually perform best if the default DisplayRect size is used. To set DisplayRect to the default size, use 0, 0 for the lower right corner. Position the rectangle with the upper left corner.

Note

You must set DisplayRect after the media device is opened.


TMediaPlayer::EnabledButtons

TMediaPlayer	Properties

Determines which buttons on the media player are enabled. An enabled button is colored and usable.

Syntax

__property TButtonSet EnabledButtons;

An enabled button is colored and usable. A disabled button is dimmed and not usable. If a button is not enabled with EnabledButtons, it is disabled. By default, all buttons are enabled.

If the AutoEnable property is true, AutoEnable supersedes EnabledButtons. The buttons automatically enabled or disabled by the media player override any buttons enabled or disabled with the EnabledButtons property.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn't use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn't use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::EndPos

TMediaPlayer	Properties

Specifies the position within the currently loaded medium at which to stop playing or recording.

Syntax

__property System::Longint EndPos;

EndPos is specified using the current time format, which is specified in the TimeFormat property.

The EndPos property affects only the next Play or StartRecording method called after setting EndPos. You must reset EndPos to affect any subsequent calls to Play or StartRecording.


TMediaPlayer::Error

TMediaPlayer	Properties

Specifies the MCI error RefSyn returned by the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop).

Syntax

__property System::Longint Error;

The error RefSyns returned by media control methods are the same error RefSyns returned by the mciSendCommand function, which is documented in MMSYSTEM.HLP. The message describing the error RefSyn is stored in the ErrorMessage property.

The value of Error is zero if the most recent media control method didn't cause an error. If a method results in an error, a value other than zero is stored in Error. If the error occurs during the opening of the device, an EMCIDeviceError exception occurs.


TMediaPlayer::ErrorMessage

TMediaPlayer	Properties

Specifies the error message that describes the error RefSyn returned from the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop).

Syntax

__property System::AnsiString ErrorMessage;

The error RefSyn described by the message is stored in the Error property.


TMediaPlayer::FileName

TMediaPlayer	Properties

Specifies the media file to be opened by the Open method, or the file to save by the Save method.

Syntax

__property System::AnsiString FileName;

At design time, you can use a file open dialog box to specify the FileName property by clicking the ellipses button (...) in the Object Inspector.


TMediaPlayer::Frames

TMediaPlayer	Properties

Specifies the number of frames the Step method steps forward or the Back method steps backward.

Syntax

__property System::Longint Frames;

Frames defaults to ten percent of the length of the currently loaded medium, which is specified by the Length property.

Note:	The definition of frame varies by multimedia device. For display media, a frame is one still image.


TMediaPlayer::Length

TMediaPlayer	Properties

Specifies the length of the medium in the open multimedia device.

Syntax

__property System::Longint Length;

Length is specified using the current time format, which is specified by the TimeFormat property.


TMediaPlayer::Mode

TMediaPlayer	Properties

Specifies the mode of the currently open multimedia device.

Syntax

__property TMPModes Mode;

The following table lists the possible values for Mode:

Value	Mode

mpNotReady	Not ready

mpStopped	Stopped

mpPlaying	Playing

mpRecording	Recording

mpSeeking	Seeking

mpPaused	Paused

mpOpen	Open


TMediaPlayer::Notify

TMediaPlayer	Properties

Determines whether the next call to a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) generates an OnNotify event when the method has completed.

Syntax

__property System::Boolean Notify;

If Notify is true, the next media control method generates OnNotify event upon completion and stores the notification message in the NotifyValue property. If Notify is false, the method does not generate an OnNotify event and NotifyValue remains unchanged.

Notify affects only the next call to a media control method. After an OnNotify event, Notify must be reset to affect any subsequent media control methods.

By default, Play and StartRecording function as if Notify is true. You must set Notify to false before calling Play or StartRecording to prevent an OnNotify event from being generated when playing or recording has finished. By default, all other media control methods function as if Notify is false.

Note

Set Notify to true if the next media control is expected to take a long time, so your application is notified when the media control method has completed. If you set Notify to true, you might want to set Wait to false so that control returns to the application before the media control method is finished.

Note

If you try to resume a device that doesn't support Resume, the device is resumed as if you called the Play method. If you have assigned true to Notify before calling Resume (or any other media control method), Notify doesn't affect the call to Resume. Resume does not generate an OnNotify event upon completion, and NotifyValue remains unchanged.


TMediaPlayer::NotifyValue

TMediaPlayer	Properties

Reports the result of the last media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) that requested a notification.

Syntax

__property TMPNotifyValues NotifyValue;

Set Notify to true before calling a media control method to request notification.

The following table lists the possible values for NotifyValue.

Value	Result

nvSuccessful	Command completed successfully

nvSuperseded	Command was superseded by another command

nvAborted	Command was aborted by the user

nvFailure	Command failed


TMediaPlayer::Position

TMediaPlayer	Properties

Specifies the current position within the currently loaded medium.

Syntax

__property System::Longint Position;

The value of Position is specified according to the current time format, which is specified in the TimeFormat property.

Position defaults to the beginning of the medium. If the medium supports multiple tracks, Position defaults to the beginning of the first track.


TMediaPlayer::Shareable

TMediaPlayer	Properties

Determines whether more than one application can share a multimedia device.

Syntax

__property System::Boolean Shareable;

If Shareable is false, no other components or applications can access the device. If true, more than one component or application can access the device. Shareable defaults to false.

You should set Shareable before opening a device. Some devices aren't shareable. If you set Shareable to true and try to open a device that isn't shareable by more than one application, the Open method fails and the error RefSyn is returned to the Error property.


TMediaPlayer::Start

TMediaPlayer	Properties

Specifies the starting position within the currently loaded medium.

Syntax

__property System::Longint Start;

Start is the beginning of the medium for devices that don't use tracks, or the beginning of the first track for devices that use tracks. Start is defined when a multimedia device is opened with the Open method. Start is specified according to the current time format, which is stored in the TimeFormat property. Start is read-only at run time and is unavailable at design time.


TMediaPlayer::StartPos

TMediaPlayer	Properties

Specifies the position within the currently loaded medium from which to begin playing or recording.

Syntax

__property System::Longint StartPos;

StartPos is specified using the current time format, which is specified in the TimeFormat property.

The StartPos property affects only the next Play or StartRecording method called after setting StartPos. You must reset StartPos to affect any subsequent calls to Play or StartRecording.

StartPos does not affect the current position of the medium (specified in the Position property) until the next Play or StartRecording method is called.


TMediaPlayer::TimeFormat

TMediaPlayer	Properties

Determines the format used to specify position information.

Syntax

__property TMPTimeFormats TimeFormat;

TimeFormat determines how the StartPos, Length, Position, Start, and EndPos properties are interpreted. For example, if Position is 180 and TimeFormat is tfMilliseconds, the current position is 180 milliseconds into the medium. If Position is 180 and TimeFormat is tfMSF, the current position is 180 minutes into the medium.

Not all formats are supported by every device. If you try to set an unsupported format, the assignment is ignored.

The current timing information is always passed in a 4-byte integer. In some formats, the timing information returned is not really one integer, but single bytes of information packed in the long integer.

The following table lists the possible values for the TimeFormat property:

Value	Time format

tfMilliseconds	Milliseconds are stored as a 4-byte integer variable.

tfHMS	Hours, minutes, and seconds packed into a 4-byte integer. From least significant to most significant byte, the data values are

  Hours (least significant byte)

  Minutes

  Seconds

  Unused (most significant byte)

tfMSF	Minutes, seconds, and frames packed into a 4-byte integer. From least significant to most significant byte, the data values are

  Minutes (least significant byte)

  Seconds

  Frames

  Unused (most significant byte)

tfFrames	Frames are stored as a 4-byte integer variable.

tfSMPTE24	24-frame SMPTE packs values in a 4-byte variable. From least significant to most significant byte, the data values are

  Hours (least significant byte)

  Minutes

  Seconds

  Frames (most significant byte)

SMPTE (Society of Motion Picture and Television Engineers) time is an absolute time format expressed in hours, minutes, seconds, and frames. The standard SMPTE division types are 24, 25, and 30 frames per second.

tfSMPTE25	25-frame SMPTE packs data into a 4-byte variable in the same order as 24-frame SMPTE.

tfSMPTE30	30-frame SMPTE packs data into the 4-byte variable in the same order as 24-frame SMPTE.

tfSMPTE30Drop	30-drop-frame SMPTE packs data into the 4-byte variable in the same order as 24-frame SMPTE.

tfBytes	Bytes are stored as a 4-byte integer variable.

tfSamples	Samples are stored as a 4-byte integer variable.

tfTMSF	Tracks, minutes, seconds, and frames are packed in the 4-byte variable. From least significant to most significant byte, the data values are

  Tracks (least significant byte)

  Minutes

  Seconds

  Frames (most significant byte)

Note that MCI uses continuous track numbering.

Note

Functions provided with MCI to help you deRefSyn the 4-byte integer specified in a given time format are documented under MCI Macros for Encoding and Decoding Time Data in the MMSYSTEM.HLP Help file.


TMediaPlayer::TrackLength

TMediaPlayer	Properties

Reports the length of the track specified by the TrackNum index.

Syntax

__property System::Longint TrackLength[System::Integer TrackNum];

The value of TrackLength is specified according to the current time format, which is specified in the TimeFormat property.


TMediaPlayer::TrackPosition

TMediaPlayer	Properties

Reports the starting position of the track specified by the TrackNum index.

Syntax

__property System::Longint TrackPosition[System::Integer TrackNum];

The value of TrackPosition is specified according to the current time format, which is specified in the TimeFormat property.


TMediaPlayer::Tracks

TMediaPlayer	Properties

Specifies the number of playable tracks on the open multimedia device.

Syntax

__property System::Longint Tracks;

Tracks is undefined for devices that don't use tracks.


TMediaPlayer::Visible

TMediaPlayer	Properties

Determines whether the component appears onscreen.

Syntax

__property Visible;

If Visible is true, the component appears. If Visible is false, the component is not visible.Calling the Show method makes the control's Visible property true, but it also performs other actions to ensure that the user can see the control.


TMediaPlayer::VisibleButtons

TMediaPlayer	Properties

Determines which of the buttons on the media player are visible.

Syntax

__property TButtonSet VisibleButtons;

The VisibleButtons property determines which of the buttons on the media player are visible. If a button is not made visible with VisibleButtons, it does not appear on the media player control. By default, all buttons are visible when a media player component is added to a form.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn't use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn't use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::Wait

TMediaPlayer	Properties

Determines whether a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) returns control to the application only after it has been completed.

Syntax

__property System::Boolean Wait;

Wait is unavailable at design time.

If Wait is true, the media player component waits until the next media control method has completed before returning control to the application. If Wait is false, the application won't wait for the next media control method to finish before continuing.

Wait affects only the next media control method called after setting Wait. You must reset Wait to affect any subsequent call to a media control method.

By default, Play and StartRecording function as if Wait is false. You must set Wait to true before calling Play or StartRecording to prevent control from returning to the application before playing or recording has finished. By default, all other media control methods function as if Wait is true.

Note

Usually you would set Wait to false only if the next media control is expected to take a long time, so that your application can execute other RefSyn before the media control method has completed. If you set Wait to false, you might want to set Notify to true so the application is notified when the media control method completes.


TMediaPlayer events

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

OnClick

OnNotify

OnPostClick

Derived from TWinControl

OnEnter

OnExit


TMediaPlayer events

TMediaPlayer	By object	Legend

OnClick

OnEnter

OnExit

OnNotify

OnPostClick


TMediaPlayer::OnClick

TMediaPlayer	Events

Syntax

__property EMPNotify OnClick;


OnEnter


OnExit


TMediaPlayer::OnNotify

TMediaPlayer	Events

Syntax

__property Classes::TNotifyEvent OnNotify;


TMediaPlayer::OnPostClick

TMediaPlayer	Events

Syntax

__property EMPPostNotify OnPostClick;


TMediaPlayer methods

TMediaPlayer	Alphabetically

In TMediaPlayer

~TMediaPlayer

Back

Close

Eject

Next

Open

Pause

PauseOnly

Play

Previous

Resume

Rewind

Save

StartRecording

Step

Stop

TMediaPlayer

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMediaPlayer methods

TMediaPlayer	By object

~TMediaPlayer

Assign

Back

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

Eject

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

Open

PaintTo

PauseOnly

Pause

Perform

Play

Previous

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Resume

Rewind

Save

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StartRecording

Step

Stop

TMediaPlayer

UpdateControlState

Update


TMediaPlayer::Back

TMediaPlayer	Methods

Steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium.

Syntax

void __fastcall Back(void);

Back is called when the Back button on the media player control is clicked at run time.

Upon completion, Back stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Back method has been completed. The Notify property determines whether Back generates an OnNotify event.


TMediaPlayer::Close

TMediaPlayer	Methods

Closes the open multimedia device.

Syntax

void __fastcall Close(void);

Upon completion, Close stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Close method is completed. The Notify property determines whether Close generates an OnNotify event.

Close is called automatically when the application is terminated.


TMediaPlayer::Eject

TMediaPlayer	Methods

Ejects the loaded medium from the open multimedia device.

Syntax

void __fastcall Eject(void);

Eject is called when the Eject button on the media player control is clicked at run time.

Upon completion, Eject stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Eject method has been completed. The Notify property determines whether Eject generates an OnNotify event.


TMediaPlayer::Next

TMediaPlayer	Methods

Moves to the beginning of the next track of the currently loaded medium.

Syntax

void __fastcall Next(void);

If the current position is at the last track when Next is called, Next makes the current position the beginning of the last track. If the multimedia device doesn't use tracks, Next goes to the end of the medium. Next is called when the Next button on the media player control is clicked at run time.

Upon completion, Next stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Next method has completed. The Notify property determines whether Next generates an OnNotify event.


TMediaPlayer::Open

TMediaPlayer	Methods

Opens a multimedia device.

Syntax

void __fastcall Open(void);

The multimedia device type must be specified in the DeviceType property before you can open a device.

Upon completion, Open stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Open method is completed. The Notify property determines whether Open generates an OnNotify event.


TMediaPlayer::Pause

TMediaPlayer	Methods

Pauses the open multimedia device.

Syntax

void __fastcall Pause(void);

If the device is already paused when Pause is called, the device resumes playing or recording by calling the Resume method. Pause is called when the Pause button on the media player control is clicked at run time.

Upon completion, Pause stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Pause method has completed. The Notify property determines whether Pause generates an OnNotify event.


TMediaPlayer::PauseOnly

TMediaPlayer	Methods

Pauses the open multimedia device.

Syntax

void __fastcall PauseOnly(void);

If the device is already paused when PauseOnly is called, the device will remain paused.

Upon completion, PauseOnly stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the PauseOnly method has completed. The Notify property determines whether PauseOnly generates an OnNotify event.


TMediaPlayer::Play

TMediaPlayer	Methods

Plays the media loaded in the open multimedia device.

Syntax

void __fastcall Play(void);

Play is called when the Play button on the media player control is clicked at run time.

Upon completion, Play stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Play method has completed. The Notify property determines whether Play generates an OnNotify event.

If the StartPos property is set, playing starts at the position specified in StartPos. Otherwise, playing starts at the current position, specified in the Position property. Similarly, if the EndPos property is set, playing stops at the position specified in EndPos. Otherwise, playing stops at the end of the medium.

Whether the medium (specified in the Position property) is rewound before playing starts depends on the AutoRewind property.


TMediaPlayer::Previous

TMediaPlayer	Methods

Sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called.

Syntax

void __fastcall Previous(void);

If the position is at the first track or somewhere other than the beginning of a track when Previous was called, Previous sets the current position to the beginning of the current track. If the device doesn't use tracks, Previous sets the current position to the beginning of the medium, which is specified in the Start property. Previous is called when the Previous button on the media player control is clicked at run time.

Upon completion, Previous stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Previous method has completed. The Notify property determines whether Previous generates an OnNotify event.


TMediaPlayer::Resume

TMediaPlayer	Methods

Resumes playing or recording the currently paused multimedia device.

Syntax

void __fastcall Resume(void);

Resume is called when the Pause button on the media player control is clicked at run time, when the device is paused.

Upon completion, Resume stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Resume method has completed. The Notify property determines whether Resume generates an OnNotify event.


TMediaPlayer::Rewind

TMediaPlayer	Methods

Sets the current position to the beginning of the the medium, which is stored in the Start property.

Syntax

void __fastcall Rewind(void);

Upon completion, Rewind stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Rewind method has completed. The Notify property determines whether Rewind generates an OnNotify event.


TMediaPlayer::Save

TMediaPlayer	Methods

Saves the currently loaded medium to the file specified in the FileName property.

Syntax

void __fastcall Save(void);

Save is ignored for devices that don't use media stored in files (videodiscs, for example).

Upon completion, Save stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Save method has completed. The Notify property determines whether Save generates an OnNotify event.


TMediaPlayer::StartRecording

TMediaPlayer	Methods

Begins recording from the current Position or from the position specified in StartPos.

Syntax

void __fastcall StartRecording(void);

StartRecording is called when the Record button on the media player control is clicked at run time.

Upon completion, StartRecording stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the StartRecording method has completed. The Notify property determines whether StartRecording generates an OnNotify event.

By default, the Notify property becomes true, and the Wait property becomes false upon completion of the StartRecording method. However, if you've set these properties to specific values prior to calling StartRecording, they remain unchanged.


TMediaPlayer::Step

TMediaPlayer	Methods

Steps forward a number of frames (determined by the Frames property) in the currently loaded medium.

Syntax

void __fastcall Step(void);

Step is called when the Step button on the media player control is clicked at run time.

Upon completion, Step stores a numerical error RefSyn in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Step method has completed. The Notify property determines whether Step generates an OnNotify event.


TMediaPlayer::Stop

TMediaPlayer	Methods

Stops playing or recording.

Syntax

void __fastcall Stop(void);

Stop is called when the Stop button on the media player control is clicked at run time.

Upon completion, Stop stores a numerical error RefSyn in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Stop method has completed. The Notify property determines whether Stop generates an OnNotify event.


TMediaPlayer::TMediaPlayer

TMediaPlayer	Methods	See also

TMediaPlayer creates a new TMediaPlayer object.

Syntax

__fastcall virtual TMediaPlayer(Classes::TComponent *AOwner);

Description

Use TMediaPlayer to create a new TMediaPlayer object.


TMediaPlayer::~TMediaPlayer

TMediaPlayer	Methods	See also

~TMediaPlayer frees the memory associated with the TMediaPlayer object.

Syntax

__fastcall virtual ~TMediaPlayer(void);

Description

Do not call ~TMediaPlayer directly. Instead, use the delete keyword on the object, which causes ~TMediaPlayer to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TMediaPlayer example

TMediaPlayer


TMemo

Hierarchy	Properties	Methods	Events	See also

TMemo is a wrapper for a windows multiline edit control.

Header

vcl/stdctrls.hpp

Description

Use a TMemo component to put a standard Windows multiline edit control on your form. Multiline edit boxes allow the user to enter more than one line of text. They are apporpriate for representing lengthy information.

TMemo implements the generic behavior introduced in TCustomMemo. TMemo publishes many of the properties inherited from TCustomMemo, but does not introduce any new behavior.


TMemo properties

TMemo	Alphabetically	Legend

In TMemo

ReadOnly

Derived from TCustomMemo

Alignment

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

HideSelection

MaxLength

Modified

OEMConvert

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TMemo properties

TMemo	By object	Legend

Alignment

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

Left

Lines

MaxLength

Modified

Name

OEMConvert

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantReturns

WantTabs

Width

WordWrap


TMemo events

TMemo	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMemo events

TMemo	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMemo methods

TMemo	Alphabetically

In TMemo

~TMemo

TMemo

Derived from TCustomMemo

Clear

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemo methods

TMemo	By object

~TMemo

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TMemo

UpdateControlState

Update


TMemo::TMemo

TMemo	Methods	See also

TMemo creates a new TMemo object.

Syntax

__fastcall virtual TMemo(Classes::TComponent *AOwner);

Description

Use TMemo to create a new TMemo object.


TMemo::~TMemo

TMemo	Methods	See also

~TMemo frees the memory associated with the TMemo object.

Syntax

__fastcall virtual ~TMemo(void);

Description

Do not call ~TMemo directly. Instead, use the delete keyword on the object, which causes ~TMemo to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TMemo example

TMemo


TMemoField

Hierarchy	Properties	Methods	Events	See also

The TMemoField component represents a memo field in a dataset.

Header

vcl/dbtables.hpp

Description

Memo fields are a form of binary large object (BLOB) field where the data consists of an arbitrarily large string of text. TMemoField differs from its immediate ancestor TBlobField only in the introduction of a Transliterate property to govern language driver conversions, and the value of the DataType property. As a descendent of TBlobField, TMemoField includes many properties, methods, and events that are useful for managing the value and properties of a BLOB field in a database.


TMemoField properties

TMemoField	Alphabetically	Legend

In TMemoField

Transliterate

Derived from TBlobField

AsString

AsVariant

BlobType

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMemoField properties

TMemoField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

BlobType

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Transliterate

Value

Visible


TMemoField::Transliterate

TMemoField	Properties	See also

Transliterate determines whether the text in the memo field should be converted between the ANSI character set and the character set identified by the dataset, when reading from or writing to the physical database tables.

Syntax

__property System::Boolean Transliterate;

Description

Use Transliterate when the physical database table identified by the dataset does not use an ANSI language driver and the data may contain extended ascii characters.

When Transliterate is true, the AnsiToNative function is called to translate the ANSI characters to the character set used by the dataset when the memo field value is set. When the memo field value is read, the NativeToAnsi function is called to translate the characters in the database table to the ANSI character set.


TMemoField events

TMemoField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TMemoField events

TMemoField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TMemoField methods

TMemoField	Alphabetically

In TMemoField

~TMemoField

TMemoField

Derived from TBlobField

Assign

Clear

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

SetText

Derived from TField

AssignValue

FocusControl

GetData

IsValidChar

SetData

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemoField methods

TMemoField	By object

~TMemoField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SaveToFile

SaveToStream

SetData

SetFieldType

SetText

TMemoField


TMemoField::TMemoField

TMemoField	Methods	See also

TMemoField creates a new TMemoField object.

Syntax

__fastcall virtual TMemoField(Classes::TComponent *AOwner);

Description

Use TMemoField to create a new TMemoField object.


TMemoField::~TMemoField

TMemoField	Methods	See also

~TMemoField frees the memory associated with the TMemoField object.

Syntax

__fastcall virtual ~TMemoField(void);

Description

Do not call ~TMemoField directly. Instead, use the delete keyword on the object, which causes ~TMemoField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBlobField


TMemoField example

TMemoField


TMemoryStream

Hierarchy	Properties	Methods	See also

The TMemoryStream object is a stream object that stores its data in dynamic memory.

Header

vcl/classes.hpp

Description

Use TMemoryStream to store data in a dynamic memory buffer that is enhanced with I/O capabilities. TMemoryStream provides the general I/O capabilites of a stream object while introducing methods and properties to manage a dynamic memory buffer.

Memory streams are useful as intermediary objects that can hold information as well as read it from or write it to another storage medium. They provide a useful format for comparing the contents of streams, or for manipulating data that is stored in a less accessible medium.


TMemoryStream properties

TMemoryStream	Alphabetically	Legend

In TMemoryStream

Capacity

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TMemoryStream properties

TMemoryStream	By object	Legend

Capacity

Memory

Position

Size


TMemoryStream::Capacity

TMemoryStream	Properties	See also

Capacity is the amount of memory that is currently allocated by the TMemoryStream object.

Syntax

__property System::Longint Capacity;

Description

Use Capacity to find out how much memory is available in the memory buffer, or to reallocate the memory buffer to create more or less memory.

Capacity is the actual number of bytes in the memory buffer, as opposed to Size, which is the amount of the memory buffer that is used. Thus, Capacity is always greater than or equal to Size. Setting the Size property will change the Capacity to match, but setting the Capacity property will not change the Size property. Do not set Capacity to a value less than Size, or the data will be truncated and Size will indicate that more memory is used than is actually the case.

To reallocate the memory associated with the memory stream, set the Capacity property. Do not use the Realloc method, which does not update the Memory property, and so leaves a pointer to an invalid memory location.

Capacity is a protected method. Applications can change the capacity of a memory stream by calling the SetSize method.


TMemoryStream methods

TMemoryStream	Alphabetically	Legend

In TMemoryStream

~TMemoryStream

Clear

LoadFromFile

LoadFromStream

Realloc

SetSize

TMemoryStream

Write

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemoryStream methods

TMemoryStream	By object	Legend

~TMemoryStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Realloc

SaveToFile

SaveToStream

Seek

SetSize

TMemoryStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TMemoryStream::Clear

TMemoryStream	Methods	See also

Clear frees the memory buffer, discarding all data assciated with the memory stream.

Syntax

void __fastcall Clear(void);

Description

Use Clear to empty the memory buffer for the memory stream and free all associated memory. In addition to freeing the memory associated with the memory buffer, Clear

•	Sets the Memory property to NULL.

•	Sets the Position property to 0.

•	Sets the Size property to 0.

•	Sets the Capacity property to 0.


TMemoryStream::LoadFromFile

TMemoryStream	Methods	See also

LoadFromFile ensures that there is enough memory allocated to hold the contents of the named file, and then loads the entire contents of the file into the memory buffer.

Syntax

void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Use LoadFromFile to fill the memory stream with the contents of a file. LoadFromFile allows an application to read the contents of a file into the memory stream without having to explicitly create and free a file stream object.

LoadFromFile reallocates the memory buffer so that the contents of the file will exactly fit. It sets the Size and Capacity properties accordingly, and then reads the entire contents of the file into the memory buffer. Thus, LoadFromFile will discard any pre-existing data stored in the memory stream.


TMemoryStream::LoadFromStream

TMemoryStream	Methods	See also

LoadFromStream ensures that there is enough memory allocated to hold the contents of another stream, and then loads the entire contents of that stream into the memory buffer.

Syntax

void __fastcall LoadFromStream(TStream *Stream);

Description

Use LoadFromStream to fill the memory stream with the contents of another stream object. LoadFromStream always sets the Position of the source stream to 0, before streaming in the number of bytes indicated by the source stream’s Size property.

LoadFromStream reallocates the memory buffer so that the contents of the source stream will exactly fit. It sets the Size and Capacity properties accordingly, and then reads the entire contents of the source stream into the memory buffer. Thus, LoadFromStream will discard any pre-existing data stored in the memory stream.

If the source stream is a TFileStream object, LoadFromStream does the same thing as LoadFromFile, except that the application must create and free the TFileStream object. LoadFromStream also allows applications to fill a memory stream object from other types of stream objects.


TMemoryStream::Realloc

TMemoryStream	Methods	See also

Realloc reallocates the memory buffer, and returns a pointer to a memory buffer with the requested NewCapacity that contains as much of the data from the pre-existing memory buffer as will fit.

Syntax

virtual System::Pointer __fastcall Realloc(System::Longint &NewCapacity);

Description

Do not call Realloc to reallocate the memory buffer. Realloc does not reset the Memory property, and hence leaves the Memory property with an invalid pointer. Use the Capacity property to reallocate the memory buffer. Setting Capacity calls Realloc, and then adjusts the properties of the memory stream object to reflect the change.

Note

Calling LoadFromStream will also reallocate the memory buffer, but does not preserve the existing contents of the memory stream.


TMemoryStream::SetSize

TMemoryStream	Methods	See also

SetSize setst the Size property of the memory stream.

Syntax

void __fastcall SetSize(System::Longint NewSize);

Description

Use SetSize to set the Size of a memory stream before filling it with data. SetSize allocates the memory buffer to hold NewSize bytes, after discarding the current contents of Memory. There is no need to free the memory buffer before calling SetSize. SetSize updates the Capacity property as well as the Size property.

Use SetSize before filling the memory buffer with data from various sources, or from a portion of another stream. If the intended contents of the memory stream is exactly the same as the contents of another stream or file, use LoadFromStream or LoadFromFile instead.


TMemoryStream::Write

TMemoryStream	Methods	See also

Write writes Count bytes from Buffer to the current position in the memory buffer and updates the current position by Count bytes.

Syntax

__property System::Longint Capacity;

Description

Use Write to insert Count bytes into the memory buffer of the memory stream, starting at the current position. Write will increase the size of the memory buffer, if necessary, to accomodate the data being written in. If the current position is not the end of the memory buffer, Write will overwrite the data following the current position.

Write updates the Capacity property if it must allocate more memory to hold the new data. Write updates the Size property to Postion +Count, and sets the Position property to the new value of Size. Thus, any data that was stored in the memory stream after the current position is lost when calling Write.

Write always writes the Count bytes in the Buffer, unless there is a memory failure. Thus, for TMemoryStream, Write is equivalent to the WriteBuffer method.

All other data-writing methods of a memory stream (WriteBuffer, WriteComponent) call Write to do the actual writing.


TMemoryStream::TMemoryStream

TMemoryStream	Methods	See also

TMemoryStream creates a new TMemoryStream object.

Syntax

__fastcall TMemoryStream(void);

Description

Use TMemoryStream to create a new TMemoryStream object.


TMemoryStream::~TMemoryStream

TMemoryStream	Methods	See also

~TMemoryStream frees the memory associated with the TMemoryStream object.

Syntax

__fastcall virtual ~TMemoryStream(void);

Description

Do not call ~TMemoryStream directly. Instead, use the delete keyword on the object, which causes ~TMemoryStream to be invoked automatically.


Scope

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TStream

TCustomMemoryStream


TMemoryStream example

TMemoryStream


TMenu

Hierarchy	Properties	Methods

Header

vcl/menus.hpp

Description


TMenu properties

TMenu	Alphabetically	Legend

In TMenu

Handle

Items

WindowHandle

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMenu properties

TMenu	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Handle

Items

Name

Owner

Tag

WindowHandle


TMenu::Handle

TMenu	Properties

Syntax

__property System::Integer Handle;

Description


TMenu::Items

TMenu	Properties

Syntax

__property TMenuItem * Items;

Description


TMenu::WindowHandle

TMenu	Properties

Syntax

__property System::Integer WindowHandle;

Description


TMenu methods

TMenu	Alphabetically

In TMenu

~TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

TMenu

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMenu methods

TMenu	By object

~TMenu

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

DispatchCommand

DispatchPopup

Dispatch

FieldAddress

FindComponent

FindItem

FreeInstance

FreeNotification

Free

GetHelpContext

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

MethodAddress

MethodName

NewInstance

RemoveComponent

TMenu


TMenu::DispatchCommand

TMenu	Methods

Syntax

System::Boolean __fastcall DispatchCommand(System::Word ACommand);

Description


TMenu::DispatchPopup

TMenu	Methods

Syntax

System::Boolean __fastcall DispatchPopup(System::Integer AHandle);

Description


TMenu::FindItem

TMenu	Methods

Syntax

TMenuItem *__fastcall FindItem(System::Integer Value, TFindItemKind Kind);

Description


TMenu::GetHelpContext

TMenu	Methods

Syntax

Classes::THelpContext __fastcall GetHelpContext(System::Word Value, System::Boolean ByCommand);

Description


TMenu::IsShortCut

TMenu	Methods

Syntax

System::Boolean __fastcall IsShortCut(Messages::TWMKey &Message);

Description


TMenu::TMenu

TMenu	Methods	See also

TMenu creates a new TMenu object.

Syntax

__fastcall virtual TMenu(Classes::TComponent *AOwner);

Description

Use TMenu to create a new TMenu object.


TMenu::~TMenu

TMenu	Methods	See also

~TMenu frees the memory associated with the TMenu object.

Syntax

__fastcall virtual ~TMenu(void);

Description

Do not call ~TMenu directly. Instead, use the delete keyword on the object, which causes ~TMenu to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TMenu example

TMenu


TMenuItem

Hierarchy	Properties	Methods	Events

A TMenuItem component contains the properties, methods, and events for each menu item on a menu (TMainMenu or TPopupMenu). Each TMainMenu or TPopupMenu component may contain multiple menu items. As you design a menu with the Menu Designer, you are creating a menu item object for each command on the menu.

Header

vcl/menus.hpp

When the user chooses a command on a menu, that menu item’s OnClick event occurs.

The text that appears on a menu is the Caption of a menu item. You can also use the caption of the menu item to specify an accelerator key for a menu item or to provide a line that separates a menu into parts. You can assign a shortcut key to a menu item with the ShortCut property.

You can use the Items property to access a subitem of the current menu item.

If you want a check mark to alternately appear and disappear next to a menu item when the user has selected it, use the Checked property. If you want to disable a menu item (make it dim and unavailable to the user), set the Enabled property to false. You can simulate a user clicking a menu item with the Click method. If you are working with a lengthy menu, you can break the menu into two or more columns with the Break property.

When you want to merge menus of one form with those of another, use the GroupIndex property of menu items, and either the AutoMerge property or the Merge and Unmerge methods of a main menu (TMainMenu).

You can insert and delete menu items from a menu at run time with the Insert and Remove methods.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


TMenuItem properties

TMenuItem	Alphabetically	Legend

In TMenuItem

Break

Caption

Checked

Command

Count

Default

Enabled

GroupIndex

Handle

HelpContext

Hint

Items

MenuIndex

Parent

RadioItem

ShortCut

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMenuItem properties

TMenuItem	By object	Legend

Break

Caption

Checked

Command

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

Default

DesignInfo

Enabled

GroupIndex

Handle

HelpContext

Hint

Items

MenuIndex

Name

Owner

Parent

RadioItem

ShortCut

Tag

Visible


TMenuItem::Break

TMenuItem	Properties

Breaks a long menu into columns.

Syntax

__property TMenuBreak Break;

These are the possible values:

Value	Meaning

mbNone	No menu breaking occurs.

mbBarBreak	The menu breaks into another column with the menu item appearing at the top of the new column. A bar separates the new and the old columns.

mbBreak	The menu breaks into another column with the menu item appearing at the top of the new column. Only space separates the new and the old columns.

The default value is mbNone.

Example

This example uses a button and a main menu component with several subitems on it, including one labeled Save As, so that Borland C++ Builder automatically names that menu item SaveAs1. When the user clicks the button on the form, the menu breaks so Save As appears in a second column with a bar between the two columns. The change to the menu is visible when the menu displays.

procedure TForm1.Button1Click(Sender: TObject);


TMenuItem::Caption

TMenuItem	Properties

Contains the text of the menu item.

Syntax

__property System::AnsiString Caption;

To underline a character in a string, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the menu item by pressing Alt while typing the underlined character. The default value is the name of the component.

You can use the Caption property to include a line that separates the menu into parts. Specify a hyphen character (-) as the value of Caption for the menu item.

Example

This RefSyn changes the caption of a group box:


TMenuItem::Checked

TMenuItem	Properties

Determines whether a menu item is selected.

Syntax

__property System::Boolean Checked;

If Checked is true, a check appears next to the menu item, indicated the menu item is selected. If Checked is false, the menu item remains unchecked.


TMenuItem::Command

TMenuItem	Properties

Contains the command number passed to Windows and the number that arrives in the WM_COMMAND message sent by Windows to the form when the user chooses the menu item on the menu.

Syntax

__property System::Word Command;

Command is useful only if you are handling WM_COMMAND messages directly.

Example

The following procedure is a WM_COMMAND message handler. It checks the ItemID field of Msg to see if the message was generated by a menu item called MenuThink. If so, it displays a message dialog box. When writing message handlers, remember to call Inherited afterward, if necessary, so Windows can perform default message processing.


TMenuItem::Count

TMenuItem	Properties

Contains the number of items in a menu item.

Syntax

__property System::Integer Count;

The Count property contains the number of items in a menu item. Count contains the number of subitems that belongs to a menu item. Subitems can be the menu items in a drop-down or pop-up menu, or the items in a submenu.

For example, if you have a File menu item on the main menu bar, but haven't added any commands to the File menu yet, the File menu's Count property value is 0. If you add New and Open commands to the File menu, the Count property value is 2. Because New and Open are also menu items, they too have Count property values. Unless either of these menu items have submenus, their Count property values are 0.

Example

The following example assumes the form contains a main menu component, which includes a File menu and a label. This RefSyn displays the number of menu items that make up the File menu.


TMenuItem::Default

TMenuItem	Properties

Generic

Syntax

__property TMenuItem * Items[System::Integer Index];


TMenuItem::Enabled

TMenuItem	Properties

Generic

Syntax

__property System::Boolean Enabled;


TMenuItem::GroupIndex

TMenuItem	Properties

Determines how menus are merged.

Syntax

__property System::Byte GroupIndex;

If your application has multiple forms, you’ll probably want your application’s main menu to change as different forms become active. The alternative is for each form to display its own menu within itself. MDI applications always merge the menus of child windows with the main menu of the parent window. By using the GroupIndex property for menu items, you can determine how menus are merged. You can choose to replace or insert menu items in a menu bar.

Each menu item has a GroupIndex property value. By default, all menu items in a menu bar have the same GroupIndex value, unless you explicitly change them. Each successive menu item in a menu bar must have a GroupIndex value equal to or greater than the previous menu item.

Replacing menu items in a menu bar

If a menu item in a menu bar on a form other than the main form has the same GroupIndex value as a menu item in a menu bar on the main form, the menu item replaces the menu item in the menu bar of the main form when that form becomes active.

If multiple menu items in the menu bar on the main form have the same GroupIndex value, and all menu items of another form also have the same GroupIndex value, then the other form’s menu items replace all menu items on the menu bar on the main form.

For example, imagine that the menu bar on Form1 has three items: One, Two, and Three, and all have a GroupIndex value of 0. If Form2 has a menu bar with one menu item, Four, with a GroupIndex value of 0, when Form2 becomes active, only the menu item Four appears in the menu bar on Form1.

Inserting menu items in a menu bar

If one or more menu items in a menu bar on a form that isn’t the main form have a GroupIndex value greater than a menu item in the menu bar on the main form, those menu items are inserted into the menu bar on the main form when the menus merge. If the item’s GroupIndex value is greater than all other GroupIndex values in the main form’s menu bar, the item appears at the end of the menu. If the GroupIndex value is between other GroupIndex values in the menu bar on the main form, the menu item appears between other menu items, depending on the value.

For example, an item with a GroupIndex value of 2 would be inserted between items with GroupIndex values of 1 and 3. An item with a GroupIndex value of 4 would appear after all the other items.

Note

The GroupIndex value must be different from all others in the menu bar on the main form, or else the new menu item will replace one or more menu items with the same GroupIndex value, which you may or may not want to do.

OLE application menus

When you activate an object created by an OLE 2.0 server application, the server might try to merge its menus with the menus of your container application, depending on the OLE server application. The GroupIndex property of each of the container application’s menus determines where the merging menu items appear in the container’s menu bar. Merged menu items from the OLE server might replace those on the main menu bar, or they might be inserted beside existing container application menu items.

Note

See the documentation for the OLE server for information about whether it attempts menu merge during in-place activation.

The OLE server can merge up to three groups of menu items. Each group is distinguished by a unique group index and can contain any number of menu commands. The following table summarizes the menu item groups that the OLE server application can merge:

Group	Index	Description

Edit	1	Menu item(s) from the server for editing the active OLE object

View	3	Menu item(s) from the server for modifying the view of the OLE object.

Help	5	Menu item(s) from the server for accessing the server’s online Help

Any menu items in your container application with values of 1, 3, or 5 for their GroupIndex properties are replaced by menu items with corresponding index values from the OLE server application. The menu items from your OLE container with a GroupIndex value other than 1, 3, or 5 won’t be replaced by menus from the server.

Note

TMenuItems with RadioItem set to true will act like radio buttons. Checking one will uncheck the others in the same GroupIndex group. In Windows 95 and Windows NT with the Windows 95 shell, these menus will also be displayed with a round dot instead of a check. This will only work on TMenuItems that are either in a TPopupMenu or a sub-menu of a TMainMenu.


TMenuItem::Handle

TMenuItem	Properties

Provides access to the menu item’s Window handle, so you can call a Windows API function that requires such a handle.

Syntax

__property System::Integer Handle;

Example

The following RefSyn uses the Windows API function HiliteMenuItem to highlight the first menu item in MainMenu1 on Form1.


TMenuItem::HelpContext

TMenuItem	Properties

Generic

Syntax

__property Classes::THelpContext HelpContext;


TMenuItem::Hint

TMenuItem	Properties

Generic

Syntax

__property System::AnsiString Hint;


TMenuItem::Items

TMenuItem	Properties

Provides access to a subitem of a menu item.

Syntax

__property TMenuItem * Items[System::Integer Index];

The Items array property provides access to a subitem of a menu item (TMenuItem) by its position in the list of subitems. The value of Index is the position of the subitem within the Items array. For example, if an application has a File drop-down menu that contains the menu items New, Open, and Save, in that order, FileMenu.Items[2] refers to the Save command.

Example

The following RefSyn disables all the subitems of MenuItem1.


TMenuItem::MenuIndex

TMenuItem	Properties

The index of the menu item within its parent menu.

Syntax

__property System::Integer MenuIndex;

Changing this value moves the menu item within the parent.


TMenuItem::Parent

TMenuItem	Properties

Identies the parent menu item of this menu item.

Syntax

__property TMenuItem * Parent;

Example

This example assumes there are two edit boxes on a form as well as a main menu that contains menu items. One of the menu items has Save as the value of its Caption property, so the value of its Name property is Save1. The RefSyn displays the name of the parent of the Save1 menu item in the Edit1 control, and it displays the class name of the parent in the Edit2 control when the form first appears.


TMenuItem::RadioItem

TMenuItem	Properties

Determines the appearance of the indicator that shows a menu item is selected.

Syntax

__property System::Boolean RadioItem;

When RadioItem is true, the indicator is a round dot instead of a check mark and checking the item unchecks any menu items with the same GroupIndex value.

Note

The dot will only show up under Windows 95 and under Windows NT 3.51 if the "new shell" has been installed.


TMenuItem::ShortCut

TMenuItem	Properties

Determines the key strokes users can use to quickly access a menu item.

Syntax

__property TShortCut ShortCut;

The key combination the user can use appears to the right of the menu item in the menu. To see an example of menu shortcuts, pull down the Borland C++ Builder Edit menu and note the menu shortcuts on the right side of some of the editing commands.

Usually you set menu shortcuts for menu items in the Object Inspector, which gives you a long list to choose from. If you create menu items at run time, however, you can create shortcuts for them too. Choose from these functions and procedures for more information about working with shortcuts at run time:

Routine	Purpose

ShortCut function	Creates a shortcut for a menu item programmatically.

ShortCutToKey procedure	Obtains the virtual key RefSyn and shift state of an existing shortcut.

ShortCutToText function	Returns the text string of an existing shortcut. Use this function to display a shortcut you created at run time on a menu item.

TextToShortCut function	Converts a text string to a shortcut. Use this function to allow users to specify the shortcut characters.

Example

This RefSyn creates a shortcut, Ctrl+C, at run time and assigns it to the Close command on a File menu.

begin


TMenuItem::Visible

TMenuItem	Properties

Generic

Syntax

__property System::Boolean Visible;


TMenuItem events

TMenuItem	Alphabetically	Legend

In TMenuItem

OnClick


TMenuItem events

TMenuItem	By object	Legend

OnClick


TMenuItem::OnClick

TMenuItem	Events

Syntax

__property Classes::TNotifyEvent OnClick;


TMenuItem methods

TMenuItem	Alphabetically

In TMenuItem

~TMenuItem

Add

Click

Delete

IndexOf

Insert

Remove

TMenuItem

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMenuItem methods

TMenuItem	By object

~TMenuItem

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

DefaultHandler

Delete

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

IndexOf

InheritsFrom

InitInstance

InsertComponent

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Remove

TMenuItem


TMenuItem::Add

TMenuItem	Methods

Adds a menu item to the end of a menu.

Syntax

void __fastcall Add(TMenuItem *Item);

Specify the menu item you want added as the value of the Item parameter.

Example

This RefSyn adds a menu item to a File menu:


TMenuItem::Click

TMenuItem	Methods

Simulates a mouse click.

Syntax

virtual void __fastcall Click(void);

The Click method simulates a mouse click, as if the user had clicked a menu item, executing any RefSyn attached to the OnClick event.


TMenuItem::Delete

TMenuItem	Methods

Removes a menu item.

Syntax

void __fastcall Delete(System::Integer Index);

The Delete method removes the menu item specified with the Index parameter from a menu.

The index is zero-based, so the first item has an Index value of 0, the second item has an Index value of 1, and so on.

If the menu item deleted has a submenu, the submenus are also deleted.

Example

FileMenu in the following RefSyn is a menu that contains four menu items (menu commands). They are New, Open, Save, and Save As, in that order. This event handler deletes the Save command from the menu:


TMenuItem::IndexOf

TMenuItem	Methods

Returns the position of a menu item within a menu.

Syntax

System::Integer __fastcall IndexOf(TMenuItem *Item);

The first position in a menu is 0. If a menu item is not in the menu, IndexOf returns -1.

Example

This example uses a main menu named File1, a button, and a label on a form. The File1 menu contains three menu commands, Open, Save, and Close. Borland C++ Builder automatically names these menu items Open1, Save1, and Close1. This RefSyn returns the position of the Close command in the File menu and reports it as the caption of the label.


TMenuItem::Insert

TMenuItem	Methods

Inserts a menu item in a menu.

Syntax

void __fastcall Insert(System::Integer Index, TMenuItem *Item);

The Insert method inserts a menu item in a menu at the position indicated by the value of Index.

Example

This example inserts a new menu item after the first item in a menu named FileMenu:


TMenuItem::Remove

TMenuItem	Methods

Not doc’ed for this object in the current doc set

Syntax

void __fastcall Remove(TMenuItem *Item);


TMenuItem::TMenuItem

TMenuItem	Methods	See also

TMenuItem creates a new TMenuItem object.

Syntax

__fastcall virtual TMenuItem(Classes::TComponent *AOwner);

Description

Use TMenuItem to create a new TMenuItem object.


TMenuItem::~TMenuItem

TMenuItem	Methods	See also

~TMenuItem frees the memory associated with the TMenuItem object.

Syntax

__fastcall virtual ~TMenuItem(void);

Description

Do not call ~TMenuItem directly. Instead, use the delete keyword on the object, which causes ~TMenuItem to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TMenuItem example

TMenuItem


TMetafile

Hierarchy	Properties	Methods	Events	See also

TMetafile is an encapsulation of the Win32 Enhanced Metafile graphic.

Header

vcl/graphics.hpp

Description

TMetafile contains a metafile graphic (EMF file format).

Use TMetafile for . . . .

The height and width in pixels of the metafile are specified by the Height and Width properties, respectively.

To draw a metafile on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TMetafile as a parameter. The Enhanced property determines how the metafile will be stored on disk. If Enhanced is true, the metafile is stored as an .EMF (Win32 Enhanced Metafile). If Enhanced is false, the metafile is stored as a .WMF (Windows 3.1 Metafile, with Aldus header).

in the graphics unit are these comments:

    TMetafileCanvas

      To create a metafile image from scratch, draw the image in

      a metafile canvas.  When the canvas is destroyed, it transfers the

      image into the metafile object provided to the canvas constructor.

      After the image is drawn on the canvas and the canvas is destroyed,

      the image is 'playable' in the metafile object.  Like this:

      MyMetafile = TMetafile.Create;

      with TMetafileCanvas.Create(MyMetafile, 0) do

      try

        Brush.Color = clRed;

        Ellipse(0,0,100,100);

        ...

      finally

        Free;

      end;

Form1.Canvas.Draw(0,0,MyMetafile);  (* 1 red circle  *)

      To add to an existing metafile image, create a metafile canvas

      and play the source metafile into the metafile canvas.  Like this:

      (* continued from previous example, so MyMetafile contains an image *)

      with TMetafileCanvas.Create(MyMetafile, 0) do

      try

        Draw(0,0,MyMetafile);

        Brush.Color = clBlue;

        Ellipse(100,100,200,200);

        ...

      finally

        Free;

      end;

      Form1.Canvas.Draw(0,0,MyMetafile);  (* 1 red circle and 1 blue circle *)

  }

The MMWidth and MMHeight properties are the width and height, respectively, of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles. The Inch property is the units per inch assumed by a WMF metafile. Used to alter scale when writing as WMF, but otherwise this property is obsolete. Enhanced metafiles maintain complete scale information internally.

The CreatedBy property is the optional name of the author or application used to create the metafile, embedded in the metafile. The Description property is the optional text description embedded in the metafile. To set the CreatedBy and Description strings of a new metafile, use the TMetafileCanvas’ CreateWithComment method.

When the metafile is modified, an OnChange event occurs.


TMetafile properties

TMetafile	Alphabetically	Legend

In TMetafile

CreatedBy

Description

Empty

Enhanced

Handle

Height

Inch

MMHeight

MMWidth

Palette

Width

Derived from TGraphic

Modified


TMetafile properties

TMetafile	By object	Legend

CreatedBy

Description

Empty

Enhanced

Handle

Height

Inch

MMHeight

MMWidth

Modified

Palette

Width


TMetafile::CreatedBy

TMetafile	Properties

CreatedBy returns the optional name of the author or application used to create the metafile, embedded in the metafile.

Syntax

__property System::AnsiString CreatedBy;

Description

Use CreatedBy to . . .

CreatedBy is read-only, however . . .


TMetafile::Description

TMetafile	Properties

Description returns the optional text “description” embedded in the metafile.

Syntax

__property System::AnsiString Description;

Description

USe Description to

Description is read-only, however . . .


TMetafile::Empty

TMetafile	Properties

Empty specifies whether the metafile object contains a metafile.

Syntax

Description

Use Empty to


TMetafile::Enhanced

TMetafile	Properties

Enhanced determines how the metafile will be stored on disk.

Syntax

__property System::Boolean Enhanced;

Description

Use Enhanced to

If Enhanced is true (default) “it” stores the metafile as an EMF (Win32 Enhanced Metafile); If Enhanced is false, it stores the metafile as a WMF (Windows 3.1 Metafile, with Aldus header). The in-memory format is always EMF.  WMF has very limited capabilities; storing as WMF will lose information that would be retained by EMF. This property is set to match the metafile type when loaded from a stream or file.  This maintains form file compatibility with 16 bit Borland C++ Builder. If loaded as WMF, then save as WMF.

If Enhanced is true, the metafile is stored as an .EMF (Win32 Enhanced Metafile). If Enhanced is false, the metafile is stored as a .WMF (Windows 3.1 Metafile, with Aldus header).


TMetafile::Handle

TMetafile	Properties

Handle provides access to the Windows GDI metafile handle, for accessing the GDI metafile object.

Syntax

__property System::Integer Handle;

Description


TMetafile::Height

TMetafile	Properties

Height specifies the vertical size of the metafile in pixels.

Syntax

Description


TMetafile::Inch

TMetafile	Properties

Inch returns the number of pixels per inch that are used for the metafile's coordinate mapping. HUH

Syntax

__property System::Word Inch;

Description

Use Inch to


TMetafile::MMHeight

TMetafile	Properties	See also

MMHeight contains the heigth of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles.

Syntax

__property System::Integer MMHeight;

Description

Use MMHeight to

The MMHeight property is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters, set or read the dimensions in millimeters with MMHeight.

The MMWidth and MMHeight properties are the width and height, respectively, of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles. The Inch property is the units per inch assumed by a WMF metafile. Used to alter scale when writing as WMF, but otherwise this property is obsolete. Enhanced metafiles maintain complete scale information internally.


TMetafile::MMWidth

TMetafile	Properties	See also

MMWidth contains the width of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles.

Syntax

__property System::Integer MMWidth;

Description

Use MMWidth to

The MMWidth property is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters by set or read the dimensions in millimeters with MMWidth.

The MMWidth and MMHeight properties are the width and height, respectively, of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles. The Inch property is the units per inch assumed by a WMF metafile. Used to alter scale when writing as WMF, but otherwise this property is obsolete. Enhanced metafiles maintain complete scale information internally.


TMetafile::Palette

TMetafile	Properties

Palette controls a metafile's color mapping.

Syntax

__property System::Integer Palette;

Description

Use Palette to . . . simliar to the bitmap property . . .

The Palette of a metafile contains up to 256 colors that can be used to display the metafile on screen.


TMetafile::Width

TMetafile	Properties

Width specifies the horizontal size of the metafile in pixels.

Syntax

Description


TMetafile events

TMetafile	Alphabetically

Derived from TGraphic

OnChange


TMetafile events

TMetafile	By object

OnChange


TMetafile methods

TMetafile	Alphabetically

In TMetafile

~TMetafile

Assign

Clear

LoadFromClipboardFormat

LoadFromStream

SaveToClipboardFormat

SaveToFile

SaveToStream

TMetafile

Derived from TGraphic

LoadFromFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMetafile methods

TMetafile	By object

~TMetafile

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SaveToClipboardFormat

SaveToFile

SaveToStream

TMetafile


TMetafile::Assign

TMetafile	Methods

[GENERIC - modified for TMetafile - the last paragraph]

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assigns an object to the metafile.

Description

The Assign method assigns one object to another. The general form of a call to Assign is

which tells the Destination object to assign the contents of the Source object to itself.

In general, the statement "Destination = Source" is not the same as the statement "Destination.Assign(Source)". The statement "Destination = Source" makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object references by Source into the object referenced by Destination.

If Destination is a property of some object, however, and that property is not a reference to another object (such as the ActiveControl property of a form, or the DataSource property of a data-aware control), then the statement "Destination = Source" is the same as "Destination.Assign(Source)". Consider these statements:

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at run time only if the objects involved "know" how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at run time.


TMetafile::Clear

TMetafile	Methods	See also

Clear deletes the old metafile image.

Syntax

void __fastcall Clear(void);

Description

Use Clear to

Clear releases the old metafile image, creates a new image, and increments a reference count on it.


TMetafile::LoadFromClipboardFormat

TMetafile	Methods

LoadFromClipboardFormat loads a metafile from the Clipboard.

Syntax

virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer

Description

Use LoadFromClipboardFormat to


TMetafile::LoadFromStream

TMetafile	Methods

LoadFromStream loads the metafile from a stream.

Syntax

virtual void __fastcall LoadFromStream(Classes::TStream *Stream);

Description

Use LoadFromStream to


TMetafile::SaveToClipboardFormat

TMetafile	Methods	See also

SaveToClipboardFormat saves a metafile to a Clipboard format.

Syntax

virtual void __fastcall SaveToClipboardFormat(System::Word &AFormat, System::Integer &AData, System::Integer

Description

Use LoadFromStream to

To save a metafile to a file, call SaveToFile.


TMetafile::SaveToFile

TMetafile	Methods	See also

SaveToFile saves the metafile to a file.

Syntax

virtual void __fastcall SaveToFile(const System::AnsiString Filename);

Description

Use SaveToFile to

To load a metafile from a file, call the LoadFromFile method.


TMetafile::SaveToStream

TMetafile	Methods

SaveToStream saves the metafile to a stream.

Syntax

virtual void __fastcall SaveToStream(Classes::TStream *Stream);

Description

Use SaveToStream to


TMetafile::TMetafile

TMetafile	Methods	See also

TMetafile creates a new TMetafile object.

Syntax

__fastcall virtual TMetafile(void);

Description

Use TMetafile to create a new TMetafile object.


TMetafile::~TMetafile

TMetafile	Methods	See also

~TMetafile frees the memory associated with the TMetafile object.

Syntax

__fastcall virtual ~TMetafile(void);

Description

Do not call ~TMetafile directly. Instead, use the delete keyword on the object, which causes ~TMetafile to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TMetafile example

TMetafile


TMetaFileCanvas

Hierarchy	Properties	Methods	Events	See also

The TMetafileCanvas object allows applications to create metafile images from scratch.

Header

vcl/graphics.hpp

Description

Use TMetafileCanvas as a surface on which to draw a metafile image. When the canvas is destroyed, it transfers the image into the metafile object provided to the canvas constructor. After the image is drawn on the canvas and the canvas is destroyed, the image is 'playable' in the metafile object. For example:

To add to an existing metafile image, create a metafile canvas and play the source metafile into the metafile canvas. For example:


TMetaFileCanvas properties

TMetaFileCanvas	Alphabetically	Legend

Derived from TCanvas

Brush

ClipRect

CopyMode

Font

Handle

Pen

PenPos

Pixels


TMetaFileCanvas properties

TMetaFileCanvas	By object	Legend

Brush

ClipRect

CopyMode

Font

Handle

PenPos

Pen

Pixels


TMetaFileCanvas events

TMetaFileCanvas	Alphabetically

Derived from TCanvas

OnChange

OnChanging


TMetaFileCanvas events

TMetaFileCanvas	By object

OnChange

OnChanging


TMetaFileCanvas methods

TMetaFileCanvas	Alphabetically

In TMetaFileCanvas

~TMetaFileCanvas

TMetaFileCanvas

Derived from TMetafileCanvas

CreateWithComment

Arc

Derived from TCanvas

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

MoveTo

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextHeight

TextOut

TextRect

TextWidth

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMetaFileCanvas methods

TMetaFileCanvas	By object

~TMetaFileCanvas

Arc

Assign

BrushCopy

Chord

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyRect

CreateWithComment

DefaultHandler

Dispatch

DrawFocusRect

Draw

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LineTo

MethodAddress

MethodName

MoveTo

NewInstance

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextHeight

TextOut

TextRect

TextWidth

TMetaFileCanvas


 CreateWithComment

CreateWithComment creates an instance of TMetafileCanvas and acquires a handle to a metafile device context with a comment string.

Description

Call CreateWithComment to create an instantiate a TMetafileCanvas object for a metafile that will recieve the CreatedBy and Description strings. CreateWithComment sets the size of the TMetafile object from the reference HDC if it does not already the MMHeight and MMWidth properties set. Create then creates a metafile device context using the CreatedBy and Description strings as a description, and sets the Handle property to its handle. All subsequent drawing methods will draw to the metafile device context.

When the TMetaFileCanvas is destroyed, The CreatedBy and Description strings will be used to set the properties of the same name in the TMetafile object.


TMetaFileCanvas::TMetaFileCanvas

TMetaFileCanvas	Methods	See also

TMetaFileCanvas creates a new TMetaFileCanvas object.

Syntax

__fastcall TMetafileCanvas(TMetafile *AMetafile, System::Integer ReferenceDevice);

Description

Use TMetaFileCanvas to create a new TMetaFileCanvas object.


TMetaFileCanvas::~TMetaFileCanvas

TMetaFileCanvas	Methods	See also

~TMetaFileCanvas frees the memory associated with the TMetaFileCanvas object.

Syntax

__fastcall virtual ~TMetafileCanvas(void);

Description

Do not call ~TMetaFileCanvas directly. Instead, use the delete keyword on the object, which causes ~TMetaFileCanvas to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCanvas


TMetaFileCanvas example

TMetaFileCanvas


TMetafileImage

Hierarchy	Methods

Header

vcl/graphics.hpp

Description


TMetafileImage methods

TMetafileImage	Alphabetically

In TMetafileImage

~TMetafileImage

TMetafileImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMetafileImage methods

TMetafileImage	By object

~TMetafileImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TMetafileImage


TMetafileImage::TMetafileImage

TMetafileImage	Methods	See also

TMetafileImage creates a new TMetafileImage object.

Syntax

__fastcall TMetafileImage(void);

Description

Use TMetafileImage to create a new TMetafileImage object.


TMetafileImage::~TMetafileImage

TMetafileImage	Methods	See also

~TMetafileImage frees the memory associated with the TMetafileImage object.

Syntax

__fastcall virtual ~TMetafileImage(void);

Description

Do not call ~TMetafileImage directly. Instead, use the delete keyword on the object, which causes ~TMetafileImage to be invoked automatically.


Hierarchy

TObject


TMetafileImage example

TMetafileImage


TNavButton

Hierarchy	Properties	Methods	Events

Header

vcl/dbctrls.hpp

Description


TNavButton properties

TNavButton	Alphabetically	Legend

In TNavButton

Index

NavStyle

Derived from TSpeedButton

AllowAllUp

Down

Glyph

GroupIndex

Layout

Margin

NumGlyphs

Spacing

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TNavButton properties

TNavButton	By object	Legend

Align

AllowAllUp

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Down

Enabled

Font

Glyph

GroupIndex

Height

Hint

Index

Layout

Left

Margin

Name

NavStyle

NumGlyphs

Owner

ParentFont

ParentShowHint

Parent

ShowHint

Spacing

Tag

Top

Visible

Width


TNavButton::Index

TNavButton	Properties

Syntax

__property TNavigateBtn Index;

Description


TNavButton::NavStyle

TNavButton	Properties

Syntax

__property TNavButtonStyle NavStyle;

Description


TNavButton events

TNavButton	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


TNavButton events

TNavButton	By object	Legend

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


TNavButton methods

TNavButton	Alphabetically

In TNavButton

~TNavButton

TNavButton

Derived from TSpeedButton

Click

BeginDrag

Derived from TControl

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNavButton methods

TNavButton	By object

~TNavButton

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TNavButton

Update


TNavButton::TNavButton

TNavButton	Methods	See also

TNavButton creates a new TNavButton object.

Syntax

__fastcall virtual TNavButton(Classes::TComponent *AOwner);

Description

Use TNavButton to create a new TNavButton object.


TNavButton::~TNavButton

TNavButton	Methods	See also

~TNavButton frees the memory associated with the TNavButton object.

Syntax

__fastcall virtual ~TNavButton(void);

Description

Do not call ~TNavButton directly. Instead, use the delete keyword on the object, which causes ~TNavButton to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TSpeedButton


TNavButton example

TNavButton


TNavDataLink

Hierarchy	Properties	Methods	See also

TNavDataLink is a helper object that helps manage data events for a TDBNavigator object.

Header

vcl/dbctrls.hpp

Description

TNavDataLink is tailored to work with a TDBNavigator. It should only be used by the TDBNavigator class.


TNavDataLink properties

TNavDataLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TNavDataLink properties

TNavDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TNavDataLink methods

TNavDataLink	Alphabetically	Legend

In TNavDataLink

~TNavDataLink

ActiveChanged

DataSetChanged

EditingChanged

TNavDataLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNavDataLink methods

TNavDataLink	By object	Legend

~TNavDataLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TNavDataLink

UpdateRecord


TNavDataLink::ActiveChanged

TNavDataLink	Methods	See also

ActiveChanged informs the TDBNavigator of changes in the Active property.

Syntax

virtual void __fastcall ActiveChanged(void);

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the ActiveChanged method of the TDBNavigator object that owns this TNavDataLink.


TNavDataLink::DataSetChanged

TNavDataLink	Methods	See also

DataSetChanged informs the TDBNavigator of changes to the dataset.

Syntax

virtual void __fastcall DataSetChanged(void);

Description

Applications do not need to call the DataSetChanged procedure. It is called automatically following changes to the contents of the dataset. TNavDataLink informs the TDBNavigator of these changes by calling its DataChanged method.


TNavDataLink::EditingChanged

TNavDataLink	Methods	See also

EditingChanged informs the TDBNavigator of changes to the editing state of the DataSource.

Syntax

virtual void __fastcall EditingChanged(void);

Description

Applications should not call the EditingChanged procedure directly. Changes to the editing state of the DataSource trigger this procedure, which in turn calls the EditingChanged method of the TDBNavigator object that owns this TNavDataLink.


TNavDataLink::TNavDataLink

TNavDataLink	Methods	See also

TNavDataLink creates a new TNavDataLink object.

Syntax

__fastcall TNavDataLink(TDBNavigator *ANav);

Description

Use TNavDataLink to create a new TNavDataLink object.


TNavDataLink::~TNavDataLink

TNavDataLink	Methods	See also

~TNavDataLink frees the memory associated with the TNavDataLink object.

Syntax

__fastcall virtual ~TNavDataLink(void);

Description

Do not call ~TNavDataLink directly. Instead, use the delete keyword on the object, which causes ~TNavDataLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TNavDataLink example

TNavDataLink


TNotebook

Hierarchy	Properties	Methods	Events

The TNotebook component is a component that can display multiple pages, each with its own set of controls. Notebook components are frequently used with tab set controls (TTabSet) to let the user select pages in the notebook by clicking a tab. TNotebook is provided for backward compatibility.

Header

vcl/extctrls.hpp

The TTabbedNoteBook control is included primarily for backwards compatibility with Borland C++ Builder 1.0 applications. It is recommended that new Borland C++ Builder 2.0 applications use the TPageControl instead.

The pages available in the notebook control are the strings specified as the value of the Pages property. You can access a particular page in the notebook either with the PageIndex property or the ActivePage property.

If you are using a notebook with a tab set, this is the RefSyn that connects the pages of the notebook with the tabs in the tab set, displaying the page strings as the text of the tabs:

TabSet1.Tabs = Notebook1.Pages;

Then, in the OnClick event handler of the tabset, this line of RefSyn changes the current page in the notebook control when the user clicks a tab:

Notebook1.PageIndex = TabSet1.TabIndex;

If you are using a notebook and a tab set together, you usually want the tab set at the bottom of the form and the notebook to take up the remaining space on the form. To align the components this way, use their Align properties.

The TNotebook component is an indirect descendent of TWinControl. In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.

Note

The TTabbedNotebook cannot be used in form inheritance. If a TTabbedNotebook is included in a form, that form cannot be used as the base class for other forms. It is recommended that you use a TPageControl instead, which does support form inheritance.


TNotebook properties

TNotebook	Alphabetically	Legend

In TNotebook

ActivePage

PageIndex

Pages

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TNotebook properties

TNotebook	By object	Legend

ActivePage

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

PageIndex

Pages

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TNotebook::ActivePage

TNotebook	Properties

Syntax

__property System::AnsiString ActivePage;

The ActivePage property determines which page displays in the notebook or tabbed notebook control. The value of ActivePage must be one of the strings contained in the Pages property.


TNotebook::PageIndex

TNotebook	Properties

Determines which page displays in the notebook control.

Syntax

__property System::Integer PageIndex;

The value of the PageIndex property determines which page displays in the notebook or tabbed notebook component. Changing the PageIndex value changes the page in the control.

Each string in the Pages property is automatically assigned a PageIndex value when the page is created. The first page receives a value of 0, the second has a value of 1, and so on. If you delete a string from the Pages property, the PageIndex values are reassigned so that the values always begin with 0 and continue to increase without any gaps between values.


TNotebook::Pages

TNotebook	Properties

Contains the strings that identify the individual pages of the notebook control.

Syntax

__property Classes::TStrings * Pages;

The Pages property contains the strings that identify the individual pages of the notebook control. Both these controls create a separate page for each string in the Pages property. For example, if Pages contains three strings, First, Second, and Third, the control has three separate pages.

You can access the various pages in a notebook or tabbed notebook control with either the ActivePage or PageIndex property.


TNotebook events

TNotebook	Alphabetically	Legend

In TNotebook

OnPageChanged

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TNotebook events

TNotebook	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnPageChanged

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


TNotebook::OnPageChanged

TNotebook	Events

Syntax

__property Classes::TNotifyEvent OnPageChanged;


OnStartDrag


TNotebook methods

TNotebook	Alphabetically

In TNotebook

~TNotebook

TNotebook

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNotebook methods

TNotebook	By object

~TNotebook

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TNotebook

UpdateControlState

Update


TNotebook::TNotebook

TNotebook	Methods	See also

TNotebook creates a new TNotebook object.

Syntax

__fastcall virtual TNotebook(Classes::TComponent *AOwner);

Description

Use TNotebook to create a new TNotebook object.


TNotebook::~TNotebook

TNotebook	Methods	See also

~TNotebook frees the memory associated with the TNotebook object.

Syntax

__fastcall virtual ~TNotebook(void);

Description

Do not call ~TNotebook directly. Instead, use the delete keyword on the object, which causes ~TNotebook to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TNotebook example

TNotebook


TNumericField

Hierarchy	Properties	Methods	Events	See also

TNumericField component is the common ancestor of all the numeric fields in a dataset.

Header

vcl/dbtables.hpp

Description

TNumericField is an abstract base class that encapsulates the fundamental behavior common to all numeric field components. In addition to the properties, events, and methods common to all field components introduced by TField, TNumericField introduces new properties for formatting numeric data for display or editing purposes.


TNumericField properties

TNumericField	Alphabetically	Legend

In TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TNumericField properties

TNumericField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TNumericField::DisplayFormat

TNumericField	Properties	See also

DisplayFormat determines how a numeric field’s value is formatted for display in a data-aware control.

Syntax

__property System::AnsiString DisplayFormat;

Description

 Use the DisplayFormat property to override automatic formatting of a field for display purposes.

The value of DisplayFormat is a string that encodes the formatting of numeric data using the specifiers in the following table:

Specifier	Represents

  0	Digit placeholder. If the value being formatted has a digit in the position where the "0" appears in the format string, then that digit is copied to the output string. Otherwise, a "0" is stored in that position in the output string.

  #	Digit placeholder. If the value being formatted has a digit in the position where the "#" appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

  .	Decimal point. The first "." character in the format string determines the location of the decimal separator in the formatted value; any additional "." characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

  ,	Thousand separator. If the format string contains one or more "," characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of "," characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

  E+	Scientific notation. If any of the strings "E+", "E-", "e+", or "e-" are contained in the format string, the number is formatted using scientific notation. A group of up to four "0" characters can immediately follow the "E+", "E-", "e+", or "e-" to determine the minimum number of digits in the exponent. The "E+" and "e+" formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The "E-" and "e-" formats output a sign character only for negative exponents.

  'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

  ;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost "0" before the decimal point in the format string and the rightmost "0" after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the "." character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

•	One section: The format string applies to all values.

•	Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

•	Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is,  if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

Note

DisplayFormat affects only the display of the field’s data.  It does not affect the  validity of strings assigned to a numeric field using the AsString property.


TNumericField::EditFormat

TNumericField	Properties	See also

EditFormat determines how a numeric field’s value is formatted when it is being edited in a data-aware control.

Syntax

__property System::AnsiString EditFormat;

Description

Use the EditFormat property to override the formatting of a field when the field’s value is being edited in a data-aware control.

When EditFormat is unassigned, but the DisplayFormat property has a value, the DisplayFormat string is used.

The value of EditFormat is a string that encodes the formatting of numeric data using the specifiers in the following table:

Specifier	Represents

  0	Digit placeholder. If the value being formatted has a digit in the position where the "0" appears in the format string, then that digit is copied to the output string. Otherwise, a "0" is stored in that position in the output string.

  #	Digit placeholder. If the value being formatted has a digit in the position where the "#" appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

  .	Decimal point. The first "." character in the format string determines the location of the decimal separator in the formatted value; any additional "." characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

  ,	Thousand separator. If the format string contains one or more "," characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of "," characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

  E+	Scientific notation. If any of the strings "E+", "E-", "e+", or "e-" are contained in the format string, the number is formatted using scientific notation. A group of up to four "0" characters can immediately follow the "E+", "E-", "e+", or "e-" to determine the minimum number of digits in the exponent. The "E+" and "e+" formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The "E-" and "e-" formats output a sign character only for negative exponents.

  'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

  ;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost "0" before the decimal point in the format string and the rightmost "0" after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the "." character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

•	One section: The format string applies to all values.

•	Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

•	Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

Note

EditFormat affects only the display of the field’s data when it is being edited.  It does not affect the  validity of strings assigned to a numeric field using the AsString property, nor does it affect the display of the field’s data when it is not being edited.


TNumericField events

TNumericField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TNumericField events

TNumericField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TNumericField methods

TNumericField	Alphabetically

In TNumericField

~TNumericField

TNumericField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNumericField methods

TNumericField	By object

~TNumericField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TNumericField


TNumericField::TNumericField

TNumericField	Methods	See also

TNumericField creates a new TNumericField object.

Syntax

__fastcall virtual TNumericField(Classes::TComponent *AOwner);

Description

Use TNumericField to create a new TNumericField object.


TNumericField::~TNumericField

TNumericField	Methods	See also

~TNumericField frees the memory associated with the TNumericField object.

Syntax

__fastcall virtual ~TNumericField(void);

Description

Do not call ~TNumericField directly. Instead, use the delete keyword on the object, which causes ~TNumericField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TNumericField example

TNumericField


TObject

Methods	See also

TObject is the ultimate ancestor for all other objects and components in Borland C++ Builder.

Header

vcl/sysdefs.h

Description

TObject encapsulates the fundamental behavior common to all objects in Borland C++ Builder by introducing interfaces for methods that provide:

•	The ability to create, maintain and destroy an instance of the object by allocating, initializing and freeing the memory needed for that object.

•	Class type and instance information on an object, and run-time type information (RTTI) about its published properties.

•	Support for message-handling.

Use TObject as an immediate base class when declaring simple objects that are not components, and that do not need streaming or assignment capabilities. If no ancestor type is specified when declaring a new object type, Borland C++ Builder automatically uses TObject as the ancestor.

Much of the powerful capability of Borland C++ Builder objects is established by the methods that TObject introduces. Many of these methods are used internally by the Borland C++ Builder environment and are not intended for users to call directly. Several others are generally either overridden in descendent objects and components that have more complex behavior.

Note

While TObject is not technically an abstract class, objects of this type are not normally instantiated.


TObject methods

TObject	Alphabetically

In TObject

~TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TObject


TObject methods

TObject	By object

~TObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TObject


TObject::ClassInfo

TObject	Methods	See also

ClassInfo returns a pointer to the run-time type information (RTTI) table for the object type.

Syntax

static void * __fastcall ClassInfo(TClass cls);

Description

Use ClassInfo to access the RTTI table that contains information about the object type, its ancestor type, and all of its published properties.

RTTI is used extensively for internal use in the Borland C++ Builder environment. ClassInfo is rarely called directly in an application. TObject provides other methods specifically intended to provide easier access to RTTI information. For more detailed information about the RTTI table in the TypInfo unit.


TObject::ClassName

TObject	Methods	See also

ClassName returns a string containing the name of the actual type of the object instance that is referenced by a variable, rather than the type of the variable.

Syntax

static ShortString __fastcall ClassName(TClass cls);

Description

Use ClassName to find the actual type of an object in the format of a string, such as when passing a string as a parameter to another routine. For example, a variable of an ancestor type can refer to an instance of any descendent type. In this case, ClassName returns a string indicating the actual type of the object, rather than a string containing the type of the declared variable.

ClassName provides information on objects across modules so it is especially useful for exception-handling.

When reporting exception-handling errors on a particular object ClassName is used by the on statement does a string comparison of classes.


TObject::ClassNameIs

TObject	Methods	See also

ClassNameIs determines whether or not an object is of a specific type.

Syntax

static bool __fastcall ClassNameIs(TClass cls, const AnsiString string);

Description

Use ClassNameIs when writing conditional code based upon an object’s typeor to query objects across modules, or DLLs.

ClassNameIs returns true if the string passed in the Name parameter matches the name of the class. Otherwise, it returns false.


TObject::ClassParent

TObject	Methods	See also

ClassParent returns the type of the immediate ancestor of a class.

Syntax

static TClass __fastcall ClassParent(TClass cls);

Description

ClassParent returns NULL for type TObject because TObject has no parent.

ClassParent is used internally in Borland C++ Builder for RTTI, by the is and as operators, and by the InheritsFrom method. Because it is a class method, it can be used to determine the type of an class reference.

Note

Applications should rarely, if ever, call ClassParent directly.


TObject::ClassType

TObject	Methods	See also

ClassType returns a pointer to the run-time type information of an object instance.

Syntax

TClass __fastcall ClassType();

Description

ClassType dynamically determines the actual type of an object. ClassType is used internally in Borland C++ Builder by the is and as operators. Do not call ClassType directly.


TObject::CleanupInstance

TObject	Methods	See also

CleanupInstance performs finalization on long strings and variants within a class.

Syntax

void __fastcall CleanupInstance();

Description

Do not call CleanupInstance directly. CleanupInstance is called automatically when Free is called.

CleanupInstance releases all long strings and variants. It set long strings to empty and variants to Unassigned.


TObject::DefaultHandler

TObject	Methods	See also

DefaultHandler introduces an interface for processing a message record passed to it.

Syntax

virtual void __fastcall DefaultHandler(void* Message);

Description

DefaultHandler is called by Dispatch when it cannot dinf a message fmethod for a particular message. DefaultHandler provides message handling for all messages for which an object does not have specific handlers. Descendent classes of TObject that process messages usually define DefaultHandler methods according to the type of messages they handle. For example, TWinControl overrides DefaultHandler to call DefWindowProc.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method only if that ancestor does not specify a message method for the particular message being handled. Otherwise calling inherited results in a call to the specific handler for that type of message.


TObject::Dispatch

TObject	Methods	See also

Dispatch calls message-handling methods for the object, based on the contents of the Message parameter.

Syntax

virtual void __fastcall Dispatch(void *Message);

Description

Call Dispatch to automatically pass messages to the current event handler for an object.

Dispatch determines whether a message is in the list of message handlers declared for the object. If the object does not handle the message, Dispatch then examines the message-handler list of the ancestor type, and continues checking ancestors until it either finds a specific handler or runs out of ancestors, in which case it calls DefaultHandler.

The Message parameter is untyped for Dispatches. Although any kind of data can be passed to Dispatch, use a message record such as TMessage or a specific message-record type. The only assumption Dispatch makes about the data in Message is that the first two bytes contain a message ID, that is an integer-that determines which message handler Dispatch calls to handle the message.


TObject::FieldAddress

TObject	Methods

FieldAddress returns the address of a published object field.

Syntax

void * __fastcall FieldAddress(const ShortString &Name);

Description

FieldAddress is used internally by the Borland C++ Builder streaming system to access a published specified field of an object. FieldAddress returns a pointer to the field if it exists. If the object has no published field by that name, FieldAddress returns NULL.

Users should access and manipulate fields by using properties instead of FieldAddress.


TObject::Free

TObject	Methods	See also

Free destroys an object and frees its associated memory, if necessary.

Syntax

__fastcall Free();

Description

Use Free to destroy an object. Free automatically calls the Destroy if the object instance is is not NULL. Any object instantiated by a call to Create should be destroyed by a call to Free, so that the object an be properly destroyed and the memory released. Free is successful even if the object is NULL, so if the object was never initialized, for example, calling Free won’t result in an error.


TObject::FreeInstance

TObject	Methods	See also

FreeInstance deallocates memory allocated by a previous call to the NewInstance method.

Syntax

virtual void __fastcall FreeInstance();

Description

All destructors call FreeInstance automatically to deallocate memory that was allocated by overriding NewInstance.

Do not call FreeInstance directly, however, FreeInstance should be overriden if NewInstance was overriden to change the way the object’s instance data was allocated.

Like NewInstance, FreeInstance uses the value returned from InstanceSize to deallocate the object's memory.


TObject::InheritsFrom

TObject	Methods	See also

InheritsFrom is a class method, it is used to determine the relationship of two object types.

Syntax

static bool __fastcall InheritsFrom(TClass cls, TClass aClass);

Description

Use InheritsFrom to determine if a particular class type is an ancestor of an object. InheritsFrom returns true if the object type specified in the AClass parameter is an ancestor of the object type or the type of the object itself. Otherwise, it returns false.

Note

The is and as operators use InheritsFrom in their implementations. The is operator, however, can only determine the inheritance relationship of an instance. As a class method InheritsFrom can determine the relationship of class references.


TObject::InitInstance

TObject	Methods	See also

InitInstance initializes a newly-allocated object instance to all zeros and initializes the instance’s virtual method table pointer.

Syntax

static TObject * __fastcall InitInstance(TClass cls, void *instance);

Description

Never call InitInstance directly. InitInstance is called automatically by NewInstance when an object is created. When overriding NewInstance be sure to call InitInstance as the last statement.

InitInstance is not virtual, so you cannot override it. Initialize any data for an object in the constructor. Override NewInstance only for special memory allocation requirements, such as allocating all instances of a class type from a common memory pool.


TObject::InstanceSize

TObject	Methods	See also

InstanceSize returns the size in bytes of each instance of the object type.

Syntax

static long __fastcall InstanceSize(TClass cls);

Description

Use InstanceSize to determine how many bytes of memory are required for a class’s instance data. Borland C++ Builder uses InstanceSize internally for methods that allocate and deallocate memory. InstanceSize is not a virtual method, so it cannot be overridden. Methods that use InstanceSize can be overriden.


TObject::MethodAddress

TObject	Methods	See also

Returns the address of a published method.

Syntax

static void * __fastcall MethodAddress(TClass cls, const ShortString &Name);

Description

MethodAddress is used internally in Borland C++ Builder by the streaming system. MethodAddress is used to convert a method name, specified by Name, to a pointer containing the method address when reading in from a stream. Do not call MethodAddress directly.

If Name does not specify a published method for the object, MethodAddress returns NULL.


TObject::MethodName

TObject	Methods	See also

MethodName returns a string containing the name of the method located at Address.

Syntax

static ShortString __fastcall MethodName(TClass cls, void *Address);

Description

MethodName is used internally in Borland C++ Builder by the streaming system. MethodName is used to convert a pointer containing the method address to a string containing the method name when writing event properties to a stream. It is essentially the counterpart to MethodAddress. Do not call it directly.

If Address does not point to a published method of the object, MethodName returns an empty string.


TObject::NewInstance

TObject	Methods	See also

NewInstance allocates memory for each instance of an object type and returns a pointer to that new instance.

Syntax

virtual TObject* __fastcall NewInstance(TClass cls);

Description

All constructors call NewInstance automatically. NewInstance calls InstanceSize to determine how much memory to allocate from the heap to contain a particular instance. Do not call NewInstance directly.

Overriding NewInstance to change the memory allocation for an object type, might necessitate overriding FreeInstance to deallocate that same memory. For example, when allocating a large number of identical objects that all need to be in memory at the same time, one could allocate a large block of memory for the entire group, then override NewInstance to use part of that larger block for each instance. When overriding NewInstance call InitInstance, and not inherited, as the last statement.

A descendent class can override NewInstance to change the way that particular class allocates its memory.

Note

By default NewInstance calls InitInstance.


TObject::TObject

TObject	Methods	See also

TObject creates a new TObject object.

Syntax

__fastcall TObject();

Description

Use TObject to create a new TObject object.


TObject::~TObject

TObject	Methods	See also

~TObject frees the memory associated with the TObject object.

Syntax

virtual __fastcall ~TObject();

Description

Do not call ~TObject directly. Instead, use the delete keyword on the object, which causes ~TObject to be invoked automatically.


Hierarchy


TObject example

TObject


TOleClientSite

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TOleClientSite methods

TOleClientSite	Alphabetically

In TOleClientSite

~TOleClientSite

AddRef

GetContainer

GetMoniker

OnShowWindow

QueryInterface

Release

RequestNewObjectLayout

SaveObject

ShowObject

TOleClientSite

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleClientSite methods

TOleClientSite	By object

~TOleClientSite

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetContainer

GetMoniker

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OnShowWindow

QueryInterface

Release

RequestNewObjectLayout

SaveObject

ShowObject

TOleClientSite


TOleClientSite::AddRef

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TOleClientSite::GetContainer

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall GetContainer(Ole2::IOleContainer *&container);

Description


TOleClientSite::GetMoniker

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall GetMoniker(System::Longint dwAssign, System::Longint dwWhichMoniker

Description


TOleClientSite::OnShowWindow

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall OnShowWindow(System::LongBool fShow);

Description


TOleClientSite::QueryInterface

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TOleClientSite::Release

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TOleClientSite::RequestNewObjectLayout

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall RequestNewObjectLayout(void);

Description


TOleClientSite::SaveObject

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall SaveObject(void);

Description


TOleClientSite::ShowObject

TOleClientSite	Methods

Syntax

virtual System::Longint __stdcall ShowObject(void);

Description


TOleClientSite::TOleClientSite

TOleClientSite	Methods	See also

TOleClientSite creates a new TOleClientSite object.

Syntax

__fastcall TOleClientSite(TOleControl *Control);

Description

Use TOleClientSite to create a new TOleClientSite object.


TOleClientSite::~TOleClientSite

TOleClientSite	Methods	See also

~TOleClientSite frees the memory associated with the TOleClientSite object.

Syntax

__fastcall virtual ~TOleClientSite(void);

Description

Do not call ~TOleClientSite directly. Instead, use the delete keyword on the object, which causes ~TOleClientSite to be invoked automatically.


Hierarchy

TObject

IUnknown

IOleClientSite


TOleClientSite example

TOleClientSite


TOleControlSite

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TOleControlSite methods

TOleControlSite	Alphabetically

In TOleControlSite

~TOleControlSite

AddRef

GetExtendedControl

LockInPlaceActive

OnControlInfoChanged

OnFocus

QueryInterface

Release

ShowPropertyFrame

TOleControlSite

TransformCoords

TranslateAccelerator

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleControlSite methods

TOleControlSite	By object

~TOleControlSite

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetExtendedControl

InheritsFrom

InitInstance

InstanceSize

LockInPlaceActive

MethodAddress

MethodName

NewInstance

OnControlInfoChanged

OnFocus

QueryInterface

Release

ShowPropertyFrame

TOleControlSite

TransformCoords

TranslateAccelerator


TOleControlSite::AddRef

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TOleControlSite::GetExtendedControl

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall GetExtendedControl(Ole2::IDispatch *&disp);

Description


TOleControlSite::LockInPlaceActive

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall LockInPlaceActive(System::LongBool fLock);

Description


TOleControlSite::OnControlInfoChanged

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall OnControlInfoChanged(void);

Description


TOleControlSite::OnFocus

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall OnFocus(System::LongBool fGotFocus);

Description


TOleControlSite::QueryInterface

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TOleControlSite::Release

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TOleControlSite::ShowPropertyFrame

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall ShowPropertyFrame(void);

Description


TOleControlSite::TransformCoords

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall TransformCoords(Windows::TPoint &ptlHimetric, Olectl::TPointF &ptfContainer

Description


TOleControlSite::TranslateAccelerator

TOleControlSite	Methods

Syntax

virtual System::Longint __stdcall TranslateAccelerator(Windows::PMsg msg, System::Longint grfModifiers

Description


TOleControlSite::TOleControlSite

TOleControlSite	Methods	See also

TOleControlSite creates a new TOleControlSite object.

Syntax

__fastcall TOleControlSite(TOleControl *Control);

Description

Use TOleControlSite to create a new TOleControlSite object.


TOleControlSite::~TOleControlSite

TOleControlSite	Methods	See also

~TOleControlSite frees the memory associated with the TOleControlSite object.

Syntax

__fastcall virtual ~TOleControlSite(void);

Description

Do not call ~TOleControlSite directly. Instead, use the delete keyword on the object, which causes ~TOleControlSite to be invoked automatically.


Hierarchy

TObject

IUnknown

IOleControlSite


TOleControlSite example

TOleControlSite


TOleContainer

Hierarchy	Properties	Methods	Events

The TOleContainer component lets you embed or link OLE objects in your Borland C++ Builder 2.0 application. TOleContainer handles many of the complexities of OLE 2.0 for you. Letting the user choose an OLE object to insert is as simple as calling the InsertObjectDialog method. Call the CreateObject or CreateObjectFromFile methods to create an embedded OLE object; use the CreateLinkToFile method to create a linked OLE object.

Header

vcl/olectnrs.hpp

TOleContainer automatically handles menu merging -- the process of combining the container form's menu with that of an in-place activated OLE object's server application. The menu items' GroupIndex property settings control how menus are merged. Those main menu items with GroupIndex values of 0, 2, and 4 remain; TOleContainer merges the server application's menus and replaces the main menu items with GroupIndex values of 1, 3, and 5 (if they exist). So, for example, if you had an MDI form with a traditional main menu, you'd set the menus' GroupIndex properties as follows:

Menu	Group Index Setting

File	0

Edit	1

Object	2

Window	4

Help	5

The File, Object, and Window menus would remain but the Edit and Help menus would be replaced by those of the server application.

Note that there's no menu with a GroupIndex of 3; that's not a problem.

OLE objects that are activated in-place add their servers' toolbars directly into your application's window. Normally, any panels you use for toolbars are replaced by the OLE object's server's toolbars. You can prevent this by setting a panel's

Locked property to true. When Locked is true, TOleContainer won't remove the panel to make room for the server's toolbars.

Note that your application's toolbars must be in panels that aligned to a side of your form (that is, their Align property set to alTop, alBottom, alLeft, or alRight).

If you're using a TOleContainer in an SDI application (your main form's FormStyle property is fsNormal rather than fsMDIForm), you should place the TOleContainer component inside a panel whose Align property is set to alClient. TOleContainer replaces an SDI form's toolbars as described above, and using a panel automatically adjusts the amount of space available to the OLE container.


TOleContainer properties

TOleContainer	Alphabetically	Legend

In TOleContainer

AllowInPlace

AutoActivate

AutoVerbMenu

BorderStyle

CanPaste

CopyOnSave

Iconic

Linked

Modified

NewInserted

ObjectVerbs

OldStreamFormat

OleClassName

OleObject

OleObjectInterface

PrimaryVerb

SizeMode

SourceDoc

State

StorageInterface

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TOleContainer properties

TOleContainer	By object	Legend

Align

AllowInPlace

AutoActivate

AutoVerbMenu

BorderStyle

BoundsRect

Brush

CanPaste

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

CopyOnSave

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Handle

Height

HelpContext

Hint

Iconic

Left

Linked

Modified

Name

NewInserted

ObjectVerbs

OldStreamFormat

OleClassName

OleObjectInterface

OleObject

Owner

ParentColor

ParentCtl3D

ParentShowHint

Parent

PopupMenu

PrimaryVerb

ShowHint

Showing

SizeMode

SourceDoc

State

StorageInterface

TabOrder

TabStop

Tag

Top

Visible

Width


TOleContainer::AllowInPlace

TOleContainer	Properties

Syntax

__property System::Boolean AllowInPlace;

Determines whether an OLE object can be activated inplace. If AllowInPlace is true and Iconic is false, the OLE object will be activated inplace. Otherwise, it will be activated in a separate window. The default value is true.


TOleContainer::AutoActivate

TOleContainer	Properties

Syntax

__property TAutoActivate AutoActivate;

The AutoActivate property determines how an object in an OLE container can be activated, as defined in the following table:

Values	Meaning

aaManual	The user can't activate the object. You can activate the OLE object in RefSyn by calling DoVerb(ovShow).

aaGetFocus	The OLE object is activated whenever the OLE container gets the focus (by clicking on it with the mouse or pressing Tab to move the focus to it).

aaDoubleClick	(Default) The OLE object is activated by doubleclicking it or pressing Enter while the container has the focus.


TOleContainer::AutoVerbMenu

TOleContainer	Properties

Syntax

__property System::Boolean AutoVerbMenu;

Determines whether TOleContainer automatically creates a popup menu containing the OLE object's verbs. If AutoVerbMenu is true (the default), TOleContainer replaces any existing PopupMenu property. If AutoVerbMenu is false, no popup menu is automatically created.


TOleContainer::BorderStyle

TOleContainer	Properties

[NOT DOCT SPECIFICALLY FOR THIS OBJECT IN THE CURRENT DOC SET]

Syntax

__property Forms::TBorderStyle BorderStyle;

The BorderStyle property of edit boxes, list boxes, memo controls, grid controls, outlines, and scroll boxes determines whether these components have a border. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

If you set the AutoSize property of an edit box or hot-key to true, the edit box or hot-key resizes automatically when the font size of the text changes. You must set the value of the BorderStyle property to fsSingle, or else AutoSize has no effect.


TOleContainer::CanPaste

TOleContainer	Properties

Syntax

__property System::Boolean CanPaste;

Indicates whether the data in the Windows clipboard is suitable for pasting as an embedded object.


TOleContainer::CopyOnSave

TOleContainer	Properties

Syntax

__property System::Boolean CopyOnSave;

Determines whether the SaveToFile and SaveToStream methods writes a temporary OLE object storage, compressing redundant data and saving space. Set CopyOnSave to false when the container holds very large embedded objects and there might not be enough memory to make the temporary copy. The default value is true.


TOleContainer::Iconic

TOleContainer	Properties

Syntax

void __fastcall SetDrawAspect(System::Boolean Iconic, System::Integer IconMetaPict);

Determines how the OLE object is displayed. If Iconic is true, it's displayed as an icon; if false, it's displayed as it would be in the server application.


TOleContainer::Linked

TOleContainer	Properties

Syntax

__property System::Boolean Linked;

Indicates whether the OLE object is linked. If true, the OLE object is linked; if false, it's embedded. An OLE object must already be loaded in the container before accessing the Linked property.


TOleContainer::Modified

TOleContainer	Properties

Syntax

__property System::Boolean Modified;

Indicates that the OLE object has been modified (including being deleted or replaced by another OLE object). You can set Modified to false and later check it to see if the OLE object has been modified. If there is no OLE object loaded into the container, Modified returns false.


TOleContainer::NewInserted

TOleContainer	Properties

Syntax

__property System::Boolean NewInserted;

Indicates whether the OLE object was newly created (via a call to InsertObjectDialog), rather than pasted in or created as a link to a file. If there is no OLE object loaded into the container, NewInserted returns false. If NewInserted is true after a call to InsertObjectDialog, you can call DoVerb(ovShow) to let the user edit the object.


TOleContainer::ObjectVerbs

TOleContainer	Properties

Syntax

__property Classes::TStrings * ObjectVerbs;

Returns a string list containing the names of the verbs the OLE object supports. The verb names can have embedded ampersand ('&') characters to indicate shortcut keys. An OLE object must already be loaded in the container before accessing the ObjectVerbs property.


TOleContainer::OldStreamFormat

TOleContainer	Properties

Syntax

__property System::Boolean OldStreamFormat;

Determines the format of files and streams saved and loaded. If OldStreamFormat is false (the default), the Borland C++ Builder 2.0 TOleContainer format is used; if true, the Borland C++ Builder 1.0 TOLEContainer format is used. The Borland C++ Builder 2.0 format is preferred, as it contains extra header information that TOleContainer can use to validate a file or stream. This property is provided for backward compatibility with existing files only.


TOleContainer::OleClassName

TOleContainer	Properties

Syntax

void __fastcall CreateObject(const System::AnsiString OleClassName, System::Boolean Iconic);

Returns the class name of the OLE object. An OLE object must already be loaded in the container before accessing the OleClassName property.


TOleContainer::OleObject

TOleContainer	Properties

[ENTRY SAYS IT’S FOR OLEAUTO OBJECT NOT FOR OLECONTAINER]

Syntax

__property System::Variant OleObject;

For TAutoObject, the OleObject property provides a variant containing the automation object. When your server needs to pass an OLE object to a controller, the controller expects it in the form of a variant. You should therefore always references to an automation object's OleObject property, rather than references to the object itself.

For TOleContainer (runtime and readonly) the OleObject property returns an OLE Automation object for the OLE object. If the OLE object doesn't support OLE Automation, an exception is raised. An OLE object must already be loaded in the container before accessing the OleObject property.


TOleContainer::OleObjectInterface

TOleContainer	Properties

Syntax

__property Ole2::IOleObject * OleObjectInterface;

Returns the IOleObject interface for the OLE object, which is useful for lowlevel access to the OLE API. If there is no OLE object loaded into the container, OleObjectInterface returns NULL.


TOleContainer::PrimaryVerb

TOleContainer	Properties

Syntax

__property System::Integer PrimaryVerb;

Returns the index of the primary (default) verb for the OLE object. You can use the index in a call to the DoVerb method. [DoVerb(ovPrimary) is the same as DoVerb(PrimaryVerb).] You can also use the index with the ObjectVerbs property to display the name of the primary verb. An OLE object must already be loaded in the container before accessing the OleObject property.


TOleContainer::SizeMode

TOleContainer	Properties

Syntax

__property TSizeMode SizeMode;

Determines how the OLE object will be sized within the container. See TSizeMode for possible values.


TOleContainer::SourceDoc

TOleContainer	Properties

Syntax

__property System::AnsiString SourceDoc;

Returns the name of the source document for a linked OLE object. An OLE object must already be loaded in the container before accessing the SourceDoc property. If the OLE object isn't linked, SourceDoc returns an empty string.


TOleContainer::State

TOleContainer	Properties

Syntax

__property TObjectState State;

Returns the state of the OLE object. The TObjectState enumerated type defines the possible values for TOleContainer's State property, as defined in the table that follows.

Values	Meaning

osEmpty	There is no OLE object in the container.

osLoaded	There is an OLE object in the container, but its server application isn't currently running.

osRunning	The OLE object's server is running.

osOpen	The OLE object is open in a separate window.

osInPlaceActive	The OLE object is activated inplace, but  hasn't yet merged its menus or toolbars. This is an intermediate state; the State property will shift to osUIActive as soon as the menus and toolbars have been merged.

osUIActive	The OLE object is activated inplace and menus and toolbars have been merged


TOleContainer::StorageInterface

TOleContainer	Properties

Syntax

__property Ole2::IStorage * StorageInterface;

Returns the IStorage interface for the OLE object, which is useful for lowlevel access to the OLE API. If there is no OLE object loaded into the container, StorageInterface returns NULL.


TOleContainer events

TOleContainer	Alphabetically	Legend

In TOleContainer

OnActivate

OnDeactivate

OnObjectMove

OnResize

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TOleContainer events

TOleContainer	By object	Legend

OnActivate

OnDeactivate

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnObjectMove

OnResize

OnStartDrag


TOleContainer::OnActivate

TOleContainer	Events

Syntax

__property Classes::TNotifyEvent OnActivate;


TOleContainer::OnDeactivate

TOleContainer	Events

Syntax

__property Classes::TNotifyEvent OnDeactivate;


OnDragrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


TOleContainer::OnObjectMove

TOleContainer	Events

Syntax

__property TObjectMoveEvent OnObjectMove;


TOleContainer::OnResize

TOleContainer	Events

Syntax

__property Classes::TNotifyEvent OnResize;


OnStartDrag


TOleContainer methods

TOleContainer	Alphabetically

In TOleContainer

~TOleContainer

ChangeIconDialog

Close

Copy

CreateLinkToFile

CreateObject

CreateObjectFromFile

CreateObjectFromInfo

DestroyObject

DoVerb

GetIconMetaPict

InsertObjectDialog

LoadFromFile

LoadFromStream

ObjectPropertiesDialog

Paste

PasteSpecialDialog

Run

SaveToFile

SaveToStream

TOleContainer

UpdateObject

UpdateVerbs

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleContainer methods

TOleContainer	By object

~TOleContainer

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeIconDialog

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

ContainsControl

ControlAtPos

Copy

CreateLinkToFile

CreateObjectFromFile

CreateObjectFromInfo

CreateObject

DefaultHandler

DestroyComponents

Destroying

DestroyObject

DisableAlign

Dispatch

DoVerb

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetIconMetaPict

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InsertObjectDialog

InstanceSize

Invalidate

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ObjectPropertiesDialog

PaintTo

PasteSpecialDialog

Paste

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Run

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TOleContainer

UpdateControlState

UpdateObject

Update

UpdateVerbs


TOleContainer::ChangeIconDialog

TOleContainer	Methods

Syntax

System::Boolean __fastcall ChangeIconDialog(void);

Executes the Change Icon OLE dialog box, which lets the user choose a different icon (from .ICO, .DLL, and .EXE files) to use when displaying the OLE object as an icon. An OLE object must already be loaded in the container before calling ChangeIconDialog. ChangeIconDialog returns true if the dialog box was successfully display and the user chose the OK button or false otherwise. You can force the container to show the OLE object as an icon by setting Iconic to true.


TOleContainer::Close

TOleContainer	Methods

Syntax

void __fastcall Close(void);

Deactivates the OLE object and terminates its server application, but doesn't remove it from the container. Any changes the user made to the OLE object are automatically saved. There must be an OLE object in the container before calling Close. After calling Close, the container's State property is osLoaded.


TOleContainer::Copy

TOleContainer	Methods

Syntax

void __fastcall Copy(void);

Copies the OLE object to the Windows clipboard. There must be an OLE object in the container before calling Copy.


TOleContainer::CreateLinkToFile

TOleContainer	Methods

Syntax

void __fastcall CreateLinkToFile(const System::AnsiString FileName, System::Boolean Iconic);

Creates a linked OLE object from the contents of the given file. Iconic indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::CreateObject

TOleContainer	Methods

Syntax

void __fastcall CreateObject(const System::AnsiString OleClassName, System::Boolean Iconic);

Creates an embedded OLE object given its class name (also known as programmatic identifier). Iconic indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::CreateObjectFromFile

TOleContainer	Methods

Syntax

void __fastcall CreateObjectFromFile(const System::AnsiString FileName, System::Boolean Iconic);

Creates an embedded OLE object from the contents of the given file. Iconic indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::CreateObjectFromInfo

TOleContainer	Methods

Syntax

void __fastcall CreateObjectFromInfo(const TCreateInfo &CreateInfo);

Creates an OLE object based on the specifications in a TCreateInfo record. See TCreateInfo and TCreateType for details on TCreateInfo's fields. If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded. The CreateLinkToFile, CreateObject, and CreateObjectFromFile methods are oneline calls for the most common types of OLE objects, instead of filling out the TCreateInfo record.


TOleContainer::DestroyObject

TOleContainer	Methods

Syntax

void __fastcall DestroyObject(void);

Destroys the container's OLE object, discarding any changes the user made to it.


TOleContainer::DoVerb

TOleContainer	Methods

Syntax

void __fastcall DoVerb(System::Integer Verb);

Requests the OLE object to perform some action. OLE defines several verbs, such as ovShow (to display the OLE object) and ovPrimary (the default action, usually to activate the OLE object). OLE objects can define their own custom verbs. You can use the ObjectVerbs property to get a list of those custom verbs.


TOleContainer::GetIconMetaPict

TOleContainer	Methods

Syntax

System::Integer __fastcall GetIconMetaPict(void);

Returns the global memory handle of a metafile containing the OLE object's icon. There must be an OLE object in the container before calling GetIconMetaPict. Use the DestroyMetaPict procedure to destroy the handle.


TOleContainer::InsertObjectDialog

TOleContainer	Methods

Syntax

System::Boolean __fastcall InsertObjectDialog(void);

Executes the Insert Object OLE dialog box, which lets the user create an OLE object. The OLE object can be embedded or linked. InsertObjectDialog returns true if the dialog box was successfully display and the user chose the OK button or false otherwise. If the user chose OK and there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::LoadFromFile

TOleContainer	Methods

Syntax

void __fastcall LoadFromFile(const System::AnsiString FileName);

Loads an OLE object from the specified file. If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded. If OldStreamFormat is false, LoadFromFile only loads files saved with Borland C++ Builder 2.0's TOleContainer component; if OldStreamFormat is true, LoadFromFile loads files saved with Borland C++ Builder 1.0's TOLEContainer component as well as Borland C++ Builder 2.0's TOleContainer.


TOleContainer::LoadFromStream

TOleContainer	Methods

Syntax

void __fastcall LoadFromStream(Classes::TStream *Stream);

Loads an OLE object from the specified stream. If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded. If OldStreamFormat is false, LoadFromStream only loads files saved with Borland C++ Builder 2.0's TOLEContainer component; if OldStreamFormat is true, LoadFromStream loads files saved with Borland C++ Builder 1.0's TOLEContainer component as well as Borland C++ Builder 2.0's TOleContainer.


TOleContainer::ObjectPropertiesDialog

TOleContainer	Methods

Syntax

System::Boolean __fastcall ObjectPropertiesDialog(void);

Displays the OLE Object Properties property sheet, which lets the user see and edit various properties of the OLE object. Any changes the user makes in the property sheet is automatically made to the OLE object. An OLE object must already be in the container before calling ObjectPropertiesDialog. ObjectPropertiesDialog returns true if the property sheet was successfully display and the user chose the OK button or false otherwise.


TOleContainer::Paste

TOleContainer	Methods

Syntax

void __fastcall Paste(void);

Pastes the contents of the Windows clipboard as an embedded object. If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::PasteSpecialDialog

TOleContainer	Methods

Syntax

System::Boolean __fastcall PasteSpecialDialog(void);

Executes the Paste Special OLE dialog to give the user more control over how the contents of the Windows clipboard are pasted into the container. The Paste Special dialog box lets the user select the format of the data, whether it should be embedded or linked, and whether to display the OLE object should be displayed as an icon (and if so, to choose a different icon). PasteSpecialDialog returns true if the dialog box was successfully display and the user chose the OK button or false otherwise. If the user chose the OK button and there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::Run

TOleContainer	Methods

Syntax

void __fastcall Run(void);

Runs the OLE object's server application, but doesn't open or active the OLE object iself. Once the server application is running, opening and activating the OLE object happens much more quickly. An OLE object must already be loaded in the container before calling Run.


TOleContainer::SaveToFile

TOleContainer	Methods

Syntax

void __fastcall SaveToFile(const System::AnsiString FileName);

Saves the OLE object to the specified file. An OLE object must already be loaded in the container before calling SaveToFile. If CopyOnSave is true, SaveToFile writes a temporary OLE object storage, compressing redundant data and saving space. If OldStreamFormat is true, SaveToFile writes a file compatible with Borland C++ Builder 1.0's TOLEContainer component; if OldStreamFormat is false, SaveToFile writes a file compatible with Borland C++ Builder 2.0's TOleContainer component.


TOleContainer::SaveToStream

TOleContainer	Methods

Syntax

void __fastcall SaveToStream(Classes::TStream *Stream);

Saves the OLE object to the specified stream. An OLE object must already be loaded in the container before calling SaveToStream. If CopyOnSave is true, SaveToStream writes a temporary OLE object storage, compressing redundant data and saving space. If OldStreamFormat is true, SaveToStream writes a stream compatible with Borland C++ Builder 1.0's TOLEContainer component; if OldStreamFormat is false, SaveToStream writes a stream compatible with Borland C++ Builder 2.0's TOleContainer component.


TOleContainer::UpdateObject

TOleContainer	Methods

Syntax

void __fastcall UpdateObject(void);

Updates the OLE object. Linked OLE objects and embedded objects that contain linked OLE objects get outofdate when the source of the link is updated. UpdateObject rereads the source to ensure that the OLE object has current data. If there is no OLE object loaded into the container, UpdateObject has no effect.


TOleContainer::UpdateVerbs

TOleContainer	Methods

Syntax

void __fastcall UpdateVerbs(void);

Refreshes the list of verbs the OLE object responds to. TOleContainer automatically calls UpdateVerbs when you first access the ObjectVerbs property, but some OLE objects change their verbs as they perform some actions. The Media Clip OLE object, for example, changes its "Play" verb to "Stop" while running. An OLE object must already be loaded in the container before calling UpdateVerbs.


TOleContainer::TOleContainer

TOleContainer	Methods	See also

TOleContainer creates a new TOleContainer object.

Syntax

__fastcall virtual TOleContainer(Classes::TComponent *AOwner);

Description

Use TOleContainer to create a new TOleContainer object.


TOleContainer::~TOleContainer

TOleContainer	Methods	See also

~TOleContainer frees the memory associated with the TOleContainer object.

Syntax

__fastcall virtual ~TOleContainer(void);

Description

Do not call ~TOleContainer directly. Instead, use the delete keyword on the object, which causes ~TOleContainer to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TOleContainer example

TOleContainer


TOleControl

Hierarchy	Properties	Methods

Header

vcl/olectrls.hpp

Description


TOleControl properties

TOleControl	Alphabetically	Legend

In TOleControl

Name

OleObject

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TOleControl properties

TOleControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

OleObject

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TOleControl::Name

TOleControl	Properties

Syntax

Description


TOleControl::OleObject

TOleControl	Properties

Syntax

__property System::Variant OleObject;

Description


TOleControl methods

TOleControl	Alphabetically

In TOleControl

~TOleControl

BrowseProperties

DoObjectVerb

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetPropDisplayString

GetPropDisplayStrings

IsCustomProperty

SetBounds

SetPropDisplayString

ShowAboutBox

TOleControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleControl methods

TOleControl	By object

~TOleControl

Assign

BeginDrag

BringToFront

Broadcast

BrowseProperties

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DoObjectVerb

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetParentComponent

GetPropDisplayStrings

GetPropDisplayString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsCustomProperty

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetPropDisplayString

SetTextBuf

ShowAboutBox

Show

TOleControl

UpdateControlState

Update


TOleControl::BrowseProperties

TOleControl	Methods

Syntax

void __fastcall BrowseProperties(void);

Description


TOleControl::DoObjectVerb

TOleControl	Methods

Syntax

void __fastcall DoObjectVerb(System::Integer Verb);

Description


TOleControl::GetEnumPropDesc

TOleControl	Methods

Syntax

TEnumPropDesc *__fastcall GetEnumPropDesc(System::Integer DispID);

Description


TOleControl::GetHelpContext

TOleControl	Methods

Syntax

System::Boolean __fastcall GetHelpContext( System::AnsiString Member, System::Integer &HelpCtx,  System::AnsiString &

Description


TOleControl::GetObjectVerbs

TOleControl	Methods

Syntax

void __fastcall GetObjectVerbs(Classes::TStrings *List);

Description


TOleControl::GetPropDisplayString

TOleControl	Methods

Syntax

System::AnsiString __fastcall GetPropDisplayString(System::Integer DispID);

Description


TOleControl::GetPropDisplayStrings

TOleControl	Methods

Syntax

void __fastcall GetPropDisplayStrings(System::Integer DispID, Classes::TStrings *List);

Description


TOleControl::IsCustomProperty

TOleControl	Methods

Syntax

System::Boolean __fastcall IsCustomProperty(System::Integer DispID);

Description


TOleControl::SetBounds

TOleControl	Methods

Syntax

virtual void __fastcall SetBounds(System::Integer ALeft, System::Integer ATop, System::Integer AWidth

Description


TOleControl::SetPropDisplayString

TOleControl	Methods

Syntax

void __fastcall SetPropDisplayString(System::Integer DispID, const System::AnsiString Value);

Description


TOleControl::ShowAboutBox

TOleControl	Methods

Syntax

void __fastcall ShowAboutBox(void);

Description


TOleControl::TOleControl

TOleControl	Methods	See also

TOleControl creates a new TOleControl object.

Syntax

__fastcall virtual TOleControl(Classes::TComponent *AOwner);

Description

Use TOleControl to create a new TOleControl object.


TOleControl::~TOleControl

TOleControl	Methods	See also

~TOleControl frees the memory associated with the TOleControl object.

Syntax

__fastcall virtual ~TOleControl(void);

Description

Do not call ~TOleControl directly. Instead, use the delete keyword on the object, which causes ~TOleControl to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TOleControl example

TOleControl


TOleFormObject

Hierarchy	Methods

Header

vcl/forms.hpp

Description


TOleFormObject methods

TOleFormObject	Alphabetically

In TOleFormObject

~TOleFormObject

TOleFormObject

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleFormObject methods

TOleFormObject	By object

~TOleFormObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TOleFormObject


TOleFormObject::TOleFormObject

TOleFormObject	Methods	See also

TOleFormObject creates a new TOleFormObject object.

Syntax

__fastcall TOleFormObject(void);

Description

Use TOleFormObject to create a new TOleFormObject object.


TOleFormObject::~TOleFormObject

TOleFormObject	Methods	See also

~TOleFormObject frees the memory associated with the TOleFormObject object.

Syntax

__fastcall virtual ~TOleFormObject(void);

Description

Do not call ~TOleFormObject directly. Instead, use the delete keyword on the object, which causes ~TOleFormObject to be invoked automatically.


Hierarchy

TObject


TOleFormObject example

TOleFormObject


TOleForm

Hierarchy	Methods

Header

vcl/olectnrs.hpp

Description


TOleForm methods

TOleForm	Alphabetically

In TOleForm

~TOleForm

TOleForm

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleForm methods

TOleForm	By object

~TOleForm

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TOleForm


TOleForm::TOleForm

TOleForm	Methods	See also

TOleForm creates a new TOleForm object.

Syntax

__fastcall TOleForm(Forms::TForm *Form);

Description

Use TOleForm to create a new TOleForm object.


TOleForm::~TOleForm

TOleForm	Methods	See also

~TOleForm frees the memory associated with the TOleForm object.

Syntax

__fastcall virtual ~TOleForm(void);

Description

Do not call ~TOleForm directly. Instead, use the delete keyword on the object, which causes ~TOleForm to be invoked automatically.


Hierarchy

TObject

TOleFormObject


TOleForm example

TOleForm


TOleInPlaceFrame

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TOleInPlaceFrame methods

TOleInPlaceFrame	Alphabetically

In TOleInPlaceFrame

~TOleInPlaceFrame

AddRef

ContextSensitiveHelp

EnableModeless

GetBorder

GetWindow

InsertMenus

QueryInterface

Release

RemoveMenus

RequestBorderSpace

SetActiveObject

SetBorderSpace

SetMenu

SetStatusText

TOleInPlaceFrame

TranslateAccelerator

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleInPlaceFrame methods

TOleInPlaceFrame	By object

~TOleInPlaceFrame

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ContextSensitiveHelp

DefaultHandler

Dispatch

EnableModeless

FieldAddress

FreeInstance

Free

GetBorder

GetWindow

InheritsFrom

InitInstance

InsertMenus

InstanceSize

MethodAddress

MethodName

NewInstance

QueryInterface

Release

RemoveMenus

RequestBorderSpace

SetActiveObject

SetBorderSpace

SetMenu

SetStatusText

TOleInPlaceFrame

TranslateAccelerator


TOleInPlaceFrame::AddRef

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TOleInPlaceFrame::ContextSensitiveHelp

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall ContextSensitiveHelp(System::LongBool fEnterMode);

Description


TOleInPlaceFrame::EnableModeless

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall EnableModeless(System::LongBool fEnable);

Description


TOleInPlaceFrame::GetBorder

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall GetBorder(Windows::TRect &rectBorder);

Description


TOleInPlaceFrame::GetWindow

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall GetWindow(System::Integer &wnd);

Description


TOleInPlaceFrame::InsertMenus

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall InsertMenus(System::Integer hmenuShared, Ole2::TOleMenuGroupWidths

Description


TOleInPlaceFrame::QueryInterface

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TOleInPlaceFrame::Release

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TOleInPlaceFrame::RemoveMenus

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall RemoveMenus(System::Integer hmenuShared);

Description


TOleInPlaceFrame::RequestBorderSpace

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall RequestBorderSpace(const Windows::TRect &borderwidths);

Description


TOleInPlaceFrame::SetActiveObject

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall SetActiveObject(Ole2::IOleInPlaceActiveObject *activeObject, System::PWideChar

Description


TOleInPlaceFrame::SetBorderSpace

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall SetBorderSpace(Windows::PRect pborderwidths);

Description


TOleInPlaceFrame::SetMenu

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall SetMenu(System::Integer hmenuShared, System::Integer holemenu, System::Integer

Description


TOleInPlaceFrame::SetStatusText

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall SetStatusText(System::PWideChar pszStatusText);

Description


TOleInPlaceFrame::TranslateAccelerator

TOleInPlaceFrame	Methods

Syntax

virtual System::Longint __stdcall TranslateAccelerator(Windows::TMsg &msg, System::Word wID);

Description


TOleInPlaceFrame::TOleInPlaceFrame

TOleInPlaceFrame	Methods	See also

TOleInPlaceFrame creates a new TOleInPlaceFrame object.

Syntax

__fastcall TOleInPlaceFrame(TOleControl *Control);

Description

Use TOleInPlaceFrame to create a new TOleInPlaceFrame object.


TOleInPlaceFrame::~TOleInPlaceFrame

TOleInPlaceFrame	Methods	See also

~TOleInPlaceFrame frees the memory associated with the TOleInPlaceFrame object.

Syntax

__fastcall virtual ~TOleInPlaceFrame(void);

Description

Do not call ~TOleInPlaceFrame directly. Instead, use the delete keyword on the object, which causes ~TOleInPlaceFrame to be invoked automatically.


Hierarchy

TObject

IUnknown

IOleWindow

IOleInPlaceUIWindow

IOleInPlaceFrame


TOleInPlaceFrame example

TOleInPlaceFrame


TOleInPlaceSite

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TOleInPlaceSite methods

TOleInPlaceSite	Alphabetically

In TOleInPlaceSite

~TOleInPlaceSite

AddRef

CanInPlaceActivate

ContextSensitiveHelp

DeactivateAndUndo

DiscardUndoState

GetWindow

GetWindowContext

OnInPlaceActivate

OnInPlaceDeactivate

OnPosRectChange

OnUIActivate

OnUIDeactivate

QueryInterface

Release

Scroll

TOleInPlaceSite

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleInPlaceSite methods

TOleInPlaceSite	By object

~TOleInPlaceSite

AddRef

CanInPlaceActivate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ContextSensitiveHelp

DeactivateAndUndo

DefaultHandler

DiscardUndoState

Dispatch

FieldAddress

FreeInstance

Free

GetWindowContext

GetWindow

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OnInPlaceActivate

OnInPlaceDeactivate

OnPosRectChange

OnUIActivate

OnUIDeactivate

QueryInterface

Release

Scroll

TOleInPlaceSite


TOleInPlaceSite::AddRef

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TOleInPlaceSite::CanInPlaceActivate

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall CanInPlaceActivate(void);

Description


TOleInPlaceSite::ContextSensitiveHelp

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall ContextSensitiveHelp(System::LongBool fEnterMode);

Description


TOleInPlaceSite::DeactivateAndUndo

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall DeactivateAndUndo(void);

Description


TOleInPlaceSite::DiscardUndoState

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall DiscardUndoState(void);

Description


TOleInPlaceSite::GetWindow

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall GetWindow(System::Integer &wnd);

Description


TOleInPlaceSite::GetWindowContext

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall GetWindowContext(Ole2::IOleInPlaceFrame *&frame, Ole2::IOleInPlaceUIWindow *

Description


TOleInPlaceSite::OnInPlaceActivate

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall OnInPlaceActivate(void);

Description


TOleInPlaceSite::OnInPlaceDeactivate

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall OnInPlaceDeactivate(void);

Description


TOleInPlaceSite::OnPosRectChange

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall OnPosRectChange(const Windows::TRect &rcPosRect);

Description


TOleInPlaceSite::OnUIActivate

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall OnUIActivate(void);

Description


TOleInPlaceSite::OnUIDeactivate

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall OnUIDeactivate(System::LongBool fUndoable);

Description


TOleInPlaceSite::QueryInterface

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TOleInPlaceSite::Release

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TOleInPlaceSite::Scroll

TOleInPlaceSite	Methods

Syntax

virtual System::Longint __stdcall Scroll(const Windows::TPoint &scrollExtent);

Description


TOleInPlaceSite::TOleInPlaceSite

TOleInPlaceSite	Methods	See also

TOleInPlaceSite creates a new TOleInPlaceSite object.

Syntax

__fastcall TOleInPlaceSite(TOleControl *Control);

Description

Use TOleInPlaceSite to create a new TOleInPlaceSite object.


TOleInPlaceSite::~TOleInPlaceSite

TOleInPlaceSite	Methods	See also

~TOleInPlaceSite frees the memory associated with the TOleInPlaceSite object.

Syntax

__fastcall virtual ~TOleInPlaceSite(void);

Description

Do not call ~TOleInPlaceSite directly. Instead, use the delete keyword on the object, which causes ~TOleInPlaceSite to be invoked automatically.


Hierarchy

TObject

IUnknown

IOleWindow

IOleInPlaceSite


TOleInPlaceSite example

TOleInPlaceSite


TOpenDialog

Hierarchy	Properties	Methods

The TOpenDialog component makes an Open dialog box available to your application. The purpose of the dialog box is to let a user specify a file to open. Use the Execute method to display the Open dialog box.

Header

vcl/dialogs.hpp

Description

When the user chooses OK in the dialog box, the user’s filename selection is stored in the dialog box’s FileName property, which you can then use to process as you want.

You can let the user decide which files to make visible in the list box of the Open dialog box with the Filter property. The user can then use the List Files of Type combo box to determine which files display in the list box. You set the default filter using the FilterIndex property.

You can permit the user to choose multiple filenames with the Options property so that the Files property contains a list of all the selected filenames in the list box. You can customize how the Open dialog box appears and behaves with the Options property.

If you want a file extension automatically appended to the filename typed in the File Name edit box of the Open dialog box, use the DefaultExt property.


TOpenDialog properties

TOpenDialog	Alphabetically	Legend

In TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TOpenDialog properties

TOpenDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

FilterIndex

Filter

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title


TOpenDialog::DefaultExt

TOpenDialog	Properties

Specifies the extension that is added to a file name the user types in File Name edit box if the user doesn’t include a file-name extension in the file name.

Syntax

__property System::AnsiString DefaultExt;

Description

If the user specifies an extension for the filename, the value of the DefaultExt property is ignored. If the DefaultExt value remains blank, no extension is added to the filename entered in the File Name edit box.


TOpenDialog::FileEditStyle

TOpenDialog	Properties

An obsolete property provides for backward compatibility only.

Syntax

__property TFileEditStyle FileEditStyle;

Description


TOpenDialog::FileName

TOpenDialog	Properties

Specifies the file name that appears in the File Name edit box when the dialog box opens.

Syntax

__property System::AnsiString FileName;

Description

The user can then select that filename or specify any other. Once the user specifies a filename and chooses OK, the value of the FileName property becomes the name of the file the user selected.

The path name can include a path. For example, to open the file README.TXT in the directory C:\TEMP, set FileName to C:\TEMP\README.TXT.


TOpenDialog::Files

TOpenDialog	Properties

Contains a list of file names selected in the Open dialog boxl

Syntax

__property Classes::TStrings * Files;

Description

Files includes the full path names.

To let users select multiple file names in the dialog box, include ofAllowMultiSelect in the Options property set (set ofAllowMultiSelect to true).


TOpenDialog::Filter

TOpenDialog	Properties

Determines the file masks available to the user for use in determining which fiels display in the dialgo box’s list box.

Syntax

__property System::AnsiString Filter;

Description

A file mask or file filter is a file name that usually includes wildcard characters (*.PAS, for example). Only files that match the selected file filter are displayed in the dialog box's list box, and the selected file filter appears in the File Name edit box. To specify a file filter, assign a filter string as the value of Filter. To create the string, follow these steps:

1	Type some meaningful text that indicates the type of file.

2	Type a | character (this is the "pipe" or "or" character).

3	Type the file filter.

Don't put in any spaces around the | character in the string.

Here's an example:

If you entered the preceding example as the Filter of an Open or Save dialog box, the string "Text files" appears in the List Files of Type drop-down list box when the dialog box appears in your application, the file filter appears in the File Name edit box, and only .TXT files appear in the list box. You can specify multiple file filters so that a list of filters appears in the List Files of Type drop-down list box or in the filter combo box. This allows the user to select from a number of file filters and determine which files are displayed in the list box.

To specify multiple file filters,

1	Create a file filter string as previously shown.

2	Type another file filter in the same way, but separate the second file filter from the first with the | character.

3	Continue adding as many file filters as you like, separating them with the | character. The string can be up to 255 characters.

Here's an example of three file filters specified as the value of the Filter property:

Now when the dialog box appears, the user can choose from three file filters that appear in the List Files of Type drop-down list box.

Note that the previous example includes the file filters in parentheses in the text parts. This isn't required, but it's a common convention that helps users understand what to expect when they select a file filter.


TOpenDialog::FilterIndex

TOpenDialog	Properties

Determines which file filter specified in the Filter property appears as the default file filter in the List Files of Type drop-down list box.

Syntax

__property System::Integer FilterIndex;

Description


TOpenDialog::HistoryList

TOpenDialog	Properties

An obsolete property provided for backwards compatibility only.

Syntax

__property Classes::TStrings * HistoryList;

Description


InitalDir

Determines the current directory when the dialog box first appears

Description

Thevalue of the InitialDir property is shown as the current directory in the directory tree. Only files in the current directory appear in the dialog box's list box of filenames. After the dialog box appears, users can then use the directory tree to change to another directory if they want.

When specifying the initial directory, include the full path name. For example,


TOpenDialog::Title

TOpenDialog	Properties

Determines the text that appears in the dialog box’s title bar.

Syntax

__property System::AnsiString Title;

Description


TOpenDialog methods

TOpenDialog	Alphabetically

In TOpenDialog

~TOpenDialog

Execute

TOpenDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOpenDialog methods

TOpenDialog	By object

~TOpenDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TOpenDialog


TOpenDialog::Execute

TOpenDialog	Methods

Displays the Open dialog box.

Syntax

virtual System::Boolean __fastcall Execute(void);

Description


TOpenDialog::TOpenDialog

TOpenDialog	Methods	See also

TOpenDialog creates a new TOpenDialog object.

Syntax

__fastcall virtual TOpenDialog(Classes::TComponent *AOwner);

Description

Use TOpenDialog to create a new TOpenDialog object.


TOpenDialog::~TOpenDialog

TOpenDialog	Methods	See also

~TOpenDialog frees the memory associated with the TOpenDialog object.

Syntax

__fastcall virtual ~TOpenDialog(void);

Description

Do not call ~TOpenDialog directly. Instead, use the delete keyword on the object, which causes ~TOpenDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TOpenDialog example

TOpenDialog


TOutline

Hierarchy	Properties	Methods	Events

The TOutline component is used for multilevel outlines of data. Use an outline to visually organize information in a hierarchical tree. Each item in an outline is contained in a TOutlineNode object.

Header

vcl/outline.hpp

An item in an outline can be accessed by the Items property. The items are indexed from 1 to the number of items. For example, Items[1] refers to the first (topmost) item. Since Items is the default array property of TOutline, an item can also be accessed immediately following the outline name. For example, Outline1.Items[1] and Outline1[1] refer to the same outline item.

Use the Add or AddObject methods to add a subitem to an outline. Use the Insert or InsertObject methods to replace an existing item in the outline. Use AddChild and AddChildObject to add a child item to the outline. Use Delete to remove items.

When adding, removing, or moving outline items, processing time can be sped up by calling BeginUpdate first. This prevents the outline items from being reindexed until EndUpdate is called.

The currently selected item is specified by the SelectedItem property. When the user selects a new item of the outline (by clicking with the mouse or pressing an Arrow key), the newly selected item is specified by SelectedItem.

The outline items can be represented within an outline by pictures that identify each item. The OutlineStyle property determines what type of pictures are used in the outline. You can also choose to display the outline tree with the OutlineStyle property.

The pictures displayed in an outline can be specified in the PictureLeaf, PictureMinus, PicturePlus, PictureOpen, and PictureClosed properties. If you don’t specify these properties, an outline displays default pictures.

To display other items than the default pictures and text, set the Style property to otOwnerDraw and then draw the item in the OnDrawItem event handler.


TOutline properties

TOutline	Alphabetically	Legend

Derived from TCustomOutline

ItemCount

ItemHeight

Items

ItemSeparator

Lines

Options

OutlineStyle

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

SelectedItem

Style

Derived from TCustomGrid

BorderStyle

Row

ScrollBars

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TOutline properties

TOutline	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

ItemCount

ItemHeight

ItemSeparator

Items

Left

Lines

Name

Options

OutlineStyle

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

PopupMenu

Row

ScrollBars

SelectedItem

ShowHint

Showing

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TOutline events

TOutline	Alphabetically	Legend

Derived from TCustomOutline

OnCollapse

OnDrawItem

OnExpand

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TOutline events

TOutline	By object	Legend

OnClick

OnCollapse

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDrag

OnEnter

OnExit

OnExpand

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnCollapse


OnDblClick


OnDragDrop


OnDragOver


OnDrawItem


OnEndDrag


OnEnter


OnExit


OnExpand


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TOutline methods

TOutline	Alphabetically

In TOutline

~TOutline

TOutline

Derived from TCustomOutline

Add

AddChild

AddChildObject

AddObject

BeginUpdate

Clear

Delete

EndUpdate

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetTextItem

GetVisibleNode

Insert

InsertObject

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetUpdateState

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOutline methods

TOutline	By object

~TOutline

AddChildObject

AddChild

AddObject

Add

Assign

BeginDrag

BeginUpdate

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

Delete

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

EndUpdate

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextItem

GetTextLen

GetVisibleNode

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InsertObject

Insert

InstanceSize

Invalidate

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

SetUpdateState

Show

TOutline

UpdateControlState

Update


TOutline::TOutline

TOutline	Methods	See also

TOutline creates a new TOutline object.

Syntax

__fastcall virtual TOutline(Classes::TComponent *AOwner);

Description

Use TOutline to create a new TOutline object.


TOutline::~TOutline

TOutline	Methods	See also

~TOutline frees the memory associated with the TOutline object.

Syntax

__fastcall virtual ~TOutline(void);

Description

Do not call ~TOutline directly. Instead, use the delete keyword on the object, which causes ~TOutline to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomOutline


TOutline example

TOutline


TOutlineNode

Hierarchy	Properties	Methods

The TOutlineNode object contains an item of an TOutline component. An outline item is represented as a line, or row, of the outline.

Header

vcl/outline.hpp

Description

An outline node contains Text and Data defined by your application. Text contains a string, and Data contains a pointer to a data structure to be associated with each outline item.

Each item can have from 0 to 16368 subitems, which are subordinate to the parent item in the outline structure.

Each item is identified by a unique Index. Index corresponds to the index of the Items property of the TOutline component. The children of an item are indexed sequentially, first child of an item having an Index value of one greater than its parent. For example, if the parent item has an Index of 7, its first child has an Index of 8, its second child has an Index of 9, and so on.

To move an item to a new location within the outline, call the MoveTo method.

The Expanded property determines if the item is currently expanded. If expanded, all children of an item are displayed in the outline. To set Expanded to true, call Expand. To set Expanded to false, call Collapse.

The Level property specifies the level, or column of an item in an outline. The items on the top level have a Level of 0. Their children have a level of 1, and so on. To change the level of an item, call the ChangeLevelBy method.

The HasItems property specifies whether an item has any children or subitems. GetFirstChild returns the Index value of the first child of an item. Likewise, GetLastChild, GetPrevChild, and GetNextChild return the index values of the last, previous, and next child items respectively.

The IsVisible property specifies whether an item is visible in an outline. An item is visible if all of its parents are expanded. You can expand all parents of an item with the FullExpand method.

The TopItem property specifies the Index value of the top-level parent of an item. The Parent property returns the actual immediate parent outline node of an item.

The FullPath property specifies the full path of parents down to an item. The path consists of the Text values of the parents separated by the ItemSeparator string specified for the TOutline component.


TOutlineNode properties

TOutlineNode	Alphabetically	Legend

In TOutlineNode

Data

Expanded

FullPath

HasItems

Index

IsVisible

Level

Parent

Text

TopItem


TOutlineNode properties

TOutlineNode	By object	Legend

Data

Expanded

FullPath

HasItems

Index

IsVisible

Level

Parent

Text

TopItem


TOutlineNode::Data

TOutlineNode	Properties

Specifies the data associated with an outline item.

Syntax

__property System::Pointer Data;


TOutlineNode::Expanded

TOutlineNode	Properties

Specifies whether the outline node is expanded.

Syntax

__property System::Boolean Expanded;

Description

When an outline item is expanded, its subitems are displayed and the minus picture or open picture might be displayed, depending on the outline style specified in the OutlineStyle property of the TOutline component for the outline node.


TOutlineNode::FullPath

TOutlineNode	Properties

Specifies the path of outline items from the top item on level 1 to the item contained by the TOutlineNode.

Syntax

__property System::AnsiString FullPath;

Description


HasItem

Determines if an outline item has any subitems.

Description


TOutlineNode::Index

TOutlineNode	Properties

Uniquely identifies each item, or node, of an outline.

Syntax

TOutlineNode *__fastcall GetNode(System::Longint Index);

Description

The first item has an Index value of 1, and subsequent items are indexed sequentially. If an item has subitems, the Index value of the parent item is one less than the Index value of its first subitem.


TOutlineNode::IsVisible

TOutlineNode	Properties

Indicates whether the outline item is visible within the TOutline component.

Syntax

__property System::Boolean IsVisible;

Description


TOutlineNode::Level

TOutlineNode	Properties

Indicates the level of indentation of an item within the TOutline component.

Syntax

void __fastcall SetLevel(System::Cardinal Level);

Description


TOutlineNode::Parent

TOutlineNode	Properties

Identifies the parent node of this outline node.

Syntax

__property TOutlineNode * Parent;

Description


TOutlineNode::Text

TOutlineNode	Properties

Contains the string that identifies the outline node.

Syntax

__property System::AnsiString Text;

Description


TOutlineNode::TopItem

TOutlineNode	Properties

Identifies which outline node is the very top item in an outline.

Syntax

__property System::Longint TopItem;

Description


TOutlineNode methods

TOutlineNode	Alphabetically

In TOutlineNode

~TOutlineNode

ChangeLevelBy

Collapse

Expand

FullExpand

GetDisplayWidth

GetFirstChild

GetLastChild

GetNextChild

GetPrevChild

MoveTo

TOutlineNode

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOutlineNode methods

TOutlineNode	By object

~TOutlineNode

Assign

ChangeLevelBy

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Collapse

DefaultHandler

Dispatch

Expand

FieldAddress

FreeInstance

Free

FullExpand

GetDisplayWidth

GetFirstChild

GetLastChild

GetNextChild

GetPrevChild

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

MoveTo

NewInstance

TOutlineNode


TOutlineNode::ChangeLevelBy

TOutlineNode	Methods

Changes the level of an outline node.

Syntax

void __fastcall ChangeLevelBy(TChangeRange Value);

Description

Specify a Value parameter value of -1 to move up (toward the root) one level. Specify a Value parameter value of 1 to move down (away from the root) one level.

When moving up one level, an item becomes the next sibling of its former parent. When moving down one level, an item becomes the last child of its former prior sibling. Therefore, you can not change the level of the first item in the outline, as it has no parent or prior sibling. Also, you can not move items that are already on the first level up one level.


TOutlineNode::Collapse

TOutlineNode	Methods

Collapses an outline item.

Syntax

void __fastcall Collapse(void);

Description


TOutlineNode::Expand

TOutlineNode	Methods

Expands an outline item

Syntax

void __fastcall Expand(void);

Description


TOutlineNode::FullExpand

TOutlineNode	Methods

Expands all the items within an outline.

Syntax

void __fastcall FullExpand(void);

Description


TOutlineNode::GetDisplayWidth

TOutlineNode	Methods

[NOT DOCUMENTED IN CURRENT HELP SYSTEM]

Syntax

System::Integer __fastcall GetDisplayWidth(void);

Description


TOutlineNode::GetFirstChild

TOutlineNode	Methods

Returns the Index value of the first subitem in an outline node.

Syntax

System::Longint __fastcall GetFirstChild(void);

Description


TOutlineNode::GetLastChild

TOutlineNode	Methods

Returns the Index value of the last subitem in an outline node.

Syntax

System::Longint __fastcall GetLastChild(void);


TOutlineNode::GetNextChild

TOutlineNode	Methods

Returns the Index value of the previous child subitem in an outline node.

Syntax

System::Longint __fastcall GetNextChild(System::Longint Value);

Description


TOutlineNode::GetPrevChild

TOutlineNode	Methods

Returns the Index value of the previous child node.

Syntax

System::Longint __fastcall GetPrevChild(System::Longint Value);

Description


TOutlineNode::MoveTo

TOutlineNode	Methods

Moves an outline node from one location to another within an outline (TOutline component).

Syntax

void __fastcall MoveTo(System::Longint Destination, TAttachMode AttachMode);

Description

The Destination parameter determines where to move the node. Pass the Index value of another outline item in the Destination parameter. The AttachMode parameter specifies how you want to attach the node to the destination position. These are the possible values of AttachMode:

oaAdd	The item is attached as if added with the Add method. The moved item becomes the last sibling of the item specified by the Destination parameter. The moved item will share the same parent as the Destination item.

oaAddChild	The item is attached as if added with the AddChild method. The moved item becomes the last child of the item specified by the Destination parameter. The Destination item will become the parent of the moved item.


TOutlineNode::TOutlineNode

TOutlineNode	Methods	See also

TOutlineNode creates a new TOutlineNode object.

Syntax

__fastcall TOutlineNode(TCustomOutline *AOwner);

Description

Use TOutlineNode to create a new TOutlineNode object.


TOutlineNode::~TOutlineNode

TOutlineNode	Methods	See also

~TOutlineNode frees the memory associated with the TOutlineNode object.

Syntax

__fastcall virtual ~TOutlineNode(void);

Description

Do not call ~TOutlineNode directly. Instead, use the delete keyword on the object, which causes ~TOutlineNode to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TOutlineNode example

TOutlineNode


TPage

Hierarchy	Properties	Methods

Header

vcl/extctrls.hpp

Description


TPage properties

TPage	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPage properties

TPage	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TPage methods

TPage	Alphabetically

In TPage

~TPage

TPage

Derived from TCustomControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPage methods

TPage	By object

~TPage

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TPage

UpdateControlState

Update


TPage::TPage

TPage	Methods	See also

TPage creates a new TPage object.

Syntax

__fastcall virtual TPage(Classes::TComponent *AOwner);

Description

Use TPage to create a new TPage object.


TPage::~TPage

TPage	Methods	See also

~TPage frees the memory associated with the TPage object.

Syntax

__fastcall virtual ~TPage(void);

Description

Do not call ~TPage directly. Instead, use the delete keyword on the object, which causes ~TPage to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TPage example

TPage


TPageControl

Hierarchy	Properties	Methods	Events

The TPageControl component is a page set which is used to make a multiple page dialog box.  It displays multiple overlapping pages which are TTabSheet objects, and replaces the TTabbedNotebook component. The user selects a page by clicking the page’s tab that appears at the top of the control.

Header

vcl/comctrls.hpp

To create a new page in a TPageControl at design time, right-click the TPageControl and choose New Page. Each page in a page control is a tab sheet object. You can access a particular page in the page control by either clicking on its tab or by setting the ActivePage property. The PageIndex property of the tab sheet control contains the index of the page in the page control.

By default, a tab control displays only one row of tabs. If not all tabs can be shown at once, the tab control displays an up-down control so that the user can scroll additional tabs into view. Use the MultiLine property to display multiple rows of tabs, if necessary, so that all tabs are visible at once.

The TPageControl component is an indirect descendent of TWinControl. In addition to the following properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TPageControl properties

TPageControl	Alphabetically	Legend

In TPageControl

ActivePage

PageCount

Pages

Derived from TCustomTabControl

MultiLine

TabHeight

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPageControl properties

TPageControl	By object	Legend

ActivePage

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

MultiLine

Name

Owner

PageCount

Pages

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabHeight

TabOrder

TabStop

TabWidth

Tag

Top

Visible

Width


TPageControl::ActivePage

TPageControl	Properties

Specifies the active page and brings it to the foreground in the sequence of overlapping pages.

Syntax

__property TTabSheet * ActivePage;

Each page is a TTabSheet object. To activate a particular page either select its tab or set the ActivePage property. To select pages whose tabs are not visible use the FindNextPage or SelectNextPage methods. Only one page can be active at a time.


TPageControl::PageCount

TPageControl	Properties

Contains the number of pages in a TPageControl.

Syntax

__property System::Integer PageCount;

Each page is a TTabSheet object.


TPageControl::Pages

TPageControl	Properties

An indexed property of the pages in a TPageControl.

Syntax

__property TTabSheet * Pages[System::Integer Index];

Each page is a TTabSheet object. Use Pages to access a TTabSheet object specified by its index value.


TPageControl events

TPageControl	Alphabetically	Legend

Derived from TCustomTabControl

OnChange

OnChanging

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPageControl events

TPageControl	By object	Legend

OnChange

OnChanging

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnChange


OnChanging


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TPageControl methods

TPageControl	Alphabetically

In TPageControl

~TPageControl

FindNextPage

SelectNextPage

TPageControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPageControl methods

TPageControl	By object

~TPageControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindNextPage

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectNextPage

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TPageControl

UpdateControlState

Update


TPageControl::FindNextPage

TPageControl	Methods

Returns the next page in the TPageControl before or after CurPage depending on the value of GoForward.

Syntax

TTabSheet *__fastcall FindNextPage(TTabSheet *CurPage, System::Boolean GoForward, System::Boolean CheckTabVisible

Each page is a TTabSheet object. To select the next page at design-time, right click the TPageControl and choose Next Page.

When CheckTabVisible is true, FindNextPage returns the next page with a TabVisible property set to true; if CheckTabVisible is false, FindNextPage returns the next page, including pages with TabVisible set to false. FindNextPage is useful in accessing a tab sheet that does not have a visible tab.

It the GoForward parameter is true, FindNextPage will find the next page in the page control after CurPage; if GoForward is false, FindNextPage will find the next page previous to CurPage.


TPageControl::SelectNextPage

TPageControl	Methods

Allows the user to select the next page previous to or after the ActivePage in the TPageControl.

Syntax

void __fastcall SelectNextPage(System::Boolean GoForward);

The SelectNextPage method allows the user to select the next page previous to or after the ActivePage in the TPageControl. It the GoForward parameter is true, FindNextPage will find the next page in the page control after ActivePage; if GoForward is false, FindNextPage will find the page previous to ActivePage. SelectNextPage will only find pages with their TabVisible property set to true.

To select a page at design-time, right-click the TPageControl and choose Previous Page or Next Page.


TPageControl::TPageControl

TPageControl	Methods	See also

TPageControl creates a new TPageControl object.

Syntax

__fastcall virtual TPageControl(Classes::TComponent *AOwner);

Description

Use TPageControl to create a new TPageControl object.


TPageControl::~TPageControl

TPageControl	Methods	See also

~TPageControl frees the memory associated with the TPageControl object.

Syntax

__fastcall virtual ~TPageControl(void);

Description

Do not call ~TPageControl directly. Instead, use the delete keyword on the object, which causes ~TPageControl to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TPageControl example

TPageControl


TPaintBox

Hierarchy	Properties	Methods	Events

The TPaintBox component provides a way for your application to draw on the form in a specified rectangular area, preventing drawing outside of the boundaries of the paint box. Once a paint box is added to your form, your application can use the OnPaint event handler to draw on the paint box’s Canvas, the drawing surface of the paint box The Color and Font properties are used to initialize the Canvas (TCanvas) for the OnPaint event handler. The Brush.Color is set to the Color property value.

Header

vcl/extctrls.hpp

If you want to draw on the entire form, you can just use the OnPaint event of the form itself. If you want to confine your drawing to rectangular area, you’ll find a paint box convenient.

You can align a paint box so that it remains in its relative position on the form, even when the user resizes the form. Use the Align property.

The TPaintBox component is a direct descendent of TGraphicControl. In addition to the following properties, methods, and events, this component also has the properties and methods that apply to all controls.


TPaintBox properties

TPaintBox	Alphabetically	Legend

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPaintBox properties

TPaintBox	By object	Legend

Align

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Tag

Top

Visible

Width


TPaintBox events

TPaintBox	Alphabetically	Legend

In TPaintBox

OnPaint

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPaintBox events

TPaintBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnMouseDown


OnMouseMove


OnMouseUp


TPaintBox::OnPaint

TPaintBox	Events

Syntax

__property Classes::TNotifyEvent OnPaint;


OnStartDrag


TPaintBox methods

TPaintBox	Alphabetically

In TPaintBox

~TPaintBox

TPaintBox

Derived from TGraphicControl

BeginDrag

Derived from TControl

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPaintBox methods

TPaintBox	By object

~TPaintBox

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TPaintBox

Update


TPaintBox::TPaintBox

TPaintBox	Methods	See also

TPaintBox creates a new TPaintBox object.

Syntax

__fastcall virtual TPaintBox(Classes::TComponent *AOwner);

Description

Use TPaintBox to create a new TPaintBox object.


TPaintBox::~TPaintBox

TPaintBox	Methods	See also

~TPaintBox frees the memory associated with the TPaintBox object.

Syntax

__fastcall virtual ~TPaintBox(void);

Description

Do not call ~TPaintBox directly. Instead, use the delete keyword on the object, which causes ~TPaintBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TPaintBox example

TPaintBox


TPaintControl

Hierarchy	Properties	Methods

Header

vcl/dbctrls.hpp

Description


TPaintControl properties

TPaintControl	Alphabetically	Legend

In TPaintControl

Ctl3DButton

Handle


TPaintControl properties

TPaintControl	By object	Legend

Ctl3DButton

Handle


TPaintControl::Ctl3DButton

TPaintControl	Properties

Syntax

__property System::Boolean Ctl3DButton;

Description


TPaintControl::Handle

TPaintControl	Properties

Syntax

__property System::Integer Handle;

Description


TPaintControl methods

TPaintControl	Alphabetically

In TPaintControl

~TPaintControl

DestroyHandle

TPaintControl

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPaintControl methods

TPaintControl	By object

~TPaintControl

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyHandle

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TPaintControl


TPaintControl::DestroyHandle

TPaintControl	Methods

Syntax

void __fastcall DestroyHandle(void);

Description


TPaintControl::TPaintControl

TPaintControl	Methods	See also

TPaintControl creates a new TPaintControl object.

Syntax

__fastcall TPaintControl(Controls::TWinControl *Owner, const System::AnsiString ClassName);

Description

Use TPaintControl to create a new TPaintControl object.


TPaintControl::~TPaintControl

TPaintControl	Methods	See also

~TPaintControl frees the memory associated with the TPaintControl object.

Syntax

__fastcall virtual ~TPaintControl(void);

Description

Do not call ~TPaintControl directly. Instead, use the delete keyword on the object, which causes ~TPaintControl to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TPaintControl example

TPaintControl


TPanel

Hierarchy	Properties	Methods	Events	See also

TPanel implements a generic panel control.

Header

vcl/extctrls.hpp

Description

Use the TPanel component to put an empty panel on your form. Panels provide properties for providing a bevelled border around the control, as well as methods to help manage the placement of child controls embedded in the panel.

TPanel implements the generic behavior introduced in TCustomPanel. TPanel publishes many of the properties inherited from TCustomPanel, but does not introduce any new behavior.


TPanel properties

TPanel	Alphabetically	Legend

Derived from TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPanel properties

TPanel	By object	Legend

Alignment

Align

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Locked

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TPanel events

TPanel	Alphabetically	Legend

Derived from TCustomPanel

OnResize

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPanel events

TPanel	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag


TPanel methods

TPanel	Alphabetically

In TPanel

~TPanel

TPanel

Derived from TCustomPanel

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPanel methods

TPanel	By object

~TPanel

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TPanel

UpdateControlState

Update


TPanel::TPanel

TPanel	Methods	See also

TPanel creates a new TPanel object.

Syntax

__fastcall virtual TPanel(Classes::TComponent *AOwner);

Description

Use TPanel to create a new TPanel object.


TPanel::~TPanel

TPanel	Methods	See also

~TPanel frees the memory associated with the TPanel object.

Syntax

__fastcall virtual ~TPanel(void);

Description

Do not call ~TPanel directly. Instead, use the delete keyword on the object, which causes ~TPanel to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


TPanel example

TPanel


TParaAttributes

Hierarchy	Properties	Methods	See also

TParaAttributes is a helper object that represents a set of paragraph formatting properties for a rich edit control.

Header

vcl/comctrls.hpp

Description

TParaAttributes includes a number of properties that describe the formatting characteristics of a paragraph in a rich text document. TParaAttributes is tailored to allow a descendent of TCustomRichEdit to read and write formatting characteristics of selected paragraphs. The properties of a TParaAttributes object are invalid unless it is owned by a descendent of TCustomRichEdit.


TParaAttributes properties

TParaAttributes	Alphabetically

In TParaAttributes

Alignment

FirstIndent

LeftIndent

Numbering

RightIndent

Tab

TabCount


TParaAttributes properties

TParaAttributes	By object

Alignment

FirstIndent

LeftIndent

Numbering

RightIndent

TabCount

Tab


TParaAttributes::Alignment

TParaAttributes	Properties	See also

Alignment specifies how text is aligned within a paragraph.

Syntax

__property Classes::TAlignment Alignment;

Description

Use Alignment to specify the alignment of text within individual paragraphs. Unlike the Alignment property of a TCustomMemo, which applies to the entire body of text, the Alignment property of TParaAttributes applies only to the selected paragraphs.

These are the possible values:

Value	Meaning

taLeftJustify	Align text to the left side of the paragraph.

taCenter	Center text horizontally in the paragraph.

taRightJustify	Align text to the right side of the pararaph.


TParaAttributes::FirstIndent

TParaAttributes	Properties	See also

FirstIndent specifies the size, in pixels, of the indentation of the first line in the paragraph relative to the left margin.

Syntax

__property System::Longint FirstIndent;

Description

Use FirstIndent to specify the number of pixels to indent the first line in the paragraph. This value is completely independent of the value of LeftIndent. Once FirstIndent has been set, subsequent changes to LeftIndent will change the relative indentation of the first and subsequent lines in the paragraph.


TParaAttributes::LeftIndent

TParaAttributes	Properties	See also

LeftIndent specifies the size, in pixels, of the left indentation of the paragraph relative to the left margin.

Syntax

__property System::Longint LeftIndent;

Description

Use LeftIndent to indent a paragraph relative to the left margin of the entire body of text. LeftIndent is useful in making individual paragraphs stand out from the rest of the text.

Note

Adding bullets to a set of paragraphs by using the Numbering property will also affect the left indentation.


TParaAttributes::Numbering

TParaAttributes	Properties	See also

Numbering specifies whether the paragraph is one of a set of bulleted paragraphs.

Syntax

__property TNumberingStyle Numbering;

Description

To insert a bullet to the left of the paragraph, and indent the paragraph sufficiently to accomodate the bullet, set Numbering to nsBullet. If the LeftIndent property has been set, bullets will appear at the indentation indicated by LeftIndent, and the body of the paragraph will be further indented to accomodate the bullets.

These are the possible values:

Value	Meaning

nsNone	No numbering on the left

nsBullet	Bullets on the left with sufficient indentation for the bullets


TParaAttributes::RightIndent

TParaAttributes	Properties	See also

RightIndent specifies the size, in pixels, of the right indentation of the paragraph relative to the right margin.

Syntax

__property System::Longint RightIndent;

Description

Use RightIndent to indent a paragraph relative to the right margin of the entire body of text. RightIndent is useful in making individual paragraphs stand out from the rest of the text, especially when Alignment is set to taRightJustify.


TParaAttributes::Tab

TParaAttributes	Properties	See also

Tab specifies the position, in pixels, of a particular tab stop.

Syntax

__property System::Longint Tab[System::Byte Index];

Description

Tab is an indexed property into an array of absolute tab stop positions. The position of the first tab stop is Tab[0], the next tab stop is Tab[1], and so on to Tab[TabCount - 1].

When setting Tab, values of Index below TabCount change the positions of existing tab stops, while values of Index greater than or equal to TabCount increase the number of tabstops in the paragraph and change the value of TabCount.

Note

Setting Tab does not insert a tab into the text of the paragraph. It sets the positions within the paragraph where tabs will occur if they are inserted. The actual tab characters are inserted into the paragraph by using the Tab key.


TParaAttributes::TabCount

TParaAttributes	Properties	See also

TabCount indicates the number of tab stops that are defined for the paragraph.

Syntax

__property System::Integer TabCount;

Description

Read TabCount to determine if a tab stop has been defined for the paragraph. To add or change the position of a tab stop use the indexed Tab property .


TParaAttributes methods

TParaAttributes	Alphabetically

In TParaAttributes

~TParaAttributes

Assign

TParaAttributes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParaAttributes methods

TParaAttributes	By object

~TParaAttributes

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TParaAttributes


TParaAttributes::Assign

TParaAttributes	Methods	See also

Assign sets all of the properties of a TParaAttributes object to match the properties specified in another TParaAttributes object.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Use Assign to set the paragraph attributes of the selected paragraph from one rich edit control to match the attributes of the selected paragraph of another rich edit control. Since the properties of a TParaAttributes object are only valid when the TParaAttributes exists within a rich edit control, Assign is only useful for copying attributes between rich edit controls.

Note

Assign only succeeds at runtime when the Source is a TParaAttributes object or an object that has an AssignTo method that is enabled for a TParaAttributes object. Other source objects will raise an EConvertError exception.


TParaAttributes::TParaAttributes

TParaAttributes	Methods	See also

TParaAttributes creates a new TParaAttributes object.

Syntax

__fastcall TParaAttributes(TCustomRichEdit *AOwner);

Description

Use TParaAttributes to create a new TParaAttributes object.


TParaAttributes::~TParaAttributes

TParaAttributes	Methods	See also

~TParaAttributes frees the memory associated with the TParaAttributes object.

Syntax

__fastcall virtual ~TParaAttributes(void);

Description

Do not call ~TParaAttributes directly. Instead, use the delete keyword on the object, which causes ~TParaAttributes to be invoked automatically.


Hierarchy

TObject

TPersistent


TParaAttributes example

TParaAttributes


TParam

Hierarchy	Properties	Methods	See also

TParam represents a field parameter.

Header

vcl/dbtables.hpp

Description

Use the properties of a TParam to set the value of a parameter that represents the value of a field. Objects that use parameters for the values of fields create TParam objects to represent those parameters. For example, TParams are used by TQuery objects and TStoredProc objects.

TParam shares many properties with a TField object, as both describe the value of a field in a dataset. However, a TField object has several properties to describe the field binding, and how the field is displayed, edited, or calculated that are not needed in a TParam object. Conversely, TParam includes properties that indicate how the field value is passed as a parameter.


TParam properties

TParam	Alphabetically	Legend

In TParam

AsBCD

AsBoolean

AsCurrency

AsDate

AsDateTime

AsFloat

AsInteger

AsSmallInt

AsString

AsTime

AsWord

Bound

DataType

IsNull

Name

ParamType

Text

Value


TParam properties

TParam	By object	Legend

AsBCD

AsBoolean

AsCurrency

AsDateTime

AsDate

AsFloat

AsInteger

AsSmallInt

AsString

AsTime

AsWord

Bound

DataType

IsNull

Name

ParamType

Text

Value


TParam::AsBCD

TParam	Properties	See also

AsBCD is the value of the parameter when it represents the value of a binary-coded decimal (BCD) field.

Syntax

__property System::Currency AsBCD;

Description

Set AsBCD to assign the value for a BCD field to the parameter. AsBCD does not actually take a BCD value. As BCD field objects use the Currency type to represent the value of BCD fields, AsBCD takes a Currency value. Setting AsBCD will set the DataType property to ftBCD.

Read the AsBCD property to determine the value that was assigned to the parameter, represented as a Currency type. The value of the parameter will be converted to a Currency value if possible.


TParam::AsBoolean

TParam	Properties	See also

AsBoolean is the value of the parameter when it represents the value of a boolean field.

Syntax

__property System::Boolean AsBoolean;

Description

Set AsBoolean to assign the value for a boolean field to the parameter. Setting AsBoolean will set the DataType property to ftBoolean.

Read the AsBoolean property to determine the value that was assigned to the parameter, represented as a Boolean. The value of the parameter will be converted to a Boolean value if possible.


TParam::AsCurrency

TParam	Properties	See also

AsCurrency is the value of the parameter when it represents the value of a currency field.

Syntax

__property System::Double AsCurrency;

Description

Set AsCurrency to assign the value for a currency field to the parameter. Setting AsCurrency will set the DataType property to ftCurrency.

Read the AsCurrency property to determine the value that was assigned to the parameter, represented as a Double. The value of the parameter will be converted to a Double value if possible.

Note

Do not confuse the AsCurrency property with the Currency data type. Currency fields in database tables store their values as Doubles. The AsBCD property represents the value of the parameter in the Currency data type.


TParam::AsDate

TParam	Properties	See also

AsDate is the value of the parameter when it represents the value of a date field.

Syntax

__property System::TDateTime AsDate;

Description

Set AsDate to assign the value for a date field to the parameter. Setting AsDate will set the DataType property to ftDate.

Read the AsDate property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible. If the DataType for the parameter is ftDate, only the date portion of the TDateTime value is valid.

The TDateTime type is a Double used by date field objects to hold their values. It actually represents more information than is needed for a date field, which only requires the date portion of the TDateTime value.

The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24-hour day that has elapsed.

Note

Borland C++ Builder 1.0 calculated the date from year 1 instead of from 1899. To convert from a Borland C++ Builder 1.0 date, subtract 693594.0. The date format changed to be more compatible with OLE 2.0 Automation.


TParam::AsDateTime

TParam	Properties	See also

AsDateTime is the value of the parameter when it represents the value of a date-time field.

Syntax

__property System::TDateTime AsDateTime;

Description

Set AsDate to assign the value for a date-time field to the parameter. Setting AsDateTime will set the DataType property to ftDateTime.

Read the AsDateTime property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible.

The TDateTime type is a Double used by date-time field objects to hold their values. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24-hour day that has elapsed.

Note

Borland C++ Builder 1.0 calculated the date from year 1 instead of from 1899. To convert from a Borland C++ Builder 1.0 date, subtract 693594.0. The date format changed to be more compatible with OLE 2.0 Automation.


TParam::AsFloat

TParam	Properties	See also

AsFloat is the value of the parameter when it represents the value of a float field.

Syntax

__property System::Double AsFloat;

Description

Set AsFloat to assign the value for a float field to the parameter. Setting AsFloat will set the DataType property to ftFloat.

Read the AsFloat property to determine the value that was assigned to the parameter, represented as a Double. The value of the parameter will be converted to a Double value if possible.


TParam::AsInteger

TParam	Properties	See also

AsInteger is the value of the parameter when it represents the value of an integer field.

Syntax

__property System::Longint AsInteger;

Description

Set AsInteger to assign the value for an integer field to the parameter. Setting AsInteger will set the DataType property to ftInteger.

Read the AsInteger property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a LongInt value if possible.


TParam::AsSmallInt

TParam	Properties	See also

AsSmallInt is the value of the parameter when it represents the value of a small integer field.

Syntax

__property System::Longint AsSmallInt;

Description

Set AsSmallInt to assign the value for a small integer field to the parameter. Setting AsSmallInt will set the DataType property to ftSmallint.

Read the AsSmallInt property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a LongInt value if possible.

Note

AsSmallInt works with a 32-bit integer. Small integer field objects store and manipulate their data as 32-bit integers even though the values in the underlying database are 16-bit integers.


TParam::AsString

TParam	Properties	See also

AsString is the value of the parameter when it represents the value of a string field.

Syntax

__property System::AnsiString AsString;

Description

Set AsString to assign the value for a string field to the parameter. Setting AsString will set the DataType property to ftString.

Read the AsString property to determine the value that was assigned to the parameter, represented as a string. The value of the parameter will be converted to a string.


TParam::AsTime

TParam	Properties	See also

AsTime is the value of the parameter when it represents the value of a time field.

Syntax

__property System::TDateTime AsTime;

Description

Set AsTime to assign the value for a time field to the parameter. Setting AsTime will set the DataType property to ftTime.

Read the AsTime property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible. If the DataType for the parameter is ftTime, only the time portion of the TDateTime value is valid

The TDateTime type is a Double used by time field objects to hold their values. It actually represents more information than is needed for a time field, which only requires the time portion of the TDateTime value.

The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24-hour day that has elapsed.


TParam::AsWord

TParam	Properties	See also

AsWord is the value of the parameter when it represents the value of a word field.

Syntax

__property System::Longint AsWord;

Description

Set AsWord to assign the value for a word field to the parameter. Setting AsWord will set the DataType property to ftWord.

Read the AsWord property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a LongInt value if possible.

Note

AsWord works with a 32-bit integer. Word field objects store and manipulate their data as 32-bit integers even though the values in the underlying database are unsigned 16-bit values.


TParam::Bound

TParam	Properties	See also

Bound indicates whether a value (NULL or otherwise) has been assigned to the parameter.

Syntax

__property System::Boolean Bound;

Description

Read Bound to determine whether a value has been assigned to the parameter. Whenever a value is assigned to the TParam object, Bound is automatically set to true. Set Bound to false to undo the setting of a value. The Clear method will replace the value of the parameter with NULL, but will not set Bound to false. If the Clear method is used to bind the parameter to a NULL value, Bound must be separately set to true.

TQuery objects and TStoredProc objects use the value of Bound to determine whether or not to assign a default value for the parameter. If Bound is false, A TQuery object attempts to assign a value from the dataset indicated by the DataSource property of the query. Similarly, when Bound is false, a TStoredProc object attempts to supply a value directly from the server.


TParam::DataType

TParam	Properties

DataType indicates the type of field whose value the parameter represents.

Syntax

__property Db::TFieldType DataType;

Description

DataType is set automatically when a value is assigned to the parameter. Do not set DataType for bound fields, as that may cause the assigned value to be misinterpreted.

Read DataType to discover the type of data that was assigned to the parameter. Each possible value of datatype corresponds to a type of database field. The possible values are as follows:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-Coded Decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field


TParam::IsNull

TParam	Properties	See also

IsNull indicates whether the value assigned to the parameter is NULL (blank).

Syntax

__property System::Boolean IsNull;

Description

Read IsNull to discover if the value of the parameter is NULL, indicating the value of a blank field. NULL values can arise in the following ways:

•	Assigning the value of another, NULL, parameter.

•	Assigning the value of a blank field.

•	Calling the Clear method.

Note

NULL parameters are not the same as unbound parameters. Unbound parameters have not had a value assigned. NULL parameters have a NULL value. NULL parameters may be bound or unbound.


TParam::Name

TParam	Properties	See also

Name specifies the the name of the parameter.

Syntax

__property System::AnsiString Name;

Description

Use Name to identify a particular parameter within a TParams object. Name is the name of the parameter, not the name of the field whose value the parameter may represent.


TParam::ParamType

TParam	Properties

ParamType indicates the type of the parameter the TParam represents.

Syntax

__property TParamType ParamType;

Description

Objects that use TParam objects to represent field parameters set ParamType to indicate the type of use for the parameter. ParamType must be one of the following values:

Value	Description

ptUnknown	Unknown or undetermined

ptInput	Used to input a field value.

ptOutput	Used to output a field value.

ptInputOutput	Used for both input and output.

ptResult	Used as a return value.


TParam::Text

TParam	Properties	See also

Text represents the value of the parameter as a string.

Syntax

__property System::AnsiString Text;

Description

Set the Text property to assign the value of the parameter to a string without changing the DataType . Unlike the AsString property, which sets the value to a string and changes the DataType, setting the text property converts the string to the DataType of the parameter, and sets the value accordingly. Thus, use AsString to treat the parameter as representing the value of a string field. Use Text instead when assigning a value that is in string form, when making no assumptions about the field type. For example, Text is useful for assigning user data that was input using an edit control.

Reading the Text property is the same as reading the AsString property.


TParam::Value

TParam	Properties	See also

Value represents the value of the parameter as a Variant.

Syntax

System::Boolean __fastcall IsEqual(TParam *Value);

Description

Use Value in generic code that manipulates the values of parameters without needing to know the field type the parameters represent.


TParam methods

TParam	Alphabetically

In TParam

~TParam

Assign

AssignField

AssignFieldValue

Clear

GetData

GetDataSize

SetData

TParam

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParam methods

TParam	By object

~TParam

AssignField

AssignFieldValue

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetDataSize

GetData

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SetData

TParam


TParam::Assign

TParam	Methods	See also

Assign copies the Name and Value of another TParam object.

Syntax

void __fastcall Assign(TParam *Param);

Description

Use Assign to copy from one parameter to another. Assign transfers the value of

•	The DataType property

•	The Bound property

•	The Value property

•	The Name property

Assign does not copy the value of the ParamType property, unless it is ptUnknown. Thus, Assign does not alter the use of a parameter, only the identifier and the value.


TParam::AssignField

TParam	Methods	See also

AssignField assigns the DataType, Name and Value properties from a TField object.

Syntax

void __fastcall AssignField(Db::TField *Field);

Description

Use AssignField to set a parameter to represent a particular TField object. AssignField sets the Bound property to true.

Unlike AssignFieldValue, AssignField names the parameter after the field object as well as taking its value.


TParam::AssignFieldValue

TParam	Methods	See also

AssignFieldValue assigns the DataType and Value properties from a TField object.

Syntax

void __fastcall AssignFieldValue(Db::TField *Field, const System::Variant &Value);

Description

Use AssignFieldValue to set a parameter to the value of a particular TField object. AssignFieldValue sets the Bound property to true.

Unlike AssignField, AssignFieldValue does not name the parameter after the field object as well as taking its value.


TParam::Clear

TParam	Methods	See also

Clear sets the Value of the parameter to NULL.

Syntax

void __fastcall Clear(void);

Description

Use Clear to assign a NULL value to a parameter. Calling Clear neither sets nor clears the Bound property. When assigning a NULL value to a parameter, set the Bound property as well as calling Clear.


TParam::GetData

TParam	Methods	See also

GetData fills the buffer with the Value of the parameter in the native format of a database field of the appropriate type.

Syntax

void __fastcall GetData(System::Pointer Buffer);

Description

Use GetData to obtain the value of a parameter in the format ready to be written directly to a record buffer. That format is the format used by physical database fields corresponding to DataType. Buffer must have enough space to hold the information. Use the GetDataSize method to determine the necessary size.

The native format for a database field may not be the same as the datatype used by the corresponding field object. Use the As... properties to get the value in the type used by the corresponding field object. Use GetData to get the value in the native database format.

For example, when DataType is ftBCD, GetData retrieves the value in binary-coded decimal, even though the TBCDField object uses Currency to store and manipulate its values. AsBCD gets the value in the Currency type.


TParam::GetDataSize

TParam	Methods	See also

GetDataSize returns the number of bytes needed to hold the parameter’s value in the format used by the corresponding type of database field.

Syntax

System::Word __fastcall GetDataSize(void);

Description

Call GetDataSize to determine the number of bytes required to store a parameter’s value in an actual database record. GetDataSize indicates the buffer size needed before calling the GetData method. The value returned by GetDataSize depends on the Value and DataType of the parameter:

DataType	Value of DataSize

ftBoolean	2

ftSmallInt	2

ftWord	2

ftAutoInc	4

ftDate	4

ftInteger	4

ftTime	4

ftCurrency	8

ftDateTime	8

ftFloat	8

ftBCD	34

ftString	length of the string + 1

ftVarBytes	raises an exception

ftBytes	raises an exception

ftBlob	raises an exception

ftDBaseOle	raises an exception

ftFmtMemo	raises an exception

ftGraphic	raises an exception

ftMemo	raises an exception

ftParadoxOle	raises an exception

ftTypedBinary	raises an exception

ftUnknown	raises an exception

Note

The size returned by GetDataSize is the size required for the physical database representation of the Value. The field object that corresponds to that physical database field may store its data in another format requiring a different number of bytes..


TParam::SetData

TParam	Methods	See also

SetData copies a new value for the parameter in physical database format from Buffer.

Syntax

void __fastcall SetData(System::Pointer Buffer);

Use SetData to set the value of a parameter from a buffer that contains data in the physical database format. The GetData method of a TField object fetches data in the physical database format. Borland Database Engind API calls can also provide data in physical database format.


TParam::TParam

TParam	Methods	See also

TParam creates a new TParam object.

Syntax

__fastcall TParam(TParams *AParamList, TParamType AParamType);

Description

Use TParam to create a new TParam object.


TParam::~TParam

TParam	Methods	See also

~TParam frees the memory associated with the TParam object.

Syntax

__fastcall virtual ~TParam(void);

Description

Do not call ~TParam directly. Instead, use the delete keyword on the object, which causes ~TParam to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TParam example

TParam


TParamList

Hierarchy	Properties	Methods

Header

vcl/db.hpp

Description


TParamList properties

TParamList	Alphabetically	Legend

In TParamList

Buffer

FieldCount

FieldDescs


TParamList properties

TParamList	By object	Legend

Buffer

FieldCount

FieldDescs


TParamList::Buffer

TParamList	Properties

Syntax

__property System::PChar Buffer;

Description


TParamList::FieldCount

TParamList	Properties

Syntax

__property System::Integer FieldCount;

Description


TParamList::FieldDescs

TParamList	Properties

Syntax

__property PFieldDescList FieldDescs;

Description


TParamList methods

TParamList	Alphabetically

In TParamList

~TParamList

TParamList

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParamList methods

TParamList	By object

~TParamList

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TParamList


TParamList::TParamList

TParamList	Methods	See also

TParamList creates a new TParamList object.

Syntax

__fastcall TParamList(Classes::TStrings *Params);

Description

Use TParamList to create a new TParamList object.


TParamList::~TParamList

TParamList	Methods	See also

~TParamList frees the memory associated with the TParamList object.

Syntax

__fastcall virtual ~TParamList(void);

Description

Do not call ~TParamList directly. Instead, use the delete keyword on the object, which causes ~TParamList to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TParamList example

TParamList


TParams

Hierarchy	Properties	Methods	See also

The TParams object manages a list of field parameters.

Header

vcl/dbtables.hpp

Description

Use TParams to manage a list of TParam objects for an object that uses field parameters. For example, TStoredProc objects and TQuery objects use TParams objects to create and access their parameters.

Use the properties and methods of TParams to:

•	Access a specific field parameter.

•	Add or delete field parameters from the list.

•	Get or set the values of individual field parameters.

•	Compare field parameters.

•	Iterate through all field parameters.

•	Copy a set of field parameters to another parameter list.


TParams properties

TParams	Alphabetically	Legend

In TParams

Items

ParamValues


TParams properties

TParams	By object	Legend

Items

ParamValues


TParams::Items

TParams	Properties	See also

Items contains the individual field parameters of a TParams object.

Syntax

__property TParam * Items[System::Word Index];

Description

Use Items to iterate through all the field parameters. Index identifies the index in the range 0..Count - 1. Items can reference a particular parameter by its index, but the ParamByName method is preferred, so as to avoid depending on the order of the parameters.


TParams::ParamValues

TParams	Properties	See also

ParamValues is a variant array containing the values of individual field parameters that are specified by name.

Syntax

__property System::Variant ParamValues[System::AnsiString ParamName];

Description

Use ParamValues to get or set the values of individual field parameters that are identified by name. ParamName is a string containing the names of the individual field parameters of interest. If ParamValues is used to access more than one field parameter, the names are separated by semicolons (;).

Setting ParamValues sets the Value property for each parameter listed in the ParamName string. Specify the values as Variants, in order, in a variant array.

Getting ParamValues retrieves a variant array of variants, each of which represents the value of one of the named parameters.

If ParamName includes a name that does not match any of the field parameters in Items, an exception is raised.


TParams methods

TParams	Alphabetically

In TParams

~TParams

AddParam

Assign

AssignValues

Clear

Count

CreateParam

GetParamList

IsEqual

ParamByName

RemoveParam

TParams

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParams methods

TParams	By object

~TParams

AddParam

Assign

AssignValues

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Count

CreateParam

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetParamList

InheritsFrom

InitInstance

InstanceSize

IsEqual

MethodAddress

MethodName

NewInstance

ParamByName

RemoveParam

TParams


TParams::AddParam

TParams	Methods	See also

AddParam inserts a new field parameter into the Items list.

Syntax

void __fastcall AddParam(TParam *Value);

Description

Use AddParam to add an instantiated parameter to the Items list. To create a field parameter as well as add it to the list, use CreateParam instead.


TParams::Assign

TParams	Methods	See also

Assign copies a parameter list from another object.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Use Assign to save and restore a set of parameters or to copy another object's information. Specify the object from which the parameters are to be copied as the value of Source. If Source is another TParams object, Assign discards any current parameter information and replaces it with a copy of the list of field parameters in Source.

Unlike AssignValues, which merely copies the values of the field parameters in the source object’s list, Assign copies the actual field parameters themselves.


TParams::AssignValues

TParams	Methods	See also

AssignValues assigns new values to the parameters of the Items property.

Syntax

void __fastcall AssignValues(TParams *Value);

Description

Use AssignValues to update the values of the field parameters in the Items list to match the values of the corresponding field parameters in another TParams object. For each entry in Items, the AssignValues method attempts to find a parameter with the same Name property in Value. If successful, the parameter information (type and current data) from the Value parameter is assigned to the Items entry. Entries in Items for which no match is found are left unchanged.


TParams::Clear

TParams	Methods	See also

Clear deletes all parameter information from the Items property of the TParams object.

Syntax

void __fastcall Clear(void);

Description

Use Clear to empty the Items list. Call Clear before building a parameter list to ensure that the list contains only the desired field parameter objects.


TParams::Count

TParams	Methods	See also

Count returns the number of entries in the Items property of the TParams object.

Syntax

System::Integer __fastcall Count(void);

Description

Use Count to obtain the number of parameter objects managed by this TParams object. Count can be used when iterating through all the field parameters in the Items list.


TParams::CreateParam

TParams	Methods	See also

CreateParam creates a new field parameter object and inserts it into the Items list.

Syntax

TParam *__fastcall CreateParam(Db::TFieldType FldType, const System::AnsiString ParamName, TParamType

Description

Call CreateParam to instantiate a new TParam object and add it to the Items managed by this TParams object. Specify the field type of the new parameter as the value of FldType, specify the name of the parameter as the value of ParamName, and specify the type of parameter as the value of ParamType.


TParams::GetParamList

TParams	Methods	See also

GetParamList fills in a TList object with the individual TParam objects named by ParamNames.

Syntax

void __fastcall GetParamList(Classes::TList *List, const System::AnsiString ParamNames);

Description

Use GetParamList to obtain a subset of the field parameters in the Items list that have been identified by name. ParamNames is a string giving the names of all field parameters of interest. Multiple parameter names are separated by semicolons (;).

GetParamList adds the field parameters to List in the order they appear in ParamNames. If ParamNames includes a name that does not match any of the field parameters in Items, an exception is raised.


TParams::IsEqual

TParams	Methods	See also

IsEqual indicates whether two TParams objects have identical Items.

Syntax

System::Boolean __fastcall IsEqual(TParams *Value);

Description

IsEqual returns true if the Items property of the Value parameter exactly matches the Items property. To match, each Items list must have the same number of field parameters, in the same order, which match on name, datatype, parameter type, and value.


TParams::ParamByName

TParams	Methods	See also

ParamByName locates the parameter with a given name.

Syntax

TParam *__fastcall ParamByName(const System::AnsiString Value);

Description

Use ParamByName method to find a parameter with the name passed in Value. If a match is found, ParamByName returns the parameter. Otherwise, an exception is raised. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate more than one parameter at a time, by name, use the GetParamList method instead. To get only the value of a named parameter, use the ParamValues property.


TParams::RemoveParam

TParams	Methods	See also

RemoveParam removes the specified parameter from the Items property of a TParams object.

Syntax

void __fastcall RemoveParam(TParam *Value);

Description

Use RemoveParam to remove a field parameter from the Items list. RemoveParam will take Value out of the list but does not free it.


TParams::TParams

TParams	Methods	See also

TParams creates a new TParams object.

Syntax

__fastcall virtual TParams(void);

Description

Use TParams to create a new TParams object.


TParams::~TParams

TParams	Methods	See also

~TParams frees the memory associated with the TParams object.

Syntax

__fastcall virtual ~TParams(void);

Description

Do not call ~TParams directly. Instead, use the delete keyword on the object, which causes ~TParams to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TParams example

TParams


TParser

Hierarchy	Properties	Methods

Header

vcl/classes.hpp

Description


TParser properties

TParser	Alphabetically	Legend

In TParser

SourceLine

Token


TParser properties

TParser	By object	Legend

SourceLine

Token


TParser::SourceLine

TParser	Properties

Syntax

__property System::Integer SourceLine;

Description


TParser::Token

TParser	Properties

Syntax

__property System::Char Token;

Description


TParser methods

TParser	Alphabetically

In TParser

~TParser

CheckToken

CheckTokenSymbol

Error

ErrorFmt

ErrorStr

HexToBinary

NextToken

SourcePos

TokenComponentIdent

TokenFloat

TokenInt

TokenString

TokenSymbolIs

TParser

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParser methods

TParser	By object

~TParser

CheckTokenSymbol

CheckToken

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

ErrorFmt

ErrorStr

Error

FieldAddress

FreeInstance

Free

HexToBinary

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NextToken

SourcePos

TokenComponentIdent

TokenFloat

TokenInt

TokenString

TokenSymbolIs

TParser


TParser::CheckToken

TParser	Methods

Syntax

void __fastcall CheckToken(System::Char T);

Description


TParser::CheckTokenSymbol

TParser	Methods

Syntax

void __fastcall CheckTokenSymbol(const System::AnsiString S);

Description


TParser::Error

TParser	Methods

Syntax

void __fastcall Error(System::Integer Ident);

Description


TParser::ErrorFmt

TParser	Methods

Syntax

void __fastcall ErrorFmt(System::Integer Ident, const TVarRec *Args, const System::Integer Args_Size

Description


TParser::ErrorStr

TParser	Methods

Syntax

void __fastcall ErrorStr(const System::AnsiString Message);

Description


TParser::HexToBinary

TParser	Methods

Syntax

void __fastcall HexToBinary(TStream *Stream);

Description


TParser::NextToken

TParser	Methods

Syntax

System::Char __fastcall NextToken(void);

Description


TParser::SourcePos

TParser	Methods

Syntax

System::Longint __fastcall SourcePos(void);

Description


TParser::TokenComponentIdent

TParser	Methods

Syntax

System::AnsiString __fastcall TokenComponentIdent(void);

Description


TParser::TokenFloat

TParser	Methods

Syntax

System::Extended __fastcall TokenFloat(void);

Description


TParser::TokenInt

TParser	Methods

Syntax

System::Longint __fastcall TokenInt(void);

Description


TParser::TokenString

TParser	Methods

Syntax

System::AnsiString __fastcall TokenString(void);

Description


TokenSymbols

Description


TParser::TParser

TParser	Methods	See also

TParser creates a new TParser object.

Syntax

__fastcall TParser(TStream *Stream);

Description

Use TParser to create a new TParser object.


TParser::~TParser

TParser	Methods	See also

~TParser frees the memory associated with the TParser object.

Syntax

__fastcall virtual ~TParser(void);

Description

Do not call ~TParser directly. Instead, use the delete keyword on the object, which causes ~TParser to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TParser example

TParser


TPasswordDialog

Hierarchy	Properties	Methods	Events	See also

TPasswordDialog is a dialog box that allows the user to specify passwords for the current session.

Header

vcl/dbpwdlg.hpp

Description

Use TPasswordDialog to allow the user to specify passwords for the current session. (The current session is represented by a TSession object.) The passwords are used when the application opens a Paradox table that requires a password. If a table requires a password that has not been added to the current session, the user will be prompted for the password.

A TPasswordDialog object is usually created with the PasswordDialog function. However, TPasswordDialog can also be used as a base object for other types of password dialog boxes.


TPasswordDialog properties

TPasswordDialog	Alphabetically	Legend

Derived from TForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

Designer

DropTarget

FormStyle

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

ObjectMenuItem

OleFormObject

Parent

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPasswordDialog properties

TPasswordDialog	By object	Legend

ActiveControl

ActiveMDIChild

ActiveOleControl

Active

Align

AutoScroll

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DropTarget

Enabled

Font

FormStyle

Handle

Height

HelpContext

Hint

HorzScrollBar

Icon

KeyPreview

Left

MDIChildCount

MDIChildren

Menu

ModalResult

Name

ObjectMenuItem

OleFormObject

Owner

Parent

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TileMode

Top

VertScrollBar

Visible

Width

WindowMenu

WindowState


TPasswordDialog events

TPasswordDialog	Alphabetically	Legend

Derived from TForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnResize

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TPasswordDialog events

TPasswordDialog	By object	Legend

OnActivate

OnClick

OnCloseQuery

OnClose

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TPasswordDialog methods

TPasswordDialog	Alphabetically

In TPasswordDialog

~TPasswordDialog

AddButtonClick

EditChange

OKButtonClick

RemoveAllButtonClick

RemoveButtonClick

TPasswordDialog

Derived from TForm

ArrangeIcons

Cascade

Close

CloseQuery

CreateNew

DefocusControl

FocusControl

GetFormImage

Hide

Next

Previous

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

Tile

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPasswordDialog methods

TPasswordDialog	By object

~TPasswordDialog

AddButtonClick

ArrangeIcons

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseQuery

Close

ContainsControl

ControlAtPos

CreateNew

DefaultHandler

DefocusControl

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditChange

EnableAlign

EndDrag

FieldAddress

FindComponent

FocusControl

Focused

FreeInstance

FreeNotification

Free

GetFormImage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

OKButtonClick

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveAllButtonClick

RemoveButtonClick

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocusedControl

SetFocus

SetTextBuf

ShowModal

Show

Tile

TPasswordDialog

UpdateControlState

Update


TPasswordDialog::AddButtonClick

TPasswordDialog	Methods	See also

AddButtonClick controls what happens when the Add button is clicked.

Syntax

void __fastcall AddButtonClick(System::TObject *Sender);

Description

AddButtonClick adds the password in the edit box to the current session by calling the TSession.AddPassword method. Then AddButtonClick clears and sets focus to the edit box.

After the AddButtonClick method is called, the OKButton is enabled, regardless of whether the edit box currently contains a password.


TPasswordDialog::EditChange

TPasswordDialog	Methods	See also

EditChange controls what happens when the contents of the edit box change.

Syntax

void __fastcall EditChange(System::TObject *Sender);

Description

EditChange enables or disables the Add, OK, and Remove buttons according to whether the edit box contains a password. If the edit box contains a password, the buttons are enabled. Otherwise the buttons are disabled.

Note

If the AddButtonClick method has been called, then the OK button is enabled, regardless of whether the edit box contains a password.


TPasswordDialog::OKButtonClick

TPasswordDialog	Methods	See also

OKButtonClick controls what happens when the OK button is clicked.

Syntax

void __fastcall OKButtonClick(System::TObject *Sender);

Description

OKButtonClick adds the password in the edit box to the current session by calling the TSession.AddPassword method.


TPasswordDialog::RemoveAllButtonClick

TPasswordDialog	Methods	See also

RemoveAllButtonClick removes all passwords from the current session.

Syntax

void __fastcall RemoveAllButtonClick(System::TObject *Sender);

Description

RemoveAllButtonClick removes all passwords from the current session by calling the TSession.RemoveAllPasswords method. Then RemoveAllButtonClick sets focus to the edit box.


TPasswordDialog::RemoveButtonClick

TPasswordDialog	Methods	See also

RemoveButtonClick removes the password in the edit box from the current session.

Syntax

void __fastcall RemoveButtonClick(System::TObject *Sender);

Description

RemoveButtonClick removes the password in the edit box from the current session by calling the TSession.RemovePassword method. Then RemoveButtonClick clears and sets focus to the edit box.


TPasswordDialog::TPasswordDialog

TPasswordDialog	Methods	See also

TPasswordDialog creates a new TPasswordDialog object.

Syntax

__fastcall virtual TPasswordDialog(Classes::TComponent *AOwner);

Description

Use TPasswordDialog to create a new TPasswordDialog object.


TPasswordDialog::~TPasswordDialog

TPasswordDialog	Methods	See also

~TPasswordDialog frees the memory associated with the TPasswordDialog object.

Syntax

__fastcall virtual ~TPasswordDialog(void);

Description

Do not call ~TPasswordDialog directly. Instead, use the delete keyword on the object, which causes ~TPasswordDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TForm


TPasswordDialog example

TPasswordDialog


TPen

Hierarchy	Properties	Methods

A TPen object is used to draw lines on a canvas (TCanvas). The TPen object encapsulates the Windows HPEN.

Header

vcl/graphics.hpp

The color of the pen is specified by the Color property. The width in pixels of the line drawn is specified by the Width property. The pattern of the line (solid, dotted, and so on) is specified by the Style property.

The Mode property specifies the color of the line, as it relates to the pixels the line is drawn over. For example, to color the line the color specified by the Color property, set Mode to pmCopy. To color the line the inverse of the screen color, set Mode to pmNot.

If the pen is modified, an OnChange event occurs.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects.


TPen properties

TPen	Alphabetically	Legend

In TPen

Color

Handle

Mode

Style

Width


TPen properties

TPen	By object	Legend

Color

Handle

Mode

Style

Width


TPen::Color

TPen	Properties

Determines the color used to draw on the canvas.

Syntax

__property TColor Color;

These are the possible color values::

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 only: Text color for tooltip controls

clInfoBk 	Windows 95 only: Background color for tooltip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.


TPen::Handle

TPen	Properties

Provides access to the Windows pen object handle, so you can access the pen object.

Syntax

__property System::Integer Handle;

If you need to use a Windows API function that requires the handle of a pen object, you could pass the handle from the Handle property of a TPen object.


TPen::Mode

TPen	Properties

Determines how the pen draws lines on the canvas.

Syntax

__property TPenMode Mode;

Mode	Pixel color

pmBlack	Always black

pmWhite	Always white

pmNop	Unchanged

pmNot	Inverse of screen color

pmCopy	Pen color specified in Color property

pmNotCopy	Inverse of pen color

pmMergePenNot	Combination of pen color and inverse of screen color

pmMaskPenNot	Combination of colors common to both pen and inverse of screen

pmMergeNotPen	Combination of screen color and inverse of pen color

pmMaskNotPen	Combination of colors common to both screen and inverse of pen

pmMerge	Combination of pen color and screen color

pmNotMerge	Inverse of pmMerge combination of pen color and screen color

pmMask	Combination of colors common to both pen and screen

pmNotMask	Inverse of pmMask combination of colors common to both pen and screen

pmXor	Combination of colors in either pen or screen, but not both

pmNotXor	Inverse of pmXor combination of colors in either pen or screen, but not both


TPen::Style

TPen	Properties

Determines the style in which the pen draws lines.

Syntax

__property TPenStyle Style;

These are the possible values of Style:

Style	Meaning

psSolid	A solid line

psDash	A line made up of a serioes of dashes

psDot	A line made up of a series of dots

psDashDot	A line made up of alternating dashes and dots

psDashDotDot	A line made up of a serios of dash-dot-dot combinations

psClear	A line made up of no visible marks

psInsideFram	A line within the frame of a closed shape that specifies a bounding rectangle


TPen::Width

TPen	Properties

Specifies the maximum width of the pen in pixels.

Syntax

__property System::Integer Width;


Events

The following table lists the events of TPen:

Event	Visibility	Documented in

OnChange	public	TGraphicsObject


OnChange


TPen methods

TPen	Alphabetically

In TPen

~TPen

Assign

TPen

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPen methods

TPen	By object

~TPen

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TPen


TPen::Assign

TPen	Methods

[GENERIC]

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Assigns a pen object to another object.

The Assign method assigns one object to another. The general form of a call to Assign is

which tells the Destination object to assign the contents of the Source object to itself.

In general, the statement "Destination = Source" is not the same as the statement "Destination.Assign(Source)". The statement "Destination = Source" makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object references by Source into the object referenced by Destination.

If Destination is a property of some object, however, and that property is not a reference to another object (such as the ActiveControl property of a form, or the DataSource property of a data-aware control), then the statement "Destination = Source" is the same as "Destination.Assign(Source)". Consider these statements:

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at run time only if the objects involved "know" how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at run time.

An object of one type can always be assigned to another object of the same type.


TPen::TPen

TPen	Methods	See also

TPen creates a new TPen object.

Syntax

__fastcall TPen(void);

Description

Use TPen to create a new TPen object.


TPen::~TPen

TPen	Methods	See also

~TPen frees the memory associated with the TPen object.

Syntax

__fastcall virtual ~TPen(void);

Description

Do not call ~TPen directly. Instead, use the delete keyword on the object, which causes ~TPen to be invoked automatically.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TPen example

TPen


TPersistent

Hierarchy	Methods	See also

TPersistent is the ancestor for all objects in Borland C++ Builder that have assignment and streaming capabilites.

Header

vcl/classes.hpp

Description

TPersistent encapsulates the fundamental behavior common to all objects that can be assigned to another object, and that can read and write their properties to and from a stream. For this purpose TPersisent introduces methods that can be overriden to:

•	Define the procedure for loading and storing unpublished data to a stream.

•	Provide the means to assign values to properties.

•	Provide the means to assign the contents of one object to another.

Do not create instances of TPersistent. Use TPersistent as a base class when declaring objects that are not components, but that need streaming or assignment capabilities.


TPersistent methods

TPersistent	Alphabetically	Legend

In TPersistent

~TPersistent

Assign

AssignTo

DefineProperties

TPersistent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPersistent methods

TPersistent	By object	Legend

~TPersistent

AssignTo

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineProperties

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TPersistent


TPersistent::Assign

TPersistent	Methods	See also

Assign copies one object to another by copying the contents of that object to the other.

Syntax

virtual void __fastcall Assign(TPersistent *Source);

Description

Override Assign to copy data from one object to another object of the same type. A small number of Borland C++ Builder classes also support assignment to objects of different types; in all other cases, if two objects are descended from TPersistent but are not of the same type, the call to Assign raises an EConvertError exception.

The standard form of a call to Assign is

which tells the Destination object to copy the contents of the Source object to itself. In general, the statement “Destination = Source” is not the same as the statement “Destination.Assign(Source)”. The statement “Destination = Source” makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object referenced by Source into the different object referenced by Destination.

Note

The types of some properties are also objects. If these properties have write methods that use Assign to set the value of the property, then in these cases the statement "Destination = Source" is the same as "Destination.Assign(Source)".

Conversion can happen in either the Assign method or the AssignTo method. The difference is in who does the work to implement the assignment.

Note also that Source can be NULL.


TPersistent::AssignTo

TPersistent	Methods	See also

AssignTo provides a generic mechanism for assigning the data associated with an object to another object.

Syntax

virtual void __fastcall AssignTo(TPersistent *Dest);

Description

AssignTo is the protected implementation of the public Assign method, By default, the AssignTo method defined by TPersistent raises an EConvertError exception. Descendent classes can define an AssignTo method that copies the contents of an object of its class into another object. AssignTo exists so that knowledge of how to copy data between types does not have to exist in both participants. For example, given the following code in which A and B are instance variables:

if A knows how to handle B, then it does so and returns. If A doesn’t know how to handle B’s type, execution will trickle up to TPersistent.Assign, which will call:

If B doesn’t know about A, then an exception is raised.


TPersistent::DefineProperties

TPersistent	Methods	See also

The DefineProperties method defined by TPersistent does nothing other than provide an interface for a methods that read and write otherwise unpublished data.

Syntax

virtual void __fastcall DefineProperties(TFiler *Filer);

Description

Descendent objects of TPersistent can override DefineProperties to designate a method for storing the object's unpublished data on a stream such as a form file. By default, writing an object to a stream writes the values of all its published properties, and reading the object in reads those values and assigns them to the properties. Objects can also specify methods that read and write data other than published properties by overriding the DefineProperties method.

When overriding DefineProperties, consider including some or all of the following:

•	A call to the inherited method

•	Calls to the filer object's DefineProperty method

•	Calls to the filer object's DefineBinaryProperty method

DefineProperties is virtual, so descendent classes can override it as necessary but are not required to redefine it.


TPersistent::TPersistent

TPersistent	Methods	See also

TPersistent creates a new TPersistent object.

Syntax

__fastcall TPersistent(void);

Description

Use TPersistent to create a new TPersistent object.


TPersistent::~TPersistent

TPersistent	Methods	See also

~TPersistent frees the memory associated with the TPersistent object.

Syntax

__fastcall virtual ~TPersistent(void);

Description

Do not call ~TPersistent directly. Instead, use the delete keyword on the object, which causes ~TPersistent to be invoked automatically.


Scope

Protected


Hierarchy

TObject


TPersistent example

TPersistent


TPopupDataList

Hierarchy	Properties	Methods	Events

Header

vcl/dbctrls.hpp

Description


TPopupDataList properties

TPopupDataList	Alphabetically	Legend

Derived from TDBLookupListBox

BorderStyle

ReadOnly

RowCount

Derived from TDBLookupControl

DataField

DataSource

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPopupDataList properties

TPopupDataList	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

KeyField

KeyValue

Left

ListFieldIndex

ListField

ListSource

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

RowCount

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TPopupDataList events

TPopupDataList	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPopupDataList events

TPopupDataList	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPopupDataList methods

TPopupDataList	Alphabetically

In TPopupDataList

~TPopupDataList

TPopupDataList

Derived from TDBLookupControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPopupDataList methods

TPopupDataList	By object

~TPopupDataList

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TPopupDataList

UpdateControlState

Update


TPopupDataList::TPopupDataList

TPopupDataList	Methods	See also

TPopupDataList creates a new TPopupDataList object.

Syntax

__fastcall virtual TPopupDataList(Classes::TComponent *AOwner);

Description

Use TPopupDataList to create a new TPopupDataList object.


TPopupDataList::~TPopupDataList

TPopupDataList	Methods	See also

~TPopupDataList frees the memory associated with the TPopupDataList object.

Syntax

__fastcall virtual ~TPopupDataList(void);

Description

Do not call ~TPopupDataList directly. Instead, use the delete keyword on the object, which causes ~TPopupDataList to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomContro

TDBLookupControl

TDBLookupListBox


TPopupDataList example

TPopupDataList


TPopupMenu

Hierarchy	Properties	Methods	Events

The TPopupMenu component encapsulates the properties, methods, and events of a pop-up menu, the menu available to forms and controls when the user selects the component and clicks the right mouse button. To make a pop-up menu available, assign a TPopupMenu component to the form’s or control’s PopupMenu property.

Header

vcl/menus.hpp

To begin designing a pop-up menu, add a pop-up menu component to your form, and double-click the component. For more information, see the topic Menu Designer.

The items on the pop-up menu are specified with the Items object, a property of a pop-up menu. The Items object is of type TMenuItem. Your application can use the Items property to access a particular item on the menu.

If you want the pop-up menu to appear when the user clicks the right mouse button on the control to which the pop-up menu is assigned, set the AutoPopup property to true. If you want to use RefSyn to control when a pop-up menu appears, use the Popup method.

Pop-up menus have an OnPopup event handler you can use to specify special processing you want to occur in your application just before a pop-up menu appears.

TPopupMenu is an indirect descendent of TComponent. In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


TPopupMenu properties

TPopupMenu	Alphabetically	Legend

In TPopupMenu

Alignment

AutoPopup

HelpContext

PopupComponent

Derived from TMenu

Handle

Items

WindowHandle

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TPopupMenu properties

TPopupMenu	By object	Legend

Alignment

AutoPopup

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Handle

HelpContext

Items

Name

Owner

PopupComponent

Tag

WindowHandle


TPopupMenu::Alignment

TPopupMenu	Properties

Determines where the pop-up menu appears when the user clicks the right mouse button.

Syntax

__property TPopupAlignment Alignment;

These are the possible values and their meanings:

Value	Meaning

paLeft	The pop-up menu appears with its top left corner under the mouse pointer.

paCenter	The pop-up menu appears with the top center of the menu under the mouse pointer.

paRight	The pop-up menu appears with its top right corner under the mouse pointer.

The default value is paLeft.

Example

This example uses a pop-up menu component and a button on a form. The RefSyn places the top right corner of a pop-up menu under the mouse pointer when the menu appears:

procedure TForm1.AlignPopupMenuClick(Sender: TObject);


TPopupMenu::AutoPopup

TPopupMenu	Properties

Determines if the pop-up menu appears.

Syntax

__property System::Boolean AutoPopup;

The AutoPopup property determines if the pop-up menu appears when the user clicks the right mouse button on the component that has this menu specified as the value of its PopupMenu property. If AutoPopup is true, a right click displays the pop-up menu. If AutoPopup is false, the menu won't appear when the user clicks the right mouse button. The default value is true.

The application key present on keyboards specifically designed for Windows 95 will also show this menu when pressed.

To display a pop-up menu when AutoPopup is false, you must use the Popup method.

Example

The following prevents the pop-up menu from appearing when the user clicks the right mouse button:


TPopupMenu::HelpContext

TPopupMenu	Properties

Generic

Syntax

__property Classes::THelpContext HelpContext;


TPopupMenu::Popup

TPopupMenu	Methods

Reports the component the user clicked to display the pop-up menu.

Syntax

virtual void __fastcall Popup(System::Integer X, System::Integer Y);

The PopupComponent property refers to of the component the user clicked on to display the pop-up menu. If your application has multiple controls that share the same pop-up menu, you can use PopupComponent to determine which of them displayed the menu.

If you activate a pop-up menu by explicitly calling PopupMenu1.Popup, and you want that pop-up menu invocation associated with a particular component, you should assign the component to the pop-up's PopupComponent property before calling Popup.

Example

This example uses two edit boxes, two memos, and one pop-up menu on a form. The pop-up menu contains Cut, Copy, and Paste commands. This RefSyn makes the pop-up menu available to both edit boxes and both memos:

These are the cut, copy, and paste OnClick events for the commands on the pop-up menu. The RefSyn only allows the user to cut and copy text from the edit boxes, and to paste text into the memo boxes.


TPopupMenu events

TPopupMenu	Alphabetically	Legend

In TPopupMenu

OnPopup


TPopupMenu events

TPopupMenu	By object	Legend

OnPopup


TPopupMenu::OnPopup

TPopupMenu	Events

Syntax

__property Classes::TNotifyEvent OnPopup;


TPopupMenu methods

TPopupMenu	Alphabetically

In TPopupMenu

~TPopupMenu

Popup

TPopupMenu

Derived from TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPopupMenu methods

TPopupMenu	By object

~TPopupMenu

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

DispatchCommand

DispatchPopup

Dispatch

FieldAddress

FindComponent

FindItem

FreeInstance

FreeNotification

Free

GetHelpContext

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

MethodAddress

MethodName

NewInstance

Popup

RemoveComponent

TPopupMenu


 Popup

Displays a pop-up menu on screen.

The menu appears at the coordinates indicated by the values (in pixels) of X and Y.

Example

This example uses a pop-up menu. When the user presses the mouse button, the pop-up menu appears near the upper left corner of the form:


TPopupMenu::TPopupMenu

TPopupMenu	Methods	See also

TPopupMenu creates a new TPopupMenu object.

Syntax

__fastcall virtual TPopupMenu(Classes::TComponent *AOwner);

Description

Use TPopupMenu to create a new TPopupMenu object.


TPopupMenu::~TPopupMenu

TPopupMenu	Methods	See also

~TPopupMenu frees the memory associated with the TPopupMenu object.

Syntax

__fastcall virtual ~TPopupMenu(void);

Description

Do not call ~TPopupMenu directly. Instead, use the delete keyword on the object, which causes ~TPopupMenu to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TMenu


TPopupMenu example

TPopupMenu


TProgressBar

Hierarchy	Properties	Methods

A TProgressBar component tracks the progress of a procedure within an application. As the procedure progresses, the rectangular TProgressBar gradually fills from left to right with the system highlight color. The Step property determines how much to increment Position each time it changes.

Header

vcl/comctrls.hpp

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TProgressBar properties

TProgressBar	Alphabetically	Legend

In TProgressBar

Max

Min

Position

Step

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TProgressBar properties

TProgressBar	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Max

Min

Name

Owner

ParentShowHint

Parent

PopupMenu

Position

ShowHint

Showing

Step

TabOrder

TabStop

Tag

Top

Visible

Width


TProgressBar::Max

TProgressBar	Properties

Specifies the upper limit of the range of possible positions on a progress bar.

Syntax

__property TProgressRange Max;


TProgressBar::Min

TProgressBar	Properties

Specifies the lower limit of the range of possible positions on a progress bar.

Syntax

__property TProgressRange Min;


TProgressBar::Position

TProgressBar	Properties

Sets the current position in tracking the progress of an application toward completing an operation.

Syntax

__property TProgressRange Position;

The range of values for Position are between Min and Max.


TProgressBar::Step

TProgressBar	Properties

Specifies the amount that the Position increases with the StepIt method.

Syntax

__property TProgressRange Step;


Events

The following table lists the events for the TProgressBar component.

Event	Visibility	Documented in

OnDragDrop	published	TControl

OnDragOver	published	TControl

OnEndDrag	published	TControl

OnEnter	published	TWinControl

OnExit	published	TWinControl

OnMouseDown	published	TControl

OnMouseMove	published	TControl

OnMouseUp	published	TControl

OnStartDrag	published	TControl


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TProgressBar methods

TProgressBar	Alphabetically

In TProgressBar

~TProgressBar

StepBy

StepIt

TProgressBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TProgressBar methods

TProgressBar	By object

~TProgressBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StepBy

StepIt

TProgressBar

UpdateControlState

Update


TProgressBar::StepBy

TProgressBar	Methods

Modifies the Position of the track bar

Syntax

void __fastcall StepBy(TProgressRange Delta);

Specify the amount you want the Position to change as the value of the Delta parameter.


TProgressBar::StepIt

TProgressBar	Methods

Modifies Position by the amount specified by the Step property.

Syntax

void __fastcall StepIt(void);


TProgressBar::TProgressBar

TProgressBar	Methods	See also

TProgressBar creates a new TProgressBar object.

Syntax

__fastcall virtual TProgressBar(Classes::TComponent *AOwner);

Description

Use TProgressBar to create a new TProgressBar object.


TProgressBar::~TProgressBar

TProgressBar	Methods	See also

~TProgressBar frees the memory associated with the TProgressBar object.

Syntax

__fastcall virtual ~TProgressBar(void);

Description

Do not call ~TProgressBar directly. Instead, use the delete keyword on the object, which causes ~TProgressBar to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TProgressBar example

TProgressBar


TPrintDialog

Hierarchy	Properties	Methods

The TPrintDialog component displays a Print dialog box that permits the user to select which printer to print to, which pages to print, how many copies to print, and if the print job should be collated. If the user chooses the Setup button in the Print dialog box, the Print Setup dialog (TPrinterSetupDialog component) appears.

Header

vcl/dialogs.hpp

Description

Display the Print dialog box by calling the Execute method.

You can customize how the Print dialog box appears and behaves using the Options property. For example, you can determine which print options are enabled or disabled, or you can decide whether the option to print to a file appears.

The range of pages to be printed is specified with the PrintRange property. If the value of PrintRange is prPageNums, which allows users to specify a page range, the pages they specify are the values of the FromPage and ToPage properties. With the MinPage and MaxPage, your application can limit the range of pages the user can select.

If the user chooses to print to a file, the PrintToFile property is true. If the user wants the print job to be collated, the Collate property is true.


TPrintDialog properties

TPrintDialog	Alphabetically	Legend

In TPrintDialog

Collate

Copies

FromPage

MaxPage

MinPage

Options

PrintRange

PrintToFile

ToPage

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TPrintDialog properties

TPrintDialog	By object	Legend

Collate

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Copies

Ctl3D

DesignInfo

FromPage

HelpContext

MaxPage

MinPage

Name

Options

Owner

PrintRange

PrintToFile

Tag

ToPage


TPrintDialog::Collate

TPrintDialog	Properties

Determines if the Collate check box is checked.

Syntax

__property System::Boolean Collate;

Description


TPrintDialog::Copies

TPrintDialog	Properties

Determines the number of copies of the print job to print.

Syntax

__property System::Integer Copies;


TPrintDialog::FromPage

TPrintDialog	Properties

Determines on which page the print job begins.

Syntax

__property System::Integer FromPage;

Description


TPrintDialog::MaxPage

TPrintDialog	Properties

Determines the greatest page number the user can use when specifying pages to print.

Syntax

__property System::Integer MaxPage;

Description

If the user specifies a number greater than the value in MaxPage, a warning message appears and the user must enter a valid number or close the dialog box. The default value is 0.

Note


TPrintDialog::MinPage

TPrintDialog	Properties

Determines the smallest page number the user can use when specifying pages to print.

Syntax

__property System::Integer MinPage;

Description

If the user specifies a number less than the value of MinPage, a warning message appears and the user must enter a valid number or close the dialog box. The default value is 0.

Note


TPrintDialog::Options

TPrintDialog	Properties

[DEFAULT VALUE?]

Syntax

__property TPrintDialogOptions Options;

Determines how a Print dialog box appears and behaves.

Description

These are the possible values that can be included in the Options set for the Print dialog box:

Value	Meaning

poHelp	If true, a Help button appears in the dialog box.

poPageNums	If true, the Pages radio button is enabled and the user can specify a range of pages to print.

poPrintToFile	If true, a Print to File check box appears in the dialog box and reflects the state of the checkbox when the dialog box is dispatched by the user.

poSelection	If true, the Selection radio button is enabled and the user can choose to print selected text.

poWarning	If true and if no printer is installed, a warning message appears when the user chooses OK.

poDisablePrintToFile	If true and poPrintToFile is true, the Print to File check box is dimmed when the dialog box appears. If poPrintToFile is false, setting poDisablePrintToFile to true has no effect because the dialog box won't have a Print to File check box.


TPrintDialog::PrintRange

TPrintDialog	Properties

Determines the type of print range used to print a file.

Syntax

__property TPrintRange PrintRange;

Description

These are the possible settings:

Value	Meaning

prAllPages	If set at run time, the user chose to print all pages of the print job. If you set the PrintRange value to prAllPages at design time, the All Pages radio button is selected when the Print dialog box first appears.

prSelection	If set at run time, the user chose to print only selected text. If you set the PrintRange value to prSelection at design time, the Selection radio button is selected when the Print dialog box first appears.

prPageNums	If set at run time, the user chose to specify a range of pages to print. If you set the PrintRange value to prPageNum at design time, the Pages radio button is selected when the Print dialog box first appears, and the user can specify a print range by page numbers. The page numbers are set through the MinPage and MaxPage properties.

Note


TPrintDialog::PrintToFile

TPrintDialog	Properties

Determines if the has chosen to print the print job to a file rather than to a printer.

Syntax

__property System::Boolean PrintToFile;

Description

If true, the user has checked the Print to File check box. If false, the user has unchecked the Print to File check box. If PrintToFile is set to true at design time, the Print to File check box is checked when the Print dialog box appears in your application.

Note


TPrintDialog::ToPage

TPrintDialog	Properties

Determines on which page the print job ends.

Syntax

__property System::Integer ToPage;

Description


TPrintDialog methods

TPrintDialog	Alphabetically

In TPrintDialog

~TPrintDialog

Execute

TPrintDialog

Derived from TCommonDialog

DestroyComponents

Derived from TComponent

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrintDialog methods

TPrintDialog	By object

~TPrintDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TPrintDialog


TPrintDialog::Execute

TPrintDialog	Methods

Displays the Print dialog box.

Syntax

System::Boolean __fastcall Execute(void);

Description


TPrintDialog::TPrintDialog

TPrintDialog	Methods	See also

TPrintDialog creates a new TPrintDialog object.

Syntax

__fastcall virtual TPrintDialog(Classes::TComponent *AOwner);

Description

Use TPrintDialog to create a new TPrintDialog object.


TPrintDialog::~TPrintDialog

TPrintDialog	Methods	See also

~TPrintDialog frees the memory associated with the TPrintDialog object.

Syntax

__fastcall virtual ~TPrintDialog(void);

Description

Do not call ~TPrintDialog directly. Instead, use the delete keyword on the object, which causes ~TPrintDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TPrintDialog example

TPrintDialog


TPrinter

Hierarchy	Properties	Methods

The TPrinter object encapsulates the printer interface of Windows. Within the Printers unit, the Printer function will create an instance of TPrinter, ready for you to use.

Header

vcl/printers.hpp

To start a print job, call the BeginDoc method. To end a print job that is sent successfully to the printer, call the EndDoc method. If a problem occurs and you need to terminate a print job that was not sent to the printer successfully, call the Abort method.

You can determine if a job is printing by checking the value of the Printing property. If the job aborted, the Aborted property is true.

The printing surface of a page is represented by the Canvas property. You can use the Brush, Font, and Pen properties of the Canvas object to determine how drawing or text appears on the page.

The list of installed printers is found in the Printers property. The value of the PrinterIndex property is the currently selected printer. The list of fonts supported by the current printer is found in the Fonts property.

You can determine if a print job prints in landscape or portrait orientation using the Orientation property.

You height and width of the current page is found in the PageHeight and PageWidth properties. The current page is the value of the PageNumber property.

The Title property determines the text that appears listed in the Print Manager and on network header pages.

Using the PrintScale property of a TForm component, you determine how the printed image of the form appears.

Whenever you use a TPrinter object, you must add Printers to the uses clause of the unit that implements the properties or methods of a TPrinter object.

The TPrinter object is a direct descendent of TObject. In addition to these properties and methods, this object also has the methods that apply to all objects.


TPrinter properties

TPrinter	Alphabetically	Legend

In TPrinter

Aborted

Canvas

Capabilities

Copies

Fonts

Handle

Orientation

PageHeight

PageNumber

PageWidth

PrinterIndex

Printers

Printing

Title


TPrinter properties

TPrinter	By object	Legend

Aborted

Canvas

Capabilities

Copies

Fonts

Handle

Orientation

PageHeight

PageNumber

PageWidth

PrinterIndex

Printers

Printing

Title


TPrinter::Aborted

TPrinter	Properties

Determines if the user aborted the print job, thereby calling the Abort method.

Syntax

__property System::Boolean Aborted;

If Aborted is true, the print job was aborted. If it is false, the user did not abort the print job.If Aborted is true, the print job was aborted. If it is false, the user did not abort the print job.


TPrinter::Canvas

TPrinter	Properties

Represents the surface of the currently printing page.

Syntax

__property Graphics::TCanvas * Canvas;

Note

Some printers do not support graphics. Therefore, the Draw, StretchDraw, or CopyRect methods might fail on these printers.


TPrinter::Capabilities

TPrinter	Properties

Not doct for this object in the doc set

Syntax

__property TPrinterCapabilities Capabilities;


TPrinter::Copies

TPrinter	Properties

Not doct in the current doc set

Syntax

__property System::Integer Copies;


TPrinter::Fonts

TPrinter	Properties

Holds a list of fonts supported by the printer.

Syntax

__property Classes::TStrings * Fonts;

The list contains TrueType fonts even if the printer doesn't support them natively because the Windows Graphics Device Interface (GDI) can draw TrueType fonts accurately when a print job uses them.


TPrinter::Handle

TPrinter	Properties

Provides access to the handle of the printer object.

Syntax

__property System::Integer Handle;


TPrinter::Orientation

TPrinter	Properties

Determines if the print job prints vertically or horizontally on a page.

Syntax

__property TPrinterOrientation Orientation;

These are the possible values:

Table Part 0.1

Value	Meaning

poPortrait	The print job prints vertically on the page.

poLandscape	The print job prints horizontally on the page.


TPrinter::PageHeight

TPrinter	Properties

Contains the height of the currently printing page in pixels.

Syntax

__property System::Integer PageHeight;


TPrinter::PageNumber

TPrinter	Properties

Contains the number of the current page.

Syntax

__property System::Integer PageNumber;

Each time an application calls the NewPage method, NewPage increments the value of PageNumber.


TPrinter::PageWidth

TPrinter	Properties

Contains the value of width of the currently printing page in pixels.

Syntax

__property System::Integer PageWidth;


TPrinter::PrinterIndex

TPrinter	Properties

Specifies which printer listed in the Printers property is the currently selected printer.

Syntax

__property System::Integer PrinterIndex;

To select the default printer, set the value of PrinterIndex to -1.


TPrinter::Printers

TPrinter	Properties

Contains a list of all printers installed in Windows.

Syntax

__property Classes::TStrings * Printers;


TPrinter::Printing

TPrinter	Properties

Determines whether a print job is printing.

Syntax

__property System::Boolean Printing;

Printing is true when your application has called the BeginDoc method, but the EndDoc method (or the Abort method) hasn't been called yet.s


TPrinter::Title

TPrinter	Properties

Determines the text that appears listed in the Print Manager and on network header pages.

Syntax

__property System::AnsiString Title;


TPrinter methods

TPrinter	Alphabetically

In TPrinter

~TPrinter

Abort

BeginDoc

EndDoc

GetPrinter

NewPage

SetPrinter

TPrinter

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrinter methods

TPrinter	By object

~TPrinter

Abort

BeginDoc

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EndDoc

FieldAddress

FreeInstance

Free

GetPrinter

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NewPage

SetPrinter

TPrinter


TPrinter::Abort

TPrinter	Methods

Terminates the printing of a print job, dropping all unprinted data.

Syntax

void __fastcall Abort(void);

The device is then set for the next print job. Use Abort to terminate the print job before it completes; otherwise, use the EndDoc method.

To use the Abort method, you must add the Printers unit to the uses clause of your unit.


TPrinter::BeginDoc

TPrinter	Methods

Sends a print job to the printer.

Syntax

void __fastcall BeginDoc(void);

If the print job is sent successfully, the application should call EndDoc to end the print job. The print job won't actually start printing until EndDoc is called.

To use the BeginDoc method, you must add the Printers unit to the uses clause of your unit.


TPrinter::EndDoc

TPrinter	Methods

Ends the current print job and closes the text file variable.

Syntax

void __fastcall EndDoc(void);

After the application calls EndDoc, the printer begins printing. Use EndDoc after successfully sending a print job to the printer. If the print job isn't successful, use the Abort method.

The Close procedure calls the EndDoc method.


TPrinter::GetPrinter

TPrinter	Methods

Retrieves the current printer.

Syntax

void __fastcall GetPrinter(System::PChar ADevice, System::PChar ADriver, System::PChar APort, System::Integer

You should rarely need to call this method and should instead access the printer you want in the Printers property array. For more information, see the CreateDC function in the Win32 Developer's Reference (WIN32.HLP).


TPrinter::NewPage

TPrinter	Methods

Forces the current print job to begin printing on a new page in the printer.

Syntax

void __fastcall NewPage(void);

It also increments the value of the PageNumber property and resets the value of the Pen property of the Canvas back to (0, 0).


TPrinter::SetPrinter

TPrinter	Methods

Specifies a printer as the current printer.

Syntax

void __fastcall SetPrinter(System::PChar ADevice, System::PChar ADriver, System::PChar APort, System::Integer

You should seldom, if ever, need to call this method, but instead should access the printer you want in the Printers property array. For more information, see the Windows API CreateDC function.


TPrinter::TPrinter

TPrinter	Methods	See also

TPrinter creates a new TPrinter object.

Syntax

__fastcall TPrinter(void);

Description

Use TPrinter to create a new TPrinter object.


TPrinter::~TPrinter

TPrinter	Methods	See also

~TPrinter frees the memory associated with the TPrinter object.

Syntax

__fastcall virtual ~TPrinter(void);

Description

Do not call ~TPrinter directly. Instead, use the delete keyword on the object, which causes ~TPrinter to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TPrinter example

TPrinter


TPropertyNotifySink

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TPropertyNotifySink methods

TPropertyNotifySink	Alphabetically

In TPropertyNotifySink

~TPropertyNotifySink

AddRef

OnChanged

OnRequestEdit

QueryInterface

Release

TPropertyNotifySink

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPropertyNotifySink methods

TPropertyNotifySink	By object

~TPropertyNotifySink

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OnChanged

OnRequestEdit

QueryInterface

Release

TPropertyNotifySink


TPropertyNotifySink::AddRef

TPropertyNotifySink	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TPropertyNotifySink::OnChanged

TPropertyNotifySink	Methods

Syntax

virtual System::Longint __stdcall OnChanged(System::Longint dispid);

Description


TPropertyNotifySink::OnRequestEdit

TPropertyNotifySink	Methods

Syntax

virtual System::Longint __stdcall OnRequestEdit(System::Longint dispid);

Description


TPropertyNotifySink::QueryInterface

TPropertyNotifySink	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TPropertyNotifySink::Release

TPropertyNotifySink	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TPropertyNotifySink::TPropertyNotifySink

TPropertyNotifySink	Methods	See also

TPropertyNotifySink creates a new TPropertyNotifySink object.

Syntax

__fastcall TPropertyNotifySink(TOleControl *Control);

Description

Use TPropertyNotifySink to create a new TPropertyNotifySink object.


TPropertyNotifySink::~TPropertyNotifySink

TPropertyNotifySink	Methods	See also

~TPropertyNotifySink frees the memory associated with the TPropertyNotifySink object.

Syntax

__fastcall virtual ~TPropertyNotifySink(void);

Description

Do not call ~TPropertyNotifySink directly. Instead, use the delete keyword on the object, which causes ~TPropertyNotifySink to be invoked automatically.


Hierarchy

TObject

IUnknown

IPropertyNotifySink


TPropertyNotifySink example

TPropertyNotifySink


TPrinterSetupDialog

Hierarchy	Properties	Methods

The TPrinterSetupDialog component displays a Printer Setup dialog box in your application. Users can use the dialog box to setup their printer before printing a job.

Header

vcl/dialogs.hpp

Description

Display the Printer Setup dialog box by calling the Execute method. The Printer Setup dialog box also appears when the user chooses the Setup button in the Print dialog box (TPrintDialog).


TPrinterSetupDialog properties

TPrinterSetupDialog	Alphabetically	Legend

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TPrinterSetupDialog properties

TPrinterSetupDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

HelpContext

Name

Owner

Tag


TPrinterSetupDialog methods

TPrinterSetupDialog	Alphabetically

In TPrinterSetupDialog

~TPrinterSetupDialog

Execute

TPrinterSetupDialog

Derived from TCommonDialog

DestroyComponents

Derived from TComponent

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrinterSetupDialog methods

TPrinterSetupDialog	By object

~TPrinterSetupDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TPrinterSetupDialog


TPrinterSetupDialog::Execute

TPrinterSetupDialog	Methods

Displays the PrinterSetup dialog box.

Syntax

void __fastcall Execute(void);

Description


TPrinterSetupDialog::TPrinterSetupDialog

TPrinterSetupDialog	Methods	See also

TPrinterSetupDialog creates a new TPrinterSetupDialog object.

Syntax

__fastcall virtual TPrinterSetupDialog(Classes::TComponent *AOwner);

Description

Use TPrinterSetupDialog to create a new TPrinterSetupDialog object.


TPrinterSetupDialog::~TPrinterSetupDialog

TPrinterSetupDialog	Methods	See also

~TPrinterSetupDialog frees the memory associated with the TPrinterSetupDialog object.

Syntax

__fastcall virtual ~TPrinterSetupDialog(void);

Description

Do not call ~TPrinterSetupDialog directly. Instead, use the delete keyword on the object, which causes ~TPrinterSetupDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TPrinterSetupDialog example

TPrinterSetupDialog


TQuery

Hierarchy	Properties	Methods	Events

TQuery component enables Borland C++ Builder applications to issue SQL statements to a database engine--either the BDE or an SQL server. TQuery provides the interface between an SQL server (or the BDE) and TDataSource components. TDataSource components then provide the interface to data-aware controls such as TDBGrid.

Header

vcl/dbtables.hpp

Set the DatabaseName property to specify the database to query. Enter a single SQL statement to execute in the SQL property. To query dBASE or Paradox tables, use local SQL. To query SQL server tables, use passthrough SQL. The SQL statement can be a static SQL statement or a dynamic SQL statement.

At run time, an application can supply parameter values for dynamic queries with the Params property, the ParamByName method, or the DataSource property. Use the Prepare method to optimize a dynamic query. The ParamCheck property determines whether the query fill the Params array.

A result set is the group of records returned by a query to an application. A TQuery can return two kinds of result sets:

“Live” result sets: As with TTable components, users can edit data in the result set with data controls. The changes are sent to the database when a Post occurs, or when the user tabs off a control.

“Read-only” result sets: Users cannot edit data in the result set with data controls.

If you want the query to provide a live result set, the SQL must conform to certain syntax requirements. If the SQL syntax does not conform to these requirements, the query will provide a read-only result set.

Execute the SQL statement at design time by setting the Active property to true . Execute the SQL statement at run time with the Open or ExecSQL methods.

Call the First, Next, Prior, Last, and MoveBy methods to navigate through the result set. Test the BOF and EOF properties to determine if the cursor is at the beginning or end of the result set, respectively. Call the Append, Insert, AppendRecord or InsertRecord methods to add a record to the underlying database table. Call the Delete method to delete the current record. Call the Edit method to allow modification of the fields of the current record, and Post to post the changes or Cancel to discard them.

The OnServerYieldEvent occurs periodically during a query executing on a Sybase server. Setting the parameter AbortQuery to false will cancel the query during execution.

The TQuery component is an indirect descendent of TComponent. In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


TQuery properties

TQuery	Alphabetically	Legend

In TQuery

Constrained

DataSource

Local

ParamCheck

ParamCount

Params

Prepared

RequestLive

RowsAffected

SQL

SQLBinary

StmtHandle

Text

UniDirectional

Derived from TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TDataSet

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

DefaultFields

Designer

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TQuery properties

TQuery	By object	Legend

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Constrained

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

KeySize

Locale

Local

Modified

Name

Owner

ParamCheck

ParamCount

Params

Prepared

RecNo

RecordCount

RecordSize

RequestLive

RowsAffected

SessionName

SQLBinary

SQL

State

StmtHandle

Tag

Text

UniDirectional

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending


TQuery::Constrained

TQuery	Properties

Determines whether updates and insertions that don’t comply with the SELECT statement are allowed.

Syntax

__property System::Boolean Constrained;

For Local SQL only. The Constrained property, if true, prevents the updates and insertions. If Constrained is false, the updates and insertions are permitted.


TQuery::DataSource

TQuery	Properties

[REVISIT THIS DESCRIPTION OF DATASOURCE]

Syntax

__property Db::TDataSource * DataSource;

Set the DataSource property to the name of a TDataSource component in the application to assign values to parameters not bound to values programmatically with Params or ParamByName. If the unbound parameter names match any column names in the specified data source, Borland C++ Builder binds the current values of those fields to the corresponding parameters. This capability enables applications to have linked queries.


TQuery::Local

TQuery	Properties

Specifies whether the table referenced by TQuery is a local dBASE or Paradox table or an SQL server table.

Syntax

__property System::Boolean Local;

If Local is true, then the table is a dBASE or Paradox table. If Local is false, the table is a SQL table.

For remote SQL tables, some operations (such as record counts) may take longer than for local tables, owing to network constraints.


TQuery::ParamCheck

TQuery	Properties

If true, what? If false, what?

Syntax

__property System::Boolean ParamCheck;

Determines whether the query fills the Params array when the SQL property is changed at run time.


TQuery::ParamCount

TQuery	Properties

Specifies how many parameters the query has.

Syntax

__property System::Word ParamCount;

The ParamCount property specifies how many entries the TQuery has in its Params array, that is, how many parameters the query has. Adding a new item to Params will automatically increase the value; removing an item will automatically decrease the value.


TQuery::Params

TQuery	Properties

Contains the parameters of a dynamic SQL statement.

Syntax

__property TParams * Params;

When you enter a query, Borland C++ Builder creates a Params array for the parameters of a dynamic SQL statement. Params is a zero-based array of TParam objects with an element for each parameter in the query; that is, the first parameter is Params[0], the second Params[1], and so on. The number of parameters is specified by ParamCount. Read-only and run-time only.

Note

Use the ParamByName method instead of Params to avoid dependencies on the order of the parameters.


TQuery::Prepared

TQuery	Properties

Specifies if the Prepare method has been called to prepare the query.

Syntax

__property System::Boolean Prepared;

While preparing a query is not required, it is highly recommended in most cases.

Note

Close the query by setting the Active property to false before changing Prepared.


TQuery::RequestLive

TQuery	Properties

Determines whether the query returns a live result set or a read-only result set.

Syntax

__property System::Boolean RequestLive;

By default, a query always returns a read-only result set. Set RequestLive to true to request a live result set. The BDE will then return a live result set if the SELECT syntax of the query conforms to the syntax requirements for a live result set. If RequestLive is true, but the syntax does not conform to the requirements, the BDE returns a read-only result set (for local SQL) or an error return RefSyn (for passthrough SQL). If a query returns a live result set, Borland C++ Builder will set the CanModify property to true.

RequestLive	CanModify	Type of result set

false	false	Read-only result set

true--SELECT syntax meets requirements	true	Live result set

true--SELECT syntax does not meet requirements	false	Read-only result set


TQuery::RowsAffected

TQuery	Properties

Returns the number of rows affected by the last ExecSQL call.

Syntax

__property System::Integer RowsAffected;

RowsAffected is intended to be used with UPDATE and DELETE queries to determine the number of rows updated or deleted.

If the last query never affects rows (such as a transaction operation), the result is -1.


TQuery::SQL

TQuery	Properties

Contains the text of the SQL statement that executes when Opne or ExecSQL is called.

Syntax

__property Classes::TStrings * SQL;

Once a query has been executed by Open, you must call the Close method before you can change the SQL text.

You can create the text for the SQL property:

At design time, by choosing the SQL property in the Object Inspector, and entering the SQL statements in the String List Editor dialog box. With Borland C++ Builder Client/Server, you can also use the Visual Query Builder to construct SQL syntax.

•	At run time, by closing any current query with Close, clearing the SQL property with Clear, and then specifying the SQL text with the Add method.

•	You can also use the LoadFromFile method to assign the text in an SQL script file to the SQL property.

A TQuery component can use SQL to access data from:

•	Paradox or dBASE tables, using local SQL. The allowable syntax is a subset of ANSI-standard SQL and includes basic SELECT, INSERT, UPDATE, and DELETE statements.

•	Databases on the Local InterBase Server, using InterBase SQL. For information on syntax and limitations, see the InterBase Language Reference.

•	Databases on remote database servers (Borland C++ Builder Client/Server only). You must have installed the appropriate SQL Link. Any standard statement in the server's SQL is allowed. For information on SQL syntax and limitations, see your server documentation.

Borland C++ Builder also supports heterogeneous queries against more than one server or table type (for example, data from an Oracle table and a Paradox table). For more information see the Database Application Developers Guide, Chapter 9, "Creating heterogenous queries" .

Note

The SQL property may contain only one complete SQL statement at a time. In general, multiple statements are not allowed. Some servers support multiple statement "batch" syntax; if the server supports this, then such statements are allowed.


TQuery::SQLBinary

TQuery	Properties

[NOT IN CURRENT HELP SYSTEM]

Syntax

__property System::PChar SQLBinary;


TQuery::StmtHandle

TQuery	Properties

Enables an application to make direct calls to the Borland Database Engine (BDE) API using the result of the last query.

Syntax

__property Bde::hDBIStmt StmtHandle;

Under most circumstances you should not need to use this property, unless your application requires some functionality not encapsulated in the VCL.


TQuery::Text

TQuery	Properties

Hold the actual text of the SQL query sent to the Borland Database Engine.

Syntax

__property System::AnsiString Text;

In general, you should not need to examine this property. However, if you encounter problems with an SQL statement, you may want to inspect the Text property to be sure that the statement is as expected.


TQuery::UniDirectional

TQuery	Properties

Determines whether an application can move only forward or can move both back and forward in a query’s result set.

Syntax

__property System::Boolean UniDirectional;

If an application only needs to be able to move forward in the result set of a TQuery component, set the UniDirectional property to true. When UniDirectional is true, an application requires less memory (because the records do not have to be cached), but the application cannot move backwards in the result set.


TQuery events

TQuery	Alphabetically	Legend

Derived from TDataSet

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TQuery events

TQuery	By object	Legend

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


OnCalcFields


OnDeleteError


OnEditError


OnFilterRecord


OnNewRecord


OnPostError


OnServerYield


OnUpdateError


OnUpdateRecord


TQuery methods

TQuery	Alphabetically

In TQuery

~TQuery

ExecSQL

ParamByName

Prepare

TQuery

UnPrepare

Derived from TDBDataSet

CheckOpen

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQuery methods

TQuery	By object

~TQuery

ActiveBuffer

AppendRecord

Append

ApplyUpdates

Assign

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

DefaultHandler

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecSQL

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SetDetailFields

SetFields

TQuery

UnPrepare

UpdateCursorPos

UpdateRecord

UpdateStatus


 ExecuteSQL

Executes the SQL statement contained in the SQL property of the query.

Use the ExecSQL method to execute an SQL statement assigned to the SQL property of a query if the statement does not return a result set. If the SQL statement is an INSERT, UPDATE, DELETE, or any DDL statement, then use this method.

If the SQL statement is a SELECT statement, use Open instead.


TQuery::ParamByName

TQuery	Methods

Locates a parameter by name.

Syntax

TParam *__fastcall ParamByName(const System::AnsiString Value);

The ParamByName method returns the element of the Params property whose Name property matches Value. Use it to assign values to parameters in a dynamic query by name.


TQuery::UnPrepare

TQuery	Methods

Sets the Prepared property to false.

Syntax

void __fastcall UnPrepare(void);

Setting Prepared to false ensures that the SQL property is translated again before the request is submitted to the server. In addition, the server is notified that it can release any resources allocated for optimization purposes, since a new request will be sent before (or in conjunction with) a call to the Open or ExecSQL method.

Preparing a query consumes some database resources, so it is good practice for an application to unprepare a query once it is done using it. The UnPrepare method unprepares a query. When you change the text of a query at run time, Borland C++ Builder automatically closes and unprepares the query.


TQuery::TQuery

TQuery	Methods	See also

TQuery creates a new TQuery object.

Syntax

__fastcall virtual TQuery(Classes::TComponent *AOwner);

Description

Use TQuery to create a new TQuery object.


TQuery::~TQuery

TQuery	Methods	See also

~TQuery frees the memory associated with the TQuery object.

Syntax

__fastcall virtual ~TQuery(void);

Description

Do not call ~TQuery directly. Instead, use the delete keyword on the object, which causes ~TQuery to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TDBDataSet


TQuery example

TQuery


TRadioButton

Hierarchy	Properties	Methods	Events

The TRadioButton component is a Windows radio button. Use radio buttons to present a set of mutually exclusive options to the user—that is, only one radio button in a set can be selected at any time. When the user selects a radio button, the previously selected radio button becomes unselected.

Header

vcl/stdctrls.hpp

Radio buttons are frequently grouped in a group box (TGroupBox). Add the group box to the form first, then choose the radio buttons from the Component palette and put them in the group box.

The text associated with the radio button that identifies its purpose is the value of the Caption property.

When the user selects a radio button, the value of the Checked property changes. Also, the OnClick event occurs. If you check a radio button, all other radio buttons in the same group become unchecked. By default, all radio buttons that are directly contained by the same windowed control container, such as a TForm, TGroupBox, or TPanel, are grouped. For example, two radio buttons on a form can be checked at the time only if they are contained in separate containers, such as two different group boxes.


TRadioButton properties

TRadioButton	Alphabetically	Legend

In TRadioButton

Alignment

Checked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TRadioButton properties

TRadioButton	By object	Legend

Alignment

Align

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TRadioButton::Alignment

TRadioButton	Properties

Determines the alignment of the caption relative to the radio button.

Syntax

__property Classes::TLeftRight Alignment;

For radio buttons, the control's caption is always left-aligned within the text area.

These are the possible values:

Value	Meaning

taLeftJustify	The caption appears to the left of the check box or radio button.

taRightJustify	The caption appears to the right of the check box or radio button.


TRadioButton::Checked

TRadioButton	Properties

Determines whether an option is selected.

Syntax

__property System::Boolean Checked;

These are the possible values:

Component	Value	Meaning

Check box	true	A check mark appears in the check box, indicating the option is selected.

false	No check mark appears, indicating the option is not selected. The value of the Checked property is false if the State of the check box is cbGrayed (the check box is grayed) or cbUnChecked (the check box is unchecked).

Radio button	true	A black circle appears in the radio button, indicating that the option is selected.

false	No black circle appears in the radio button, indicating the option is not selected.

Menu item	true	A check mark appears next to the menu item in the menu, indicating the item is selected.

false	No check mark appears, indicating the item is not selected.


TRadioButton events

TRadioButton	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TRadioButton events

TRadioButton	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnClick


OnDblClick


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TRadioButton methods

TRadioButton	Alphabetically

In TRadioButton

~TRadioButton

TRadioButton

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRadioButton methods

TRadioButton	By object

~TRadioButton

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TRadioButton

UpdateControlState

Update


TRadioButton::TRadioButton

TRadioButton	Methods	See also

TRadioButton creates a new TRadioButton object.

Syntax

__fastcall virtual TRadioButton(Classes::TComponent *AOwner);

Description

Use TRadioButton to create a new TRadioButton object.


TRadioButton::~TRadioButton

TRadioButton	Methods	See also

~TRadioButton frees the memory associated with the TRadioButton object.

Syntax

__fastcall virtual ~TRadioButton(void);

Description

Do not call ~TRadioButton directly. Instead, use the delete keyword on the object, which causes ~TRadioButton to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TRadioButton example

TRadioButton


TRadioGroup

Hierarchy	Properties	Methods	Events	See also

TRadioGroup represents a group of radio buttons that function together.

Header

vcl/extctrls.hpp

Description

A TRadioGroup object is a special group box that contains only radio buttons. Radio buttons that are placed directly in the same control component are said to be “grouped.” When the user checks a radio button, all other radio buttons in its group become unchecked. Hence, two radio buttons on a form can be checked at the same time only if they are placed in separate subcontainers, such as group boxes.

To add radio buttons to a TRadioGroup, edit the Items property in the Object Inspector. Each string in Items makes a radio button appear in the group box with the string as its caption. The value of the ItemIndex property determines which radio button is currently selected.

You can display the radio buttons in a single column or in multiple columns by setting the value of the Columns property.


TRadioGroup properties

TRadioGroup	Alphabetically	Legend

Derived from TCustomRadioGroup

Columns

ItemIndex

Items

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TRadioGroup properties

TRadioGroup	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TRadioGroup events

TRadioGroup	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TRadioGroup events

TRadioGroup	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnStartDrag


TRadioGroup methods

TRadioGroup	Alphabetically	Legend

In TRadioGroup

~TRadioGroup

TRadioGroup

Derived from TCustomRadioGroup

CanModify

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRadioGroup methods

TRadioGroup	By object	Legend

~TRadioGroup

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TRadioGroup

UpdateControlState

Update


TRadioGroup::TRadioGroup

TRadioGroup	Methods	See also

TRadioGroup creates a new TRadioGroup object.

Syntax

__fastcall virtual TRadioGroup(Classes::TComponent *AOwner);

Description

Use TRadioGroup to create a new TRadioGroup object.


TRadioGroup::~TRadioGroup

TRadioGroup	Methods	See also

~TRadioGroup frees the memory associated with the TRadioGroup object.

Syntax

__fastcall virtual ~TRadioGroup(void);

Description

Do not call ~TRadioGroup directly. Instead, use the delete keyword on the object, which causes ~TRadioGroup to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox

TCustomRadioGroup


TRadioGroup example

TRadioGroup


TReader

Hierarchy	Properties	Methods	Events	See also

TReader is a specialized filer object that reads data from an associated stream.

Header

vcl/classes.hpp

Description

TReader is used internally by the VCL streaming system to read data from a stream for the purpose of restoring the state of a component that has been written to a stream. TReader is a helper object for streams that handles the mechanics of reading the data associated with a component from the stream. It is the reader object, rather than the stream object, that is responsible for handling the complexities of streaming components. These include methods for:

•	Creating component instances from class names read from the stream.

•	Assigning stream data to published component properties.

•	Enabling an object to store hidden or complex data as if they were actual properties of the object.

•	Resolving references between components, as in a property that refers to another component.

Other methods and properties of TReader are used for triggering the reader object's events and interacting with the stream.

Users do not directly create reader objects. The constructor for TReader takes a stream as a parameter. Readers are automatically created in stream object methods or in global routines that initiate the streaming process. These include:

•	Calling the global routine ObjectBinaryToText procedure, which directly creates a reader object.

•	Calling thje global ReadComponentResFile function, which creates a file stream object that creates a reader object.

•	Calling TStream.ReadCompoennt, which creates a reader object.

The reader constructor takes a stream as a parameter. This represents the associated stream. Therefore reader objects will always have an associated stream object, and once the streaming process is underway users do not need to directly manipulate reader objects. The interaction between the reader, component, and stream objects happens automatically in methods of these objects that make calls to each other.


TReader properties

TReader	Alphabetically

In TReader

Owner

Parent

Position

Derived from TFiler

Ancestor

IgnoreChildren

Root


TReader properties

TReader	By object

Ancestor

IgnoreChildren

Owner

Parent

Position

Root


TReader::Owner

TReader	Properties	See also

Owner stores the component that is assigned as the Owner property of all components read from the reader object's stream.

Syntax

__property TComponent * Owner;

Description

Owner is used internally by the VCL streaming system to determine which components are streamed. All components owned by the Root component are handled by the streaming process.

Owner is the Owner property of the component being streamed. It is assigned a value from its Reader object. When a reader creates a new component instance, the Component.Owner is assigned the Reader.Owner. If Reader.Owner is NULL, then the Reader.Root is assigned to the Owner property.

For most components, Owner is NULL. For components that can contain components that are not owned by the Root form, such as the pages of a tabbed notebood, the Owner is not the same as the Root. The GetChildOwner method of the component determines the Owner.


TReader::Parent

TReader	Properties	See also

Parent stores the component that will be assigned as the Parent property of all controls read from the reader object's stream.

Syntax

__property TComponent * Parent;

Description

Parent is used internally by the VCL streaming system. The value of the Parent property is determined by the order of the components being read in from the stream. The Parent relationship determines the visual containment scheme of components.


TReader::Position

TReader	Properties	See also

Position represents the current reading position in the associated stream.

Syntax

__property System::Longint Position;

Description

Position is used to track the reader’s position within the stream. The value of Position will always be inside the most recent buffer block read. Thus for reading Position will always be less than the stream's Position.


TReader events

TReader	Alphabetically

In TReader

OnError

OnFindMethod

OnSetName


TReader events

TReader	By object

OnError

OnFindMethod

OnSetName


TReader::OnError

TReader	Events	See also

OnError occurs whenever a reader object encounters an error reading its data, such as reading the name of an undeclared property or an illegal value.

Syntax

__property TReaderError OnError;

Descriptoion

OnError is used internally by the Borland C++ Builder environment to report errors. It can also be used to write an event handler to selectively choose to process or ignore errors.

The last parameter passed to the OnError event handler is a var parameter called Handled. By default, the Error method passes false in Handled, but a handler that corrects the error or chooses to ignore the error can set Handled to true, which prevents further processing of the error. If the event handler returns with Handler still set to false, the reader object raises an EReadError exception.


TReader::OnFindMethod

TReader	Events	See also

OnFindMethod occurs each time the reader object reads an event, which is a method-pointer property, for an object.

Syntax

__property TFindMethodEvent OnFindMethod;

Description

OnFindMethod is used internally by the Borland C++ Builder environment for reading events. It can also be used to write a handler to ask the user how to handle missing methods.

If the reader cannot locate the named method assigned to the method pointer, it sets the Error parameter to the OnFindMethod handler to true. The handler can set Error to false, which prevents FindMethod from raising an exception when the handler returns.


TReader::OnSetName

TReader	Events	See also

OnSetName occurs just before the reader object sets the Name property of a component it reads from its stream.

Syntax

__property TSetNameEvent OnSetName;

Description

OnSetName is used by internally by the Borland C++ Builder environment to handle duplicate names of components and forms. It can also be used to write an event handler to perform special processing just before the Name property is set for the component which has just been created and is about to have its properties read from the stream.

The Name parameter to the OnSetName event handler is a var parameter, so the handler can change the name before the reader assigns it to the component. For example, OnSetName is useful for filtering all the component names in a form, to add or change part of the string.


TReader methods

TReader	Alphabetically	Legend

In TReader

~TReader

BeginReferences

DefineBinaryProperty

DefineProperty

EndOfList

EndReferences

Error

FindMethod

FixupReferences

FlushBuffer

NextValue

Read

ReadBoolean

ReadChar

ReadComponent

ReadComponents

ReadFloat

ReadIdent

ReadInteger

ReadListBegin

ReadListEnd

ReadPrefix

ReadRootComponent

ReadSignature

ReadStr

ReadString

ReadValue

SetName

TReader

Derived from TFiler

ClassInfo

Derived from TObject

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReader methods

TReader	By object	Legend

~TReader

BeginReferences

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineBinaryProperty

DefineProperty

Dispatch

EndOfList

EndReferences

Error

FieldAddress

FindMethod

FixupReferences

FlushBuffer

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NextValue

ReadBoolean

ReadChar

ReadComponents

ReadComponent

ReadFloat

ReadIdent

ReadInteger

ReadListBegin

ReadListEnd

ReadPrefix

ReadRootComponent

ReadSignature

ReadString

ReadStr

Read

ReadValue

SetName

TReader


TReader::BeginReferences

TReader	Methods	See also

BeginReference starts a block of commands that read components that might contain references to other components.

Syntax

void __fastcall BeginReferences(void);

Description

Do not call BeginReferences directly. BeginReferences is used internally in Borland C++ Builder for streaming properties that reference other components.

Following the call to BeginReferences, the reader object creates a list of all the objects read and their names. After all of the interdependent objects are read, FixupReferences is called to resolve the named references from the stream into instance references. Finally, call EndReferences to dispose of the fixup list.

BeginReferences is always used together with FixupReferences and EndReferences in a try..finally block.


TReader::DefineBinaryProperty

TReader	Methods	See also

DefineBinaryProperty defines binary data the reader object reads as if the data were a property.

Syntax

virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, TStreamProc ReadData, TStreamProc

Description

DefineBinaryProperty is called internally by the DefineProperties method of an object that has data it needs to store. Users would call DefineBinaryProperty directly when implementing a component with a large custom data (like a bitmap), in the component’s DefineProperties method. This is the only context in which DefineBinaryProperty (or DefineProperty) should be used.

DefineProperties takes a generic filer object as its parameter. For reading binary data DefineProperties takes a TReader object and calls the TReader or TFiler DefineBinaryProperty method of the reader object. DefineBinaryProperty then reads the property’s name and it’s data and passes the data to the indicated ReadData method.

The Name parameter specifies the name of the “fake” property to be read from the stream. A “fake” property is a property that is not published, and that exists only in the code for the DefineBinaryProperty method. The Top and Left properties of a non-visual component are examples of “fake” properties. These are also called “defined properties” or “custom defined properties.”

The TStreamProc type is the type of the ReadData and WriteData parameters. It is the method-pointer type that points to a procedure (defined in the component object) that reads or writes a binary representation of the object's data directly to or from the stream passed to them in the Stream parameter. For TReader the WriteData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write). For TReader the HasData parameter is ignored.

When writing a component that has special (large) data storage requirements, DefineProperties can be overriden. For each special or “fake” property item, call the Filer.DefineProperty method or Filer.DefineBinaryProperty. For the ReadData and WriteData parameters, pass in methods of the component that know how to handle that special data type. When reading, ReadData will be called. When writing, WriteData will be called.

Defined binary properties are quite rare. VCL objects that store graphics as binary data are the most common use of filer objects to store and retrieve that data. More commonly objects use the DefineProperty method. The difference between DefineBinaryProperty and DefineProperty is that the component reads or writes the binary property directly to or from from a memory stream object, rather than going through a filer object. Binary data is also harder to edit as text.

Note

Streamable objects that are descended from TPersistent inherit a DefineProperties method, however DefineProperties does nothing until TComponent. Therefore, it is component objects DefineProperties method that calls the reader’s DefineBinaryProperty when reading binary data.


TReader::DefineProperty

TReader	Methods	See also

DefineProperty defines data the reader object reads as if the data were a property.

Syntax

virtual void __fastcall DefineProperty(const System::AnsiString Name, TReaderProc ReadData, TWriterProc

Description

DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For reading data DefineProperties takes a TReader object and then it calls the DefineProperties method of the reader object. DefineProperty then reads the property’s name and it’s data.

The Name parameter specifies the name of the “fake” property to be read from the stream.

The TReaderProc type is the type of the ReadData parameter. It is the method-pointer type that points to a procedure (defined in the storing object) that reads the object's data, that represents a property value, to the reader object. For TReader the WriteData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write).For TReader the HasData parameter is ignored.

The difference between DefineBinaryProperty and DefineProperty is that the binary property is read directly from a stream object, rather than going through a filer object, and binary data is harder to edit as text.


TReader::EndOfList

TReader	Methods	See also

EndOfList indicates the end of a group of items that are sequentially read from the stream.

Syntax

System::Boolean __fastcall EndOfList(void);

Description

EndOfList is used by other methods that iterate through a list of items when reading in data. It checks for a value type that signals the end of that type of data. EndOfList returns true if the reader object has read to the end of a list of items.

When reading a list of items, the reader object's ReadListBegin method is called, then the items are repeatedly read until EndOfList returns true. Then ReadListEnd is called.

Note

Component writers can use this in their defined property ReadData methods, as for example, with TStrings.


TReader::EndReferences

TReader	Methods	See also

EndReferences terminates a block of code that reads components from the reader object's stream that might contain references to each other.

Syntax

void __fastcall EndReferences(void);

Description

EndReferences is used for streaming properties that reference another component. Users should not need to call EndReferences directly.

The reader object calls EndReferences and creates a list of all the objects read and their names. After all the interdependent objects are read, FixupReferences is called to resolve the named references from the stream into instance references. Finally, call EndReferences to dispose of the fixup list.

EndReferences is always used in the finally part of a try..finally block that also includes calls to BeginReferences and FixupReferences.


TReader::Error

TReader	Methods	See also

Error is the implementation method for the reader object's OnError event.

Syntax

virtual System::Boolean __fastcall Error(const System::AnsiString Message);

Description

The reader object calls Error whenever it encounters a problem reading a component or a property. By default, Error sets its return value to false, then calls any handler attached to the OnError event, which can change the return value.

Use Error to change the return value that indicates whether to continue error processing. A return value of true indicates that the application should continue to treat the condition as an error. A return value of false indicates that the error condition is either fixed or should be ignored.

Note

This method is virtual only for the design-time environment. Users would not create descendent classes of a TReader object.


TReader::FindMethod

TReader	Methods	See also

FindMethod returns a pointer to a method for a specififed component.

Syntax

virtual System::Pointer __fastcall FindMethod(TComponent *Root, const System::AnsiString MethodName

Description

FindMethod is used by the reader object when it reads a property that is a method pointer (that is, usually an event). After reading the name of the assigned method (the event handler), the reader calls FindMethod to get the address of the method in the root object (the form).

FindMethod returns a pointer to the method, for the component passed in Root, that has the name passed in MethodName. Then it calls the event handler attached to the OnFindMethod event, if any. If FindMethod cannot locate the named method and the OnFindMethod handler does not clear its error flag, FindMethod raises an EReadError exception.

To customize the processing of method pointers read from the reader object, write an event handler for OnFindMethod.


TReader::FixupReferences

TReader	Methods	See also

FixupReferences is used to resolve references when streaming properties that are represented by another component.

Syntax

void __fastcall FixupReferences(void);

Description

FixupReferences is used internally by the streaming sysem to resolve the named references from the stream into instance references. Users would never need to call this method.

The reader object calls BeginReferences and creates a list of all the objects read and their names. After all the interdependent objects are read, FixupReferences is called to resolve the references among various mutually dependent components read from the reader object's stream after all of the objects have been read. Finally, call EndReferences to dispose of the fixup list.

FixupReferences is always used inside a try..finally block between calls to BeginReferences and EndReferences.


TReader::FlushBuffer

TReader	Methods	See also

FlushBuffer synchronizes the reader’s buffer with its stream’s buffer.

Syntax

virtual void __fastcall FlushBuffer(void);

Description

FlushBuffer synchronizes the reader's buffer with the associated stream by setting the stream’s Position to match the reader’s Position.


TReader::NextValue

TReader	Methods	See also

NextValue returns the type of the next item in the reader object's stream without moving the position of the stream.

Syntax

TValueType __fastcall NextValue(void);

Description

NextValue is used internally by reader methods to query the type of the next item in the stream. After identifying the type of the next item, NextValue returns with the stream position still before the value-type indicator.

The TValueType type defines the kinds of values written to and read from filer objects. Borland C++ Builder's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType.


TReader::Read

TReader	Methods	See also

Read is used internally by other methods to handle the reading of data.

Syntax

void __fastcall Read(void *Buf, System::Longint Count);

Description

Do not call read directly. Read is used internally to read data from the stream. Many other writer methods call Read, usually after setting pertinent values or verifying data types.


TReader::ReadChar

TReader	Methods	See also

ReadChar reads a character from the reader object's stream and returns that character value.

Syntax

System::Char __fastcall ReadChar(void);

Description

ReadChar is a helper method used by other reader methods to read a tagged character value at the current reader Position. ReadChar first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString ReadString checks the length. If the length indicates that the value is a char, it calls Read and returns the character. Otherwise a EReadError exception is raised.

Note

If the tagged data is a string with length = 1, it is char compatible. If length > 1, it is an error, however, the rest of the string data must be read to keep the reader in a consistent state. Each action that processes tagged data must leave the reader Position at the start of the next unread tag.


TReader::ReadComponent

TReader	Methods	See also

ReadComponent reads the component specified by Instance from the stream and returns the component.

Syntax

TComponent *__fastcall ReadComponent(TComponent *Component);

Description

ReadComponent is used internally by ReadRootComponent to read each of the components owned by Root. Users would not need to call ReadComponent directly.

ReadComponent handles the loading and initialization process for each component. After loading all the components in the list, ReadComponents calls the Loaded method of each loaded component in the order it read them. ReadComponent manages the complexities of reading the component from the stream through calls to other reader methods and to the component’s methods.


TReader::ReadComponents

TReader	Methods

ReadComponents reads a list of owned components from the reader object's associated stream.

Syntax

void __fastcall ReadComponents(TComponent *AOwner, TComponent *AParent, TReadComponentsProc Proc);

Description

ReadComponents is used internally by the Borland C++ Builder environment for design-time streaming. Do not call ReadComponents directly.

ReadComponents first sets the reader object's Root and Owner properties to the component passed in the AOwner parameter and sets its Parent property to AParent. Next ReadComponents reads components by calling the ReadComponent method, passing each returned component to the method passed in Proc.

Note

ReadComponents is used at design-time for clipboard cut and paste of mulitple components.


TReader::ReadFloat

TReader	Methods	See also

ReadFloat reads a floating-point number from the reader object's stream and returns its value.

Syntax

System::Extended __fastcall ReadFloat(void);

Descrpition

ReadFloat is a helper method used by other reader methods to read a tagged floating-point data value at the current reader Position. ReadFloat first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaExtended ReadFloat calls Read and returns the float value. Otherwise it calls ReadInteger.


TReader::ReadIdent

TReader	Methods	See also

ReadIndent reads an identifier from the reader object's stream and returns the identifier.

Syntax

System::AnsiString __fastcall ReadIdent(void);

Description

ReadIndent is a helper method used by other reader methods to read an identifying type at the current reader Position. ReadIndent first checks the value type (TValueType) by calling the ReadValue method. If the item is:

•	A vaIdent type, ReadIndent calls Read and returns the identifier string value.

•	A vaFalse type, ReadIdent returns the string ‘false.’

•	A vaTrue type, ReadIdent returns the string ‘true.’

•	A vaNil type, ReadIdent returns the string ‘NULL.’

Otherwise if raises a EReadError exception.


TReader::ReadInteger

TReader	Methods	See also

ReadInteger reads an integer-type number from the reader object's stream and returns its value.

Syntax

System::Longint __fastcall ReadInteger(void);

Description

ReadInteger is a helper method used by other reader methods to read a tagged integer value at the current reader Position. ReadInteger first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString or a vaInt8, vaInt16 or vaInt32 type , ReadInteger calls Read and returns the integer value. Otherwise if raises a EReadError exception.


TReader::ReadListBegin

TReader	Methods	See also

ReadListBegin reads a start-of-list marker from the reader object's associated stream.

Syntax

void __fastcall ReadListBegin(void);

Description

ReadListBegin is used by other methods that iterate through a list of items to ensure that the type about to be read is a list. ReadListBegin is also used by component writers in defined property ReadData methods.

If the next item in the stream is not a start-of list marker as written by the WriteListBegin method, ReadListBegin raises an EReadError exception.

A call to ReadListBegin is generally followed by a reading loop that terminates when the EndOfList method returns true, indicating that an end-of-list marker is next on the stream, at which point a call to ReadListEnd is required.


TReader::ReadListEnd

TReader	Methods	See also

ReadListEnd reads an end-of-list marker from the reader object's associated stream.

Syntax

void __fastcall ReadListEnd(void);

Description

ReadListEnd is used by other methods that iterate through a list of items to signal the end of a group of items being read. ReadListEnd is also used by component writers in defined property ReadData methods.

A call to ReadListEnd is generally preceded by a reading loop that terminates when the EndOfList method returns true, indicating that an end-of-list marker is next on the stream.

If the item read is not an end-of-list marker, ReadListEnd raises an EReadError exception. A call to ReadListEnd must correspond to a preceeding call to ReadListBegin.


TReader::ReadPrefix

TReader	Methods	See also

ReadPrefix reads preliminary information concerning form inheritance for a component.

Syntax

void __fastcall ReadPrefix( TFilerFlags *Flags, System::Integer &AChildPos);

Description

ReadPrefix is used internally by the Borland C++ Builder streaming system. It is called automatically by ReadComponent to read two flags to determine whether a component is a component in an inherited form and whether its creation order in the form is important. It also reads the component’s position in the ancestor form's creation order. When a writer object writes a component to its stream, it prefaces the component with these flags.

The TFilerFlags type is the type of the Flags parameter.


TReader::ReadRootComponent

TReader	Methods	See also

ReadRootComponent reads a component and all its owned components from the reader object's stream.

Syntax

TComponent *__fastcall ReadRootComponent(TComponent *Root);

Description

Do not call ReadRootComponent directly. It is used internally by the streaming system. When the reader object is created by its stream in TStream.ReadComponent, it immediately calls the ReadRootComponent method, which initiates the streaming sequence of restoring an object.

ReadRootComponent first calls the ReadSignature method to ensure that it is reading a proper component. ReadRootComponent also handles intializations and fixup references. For example, the component passed in Root becomes the value of the Root property for the reader object.

ReadRootComponent calls the component’s ReadState method, which calls back to TReader.ReadData. TComponent.ReadState is virtual, thus providing an opportunity for the component to prepare itself for being loaded with the new data from the stream.


TReader::ReadSignature

TReader	Methods	See also

ReadSignature reads a Borland C++ Builder filer signature from the reader object's associated stream.

Syntax

void __fastcall ReadSignature(void);

Description

ReadSignature is used by several routines to ensure that the file about to be read is a valid Borland C++ Builder component stream. For example, ReadRootComponent, calls ReadSignature before reading its component from the stream. By checking for the signature before loading objects, the reader object can guard against inadvertantly reading invalid or corrupted data.

The signature is a four-character sequence. For this version of Borland C++ Builder, the signature is 'TPF0'.


TReader::ReadStr

TReader	Methods	See also

ReadStr is used internally by certain Borland C++ Builder components to read a string value.

Syntax

System::AnsiString __fastcall ReadStr(void);

Description

Do not call ReadStr directly. ReadStr is for internal use by certain VCL components.

Caution

Always use ReadString for reading component strings to streams. ReadStr can corrupt data if not used correctly.


TReader::ReadString

TReader	Methods	See also

ReadString reads a tageed string value written by WriteString from the reader object's stream and returns its contents.

Syntax

System::AnsiString __fastcall ReadString(void);

Description

ReadString is a helper method used by other reader methods to read a string at the current reader Position. ReadString first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString or a vaLString type ReadString calls Read and returns the string. Otherwise it raises a EReadError exception.

Caution

Always use ReadString for reading component strings to streams. The similarly-named ReadStr method is for internal use only by certain VCL components.


TReader::ReadValue

TReader	Methods	See also

ReadValue reads the type of the next item on the reader object's stream and returns with the stream positioned after the value-type indicator.

Syntax

TValueType __fastcall ReadValue(void);

Description

ReadValue is used by other reader methods when the subsequent processing depends upon a type check of the data about to be read.

The TValueType type defines the kinds of values written to and read from filer objects. Borland C++ Builder's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType.


TReader::SetName

TReader	Methods	See also

SetName allows a reader object to change the names of components being read from the associated stream before assigning them to the Name properties of the components.

Syntax

virtual void __fastcall SetName(TComponent *Component,  System::AnsiString &Name);

Description

SetName is called by ReadComponent. After reading the name, ReadComponent passes the name read from the stream in the Name parameter to SetName. Name is a var parameter, so SetName can change the string before returning.

SetName also calls any event handler attached to the OnSetName event, passing the name string in a var parameter, so the attached handler can also modify the string.


TValueType

TValueType defines the kinds of values written to and read from filer objects.

Description

TValueType is he type used by the TReader and TWriter filer objects to type- check property values that are read from and written to streams when streaming components and their properties.

Borland C++ Builder's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType. The following table lists the values for TValueType:

Value	Meaning

vaNull	identifies the type as the const variant NULL.

vaList	identifies the type as a list of tagged items ending with null.

vaInt8	identifies the type as a Shortint.

vaInt16	identifies the type as a Smallint.

vaInt32	identifies the type as a Lonint.

vaExtended	identifies the type as a float.

vaString	identifies the type as a short string

vaIdent	identifies the type as a Pascal identifier string.

vaFalse	identifies the type as the Boolean false.

vaTrue	identifies the type as the Boolean true.

vaBinary	identifies the type as a bloack of binary proceeded by a length count.

vaSet	identifies the type as a set.

vaLString	identifies the type as a long string.

vaNil	identifies the type as NULL.

vaCollection	identifies the type as a TCollection.


TReader::TReader

TReader	Methods	See also

TReader creates a new TReader object.

Syntax

__fastcall TReader(TStream *Stream, System::Integer BufSize);

Description

Use TReader to create a new TReader object.


TReader::~TReader

TReader	Methods	See also

~TReader frees the memory associated with the TReader object.

Syntax

__fastcall virtual ~TReader(void);

Description

Do not call ~TReader directly. Instead, use the delete keyword on the object, which causes ~TReader to be invoked automatically.


Scope

Protected


Hierarchy

TObject

TFiler


TReader example

TReader


TRegIniFile

Hierarchy	Properties	Methods

TRegIniFile is a low-level wrapper for the Windows 95/NT system registry that is intended to enable existing Borland C++ Builder applications that used INI files to use the system registry with a minimum of coding changes.

Header

vcl/registry.hpp

Description

TRegIniFile enables handling the Windows 95/NT system registry as if it were a Windows 3.x INI file. Instead of processing an INI file, however, TRegIniFile reads from and writes to the system registry.

TRegIniFile is derived from TRegistry. It inherits all of the properties and methods of TRegistry, and adds to them the same properties and methods used by the TIniFile object. Some of the added methods for TRegIniFile, such as ReadBool and WriteBool, override the methods of TRegistry.

The FileName passed to a TRegIniFile object becomes a subkey under the system registry’s root key (HKEY_CURRENT_USER by default). What corresponds to a section in an INI file is treated as a key in the system registry, and what corresponds to data entries under a section in an INI file are treated as data values under a key in the system registry.

TRegIniFile is particularly useful for migrating a 16-bit Windows 3.x application to Windows 95/NT. By finding all references to TIniFile in an application’s source code, replacing them with TRegIniFile, and recompiling the application, a developer can update an application to use the system registry instead of INI files without having to code any new logic into the application.

Note

Information contained in existing users’ INI files is not migrated into the system registry using the method described above.

Tip

TRegIniFile presents a simple interface to the system registry and hides the need to know about the underlying structure of the registry. Some developers may prefer to use TRegIniFile instead of TRegistry in their applications.


TRegIniFile properties

TRegIniFile	Alphabetically	Legend

In TRegIniFile

FileName

Derived from TRegistry

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegIniFile properties

TRegIniFile	By object	Legend

CurrentKey

CurrentPath

FileName

LazyWrite

RootKey


TRegIniFile::FileName

TRegIniFile	Properties	See also

Contains the name of the key opened or created in the system registry.

Syntax

__fastcall TRegIniFile(const System::AnsiString FileName);

Description

Query FileName to determine the name of the key in the system registry that is the root key for all TRegIniFile operations.


TRegIniFile methods

TRegIniFile	Alphabetically

In TRegIniFile

~TRegIniFile

DeleteKey

EraseSection

ReadBool

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

TRegIniFile

WriteBool

WriteInteger

WriteString

Derived from TRegistry

CloseKey

CreateKey

DeleteValue

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

KeyExists

LoadKey

MoveKey

OpenKey

ReadBinaryData

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

UnLoadKey

ValueExists

WriteBinaryData

WriteCurrency

WriteDate

WriteDateTime

WriteFloat

WriteTime

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRegIniFile methods

TRegIniFile	By object

~TRegIniFile

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseKey

CreateKey

DefaultHandler

DeleteKey

DeleteValue

Dispatch

EraseSection

FieldAddress

FreeInstance

Free

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

InheritsFrom

InitInstance

InstanceSize

KeyExists

LoadKey

MethodAddress

MethodName

MoveKey

NewInstance

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDateTime

ReadDate

ReadFloat

ReadInteger

ReadSections

ReadSection

ReadSectionValues

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

TRegIniFile

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDateTime

WriteDate

WriteFloat

WriteInteger

WriteString

WriteTime


TRegIniFile::DeleteKey

TRegIniFile	Methods	See also

Erases a data value that is associated with a key.

Syntax

void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident);

Description

Call DeleteKey to erase a data value associated with a key. Section is string containing the name of the system registry key containing the value to delete. Ident is a string containing the name of the data value to delete.

Note

DeleteKey for TRegIniFile overrides the DeleteKey method of TRegistry, from which TRegIniFile descends. You can access TRegistry's DeleteKey method by casting the call to DeleteKey as type TRegistry.


TRegIniFile::EraseSection

TRegIniFile	Methods	See also

Deletes a key and its data values in the system registry.

Syntax

void __fastcall EraseSection(const System::AnsiString Section);

Description

Call EraseSection to remove a key and its data values from the system registry. Section identifies the key to delete.


TRegIniFile::ReadBool

TRegIniFile	Methods	See also

Retrieves a Boolean value from a specified data value associated with a key.

Syntax

System::Boolean __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident

Description

Call ReadBool to retrieve a Boolean value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is a Boolean value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note

This function overrides the ReadBool function of TRegistry, from which TRegIniFile is derived. To call the ReadBool function of TRegistry instead of this function, cast the call to ReadBool as TRegistry.


TRegIniFile::ReadInteger

TRegIniFile	Methods	See also

Retrieves an integer value from a specified data value (Ident) associated with a key (Section).

Syntax

System::Longint __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident

Description

Call ReadInteger to retrieve an integer value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is an integer value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note

This function overrides the ReadInteger function of TRegistry, from which TRegIniFile is derived. To call the ReadInteger function of TRegistry instead of this function, cast the call to ReadInteger as TRegistry.


TRegIniFile::ReadSection

TRegIniFile	Methods	See also

Retrieves the names of all data values associated with a key, and stores the names in a TString object.

Syntax

void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings *Strings);

Description

Call ReadSection to retrieve the names of all data values associated with a key into a TString object. Section is a string identifying the key for which to retrieve data-value names.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegIniFile::ReadSections

TRegIniFile	Methods	See also

Retrieves the names of all subkeys associated with the current key.

Syntax

void __fastcall ReadSections(Classes::TStrings *Strings);

Description

Call ReadSections to retrieve the names of all subkeys associated with the current key.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegIniFile::ReadSectionValues

TRegIniFile	Methods	See also

Retrieves the data-values associated with a specified key, and stores the retrieved values in a string object.

Syntax

void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings *Strings);

Description

Call ReadSectionValues to read all data values associated with a specified key into a string object. Section is the name of the key from which to retrieve data-values. Strings specifies the string object to hold the retrieved values.

Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself. Use the Values property of the string object to access a specific string in the object.


TRegIniFile::ReadString

TRegIniFile	Methods	See also

Retrieves a string value from a specified data value (Ident) associated with a key (Section).

Syntax

System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString

Description

Call ReadString to retrieve a string value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is a string value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note

This function overrides the ReadString function of TRegistry, from which TRegIniFile is derived. To call the ReadString function of TRegistry instead of this function, cast the call to ReadString as TRegistry.


TRegIniFile::WriteBool

TRegIniFile	Methods	See also

Writes a Boolean value to a specified data value associated with a specified key.

Syntax

void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident, System::Boolean

Description

Call WriteBool to store a Boolean value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the Boolean value to write into the data value.

Note

This function overrides the WriteBool procedure of TRegistry, from which TRegIniFile is derived. To call the WriteBool procedure of TRegistry instead of this procedure, cast the call to WriteBool as TRegistry.


TRegIniFile::WriteInteger

TRegIniFile	Methods	See also

Writes a long integer value to a specified data value associated with a specified key.

Syntax

void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident, System::Longint

Description

Call WriteInteger to store an integer value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the integer value to write into the data value.

Note

This function overrides the WriteInteger procedure of TRegistry, from which TRegIniFile is derived. To call the WriteInteger procedure of TRegistry instead of this procedure, cast the call to WriteInteger as TRegistry.


TRegIniFile::WriteString

TRegIniFile	Methods	See also

Writes a string value to a specified data value associated with a specified key.

Syntax

void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident, const System::AnsiString

Description

Call WriteString to store a string value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the string value to write into the data value.

Note

This function overrides the WriteString procedure of TRegistry, from which TRegIniFile is derived. To call the WriteString procedure of TRegistry instead of this procedure, cast the call to WriteString as TRegistry.


TRegIniFile::TRegIniFile

TRegIniFile	Methods	See also

TRegIniFile creates a new TRegIniFile object.

Syntax

__fastcall TRegIniFile(const System::AnsiString FileName);

Description

Use TRegIniFile to create a new TRegIniFile object.


TRegIniFile::~TRegIniFile

TRegIniFile	Methods	See also

~TRegIniFile frees the memory associated with the TRegIniFile object.

Syntax

__fastcall virtual ~TRegIniFile(void);

Description

Do not call ~TRegIniFile directly. Instead, use the delete keyword on the object, which causes ~TRegIniFile to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TRegistry


TRegIniFile example

TRegIniFile


TRegistry

Hierarchy	Properties	Methods

The TRegistry object is a low-level wrapper for the Microsoft Windows95/NT system registry and functions that operate on the registry.

Header

vcl/registry.hpp

Description

Use TRegistry to encapsulate access to the Windows 95/NT system registry in an application. The registry is a database that an applications can use to store and retrieve configuration information. Configuration information is stored in a hierarchical tree. Each node in the tree is called a key. Every key can contain subkeys and data values that represent part of the configuration information for an application.

All keys that an application creates, opens, reads, or writes are subkeys of  predefined root keys. By default, a TRegistry object is created with a root key of HKEY_CURRENT_USER.

Only one key is accessible at a time in a TRegistry object. To determine the key that is currently accessible, read the value of the CurrentKey property. TRegistry methods enable an application to open, close, save, move, copy, and delete keys.

One or more data values containing actual configuration information can be stored in a key. TRegistry methods enable an application to query a key to see if it contains data, to read data in a key, and to write data to a key.


TRegistry properties

TRegistry	Alphabetically	Legend

In TRegistry

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegistry properties

TRegistry	By object	Legend

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegistry::CurrentKey

TRegistry	Properties	See also

Reports the registry key that is currently open.

Syntax

__property System::Integer CurrentKey;

Description

Use CurrentKey to determine the registry key that is currently open. All operations performed by TRegistry affect only the current key. To access another key, call the OpenKey method.


TRegistry::CurrentPath

TRegistry	Properties	See also

Returns the registry path associated with the current key.

Syntax

__property System::AnsiString CurrentPath;

Description

Use CurrentPath to determine the registry path of the current key. The system registry is hierarchical, and CurrentPath returns a string that spells out the hierarchy of keys from the root key to the current key, inclusive.

CurrentPath is automatically reset each time a different key becomes the current key.


TRegistry::LazyWrite

TRegistry	Properties	See also

Specifies how keys are written to the registry when calling the CloseKey procedure.

Syntax

__property System::Boolean LazyWrite;

Description

Use LazyWrite to specify how keys are written to the registry. By default, LazyWrite is true when a registry object is first created. When LazyWrite is true, keys are written to the registry when they are closed, but the CloseKey procedure may return before the write operation takes place.

When LazyWrite is false, keys are written to the registry before CloseKey returns. Set LazyWrite to false only when absolutely necessary. Setting LazyWrite to false guarantees that the changes an application makes to keys are written to the registry before further application processing takes place, but it uses more system resources when keys are closed. If LazyWrite is false, and an application is displaying or changing many registry entries, there will be a degradation to application performance.


TRegistry::RootKey

TRegistry	Properties	See also

Specifies the root key for the TRegistry object in an application.

Syntax

__property System::Integer RootKey;

Description

Use RootKey to determine the hierarchy of subkeys an application can access, or to specify the root key for the application.

By default, RootKey is set to HKEY_CURRENT_USER when the registry object is created. To change the root key, specify a valid integer value for the RootKey property.

Note

For some operations, such as LoadKey or RegistryConnect, an application may need to change the default value of RootKey.


TRegistry methods

TRegistry	Alphabetically

In TRegistry

~TRegistry

CloseKey

CreateKey

DeleteKey

DeleteValue

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

KeyExists

LoadKey

MoveKey

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

TRegistry

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRegistry methods

TRegistry	By object

~TRegistry

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseKey

CreateKey

DefaultHandler

DeleteKey

DeleteValue

Dispatch

FieldAddress

FreeInstance

Free

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

InheritsFrom

InitInstance

InstanceSize

KeyExists

LoadKey

MethodAddress

MethodName

MoveKey

NewInstance

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDateTime

ReadDate

ReadFloat

ReadInteger

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

TRegistry

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDateTime

WriteDate

WriteFloat

WriteInteger

WriteString

WriteTime


TRegistry::CloseKey

TRegistry	Methods	See also

Writes the current key to the registry and closes the key.

Syntax

void __fastcall CloseKey(void);

Description

Call CloseKey to write the current key to the registry and close the key. An application should not keep keys open any longer than necessary. Many TRegistry methods routinely call CloseKey after reading from or writing to the registry. Calling CloseKey when there is no current key has no effect.

Note

When an application closes a key, the key is written to the registry. The LazyWrite property determines how the write takes place.


TRegistry::CreateKey

TRegistry	Methods	See also

Creates a new key in the registry.

Syntax

System::Boolean __fastcall CreateKey(const System::AnsiString Key);

Description

Use CreateKey to add a new key to the registry. Key is the name of the key to create. Key can be an absolute or relative name. An absolute key begins with a backslash (\) and is a subkey of the root key. A relative key is a subkey of the current key.

CreateKey returns true if key creation is successful. On error, an exception is raised, and CreateKey returns false. Attempting to create a key that already exists has no effect.

CreateKey creates only non-volatile keys. If you need to create volatile keys on Windows NT, you must call the Windows API directly.

CreateKey creates keys with a security access of KEY_ALL_ACCESS. If you need to create keys with more restricted access, you must call the Windows API directly.

A key created by CreateKey has no values. To set key values, use the WriteCurrency, WriteBinaryData, WriteBool, WriteDate, WriteDateTime, WriteFloat, WriteInteger, WriteString, or WriteTime procedures.


TRegistry::DeleteKey

TRegistry	Methods	See also

Removes a specified key and its associated data from the registry.

Syntax

System::Boolean __fastcall DeleteKey(const System::AnsiString Key);

Description

Call DeleteKey to remove a specified key and its associated data, if any, from the registry. If the key has subkeys, the subkeys and any associated data are also removed.

DeleteKey returns true if key deletion is successful. On error, DeleteKey returns false.


TRegistry::DeleteValue

TRegistry	Methods	See also

Erases a data value that is associated with the current key.

Syntax

System::Boolean __fastcall DeleteValue(const System::AnsiString Name);

Description

Call DeleteValue to remove a specific data value associated with the current key. Name is string containing the name of the value to delete. Keys can contain multiple data values, and every value associated with a key has a unique name.

DeleteValue returns true if the deletion is successful, false if the deletion fails.


TRegistry::GetDataInfo

TRegistry	Methods	See also

Returns information about a specified data value associated with the current key.

Syntax

System::Boolean __fastcall GetDataInfo(const System::AnsiString ValueName, TRegDataInfo &Value);

Description

Call GetDataInfo to get information about a data value associated with the current key. ValueName is a string containing the name of the data value to query. Value is a record of type TRegDataInfo in which information about the data value is returned. If the data value is of type rdString or rdExpandString, the size of the data value includes an extra byte for the terminating null character.

GetDataInfo returns true if data value information is returned. If GetDataInfo fails, it returns false, and the Value record is filled with zeros.

Value is a record of type TRegDataInfo that is declared in an application. Records of type TRegDataInfo contain two fields: a field called RegData, of type TRegDataType, that specifies the data type of the data value; and a field called DataSize that specifies the size, in bytes, of the data value. RegData can have the following values:

Value	Meaning

rdUnknown	Data value type is of no defined value type.

rdString	Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdExpandString	Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger	Data value type is a32-bit number.

rdBinary	Data value type is binary data, in any form.


TRegistry::GetDataSize

TRegistry	Methods	See also

Returns the size, in bytes, of a specified data value associated with the current key.

Syntax

System::Integer __fastcall GetDataSize(const System::AnsiString ValueName);

Description

Call GetDataSize to determine the size, in bytes, of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

On success, GetDataSize returns the size of the data value. On failure, GetDataSize returns -1.

Note

If the data value is a string, GetDataSize returns the size of the data value and one extra byte for the terminating null character.


TRegistry::GetDataType

TRegistry	Methods	See also

Returns the enumerated data type of a specified data value associated with the current key.

Syntax

TRegDataType __fastcall GetDataType(const System::AnsiString ValueName);

Description

Call GetDataType to determine the data type of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

GetDataType returns an enumerated value of type TRegDataType. TRegDataType can be one of the following values

Value	Meaning

rdUnknown	Data value type is of no defined value type.

rdString	Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdExpandString	Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger	Data value type is a32-bit number.

rdBinary	Data value type is binary data, in any form.


TRegistry::GetKeyInfo

TRegistry	Methods	See also

Returns information about the current key.

Syntax

System::Boolean __fastcall GetKeyInfo(TRegKeyInfo &Value);

Description

Call GetKeyInfo to return all information about the current key to an application. Value is a variable declared in an application to store the key information returned by this function. Value must be of type TRegKeyInfo. Information returned by GetKeyInfo about the current key includes:

•	Number of subkeys

•	Longest subkey name length, in characters

•	Number of data values

•	Longest data-value name length

•	Longest data-value length

•	Time of last write to the key

On success GetKeyInfo returns true. On failure it returns false, and the Value record is set to zeroes.


TRegistry::GetKeyNames

TRegistry	Methods	See also

Returns a string list containing the names of all subkeys belonging to the current key.

Syntax

void __fastcall GetKeyNames(Classes::TStrings *Strings);

Description

Call GetKeyNames to determine the names of all subkeys belonging to the current key. Determining the names of subkeys is useful in an application that iterates through a set of keys.

Strings is a variable of type TString into which to return the list of subkey names.


TRegistry::GetValueNames

TRegistry	Methods	See also

Returns a string list containing the names of all data values associated with the current key.

Syntax

void __fastcall GetValueNames(Classes::TStrings *Strings);

Description

Call GetValueNames to determine the names of all data values associated with the current key. Determining the names of data values is useful in an application that iterates through a set of data values for a key.

Strings is a variable of type TString into which to return the list of data value names.


TRegistry::HasSubKeys

TRegistry	Methods	See also

Determines if the current key has subkeys.

Syntax

System::Boolean __fastcall HasSubKeys(void);

Description

Call HasSubKeys to determine if the current key has any subkeys. HasSubKeys returns true if the current key has at least one subkey. Otherwise it returns false.


TRegistry::KeyExists

TRegistry	Methods	See also

Determines if a specified key exists.

Syntax

System::Boolean __fastcall KeyExists(const System::AnsiString Key);

Description

Call KeyExists to determine if a key of a specified name exists. Key is the name of the key for which to search.


TRegistry::LoadKey

TRegistry	Methods	See also

Creates a subkey under the root key and loads registry information from a file into the newly created subkey.

Syntax

System::Boolean __fastcall LoadKey(const System::AnsiString Key, const System::AnsiString FileName)

Description

Call LoadKey to:

1	Create a new subkey under the root key, and

2	Load registry information from a file into the subkey. Registry information can include data values, subkeys, and data values for those subkeys.

LoadKey is intended to simplify creation of a key, its values and subkeys, and the values for those subkeys in a single operation. A key, its subkeys, and all data values the key and its subkeys is called a hive. Rather than creating each key and value separately, an application can read a hive from a file. This is especially useful for applications that users can reconfigure at run time.

Note

Before an application calls LoadKey the RootKey property must be set to HKEY_USERS, HKEY_LOCAL_MACHINE, or to a key returned by a previous call to RegistryConnect.

The Key parameter is the name of the subkey to create. The FileName parameter is the location of the file containing registry information to store in the subkey. The file specified by FileName must be one previously created using the SaveKey function or the RegSaveKey Windows API function. On systems that use a file allocation table (FAT), FileName cannot include an extension.


TRegistry::MoveKey

TRegistry	Methods	See also

Moves an existing key, its subkeys, and data values to a new location using a new key name.

Syntax

void __fastcall MoveKey(const System::AnsiString OldName, const System::AnsiString NewName, System::Boolean

Description

Call MoveKey to copy or move an existing key, its subkeys, and data values to a different location. Copying is recursive. If a key contains subkeys and data values, they too, are copied. When the operation is complete, the new key is closed.

OldName specifies the key to copy or move. NewName specifies a name for the duplicate key to create. If the key specified by NewName does not exist, MoveKey creates it. Delete specifies whether to delete the old key after the copy operation. If Delete is true, the key specified by OldName is deleted after it is copied. Otherwise the old key is closed.


TRegistry::OpenKey

TRegistry	Methods	See also

Opens a specified key.

Syntax

System::Boolean __fastcall OpenKey(const System::AnsiString Key, System::Boolean CanCreate);

Description

Call OpenKey to make a specified key the current key. Key is the name of the key to open. If Key is null, the CurrentKey property is set to the key specified by the RootKey property.

CanCreate specifies whether to create the specified key if it does not exist. If CanCreate is true, the key is created if necessary.

Key is opened or created with the security access value KEY_ALL_ACCESS. OpenKey only creates non-volatile keys, A non-volatile key is stored in the registry and is preserved when the system is restarted.

OpenKey returns true if the key is successfully opened or created


TRegistry::ReadBinaryData

TRegistry	Methods	See also

Retrieves a binary value from a specified data value associated with the current key.

Syntax

System::Integer __fastcall ReadBinaryData(const System::AnsiString Name, void *Buffer, System::Integer

Description

Call ReadBinaryData to read a binary value from a specified data value associated with the current key. Name is the name of the data value to read. Buffer is the application variable into which to read the registry data. Buffer must be large enough to hold all of the data returned. BufSize specifies the size of Buffer.

If successful, ReadBinaryData returns the requested data. On error, an exception is raised, and the value returned by this function should be discarded.

Note

Binary data is typically an Object Pascal record. It might also be an icon or a bitmap although Microsoft recommends against storing graphics objects in the registry for performance reasons.


TRegistry::ReadBool

TRegistry	Methods	See also

Retrieves a Boolean value from a specified data value associated with the current key.

Syntax

System::Boolean __fastcall ReadBool(const System::AnsiString Name);

Description

Call ReadBool to read a Boolean value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadBool returns the requested Boolean value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadCurrency

TRegistry	Methods	See also

Retrieves a currency value from a specified data value associated with the current key.

Syntax

System::Currency __fastcall ReadCurrency(const System::AnsiString Name);

Description

Call ReadCurrency to read a Currency value from a specified data value associated with the current key. Name is the name of the data vale to read.

If successful, ReadCurrency returns a Currency value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadDate

TRegistry	Methods	See also

Retrieves a date value from a specified data value associated with the current key.

Syntax

System::TDateTime __fastcall ReadDate(const System::AnsiString Name);

Description

Call ReadDate to read a date value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadDate returns a Borland C++ Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

On error, an exception is raised, and the value returned by this function should be discarded.

Note

Only use ReadDate to read data values previously stored with the WriteDate procedure.


TRegistry::ReadDateTime

TRegistry	Methods	See also

Retrieves a date and time value from a specified data value associated with the current key.

Syntax

System::TDateTime __fastcall ReadDateTime(const System::AnsiString Name);

Description

Call ReadDateTime to read a datetime value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadDateTime returns a Borland C++ Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since
12/30/1899. The fractional part of a TDateTime value is the time of day.

On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadFloat

TRegistry	Methods	See also

Retrieves a float value from a specified data value associated with the current key.

Syntax

System::Double __fastcall ReadFloat(const System::AnsiString Name);

Description

Call ReadFloat to read a float value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadFloat returns an Object Pascal Double value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadInteger

TRegistry	Methods	See also

Retrieves an integer value from a specified data value associated with the current key.

Syntax

System::Integer __fastcall ReadInteger(const System::AnsiString Name);

Description

Call ReadInteger to read an integer value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadInteger returns an Object Pascal Integer value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadString

TRegistry	Methods	See also

Retrieves a string value from a specified data value associated with the current key.

Syntax

System::AnsiString __fastcall ReadString(const System::AnsiString Name);

Description

Call ReadString to read a string value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadString returns an Object Pascal String value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadTime

TRegistry	Methods	See also

Retrieves a time value from a specified data value associated with the current key.

Syntax

System::TDateTime __fastcall ReadTime(const System::AnsiString Name);

Description

Call ReadTime to read a time value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadTime returns a Borland C++ Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

On error, an exception is raised, and the value returned by this function should be discarded.

Note

Only use ReadTime to read data values previously stored with the WriteTime procedure.


TRegistry::RegistryConnect

TRegistry	Methods	See also

Establishes a connection to a registry on another computer.

Syntax

System::Boolean __fastcall RegistryConnect(const System::AnsiString UNCName);

Description

Call RegistryConnect to establish a connection to a registry on another computer running Windows 95 or Windows NT. UNCName is the name of the remote computer, and must take the following form:

where computername is the name of the remote computer. If UNCName is NULL, the local machine name is used.

Note

Before calling RegistryConnect, an application must set the RootKey property for its registry object to HKEY_USERS or HKEY_LOCAL_MACHINE.

If connection is successful, RegistryConnect sets the RootKey property to the root key of the remote computer and returns true. If unsuccessful, RegistryConnect returns false, and RootKey remains unchanged.


TRegistry::RenameValue

TRegistry	Methods	See also

Changes the name of a data value associated with the current key.

Syntax

void __fastcall RenameValue(const System::AnsiString OldName, const System::AnsiString NewName);

Description

Call RenameValue to change the name of a data value associated with the current key. OldName is a string containing the current name of the data value. NewName is a string containing the replacement name for the data value.

If OldName is the name of an existing data value for the current key, and NewName is not the name of an existing data value for the current key, RenameValue changes the data value name as specified. Otherwise the current name remains unchanged.


TRegistry::ReplaceKey

TRegistry	Methods	See also

Replaces the hive file backing a key and all its subkeys with a hive stored in a different file, so that when the system is next started, the key and subkeys will have the values stored in the new file.

Syntax

System::Boolean __fastcall ReplaceKey(const System::AnsiString Key, const System::AnsiString FileName

Description

Call ReplaceKey to replace the hive file backing a key and all its subkeys with a different hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

FileName indicates the name of the file containing the new key and subkey information. BackUpFileName is the name of a backup file used to store the current key and subkey information before it is overwritten.

ReplaceKey returns true if it is successful.

Note

The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.


TRegistry::RestoreKey

TRegistry	Methods	See also

Reopens the specified key, and overwrites any information contained in this key and its subkeys keys with registry data stored in a hive file.

Syntax

System::Boolean __fastcall RestoreKey(const System::AnsiString Key, const System::AnsiString FileName

Description

Call RestoreKey to open the specified key with a security access value of KEY_ALL_ACCESS and overwrite any information in the key and its subkeys with registry data stored in a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key to open. FileName is the name of the file containing the hive information.

If RestoreKey successfully reads and copies the registry information in FileName to the specified key, the return value of RestoreKey is true and the key is closed.

Note

The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.


TRegistry::SaveKey

TRegistry	Methods	See also

Opens the specified key with the security access value KEY_ALL_ACCESS and saves the specified key and all of its subkeys and values to a hive file.

Syntax

System::Boolean __fastcall SaveKey(const System::AnsiString Key, const System::AnsiString FileName)

Description

Call SaveKey to open a key with a security access value of KEY_ALL_ACCESS, and save the key and its subkeys and data values to a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the key to save. FileName is the file into which to save the key information. It must be the name of a new file that does not already exist. On FAT file systems FileName cannot include an extension.

Files created by SaveKey are passed as parameters to the RestoreKey, ReplaceKey and LoadKey functions.

If SaveKey is successful it returns true and closes the key.


TRegistry::UnLoadKey

TRegistry	Methods	See also

Removes a hive from the registry.

Syntax

System::Boolean __fastcall UnLoadKey(const System::AnsiString Key);

Description

Call UnLoadKey to remove a hive from the registry without modifying its associated hive file, if any. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key at the root of the hive to remove.

If successful, UnLoadKey returns true.

Note

Before calling this function, set RootKey to HKEY_USERS, HKEY_LOCAL_MACHINE, or call RegistryConnect.


TRegistry::ValueExists

TRegistry	Methods	See also

Determines if a specified data value exists for the current key.

Syntax

System::Boolean __fastcall ValueExists(const System::AnsiString Name);

Description

Call ValueExists to determine if a particular key exists in the registry. Calling Value Exists is especially useful before calling other TRegistry methods that operate only on existing keys.

Name is the name of the data value for which to check.

ValueExists returns true if a match if found, false otherwise.


TRegistry::WriteBinaryData

TRegistry	Methods	See also

Stores an Object Pascal record in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteBinaryData(const System::AnsiString Name, void *Buffer, System::Integer BufSize

Description

Call WriteBinaryData to store an Object Pascal record in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteBinary. If Name does not exist, it is created.

Buffer is an Object Pascal record or data buffer containing the data to store in the registry. BufSize indicates the size of Buffer.

Note

Data-value lengths are limited by available memory. Long values (more than 2048 bytes) should be stored as separate files, and those file names should be stored in the registry. Application elements such as icons, bitmaps, and executable files should be stored as separate files rather than as values in the registry.

If WriteBinaryData fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteBool

TRegistry	Methods	See also

Stores a Boolean value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteBool(const System::AnsiString Name, System::Boolean Value);

Description

Call WriteBool to store an Object Pascal Boolean value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteBool. If Name does not exist, it is created.

Value is an Object Pascal Boolean value to store in the registry.

If WriteBool fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteCurrency

TRegistry	Methods	See also

Stores a currency value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteCurrency(const System::AnsiString Name, System::Currency Value);

Description

Call WriteCurrency to store an Object Pascal Currency value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteCurrency. If Name does not exist, it is created.

Value is an Object Pascal Currency value to store in the registry.

If WriteCurrency fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteDate

TRegistry	Methods	See also

Stores a date value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteDate(const System::AnsiString Name, System::TDateTime Value);

Description

Call WriteDate to store an Object Pascal datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteDate. If Name does not exist, it is created.

Value is an Object Pascal datetime value to store in the registry.

If WriteDate fails, an exception is raised, and the value is not written to the registry.

If successful, WriteDate stores a Borland C++ Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry::WriteDateTime

TRegistry	Methods	See also

Stores a datetime value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteDateTime(const System::AnsiString Name, System::TDateTime Value);

Description

Call WriteDateTime to store an Object Pascal datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteDateTime. If Name does not exist, it is created.

Value is an Object Pascal datetime value to store in the registry.

If WriteDateTime fails, an exception is raised, and the value is not written to the registry.

If successful, WriteDateTime stores a Borland C++ Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since
12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry::WriteFloat

TRegistry	Methods	See also

Stores a Double value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteFloat(const System::AnsiString Name, System::Double Value);

Description

Call WriteFloat to store an Object Pascal float value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteFloat. If Name does not exist, it is created.

Value is an Object Pascal float value to store in the registry.

If WriteFloat fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteInteger

TRegistry	Methods	See also

Stores an integer value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteInteger(const System::AnsiString Name, System::Integer Value);

Description

Call WriteInteger to store an Object Pascal integer value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteInteger. If Name does not exist, it is created.

Value is an Object Pascal integer value to store in the registry.

If WriteInteger fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteString

TRegistry	Methods	See also

Stores an integer value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteString(const System::AnsiString Name, const System::AnsiString Value);

Description

Call WriteString to store an Object Pascal string value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteString. If Name does not exist, it is created.

Value is an Object Pascal string value to store in the registry.

If WriteString fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteTime

TRegistry	Methods	See also

Stores a time value in a specifically named data value associated with the current key.

Syntax

void __fastcall WriteTime(const System::AnsiString Name, System::TDateTime Value);

Description

Call WriteTime to store an Object Pascal datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteTime. If Name does not exist, it is created.

Value is an Object Pascal datetime value to store in the registry.

If WriteTime fails, an exception is raised, and the value is not written to the registry.

If successful, WriteTime stores a Borland C++ Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry::TRegistry

TRegistry	Methods	See also

TRegistry creates a new TRegistry object.

Syntax

__fastcall TRegistry(void);

Description

Use TRegistry to create a new TRegistry object.


TRegistry::~TRegistry

TRegistry	Methods	See also

~TRegistry frees the memory associated with the TRegistry object.

Syntax

__fastcall virtual ~TRegistry(void);

Description

Do not call ~TRegistry directly. Instead, use the delete keyword on the object, which causes ~TRegistry to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TRegistry example

TRegistry


TRegistryClass

Hierarchy	Methods

Header

vcl/oleauto.hpp

Description


TRegistryClass methods

TRegistryClass	Alphabetically

In TRegistryClass

~TRegistryClass

TRegistryClass

UpdateRegistry

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRegistryClass methods

TRegistryClass	By object

~TRegistryClass

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TRegistryClass

UpdateRegistry


TRegistryClass::UpdateRegistry

TRegistryClass	Methods

Syntax

void __fastcall UpdateRegistry(System::Boolean Register);

Description


TRegistryClass::TRegistryClass

TRegistryClass	Methods	See also

TRegistryClass creates a new TRegistryClass object.

Syntax

__fastcall TRegistryClass(const TAutoClassInfo &AutoClassInfo);

Description

Use TRegistryClass to create a new TRegistryClass object.


TRegistryClass::~TRegistryClass

TRegistryClass	Methods	See also

~TRegistryClass frees the memory associated with the TRegistryClass object.

Syntax

__fastcall virtual ~TRegistryClass(void);

Description

Do not call ~TRegistryClass directly. Instead, use the delete keyword on the object, which causes ~TRegistryClass to be invoked automatically.


Hierarchy

TObject


TRegistryClass example

TRegistryClass


TReplaceDialog

Hierarchy	Properties	Methods	Events

Header

vcl/dialogs.hpp

Description


TReplaceDialog properties

TReplaceDialog	Alphabetically	Legend

Derived from TFindDialog

FindText

Handle

Left

Options

Position

ReplaceText

Top

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TReplaceDialog properties

TReplaceDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

FindText

Handle

HelpContext

Left

Name

Options

Owner

Position

ReplaceText

Tag

Top


TReplaceDialog events

TReplaceDialog	Alphabetically	Legend

In TReplaceDialog

OnReplace

Derived from TFindDialog

OnFind


TReplaceDialog events

TReplaceDialog	By object	Legend

OnFind

OnReplace


TReplaceDialog::OnReplace

TReplaceDialog	Events

Syntax

__property Classes::TNotifyEvent OnReplace;

Description


TReplaceDialog methods

TReplaceDialog	Alphabetically

In TReplaceDialog

~TReplaceDialog

TReplaceDialog

Derived from TFindDialog

CloseDialog

Execute

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReplaceDialog methods

TReplaceDialog	By object

~TReplaceDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDialog

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TReplaceDialog


TReplaceDialog::TReplaceDialog

TReplaceDialog	Methods	See also

TReplaceDialog creates a new TReplaceDialog object.

Syntax

__fastcall virtual TReplaceDialog(Classes::TComponent *AOwner);

Description

Use TReplaceDialog to create a new TReplaceDialog object.


TReplaceDialog::~TReplaceDialog

TReplaceDialog	Methods	See also

~TReplaceDialog frees the memory associated with the TReplaceDialog object.

Syntax

__fastcall virtual ~TReplaceDialog(void);

Description

Do not call ~TReplaceDialog directly. Instead, use the delete keyword on the object, which causes ~TReplaceDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TFindDialog


TReplaceDialog example

TReplaceDialog


TReport

Hierarchy	Properties	Methods

The TReport component is an interface to Borland’s ReportSmith application. Once you place the TReport component on a form, you can double-click it to begin running ReportSmith. If you specify an existing report name using the Object Inspector, choose Cancel when the Open Report dialog box appears and ReportSmith minimizes. When you click the ReportSmith icon to restore it, the specified report displays.

Header

vcl/report.hpp

You can also control the running of ReportSmith at run time. Specify the report you want to run as the value of the ReportName property. You can include the path where the report is located as part of the ReportName property, or you can specify the directory with the ReportDir property. Call the Run method to run the report. To print an existing report, call the Print method.

The report component lets you specify several report parameters. You can choose the starting and ending page of the report with the StartPage and EndPage properties. To limit the size of the report, you can specify a maximum number of records for the report with the MaxRecords property. Choose how many copies of the report you want with the PrintCopies property.

Specify the report variables you want the report to use with the InitialValues property. You can change a report variable with the SetVariable and SetVariableLines methods, and then recalculate the report and run it using the new report variable by calling the RecalcReport method.

You can run a ReportBasic macro using the RunMacro method.

To terminate the running of a report, call the CloseReport method. You can choose to automatically unload ReportSmith when a report finishes running if you set the AutoUnload property to true. If AutoUnload is false, you must call the CloseApplication method to unload ReportSmith.

For information about using ReportSmith, see the ReportSmith documentation.

The TReport component is a direct descendent of TComponent. In addition to the following properties and methods, this component also has the properties and methods that apply to all components.


TReport properties

TReport	Alphabetically	Legend

In TReport

AutoUnload

Busy

EndPage

InitialValues

LaunchType

MaxRecords

Preview

PrintCopies

ReportDir

ReportHandle

ReportName

StartPage

VersionMajor

VersionMinor

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TReport properties

TReport	By object	Legend

AutoUnload

Busy

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

EndPage

InitialValues

LaunchType

MaxRecords

Name

Owner

Preview

PrintCopies

ReportDir

ReportHandle

ReportName

StartPage

Tag

VersionMajor

VersionMinor


TReport::AutoUnload

TReport	Properties

Determines whether ReportSmith unloads from memory when you have finished running a report.

Syntax

__property System::Boolean AutoUnload;

If AutoUnload is true, ReportSmith unloads as soon as the report is finished running.

If AutoUnload is false, ReportSmith remains in memory. For example, you can create an application that includes a menu item that runs a report. After the report runs, you want ReportSmith to stay in memory so the report can be quickly rerun again. To remove ReportSmith from memory when AutoUnload is false, you must then call the CloseApplication method.

Example

The following RefSyn sets AutoUnload to false, so that Report1 can be run twice using two different variables. After the second run, ReportSmith is unloaded by a call to CloseApplication.


TReport::Busy

TReport	Properties

Indiates if ReportSmith is read to perform an operation.

Syntax

__property System::Boolean Busy;

If Busy is true, then ReportSmith is busy performing some task.  If Busy is false, then ReportSmith can execute another command.

Note

Communication with ReportSmith is possible even while a task is being performed.


TReport::EndPage

TReport	Properties

Specifies the last page of the report that is printed.

Syntax

__property System::Word EndPage;

If the report is fewer than 9999 pages and you don't change the value of EndPage, your entire report is printed.

Example

The following RefSyn prints only the first page of Report1.


TReport::InitialValues

TReport	Properties

A list of report variables strings the report uses to run.

Syntax

__property Classes::TStrings * InitialValues;

By specifying these initial values, your application can bypass the dialog boxes that prompt you for these values when the report runs.

Example

The following RefSyn adds two report variable values and runs the report.


TReport::LaunchType

TReport	Properties

Specifies whether ReportSmith is to be opened in run-time mode or design mode when the Run method is called.

Syntax

__property TLaunchType LaunchType;

When LauchType is set to ltRunTime or ltDefault, Run starts the runtime version of ReportSmith to print or preview a report. When LaunchType is set to ltDesignTime, Run opens ReportsSmith for modifying and creating reports.

The following table contains a list of possible values of the LauchType property.

Value	Meaning

ltDefault	Launch ReportSmith Runtime for printing and previewing reports.

ltRunTime	Launch ReportSmith Runtime for printing and previewing reports.

ltDesignTime	Launch ReportSmith to modify or create a report.

Example


TReport::MaxRecords

TReport	Properties

Specifies the number of database records you want to use to create the report.

Syntax

__property System::Word MaxRecords;

For example, if you just want to see a sample report and your database contains 50,000 records, you can specify a MaxRecords value that limits the number of records in the report to a much smaller number.

Example

The following RefSyn sets the maximum number of records to be used by Report1 to 3.


TReport::Preview

TReport	Properties

Determines whether a report is viewed onscreen or printed.

Syntax

__property System::Boolean Preview;

If Preview is true, the report appears onscreen when the report is run. If Preview is false, the report is printed.

Example

This example uses a report component and a button on a form. When the user clicks the button, a message appears if the Preview property is true. If Preview is true, the MyReport report is sent to the screen; if Preview is false, the report prints on the printer.


TReport::PrintCopies

TReport	Properties

Determines how many copies of the report are printed.

Syntax

__property System::Word PrintCopies;

Specify the number of copies you want printed when your report runs. The default value is 1.

Example

The following RefSyn reads the number of copies to print from an edit box.


TReport::ReportDir

TReport	Properties

The directory where ReportSmith stores its reports and expects to find saved reports.

Syntax

__property System::AnsiString ReportDir;

By specifying a report directory, you won't have to include a path when specifying a report name.


TReport::ReportHandle

TReport	Properties

A Windows handle to ReportSmith.

Syntax

__property System::Integer ReportHandle;

Example

The following RefSyn retrieves the window placement information for ReportSmith, assuming Report1 is a valid TReport component.


TReport::ReportName

TReport	Properties

Determines which report runs.

Syntax

__property System::AnsiString ReportName;

You can include a full path name as part of the report name if you have not specified a ReportDir property value or want to run a report that is stored elsewhere. If you have specified a ReportDir value, omit the path name and simply specify the name of the report.

Example

The following RefSyn lets users use the Open dialog box component to specify the report they want to run.


TReport::StartPage

TReport	Properties

Determines which page the report starts printing from.

Syntax

__property System::Word StartPage;

The default value is 1, indicating the first page. You can change that value to begin printing the report on some other page.

Example

The following RefSyn determines the page on which to start printing the report from an edit box.


TReport::VersionMajor

TReport	Properties

Identifies which major version of ReportSmith is running.

Syntax

__property System::Integer VersionMajor;

For example, if you are using ReportSmith 3.0, the value of VersionMajor is 3. The minor version value is reported in the VersionMinor property.


TReport::VersionMinor

TReport	Properties

Identifies which minor version of ReportSmith is running.

Syntax

__property System::Integer VersionMinor;

For example, if you are using ReportSmith 3.0, the value of VersionMinor is 0. The major version value is reported in the VersionMajor property.


TReport methods

TReport	Alphabetically

In TReport

~TReport

CloseApplication

CloseReport

Connect

Print

RecalcReport

Run

RunMacro

SetVariable

SetVariableLines

TReport

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReport methods

TReport	By object

~TReport

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseApplication

CloseReport

Connect

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Print

RecalcReport

RemoveComponent

RunMacro

Run

SetVariableLines

SetVariable

TReport


TReport::CloseApplication

TReport	Methods

Stops ReportSmith if it is running.

Syntax

System::Integer __fastcall CloseApplication(System::Boolean ShowDialogs);

CloseApplication attempts to terminate ReportSmith and looks for confirmation from ReportSmith in return. If CloseApplication returns true, ReportSmith terminated successfully; if it returns false, ReportSmith was not able to close at the current time.

The value of the ShowDialogs parameter determines whether ReportSmith displays dialog boxes prompting users to save the existing report before closing, and so on. If ShowDialogs is true, the dialog boxes appear before ReportSmith closes. If the parameter is false, no dialog boxes appear.


TReport::CloseReport

TReport	Methods

Determines whether the running of a report terminates.

Syntax

System::Integer __fastcall CloseReport(System::Boolean ShowDialogs);

CloseReport tells ReportSmith to terminate the report and then waits for confirmation in return. If CloseReport returns true, ReportSmith received the message to terminate the report. If CloseReport returns false, ReportSmith could not terminate the report at the current time.

The ShowDialogs parameter determines whether dialog boxes that prompt the user about saving the report appear before the report closes, and so on. If ShowDialogs is true, the dialog boxes appear. If it is false, the dialog boxes are not shown.

Example

The following RefSyn terminates the running report if the user chooses Yes from a dialog box:


TReport::Connect

TReport	Methods

Connects the report to a database, bypassing the ReportSmith log-in dialog box.

Syntax

System::Integer __fastcall Connect(System::Word ServerType, const System::AnsiString ServerName, const System::AnsiString

Specify the server type and name with the ServerType and ServerName parameters. Specify the user name, the log-in password, and the name of the database using the UserName, Password, and DatabaseName parameters.


TReport::Print

TReport	Methods

Determines whether a report prints.

Syntax

System::Integer __fastcall Print(void);

Print sends a DDE message to ReportSmith Runtime and looks for a DDE message from ReportSmith Runtime in return. If Print returns true, ReportSmith Runtime received the message to print the report. If Print returns false, ReportSmith Runtime could not receive the DDE message at the current time.


TReport::RecalcReport

TReport	Methods

Recalculates and reprints the report.

Syntax

System::Integer __fastcall RecalcReport(void);

The RecalcReport method recalculates and reprints the report with the new value for the report variable previously changed with the SetVariable method.

RecalcReport sends a message to ReportSmith and looks for confirmation in return. If RecalcReport returns true, the message to recalculate the report was sent successfully to ReportSmith. If it returns false, ReportSmith could not recalculate the report at the current time.

For more information about report variables, see your ReportSmith documentation.

Example

The following RefSyn sets the 'FirstName' report variable to 'Marty', then recalculates the report.


TReport::Run

TReport	Methods

Loads ReportSmith Runtime and runs and prints the report.

Syntax

System::Integer __fastcall Run(void);

Example

The following RefSyn allows the user to specify the report with the Open dialog box and then runs the report.


TReport::RunMacro

TReport	Methods

Runs a ReportBasic macro

Syntax

System::Integer __fastcall RunMacro(const System::AnsiString Macro);

Specify the macro to run as the value of the Macro parameter.

The RunMacro method sends a DDE message to ReportSmith Runtime to run the specified macro and looks for a DDE message from ReportSmith Runtime in return. If RunMacro returns true, the message to run the macro was sent successfully to ReportSmith Runtime. If it returns false, ReportSmith Runtime could not receive the DDE message at the current time.

For information about ReportBasic macros, refer to your ReportSmith documentation.

Example

The following RefSyn runs the macro "SELALL.MAC".


TReport::SetVariable

TReport	Methods

Changes the value of a report variable.

Syntax

System::Integer __fastcall SetVariable(const System::AnsiString Name, const System::AnsiString Value

The Name parameter specifies which report variable changes, and the Value parameter specifies the new value. Once the SetVariable method has been called, your application can call the RecalcReport method, which recalculates the report using the new value for the specified report variable.

The SetVariable method sends a message to ReportSmith to change the specified report variable with the new value, and looks for confirmation from ReportSmith in return. If SetVariable returns true, the message was sent to ReportSmith successfully. If it returns false, ReportSmith could not receive the message or set the variable at the current time.

To learn more about report variables, see your ReportSmith documentation.

Note

Before calling SetVariable, you must load a report by specifying the ReportName property.

Example

The following RefSyn attempts to set the 'LastName' report variable to 'Schaeferle'. If successful, it then recalculates the report.


SerVariableLines

Changes the value of a report variable.

The Name parameter specifies which report variable changes, and the Value parameter specifies the new value, which is a list of strings. Once the SetVariableLines method has been called, your application can call the RecalcReport method, which recalculates the report using the new value for the specified report variable.

The SetVariableLines method sends a message to ReportSmith to change the specified report variable with the new value, and looks for confirmation from ReportSmith in return. If SetVariableLines returns true, the message was sent to ReportSmith successfully. If it returns false, ReportSmith could not receive the message or set the variable at the current time.

To learn more about report variables, see your ReportSmith documentation.

Note

Before calling SetVariable, you must load a report by specifying the ReportName property.


TReport::TReport

TReport	Methods	See also

TReport creates a new TReport object.

Syntax

__fastcall virtual TReport(Classes::TComponent *AOwner);

Description

Use TReport to create a new TReport object.


TReport::~TReport

TReport	Methods	See also

~TReport frees the memory associated with the TReport object.

Syntax

__fastcall virtual ~TReport(void);

Description

Do not call ~TReport directly. Instead, use the delete keyword on the object, which causes ~TReport to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TReport example

TReport


TRichEdit

Hierarchy	Properties	Methods	Events	See also

TRichEdit is a wrapper for a Windows rich text edit control.

Header

vcl/comctrls.hpp

Description

Use a TRichEdit component to put a standard Windows rich text edit control on your form. Rich text edit controls allow the user to enter text that includes variation in font attributes and paragraph formatting information.

TRichEdit implements the generic behavior introduced in TCustomRichEdit. TRichEdit publishes many of the properties inherited from TCustomRichEdit, but does not introduce any new behavior.


TRichEdit properties

TRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

DefAttributes

DefaultConverter

HideScrollBars

HideSelection

Lines

PageRect

Paragraph

PlainText

SelAttributes

Derived from TCustomMemo

Alignment

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

MaxLength

Modified

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TRichEdit properties

TRichEdit	By object	Legend

Alignment

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefAttributes

DefaultConverter

DesignInfo

DragMode

Enabled

Font

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

Left

Lines

MaxLength

Modified

Name

Owner

PageRect

Paragraph

ParentColor

ParentCtl3D

ParentFont

Parent

PlainText

PopupMenu

ReadOnly

ScrollBars

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantReturns

WantTabs

Width

WordWrap


TRichEdit events

TRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TRichEdit events

TRichEdit	By object	Legend

OnChange

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

OnStartDrag


TRichEdit methods

TRichEdit	Alphabetically

In TRichEdit

~TRichEdit

TRichEdit

Derived from TCustomRichEdit

FindText

Print

RegisterConversionFormat

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRichEdit methods

TRichEdit	By object

~TRichEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindText

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TRichEdit

UpdateControlState

Update


TRichEdit::TRichEdit

TRichEdit	Methods	See also

TRichEdit creates a new TRichEdit object.

Syntax

__fastcall virtual TRichEdit(Classes::TComponent *AOwner);

Description

Use TRichEdit to create a new TRichEdit object.


TRichEdit::~TRichEdit

TRichEdit	Methods	See also

~TRichEdit frees the memory associated with the TRichEdit object.

Syntax

__fastcall virtual ~TRichEdit(void);

Description

Do not call ~TRichEdit directly. Instead, use the delete keyword on the object, which causes ~TRichEdit to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo

TCustomRichEdit


TRichEdit example

TRichEdit


TReportDirProperty

Hierarchy	Properties	Methods

Header

vcl/report.hpp

Description


TReportDirProperty properties

TReportDirProperty	Alphabetically	Legend

Derived from TPropertyEditor

Designer

PrivateDirectory

PropCount

Value


TReportDirProperty properties

TReportDirProperty	By object	Legend

Designer

PrivateDirectory

PropCount

Value


TReportDirProperty methods

TReportDirProperty	Alphabetically

In TReportDirProperty

~TReportDirProperty

Edit

GetAttributes

GetValue

SetValue

TReportDirProperty

Derived from TPropertyEditor

Activate

AllEqual

GetComponent

GetEditLimit

GetName

GetProperties

GetPropType

GetValues

Initialize

Revert

ValueAvailable

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReportDirProperty methods

TReportDirProperty	By object

~TReportDirProperty

Activate

AllEqual

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

GetAttributes

GetComponent

GetEditLimit

GetName

GetProperties

GetPropType

GetValues

GetValue

InheritsFrom

Initialize

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Revert

SetValue

TReportDirProperty

ValueAvailable


TReportDirProperty::Edit

TReportDirProperty	Methods

Syntax

virtual void __fastcall Edit(void);

Description


TReportDirProperty::GetAttributes

TReportDirProperty	Methods

Syntax

virtual Dsgnintf::TPropertyAttributes __fastcall GetAttributes(void);

Description


TReportDirProperty::GetValue

TReportDirProperty	Methods

Syntax

virtual System::AnsiString __fastcall GetValue(void);

Description


TReportDirProperty::SetValue

TReportDirProperty	Methods

Syntax

virtual void __fastcall SetValue(const System::AnsiString Value);

Description


TReportDirProperty::TReportDirProperty

TReportDirProperty	Methods	See also

TReportDirProperty creates a new TReportDirProperty object.

Syntax

__fastcall TReportDirProperty(void);

Description

Use TReportDirProperty to create a new TReportDirProperty object.


TReportDirProperty::~TReportDirProperty

TReportDirProperty	Methods	See also

~TReportDirProperty frees the memory associated with the TReportDirProperty object.

Syntax

__fastcall virtual ~TReportDirProperty(void);

Description

Do not call ~TReportDirProperty directly. Instead, use the delete keyword on the object, which causes ~TReportDirProperty to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPropertyEditor


TReportDirProperty example

TReportDirProperty


TReportEditor

Hierarchy	Properties	Methods

Header

vcl/report.hpp

Description


TReportEditor properties

TReportEditor	Alphabetically	Legend

Derived from TComponentEditor

Component

Designer


TReportEditor properties

TReportEditor	By object	Legend

Component

Designer


TReportEditor methods

TReportEditor	Alphabetically

In TReportEditor

~TReportEditor

TReportEditor

Derived from TComponentEditor

Copy

Edit

ExecuteVerb

GetVerb

GetVerbCount

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReportEditor methods

TReportEditor	By object

~TReportEditor

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Copy

DefaultHandler

Dispatch

Edit

ExecuteVerb

FieldAddress

FreeInstance

Free

GetVerbCount

GetVerb

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TReportEditor


TReportEditor::TReportEditor

TReportEditor	Methods	See also

TReportEditor creates a new TReportEditor object.

Syntax

__fastcall virtual TReportEditor(Classes::TComponent *AComponent,

Description

Use TReportEditor to create a new TReportEditor object.


TReportEditor::~TReportEditor

TReportEditor	Methods	See also

~TReportEditor frees the memory associated with the TReportEditor object.

Syntax

__fastcall virtual ~TReportEditor(void);

Description

Do not call ~TReportEditor directly. Instead, use the delete keyword on the object, which causes ~TReportEditor to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TComponentEditor


TReportEditor example

TReportEditor


TReportManager

Hierarchy	Properties	Methods

Header

vcl/report.hpp

Description


TReportManager properties

TReportManager	Alphabetically	Legend

In TReportManager

DataSet

DataSets

Handle

Report

Reports

Updated

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TReportManager properties

TReportManager	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSets

DataSet

DesignInfo

Handle

Name

Owner

Reports

Report

Tag

Updated


TReportManager::DataSet

TReportManager	Properties

Syntax

System::LongBool __fastcall GetData(Db::TDataSet *DataSet, PDataElement pStmtMem);

Description


TReportManager::DataSets

TReportManager	Properties

Syntax

__property Classes::TList * DataSets;

Description


TReportManager::Handle

TReportManager	Properties

Syntax

__property System::Integer Handle;

Description


TReportManager::Report

TReportManager	Properties

Syntax

__property TReport * Report[System::Integer Index];

Description


TReportManager::Reports

TReportManager	Properties

Syntax

__property Classes::TList * Reports;

Description


TReportManager::Updated

TReportManager	Properties

Syntax

__property System::Boolean Updated;

Description


TReportManager methods

TReportManager	Alphabetically

In TReportManager

~TReportManager

Add

AddDataSet

Clear

EndSQL

ExecuteSQL

GetColumnList

GetData

GetDataSet

GetDataSetByName

GetDataSets

GetMemo

GetNext

GetReport

GetTableList

Remove

TReportManager

UpdateDataSets

ValidDataType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReportManager methods

TReportManager	By object

~TReportManager

AddDataSet

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

EndSQL

ExecuteSQL

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetColumnList

GetDataSetByName

GetDataSets

GetDataSet

GetData

GetMemo

GetNext

GetParentComponent

GetReport

GetTableList

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Remove

TReportManager

UpdateDataSets

ValidDataType


TReportManager::Add

TReportManager	Methods

Syntax

void __fastcall Add(TReport *Value);

Description


TReportManager::AddDataSet

TReportManager	Methods

Syntax

void __fastcall AddDataSet(Classes::TComponent *Root);

Description


TReportManager::Clear

TReportManager	Methods

Syntax

void __fastcall Clear(void);

Description


TReportManager::EndSQL

TReportManager	Methods

Syntax

System::LongBool __fastcall EndSQL(PSQLStruct SQLStruct);

Description


ExecutesSQL

Description


TReportManager::GetColumnList

TReportManager	Methods

Syntax

System::LongBool __fastcall GetColumnList(System::PChar Buffer);

Description


TReportManager::GetData

TReportManager	Methods

Syntax

System::LongBool __fastcall GetData(Db::TDataSet *DataSet, PDataElement pStmtMem);

Description


TReportManager::GetDataSet

TReportManager	Methods

Syntax

Db::TDataSet *__fastcall GetDataSet(System::Integer Index);

Description


TReportManager::GetDataSetByName

TReportManager	Methods

Syntax

Db::TDataSet *__fastcall GetDataSetByName( System::AnsiString Value);

Description


TReportManager::GetDataSets

TReportManager	Methods

Syntax

Classes::TList *__fastcall GetDataSets(void);

Description


TReportManager::GetMemo

TReportManager	Methods

Syntax

System::LongBool __fastcall GetMemo(PMemoStruct MemoStruct);

Description


TReportManager::GetNext

TReportManager	Methods

Syntax

System::LongBool __fastcall GetNext(PSQLStruct SQLStruct, System::LongBool &MoreData);

Description


TReportManager::GetReport

TReportManager	Methods

Syntax

TReport *__fastcall GetReport(System::Integer Index);

Description


TReportManager::GetTableList

TReportManager	Methods

Syntax

void __fastcall GetTableList(System::PChar Buffer);

Description


TReportManager::Remove

TReportManager	Methods

Syntax

void __fastcall Remove(TReport *Value);

Description


TReportManager::UpdateDataSets

TReportManager	Methods

Syntax

void __fastcall UpdateDataSets(void);

Description


TReportManager::ValidDataType

TReportManager	Methods

Syntax

System::Boolean __fastcall ValidDataType(Db::TFieldType Value);

Description


TReportManager::TReportManager

TReportManager	Methods	See also

TReportManager creates a new TReportManager object.

Syntax

__fastcall virtual TReportManager(Classes::TComponent *AOwner);

Description

Use TReportManager to create a new TReportManager object.


TReportManager::~TReportManager

TReportManager	Methods	See also

~TReportManager frees the memory associated with the TReportManager object.

Syntax

__fastcall virtual ~TReportManager(void);

Description

Do not call ~TReportManager directly. Instead, use the delete keyword on the object, which causes ~TReportManager to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TReportManager example

TReportManager


TReportNameProperty

Hierarchy	Properties	Methods

Header

vcl/report.hpp

Description


TReportNameProperty properties

TReportNameProperty	Alphabetically	Legend

Derived from TPropertyEditor

Designer

PrivateDirectory

PropCount

Value


TReportNameProperty properties

TReportNameProperty	By object	Legend

Designer

PrivateDirectory

PropCount

Value


TReportNameProperty methods

TReportNameProperty	Alphabetically

In TReportNameProperty

~TReportNameProperty

Edit

GetAttributes

GetValue

SetValue

TReportNameProperty

Derived from TPropertyEditor

Activate

AllEqual

GetComponent

GetEditLimit

GetName

GetProperties

GetPropType

GetValues

Initialize

Revert

ValueAvailable

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReportNameProperty methods

TReportNameProperty	By object

~TReportNameProperty

Activate

AllEqual

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

GetAttributes

GetComponent

GetEditLimit

GetName

GetProperties

GetPropType

GetValues

GetValue

InheritsFrom

Initialize

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Revert

SetValue

TReportNameProperty

ValueAvailable


TReportNameProperty::Edit

TReportNameProperty	Methods

Syntax

virtual void __fastcall Edit(void);

Description


TReportNameProperty::GetAttributes

TReportNameProperty	Methods

Syntax

virtual Dsgnintf::TPropertyAttributes __fastcall GetAttributes(void);

Description


TReportNameProperty::GetValue

TReportNameProperty	Methods

Syntax

virtual System::AnsiString __fastcall GetValue(void);

Description


TReportNameProperty::SetValue

TReportNameProperty	Methods

Syntax

virtual void __fastcall SetValue(const System::AnsiString Value);

Description


TReportNameProperty::TReportNameProperty

TReportNameProperty	Methods	See also

TReportNameProperty creates a new TReportNameProperty object.

Syntax

__fastcall TReportNameProperty(void);

Description

Use TReportNameProperty to create a new TReportNameProperty object.


TReportNameProperty::~TReportNameProperty

TReportNameProperty	Methods	See also

~TReportNameProperty frees the memory associated with the TReportNameProperty object.

Syntax

__fastcall virtual ~TReportNameProperty(void);

Description

Do not call ~TReportNameProperty directly. Instead, use the delete keyword on the object, which causes ~TReportNameProperty to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPropertyEditor


TReportNameProperty example

TReportNameProperty


TResourceStream

Hierarchy	Properties	Methods	See also

The TResourceStream object is a memory stream that provides access to the compiled resources in a Windows application.

Header

vcl/classes.hpp

Description

Use TResourceStream to read the resources of a Windows application. An instance of TResourceStream holds the value of a single resource in a memory buffer where it is accessible to the application.

The global ReadComponentRes function uses TResourceStream to access the compiled resources used by the application.


TResourceStream properties

TResourceStream	Alphabetically	Legend

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TResourceStream properties

TResourceStream	By object	Legend

Memory

Position

Size


TResourceStream methods

TResourceStream	Alphabetically

In TResourceStream

~TResourceStream

CreateFromID

TResourceStream

Write

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TResourceStream methods

TResourceStream	By object

~TResourceStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

CreateFromID

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

SaveToFile

SaveToStream

Seek

TResourceStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TResourceStream::CreateFromID

TResourceStream	Methods	See also

The CreateFromID method creates an instance of TResourceStream associated with a particular resource ID and type.

Syntax

Description

Call CreateFromID to instantiate a TResourceStream for a resource in the indicated instance that can be identified by an integer ID. Create finds the resource data and loads it into the Memory buffer for the TResourceStream.

The Instance parameter is the Windows instance handle associated with the executable or DLL that contains the resource.

The ResID is the integer ID associated with the resource in the .RC file that was compiled with the application. If the Resource was identified by a string rather than an ID number, use the Create method instead.

The ResType is a string identifying the type of the resource. Applications can define their own resource types and identify them by name in the .RC file. In addition, Windows provides a number of predefined resource types. To identify a resource that is one of the predefined Windows resource types, set ResType to the appropriate value from the following table.

ResType	Type of resource

RT_ACCELERATOR	Accelerator table

RT_BITMAP	Bitmap resource

RT_DIALOG	Dialog box

RT_FONT	Font resource

RT_FONTDIR	Font directory resource

RT_MENU	Menu resource

RT_RCDATA	Application-defined resource (raw data)

RT_STRING	String-table entry

RT_MESSAGETABLE	Message-table entry

RT_CURSOR	Hardware-dependent cursor resource

RT_GROUP_CURSOR	Hardware-independent cursor resource

RT_ICON	Hardware-dependent icon resource

RT_GROUP_ICON	Hardware-independent icon resource

RT_VERSION	Version resource

Note

Specifying resources by ID requires less memory than specifying resources by name.


TResourceStream::Write

TResourceStream	Methods	See also

Write overrides the inherited method to raise an EStreamError exception when an attempt is made to write the resource back to the application.

Syntax

virtual System::Longint __fastcall Write(const void *Buffer, System::Longint Count);

Description

Applications should not use a TResourceStream to write the resources of the running application. Write overrides the inherited method to raise an error whenever an application tries to write to the application’s resources.

As all other data-writing methods of TResourceStream (WriteBuffer, WriteComponent) call Write to do the actual writing, calling any of the data-writing methods of TResourceStream will raise an exception.


TResourceStream::TResourceStream

TResourceStream	Methods	See also

TResourceStream creates a new TResourceStream object.

Syntax

__fastcall TResourceStream(System::Integer Instance, const System::AnsiString ResName, System::PChar

Description

Use TResourceStream to create a new TResourceStream object.


TResourceStream::~TResourceStream

TResourceStream	Methods	See also

~TResourceStream frees the memory associated with the TResourceStream object.

Syntax

__fastcall virtual ~TResourceStream(void);

Description

Do not call ~TResourceStream directly. Instead, use the delete keyword on the object, which causes ~TResourceStream to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TStream

TCustomMemoryStream


TResourceStream example

TResourceStream


TSaveDialog

Hierarchy	Properties	Methods

The TSaveDialog component makes a Save dialog box available to your application. The purpose of the dialog box is to allow a user to specify a file to save. Use the Execute method to display the Save dialog box.

Header

vcl/dialogs.hpp

Description

When the user chooses OK in the dialog box, the user’s filename selection is stored in the dialog box’s FileName property, which you can then use to process as you want.

You can let the user decide which set of files are visible in the list box of the Save dialog box with the Filter property. The user can then use the List Files of Type combo box to determine which files display in the list box. You set the default filter using the FilterIndex property.

You can permit the user to choose multiple filenames with the Options property so that the Files property contains a list of all the selected filenames in the list box. You can customize how the Save dialog box appears and behaves with the Options property.

If you want a file extension automatically appended to the filename typed in the File Name edit box of the Save dialog box, use the DefaultExt property.


TSaveDialog properties

TSaveDialog	Alphabetically	Legend

Derived from TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TSaveDialog properties

TSaveDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

FilterIndex

Filter

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title


TSaveDialog methods

TSaveDialog	Alphabetically

In TSaveDialog

~TSaveDialog

Execute

TSaveDialog

Derived from TOpenDialog

DestroyComponents

Derived from TComponent

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSaveDialog methods

TSaveDialog	By object

~TSaveDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TSaveDialog


TSaveDialog::Execute

TSaveDialog	Methods

Displays the Save dialog box.

Syntax

virtual System::Boolean __fastcall Execute(void);

Description


TSaveDialog::TSaveDialog

TSaveDialog	Methods	See also

TSaveDialog creates a new TSaveDialog object.

Syntax

__fastcall virtual TSaveDialog(Classes::TComponent *AOwner);

Description

Use TSaveDialog to create a new TSaveDialog object.


TSaveDialog::~TSaveDialog

TSaveDialog	Methods	See also

~TSaveDialog frees the memory associated with the TSaveDialog object.

Syntax

__fastcall virtual ~TSaveDialog(void);

Description

Do not call ~TSaveDialog directly. Instead, use the delete keyword on the object, which causes ~TSaveDialog to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TOpenDialog


TSaveDialog example

TSaveDialog


TScreen

Hierarchy	Properties	Methods	Events

The TScreen component represents the state of the screen as your application runs. A Screen variable of type TScreen is already declared, ready for you to use as an instance of TScreen.

Header

vcl/forms.hpp

The screen component lists all forms displayed on the screen in the Forms property array. The number of forms is kept as the value of the FormCount property. You can find out which form currently has the focus by checking the value of the ActiveForm property. Similarly, the control that has the focus is the value of the ActiveControl property.

The screen component lists all data modules that are currently created in the application in the DataModules property. The number of created data modules is kept as the value of the DataModuleCount property.

The height and width of the screen device in pixels are the value of the Height and Width properties. The PixelsPerInch property indicates the system font proportions of the system used to design the form.

All the fonts supported by the screen are listed in the Fonts property. Similarly, all the cursors available are in the Cursors property. Using Cursors, you can make a custom cursor available to your application.

The TScreen component is a direct descendent of TComponent. In addition to the following properties, methods, and events, this component also has the properties and methods that apply to all components.


TScreen properties

TScreen	Alphabetically	Legend

In TScreen

ActiveControl

ActiveForm

Cursor

Cursors

DataModuleCount

DataModules

Fonts

FormCount

Forms

Height

PixelsPerInch

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TScreen properties

TScreen	By object	Legend

ActiveControl

ActiveForm

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Cursors

Cursor

DataModuleCount

DataModules

DesignInfo

Fonts

FormCount

Forms

Height

Name

Owner

PixelsPerInch

Tag

Width


TScreen::ActiveControl

TScreen	Properties

Indicates which control currently has focus on the screen.

Syntax

__property Controls::TWinControl * ActiveControl;

When focus shifts to another control, the ActiveControl property is updated before the OnExit event of the original control with focus occurs.


TScreen::ActiveForm

TScreen	Properties

Indicates which form currently has focus, or will have focus when the application becomes active again.

Syntax

__property TForm * ActiveForm;


Cursor

Controls the mouse cursor shape on a global level.

Assigning any value but crDefault to the Screen object's Cursor property sets the mouse cursor shape for all windows belonging to the application. The global mouse cursor shape remains in effect until you assign crDefault to the Screen object's Cursor property, at which point normal cursor behavior is restored.

To see a list of possible cursor shapes, see the Cursor property for all controls.

Example

Assignments to the Screen object's cursor property are typically guarded by a try...finally statement to ensure that normal cursor behavior is restored, for example:


TScreen::Cursors

TScreen	Properties

Provides access to the list of cursors available to your application.

Syntax

__property System::Integer Cursors[System::Integer Index];

To access a particular cursor, specify its position in the list of cursors as the value of the Index parameter with the first position in the list having an index of 0, the second having an index of 1, and so on.

Using the Cursors property, you can make custom cursors available to your application.

These are the cursor constants and their position in the Cursors property array:

Cursor	Value	Cursor	Value

crDefault	     0	crSizeWE	     –9

crNone	     –1	crUpArrow	     –10

crArrow	     –2	crHourglass	     –11

crCross	     –3	crDrag	     –12

crIBeam	     –4	crNoDrop	     –13

crSize	     –5	crHSplit	     –14

crSizeNESW	     –6	crVSplit	     –15

crSizeNS	     –7	crMultiDrag	     –16

crSizeNWSE	     –8	crSQLWait	     –17

To make a custom cursor available to your application,

1	Create the cursor resource using a resource editor.

2	Declare a cursor constant with a value that does not conflict with an existing cursor constant.

3	Use the Windows API function LoadCursor to make your cursor available to your application, specifying the newly declared cursor constant as the value of the Index parameter for the Cursors property array.

Note

You don’t need to call the WinAPI function DestroyCursor when you are finished using the custom cursor; Borland C++ Builder does this automatically.

Example

This example assumes you have created a cursor resource with the name NewCursor. The RefSyn loads the new cursor into the Cursors property array and makes the newly loaded cursor the cursor of the form:

const

procedure TForm1.FormCreate(Sender: TObject);


TScreen::DataModuleCount

TScreen	Properties

Contains a count of all the data modules that currently in the application.

Syntax

__property System::Integer DataModuleCount;


DataModules

Maintains a list of all the data modules that are currently created in the application.


TScreen::Fonts

TScreen	Properties

Returns a list of fonts supported by the screen.

Syntax

__property Classes::TStrings * Fonts;


FormCount

Contains the number of forms displayed on the screen.


TScreen::Forms

TScreen	Properties

Provides access to a form on the screen by its position in the list of forms key by TScreen.

Syntax

__property TForm * Forms[System::Integer Index];

Specify the form you want to access as the value of the Index parameters. The first form has an index value of 0, the second has an index value of 1, and so on.

Example

The following RefSyn adds the name of all forms on the screen to ListBox1 when Button1 is clicked.


TScreen::Height

TScreen	Properties

Contains the vertical size of the screen in pixels.

Syntax

__property System::Integer Height;

Example

To following RefSyn sets a form's height to half the height of the screen:


TScreen::PixelsPerInch

TScreen	Properties

Reports the relative size of the Windows system font.

Syntax

__property System::Integer PixelsPerInch;

Windows PixelsPerInch is a misnomer: it tells you nothing about the pixel resolution or aspect ratio of the video screen. All PixelsPerInch tells you is the relative size of the Windows system font. The value in PixelsPerInch is retrieved from Windows when Borland C++ Builder loads.

Example

This example adds 30 to the form's PixelsPerInch property if the screen's PixelsPerInch property is greater than 100:


TScreen::Width

TScreen	Properties

Reports the horizontal size of the screen in pixels.

Syntax

__property System::Integer Width;

Example

The following component determines the width of all the forms on the screen and resizes the ones that are wider than the screen width. To run this RefSyn, the integer variable I must be declared.


TScreen events

TScreen	Alphabetically

In TScreen

OnActiveControlChange

OnActiveFormChange


TScreen events

TScreen	By object

OnActiveControlChange

OnActiveFormChange


TScreen::OnActiveControlChange

TScreen	Events

Syntax

__property Classes::TNotifyEvent OnActiveControlChange;


TScreen::OnActiveFormChange

TScreen	Events

Syntax

__property Classes::TNotifyEvent OnActiveFormChange;


TScreen methods

TScreen	Alphabetically

In TScreen

~TScreen

TScreen

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScreen methods

TScreen	By object

~TScreen

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TScreen


TScreen::TScreen

TScreen	Methods	See also

TScreen creates a new TScreen object.

Syntax

__fastcall virtual TScreen(Classes::TComponent *AOwner);

Description

Use TScreen to create a new TScreen object.


TScreen::~TScreen

TScreen	Methods	See also

~TScreen frees the memory associated with the TScreen object.

Syntax

__fastcall virtual ~TScreen(void);

Description

Do not call ~TScreen directly. Instead, use the delete keyword on the object, which causes ~TScreen to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TScreen example

TScreen


TScrollBar

Hierarchy	Properties	Methods	Events

The TScrollBar component is a Windows scroll bar, which is used to scroll the contents of a window, form, or control. In the OnScroll event handler, you write the RefSyn that determines how the window, form, or control behaves in response to the user scrolling the scroll bar.

Header

vcl/stdctrls.hpp

You determine how far a thumb tab moves when the user clicks the scroll bar on either side of the thumb tab with the value of the LargeChange property. The value of the SmallChange property determines how far the thumb tab moves when the user clicks the arrows at the end of the scroll bar or scrolls the scroll bar using the arrow keys on the keyboard.

The Min and Max property values together determine how many positions are available on the scroll bar for the thumb tab to move when the user scrolls the scroll bar. Your application can set the position of the thumb tab with the Position property, or use the property to determine how far the scroll bar has scrolled. You can use the SetParams method to set the Min, Max, and Position properties all at once.

To cause the form or scroll box to scroll while the scroll bar thumb tab is being dragged instead of waiting for the tab to be dropped, set the Tracking property to true.

The TScrollBar component is a direct descendent of TWinControl. In addition to the following properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TScrollBar properties

TScrollBar	Alphabetically	Legend

In TScrollBar

Kind

LargeChange

Max

Min

Position

SmallChange

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScrollBar properties

TScrollBar	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Handle

Height

HelpContext

Hint

Kind

LargeChange

Left

Max

Min

Name

Owner

ParentCtl3D

ParentShowHint

Parent

PopupMenu

Position

ShowHint

Showing

SmallChange

TabOrder

TabStop

Tag

Top

Visible

Width


TScrollBar::Kind

TScrollBar	Properties

Determines if a scroll bar is horizontal or vertical.

Syntax

__property Forms::TScrollBarKind Kind;

These are the possible values:

Value	Meaning

sbHorizontal	Scroll bar is horizontal

sbVertical	Scroll bar is vertical


TScrollBar::LargeChange

TScrollBar	Properties

Determines how far the scroll box moves when the user clicks the scroll bar on either side of the scroll box or presses PgUp or PgDn.

Syntax

__property Forms::TScrollBarInc LargeChange;

For example, if the LargeChange property setting is 1000, each time the user clicks the scroll bar, the scroll box moves 1000 positions. How big the change from one position to another depends on the difference between the Max property value and the Min property value. If Max is 3000 and Min is 0, the user needs to click the scroll bar three times to move the scroll box from one end of the scroll bar to the other.


TScrollBar::Max

TScrollBar	Properties

Along with the Min property, Max determines the number of possible positions the scroll box can have on the scroll bar.

Syntax

__property System::Integer Max;

The LargeChange and SmallChange properties use the number of positions to determine how far to move the scroll box when the user uses the scroll bar.

For example, if Max is 30000 and Min is 0, the scroll box can assume 30,000 positions on a horizontal scroll bar. If the LargeChange property setting is 10000 and the scroll box position is at the far left of the scroll bar (Position is 0), the user can click the scroll bar three times to the right of the scroll box before the scroll box is moved all the way to the right of the scroll bar (30000/10000 = 3).

If you want to change the Min, Max, and Position values all at once at run time, call the SetParams method.


TScrollBar::Min

TScrollBar	Properties

Along with the Max property, Min determines the number of possible positions the scroll box can have on the scroll bar.

Syntax

__property System::Integer Min;

The LargeChange and SmallChange properties use the number of positions to determine how far to move the scroll box when the user uses the scroll bar.

For example, if Max is 3000 and Min is 0, the scroll box can assume 3000 positions on a horizontal scroll bar. If the LargeChange property setting is 1000 and the scroll box position is at the far left of the scroll bar (Position is 0), the user can click the scroll bar three times to the right of the scroll box before the scroll box is moved all the way to the right of the scroll bar (3000/1000 = 3).

If you want to change the Min, Max, and Position values all at run time, call the SetParams method.


TScrollBar::Position

TScrollBar	Properties

Determines the position of the thumb tab on a scroll bar.

Syntax

__property System::Integer Position;

When the user scrolls the scroll bar, the value of Position changes. You can also change where the thumb tab appears on the scroll bar by changing the value of Position.

The number of possible positions on the scroll bar is determined by the difference between the Max property and the Min property. If the Min and Position values are both 0, the thumb tab is positioned to the far left on a horizontal scroll bar and to the top of a vertical scroll bar. If Min is 10, Position can be no less than 10.


TScrollBar::SmallChange

TScrollBar	Properties

Determines how far the thumb tab moves when the user clicks the arrows at the end of the scroll bar to scroll or uses the arrow keys on the keyboard.

Syntax

__property Forms::TScrollBarInc SmallChange;

For example, if SmallChange is 1000, each time the user clicks an arrow on the scroll bar, the thumb tab moves 1000 positions. The number of positions is determined by the difference between the Max property value and the Min property value. If the Max property is 30000 and the Min property is 0, the user would need to click an arrow on the scroll bar 30 times to move the thumb tab from one end of the scroll bar to the other.


TScrollBar events

TScrollBar	Alphabetically	Legend

In TScrollBar

OnChange

OnScroll

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TScrollBar events

TScrollBar	By object	Legend

OnChange

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnScroll

OnStartDrag


TScrollBar::OnChange

TScrollBar	Events

Syntax

__property Classes::TNotifyEvent OnChange;


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnKeyDown


OnKeyPress


OnKeyUp


TScrollBar::OnScroll

TScrollBar	Events

Syntax

__property TScrollEvent OnScroll;


OnStartDrag


TScrollBar methods

TScrollBar	Alphabetically

In TScrollBar

~TScrollBar

SetParams

TScrollBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollBar methods

TScrollBar	By object

~TScrollBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetParams

SetTextBuf

Show

TScrollBar

UpdateControlState

Update


TScrollBar::SetParams

TScrollBar	Methods

[PROBABLY DOCUMENTED, BUT LOST IN HELP FILE. THE ONLY SETPARAMS METHOD YOU CAN GET TO APPLIES TO TUPDATESQL METHOD. UNFORTUNATELY, JUMPS FROM SCROLLBAR TOPICS JUMP INTO THE TUPDATESQL SETPARAMS, WHICH IS ENTIRELY DIFFERENT.]

Syntax

void __fastcall SetParams(System::Integer APosition, System::Integer AMin, System::Integer AMax);


TScrollBar::TScrollBar

TScrollBar	Methods	See also

TScrollBar creates a new TScrollBar object.

Syntax

__fastcall virtual TScrollBar(Classes::TComponent *AOwner);

Description

Use TScrollBar to create a new TScrollBar object.


TScrollBar::~TScrollBar

TScrollBar	Methods	See also

~TScrollBar frees the memory associated with the TScrollBar object.

Syntax

__fastcall virtual ~TScrollBar(void);

Description

Do not call ~TScrollBar directly. Instead, use the delete keyword on the object, which causes ~TScrollBar to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TScrollBar example

TScrollBar


TScrollBox

Hierarchy	Properties	Methods	Events	See also

TScrollBox is the component for a scrolling area (a scroll box) in a window.

Header

vcl/forms.hpp

Description

Use TScrollBox to create a scroll box in a window.

One use of a scroll box is to prevent areas of a window, such as a toolbar or status bar (TPanel components), from scrolling. To prevent a toolbar and status bar from scrolling, hide the window’s scroll bars, and then position a scroll box in the client area of the window between the toolbar and status bar. The scroll bars associated with the scroll box will appear to belong to the window, but will scroll only the area inside the scroll box.

Another use of scroll boxes is to create multiple scrolling areas (views) in a window. Views are common in commercial word-processor, spreadsheet, and project management applications.

A scroll box can contain objects, such as TButton and TCheckBox objects.


TScrollBox properties

TScrollBox	Alphabetically	Legend

In TScrollBox

BorderStyle

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScrollBox properties

TScrollBox	By object	Legend

Align

AutoScroll

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

HorzScrollBar

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VertScrollBar

Visible

Width


TScrollBox::BorderStyle

TScrollBox	Properties

BorderStyle is a value that specifies whether the scroll box has a border.

Syntax

__property TBorderStyle BorderStyle;

Description

Use BorderStyle to get or set whether the scroll box has a border. BorderStyle can be one of the following TBorderStyle values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TScrollBox events

TScrollBox	Alphabetically	Legend

In TScrollBox

OnResize

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp


TScrollBox events

TScrollBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnResize


TScrollBox::OnResize

TScrollBox	Events

OnResize occurs when the scroll box is resized.

Syntax

__property Classes::TNotifyEvent OnResize;

Description

Use OnResize to perform special processing when the scroll box is resized.


TScrollBox methods

TScrollBox	Alphabetically

In TScrollBox

~TScrollBox

TScrollBox

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollBox methods

TScrollBox	By object

~TScrollBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TScrollBox

UpdateControlState

Update


TScrollBox::TScrollBox

TScrollBox	Methods	See also

TScrollBox creates a new TScrollBox object.

Syntax

__fastcall virtual TScrollBox(Classes::TComponent *AOwner);

Description

Use TScrollBox to create a new TScrollBox object.


TScrollBox::~TScrollBox

TScrollBox	Methods	See also

~TScrollBox frees the memory associated with the TScrollBox object.

Syntax

__fastcall virtual ~TScrollBox(void);

Description

Do not call ~TScrollBox directly. Instead, use the delete keyword on the object, which causes ~TScrollBox to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TScrollBox example

TScrollBox


TScroller

Hierarchy	Properties	Methods	Events

Header

vcl/tabs.hpp

Description


TScroller properties

TScroller	Alphabetically	Legend

In TScroller

Change

Max

Min

Position

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScroller properties

TScroller	By object	Legend

Align

BoundsRect

Brush

Change

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Max

Min

Name

Owner

Parent

Position

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TScroller::Change

TScroller	Properties

Syntax

__property System::Integer Change;

Description


TScroller::Max

TScroller	Properties

Syntax

__property System::Longint Max;

Description


TScroller::Min

TScroller	Properties

Syntax

__property System::Longint Min;

Description


TScroller::Position

TScroller	Properties

Syntax

__property System::Longint Position;

Description


TScroller events

TScroller	Alphabetically	Legend

In TScroller

OnClick


TScroller events

TScroller	By object	Legend

OnClick


TScroller::OnClick

TScroller	Events

Syntax

__property Classes::TNotifyEvent OnClick;

Description


TScroller methods

TScroller	Alphabetically

In TScroller

~TScroller

Paint

TScroller

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScroller methods

TScroller	By object

~TScroller

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Paint

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TScroller

UpdateControlState

Update


TScroller::Paint

TScroller	Methods

Syntax

virtual void __fastcall Paint(void);

Description


TScroller::TScroller

TScroller	Methods	See also

TScroller creates a new TScroller object.

Syntax

__fastcall virtual TScroller(Classes::TComponent *AOwner);

Description

Use TScroller to create a new TScroller object.


TScroller::~TScroller

TScroller	Methods	See also

~TScroller frees the memory associated with the TScroller object.

Syntax

__fastcall virtual ~TScroller(void);

Description

Do not call ~TScroller directly. Instead, use the delete keyword on the object, which causes ~TScroller to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TScroller example

TScroller


TScrollingWinControl

Hierarchy	Properties	Methods	See also

TScrollingWinControl is the component for a windowed control that supports scrolling.

Header

vcl/forms.hpp

Description

Use TScrollingWinControl to create a windowed control that supports scrolling.

Typically, a scrolling windowed control has horizontal and vertical scroll bars and scrolls a child control into view when the child control receives focus.

Examples of scrolling windowed controls include TForm and TScrollBox objects.


TScrollingWinControl properties

TScrollingWinControl	Alphabetically	Legend

In TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScrollingWinControl properties

TScrollingWinControl	By object	Legend

Align

AutoScroll

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

HorzScrollBar

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VertScrollBar

Visible

Width


TScrollingWinControl::AutoScroll

TScrollingWinControl	Properties	See also

AutoScroll is a Boolean property that specifies whether scroll bars appear automatically on the scrolling windowed control if it is not large enough to display all of its controls.

Syntax

__property System::Boolean AutoScroll;

Description

If AutoScroll is true, the scroll bars appear automatically when necessary. For example, if the user resizes the scrolling windowed control so that some of its controls are partially obscured, scroll bars appear.

If AutoScroll is false, scroll bars don’t appear automatically. In this case, use  the HorzScrollBar and VertScrollBar properties to make scroll bars appear.


TScrollingWinControl::HorzScrollBar

TScrollingWinControl	Properties	See also

HorzScrollBar is a TControlScrollBar object that encapsulates the horizontal scroll bar for the scrolling windowed control.

Syntax

__property TControlScrollBar * HorzScrollBar;

Description

Use HorzScrollBar to hide, show, or manipulate the horizontal scroll bar for the scrolling windowed control.


TScrollingWinControl::VertScrollBar

TScrollingWinControl	Properties	See also

VertScrollBar is a TControlScrollBar object that encapsulates the vertical scroll bar for the scrolling windowed control.

Syntax

__property TControlScrollBar * VertScrollBar;

Description

Use VertScrollBar to hide, show, or manipulate the vertical scroll bar for the scrolling windowed control.


TScrollingWinControl methods

TScrollingWinControl	Alphabetically	Legend

In TScrollingWinControl

~TScrollingWinControl

AlignControls

AutoScrollInView

ChangeScale

CreateWnd

ScrollInView

TScrollingWinControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollingWinControl methods

TScrollingWinControl	By object	Legend

~TScrollingWinControl

AlignControls

Assign

AutoScrollInView

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TScrollingWinControl

UpdateControlState

Update


TScrollingWinControl::AlignControls

TScrollingWinControl	Methods	See also

AlignControls is a method that aligns the controls in the scrolling windowed control.

Syntax

virtual void __fastcall AlignControls(Controls::TControl *AControl, Windows::TRect &ARect);

Description

Use AlignControls to align the controls in the scrolling windowed control  according to the values of their Align properties.

AControl is a TControl object specifying the control that takes precedence in alignment when other controls have the same Align value. AControl can be NULL.

ARect is a TRect object specifying the area in the scrolling windowed control that contains the controls to align. ARect is automatically set to the entire area of the scrolling windowed control.

If AutoScroll is true and the scrolling windowed control is not being resized,  the ranges of the scroll bars on the scrolling windowed control are automatically recalculated.

After recalculating the ranges of the scroll bars and setting the value of ARect, AlignControls calls TWinControl.AlignControls, passing the AControl and ARect objects.


TScrollingWinControl::AutoScrollInView

TScrollingWinControl	Methods	See also

AutoScrollInView is a method that scrolls a control into the visible area of the scrolling windowed control.

Syntax

void __fastcall AutoScrollInView(Controls::TControl *AControl);

Description

Use AutoScrollInView to scroll a control into the visible area of the scrolling windowed control.

AControl is a TControl object encapsulating the control to scroll into the visible area of the scrolling windowed control.

Unlike ScrollInView, AutoScrollInView does not perform scrolling when the ComponentState property of AControl or the scrolling windowed control is  csLoading.

AutoScrollInView calls ScrollInView to perform any needed scrolling.


TScrollingWinControl::ChangeScale

TScrollingWinControl	Methods	See also

ChangeScale is a method that resizes the scrolling windowed control by a specific ratio.

Syntax

virtual void __fastcall ChangeScale(System::Integer M, System::Integer D);

Description

Use ChangeScale to resize the scrolling windowed control by a specific ratio.

M is the multiplier of the ratio; D is the divisor of the ratio. For example, to resize the scrolling windowed control to four-fifths of its current size, set M to four and D to five.

ChangeScale recalculates the ranges of the scroll bars on the scrolling windowed control according to the ratio, and then calls TControl.ChangeScale.


TScrollingWinControl::CreateWnd

TScrollingWinControl	Methods	See also

CreateWnd is a method that creates a Windows control corresponding to the TScrollingWinControl object.

Syntax

virtual void __fastcall CreateWnd(void);

Description

Use CreateWnd to create a Windows control corresponding to the ScrollingWinControl object.

CreateWnd initializes the scroll bars on the scrolling windowed control and then calls TWinControl.CreateWnd.


TScrollingWinControl::ScrollInView

TScrollingWinControl	Methods	See also

ScrollInView is a method that scrolls a control into the visible area of the scrolling windowed control.

Syntax

void __fastcall ScrollInView(Controls::TControl *AControl);

Description

Use ScrollInView to scroll a control into the visible area of the scrolling windowed control.

AControl is a TControl object encapsulating the control to scroll into view.

Note

If the ComponentState property for AControl or the scrolling windowed control might be csLoading, use AutoScrollInView instead.


TScrollingWinControl::TScrollingWinControl

TScrollingWinControl	Methods	See also

TScrollingWinControl creates a new TScrollingWinControl object.

Syntax

__fastcall virtual TScrollingWinControl(Classes::TComponent *AOwner);

Description

Use TScrollingWinControl to create a new TScrollingWinControl object.


TScrollingWinControl::~TScrollingWinControl

TScrollingWinControl	Methods	See also

~TScrollingWinControl frees the memory associated with the TScrollingWinControl object.

Syntax

__fastcall virtual ~TScrollingWinControl(void);

Description

Do not call ~TScrollingWinControl directly. Instead, use the delete keyword on the object, which causes ~TScrollingWinControl to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TScrollingWinControl example

TScrollingWinControl


TSessionList

Hierarchy	Properties	Methods

TSessionList provides management of Borland Database Engine (BDE) sessions within a database application.

Header

vcl/db.hpp

Description

Use TSessionList to manage session components in applications that provide multiple sessions. Borland C++ Builder automatically creates a globally accessible default session list component named Sessions for all database applications. In a multi-session application there can be more than one active session, but only one session can be current at a time. TSessionList enables an application to switch current sessions.

Note

Applications should not instantiate additional session list components.


TSessionList properties

TSessionList	Alphabetically	Legend

In TSessionList

Count

CurrentSession

List

Sessions


TSessionList properties

TSessionList	By object	Legend

Count

CurrentSession

List

Sessions


TSessionList::Count

TSessionList	Properties	See also

Indicates the number of available sessions for the application.

Syntax

__property System::Integer Count;

Description

Read Count to determine the current number of available sessions. Count is typically used to iterate through the list of available sessions to perform some universal action on all sessions. Used with the Sessions property, which enables an application to access a session by index number, Count specifies the maximum number of index entries for Sessions (Count - 1).


TSessionList::CurrentSession

TSessionList	Properties	See also

Returns a pointer to the current session.

Syntax

__property TSession * CurrentSession;

Description

Use CurrentSession to determine or specify which session in a database application is the current session. By default the current session is a pointer to the default session component, Session, that is created automatically by Borland C++ Builder for all database applications. Setting CurrentSession makes the specified session component the current one. While any number of sessions may be active, only one session can be current at a time.


TSessionList::List

TSessionList	Properties	See also

Returns a specified session component.

Syntax

void __fastcall GetSessionNames(Classes::TStrings *List);

Description

Use List to return a pointer to a specific session component managed by the session list. List does not change which session is current. SessionName specifies the session component to return, and must match the SessionName property of an existing session component. If no such session exists, List raises an EDatabaseError exception with a message specifying the invalid session name.

Note

To prevent raising an exception, call the FindSession method instead of using the List property.


TSessionList::Sessions

TSessionList	Properties	See also

Provides an indexed array of all active session components in the session list.

Syntax

__property TSession * Sessions[System::Integer Index];

Description

Use Sessions to access available session components. Index specifies the session to access. Index must be in the range of zero to the current value of the Count property minus one, or an EListError exception is raised describing the out of bounds condition.

For example, an application might iterate through all available sessions in the list to perform a global action on them. The following code sets the KeepConnections property of each session to false:


TSessionList methods

TSessionList	Alphabetically

In TSessionList

~TSessionList

FindSession

GetSessionNames

OpenSession

TSessionList

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSessionList methods

TSessionList	By object

~TSessionList

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FindSession

FreeInstance

Free

GetSessionNames

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OpenSession

TSessionList


TSessionList::FindSession

TSessionList	Methods	See also

Searches the list of sessions for a specified session.

Syntax

TSession *__fastcall FindSession(const System::AnsiString SessionName);

Description

Call FindSession to determine whether or not a specified session exists. SessionName specifies the session to search for.

FindSession compares the SessionName parameter to the SessionName property for each session component in the session list. If a match is found, FindSession returns a pointer to the session component. If an application passes an empty string in SessionName, FindSession returns the default session, Session. If a match is not found, FindSession returns NULL.


TSessionList::GetSessionNames

TSessionList	Methods	See also

Populates a string list with the names of all available sessions.

Syntax

void __fastcall GetSessionNames(Classes::TStrings *List);

Fills a string list object you create with the names (SessionName property) of all available sessions.

Description

Call GetSessionNames to retrieve a list of all available sessions. List is a string list object, created and maintained by the application, into which to store session names. Names returned by GetSessionNames correspond to the SessionName properties of all available sessions.


TSessionList::OpenSession

TSessionList	Methods	See also

Makes an existing session active, or creates a new session component and makes it active.

Syntax

TSession *__fastcall OpenSession(const System::AnsiString SessionName);

Description

Call OpenSession to make an existing session active, or to create a new session and make it active. SessionName specifies the name of the session to open.

OpenSession calls FindSession to see if the session specified in the SessionName parameter already exists. If it finds a match, it starts that session if necessary, and makes the session active. If OpenSession does not find an existing session, it creates a new session using the name specified in the SessionName parameter, starts the session, and makes it active.

In either case, OpenSession returns the session object.


TSessionList::TSessionList

TSessionList	Methods	See also

TSessionList creates a new TSessionList object.

Syntax

__fastcall TSessionList(void);

Description

Use TSessionList to create a new TSessionList object.


TSessionList::~TSessionList

TSessionList	Methods	See also

~TSessionList frees the memory associated with the TSessionList object.

Syntax

__fastcall virtual ~TSessionList(void);

Description

Do not call ~TSessionList directly. Instead, use the delete keyword on the object, which causes ~TSessionList to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TSessionList example

TSessionList


TSession

Hierarchy	Properties	Methods	Events	See also

TSession provides global management of a group of database connections within an application.

Header

vcl/db.hpp

Description

Use TSession to manage a group of database connections within an application. There are three uses for TSession: standard, multiple net files for Paradox, and multi-threaded database applications.

Borland C++ Builder automatically creates a globally accessible default TSession component named Session for all database applications. The default session component handles standard database connections. An application can control the default session by accessing its properties, events, and methods at run time.

Database applications that must simultaneously access Paradox tables located in different network locations can establish multiple sessions, one for each network location.

Finally, database applications that must establish multiple, concurrent connections to the same database, such as performing two queries against the same data at once, are multi-threaded applications. Multi-threaded applications must create and maintain one additional session component for each simultaneous connection to a single database server.

Note

Applications that maintain multiple sessions can manage them through the TSessionList component. A default session list component, called Sessions—note the plural which distinguishes this component from the default session component, Session—is automatically created for all database applications.


TSession properties

TSession	Alphabetically	Legend

In TSession

Active

ConfigMode

DatabaseCount

Databases

Handle

KeepConnections

Locale

NetFileDir

PrivateDir

SessionName

TraceFlags

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TSession properties

TSession	By object	Legend

Active

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConfigMode

DatabaseCount

Databases

DesignInfo

Handle

KeepConnections

Locale

Name

NetFileDir

Owner

PrivateDir

SessionName

Tag

TraceFlags


TSession::Active

TSession	Properties	See also

Specifies whether or not a session is active.

Syntax

__property System::Boolean Active;

Description

Examine Active at run time for the default session, Session, to determine if it is active or not. Active is false by default, meaning there are no open database connections or datasets associated with the session. If Active is true, one or more database connections are open, and one or more datasets may also be open.

Set the Active property at design time or run time for additional session components in a database application. Setting Active to true starts the session and makes it the current session. Setting Active to true triggers an OnStartup event handler for the session and initializes the NetFileDir, PrivateDir, and ConfigMode properties.

Setting Active to false (the default), closes any open datasets, and disconnects from attached database servers.

Note

An application can close the default session by setting Active to false, but this is not recommended.


TSession::ConfigMode

TSession	Properties	See also

Specifies how the Borland Database Engine (BDE) should handle aliases for the session.

Syntax

__property TConfigMode ConfigMode;

Description

Set ConfigMode to specify how the BDE should handle aliases created using the AddAlias or AddStandardAlias methods within the context of a session. ConfigMode also determines which BDE aliases are reported to a session when an application calls the GetAliasNames method.

The default setting for ConfigMode is cmAll, meaning that the aliases in the BDE configuration file, the BDE persistent store, and aliases local to the session are available to this session. The following table summarizes the possible BDE configuration modes that can be set for aliases:

Mode	Meaning

cmAll	All aliases in the BDE configuration file, the BDE persistent store, and aliases local to the session are available to the session.

cmPersistent	Only aliases in the BDE configuration file, or that are added to the persistent store are available to the session.

cmSession	Only aliases created within this session are available to the session.

The main purpose of ConfigMode is to enable an application to specify and restrict aliases at the session level.

Note

Aliases created within a session are not automatically saved to the BDE configuration file. To save an alias to the configuration file, call the SaveConfigFile method.


TSession::DatabaseCount

TSession	Properties	See also

Indicates the number of active database components currently associated with the session.

Syntax

__property System::Integer DatabaseCount;

Description

Examine DatabaseCount to determine the number of active database components associated with a session. As database connections are opened or closed during a session’s life-span, this number can change. If DatabaseCount is zero, there are currently no active database components for the session.

DatabaseCount is typically used with the Databases property to iterate through the current set of active databases in a session. For example, the following code sets the KeepConnection property of each active database in the default session to true:


TSession::Databases

TSession	Properties	See also

Provides an indexed array of all active database component names for a session.

Syntax

__property TDatabase * Databases[System::Integer Index];

Description

Use Databases to access active database components associated with a session. An active database is one that is currently connected to a database server.

Databases is typically used with the DatabaseCount property to iterate through the current set of active databases in a session. For example, the following code sets the KeepConnection property of each active database in the default session to true:


TSession::Handle

TSession	Properties	See also

Specifies the Borland Database Engine (BDE) handle for the session.

Syntax

__property Bde::hDBISes Handle;

Description

Use Handle only to bypass TSession methods and write directly to the BDE API. Many BDE function calls require a handle parameter. Handle is assigned an initial value when a session is activated.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++ Builder components.


TSession::KeepConnections

TSession	Properties	See also

Specifies whether or not a temporary database component created in the context of a session maintains a database server connection even if there are no active datasets associated with the database component.

Syntax

__property System::Boolean KeepConnections;

Description

Use KeepConnections to specify whether or not temporary database components created at run time maintain server connections even when they have no active datasets. If KeepConnections is true (the default), the application maintains database connections until the application exits or calls the DropConnections method. For connections to remote database servers, or for applications that frequently open and close datasets, KeepConnections should remain true to reduce network traffic and speed up processing.

When KeepConnections is false, an application disconnects from a database when all datasets associated with a database component are closed. Dropping a connection releases system resources allocated to the connection, but if a dataset is later reopened that uses the same database, the connection must be reestablished and initialized.

Note

Duration of server connection for a persistent database component is determined by the database component’s KeepConnection property instead of the session’s KeepConnections property.


TSession::Locale

TSession	Properties	See also

Identifies the Borland Database Engine (BDE) language driver for the session component.

Syntax

__property System::Pointer Locale;

Description

Examine Locale to determine the BDE language driver used by the session component. Applications that make direct calls to the BDE may need to pass Locale information as an API function parameter.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++ Builder components.


TSession::NetFileDir

TSession	Properties	See also

Specifies the directory that contains the Borland Database Engine (BDE) network control file, PDOXUSRS.NET.

Syntax

__property System::AnsiString NetFileDir;

Description

Use NetFileDir to specify the directory that contains the BDE network control file, PDOXUSER.NET. This file governs the sharing of Paradox tables on network drives. All applications that share Paradox tables on a network directory must specify the same value for this property, and must have read, write, and create rights for the directory.

Borland C++ Builder derives an initial value for NetFileDir from the BDE configuration file for the Paradox driver. Any value assigned to NetFileDir at design time or run time overrides the BDE configuration setting.


TSession::PrivateDir

TSession	Properties	See also

Specifies the directory in which to store temporary table processing files generated by the Borland Database Engine (BDE) for database components associated with a session.

Syntax

__property System::AnsiString PrivateDir;

Description

Use PrivateDir to set the directory in which to store temporary table processing files for all database connections, such as those generated by the BDE to handle local SQL statements. If no value is specified for PrivateDir, the BDE automatically stores temporary files in the directory current at the time the BDE was initialized.

Note

For applications that run directly from a networked file server, the application might want to set PrivateDir to a user’s local drive to prevent temporary files from being created on the server where they might conflict with temporary files created by other instances of the application.


TSession::SessionName

TSession	Properties	See also

Specifies a unique session name that can be used by database and dataset components to link to this session.

Syntax

__property System::AnsiString SessionName;

Description

Set SessionName to a unique and meaningful name that can be used to link database and dataset components to the session. Database and dataset components each have corresponding SessionName properties that must either match the SessionName property of an active session or that be blank, indicating that they should be associated with the default session, Session.


TSession::TraceFlags

TSession	Properties	See also

Specifies the database operations to track with the SQL Monitor at run time.

Syntax

__property TTraceFlags TraceFlags;

Description

Use TraceFlags to specify which database operations the SQL Monitor should track in an application at run time. TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning and SQL debugging when working with remote SQL database servers.

Note

Normally trace options are set from the SQL Monitor rather than setting TraceFlags in application code.

The value of a session component’s TraceFlags property determines the initial settings of the TraceFlags property for database components associated with the session.

The TTraceFlags type defines the individual values that can be included in the TraceFlags property. The following table summarizes those values:

Values	Meaning

tfQPrepare	Monitor Prepare statements.

tfQExecute	Monitor ExecSQL statements.

tfError	Monitor server error messages. Such messages may include an error code.

tfStmt	Monitor all SQL statements.

tfConnect	Monitor database connect and disconnect operations, including allocation of connection handles, and freeing connection handles.

tfTransact	Monitor transaction statements, such as StartTransaction, Commit, and Rollback.

tfBlob	Monitor operations on blob data types.

tfMisc	Monitor any statements not covered by other flag options.

tfVendor	Monitor direct API function calls to the database server.

Because TraceFlags is a set property, an application can specify different combinations of flags to monitor different combinations of statements. For example, the following statement limits monitoring to database connections and SQL statement preparation:


TSession events

TSession	Alphabetically	Legend

In TSession

OnPassword

OnStartup


TSession events

TSession	By object	Legend

OnPassword

OnStartup


TSession::OnPassword

TSession	Events	See also

OnPassword occurs when an application attempts to open a Paradox table for the first time and the Borland Database Engine (BDE) reports insufficient access rights.

Syntax

__property TPasswordEvent OnPassword;

Description

Write an OnPassword event handler to take specific action when an application attempts to open a password-protected Paradox table for the first time. To gain access to the Paradox table, the event handler must pass a valid password to the BDE. The event handler should call the AddPassword method to make the password available to the session.

Note

If an OnPassword event does not exist, but the BDE reports insufficient access rights, Borland C++ Builder displays a default dialog box that prompts for a password.


TSession::OnStartup

TSession	Events	See also

OnStartup occurs when an application activates a session.

Syntax

__property Classes::TNotifyEvent OnStartup;

Description

Write an OnStartup event handler to take specific actions when an application activates a session. A session is activated by setting its Active property to true, or by opening a database or dataset associated with the session (both of which set Active to true).


TSession methods

TSession	Alphabetically

In TSession

~TSession

AddAlias

AddPassword

AddStandardAlias

Close

CloseDatabase

DeleteAlias

DropConnections

FindDatabase

GetAliasDriverName

GetAliasNames

GetAliasParams

GetConfigParams

GetDatabaseNames

GetDriverNames

GetDriverParams

GetPassword

GetStoredProcNames

GetTableNames

IsAlias

ModifyAlias

Open

OpenDatabase

RemoveAllPasswords

RemovePassword

SaveConfigFile

TSession

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSession methods

TSession	By object

~TSession

AddAlias

AddPassword

AddStandardAlias

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDatabase

Close

DefaultHandler

DeleteAlias

DestroyComponents

Destroying

Dispatch

DropConnections

FieldAddress

FindComponent

FindDatabase

FreeInstance

FreeNotification

Free

GetAliasDriverName

GetAliasNames

GetAliasParams

GetConfigParams

GetDatabaseNames

GetDriverNames

GetDriverParams

GetParentComponent

GetPassword

GetStoredProcNames

GetTableNames

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsAlias

MethodAddress

MethodName

ModifyAlias

NewInstance

OpenDatabase

Open

RemoveAllPasswords

RemoveComponent

RemovePassword

SaveConfigFile

TSession


TSession::AddAlias

TSession	Methods	See also

Adds a specified Borland Database Engine (BDE) alias to the session for an SQL database server.

Syntax

void __fastcall AddAlias(const System::AnsiString Name, const System::AnsiString Driver, Classes::TStrings *

Description

Call AddAlias at run time to create a session-specific BDE alias for an SQL database server. Name is the unique name to assign to the alias. Driver is the name of the SQL Links database driver to use for the alias. List is a string list containing parameters for the alias.

A session’s ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. the lifetime of the session. To save an alias permanently, call the SaveConfigFile method before ending the session.

Note

Although AddAlias can be used to create a Paradox or dBASE alias, AddStandardAlias provides a simpler method for Paradox and dBASE alias creation.

Example

This example creates an alias for an InterBase database server:


TSession::AddPassword

TSession	Methods	See also

Adds a password to the current session for accessing encrypted Paradox tables.

Syntax

void __fastcall AddPassword(const System::AnsiString Password);

Description

Call AddPassword to provide a password for a session prior to opening an encrypted Paradox table that requires a password. If an application opens a Paradox table that requires a password for access, the session does not have a password assigned to it, and the application does not provide its own OnPassword event handler, Borland C++ Builder displays a dialog box prompting the user for a valid password before allowing table access.

Note

If an application defines its own OnPassword event handler, the handler should call this method to add passwords for the session. All passwords assigned by AddPassword should be deleted with RemoveAllPasswords or RemovePassword before an application closes.


TSession::AddStandardAlias

TSession	Methods	See also

Adds a standard Borland Database Engine (BDE) alias to the session for Paradox, dBASE, or ASCII tables.

Syntax

void __fastcall AddStandardAlias(const System::AnsiString Name, const System::AnsiString Path, const System::AnsiString

Description

Call AddStandardAlias at run time to create a session-specific BDE alias for Paradox, dBASE or ASCII tables. Name is the unique name to assign to the alias. Path specifies the directory where the database is located. DefaultDriver is the name of the standard BDE driver to use for the alias. If set, DefaultDriver must be one of “Paradox,” “DBASE,” or “ASCIIDRV”. If left blank DefaultDriver defaults to “Paradox”. DefaultDriver is used when attempting to open a table that both does not have an extension and is defined as a table of type ttDefault.

A session’s ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. the lifetime of the session. To save an alias permanently, call the SaveConfigFile method before ending the session.

Note

To create an alias for an SQL database, call AddAlias instead of AddStandardAlias.


TSession::Close

TSession	Methods	See also

Disconnects from all databases, and closes the session.

Syntax

void __fastcall Close(void);

Description

Call Close to end a session. Close disconnects from all active databases by freeing temporary database components, and calling the Close methods persistent database components, and then sets its own session handle to NULL.

Note

Setting the Active property to false also closes a session.


TSession::CloseDatabase

TSession	Methods	See also

Closes a database connection associated with the current session.

Syntax

void __fastcall CloseDatabase(TDatabase *Database);

Description

Call CloseDatabase to close a persistent database connection, or to close and free a temporary database connection. Database specifies the name of the database component for which to close the connection.

CloseDatabase decrements the specified database component’s reference count, and then, if the reference count is zero and the database component’s KeepConnection property is false, CloseDatabase either frees a temporary database component or closes the connection for a persistent database component.

Note

Calling CloseDatabase for a persistent database component does not close the connection. To close a connection for a persistent database component, call the database component’s Close method directly.

Temporary database components are closed automatically when the last dataset associated with the database component is closed, but an application can call CloseDatabase prior to that time to force closure. Closing a connection established by a temporary database component does not free the component if the session’s KeepConnections property is true (the default). To free temporary database components after closing their connections call DropConnections.


TSession::DeleteAlias

TSession	Methods	See also

Removes a specified Borland Database Engine (BDE) alias from the session.

Syntax

void __fastcall DeleteAlias(const System::AnsiString Name);

Description

Call DeleteAlias to remove a BDE alias from a session. Removing an alias makes the alias unavailable to the session, but does not remove it from the BDE configuration file if the alias was stored there when it was created. To remove an alias from the BDE configuration file follow the call to DeleteAlias with a call to SaveConfigFile.


TSession::DropConnections

TSession	Methods	See also

Frees all temporary database components associated with a session if they are inactive.

Syntax

void __fastcall DropConnections(void);

Description

Use DropConnections to free all temporary database components that are currently inactive. If the KeepConnections property of the session is true (the default), then temporary database components created as needed for the session by Borland C++ Builder at run time are not automatically freed when their database connections are closed. DropConnections enables an application to free these components when they are no longer needed.


TSession::FindDatabase

TSession	Methods	See also

Searches a session’s list of database components for a specified database.

Syntax

TDatabase *__fastcall FindDatabase(const System::AnsiString DatabaseName);

Description

Call FindDatabase to determine whether or not a specified database is associated with a session. DatabaseName specifies the name of the database component for which to search.

FindDatabase compares DatabaseName to the DatabaseName property for each database component in a session’s list. If a match is found, FindDatabase returns a pointer to the database component. Otherwise FindDatabase returns NULL.

An application can call FindDatabase to see if a database component already exists before creating a new database component for a session.


TSession::GetAliasDriverName

TSession	Methods	See also

Provides the name of the database driver used by a specified Borland Database Engine (BDE) alias associated with the session.

Syntax

System::AnsiString __fastcall GetAliasDriverName(const System::AnsiString AliasName);

Description

Call GetAliasDriverName to determine the BDE database driver used by a specific alias. AliasName is the name of the alias for which to return driver information.

For aliases corresponding to Paradox and dBASE tables, GetAliasDriverName returns “STANDARD”. For ASCII tables the return value is “ASCIIDRV”. For SQL databases, the driver name depends on the database server.


TSession::GetAliasNames

TSession	Methods	See also

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases.

Syntax

void __fastcall GetAliasNames(Classes::TStrings *List);

Description

Call GetAliasNames to retrieve a list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file. List is a string list object, created and maintained by the application, into which to store the alias names.

A session’s ConfigMode property determines whether an alias created in the context of this session is reported by GetAliasNames. If ConfigMode is cmAll or cmPersistent, aliases created within the session are reported.


TSession::GetAliasParams

TSession	Methods	See also

Retrieves the parameters associated with a specified Borland Database Engine (BDE) alias.

Syntax

void __fastcall GetAliasParams(const System::AnsiString AliasName, Classes::TStrings *List);

Description

Call GetAliasParams to retrieve the BDE configuration parameters for a specified alias. AliasName is the name of the alias for which to retrieve parameters. List is a string list object, created and maintained by the application, into which to store the parameters.


TSession::GetConfigParams

TSession	Methods	See also

Retrieves Borland Database Engine (BDE) configuration information.

Syntax

void __fastcall GetConfigParams(const System::AnsiString Path, const System::AnsiString Section, Classes::TStrings *

Description

Call GetConfigParams to retrieve specific types of configuration information from the BDE configuration file used to initialize the application.

Path represents the internal node structure of the BDE configuration file, and must always start at the root, denoted by a backslash. Each node must be separated from others by a backslash, and no node may be empty. For example, a Path of \SYSTEM\FORMATS\TIME, returns the time format used by the BDE configuration file.

Path can contain a replaceable string formatting symbol (%s) in one of its node designations. If it does, Section must contain the missing node information. In this case, GetConfigParams inserts the contents of Section into Path before calling the BDE for the requested information.

List is a string list object, created and maintained by the application, into which to store the configuration information. For example, if Path is \DATABASES\%s\DB INFO, and Section is an alias name, then GetConfigParams returns the parameters for the alias in List.

For more information about the BDE Configuration File, see the on-line BDE help.


TSession::GetDatabaseNames

TSession	Methods	See also

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases and the names of all databases components known to the session.

Syntax

void __fastcall GetDatabaseNames(Classes::TStrings *List);

Description

Call GetDatabaseNames to retrieve a sorted, combined list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file—and the names of all database components known to the session. List is a string list object, created and maintained by the application, into which to store the database and alias names.


TSession::GetDriverNames

TSession	Methods	See also

Populates a string list with the names of all Borland Database Engine (BDE) drivers available to the session.

Syntax

void __fastcall GetDriverNames(Classes::TStrings *List);

Description

Call GetDriverNames to retrieve the names of all BDE drivers that can be used by a session. List is a string list object, created and maintained by the application, into which to store the driver names.


TSession::GetDriverParams

TSession	Methods	See also

Populates a string list with the parameters for a specified Borland Database Engine (BDE) driver.

Syntax

void __fastcall GetDriverParams(const System::AnsiString DriverName, Classes::TStrings *List);

Description

Call GetDriverParams to retrieve a list of parameters associated with a specified BDE driver. DriverName is the BDE driver for which to return a parameter list. List is a string list object, created and maintained by the application, into which to store the driver parameters.

The actual number of parameters returned by GetDriverParams depends on the specified driver. For example, for the STANDARD driver used by Paradox and dBASE, returns only a few parameters. For SQL Links drivers multiple parameters are returned.


TSession::GetPassword

TSession	Methods	See also

Invokes the OnPassword event handler for the session or displays the default password dialog box.

Syntax

System::Boolean __fastcall GetPassword(void);

Description

Call GetPassword to invoke the OnPassword event handler for the session and handle response logic when an application is working with password-protected Paradox files. If an OnPassword event handler is not defined, GetPassword displays the default password dialog box.

An application can use the return value of GetPassword to control program logic. GetPassword returns true if a user chooses OK, or false if the user chooses Cancel.


TSession::GetStoredProcNames

TSession	Methods	See also

Populates a string list with the names of all stored procedures associated with a specified database component that is connected to an SQL database server.

Syntax

void __fastcall GetStoredProcNames(const System::AnsiString DatabaseName, Classes::TStrings *List);

Description

Call GetStoredProcNames to retrieve a list of all stored procedures for a database component that is attached to an SQL database server. DatabaseName specifies the name of the database for which to retrieve stored procedure names. List is a string list object, created and maintained by the application, into which to return the stored procedure names.

Note

GetStoredProcNames raises an exception if called on Paradox or dBASE databases.


TSession::GetTableNames

TSession	Methods	See also

Populates a string list with the names of tables associated with a specified database component.

Syntax

void __fastcall GetTableNames(const System::AnsiString DatabaseName, const System::AnsiString Pattern

Description

Call GetTableNames to retrieve a list of the tables associated with a given database. DatabaseName specifies the name of the database from which to retrieve table names.

Pattern specifies a delimiter string that restricts the tables returned to those that match the string. Pattern can include wildcard symbols. Pass an empty Pattern string to match all files not restricted by other criteria.

For searches on Paradox and dBASE, set Extensions to true to include filename extensions as part of the table name. For SQL-based databases, set Extension to false.

Set SystemTables to true for SQL-based databases to return both data tables and the system tables that define the database structure. Set SystemTables to false for Paradox and dBASE tables.

List is a string list object, created and maintained by the application, into which to return the table names.


TSession::IsAlias

TSession	Methods	See also

Determines whether or not a string value corresponds to an existing Borland Database Engine (BDE) database alias known to the session.

Syntax

System::Boolean __fastcall IsAlias(const System::AnsiString Name);

Description

Call IsAlias to determine if a string corresponds to the name of an existing BDE alias that can be used by the session. Name is the string to test.

If IsAlias returns true, Name is a valid alias.

Note

The aliases known to IsAlias depend on the session’s ConfigMode property. If ConfigMode is cmAll, then all aliases are available to the session.


TSession::ModifyAlias

TSession	Methods	See also

Adds or changes parameters for a Borland Database Engine (BDE) alias.

Syntax

void __fastcall ModifyAlias( System::AnsiString Name, Classes::TStrings *List);

Description

Call ModifyAlias to change the parameters for a specified BDE alias. Name is the name of the alias to modify. List is a string list object previously populated with parameter values to add or change. An application must create and maintain List.

Populate List with parameter strings before calling ModifyAlias. List need only contain the parameters to change. If ModifyAlias passes a parameter for which a value already exists, the new parameter replaces the existing one. New parameters that are not yet defined for the alias are added to the existing parameters. If List is empty, ModifyAlias does not change any existing parameters.


TSession::Open

TSession	Methods	See also

Starts a session and makes it the current session.

Syntax

void __fastcall Open(void);

Description

Call Open to start a session other than the default session in a database application. Open sets Active to true, triggers an OnStartup event handler for the session and initializes the NetFileDir, PrivateDir, and ConfigMode properties.


TSession::OpenDatabase

TSession	Methods	See also

Opens an existing database, or creates a temporary database component and opens it.

Syntax

TDatabase *__fastcall OpenDatabase(const System::AnsiString DatabaseName);

Description

Call OpenDatabase to connect to a database for which a persistent database component already exists, or to create a temporary database component and connect to a database. DatabaseName specifies the database to open.

OpenDatabase makes the current session active, then calls FindDatabase to determine if the DatabaseName parameter corresponds to the DatabaseName property of an existing database component. If it does not, OpenDatabase creates a temporary database component, assigning the DatabaseName parameter to the DatabaseName property. Finally, OpenDatabase calls the Open method of the database to connect to a database server, then increments the session’s database reference count by one.


TSession::RemoveAllPasswords

TSession	Methods	See also

Deletes all passwords previously added to the current session for accessing encrypted Paradox tables.

Syntax

void __fastcall RemoveAllPasswords(void);

Description

Call RemoveAllPasswords to delete all current Paradox table passwords associated with the current session. Subsequent attempts to access encrypted Paradox tables fail unless an application first calls AddPassword to reestablish a password.

Note

Ordinarily an application should call RemoveAllPasswords to remove all session-specific passwords it creates from the Borland Database Engine (BDE) persistent store before terminating.


TSession::RemovePassword

TSession	Methods	See also

Deletes a single password previously added to the current session for accessing an encrypted Paradox table.

Syntax

void __fastcall RemovePassword(const System::AnsiString Password);

Description

Call RemovePassword to delete a single Paradox table password associated with the current session from the Borland Database Engine (BDE) persistent store. Subsequent attempts to access the encrypted Paradox table fails unless an application first calls AddPassword to reestablish a password.


TSession::SaveConfigFile

TSession	Methods	See also

Writes the current information in the Borland Database Engine (BDE) persistent store from memory to the BDE configuration file on disk.

Syntax

void __fastcall SaveConfigFile(void);

Description

Call SaveConfigFile to write any BDE configuration changes currently in memory to the BDE configuration file on disk. When the BDE is first initialized, the current BDE configuration file is read into persistent storage in memory. Applications can read or modify the configuration file in memory, but modification exist only in memory, not on disk.

For example, if an application defines a new BDE alias with AddAlias, the alias exists in memory only for as long as the BDE resides in memory. To store the new alias for later use by all applications that use the BDE, call SaveConfigFile. SaveConfigFile overwrites the disk image of the configuration file with the in-memory image of the persistent configuration file.

Note

If a session’s ConfigMode property is cmSession, added aliases cannot be saved to the BDE configuration file.


TSession::TSession

TSession	Methods	See also

TSession creates a new TSession object.

Syntax

__fastcall virtual TSession(Classes::TComponent *AOwner);

Description

Use TSession to create a new TSession object.


TSession::~TSession

TSession	Methods	See also

~TSession frees the memory associated with the TSession object.

Syntax

__fastcall virtual ~TSession(void);

Description

Do not call ~TSession directly. Instead, use the delete keyword on the object, which causes ~TSession to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TSession example

TSession


TShape

Hierarchy	Properties	Methods	Events

The TShape component displays a geometric shape on the form. It is a nonwindowed component.

Header

vcl/extctrls.hpp

You determine which geometric shape the shape control assumes by setting the Shape property. How the shape is painted depends on the two nested properties of the Brush object, Color and Style.

The TShape component is a direct descendent of TGraphicControl. In addition to the following properties, methods, and events, this component also has the properties and methods that apply to all controls.


TShape properties

TShape	Alphabetically	Legend

In TShape

Brush

Pen

Shape

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TShape properties

TShape	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Owner

ParentShowHint

Parent

Pen

Shape

ShowHint

Tag

Top

Visible

Width


TShape::Brush

TShape	Properties

Determines the color and pattern used for filling the shape control.

Syntax

__property Graphics::TBrush * Brush;


Pen

Determines what kind of pen is used for outline of the shape control.


TShape::Shape

TShape	Properties

Determines the shape of a shape control.

Syntax

__property TShapeType Shape;

These are the possible values and their meanings:

Value	Meaning

stEllipse	The shape is an ellipse.

stRectangle	The shape is a rectangle.

stRoundRect	The shape is a rectangle with rounded corners.

stRoundSquare	The shape is a square with rounded corners.

stSquare	The shape is a square.

stCircle	The shape is a circle.


TShape events

TShape	Alphabetically	Legend

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TShape events

TShape	By object	Legend

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnDragDrop


OnDragOver


OnEndDrag


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TShape methods

TShape	Alphabetically

In TShape

~TShape

TShape

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TShape methods

TShape	By object

~TShape

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TShape

Update


TShape::TShape

TShape	Methods	See also

TShape creates a new TShape object.

Syntax

__fastcall virtual TShape(Classes::TComponent *AOwner);

Description

Use TShape to create a new TShape object.


TShape::~TShape

TShape	Methods	See also

~TShape frees the memory associated with the TShape object.

Syntax

__fastcall virtual ~TShape(void);

Description

Do not call ~TShape directly. Instead, use the delete keyword on the object, which causes ~TShape to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TShape example

TShape


TSimpleFrameSite

Hierarchy	Methods

Header

vcl/olectrls.hpp

Description


TSimpleFrameSite methods

TSimpleFrameSite	Alphabetically

In TSimpleFrameSite

~TSimpleFrameSite

AddRef

PostMessageFilter

PreMessageFilter

QueryInterface

Release

TSimpleFrameSite

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSimpleFrameSite methods

TSimpleFrameSite	By object

~TSimpleFrameSite

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

PostMessageFilter

PreMessageFilter

QueryInterface

Release

TSimpleFrameSite


TSimpleFrameSite::AddRef

TSimpleFrameSite	Methods

Syntax

virtual System::Longint __stdcall AddRef(void);

Description


TSimpleFrameSite::PostMessageFilter

TSimpleFrameSite	Methods

Syntax

virtual System::Longint __stdcall PostMessageFilter(System::Integer wnd, System::Integer msg, System::Integer

Description


TSimpleFrameSite::PreMessageFilter

TSimpleFrameSite	Methods

Syntax

virtual System::Longint __stdcall PreMessageFilter(System::Integer wnd, System::Integer msg, System::Integer

Description


TSimpleFrameSite::QueryInterface

TSimpleFrameSite	Methods

Syntax

virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);

Description


TSimpleFrameSite::Release

TSimpleFrameSite	Methods

Syntax

virtual System::Longint __stdcall Release(void);

Description


TSimpleFrameSite::TSimpleFrameSite

TSimpleFrameSite	Methods	See also

TSimpleFrameSite creates a new TSimpleFrameSite object.

Syntax

__fastcall TSimpleFrameSite(TOleControl *Control);

Description

Use TSimpleFrameSite to create a new TSimpleFrameSite object.


TSimpleFrameSite::~TSimpleFrameSite

TSimpleFrameSite	Methods	See also

~TSimpleFrameSite frees the memory associated with the TSimpleFrameSite object.

Syntax

__fastcall virtual ~TSimpleFrameSite(void);

Description

Do not call ~TSimpleFrameSite directly. Instead, use the delete keyword on the object, which causes ~TSimpleFrameSite to be invoked automatically.


Hierarchy

TObject

IUnknown

ISimpleFrameSite


TSimpleFrameSite example

TSimpleFrameSite


TSmallIntField

Hierarchy	Properties	Methods	Events	See also

A TSmallintField component represents a signed 16-bit integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Small-integer fields can hold values in the range -32768 to 32767, and are used to hold values that are signed 16-bit whole numbers.

TSmallIntField differs from its immediate ancestor TIntegerField only in the data type it represents. Except for the constructor, all of the properties, methods, and events are the same as those of TIntegerField, and provide functionality that is useful for managing the value and properties of a integral numeric field in a database.


TSmallIntField properties

TSmallIntField	Alphabetically	Legend

Derived from TIntegerField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TSmallIntField properties

TSmallIntField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TSmallIntField events

TSmallIntField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TSmallIntField events

TSmallIntField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TSmallIntField methods

TSmallIntField	Alphabetically

Derived from TSmallintField

~TSmallIntField

In TSmallIntField

TSmallIntField

Derived from TIntegerField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSmallIntField methods

TSmallIntField	By object

~TSmallIntField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TSmallIntField


TSmallIntField

TSmallIntField creates a new TSmallIntField object.

Description

Use TSmallIntField to create a new TSmallIntField object.


~TSmallIntField

~TSmallIntField frees the memory associated with the TSmallIntField object.

Description

Do not call ~TSmallIntField directly. Instead, use the delete keyword on the object, which causes ~TSmallIntField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TSmallIntField example

TSmallIntField


TSpeedButton

Hierarchy	Properties	Methods	Events	See also

TSpeedButton is a button, usually with a graphical image on its face, that is used to execute commands or set modes.

Header

vcl/buttons.hpp

Overview

TSpeedButton introduces properties that can be used to set graphical images to represent the different button states (selected, unselected, disabled and so on). You can use other properties to specify multiple images or to rearrange the images and text on the button. Speed button properties also enable them to work together as a group. They are commonly used in this way with panels (TPanel) to create tool bars and tool palettes.


TSpeedButton properties

TSpeedButton	Alphabetically	Legend

In TSpeedButton

AllowAllUp

Down

Glyph

GroupIndex

Layout

Margin

NumGlyphs

Spacing

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TSpeedButton properties

TSpeedButton	By object	Legend

Align

AllowAllUp

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Down

Enabled

Font

Glyph

GroupIndex

Height

Hint

Layout

Left

Margin

Name

NumGlyphs

Owner

ParentFont

ParentShowHint

Parent

ShowHint

Spacing

Tag

Top

Visible

Width


TSpeedButton::AllowAllUp

TSpeedButton	Properties

Determines if all speed buttons in a group this speed button belongs to can be unselected (in their up state) at the same time.

Syntax

__property System::Boolean AllowAllUp;

AllowAllUp should be used only with speed buttons in a group (that is, each button's GroupIndex property is not zero). See the GroupIndex property for information on how to create a group of speed buttons. If GroupIndex is zero, AllowAllUp has no effect.

If AllowAllUp is true, all of the speed buttons in a group can be unselected. All buttons can appear in their up state.

If AllowAllUp is false, one of the speed buttons belonging to a group must be selected (in its down state) at all times. Clicking a down button won't return the button to its up state. The button only becomes unselected when the user clicks one of the other buttons in the group. In such a group, one button must always be selected. Determine which speed button will be initially down by setting its Down property to true.

The default value is false.

Changing the value of the AllowAllUp property for one speed button in a group changes the AllowAllUp value for all buttons in the group.

You can use AllowAllUp with a single bitmap button in its own group (with a GroupIndex value greater than 0) so that the button can be selected and remain selected until the user clicks the button again--at which time it becomes unselected. In other words, the button can work much like a check box. To make a single speed button behave this way, set its GroupIndex property to a value greater than 0 (but different from any other GroupIndex value of any other speed buttons you have), and set AllowAllUp to true.


TSpeedButton::Down

TSpeedButton	Properties

Determines if the button appears in an up (unselected) or down (selected) state.

Syntax

__property System::Boolean Down;

Speed buttons are initially in their up (unselected) state. This occurs because the default setting of the Down property is false.

To initially display a speed button in its down state, set the Down property to true. For example, if you use a panel component with several speed buttons to create a tools palette, you might want one of the speed buttons selected when the palette first appears.

Although you can use a group of speed buttons with the AllowAllUp property set to false to make the tool palette buttons work as a group, you must set the Down property for the button you want to be selected initially. You can also use the Down property at run time any time you want to put a button in a down state without the user clicking it first.


TSpeedButton::Glyph

TSpeedButton	Properties

Specifies the bitmap that appears on the selected speed button.

Syntax

__property Graphics::TBitmap * Glyph;

Use the Open dialog box that appears as an editor in the Object Inspector to choose a bitmap file (with a .BMP extension) to use on the button, or specify a bitmap file at run time.

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++ Builder then displays one of these images depending on the state of the button.

Image position in bitmap	Button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++ Builder also uses this image for all other images.

Second	Disabled	This image usually appears dimmed to indicate that the button can't be selected.

Third	Down	This image appears when a button is clicked. The up state image reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected. (This fourth state applies only to speed buttons.)

If only one image is present, Borland C++ Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren't satisfied with the results, you can provide one or more additional images in the bitmap.

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a horizontal row.

Note

The lower left hand pixel of the bitmap is reserved for the "transparent" color. Any pixel in the bitmap which matches that lower left hand pixel will be "transparent".


TSpeedButton::GroupIndex

TSpeedButton	Properties

Determines which speed buttons work together as a group.

Syntax

__property System::Integer GroupIndex;

By default, speed buttons have a GroupIndex property value of 0, indicating that they do not belong to a group. When the user clicks such a speed button, the button appears "pressed," or in its down state, then the button returns to its normal up state when the user releases the mouse button.

Speed buttons with the same GroupIndex property value (other than 0), work together as a group. When the user clicks one of these speed buttons, it remains "pressed," or in its down state, until the user clicks another speed button belonging to the same group. Speed buttons used in this way can present mutually exclusive choices to the user.


TSpeedButton::Layout

TSpeedButton	Properties

Determines where the image appears on the bitmap button or a speed button.

Syntax

__property TButtonLayout Layout;

These are the possible values.:

Table Part 0.1

Value	Meaning

blGlyphLeft	The image appears near the left side of the button.

blGlyphRight	The image appears near the right side of the button.

blGlyphTop	The image appears near the top of the button.

blGlyphBottom	The image appears near the bottom of the button.

The TButtonLayout type defines the values the Layout property of a speed button (TSpeedButton) can assume.


TSpeedButton::Margin

TSpeedButton	Properties

Determines the number of pixels between the edge of the image (specified in the Glyph property) and the edge of the button.

Syntax

__property System::Integer Margin;

The edges that the margin separates depends on the layout of the image and text (specified in the Layout property). For example, if Layout is blGlyphLeft, the margin appears between the left edge of the image and the left edge of the button. If Margin is 3, three pixels separates the image and the button edges. If Margin is 0, no distance in pixels separates the image and the button edges.

If Margin is -1 (which it is by default), then the image and text (specified in the Caption property) are centered. The number of pixels between the image and button edge is equal to the number of pixels between the opposite edge of the button and the text.


TSpeedButton::NumGlyphs

TSpeedButton	Properties

Indicates the number of images that are in the graphic specified in the Glyph property for use on a speed button.

Syntax

__property TNumGlyphs NumGlyphs;

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a row. Valid NumGlyphs values are 1 to 4. The default value is 1.

Image position in bitmap	Button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++ Builder also uses this image for all other images.

Second	Disabled	This image usually appears dimmed to indicate that the button can't be selected.

Third	Down	This image appears when a button is clicked. The up state image reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected. (This fourth state applies only to speed buttons.)

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++ Builder then displays one of these images depending on the state of the button. Only one image is required in a bitmap.

Image position in bitmap	Button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++ Builder also uses this image for all other images.

Second	Disabled	This image usually appears dimmed to indicate that the button can't be selected.

Third	Down	This image appears when a button is clicked. The up state image reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected. (This fourth state applies only to speed buttons.)

If only one image is present, Borland C++ Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren't satisfied with the results, you can provide additional images in the bitmap.

The TNumGlyphs type defines the range of values (1-4) the NumGlyphs property of a speed button can assume.


TSpeedButton::Spacing

TSpeedButton	Properties

Determines where the image and text appear on a speed button.

Syntax

__property System::Integer Spacing;

Spacing determines the number of pixels between the image (specified in the Glyph property) and the text (specified in the Caption property). The default value is 4 pixels.

If Spacing is a positive number, its value is the number of pixels between the image and text. If Spacing is 0, no pixels will be between the image and text. If Spacing is -1, the text appears centered between the image and the button edge. The number of pixels between the image and text is equal to the number of pixels between the text and the button edge opposite the glyph.


TSpeedButton events

TSpeedButton	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


TSpeedButton events

TSpeedButton	By object	Legend

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


OnClick


OnDblClick


OnMouseDown


OnMouseMove


OnMouseUp


TSpeedButton methods

TSpeedButton	Alphabetically

In TSpeedButton

~TSpeedButton

Click

TSpeedButton

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSpeedButton methods

TSpeedButton	By object

~TSpeedButton

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TSpeedButton

Update


TSpeedButton::Click

TSpeedButton	Methods

Simulates a mouse click, as if the user had clicked a button, executing any RefSyn attached to the OnClick event.

Syntax

virtual void __fastcall Click(void);


TSpeedButton::TSpeedButton

TSpeedButton	Methods	See also

TSpeedButton creates a new TSpeedButton object.

Syntax

__fastcall virtual TSpeedButton(Classes::TComponent *AOwner);

Description

Use TSpeedButton to create a new TSpeedButton object.


TSpeedButton::~TSpeedButton

TSpeedButton	Methods	See also

~TSpeedButton frees the memory associated with the TSpeedButton object.

Syntax

__fastcall virtual ~TSpeedButton(void);

Description

Do not call ~TSpeedButton directly. Instead, use the delete keyword on the object, which causes ~TSpeedButton to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TSpeedButton example

TSpeedButton


TStoredProc

Hierarchy	Properties	Methods	Events

The TStoredProc component enables Borland C++ Builder applications to execute server stored procedures. Set the DatabaseName property to specify the database in which the stored procedure is defined. Set the StoredProcName to the name of the stored procedure on the server.

Header

vcl/dbtables.hpp

A stored procedure has a Params array for its input and output parameters, similar to a TQuery component. The order of the parameters in the Params array is determined by the stored procedure definition. An application can set the values of input parameters and get the values of output parameters in the array similar to TQuery parameters. You can also use ParamByName to access the parameters by name. If you are not sure of the ordering of the input and output parameters for a stored procedure, use the Parameters Editor.

Before an application can execute a stored procedure, you must prepare the stored procedure, which can be done:

•	At design time with the Parameters Editor.

•	At run time with the Prepare method.

A stored procedure can return either a singleton result or a result set with a cursor, if the server supports it. Execute a stored procedure with the ExecProc method, if the stored procedure returns a singleton result (one row), or Open method, if the stored procedure returns a result set (multiple rows).

Note

InterBase “select procedures” are called with the SELECT statement as if querying a table. To get output from such procedures, use a TQuery component with the appropriate SELECT syntax.

The OnServerYieldEvent occurs periodically during a query executing on a Sybase server. Setting the parameter AbortQuery to false will cancel the query during execution.

The TStoredProc component is an indirect descendent of TComponent. In addition to the following properties, methods, and events, this component also has the properties and methods that apply to all components.


TStoredProc properties

TStoredProc	Alphabetically	Legend

In TStoredProc

Overload

ParamBindMode

ParamCount

Params

Prepared

StmtHandle

StoredProcName

Derived from TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

Derived from TDataSet

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

DataSource

DefaultFields

Designer

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TStoredProc properties

TStoredProc	By object	Legend

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

KeySize

Locale

Modified

Name

Overload

Owner

ParamBindMode

ParamCount

Params

Prepared

RecNo

RecordCount

RecordSize

SessionName

State

StmtHandle

StoredProcName

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending


TStoredProc::Overload

TStoredProc	Properties

Determines which Oracle procedure with the same name as another executes.

Syntax

__property System::Word Overload;

Oracle servers allow overloading of stored procedures in an Oracle package; that is, different procedures with the same name.

Set the Overload property to specify the procedure to execute on an Oracle server. If Overload is zero (the default), there is assumed to be no overloading. If Overload is one (1), then Borland C++ Builder will execute the first stored procedure with the overloaded name; if it is two (2), it will execute the second, and so on.


TStoredProc::Prepared

TStoredProc	Properties

Determines whether a stored procedure has been submitted to the server for optimization purposes.

Syntax

__property System::Boolean Prepared;

Setting Prepared to true will not execute the procedure; it simply advises the server that the procedure will need to be executed at some future time. Setting Prepared to true is equivalent to calling the Prepare method; setting it to false is equivalent to calling the UnPrepare method.


TStoredProc::StmtHandle

TStoredProc	Properties

[REVISIT THIS DESCRIPTION]

Syntax

__property Bde::hDBIStmt StmtHandle;

The StmtHandle property enables an application to make direct calls to the Borland Database Engine (BDE) API using the result of the last query. Under most circumstances you should not need to use this property, unless your application requires some functionality not encapsulated in the VCL.


TStoredProc::StoredProcName

TStoredProc	Properties

Contains the name of the stored procedure on the server.

Syntax

__property System::AnsiString StoredProcName;

Oracle servers allow more than one stored procedure with the same name. Set the Overload property to specify the procedure to execute on an Oracle server.


TStoredProc events

TStoredProc	Alphabetically	Legend

Derived from TDataSet

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TStoredProc events

TStoredProc	By object	Legend

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


OnCalcFields


OnDeleteError


OnEditError


OnFilterRecord


OnNewRecord


OnPostError


OnServerYield


OnUpdateError


OnUpdateRecord


TStoredProc methods

TStoredProc	Alphabetically

In TStoredProc

~TStoredProc

CopyParams

DescriptionsAvailable

ExecProc

GetResults

ParamByName

Prepare

TStoredProc

UnPrepare

Derived from TDBDataSet

CheckOpen

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStoredProc methods

TStoredProc	By object

~TStoredProc

ActiveBuffer

AppendRecord

Append

ApplyUpdates

Assign

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

ControlsDisabled

CopyParams

CursorPosChanged

DefaultHandler

Delete

DescriptionsAvailable

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecProc

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetParentComponent

GetResults

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SetDetailFields

SetFields

TStoredProc

UnPrepare

UpdateCursorPos

UpdateRecord

UpdateStatus


TStoredProc::CopyParams

TStoredProc	Methods

Copies parameters from one stored procedure to another.

Syntax

void __fastcall CopyParams(TParams *Value);

The CopyParams method copies all of the parameter information from the stored procedure component to Value. Use this method to copy parameters from one stored procedure component to another.


TStoredProc::DescriptionsAvailable

TStoredProc	Methods

Indicates whether stored procedure information is available from the server.

Syntax

System::Boolean __fastcall DescriptionsAvailable(void);

If the information is available, it returns true. Otherwise, it returns false. Different servers may require additional information to obtain the parameter information. If DescriptionsAvailable returns false, you will have to specify parameters either with the Parameters Editor or with explicit RefSyn.


TStoredProc::ExecProc

TStoredProc	Methods

Executes the stored procedure on the server.

Syntax

void __fastcall ExecProc(void);

If any input parameters are to be used, specify them first in the Params property at design time or at run time. Call the Prepare method before executing the stored procedure with ExecProc. If any output parameters are returned from the stored procedure, the values can be accessed by indexing into the Params string list or by using the ParamByName method.


TStoredProc::GetResults

TStoredProc	Methods

Returns the output parameter values from the stored procedure.

Syntax

void __fastcall GetResults(void);

You must call this method only with a Sybase stored procedure that returns a result set. GetResults returns the output parameter values from the stored procedure. Usually, TStoredProc does this automatically, but Sybase stored procedures do not return the values until the cursor reaches the end of the result set, so you must call GetResults explicitly.


TStoredProc::ParamByName

TStoredProc	Methods

Assigns values to parameters in a stored procedure, using the parameter names.

Syntax

TParam *__fastcall ParamByName(const System::AnsiString Value);

The ParamByName method returns the element of the Params property whose Name property matches Value. Use it to assign values to parameters in a stored procedure by name.


TStoredProc::Prepare

TStoredProc	Methods

Prepares the stored procedure to be executed.

Syntax

void __fastcall Prepare(void);

Prepare allows the server to load the procedure and otherwise prepare for execution.


TStoredProc::UnPrepare

TStoredProc	Methods

Notifies the server that stored procedure is no longer needed, allowing the server to release any resources allocated to the stored procedure.

Syntax

void __fastcall UnPrepare(void);


TStoredProc::TStoredProc

TStoredProc	Methods	See also

TStoredProc creates a new TStoredProc object.

Syntax

__fastcall virtual TStoredProc(Classes::TComponent *AOwner);

Description

Use TStoredProc to create a new TStoredProc object.


TStoredProc::~TStoredProc

TStoredProc	Methods	See also

~TStoredProc frees the memory associated with the TStoredProc object.

Syntax

__fastcall virtual ~TStoredProc(void);

Description

Do not call ~TStoredProc directly. Instead, use the delete keyword on the object, which causes ~TStoredProc to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TDBDataSet


TStoredProc example

TStoredProc


TStream

Hierarchy	Properties	Methods	See also

TStream is the abstract base class type for Borland C++ Builder stream objects that can store binary data in various kinds of storage media, such as disk files, dynamic memory, and so on.

Header

vcl/classes.hpp

Description

TStream encapsulates methods for generic file I/O. For this purpose TStream defines methods that provide for reading, writing, and copying bytes to and from the stream, and for seeking the current position in the stream. Properties of TStream provide information about the stream, such as its size and the current position in the stream.

TStream also introduces methods that work in conjunction with components and filers for streaming components in simple and inherited forms. These methods are called automatically by global routines that initiate component streaming. They can also be called directly to the initiate the streaming process. Note, however, that component streaming always involves two additional objects:

•	A component object that is passed as a parameter to the stream’s methods.

•	A filer object that is automatically created by the stream, and associated with the stream.

As an abstract class TStream cannot be instantiated. Descendant stream objects, such as memory and file streams used for component streaming, are created automatically when using the global functions ReadComponentRes and WriteComponentRes. For streaming other kinds of information, choose a descendent class according to the specific data and storage needs.


TStream properties

TStream	Alphabetically	Legend

In TStream

Position

Size


TStream properties

TStream	By object	Legend

Position

Size


TStream::Position

TStream	Properties	See also

Position indicates the current offset into the stream for reading and writing.

Syntax

__property System::Longint Position;

Description

Use Position to query the current position of the stream. Position is used internally by filer objects when reading and writing data to and from the stream.


TStream::Size

TStream	Properties	See also

Size indicates the size in bytes of the stream.

Syntax

__property System::Longint Size;

Description

Use Size to find the size of the stream. Size is used internally in routines that read and write to and from the stream.


TStream methods

TStream	Alphabetically

In TStream

~TStream

CopyFrom

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

Seek

TStream

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStream methods

TStream	By object

~TStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

TStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TStream::CopyFrom

TStream	Methods

CopyFrom copies a specified number of bytes from one stream to another.

Syntax

System::Longint __fastcall CopyFrom(TStream *Source, System::Longint Count);

Description

Use CopyFrom to copy data to the stream from a different stream. Using CopyFrom eliminates the need for the user to create, read into, write from, and free a buffer when copying data.

CopyFrom copies Count bytes from the stream specified by Source into the stream. It then moves the current position by Count bytes, and returns the number of bytes copied.

If Count is 0, CopyFrom sets Source osition to 0 before reading and then copies the entire contents of Source into the stream. If Count is greater than or less than 0, CopyFrom reads from the current position in Source.


TStream::Read

TStream	Methods	See also

TStream introduces Read as an abstract method.

Syntax

virtual System::Longint __fastcall Read(void *Buffer, System::Longint Count);

Description

Each descendant stream object defines a Read method that reads data from its particular storage medium (such as memory or a disk file).

Read is used in cases where the number of bytes to read from the stream is not necessarily fixed.

All the other data-reading methods of a stream (ReadBuffer, ReadComponent) call Read to do their actual reading.


TStream::ReadBuffer

TStream	Methods	See also

ReadBuffer reads bytes from the stream into Buffer.

Syntax

void __fastcall ReadBuffer(void *Buffer, System::Longint Count);

Description

Use ReadBuffer to read Count bytes from the stream into a buffer in cases where the number of bytes is known and fixed, for example when reading in structures. ReadBuffer is used internally for loading from a stream and copying from a stream.

ReadBuffer calls Read to do the actual reading. If reading attempts to read past the end of the stream, an EReadError exception is raised.


TStream::ReadComponent

TStream	Methods	See also

ReadComponent is one of several ways to intiate streaming of components and their properites.

Syntax

TComponent *__fastcall ReadComponent(TComponent *Instance);

Description

ReadComponent is called indirectly by the global routine ReadComponentRes, by the ReadComponentRes method, or it can be called directly to initiate streaming of components.

ReadComponent reads data values from the stream and assigns them to Instance’s properties. It then constructs a reader object and calls the reader’s ReadRootComponent method to read Instance’s property values and construct child objects defined in the stream as children of the Instance. ReadComponent returns the component.

If Instance is NULL, ReadComponent constructs a component based on the type information in the stream and returns the newly-constructed component.


TStream::ReadComponentRes

TStream	Methods	See also

ReadComponentRes is one of several ways to intiate streaming of components and their properites.

Syntax

TComponent *__fastcall ReadComponentRes(TComponent *Instance);

Description

ReadComponentRes is called automatically by the global routine ReadComponentResFile. It can also be called directly if the current position of the stream points to a component written using the WriteComponentRes method.

ReadComponentResFile creates a file stream object which then calls its ReadComponentRes method.

ReadComponentRes first calls the ReadResHeader method to read a resource header from the stream. If the stream does not contain a resource header at the current position, ReadResHeader will raise an EInvalidImage exception. ReadComponentRes then calls ReadComponent to read Instance.


TStream::ReadResHeader

TStream	Methods	See also

ReadResHeader is used internally by the streaming system to read a Windows resource-file header from the stream.

Syntax

void __fastcall ReadResHeader(void);

Description

Do not call ReadResHeader directly. It is called automatically by ReadComponentRes before reading a component from a resource file.

After reading the resource-file header, ReadResHeader moves the current position of the stream to just beyond the header. If the stream does not contain a valid resource-file header, ReadResHeader raises an EInvalidImage exception.


TStream::Seek

TStream	Methods

TStream introduces Seek as an abstract method.

Syntax

virtual System::Longint __fastcall Seek(System::Longint Offset, System::Word Origin);

Description

Each descendant stream object defines a Seek method that moves the current position of the stream in its particular storage medium (such as memory or a disk file).

Seek is called by the Position and Size properties.


TStream::Write

TStream	Methods	See also

TStream introduces Write as an abstract method.

Syntax

virtual System::Longint __fastcall Write(const void *Buffer, System::Longint Count);

Description

Each descendant stream object defines a Write method that writes data to its particular storage medium (such as memory or a disk file). All the other data-writing methods of a stream (WriteBuffer, WriteComponent) call Write to do their actual writing.


TStream::WriteBuffer

TStream	Methods	See also

WriteBuffer writes Count bytes from Buffer onto the stream and advances the current position of the stream by Count bytes.

Syntax

void __fastcall WriteBuffer(const void *Buffer, System::Longint Count);

Description

Use WriteBuffer to save data to a stream. WriteBuffer and ReadBuffer are used in cases where the number of bytes is known and required, for example when reading in structures. Use WriteBuffer for standard file I/O streaming.

WriteBuffer is used internally for writing to a stream and copying from a stream. It is used by other objects, such as strings and lists, for writing strings to a buffer.

WriteBuffer calls Write to handle the actual writing. If the stream fails to write all the requested bytes, an EWriteError exception is raised.


TStream::WriteComponent

TStream	Methods	See also

WriteComponent is one of several ways to intiate writing components and their properites to a stream.

Syntax

void __fastcall WriteComponent(TComponent *Instance);

Description

WriteComponent is used internally in the Borland C++ Builder streaming system, but can also be called directly when writing components to memory streams or database blobs.

WriteComponent constructs a writer object and calls its WriteRootComponent method to write the component specified by Instance, and its owned objects, to the stream.


TStream::WriteComponentRes

TStream	Methods	See also

WriteComponentRes is one of several ways to intiate writing components and their properites to a stream.

Syntax

void __fastcall WriteComponentRes(const System::AnsiString ResName, TComponent *Instance);

Description

WriteComponentRes is used internally in the Borland C++ Builder streaming system, but can also be called directly when sending data to other appliactions on disk. WriteComponentRes is used for streaming components that need data, such as a bitmap, or icon to be stored specifically in a Windows resource-file format.

WriteComponentRes calls WriteDescendentRes, passing in NULL as the Ancestor. Therefore, WriteDescendentRes initiates the remainder of the streaming process for a component that, in this case, is not a descendent.

To read a component written with WriteComponentRes, call the ReadComponentRes method.


TStream::WriteDescendent

TStream	Methods	See also

WriteDescendent is used internally by the streaming system to stream components and their properties in inherited forms.

Syntax

void __fastcall WriteDescendent(TComponent *Instance, TComponent *Ancestor);

Description

Do not call WriteDescendent directly. WriteDescendent is called automatically by WriteComponent.

WriteDescendent constructs a writer object, then calls the writer object's WriteDescendent method to write the component passed in Instance to the stream. Instance is either an inherited form descended from Ancestor or NULL. However, WriteDescendent is never used to write owned components, only to initiate streaming on the root component.


TStream::WriteDescendentRes

TStream	Methods	See also

WriteDescendentRes is used internally by the streaming system to stream components and their properties in inhertied forms.

Syntax

void __fastcall WriteDescendentRes(const System::AnsiString ResName, TComponent *Instance, TComponent *

Description

Do not call WriteDescendentRes directly. WriteDescendentRes is called automatically by WriteComponentRes.

WriteDescendentRes writes a standard Windows resource-file header to the stream, using the resource name passed in ResName as the name of the resource. It then calls WriteDescendent to write Instance to the stream as a descendant of Ancestor.


TStream::TStream

TStream	Methods	See also

TStream creates a new TStream object.

Syntax

__fastcall TStream(void);

Description

Use TStream to create a new TStream object.


TStream::~TStream

TStream	Methods	See also

~TStream frees the memory associated with the TStream object.

Syntax

__fastcall virtual ~TStream(void);

Description

Do not call ~TStream directly. Instead, use the delete keyword on the object, which causes ~TStream to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject


TStream example

TStream


TStringGridStrings

Hierarchy	Properties	Methods

Header

vcl/grids.hpp

Description


TStringGridStrings properties

TStringGridStrings	Alphabetically	Legend

In TStringGridStrings

Count

Objects

Strings

Derived from TStrings

CommaText

Names

Text

Values


TStringGridStrings properties

TStringGridStrings	By object	Legend

CommaText

Count

Names

Objects

Strings

Text

Values


TStringGridStrings::Count

TStringGridStrings	Properties

Syntax

Description


TStringGridStrings::Objects

TStringGridStrings	Properties

Syntax

Description


TStringGridStrings::Strings

TStringGridStrings	Properties

Syntax

Description


TStringGridStrings methods

TStringGridStrings	Alphabetically

In TStringGridStrings

~TStringGridStrings

Assign

TStringGridStrings

Derived from TStrings

Add

AddObject

AddStrings

Append

BeginUpdate

Clear

Delete

EndUpdate

Equals

Exchange

GetText

IndexOf

IndexOfName

IndexOfObject

Insert

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringGridStrings methods

TStringGridStrings	By object

~TStringGridStrings

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SaveToFile

SaveToStream

SetText

TStringGridStrings


TStringGridStrings::Assign

TStringGridStrings	Methods

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description


TStringGridStrings::TStringGridStrings

TStringGridStrings	Methods	See also

TStringGridStrings creates a new TStringGridStrings object.

Syntax

__fastcall TStringGridStrings(TStringGrid *AGrid, System::Longint AIndex);

Description

Use TStringGridStrings to create a new TStringGridStrings object.


TStringGridStrings::~TStringGridStrings

TStringGridStrings	Methods	See also

~TStringGridStrings frees the memory associated with the TStringGridStrings object.

Syntax

__fastcall virtual ~TStringGridStrings(void);

Description

Do not call ~TStringGridStrings directly. Instead, use the delete keyword on the object, which causes ~TStringGridStrings to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings


TStringGridStrings example

TStringGridStrings


TStrings

Hierarchy	Properties	Methods

TStrings objects are used by various components to manipulate strings. A string object has no way to store a string, but instead uses the native storage ability of the control that uses it.

Header

vcl/classes.hpp

For example, the Items property of a list box control is of type TStrings. The strings that appear in a list box control are stored in a list box string object (TListBoxStrings), which is derived from TStrings. When you add or delete items in a list box, you are adding and deleting them from a list box string object.

To maintain a list of strings outside of a control, use a string list object (TStringList).

You can add, delete, insert, move, and exchange strings using the Add, Append, Delete, Insert, Move, and Exchange methods of a string object. The Clear method clears all the strings in the list of strings. The Count property contains the number of strings in the list. Each string object has a Strings property that lets you access a particular string by its position in the list of strings. The Names property lets you access the name part of a string at a particular position in the list of strings when the string is of the form Name=Value. To find the position of a string in the list, use either the IndexOf or the IndexOfName method.

To add several strings at once to a list of strings, use the AddStrings method. Use the Text and CommaText properties to add to and retrieve the list of strings in the strings object. You can assign one string object to another using the Assign method.

To compare two lists of strings, use the Equals method.

Each string can be associated with an object. The objects associated with strings are commonly used to place a bitmap in an owner-draw control. If you want to add a string and an object to string list at the same time, use the AddObject method. You can access a particular object by its position in the list of objects using the Objects property. To find the position of the object in the list, use the IndexOfObject method. To insert an object, call the InsertObject method. The Delete, Move, Clear, and Exchange methods operate on the object associated with a string as well as on the string itself. For example, calling Clear removes all strings and all their associated objects.

You can store strings in a file and then load them all at one using either the LoadFromFile or LoadFromStream method. To save the strings to a file or stream, use the SaveToFile method and the SaveToStream method.


TStrings properties

TStrings	Alphabetically	Legend

In TStrings

CommaText

Count

Names

Objects

Strings

Text

Values


TStrings properties

TStrings	By object	Legend

CommaText

Count

Names

Objects

Strings

Text

Values


TStrings::CommaText

TStrings	Properties

Retrieves and sets the strings of the string list in system data format (SDF) style.

Syntax

__property System::AnsiString CommaText;

When retrieving CommaText, the string returned contains each string in the string list separated by commas. If a string in the string list has spaces, commas or quotes, then the individual string will be quoted as well. For example, if the string list contains the following strings:

CommaText will return:

When assigning CommaText, the string is parsed in as SDF formatted text. For SDF format, strings are separated by commas, spaces, #10, #13 and #0, and delimited by double quotes. For example, suppose CommaText is set to:

The string list will then contain:


TStrings::Count

TStrings	Properties

TStrings introduces Count as an abstract property.

Syntax

__property System::Integer Count;

Each descendent string object declares a Count property that indicates the number of strings contained in the descendent string object.


TStrings::Names

TStrings	Properties

Returns the name part of a string at the Index position in the string list when the form is Name=Value, otherwise it returns a blank string.

Syntax

__property System::AnsiString Names[System::Integer Index];


TStrings::Objects

TStrings	Properties

The Objects property for TStrings does nothing. Descendent strings objects should override the appropiate accessor methods for this property.

Syntax

__property System::TObject * Objects[System::Integer Index];


TStrings::Strings

TStrings	Properties

TStrings introduces Strings as a property that has an abstract accessor method.

Syntax

virtual void __fastcall AddStrings(TStrings *Strings);

Each descendent string object defines the accessor methods for the String property that will return a specific string contained in the descendent string object.


TStrings::Text

TStrings	Properties

Gets and sets the strings of the string list separated by #13, #10 or #0 (carriage return, line feed and null).

Syntax

virtual void __fastcall SetText(System::PChar Text);

When getting the list of strings from the string list, each string is separated by a #13 and #10 (carriage return and line feed). When setting Text, a string is added at the beginning and when a #13, #10 or #0 is encountered.


TStrings::Values

TStrings	Properties

Provides access to a specific string in a list of strings.

Syntax

__property System::AnsiString Values[System::AnsiString Name];

The strings must have a unique structure before you can use the Values property array to access them:

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side of the equal sign. There should be no spaces present before and after the equal sign.

Such strings are commonly found in .INI files. For example, here are a few strings taken from a BORLAND C++ BUILDER.INI file:

The strings that make up the Params property of a database component (TDatabase) have the same format. The most common use of the Values property is to modify a string within the Params property array.

To modify a string in a list of strings that have the required format, identify the string to modify with the Name constant parameter, which serves as an index into the list of strings, and assign a new value.


TStrings methods

TStrings	Alphabetically

In TStrings

~TStrings

Add

AddObject

AddStrings

Append

Assign

BeginUpdate

Clear

Delete

EndUpdate

Equals

Exchange

GetText

IndexOf

IndexOfName

IndexOfObject

Insert

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

TStrings

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStrings methods

TStrings	By object

~TStrings

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SaveToFile

SaveToStream

SetText

TStrings


TStrings::Add

TStrings	Methods

The Add method for TStrings calls an abstract method. Descendent strings objects should override this method.

Syntax

virtual System::Integer __fastcall Add(const System::AnsiString S);

In descendent strings objects, Add adds a new string to the strings contained in the string object.


TStrings::AddObject

TStrings	Methods

Adds both a string and an object to a string or string list object.

Syntax

virtual System::Integer __fastcall AddObject(const System::AnsiString S, System::TObject *AObject);

The string and the object are appended to the list of strings. Specify the string to be added as the value of the S parameter, and specify the object to be added as the value of the AObject parameter. The memory referenced by Ptr is not freed when the string object is freed.


TStrings::AddStrings

TStrings	Methods

Adds a group of strings to the list of strings in a string list object.

Syntax

virtual void __fastcall AddStrings(TStrings *Strings);

The new strings are appended to the existing strings. Specify a string object containing the list of strings you want added as the value of the Strings parameter. Object references are also copied if the TStrings object supports objects (TMemo.Lines does not, for example)


TStrings::Append

TStrings	Methods

Performs the same function as the Add method for strings and string lists but doesn't return the result.

Syntax

void __fastcall Append(const System::AnsiString S);

Use this method rather than Add when you need it as a parameter for a function requiring a TGetStrProc or when you don't need to know where the string is added.


TStrings::Assign

TStrings	Methods

Assigns one object to another.

Syntax

virtual void __fastcall Assign(TPersistent *Source);

If Source is of type TStrings, the strings in the TStrings object are cleared and the list of strings in Source are added to the TStrings object. The inherited Assign is then called. If Source is not of type TStrings, the inherited Assign is immediately called.


TStrings::BeginUpdate

TStrings	Methods

Prevents the screen from being repainted when new strings are added.

Syntax

void __fastcall BeginUpdate(void);

For example, the Lines property of a memo component is of type TStrings. If your application calls the AddStrings method to add several strings at once to the Lines property, AddStrings calls BeginUpdate before the strings are added. After the strings are added, AddStrings calls EndUpdate and the screen repaints, displaying the new list of strings.

Use BeginUpdate to prevent screen repaints and to speed processing time while you are rebuilding your list.


TStrings::Clear

TStrings	Methods

TStrings introduces Clear as an abstract method.

Syntax

virtual void __fastcall Clear(void);

Each descendent string object defines a Clear method that deletes its items.


TStrings::Delete

TStrings	Methods

TStrings introduces Delete as an abstract method.

Syntax

virtual void __fastcall Delete(System::Integer Index);

Each descendent string object defines a Delete method that removes a specified item that it contains.


TStrings::EndUpdate

TStrings	Methods

Re-enables screen repainting and outline item reindexing that was turned off with the BeginUpdate method.

Syntax

void __fastcall EndUpdate(void);


TStrings::Equals

TStrings	Methods

Returns true if Strings and the calling TStrings object are equal in count and each byte in the strings are equal.

Syntax

System::Boolean __fastcall Equals(TStrings *Strings);


TStrings::Exchange

TStrings	Methods

Exchanges the position of two items in the list of a strings object.

Syntax

virtual void __fastcall Exchange(System::Integer Index1, System::Integer Index2);

The items are specified with their index values in the Index1 and Index2 parameters. Because the indexes are zero-based, the first item in the list has an index value of 0, the second item has an index value of 1, and so on.

If a string in a string object has an associated object, Exchange changes the position of both the string and the object.


TStrings::GetText

TStrings	Methods

Returns a string that contains the text of the strings in the string object.

Syntax

virtual System::PChar __fastcall GetText(void);

The strings are separated by a carriage return and a line feed.


TStrings::IndexOf

TStrings	Methods

Returns the position of a string in a list of strings in a string or string list object.

Syntax

virtual System::Integer __fastcall IndexOf(const System::AnsiString S);

Specify the string you want to locate as the value of the S parameter. The first position in the list of strings is 0. If the string is not in the string list, IndexOf returns -1.


TStrings::IndexOfName

TStrings	Methods

Returns the Index of the name part of a string which is of the form Name=Value.

Syntax

System::Integer __fastcall IndexOfName(const System::AnsiString Name);

Specify the Name you want to locate as the value of the Name parameter. The first position in the list of objects is 0. If the name is not in the list of strings, IndexOfName returns -1.


TStrings::IndexOfObject

TStrings	Methods

Returns the position of an object stored in the Objects property of a string object.

Syntax

System::Integer __fastcall IndexOfObject(System::TObject *AObject);

Specify the object you want to locate as the value of the AObject parameter. The first position in the list of objects is 0. If the object is not in the list of objects, IndexOfObject returns -1.


TStrings::Insert

TStrings	Methods

TStrings introduces Insert as an abstract method.

Syntax

virtual void __fastcall Insert(System::Integer Index, const System::AnsiString S);

Each descendent strings object defines an Insert method that adds a given string, S, to the strings contained in the string object, at the position indicated by Index.


TStrings::InsertObject

TStrings	Methods

Inserts a string into the list of strings and an object into the list of objects in a string or string list object.

Syntax

void __fastcall InsertObject(System::Integer Index, const System::AnsiString S, System::TObject *AObject

Specify the string you want to insert as the value of the S parameter, and the object you want to insert as the value of the AObject parameter. The Index parameter identifies the position of the string and object in their respective string and object lists. Because the index is zero-based, the first position in each list has an Index value of 0.

If your application calls InsertObject when the list of items is sorted, an EListError exception is raised.


TStrings::LoadFromFile

TStrings	Methods

Reads the file specified in FileName and loads the data into the string object.

Syntax

virtual void __fastcall LoadFromFile(const System::AnsiString FileName);


TStrings::LoadFromStream

TStrings	Methods

Reads a stream and stores the contents in the object.

Syntax

virtual void __fastcall LoadFromStream(TStream *Stream);


TStrings::Move

TStrings	Methods

Changes the position of an item in the list of a list object or in a list of strings in a string object by giving the item a new index value.

Syntax

virtual void __fastcall Move(System::Integer CurIndex, System::Integer NewIndex);

The CurIndex parameter is the item's current index, and the NewIndex parameter is the item's new index value.

If a string in a string object has an associated object in the Objects property, Move moves both the string and the object.


TStrings::SaveToFile

TStrings	Methods

Saves an object to the file specified in FileName.

Syntax

virtual void __fastcall SaveToFile(const System::AnsiString FileName);

The nature of the information saved to the file depends upon the object. String objects save text to the file.


TStrings::SaveToStream

TStrings	Methods

Writes a stream with the name passed in Stream with the contents of the object.

Syntax

virtual void __fastcall SaveToStream(TStream *Stream);


TStrings::SetText

TStrings	Methods

Clears the current strings in the string object, and adds new strings based upon the Text parameter.

Syntax

virtual void __fastcall SetText(System::PChar Text);

SetText adds strings one at a time to the string object, using the carriage returns and line feed in Text as delimiters indicating when to add a new string.


TStrings::TStrings

TStrings	Methods	See also

TStrings creates a new TStrings object.

Syntax

__fastcall TStrings(void);

Description

Use TStrings to create a new TStrings object.


TStrings::~TStrings

TStrings	Methods	See also

~TStrings frees the memory associated with the TStrings object.

Syntax

__fastcall virtual ~TStrings(void);

Description

Do not call ~TStrings directly. Instead, use the delete keyword on the object, which causes ~TStrings to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TStrings example

TStrings


TStringField

Hierarchy	Properties	Methods	Events	See also

A TStringField object represents a string field in a dataset.

Header

vcl/dbtables.hpp

Description

A value of a string field is physically stored as a sequence of up to 8192 characters. Common uses for string fields are to store text, such as names and addresses.

TStringField introduces properties to translate between string values and other datatypes, and to manage language driver conversions. As a descendent of TField, TStringField inherits many properties, methods, and events that are useful for managing the value and properties of a field in a database.


TStringField properties

TStringField	Alphabetically	Legend

In TStringField

AsBoolean

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

Transliterate

Value

Derived from TField

Alignment

AsCurrency

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TStringField properties

TStringField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Transliterate

Value

Visible


TStringField::AsBoolean

TStringField	Properties	See also

AsBoolean converts the value of the field to or from a Boolean value.

Syntax

Description

Use AsBoolean to:

•	Assign the string field value to a Boolean value.

•	Assign a Boolean value to the string field.

AsBoolean returns true on reading the value of the field if its text begins with the letters "Y", "y", "T" or "t" (for "Yes" or "true"), and false otherwise. Using AsBoolean to write a TStringField's value sets the string to 'T' or 'F'.


TStringField::AsDateTime

TStringField	Properties	See also

AsDateTime converts the value of the field to or from a date and time value.

Syntax

Description

Use AsDateTime to:

•	Assign the string field value to a TDateTime value.

•	Assign a TDateTime value to the string field.

Reading AsDateTime converts the value of the field to a date-time using the StrToDateTime function. Setting AsDateTime converts the date-time value to a string using the DateTimeToStr function.


TStringField::AsFloat

TStringField	Properties	See also

AsFloat converts the value of the field to or from a floating-point value..

Syntax

Description

Use AsFloat to:

•	Assign the string field value to a floating-point value.

•	Assign a floating-point value to the string field.

For example, this code assigns a floating-point value to a string field value:

To assign a string field value to a floating-point value, use code similar to this:

Reading AsFloat converts the value of the field to a floating-point value using the StrToFloat function. Setting AsFloat converts the floating-point value to a string using the FloatToStr function.


TStringField::AsInteger

TStringField	Properties	See also

AsInteger converts the value of the field to or from an integer value..

Syntax

Description

Use AsInteger to:

•	Assign the string field value to an integer value.

•	Assign an integer value to the string field.

For example, this code assigns integer value to a string field value:

To assign a string field value to an integer value, use code similar to this:

Reading AsInteger converts the value of the field to an integer using the StrToInt function. Setting AsInteger converts the integer to a string using the IntToStr function.


TStringField::AsString

TStringField	Properties	See also

AsString gets or sets the value of the field.

Syntax

Description

string values need no conversion, because the native format of a string field is a string. For string fields, AsString is the same as the Value property. AsString provides a uniform interface that allows applications to get or set string values with generic field components when the internal format of the data is not known.

When setting the AsString property, TStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is true. Strings that have more characters than permitted by the value of the Size property are truncated when setting AsString.


TStringField::Transliterate

TStringField	Properties	See also

Transliterate determines whether the value of the string field should be converted between the ANSI character set and the character set identified by the dataset, when reading from or writing to the physical database tables.

Syntax

__property System::Boolean Transliterate;

Description

Use Transliterate when the physical database table identified by the dataset does not use an ANSI language driver and the data may contain extended ascii characters.

When Transliterate is true, the AnsiToNative function is called to translate the ANSI characters to the character set used by the dataset when the string field value is set. When the string field value is read, the NativeToAnsi function is called to translate the characters in the database table to the ANSI character set.


TStringField::Value

TStringField	Properties	See also

Value is the actual data in the string field.

Syntax

System::Boolean __fastcall GetValue( System::AnsiString &Value);

Description

Use Value to read data directly from and write data directly to a string field component at run time. Using the Value property is the same as using the AsString property. Use Value when you know the field component is a string field. Use AsString when working with a generic field component.

When setting the Value property, TStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is true. Strings that have more characters than permitted by the value of the Size property are truncated when setting Value.


TStringField events

TStringField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TStringField events

TStringField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TStringField methods

TStringField	Alphabetically

In TStringField

~TStringField

TStringField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringField methods

TStringField	By object

~TStringField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TStringField


TStringField::TStringField

TStringField	Methods	See also

TStringField creates a new TStringField object.

Syntax

__fastcall virtual TStringField(Classes::TComponent *AOwner);

Description

Use TStringField to create a new TStringField object.


TStringField::~TStringField

TStringField	Methods	See also

~TStringField frees the memory associated with the TStringField object.

Syntax

__fastcall virtual ~TStringField(void);

Description

Do not call ~TStringField directly. Instead, use the delete keyword on the object, which causes ~TStringField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TStringField example

TStringField


TStringGrid

Hierarchy	Properties	Methods	Events

The TStringGrid component is a grid control designed to simplify the handling of strings and associated objects while maintaining all the functionality of the TDrawGrid component.

Header

vcl/grids.hpp

All the strings within a string grid are contained in the Cells property, which you can use to access a particular string within the grid. All the objects associated with the strings in a string grid are contained in the Objects property. Use Objects to access a particular object.

All the strings and their associated objects for a particular column can be accessed using the Cols property. The Rows property gives you access to all the strings and their associated objects for a particular row.


TStringGrid properties

TStringGrid	Alphabetically	Legend

In TStringGrid

Cells

Cols

Objects

Rows

Derived from TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TStringGrid properties

TStringGrid	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

Cells

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

Cols

Col

ColWidths

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

DragCursor

DragMode

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

Font

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

LeftCol

Left

Name

Objects

Options

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

RowCount

RowHeights

Rows

Row

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStops

TabStop

Tag

TopRow

Top

VisibleColCount

VisibleRowCount

Visible

Width


TStringGrid::Cells

TStringGrid	Properties

The Cells property is an array of strings, one string for each cell in the grid.

Syntax

__property System::AnsiString Cells[System::Integer ACol][System::Integer ARow];

Use the Cells property to access a string within a particular cell. ACol is the column coordinate of the cell, and ARow is the row coordinate of the cell. The first row is row zero, and the first column is column zero.

The ColCount and RowCount property values define the size of the array of strings.


TStringGrid::Cols

TStringGrid	Properties

The Cols property is an array of the strings and their associated objects in a column.

Syntax

__property Classes::TStrings * Cols[System::Integer Index];

The number of strings and associated objects is always equal to the value of the ColCount property, the number of columns in the grid. Use the Cols property to access the strings and their associated objects within a particular column in the grid. The Index parameter is the number of the column you want to access; the Index value of the first column in the grid is zero.


TStringGrid::Objects

TStringGrid	Properties

The Objects property is an array of objects, one for each cell in the grid.

Syntax

__property System::TObject * Objects[System::Integer ACol][System::Integer ARow];

The ColCount and RowCount values define the size of the array of objects. Use the Objects property to access an object within a particular cell. ACol is the column coordinate of the cell, and ARow is the row coordinate of the cell.

If you put an object into the Objects array, the object will still exist even if the string grid is destroyed. You must destroy the object explicitly.


TStringGrid::Rows

TStringGrid	Properties

The Rows property is an array of the strings and their associated objects in a row.

Syntax

__property Classes::TStrings * Rows[System::Integer Index];

The number of strings and associated objects is always the value of the RowCount property, the number of rows in the grid. Use the Rows property to access the strings and their associated objects within a particular row in the grid. The Index parameter is the number of the row you want to access, with the first row having an Index value of zero.


TStringGrid events

TStringGrid	Alphabetically	Legend

Derived from TDrawGrid

OnColumnMoved

OnDrawCell

OnGetEditMask

OnGetEditText

OnRowMoved

OnSelectCell

OnSetEditText

OnTopLeftChanged

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TStringGrid events

TStringGrid	By object	Legend

OnClick

OnColumnMoved

OnDblClick

OnDragDrop

OnDragOver

OnDrawCell

OnEndDrag

OnEnter

OnExit

OnGetEditMask

OnGetEditText

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnRowMoved

OnSelectCell

OnSetEditText

OnStartDrag

OnTopLeftChanged


OnClick


OnColumnMoved


OnDblClick


OnDragDrop


OnDragOver


OnDrawCell


OnEndDrag


OnEnter


OnExit


OnGetEditMask


OnGetEditText


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnRowMoved


OnSelectCell


OnSetEditText


OnStartDrag


OnTopLeftChanged


TStringGrid methods

TStringGrid	Alphabetically

In TStringGrid

~TStringGrid

TStringGrid

Derived from TDrawGrid

CellRect

MouseToCell

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringGrid methods

TStringGrid	By object

~TStringGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CellRect

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

MouseToCell

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TStringGrid

UpdateControlState

Update


TStringGrid::TStringGrid

TStringGrid	Methods	See also

TStringGrid creates a new TStringGrid object.

Syntax

__fastcall virtual TStringGrid(Classes::TComponent *AOwner);

Description

Use TStringGrid to create a new TStringGrid object.


TStringGrid::~TStringGrid

TStringGrid	Methods	See also

~TStringGrid frees the memory associated with the TStringGrid object.

Syntax

__fastcall virtual ~TStringGrid(void);

Description

Do not call ~TStringGrid directly. Instead, use the delete keyword on the object, which causes ~TStringGrid to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TDrawGrid


TStringGrid example

TStringGrid


TStringList

Hierarchy	Properties	Methods	Events

The TStringList object maintains a list of strings. Use a string list object when you are managing a list of strings that is not maintained by a control.

Header

vcl/classes.hpp

You can add, delete, insert, move, and exchange strings using the Add, Append, Delete, Insert, Move, and Exchange methods. The Clear method clears all the strings in the list of strings. The Count property contains the number of strings in the list. Each string list object has a Strings property that lets you access a particular string by its position in the list of strings. To find the position of a string in the list, use the IndexOf method.

If you want to add several strings at once to a list of strings, use the AddStrings method. You can assign one strings object to another using the Assign method.

To determine if a particular string exists in the list of strings, call the Find method. To sort the list of strings, use the Sort method. To determine if the list is sorted, check the value of the Sorted property. You can decide whether the list can contain duplicate strings using the Duplicates property.

Each string can be associated with an object. The objects associated with strings are commonly used to place a bitmap in an owner-draw control. If you want to add a string and an object to string list at the same time, use the AddObject method. You can access a particular object by its position in the list of objects using the Objects property. To find the position of the object in the list, use the IndexOfObject method. To insert an object, call the InsertObject method. The Delete, Move, Clear, and Exchange methods operate on the object associated with a string as well as on the string itself. For example, calling Clear removes all strings and all their associated objects.

You can store strings in a file and then load them all at one using the LoadFromFile method. To save the strings to a file, use the SaveToFile method.

The TStringList object is an indirect descendent of TPersistent. In addition to these properties, methods, and events, this object also has the methods that apply to the TStrings object and to all objects.


TStringList properties

TStringList	Alphabetically	Legend

In TStringList

Count

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

Text

Values


TStringList properties

TStringList	By object	Legend

CommaText

Count

Duplicates

Names

Objects

Sorted

Strings

Text

Values


TStringList::Count

TStringList	Properties

Contains the number of strings in the list of strings.

Syntax


TStringList::Duplicates

TStringList	Properties

Defines the possible values of the Duplicates property of a string list object (TStringList).

Syntax

__property TDuplicates Duplicates;


TStringList::Objects

TStringList	Properties

Associates an object with another object or component.

Syntax

The Objects property gives you access to an object in the list of objects associated with the list of strings. Each string in the list of strings can have an associated object.

The most common use of objects in a string and string list objects is to associate bitmaps with strings so that you can use the bitmaps in owner-draw controls. For example, if you have an owner-draw list box, you can add a string 'Banana' and a bitmap of a banana to the Items property of the list box using the AddObject method. You can then access the 'Banana' string using the Strings property or the bitmap using the Objects property.

Specify the object you want to access with its position in the list as the value of the Index parameter. The index is zero-based, so the first object in the list of objects has a value of 0, the second object has a value of 1, and so on.

To associate an object with an existing string, assign the object to the Objects property using the same index as that of the existing string in the Strings property. For example, if a string object named Fruits contains the string 'Banana' and an existing bitmap of a banana called BananaBitmap, you could make the following assignment:

Fruits.Objects[Fruits.IndexOf('Banana')] = BananaBitmap;


TStringList::Sorted

TStringList	Properties

Determines the order of the strings in the list of strings maintained by the string list.

Syntax

__property System::Boolean Sorted;

If Sorted is true, the strings are sorted in ascending order. If Sorted is false, the strings are unsorted.


TStringList::Strings

TStringList	Properties

Provides access to a specific string of a string list object.

Syntax

Specify the position of the string in the string list as the value of the Index parameter. The index of the Strings property is zero-based, so the first string has an Index value of 0, the second has an Index value of 1, and so on. To find out what the index of a particular string is, call the IndexOf method.

Strings is the default property of string objects. Therefore, you can safely omit the reference to the Strings identifier and just the treat the string object itself as an indexed array of strings. In the following example, Lines is a string object property of a memo component (TMemo). These two lines of RefSyn are both acceptable and do the same thing:


TStringList events

TStringList	Alphabetically

In TStringList

OnChange

OnChanging


TStringList events

TStringList	By object

OnChange

OnChanging


TStringList::OnChange

TStringList	Events

Occurs when a change to a string stored in the list of strings changes.

Syntax

__property TNotifyEvent OnChange;


TStringList::OnChanging

TStringList	Events

Occurs immediately before the string contained in the stringlist is modified.

Syntax

__property TNotifyEvent OnChanging;


TStringList methods

TStringList	Alphabetically

In TStringList

~TStringList

Add

Clear

Delete

Exchange

Find

IndexOf

Insert

Sort

TStringList

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringList methods

TStringList	By object

~TStringList

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Find

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SaveToFile

SaveToStream

SetText

Sort

TStringList


TStringList::Add

TStringList	Methods

Adds a new string to a string list.

Syntax

virtual System::Integer __fastcall Add(const System::AnsiString S);

The S parameter is the new string. Add returns the position of the item in the list; the first item in the list has a value of 0.

For TStrings objects, such as the Items property of a list box, the new string is appended to the end of the list unless the Sorted property of the list box or combo box is true. In such a case the string is inserted into the list of strings so as to maintain the sort order.

For TStringList objects, the value of the Sorted property determines how a string is added. If Sorted is false, the string is appended to the list. If Sorted is true, the new string is inserted into the list of strings so as to maintain the sort order.


TStringList::Clear

TStringList	Methods

Deletes all items in the string list.

Syntax

virtual void __fastcall Clear(void);


TStringList::Delete

TStringList	Methods

Removes the item specified with the Index parameter.

Syntax

virtual void __fastcall Delete(System::Integer Index);

The index is zero-based, so the first item has an Index value of 0, the second item has an Index value of 1, and so on. If a string is deleted from a string object, the reference to its associated object is also deleted.


TStringList::Exchange

TStringList	Methods

Exchanges the position of two items in the list of a string list object.

Syntax

virtual void __fastcall Exchange(System::Integer Index1, System::Integer Index2);

The items are specified with their index values in the Index1 and Index2 parameters. Because the indexes are zero-based, the first item in the list has an index value of 0, the second item has an index value of 1, and so on.

If a string in a string list object has an associated object, Exchange changes the position of both the string and the object.

An OnChanging event occurs before the exchange takes place, and an OnChange event takes place after.


TStringList::Find

TStringList	Methods

Searches for a specified string in the list of strings kept in a string list object.

Syntax

virtual System::Boolean __fastcall Find(const System::AnsiString S, System::Integer &Index);

If the string specified as the value of the S parameter is found, Find returns true and the position of the string in the string list is stored as the value of the Index parameter. Because the index is zero-based, the first string in the string list has an index value of 0, the second string has an index value of 1, and so on.

Find returns false if the specified string is not found. Use Find with sorted lists only. For unsorted lists use the IndexOf method instead.


TStringList::IndexOf

TStringList	Methods

Returns the position of a string in a list of strings in a string or string list object.

Syntax

virtual System::Integer __fastcall IndexOf(const System::AnsiString S);

Specify the string you want to locate as the value of the S parameter. The first position in the list of strings is 0. If the string is not in the string list, IndexOf returns -1.

Use IndexOf with unsorted lists only. For sorted lists use the Find method.


TStringList::Insert

TStringList	Methods

Inserts a string into the list of strings in the string list object.

Syntax

virtual void __fastcall Insert(System::Integer Index, const System::AnsiString S);

The string S is inserted into the position in the list indicated by the value of Index. The index is zero-based, so the first position in the list has an index value of 0.


TStringList::Sort

TStringList	Methods

Sorts the strings in a string list object in alphabetical order.

Syntax

virtual void __fastcall Sort(void);


TStringList::TStringList

TStringList	Methods	See also

TStringList creates a new TStringList object.

Syntax

__fastcall TStringList(void);

Description

Use TStringList to create a new TStringList object.


TStringList::~TStringList

TStringList	Methods	See also

~TStringList frees the memory associated with the TStringList object.

Syntax

__fastcall virtual ~TStringList(void);

Description

Do not call ~TStringList directly. Instead, use the delete keyword on the object, which causes ~TStringList to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings


TStringList example

TStringList


TStatusPanel

Hierarchy	Properties	Methods	See also

TStatusPanel represents a single panel of a status bar.

Header

vcl/comctrls.hpp

Description

Each TStatusBar uses a TStatusPanels to maintain a collection of TStatusPanel objects.


TStatusPanel properties

TStatusPanel	Alphabetically	Legend

In TStatusPanel

Alignment

Bevel

Style

Text

Width

Derived from TCollectionItem

Collection

Index


TStatusPanel properties

TStatusPanel	By object	Legend

Alignment

Bevel

Collection

Index

Style

Text

Width


TStatusPanel::Alignment

TStatusPanel	Properties	See also

Specifies how text is aligned within the status panel.

Syntax

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the panel.

taCenter	Center the text in the panel.

taRightJustify	Align text on the right side of the panel.

Note

If the status bar has a sizing grip, setting the Alignment of the last status panel to taRightJustify will truncate the panel’s text.


TStatusPanel::Bevel

TStatusPanel	Properties	See also

Determines the bevel style of the panel.

Syntax

__property TStatusPanelBevel Bevel;

Description

These are the possible values of Bevel:

Value	Meaning

pbNone	The panel has no bevel and appears flat.

pbLowered	The panel appears recessed.

pbRaised	The panel appears raised.


TStatusPanel::Style

TStatusPanel	Properties	See also

Determines how the status panel’s text is displayed.

Syntax

__property TStatusPanelStyle Style;

Description

If Style is set to psText (the default), the string contained in the Text property is displayed in the status panel, using the alignment specified by Alignment. The font is determined by the status bar’s Font property.

If Style is set to psOwnerDraw, the content displayed in the status panel is drawn at run time on the status bar’s canvas by code in a TStatusBar.OnDrawPanel event handler.


TStatusPanel::Text

TStatusPanel	Properties

The text appearing in the status panel.

Syntax

__property System::AnsiString Text;

Description

The Text property contains a string that appears in the status panel if Style is set to psText.


TStatusPanel::Width

TStatusPanel	Properties

The width of the status panel.

Syntax

__property System::Integer Width;

Description

The Width property determines the horizontal size of the status panel, in pixels.


TStatusPanel methods

TStatusPanel	Alphabetically

In TStatusPanel

~TStatusPanel

Assign

TStatusPanel

Derived from TCollectionItem

ClassInfo

Derived from TObject

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusPanel methods

TStatusPanel	By object

~TStatusPanel

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TStatusPanel


TStatusPanel::Assign

TStatusPanel	Methods	See also

Copies the contents of the source status panel to a new status panel.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Assign creates a new status panel with the same Alignment, Bevel, Style, Text, and Width values as the source object.


TStatusPanel::TStatusPanel

TStatusPanel	Methods	See also

TStatusPanel creates a new TStatusPanel object.

Syntax

__fastcall virtual TStatusPanel(Classes::TCollection *Collection);

Description

Use TStatusPanel to create a new TStatusPanel object.


TStatusPanel::~TStatusPanel

TStatusPanel	Methods	See also

~TStatusPanel frees the memory associated with the TStatusPanel object.

Syntax

__fastcall virtual ~TStatusPanel(void);

Description

Do not call ~TStatusPanel directly. Instead, use the delete keyword on the object, which causes ~TStatusPanel to be invoked automatically.


Scope

Published


Hierarchy

TObject

TPersistent

TCollectionItem


TStatusPanel example

TStatusPanel


TStatusPanels

Hierarchy	Properties	Methods	See also

TStatusPanels is a container for TStatusPanel objects.

Header

vcl/comctrls.hpp

Description

Each TStatusPanels holds a collection of TStatusPanel objects in a TStatusBar. TStatusPanels maintains an index of the status panels in its Items array. The Count property contains the number of status panels in the collection. At design time, use the status bar’s Panels editor to add, remove, or modify status panels.


TStatusPanels properties

TStatusPanels	Alphabetically	Legend

In TStatusPanels

Items

Derived from TCollection

Count


TStatusPanels properties

TStatusPanels	By object	Legend

Count

Items


TStatusPanels::Items

TStatusPanels	Properties	See also

An index of the status panels in the collection.

Syntax

__property TStatusPanel * Items[System::Integer Index];

Description

The value of the Index parameter corresponds to the Index property of TStatusPanel. It represents the position of the status panel in the status bar.


TStatusPanels methods

TStatusPanels	Alphabetically

In TStatusPanels

~TStatusPanels

Add

TStatusPanels

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusPanels methods

TStatusPanels	By object

~TStatusPanels

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TStatusPanels


TStatusPanels::Add

TStatusPanels	Methods	See also

Creates a new TStatusPanel instance and adds it to the Items array.

Syntax

TStatusPanel *__fastcall Add(void);

Description

Add returns the new status panel. At design time, use the Panels editor to add panels to the status bar.


TStatusPanels::TStatusPanels

TStatusPanels	Methods	See also

TStatusPanels creates a new TStatusPanels object.

Syntax

__fastcall TStatusPanels(TStatusBar *StatusBar);

Description

Use TStatusPanels to create a new TStatusPanels object.


TStatusPanels::~TStatusPanels

TStatusPanels	Methods	See also

~TStatusPanels frees the memory associated with the TStatusPanels object.

Syntax

__fastcall virtual ~TStatusPanels(void);

Description

Do not call ~TStatusPanels directly. Instead, use the delete keyword on the object, which causes ~TStatusPanels to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TStatusPanels example

TStatusPanels


TStatusBar

Hierarchy	Properties	Methods	Events	See also

TStatusBar represents a Windows status bar.

Header

vcl/comctrls.hpp

Description

The TStatusBar component is a row of panels, usually aligned at the bottom of the form, that display information about the application as it runs. Each panel is represented by a TStatusPanel object listed in the Panels property. The SimplePanel property can be used to toggle the status bar at run time between a single-panel and multiple-panel display.


TStatusBar properties

TStatusBar	Alphabetically	Legend

In TStatusBar

Canvas

Panels

SimplePanel

SimpleText

SizeGrip

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TStatusBar properties

TStatusBar	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

Panels

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

SimplePanel

SimpleText

SizeGrip

TabOrder

TabStop

Tag

Top

Visible

Width


TStatusBar::Canvas

TStatusBar	Properties	See also

Provides run-time access to the status bar’s drawing surface.

Syntax

__property Graphics::TCanvas * Canvas;

Description

The read-only Canvas property provides access to the status bar’s drawing surface that you can use when implementing a handler for the OnDrawPanel event.


TStatusBar::Panels

TStatusBar	Properties	See also

A list of panels (TStatusPanel) in the status bar.

Syntax

__property TStatusPanels * Panels;

Description

The Panels property holds a TStatusPanels—that is, a collection of TStatusPanel objects. At design time, you can add, remove, or modify panels with the Panels editor. To open the Panels editor, select the Panels property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.


TStatusBar::SimplePanel

TStatusBar	Properties	See also

Determines whether the status bar displays a single panel or multiple panels.

Syntax

__property System::Boolean SimplePanel;

Description

If SimplePanel is set to true, the status bar consists of a single panel displaying the text in SimpleText. If SimplePanel is set to false, the status bar displays a separate panel for each item in its Panels property. By changing the value of SimplePanel programmatically, you can alter the appearance of the status bar at run time.


TStatusBar::SimpleText

TStatusBar	Properties	See also

Contains the string that is displayed in the status bar when SimplePanel is set to true.

Syntax

__property System::AnsiString SimpleText;

Description

SimpleText contains a text string to be displayed in the status panel when SimplePanel is true.


TStatusBar::SizeGrip

TStatusBar	Properties	See also

Determines whether the status bar is resizable at run time.

Syntax

__property System::Boolean SizeGrip;

Description

If SizeGrip is set to true, the status bar has a triangular grip on the lower right-hand corner. The user can resize the status bar by dragging the grip with the mouse.

Note

If Align is set to alBottom, alRight, or alClient, the sizing grip will not work. If the Alignment property of the last panel in the status bar is set to taRightJustify, the sizing grip will truncate the panel’s text.


TStatusBar events

TStatusBar	Alphabetically	Legend

In TStatusBar

OnDrawPanel

OnResize

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TStatusBar events

TStatusBar	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawPanel

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag


TStatusBar::OnDrawPanel

TStatusBar	Events	See also

OnDrawPanel occurs when a status panel needs to be redrawn.

Syntax

__property TDrawPanelEvent OnDrawPanel;

Description

The OnDrawPanel event occurs when a status panel needs to be redisplayed—for example, when the user resizes the status bar. The Rect parameter gives the (new) dimensions of the status panel. OnDrawPanel occurs only if the status panel’s Style property is set to psOwnerDraw.

TDrawPanelEvent is the type of the OnDrawPanel property.


TStatusBar::OnResize

TStatusBar	Events	See also

OnResize occurs when the status panel is resized.

Syntax

__property Classes::TNotifyEvent OnResize;

Description

The OnResize event occurs whenever the entire status bar is resized at run time.


TStatusBar methods

TStatusBar	Alphabetically

In TStatusBar

~TStatusBar

TStatusBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusBar methods

TStatusBar	By object

~TStatusBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TStatusBar

UpdateControlState

Update


TStatusBar::TStatusBar

TStatusBar	Methods	See also

TStatusBar creates a new TStatusBar object.

Syntax

__fastcall virtual TStatusBar(Classes::TComponent *AOwner);

Description

Use TStatusBar to create a new TStatusBar object.


TStatusBar::~TStatusBar

TStatusBar	Methods	See also

~TStatusBar frees the memory associated with the TStatusBar object.

Syntax

__fastcall virtual ~TStatusBar(void);

Description

Do not call ~TStatusBar directly. Instead, use the delete keyword on the object, which causes ~TStatusBar to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TStatusBar example

TStatusBar


TTabControl

Hierarchy	Properties	Methods	Events

The TTabControl component is a tab set which functions similar to a TTabSet and has the appearance of notebook dividers.

Header

vcl/comctrls.hpp

To create a multiple page dialog box, use a TPageControl. To use simply a tab set, use the TTabControl. Disabling a TTabControl will disable all tabs because it is one control. To disable individual tabs use a TPageControl and disable the individual TTabSheet controls that represent the pages.


TTabControl properties

TTabControl	Alphabetically	Legend

Derived from TCustomTabControl

DisplayRect

MultiLine

TabHeight

TabIndex

Tabs

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabControl properties

TTabControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DisplayRect

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

MultiLine

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabHeight

TabIndex

TabOrder

Tabs

TabStop

TabWidth

Tag

Top

Visible

Width


TTabControl events

TTabControl	Alphabetically	Legend

Derived from TCustomTabControl

OnChange

OnChanging

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabControl events

TTabControl	By object	Legend

OnChange

OnChanging

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnChange


OnChanging


OnDragDrop


OnDragOver


OnEndDrag


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TTabControl methods

TTabControl	Alphabetically

In TTabControl

~TTabControl

TTabControl

Derived from TCustomTabControl

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabControl methods

TTabControl	By object

~TTabControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabControl

UpdateControlState

Update


TTabControl::TTabControl

TTabControl	Methods	See also

TTabControl creates a new TTabControl object.

Syntax

__fastcall virtual TTabControl(Classes::TComponent *AOwner);

Description

Use TTabControl to create a new TTabControl object.


TTabControl::~TTabControl

TTabControl	Methods	See also

~TTabControl frees the memory associated with the TTabControl object.

Syntax

__fastcall virtual ~TTabControl(void);

Description

Do not call ~TTabControl directly. Instead, use the delete keyword on the object, which causes ~TTabControl to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TTabControl example

TTabControl


TTable

Hierarchy	Properties	Methods	Events

The TTable component provides live access to database tables through the Borland Database Engine. TTable is the interface between the Borland Database Engine and TDataSource components. The TDataSource components then provide the interface to data-aware controls such as TDBGrid.

Header

vcl/dbtables.hpp

Set the DatabaseName property to specify the database to access. Set the TableName property to the table to access. Set the ReadOnly property to true unless you want to change the contents of the table. Set the Exclusive property to true if you do not want any other application to access the table while you are using it. Use the IndexName property to use the table with a secondary index. Use the MasterFields and MasterSource properties to create a link to a master table in a master-detail relationship. Call the GotoCurrent method to move the cursor to the same position as another TTable linked to the same database table.

Set the Active property to true or call the Open method to open a TTable, putting it in Browse mode. Set Active to false or call Close close the TTable. Call the First, Next, Prior, Last, and MoveBy, methods to navigate through the table. Call the SetKey, FindKey, FindNearest, GotoKey, and GotoNearest methods to search the database table for specific values.

Test the BOF and EOF properties to determine if the cursor has reached the beginning or end of the table, respectively. Call the Append, Insert, AppendRecord or InsertRecord methods to add a record to the table. Call the Delete method to delete the current record. Call the Edit method to allow an application to modify records in the table, and Post to send the changes to the database or Cancel to discard them.

Use the EditRangeStart, EditRangeEnd, SetRangeStart, SetRangeEnd, ApplyRange and SetRange methods to limit the range of records returned to the application and the CancelRange method to remove the limit.

The OnServerYieldEvent occurs periodically during a query executing on a Sybase server. Setting the parameter AbortQuery to false will cancel the query during execution.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


TTable properties

TTable	Alphabetically	Legend

In TTable

CanModify

DataSource

Exclusive

IndexDefs

IndexFieldNames

IndexFiles

IndexName

MasterFields

MasterSource

ReadOnly

TableName

TableType

Derived from TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TDataSet

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

DefaultFields

Designer

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

IndexFieldCount

IndexFields

KeyExclusive

KeyFieldCount

KeySize

Locale

Modified

Name

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTable properties

TTable	By object	Legend

Active

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AutoCalcFields

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BOF

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

Exclusive

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexFiles

IndexName

KeyExclusive

KeyFieldCount

KeySize

Locale

MasterFields

MasterSource

Modified

Name

Owner

ReadOnly

RecNo

RecordCount

RecordSize

SessionName

State

TableName

TableType

Tag

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending


TTable::CanModify

TTable	Properties

Specifies whether an application can modify the data in a table.

Syntax

When CanModify is false, the dataset is read-only, and cannot be put into Edit or Insert state. When CanModify is true, the dataset can enter Edit or Insert state.

Even if CanModify is true, it is not a guarantee that a user will be able to insert or update records in a table. Other factors may come in to play, for example, SQL access privileges.

TTable has a ReadOnly property that requests write privileges when set to false. When ReadOnly is true, CanModify will automatically be set to false. When ReadOnly is false, CanModify will be true if the database allows read and write privileges for the dataset and the underlying table.

CanModify will be true for queries only if you use cached updates or set RequestLive to true before opening the query, and if the Borland Database Engine (BDE) can actually return a live result set. If it can't, or if RequestLive is false (the default), CanModify will be false. If you set CachedUpdates to true and create an OnUpdateRecord event handler or assign a TUpdateSQL component to the query's UpdateObject property, CanModify will be true. Cached updates let you perform updates to a query that would otherwise be read-only.


TTable::DataSource

TTable	Properties

[REVISIT THIS DESCRIPTION OF DATASOURCE]

Syntax

The DataSource property determines where the component obtains the data to display. Specify the data source component that identifies the dataset the data is found in.


TTable::Exclusive

TTable	Properties

Determines who can access the table.

Syntax

__property System::Boolean Exclusive;

Set the Exclusive property to true to prevent any other user from accessing the table. If other users are accessing the table when you try to open it, your exception handler will have to wait for those users to release it. If you do not provide an exception handler and another user already has the table open, your application will be terminated.

Note

Set the Active property to false before changing Exclusive to prevent an exception.

Do not set Active and Exclusive to true in the Object Inspector Window. Since the Object Inspector will have the table open, that will prevent your program from opening it.

Set Exclusive to true only when you must have complete control over the table.


TTable::IndexDefs

TTable	Properties

Specifies the indexes for the table.

Syntax

__property TIndexDefs * IndexDefs;

The IndexDefs property may not always reflect the current set of indexes. Before examining any property of IndexDefs, call its Update method to ensure that it has the most recent set of information.


TTable::IndexFieldNames

TTable	Properties

Identies the columns to be used as an index for the table on a SQL server.

Syntax

__property System::AnsiString IndexFieldNames;

Separate the column names with semicolon characters (";"). If you have too many column names or the names are too long to fit within the 255 character limit, use column numbers instead of names.

Note

IndexFieldNames and IndexName are mutually exclusive. Setting one will clear the other.


TTable::IndexFiles

TTable	Properties

Contains a list of file names containing non-production indexes for dBASE tables.

Syntax

__property Classes::TStrings * IndexFiles;

Because IndexFiles is of type TStrings, you can add, insert, delete, and clear index filenames using the Add, Insert, Delete, and Clear methods of TStrings. As you add index filenames (using Add or Insert), TTable opens them. While the indexes are opened, updates made to the table maintain the indexes. You can make one the active index by setting the IndexName property. As you delete index filenames (using Delete or Clear), TTable closes them and they are no longer maintained.


TTable::IndexName

TTable	Properties

Identifies a secondary index for the table.

Syntax

void __fastcall GetIndexParams(const System::AnsiString IndexName, System::Boolean FieldsIndex,  System::AnsiString &

If no value is assigned to IndexName, the table's primary index will be used to order the records.

For dBASE tables, the index must reside in the table's master index file. The master index file is determined by taking the TableName property and replacing any file extension with "MDX". Non-maintained indexes are not supported.

Note

IndexFieldNames and IndexName are mutually exclusive. Setting one will clear the other.


TTable::MasterFields

TTable	Properties

Specifies one or more columns to link a detail table with a the master table specified by the MasterSource property.

Syntax

__property System::AnsiString MasterFields;

MasterFields is a string consisting of one or more column names that join the two tables. Separate multiple column names with semicolons. Each time the current record in the master table changes, the new values in those fields are used to select corresponding records from the detail table for display. At design time, use the Field Link Designer to set this property.


TTable::MasterSource

TTable	Properties

Specifies the data source from which the table finds the data for the master table.

Syntax

__property Db::TDataSource * MasterSource;


ReadOnly

Determines if the data can be modified.

Use the ReadOnly property to prevent users from changing data in the table.

Note

Set the Active property to false before changing ReadOnly.


TTable::TableName

TTable	Properties

The name of the database table to which this table is linked.

Syntax

__property System::AnsiString TableName;

The table must be closed before this property can be changed.


TTable::TableType

TTable	Properties

Specifies the underlying database table.

Syntax

__property TTableType TableType;

This property is not used for SQL tables.

If TableType is set to Default, the table's file-name extension determines the table type:

•	Extension of .DB or no filename extension: Paradox table

•	Extension of .DBF : dBASE table

•	Extension of .TXT : ASCII table

If the value of TableType is not Default, then the table will always be of the specified TableType, regardless of file-name extension::

•	ttASCII: Text file

•	ttDBase: dBASE table

•	ttParadox: Paradox table

Note

The TTable must be closed to change this property.


TTable events

TTable	Alphabetically	Legend

Derived from TDataSet

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TTable events

TTable	By object	Legend

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


OnCalcFields


OnDeleteError


OnEditError


OnFilterRecord


OnNewRecord


OnPostError


OnServerYield


OnUpdateError


OnUpdateRecord


TTable methods

TTable	Alphabetically

In TTable

~TTable

AddIndex

ApplyRange

BatchMove

CancelRange

CloseIndexFile

CreateTable

DeleteIndex

DeleteTable

EditKey

EditRangeEnd

EditRangeStart

EmptyTable

FindKey

FindNearest

GetIndexNames

GotoCurrent

GotoKey

GotoNearest

LockTable

OpenIndexFile

RenameTable

SetKey

SetRange

SetRangeEnd

SetRangeStart

TTable

UnlockTable

Derived from TDBDataSet

CheckOpen

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTable methods

TTable	By object

~TTable

ActiveBuffer

AddIndex

AppendRecord

Append

ApplyRange

ApplyUpdates

Assign

BatchMove

CancelRange

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

CloseIndexFile

Close

CommitUpdates

ControlsDisabled

CreateTable

CursorPosChanged

DefaultHandler

DeleteIndex

DeleteTable

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

EditKey

EditRangeEnd

EditRangeStart

Edit

EmptyTable

EnableControls

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindKey

FindLast

FindNearest

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetIndexNames

GetParentComponent

GotoBookmark

GotoCurrent

GotoKey

GotoNearest

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

LockTable

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

OpenIndexFile

Open

Post

Prior

Refresh

RemoveComponent

RenameTable

Resync

RevertRecord

SetDetailFields

SetFields

SetKey

SetRangeEnd

SetRangeStart

SetRange

TTable

UnlockTable

UpdateCursorPos

UpdateRecord

UpdateStatus


TTable::AddIndex

TTable	Methods

Creates a new index for the table

Syntax

void __fastcall AddIndex(const System::AnsiString Name, const System::AnsiString Fields,  TIndexOptions

Name is the name of the new index. Fields is a list of the fields to include in the index. Separate the field names by a semicolon. Options is a set of values from the TIndexOptions type.

Note

You can't add an index to a dBASE table with the index option ixCaseInsensitive. For example, the following RefSyn returns an error if Table1 is a dBASE table:


TTable::ApplyRange

TTable	Methods

Apply a range to the dataset.

Syntax

void __fastcall ApplyRange(void);

The ApplyRange method is used to apply the start and end ranges established with the SetRangeStart and SetRangeEnd methods or the EditRangeStart and EditRangeEnd methods. This will filter the set of records from the database table accessible to the application.

Note

When comparing fields for range purposes, a NULL field is always less than any other possible value.


TTable::BatchMove

TTable	Methods

Copies, appends, updates, or deletes records in the table.

Syntax

System::Longint __fastcall BatchMove(Db::TDataSet *ASource, TBatchMode AMode);

ASource is a TTable linked to a database table containing the source records. AMode is the copy mode; it can be any of the elements of TBatchMode: batAppend, batUpdate, batAppendUpdate, batDelete, or batCopy.

BatchMove returns the number of records operated on.


TTable::CancelRange

TTable	Methods

Removes any range limitations that were previously established on the dataset using ApplyRange or SetRange.

Syntax

void __fastcall CancelRange(void);


CloseIndexFile

Closes the specified dBASE non-production index file.

Once closed, non-production index files aren't maintained.


TTable::CreateTable

TTable	Methods

Creates a new empty database table.

Syntax

void __fastcall CreateTable(void);

Before calling this method, the DatabaseName, TableName, TableType, FieldDefs and IndexDefs properties must be assigned values.


TTable::DeleteIndex

TTable	Methods

Deletes a secondary index for the table.

Syntax

void __fastcall DeleteIndex(const System::AnsiString Name);

Name is the name of the index. You must have opened the table with exclusive access (Exclusive = true).


TTable::DeleteTable

TTable	Methods

Deletes an existing database table.

Syntax

void __fastcall DeleteTable(void);

Before calling this method, the DatabaseName, TableName and TableType properties must be assigned values. The table must be closed.


TTable::EditKey

TTable	Methods

Modifies the contents of the search key buffer.

Syntax

void __fastcall EditKey(void);

This method is useful only when searching on multiple fields after calling SetKey. Call GotoKey to move the cursor to the record with the corresponding key.

EditKey differs from SetKey in that the latter clears all the elements of the search key buffer to the default values (or NULL). EditKey leaves the elements of the search key buffer with their current values.


TTable::EditRangeEnd

TTable	Methods

Modifies the range that exists on the dataset.

Syntax

void __fastcall EditRangeEnd(void);

EditRangeEnd enables you to modify the beginning range of the dataset filter established with SetRangeEnd. Subsequent assignments to field values will modify the values of the ending field range previously set with SetRangeEnd. Call ApplyRange to apply the new range and filter the dataset.

EditRangeEnd differs from SetRangeEnd in that the latter clears all the elements of the search key buffer to the default values (NULL). EditRangeEnd leaves the elements of search key buffer with their current values.

Note

With Paradox or dBASE tables, these methods work only with indexed fields. With SQL databases, they can work with any columns specified in the IndexFieldNames property.


TTable::EditRangeStart

TTable	Methods

Modifies the range that exists on the dataset.

Syntax

void __fastcall EditRangeStart(void);

EditRangeStart enables you to modify the lower key limit established with SetRangeStart. Call ApplyRange to apply the new range and filter the dataset.

EditRangeStart differs from SetRangeStart in that the latter clears all the elements of the search key buffer to the default values (NULL). EditRangeStart leaves the elements of the search key buffer with their current values.

Note

With Paradox or dBASE tables, these methods work only with indexed fields. With SQL databases, they can work with any columns specified in the IndexFieldNames property.


TTable::EmptyTable

TTable	Methods

Deletes all records from the table.

Syntax

void __fastcall EmptyTable(void);

The EmptyTable method deletes all records from the database table specified by TableName. Before calling this method, the DatabaseName, TableName and TableType properties must be assigned values.

Note

If the table is open, it must have been opened with the Exclusive property set to true.


TTable::FindKey

TTable	Methods

Searches the table to find a record with specified index fields.

Syntax

System::Boolean __fastcall FindKey(const TVarRec *KeyValues, const System::Integer KeyValues_Size);

The FindKey method searches the dataset to find a record whose index fields match those passed in KeyValues. FindKey takes a comma-delimited array of values as its argument, where each value corresponds to a index column in the underlying table. The values can be literals, variables, null, or NULL. If the number of values supplied is less than the number of columns in the database table, then the remaining values are assumed to be null. FindKey searches for values specified in the array in the current index.

•	FindKey does the following:

•	Puts the TTable in SetKey state.

•	Finds the record in the table that matches the specified values. If a matching record is found, it moves the cursor there, and returns true.

If a matching record is not found, it does not move the cursor, and returns false.


TTable::FindNearest

TTable	Methods

Moves the cursor to the nearest record.

Syntax

void __fastcall FindNearest(const TVarRec *KeyValues, const System::Integer KeyValues_Size);

The FindNearest method moves the cursor to the first record whose index fields' values are greater than or equal to those passed in KeyValues. The search begins at the first record, not at the current cursor position. This method can be used to match columns of string data type only. If you do not supply values for each field in the index key, any unassigned fields will use a null value.

FindNearest works by default on the primary index column. To search the table for values in other indexes, you must specify the field name in the table's IndexFieldNames property or the name of the index in the IndexName property.

The KeyExclusive property indicates whether a search will position the cursor on or after the specified record being searched for.

Note

With Paradox or dBASE tables, FindNearest works only with indexed fields. With SQL databases, it can work with any columns specified in the IndexFieldNames property.


TTable::GetIndexNames

TTable	Methods

Syntax

void __fastcall GetIndexNames(Classes::TStrings *List);

The GetIndexNames method adds the names of all available indexes for the TTable to the List parameter.


TTable::GotoCurrent

TTable	Methods

Syntax

void __fastcall GotoCurrent(TTable *Table);

Use the GotoCurrent method to synchronize the positions of two TTable components that use the same database table. GotoCurrent changes the position of the table to match that of the Table parameter.

Note

Both tables must have the same DatabaseName and TableName or a "table mismatch" exception will be raised.


TTable::GotoKey

TTable	Methods

Moves the cursor to a specific record.

Syntax

System::Boolean __fastcall GotoKey(void);

The GotoKey method is used with the SetKey or EditKey method to move to a specific record in a TTable. Call SetKey to put the table in SetKey state. In SetKey state, assignments to fields indicate values to search for in indexed fields. GoToKey then moves the cursor to the first row in the table that matches those field values.

GoToKey is a Boolean function that moves the cursor and returns true if the search is successful. If the search is unsuccessful, it returns false and does not change the position of the cursor.

Note

If you want to search on a subset of fields in a multiple-field key, you must set the KeyFieldCount property to the number of fields on which you want to search.


TTable::GotoNearest

TTable	Methods

Used with the EditKey and SetKey methods to move the cursor to a record in the dataset whose index fields are greater than or equal to the IndexFields property.

Syntax

void __fastcall GotoNearest(void);

Call SetKey first to put the TTable in SetKey state, modify the fields of the key, and finally call GotoNearest to perform the move.

The KeyExclusive property indicates whether a search will position the cursor on or after the specified record being searched for.

You do not have to assign a value for each field in the index key. Any unassigned field will use a NULL value.

The search begins at the first record in the table, not at the current cursor position.


TTable::LockTable

TTable	Methods

Locks the table.

Syntax

void __fastcall LockTable(TLockType LockType);

The LockTable method locks the table, to prevent other users from being able to place other locks on it. The LockType parameter specifies the type of lock. You can apply more than one lock to a single table. LockTable only works with dBASE and Paradox tables.


TTable::OpenIndexFile

TTable	Methods

Opens the specified dBASE non-production index file.

Syntax

void __fastcall OpenIndexFile(const System::AnsiString IndexName);

While non-production indexes are open, updates made to the table maintain the indexes. You can make one the active index by setting the IndexName property.


TTable::RenameTable

TTable	Methods

Renames a table.

Syntax

void __fastcall RenameTable(const System::AnsiString NewTableName);

The RenameTable method renames a table, including any  constituent files (for example, Paradox .DB and .MB files).  RenameTable only works with dBASE and Paradox tables.


TTable::SetRange

TTable	Methods

Combines the functionality of the SetRangeStart, SetRangeEnd, and ApplyRange methods.

Syntax

void __fastcall SetRange(const TVarRec *StartValues, const System::Integer StartValues_Size, const

SetRange assigns the elements of StartValues to the beginning index key, the elements of EndValues to the ending index key, and then calls ApplyRange. This enables an application to filter the data visible to the dataset.

If either StartValues or EndValues has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.

Note

With Paradox or dBASE tables, these methods work only with indexed fields. With SQL databases, they can work with any columns specified in the IndexFieldNames property.


TTable::SetRangeEnd

TTable	Methods

Indicates that subsequent assignments to field values specify the end of the range of rows to include in the dataset.

Syntax

void __fastcall SetRangeEnd(void);

This enables an application to filter the data that is visible to it. Any column values not specified are not considered. The corresponding method EditRangeEnd indicates to keep existing range values and update with the succeeding assignments.

Call ApplyRange to apply the range filter defined with SetRangeEnd and SetRangeStart.

SetRangeEnd differs from EditRangeEnd in that it clears all the elements of the range filter to the default values (or NULL). EditRangeEnd leaves the elements of the range filter with their current values.

Note

With Paradox or dBASE tables, these methods work only with indexed fields. With SQL databases, they can work with any columns specified in the IndexFieldNames property.


TTable::SetRangeStart

TTable	Methods

Indicates that subsequent assignments to field values specify the start of the range of rows to include in the dataset.

Syntax

void __fastcall SetRangeStart(void);

This enables an application to filter the data that is visible to it. Any column values not specified are not considered. The corresponding method EditRangeStart indicates to keep existing range values and update with the succeeding assignments.

Call ApplyRange to apply the range filter defined with SetRangeEnd and SetRangeStart.

SetRangeStart differs from EditRangeStart in that it clears all the elements of range filter to the default values (or NULL). EditRangeStart leaves the elements of range filter with their current values.

Note

With Paradox or dBASE tables, these methods work only with indexed fields. With SQL databases, they can work with any columns specified in the IndexFieldNames property.


TTable::UnlockTable

TTable	Methods

Removes a lock on a table.

Syntax

void __fastcall UnlockTable(TLockType LockType);

The LockType parameter specifies which type of lock should be removed. UnlockTable only works with dBASE and Paradox tables.


TTable::TTable

TTable	Methods	See also

TTable creates a new TTable object.

Syntax

__fastcall virtual TTable(Classes::TComponent *AOwner);

Description

Use TTable to create a new TTable object.


TTable::~TTable

TTable	Methods	See also

~TTable frees the memory associated with the TTable object.

Syntax

__fastcall virtual ~TTable(void);

Description

Do not call ~TTable directly. Instead, use the delete keyword on the object, which causes ~TTable to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TDBDataSet


TTable example

TTable


TTabList

Hierarchy	Properties	Methods	Events

Header

vcl/tabs.hpp

Description


TTabList properties

TTabList	Alphabetically	Legend

Derived from TStringList

Count

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

Text

Values


TTabList properties

TTabList	By object	Legend

CommaText

Count

Duplicates

Names

Objects

Sorted

Strings

Text

Values


TTabList events

TTabList	Alphabetically

Derived from TStringList

OnChange

OnChanging


TTabList events

TTabList	By object

OnChange

OnChanging


TTabList methods

TTabList	Alphabetically

In TTabList

~TTabList

Add

AddStrings

Clear

Delete

Insert

Put

TTabList

Derived from TStringList

Exchange

Find

IndexOf

Sort

Derived from TStrings

AddObject

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabList methods

TTabList	By object

~TTabList

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Find

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

Put

SaveToFile

SaveToStream

SetText

Sort

TTabList


TTabList::Add

TTabList	Methods

Syntax

virtual System::Integer __fastcall Add(const System::AnsiString S);

Description


TTabList::AddStrings

TTabList	Methods

Syntax

virtual void __fastcall AddStrings(Classes::TStrings *Strings);

Description


TTabList::Clear

TTabList	Methods

Syntax

virtual void __fastcall Clear(void);

Description


TTabList::Delete

TTabList	Methods

Syntax

virtual void __fastcall Delete(System::Integer Index);

Description


TTabList::Insert

TTabList	Methods

Syntax

virtual void __fastcall Insert(System::Integer Index, const System::AnsiString S);

Description


TTabList::Put

TTabList	Methods

Syntax

virtual void __fastcall Put(System::Integer Index, const System::AnsiString S);

Description


TTabList::TTabList

TTabList	Methods	See also

TTabList creates a new TTabList object.

Syntax

__fastcall TTabList(void);

Description

Use TTabList to create a new TTabList object.


TTabList::~TTabList

TTabList	Methods	See also

~TTabList frees the memory associated with the TTabList object.

Syntax

__fastcall virtual ~TTabList(void);

Description

Do not call ~TTabList directly. Instead, use the delete keyword on the object, which causes ~TTabList to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings

TStringList


TTabList example

TTabList


TTabbedNotebook

Hierarchy	Properties	Methods	Events

The TTabbedNotebook component contains multiple pages, each with its own set of controls. The user selects a page by clicking the page’s tab that appears at the top of the control. TTabbedNotebook is provided for backward compatibility. Use TPageControl component in Microsoft Windows 95 and Windows NT applications.

Header

vcl/tabnotbk.hpp

The pages available in the tabbed notebook control are the strings specified as the value of the Pages property. You can access a particular page in the notebook either with the PageIndex property or the ActivePage property.

If you need to determine the PageIndex value of a particular page, call the GetIndexForPage method.

You determine how many tabs appear in a row by setting the TabsPerRow property. If there are more pages than there are tabs in one row, multiple rows automatically appear in the control. You can specify the font of the text on the tabs with the TabFont property.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TTabbedNotebook properties

TTabbedNotebook	Alphabetically	Legend

In TTabbedNotebook

ActivePage

PageIndex

Pages

TabFont

TabsPerRow

TopFont

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabbedNotebook properties

TTabbedNotebook	By object	Legend

ActivePage

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

PageIndex

Pages

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabFont

TabOrder

TabsPerRow

TabStop

Tag

TopFont

Top

Visible

Width


TTabbedNotebook::ActivePage

TTabbedNotebook	Properties

Determines which page displays in the notebook or tabbed notebook control.

Syntax

__property System::AnsiString ActivePage;

The value of ActivePage must be one of the strings contained in the Pages property.


TTabbedNotebook::PageIndex

TTabbedNotebook	Properties

Determines which page displays in the tabbed notebook component.

Syntax

__property System::Integer PageIndex;

Changing the PageIndex value changes the page in the control.

Each string in the Pages property is automatically assigned a PageIndex value when the page is created. The first page receives a value of 0, the second has a value of 1, and so on. If you delete a string from the Pages property, the PageIndex values are reassigned so that the values always begin with 0 and continue to increase without any gaps between values.


TTabbedNotebook::Pages

TTabbedNotebook	Properties

Contains the strings that identify the individual pages of the tabbed notebook control.

Syntax

__property Classes::TStrings * Pages;

Both these controls create a separate page for each string in the Pages property. For example, if Pages contains three strings, First, Second, and Third, the control has three separate pages.

You can access the various pages in a notebook or tabbed notebook control with either the ActivePage or PageIndex property.


TTabbedNotebook::TabFont

TTabbedNotebook	Properties

Determines the font used on the tabs of the tabbed notebook control.

Syntax

__property Graphics::TFont * TabFont;

The text on the selected tab is boldfaced if the selected font for the TabFont property is not also boldfaced.


TTabbedNotebook::TabsPerRow

TTabbedNotebook	Properties

The TabsPerRow property is obsolete and retained only for backwards compatibility.

Syntax

__property System::Integer TabsPerRow;

The TabsPerRow property determines the number of tabs that can appear in a row at the top of the tabbed notebook control. If there are more tabbed pages in the control than can fit in one row, multiple rows are displayed. The number of tabs you specify affects the size of the tabs--the more tabs per row--the smaller the tabs.


TTabbedNotebook::TopFont

TTabbedNotebook	Properties

Notdoct for this object in the current doc set

Syntax

__property Graphics::TFont * TopFont;


TTabbedNotebook events

TTabbedNotebook	Alphabetically	Legend

In TTabbedNotebook

OnChange

OnClick

Derived from TWinControl

OnEnter

OnExit


TTabbedNotebook events

TTabbedNotebook	By object	Legend

OnChange

OnClick

OnEnter

OnExit


TTabbedNotebook::OnChange

TTabbedNotebook	Events

Syntax

__property TPageChangeEvent OnChange;


TTabbedNotebook::OnClick

TTabbedNotebook	Events

Syntax

__property Classes::TNotifyEvent OnClick;


OnEnter


OnExit


TTabbedNotebook methods

TTabbedNotebook	Alphabetically

In TTabbedNotebook

~TTabbedNotebook

GetIndexForPage

TabFontChanged

TTabbedNotebook

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabbedNotebook methods

TTabbedNotebook	By object

~TTabbedNotebook

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetIndexForPage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TabFontChanged

TTabbedNotebook

UpdateControlState

Update


TTabbedNotebook::GetIndexForPage

TTabbedNotebook	Methods

Returns the PageIndex value of the specified page.

Syntax

System::Integer __fastcall GetIndexForPage(const System::AnsiString PageName);

The PageIndex property value is determined by the page's position in the Pages property array. Specify the name of the page as the value of the PageName parameter. The name you specify must be one of the strings in the Pages property.


TabFontChange

Not doct for this object in the current doc set


TTabbedNotebook::TTabbedNotebook

TTabbedNotebook	Methods	See also

TTabbedNotebook creates a new TTabbedNotebook object.

Syntax

__fastcall virtual TTabbedNotebook(Classes::TComponent *AOwner);

Description

Use TTabbedNotebook to create a new TTabbedNotebook object.


TTabbedNotebook::~TTabbedNotebook

TTabbedNotebook	Methods	See also

~TTabbedNotebook frees the memory associated with the TTabbedNotebook object.

Syntax

__fastcall virtual ~TTabbedNotebook(void);

Description

Do not call ~TTabbedNotebook directly. Instead, use the delete keyword on the object, which causes ~TTabbedNotebook to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TTabbedNotebook example

TTabbedNotebook


TTabPage

Hierarchy	Properties	Methods

Header

vcl/tabnotbk.hpp

Description


TTabPage properties

TTabPage	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabPage properties

TTabPage	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TTabPage methods

TTabPage	Alphabetically

In TTabPage

~TTabPage

TTabPage

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabPage methods

TTabPage	By object

~TTabPage

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabPage

UpdateControlState

Update


TTabPage::TTabPage

TTabPage	Methods	See also

TTabPage creates a new TTabPage object.

Syntax

__fastcall virtual TTabPage(Classes::TComponent *AOwner);

Description

Use TTabPage to create a new TTabPage object.


TTabPage::~TTabPage

TTabPage	Methods	See also

~TTabPage frees the memory associated with the TTabPage object.

Syntax

__fastcall virtual ~TTabPage(void);

Description

Do not call ~TTabPage directly. Instead, use the delete keyword on the object, which causes ~TTabPage to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTabPage example

TTabPage


TTabSet

Hierarchy	Properties	Methods	Events

The TTabSet component presents horizontal tabs users can click to initiate actions. Tab set controls are commonly used with TNotebook controls to display pages within the same dialog box. TTabSet is provided for backward compatibility. Use TTabControl component in Microsoft Windows 95 and Windows NT applications.

Header

vcl/tabs.hpp

You create a set of tabs for the tab set control when you specify a list of strings as the value of the Tabs property. One tab is created for each string. If you are using a tab set control to work with a notebook control (TNotebook), this line of RefSyn creates a tab for each page of the notebook control:

Then, in the OnClick event handler of the tab set control, this line of RefSyn changes the current page in the notebook control when the user clicks a tab:

To determine which tab is currently selected or to use RefSyn to select a tab, use the TabIndex property. To find out which tab is the first visible tab in the tab set control or to make a tab the first visible tab, use the FirstIndex property.

Several properties affect the appearance of the tab set control. Tabs are usually displayed at the bottom of a form. To display the tabs at the bottom of the form, choose alBottom as the Align property value. Set the SelectedColor and UnselectedColor properties to help the user tell the difference between a selected and an unselected tab. The BackgroundColor and the DitherBackground properties determine how the background of the tab set appears. You can determine how far from the edge of the control the tabs are positioned with the StartMargin and EndMargin properties. If you want scroll buttons to appear automatically when the tab set control doesn’t have enough room to display all the tabs, set AutoScroll to true.

You can display graphics on tabs as well as text. Use the Style property select an owner-draw tab style.


TTabSet properties

TTabSet	Alphabetically	Legend

In TTabSet

AutoScroll

BackgroundColor

DitherBackground

EndMargin

FirstIndex

SelectedColor

StartMargin

Style

TabHeight

TabIndex

Tabs

UnselectedColor

VisibleTabs

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabSet properties

TTabSet	By object	Legend

Align

AutoScroll

BackgroundColor

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DitherBackground

DragMode

Enabled

EndMargin

FirstIndex

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentShowHint

Parent

PopupMenu

SelectedColor

ShowHint

Showing

StartMargin

Style

TabHeight

TabIndex

TabOrder

TabStop

Tabs

Tag

Top

UnselectedColor

VisibleTabs

Visible

Width


TTabSet::AutoScroll

TTabSet	Properties

Determines if scroll buttons automatically appear in a tab set control if there isn't room in the control to display all the tabs.

Syntax

__property System::Boolean AutoScroll;

If AutoScroll is false, your application can still access tabs that aren't visible by using the FirstIndex or TabIndex properties at design time or run time, but the user can't click on the tabs with the mouse at run time.


TTabSet::BackgroundColor

TTabSet	Properties

Determines the background color of the tab set control.

Syntax

__property Graphics::TColor BackgroundColor;

The background area of the tab set control is the area between the tabs and the border of the control. For a list of possible color values, see the Color property.


TTabSet::DitherBackground

TTabSet	Properties

Determines whether the selected background color set with the BackgroundColor property is dithered.

Syntax

__property System::Boolean DitherBackground;

Dithering means the background is lightened by 50%, which is intended to make the tabs easier to see. If DitherBackground is true, the tab set control background is dithered. If it is false, there is no dithering.


TTabSet::EndMargin

TTabSet	Properties

Determines how far in pixels the rightmost tab appears from the right edge of the tab set control.

Syntax

__property System::Integer EndMargin;

The EndMargin property determines how far in pixels the rightmost tab appears from the right edge of the tab set control. Together with the StartMargin property, EndMargin can play a role in determining how many tabs can fit within the tab set control.

If AutoScroll is true and scroll buttons appear in the tab set control, EndMargin determines how far in pixels the rightmost tab appears from the left edge of the scroll buttons, rather than the edge of the tab set control.


TTabSet::FirstIndex

TTabSet	Properties

Specifies the tab that appears in the leftmost visible position in the tab set control.

Syntax

__property System::Integer FirstIndex;

Any tabs with a lower value in the FirstIndex property scroll to the left in the tab set control and don't appear until the user scrolls the tabs.

The default value of FirstIndex is 0 indicating that the tab with an index of 0 is in the leftmost position. For example, if you have three tabs labeled First, Second, and Third with TabIndex values of 0, 1, and 2, respectively, First appears first, by default, because it has an index value of 0. If you want to shift the tabs so the Second or Third tab appears leftmost in the tab set control, change the FirstIndex value to 1 or 2.


TTabSet::SelectedColor

TTabSet	Properties

Determines the color of the selected tab in the tab set control.

Syntax

__property Graphics::TColor SelectedColor;

The SelectedColor property determines the color of the selected tab in the tab set control. To view a list of available color values, see the Color property.


TTabSet::StartMargin

TTabSet	Properties

Determines how far in pixels the first tab appears from the left edge of the tab set control.

Syntax

__property System::Integer StartMargin;

Together with the EndMargin property, StartMargin can play a role in determining how many tabs can fit within the tab set control.


TTabSet::Style

TTabSet	Properties

Determines how a tab appears.

Syntax

__property TTabStyle Style;

These are the possible values:

Value	Meaning

tsStandard	Each tab has the standard size and look.

tsOwnerDraw	Each tab has the height specified with the TabHeight property and width needed to hold the text or glyph.

Owner-draw tabs can display objects other than strings, such as graphical images. Owner-draw tabs require more programming, however, as the application needs information on how to render the image for each tab in the tab set control.

Each time an item is displayed in an tsOwnerDraw tab, two events occur. The first is the OnMeasureTab event. In the OnMeasureTab event handler, you write the RefSyn that calculates the width of the tab needed to hold the text or graphical image. After the OnMeasureTab event, the OnDrawTab event occurs. The RefSyn you write for the OnDrawTab event draws the tab and its contents using the width found with the OnMeasureTab event and the height specified as the value of the TabHeight property.


TTabSet::TabHeight

TTabSet	Properties

Determines the height of the tabs in a tab set control when the tab set control's Style property value is tsOwnerDraw.

Syntax

__property System::Integer TabHeight;

If the Style property value is tsStandard, the TabHeight property value is ignored.


TTabSet::TabIndex

TTabSet	Properties

Determines which tab of a tab set control is currently selected.

Syntax

__property System::Integer TabIndex;

The value can be from -1 to one less than the number of strings in the Tabs property array (Tabs.Count - 1). A value of 0 indicates the first tab in the tab set control, 1 is the second tab, and so on. If no tabs are selected, TabIndex has a value of -1.

TabIndex can be used as an index to the Tabs array property.

When a value is assigned to TabIndex, the OnClick event for the tab set occurs, followed by the OnChange event, just as if the user had clicked on a new tab.


TTabSet::Tabs

TTabSet	Properties

Contains the list of text strings that appear on the tabs.

Syntax

__property Classes::TStrings * Tabs;

For each string in the Tabs property, a new tab is created to display the text string. At design time, you enter the text strings you want to appear on the tabs using the String List editor. Double-click the value column of the Tabs property to display the String List editor. You can also change strings in the Tabs property at run time.


TTabSet::UnselectedColor

TTabSet	Properties

Determines the color of the tabs that aren't currently selected in the tab set control.

Syntax

__property Graphics::TColor UnselectedColor;

The UnselectedColor property determines the color of the tabs that aren't currently selected in the tab set control.


TTabSet::VisibleTabs

TTabSet	Properties

[THIS IS “PUBLISHED, READ-ONLY” IN THE SOURCE REFSYN!! THAT DOENS’T MAKE SENSE - ASK R&D ABOUT IT]

Syntax

__property System::Integer VisibleTabs;

Contains the number of tabs currently visible in the tab set control.


TTabSet events

TTabSet	Alphabetically	Legend

In TTabSet

OnChange

OnDrawTab

OnMeasureTab

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabSet events

TTabSet	By object	Legend

OnChange

OnClick

OnDragDrop

OnDragOver

OnDrawTab

OnEndDrag

OnEnter

OnExit

OnMeasureTab

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabSet::OnChange

TTabSet	Events

Syntax

__property TTabChangeEvent OnChange;


OnClick


OnDragDrop


OnDragOver


TTabSet::OnDrawTab

TTabSet	Events

Syntax

__property TDrawTabEvent OnDrawTab;


OnEndDrag


OnEnter


OnExit


TTabSet::OnMeasureTab

TTabSet	Events

Syntax

__property TMeasureTabEvent OnMeasureTab;


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TTabSet methods

TTabSet	Alphabetically

In TTabSet

~TTabSet

ItemAtPos

ItemRect

SelectNext

TTabSet

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabSet methods

TTabSet	By object

~TTabSet

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectNext

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabSet

UpdateControlState

Update


TTabSet::ItemAtPos

TTabSet	Methods

Returns the index of the tab indicated by the coordinates of a point on the control.

Syntax

System::Integer __fastcall ItemAtPos(const Windows::TPoint &Pos);

The Pos parameter is the point in the control in window coordinates. If the returned index is 0, the tab is the first tab in the tab set, if the index is 1, the tab is the second tab, and so on.

ItemAtPos is useful for determining which tab is located at a particular position in the tab set control.


TTabSet::ItemRect

TTabSet	Methods

Returns the rectangle that surrounds the item specified in the Item parameter.

Syntax

Windows::TRect __fastcall ItemRect(System::Integer Item);


TTabSet::SelectNext

TTabSet	Methods

Selects the next tab in a tab set control, and scrolls that tab set control if necessary to bring the selected tab into view.

Syntax

void __fastcall SelectNext(System::Boolean Direction);

The value of the Direction parameters determines if the tab to the left or right is selected. If Direction is true, the tab to the right is selected. If Direction is false, the tab to the left is selected. When the last tab in either direction is selected, calling SelectNext using the same direction wraps around to the beginning of the tab order. For example, if your application has three tabs, First, Second, and Third, and Third is the current tab, calling SelectNext(true) selects First. Likewise, if First is the current tab, SelectNext(false) selects Third.

When SelectNext is called, the OnClick event of the tab set occurs, followed by the OnChange event, just as if the user had clicked on a new tab.


TTabSet::TTabSet

TTabSet	Methods	See also

TTabSet creates a new TTabSet object.

Syntax

__fastcall virtual TTabSet(Classes::TComponent *AOwner);

Description

Use TTabSet to create a new TTabSet object.


TTabSet::~TTabSet

TTabSet	Methods	See also

~TTabSet frees the memory associated with the TTabSet object.

Syntax

__fastcall virtual ~TTabSet(void);

Description

Do not call ~TTabSet directly. Instead, use the delete keyword on the object, which causes ~TTabSet to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TTabSet example

TTabSet


TTabSheet

Hierarchy	Properties	Methods	Events

The TTabSheet component is an individual page in a TPageControl component. Tab sheets are typically referred to as pages. The TPageControl maintains a zero-based indexed array of its tab sheets in its Pages property. The page control’s PageCount property specifies the number of tab sheets in the page control and its ActivePage property indicates the currently active tab sheet. Click on a tab to activate the tab sheet or use FindNextPage and SelectNextPage to sequentially page through the tab sheets in the page control.

Header

vcl/comctrls.hpp

At design-time a tab sheet is automatically assigned a PageIndex value according to a zero-based index and the TabVisible property is true by default. At run-time use the read-only TabIndex property to return the index of the tab in the page control; if TabIndex is -1 the tab is not visible. The PageControl property determines to which page control the tab sheet is associated.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TTabSheet properties

TTabSheet	Alphabetically	Legend

In TTabSheet

PageControl

PageIndex

TabIndex

TabVisible

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabSheet properties

TTabSheet	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

PageControl

PageIndex

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabIndex

TabOrder

TabStop

TabVisible

Tag

Top

Visible

Width


TTabSheet::PageControl

TTabSheet	Properties

Returns the TPageControl object that is associated with the TTabSheet.

Syntax

__property TPageControl * PageControl;

Tab sheets represent the individual pages of a page control.


TTabSheet::PageIndex

TTabSheet	Properties

Provides access to the index value given the tab sheet.

Syntax

__property System::Integer PageIndex;

Tab sheets represent the pages of a TPageControl. Each tab sheet in a page control is automatically assigned a PageIndex when it is created. The first tab sheet receives a value of 0, the second has a value of 1, and so on. PageIndex values are reassigned if tab sheets are deleted.

Use PageIndex to access the index value given the tab sheet. To access a particular tab sheet given its index value, use the indexed Pages property of the TPageControl.


TTabSheet::TabIndex

TTabSheet	Properties

Returns the index value of a tab sheet according to its index into an array of visible tabs in a TPageControl.

Syntax

__property System::Integer TabIndex;

For example, a tab sheet may have a PageIndex of 3 but a TabIndex of 2 if one of the previous tab sheets in the page control is not visible. If a tab sheet's TabVisible property is false, the TabIndex property is -1.


TTabSheet::TabVisible

TTabSheet	Properties

Determines whether the tab of a TTabSheet component is visible in a TPageControl.

Syntax

__property System::Boolean TabVisible;

If TabVisible is false, its TabIndex property is -1. Clicking on a tab activates the tab sheet. If TabVisible is false, the tab does not appear; in which case, you can use FindNextPage with the CheckTabVisble set to false to increment through both visible and non-visible page controls and activate the tab sheet. For example, to hide a tab at run time, you could use the following RefSyn:


TTabSheet events

TTabSheet	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TTabSheet events

TTabSheet	By object	Legend

OnDragDrop

OnDragOver

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


OnDragDrop


OnDragOver


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


TTabSheet methods

TTabSheet	Alphabetically

In TTabSheet

~TTabSheet

TTabSheet

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabSheet methods

TTabSheet	By object

~TTabSheet

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabSheet

UpdateControlState

Update


TTabSheet::TTabSheet

TTabSheet	Methods	See also

TTabSheet creates a new TTabSheet object.

Syntax

__fastcall virtual TTabSheet(Classes::TComponent *AOwner);

Description

Use TTabSheet to create a new TTabSheet object.


TTabSheet::~TTabSheet

TTabSheet	Methods	See also

~TTabSheet frees the memory associated with the TTabSheet object.

Syntax

__fastcall virtual ~TTabSheet(void);

Description

Do not call ~TTabSheet directly. Instead, use the delete keyword on the object, which causes ~TTabSheet to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTabSheet example

TTabSheet


TTableDataLink

Hierarchy	Properties	Methods	See also

TTableDataLink is a helper object that helps a TTable object respond to data events and that manages the field list for a TTable object.

Header

vcl/dbtables.hpp

Description

TTableDataLink is tailored to work with a TTable object. It should only be used by the TTable class.


TTableDataLink properties

TTableDataLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TTableDataLink properties

TTableDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TTableDataLink methods

TTableDataLink	Alphabetically	Legend

In TTableDataLink

~TTableDataLink

ActiveChanged

CheckBrowseMode

LayoutChanged

RecordChanged

TTableDataLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTableDataLink methods

TTableDataLink	By object	Legend

~TTableDataLink

ActiveChanged

Assign

CheckBrowseMode

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

TTableDataLink

UpdateRecord


TTableDataLink::ActiveChanged

TTableDataLink	Methods	See also

ActiveChanged helps the TTable respond to changes in the Active property by regenerating the field list.

Syntax

virtual void __fastcall ActiveChanged(void);

procedure ActiveChanged; override;

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn regenerates the field list and then calls the MasterChanged method of the TTable object that owns this TTableDataLink. ActiveChanged ensures that the field list reflects any changes to the underlying database that may have occurred while the dataset was not Active, as the TTableLink would not have received any data events for those changes.


TTableDataLink::CheckBrowseMode

TTableDataLink	Methods	See also

CheckBrowseMode informs the TTable that the dataset is about to change.

Syntax

virtual void __fastcall CheckBrowseMode(void);

procedure CheckBrowseMode; override;

Description

Call CheckBrowseMode just prior to changing the dataset for the TTableDataLink. CheckBrowseMode passes these events on to the TTable by calling the TTable’s CheckBrowseMode method.


TTableDataLink::LayoutChanged

TTableDataLink	Methods	See also

LayoutChanged helps the TTable respond to changes in the layout of whatever control represents the TTable.

Syntax

virtual void __fastcall LayoutChanged(void);

procedure LayoutChanged; override;

Description

LayoutChanged is called automatically, following a change in the layout of any object that represents TTable, if the change affects the order or number of fields in the field list. LayoutChanged regenerates the field list to reflect the changes, and then calls the MasterChanged method of the TTable object that owns this TTableDataLink.


TTableDataLink::RecordChanged

TTableDataLink	Methods	See also

RecordChanged informs the TTable of changes to the current record or field of the dataset.

Syntax

virtual void __fastcall RecordChanged(Db::TField *Field);

procedure RecordChanged; override;

Description

RecordChanged is called when the contents of the active record are changed by the DataSet. RecordChanged allows the TTable to respond to these changes by calling its MasterChanged method.


TTableDataLink::TTableDataLink

TTableDataLink	Methods	See also

TTableDataLink creates a new TTableDataLink object.

Syntax

__fastcall TTableDataLink(TTable *Table);

Description

Use TTableDataLink to create a new TTableDataLink object.


TTableDataLink::~TTableDataLink

TTableDataLink	Methods	See also

~TTableDataLink frees the memory associated with the TTableDataLink object.

Syntax

__fastcall virtual ~TTableDataLink(void);

Description

Do not call ~TTableDataLink directly. Instead, use the delete keyword on the object, which causes ~TTableDataLink to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TTableDataLink example

TTableDataLink


TTextAttributes

Hierarchy	Properties	Methods	See also

TTextAttributes is a helper object that represents a set of font characteristics for a section of text in a rich edit control.

Header

vcl/comctrls.hpp

Description

TTextAttributes includes a number of properties that describe the font characteristics of some text in a rich text document. TTextAttributes is tailored to allow a descendent of TCustomRichEdit to read and write the default text characteristics (via its DefAttributes property) or the characteristics of the selected text (via its SelAttributes property). The properties of a TTextAttributes object are invalid unless it is owned by a descendent of TCustomRichEdit.

Most of the font characteristics represented by a TTextAttributes object are the same as the properties of a TFont object with the same names.You can assign fonts to text attributes and vice versa.


TTextAttributes properties

TTextAttributes	Alphabetically	Legend

In TTextAttributes

Color

ConsistentAttributes

Height

Name

Pitch

Protected

Size

Style


TTextAttributes properties

TTextAttributes	By object	Legend

Color

ConsistentAttributes

Height

Name

Pitch

Protected

Size

Style


TTextAttributes::Color

TTextAttributes	Properties	See also

Color indicates the foreground color of the text.

Syntax

__property Graphics::TColor Color;

Description

Use color to indicate the color of the actual characters. Background color is a property of the rich edit control that uses the TTextAttributes object, and should be set by the Color property of the rich edit control.

Color can take one of the following values::

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 only: Text color for tooltip controls

clInfoBk 	Windows 95 only: Background color for tooltip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel in Program Manager. However, unless the Color is set to clWindowText, subsequent changes to the color through the Control Panel will not cause the color of the text in the rich edit control to update. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.


TTextAttributes::ConsistentAttributes

TTextAttributes	Properties	See also

ConsistentAttributes indicates which of the properties of the TTextAttributes object are consistent throughout the text of the current selection in the rich edit object.

Syntax

__property TConsistentAttributes ConsistentAttributes;

Description

Read the ConsistentAttributes of the SelAttributes property of a rich text object to discover which of the properties of the TTextAttributes are meaningful for the current selection. This information is relevent if you want to then read the text characteristics of the current selection. Setting a proprety of the TTextAttributes will cause that property to become a consistent attribute until the selection changes.

ConsistentAttributes is a set from among the following values:

Value	Meaning

caBold	Characters are consistently either bold or not bold throughout the entire selection.

caColor	The color of character font is consistent throughout the entire selection.

caFace	The facename of the character font is consistent throughout the entire selection.

caItalic	Characters are consistently either italic or not italic throughout the entire selection.

caSize	The size of the character font is consistent throughout the entire selection.

caStrikeout	Characters consistently either have the strikeout style or they do not have the strikeout style throughout the entire selection.

caUnderline	Characters are consistently either underlined or not underlined throughout the entire selection.

caProtected	Text is consistently either protected or not protected.

Note

Use ConsistentAttributes with the SelAttributes property of the rich edit control. The ConsistentAttributes of the DefAttributes property of the rich edit control is the empty set, even though all attributes are consistent in the section of text that has the default attributes.


TTextAttributes::Height

TTextAttributes	Properties	See also

Height is the height of the font in pixels.

Syntax

__property System::Integer Height;

Description

To specify a font height in pixels, use the Height property. To specify the size of the font in points instead, use the Size property. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels when displaying a font on the screen.

The relationship between the Height and Size properties is expressed by the formula:

Height = Size * 72 / ScreenPixelsPerInch

Note

Unlike the Height property of a TFont object, the Height property of a TTextAttributes object always includes the internal leading that appears at the top of the font.


TTextAttributes::Name

TTextAttributes	Properties	See also

Name specifies the face name of the font described by the TTextAttributes object.

Syntax

__property Graphics::TFontName Name;

Description

Use Name to specify the face name of the font. Face names are strings of up to 32 characters used by Windows to identify a font. The Name is the identifier for the font that most font selection controls show.


TTextAttributes::Pitch

TTextAttributes	Properties	See also

Pitch specifies whether the characters in the font all have the same width.

Syntax

__property Graphics::TFontPitch Pitch;

Description

Each font face has an associated pitch. The characters in fixed-pitch fonts are all the same width. The characters in variable-pitch fonts differ in width. Fixed pitch fonts are generally used for representing source code, because they allow the indentation to line up properly. Variable pitch fonts are generally used to give text a more natural appearance.

Here are the possible values for Pitch:

Value	Meaning

fpDefault	The font pitch is set to the default value, which depends on the font specified in the Name property.

fpFixed	The font pitch is set to fixed. All characters in the font have the same width.

fpVariable	The font pitch is set to variable. The characters in the font have different widths.

Setting the Pitch of a fixed-pitch font to fpVariable or a variable-pitch font to fpFixed will cause Windows to find what it considers the best match to all of the font characteristics that have been specified. This might have no effect on the appearance of a font, or might cause Windows to substitute a different font with the appropriate pitch. For example, setting the pitch of MS Serif (a variable-pitch font) to fpFixed causes Courier to be displayed.


TTextAttributes::Protected

TTextAttributes	Properties	See also

Protected indicates whether the text represented by the TTextAttributes object is protected.

Syntax

protected:

Description

Protected text can not be changed by the user. When the user attempts to edit a selection that includes some protected text, the rich edit control calls the OnProtectChange event handler. The OnProtectChange event handler can then permit or disallow the editing of the protected text. If there is no OnProtectChange event handler, protected text is simply read-only.


TTextAttributes::Size

TTextAttributes	Properties	See also

Size is the height of the font in points.

Syntax

__property System::Integer Size;

Description

To specify a font height in points, use the Size property. To specify the size of the font in pixels instead, use the Height property. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels when displaying a font on the screen.

The relationship between the Height and Size properties is expressed by the formula:

Height = Size * 72 / ScreenPixelsPerInch

Note

Unlike the Size property of a TFont object, the Size property of a TTextAttributes object always includes the internal leading that appears at the top of the font.


TTextAttributes::Style

TTextAttributes	Properties	See also

Style determines whether the font is normal, italic, underlined, bold, or strikeout.

Syntax

__property Graphics::TFontStyles Style;

Description

The Style property is a set from among the following values:

Value	Meaning

fsBold	The font is boldfaced.

fsItalic	The font is italicized.

fsUnderline	The font is underlined.

fsStrikeout	The font is displayed with a horizontal line through it.

Because the Style property is a set, it can contain multiple values. For example, a font could be both boldfaced and italicized.


TTextAttributes methods

TTextAttributes	Alphabetically	Legend

In TTextAttributes

~TTextAttributes

Assign

AssignTo

InitFormat

TTextAttributes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTextAttributes methods

TTextAttributes	By object	Legend

~TTextAttributes

AssignTo

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitFormat

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TTextAttributes


TTextAttributes::Assign

TTextAttributes	Methods	See also

Assign sets the properties of a TTextAttributes object to match the properties specified in another TTextAttributes object or in a TFont object.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description

Use Assign to change all of the text attributes at once. Assign can set the font characteristics of the selected text to match the default font characteristics or vice versa. When the Source is a TTextAttributes object, Assign matches only the Color, Name, Style, and Pitch properties. When the Source is a TFont object, Assign matches the Size as well.

Note

Assign only succeeds at runtime when the Source is a TTextAttributes object, a TFont object, or an object that has implemented an AssignTo method that deals with the TTextAttributes object. Other source objects will raise an EConvertError exception.


TTextAttributes::AssignTo

TTextAttributes	Methods	See also

AssignTo enables the properties of a TTextAttributes object to be assigned to a TFont object.

Syntax

virtual void __fastcall AssignTo(Classes::TPersistent *Dest);

Description

TTextAttributes overrides the inherited AssignTo in order to enable its font properties to be assigned to a TFont object. Applications should not call AssignTo. It is called when the Assign method of the TFont object is called. AssignTo copies the Color, Name, Style, Size, and Pitch properties to the TFont object.


TTextAttributes::InitFormat

TTextAttributes	Methods	See also

InitFormat initializes a TCharFormat structure .

Syntax

void __fastcall InitFormat(Richedit::TCharFormat &Format);

Description

TTextAttributes uses the TCharFormat structure to communicate with the rich edit control window when it gets and sets properties. InitFormat initializes this structure before any particular properties are read or set. InitFormat is exposed as a protected method so that derived classes can use the TCharFormat structure in the implementation of any other text properties.


TTextAttributes::TTextAttributes

TTextAttributes	Methods	See also

TTextAttributes creates a new TTextAttributes object.

Syntax

__fastcall TTextAttributes(TCustomRichEdit *AOwner, TAttributeType AttributeType);

Description

Use TTextAttributes to create a new TTextAttributes object.


TTextAttributes::~TTextAttributes

TTextAttributes	Methods	See also

~TTextAttributes frees the memory associated with the TTextAttributes object.

Syntax

__fastcall virtual ~TTextAttributes(void);

Description

Do not call ~TTextAttributes directly. Instead, use the delete keyword on the object, which causes ~TTextAttributes to be invoked automatically.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TTextAttributes example

TTextAttributes


TThread

Hierarchy	Properties	Methods	Events	See also

TThread is an abstract class that enables creation of separate threads of execution in an application.

Header

vcl/classes.hpp

Description

Each new instance of a subclassed TThread object is a new thread of execution. Multiple instances of a TThread derived class make a Borland C++ Builder application multi-threaded. To use threads in an application, derive a new class from TThread and override its methods.

When an application is run, it’s loaded into memory ready for execution. At this point it becomes a process containing one or more threads that contain the data, code and other system resources for the program. A thread executes one part of an application and is allocated CPU time by the operating system. All threads of a process share the same address space and can access the process’s global variables.

Use threads to improve application performance by

•	Managing input from several communication devices

•	Distinguishing among tasks of varying priority.  For example, a high priority thread handles time critical tasks, and a low priority thread performs other tasks

Following are issues and recommendations to be aware of when using threads:

•	Keeping track of too many threads consumes CPU time; the recommended limit is 16 threads per process on single processor systems

•	With multiple threads updating the same resources, keep threads synchronized to avoid conficts

•	Any methods that access a VCL component and update a form must only be called from within the main VCL thread

To create and use a new thread object:

•	Choose File | New | Thread Object to create a new unit that contains an object derived from the TThread class.

•	Define the new thread object’s Create method.

•	Define the thread object’s Execute method by inserting the code to execute when the thread is executed.

•	Pass any calls that use a VCL component to the Synchronize method which causes the main VCL thread to execute the call, avoiding multi-thread conflicts.

See BORLAND C++ BUILDER 3.0/DEMOS/THREADS for multi-threading program samples.


TThread properties

TThread	Alphabetically	Legend

In TThread

FreeOnTerminate

Handle

Priority

ReturnValue

Suspended

Terminated

ThreadID


TThread properties

TThread	By object	Legend

FreeOnTerminate

Handle

Priority

ReturnValue

Suspended

Terminated

ThreadID


TThread::FreeOnTerminate

TThread	Properties	See also

FreeOnTerminate determines whether the thread object is automatically destroyed when the thread terminates.

Syntax

__property System::Boolean FreeOnTerminate;

Description

FreeOnTerminate is false by default. If the default is used, the thread object must be explicitly destroyed in the application code.


TThread::Handle

TThread	Properties	See also

The Handle property contains the thread's handle.

Syntax

__property System::Integer Handle;

Description

Use Handle when calling Win32 API functions for thread manipulation.


TThread::Priority

TThread	Properties	See also

Priority determines the thread's scheduling priority relative to other threads in the process.

Syntax

__property TThreadPriority Priority;

Description

The Priority property is an enumerated type whose default is tpNormal; adjust the priority higher or lower as needed.

TThreadPriority type defines the possible values for the Priority property of the TThread component, as defined in the following table. Windows schedules CPU cycles to each thread based on a priority scale; the Priority property adjusts a thread's priority higher or lower on the scale.

Values	Meanin

tpIdle	The thread executes only when the system is idle-Windows won't interrupt other threads to execute a thread with tpIdle priority.

tpLowest	The thread's priority is two points below normal.

tpLower	The thread's priority is one point below normal.

tpNormal	The thread has normal priority.

tpHigher	The thread's priority is one point above normal.

tpHighest	The thread's priority is two points above normal.

tpTimeCritical	The thread gets highest priority.

Warning

Boosting the thread priority of a CPU intensive operation may “starve” the other threads in the application. Only apply priority boosts to threads that spend most of their time waiting for external events.


TThread::ReturnValue

TThread	Properties	See also

The ReturnValue property is the thread's equivalent to a function's Result variable.

Syntax

__property System::Integer ReturnValue;

Description

Use ReturnValue to indicate success/failure or numeric result/output of the thread to the application or other threads. The WaitFor method returns the value stored in ReturnValue.


TThread::Suspended

TThread	Properties	See also

The Suspended property indicates whether a thread is suspended.

Syntax

__property System::Boolean Suspended;

Description

Suspended threads don't continue execution until they're resumed. Set Suspended to true to suspend a thread; set it to false to resume it.


TThread::Terminated

TThread	Properties	See also

The Terminated property indicates that the thread has been asked to terminate. The Terminate method sets the Terminated property to true.

Syntax

__property System::Boolean Terminated;

Description

The thread's Execute method and any methods that Execute calls should check Terminated periodically and exit when it's true.

The Terminate method is the polite way to abort the execution of a thread, but it requires cooperation from the thread’s Execute code. Using terminate is recommended over the TerminateThread Win32 API call.


TThread::ThreadID

TThread	Properties	See also

The ThreadID is a thread identifier that uniquely identifies the thread throughout the system. ThreadID is different than its handle in the Handle property.

Syntax

__property System::Integer ThreadID;

Description

ThreadID is useful when calling Win32 API functions for manipulating the thread.


TThread events

TThread	Alphabetically

In TThread

OnTerminate


TThread events

TThread	By object

OnTerminate


TThread::OnTerminate

TThread	Events	See also

The OnTerminate event is triggered after the thread's Execute method has returned and before the thread is destroyed.

Syntax

__property TNotifyEvent OnTerminate;

Description

The OnTerminate event handler is called in the context of the main VCL thread, which means VCL methods and properties can be called freely. The thread object may also be freed within the event handler.

The TNotifyEvent type is the type for events that have no parameters. These events simply notify the component that a specific event occurred, in this case an OnTerminate event.


TThread methods

TThread	Alphabetically	Legend

In TThread

~TThread

DoTerminate

Execute

Resume

Suspend

Synchronize

Terminate

TThread

WaitFor

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TThread methods

TThread	By object	Legend

~TThread

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

DoTerminate

Execute

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Resume

Suspend

Synchronize

Terminate

TThread

WaitFor


TThread::DoTerminate

TThread	Methods	See also

The DoTerminate method triggers the thread’s OnTerminate event handler if one has been assigned.

Syntax

virtual void __fastcall DoTerminate(void);

Description

DoTerminate calls the OnTerminate event handler, but does not terminate the thread.


TThread::Execute

TThread	Methods	See also

Execute is an abstract method that must be overridden; it contains the code to execute when the thread begins.

Syntax

virtual void __fastcall Execute(void);

Description

A thread begins when Create is called with CreateSuspended set to false, and when Resume is first called after Create is called with CreateSuspended set to true. Overide this method and insert the code to be executed when the thread begins. Execute is responsible for checking the value of the Terminated property to determine if the thread needs to exit.


TThread::Resume

TThread	Methods	See also

The Resume method resumes the execution of a suspended thread.

Syntax

void __fastcall Resume(void);

Description

Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread will resume execution.


TThread::Suspend

TThread	Methods	See also

The Suspend method pauses a running thread.

Syntax

void __fastcall Suspend(void);

Description

Call Resume to resume execution. Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread will resume execution.


TThread::Synchronize

TThread	Methods	See also

The Synchonize method executes Method within the main VCL thread.

Syntax

void __fastcall Synchronize(TThreadMethod Method);

Description

The Synchronize method causes the call specified by Method to be executed by the main VCL thread, avoiding multi-thread conflicts. Call any methods that access a VCL component and update a form only from within the main VCL thread by passing them to the Synchronize method.

Note

Execution of the thread is suspended while Method is executing in the main VCL thread.


TThread::Terminate

TThread	Methods	See also

Terminate signals the thread to terminate by setting the Terminated property to true.

Syntax

void __fastcall Terminate(void);

Description

The thread's Execute method and any methods that Execute calls should check Terminated periodically and exit when it's true.


TThread::WaitFor

TThread	Methods	See also

The WaitFor method waits for the thread to terminate and then returns the value of the ReturnValue property.

Syntax

System::Integer __fastcall WaitFor(void);

Description

WaitFor doesn't return until the thread terminates, so the thread must exit either by finishing the Execute method or by exiting when the Terminated property is true. Don't call WaitFor in the context of the main VCL thread if the thread uses Synchronize. Doing so will either cause a deadlock, making it appear that the application has hung, or raise an EThread exception.

Synchronize waits for the main VCL thread to enter the message loop before allowing the method it is trying to synchronize to execute. If the main VCL thread has called WaitFor, it won't enter the message loop and Synchronize will never return. TThread detects that case and will raise an EThread exception in the thread causing it to terminate and, if not caught in the Execute method, the application will terminate as well. If Synchronize is already waiting on the main VCL thread when WaitFor is called, TThread can't intervene, and the application will deadlock.


TThread::TThread

TThread	Methods	See also

TThread creates a new TThread object.

Syntax

__fastcall TThread(System::Boolean CreateSuspended);

Description

Use TThread to create a new TThread object.


TThread::~TThread

TThread	Methods	See also

~TThread frees the memory associated with the TThread object.

Syntax

__fastcall virtual ~TThread(void);

Description

Do not call ~TThread directly. Instead, use the delete keyword on the object, which causes ~TThread to be invoked automatically.


Scope

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


TThread example

TThread


TTimeField

Hierarchy	Properties	Methods	Events	See also

A TTimeField object represents a date field in a dataset.

Header

vcl/dbtables.hpp

Description

Time fields contain time values.

TTimeField differs from its immediate ancestor TDateTimeField only in having a DataType of ftTime. While the underlying physical format for a time field in a database differs from that of a date-time field, TTimeField uses a TDateTime value to store and manipulate time values.

As a descendent of TDateTimeField, TTimeField includes many properties, methods, and events that are useful for managing the value and properties of a temporal field in a database.


TTimeField properties

TTimeField	Alphabetically	Legend

Derived from TDateTimeField

AsDateTime

AsFloat

AsString

AsVariant

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsInteger

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TTimeField properties

TTimeField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TTimeField events

TTimeField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TTimeField events

TTimeField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TTimeField methods

TTimeField	Alphabetically

In TTimeField

~TTimeField

TTimeField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTimeField methods

TTimeField	By object

~TTimeField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TTimeField


TTimeField::TTimeField

TTimeField	Methods	See also

TTimeField creates a new TTimeField object.

Syntax

__fastcall virtual TTimeField(Classes::TComponent *AOwner);

Description

Use TTimeField to create a new TTimeField object.


TTimeField::~TTimeField

TTimeField	Methods	See also

~TTimeField frees the memory associated with the TTimeField object.

Syntax

__fastcall virtual ~TTimeField(void);

Description

Do not call ~TTimeField directly. Instead, use the delete keyword on the object, which causes ~TTimeField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TDateTimeField


TTimeField example

TTimeField


TTimer

Hierarchy	Properties	Methods	Events

TTimer is an object that encapsulates the Windows API timer functions.

Header

vcl/extctrls.hpp

Description

TTimer is a design-time only component that is used to simplify calling the Windows API timer functions SetTimer and KillTimer, and to simplify processing the WM_TIMER messages. Use one timer component for each timer in the application.

Timer properties and methods affect the functionality of the timer by providing information for the timer event. This information includes the timer interval, which corresponds to the parameter for the Windows API SetTimer function. The actual execution of the timer occurs through its OnTimer event.

Caution

Limitations on the total number of timers system-wide are system dependent.


TTimer properties

TTimer	Alphabetically	Legend

In TTimer

Enabled

Interval

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TTimer properties

TTimer	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Enabled

Interval

Name

Owner

Tag


TTimer::Enabled

TTimer	Properties	See also

Enabled controls whether the timer responds to timer events.

Syntax

__property System::Boolean Enabled;

Description

Use Enabled to enable or disable the timer. If Enabled is true, the timer responds normally. If Enabled is false, the timer ignores the OnTimer event. The default is true.


TTimer::Interval

TTimer	Properties	See also

Interval determines the amount of time, in milliseconds, that passes before the timer component initiates another OnTimer event.

Syntax

__property System::Cardinal Interval;

Description

Interval determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs.

Use Interval to specify any cardinal value as the interval between OnTimer events. The default value is 1000 (one second).

Note

A 0 value is valid, however the timer won't call an OnTimer event for a value of 0.

Example

The code in this OnTimer event handler moves a ball, the shape component (TShape) slowly across a form.


TTimer events

TTimer	Alphabetically	Legend

In TTimer

OnTimer


TTimer events

TTimer	By object	Legend

OnTimer


TTimer::OnTimer

TTimer	Events	See also

OnTimer occurs when a specified amount of time, determined by the Interval property, has passed.

Syntax

__property Classes::TNotifyEvent OnTimer;

Description

Use OnTimer to write an event handler to execute an action at regular intervals.

The Interval property of a timer determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs.


TTimer methods

TTimer	Alphabetically

In TTimer

~TTimer

TTimer

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTimer methods

TTimer	By object

~TTimer

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TTimer


TTimer::TTimer

TTimer	Methods	See also

TTimer creates a new TTimer object.

Syntax

__fastcall virtual TTimer(Classes::TComponent *AOwner);

Description

Use TTimer to create a new TTimer object.


TTimer::~TTimer

TTimer	Methods	See also

~TTimer frees the memory associated with the TTimer object.

Syntax

__fastcall virtual ~TTimer(void);

Description

Do not call ~TTimer directly. Instead, use the delete keyword on the object, which causes ~TTimer to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TTimer example

TTimer


TTrackBar

Hierarchy	Properties	Methods	Events

TTrackBar is an optionally-ticked bar control that contains a slider which marks a current Position.

Header

vcl/comctrls.hpp

Move the slider to the desired Position on the bar by dragging it with the mouse or by clicking the mouse on the bar. To use the keyboard to move the slider, press the arrow keys or the PgUp and PgDn keys. The LineSize property specifies the number of ticks moved by arrow keys. The PageSize property specifies the number of ticks moved by the PageUp and PageDown keys, or by mouse clicks on the bar.

To customize the number and placement of tick marks use the TickStyle and TickMarks properties. A TTrackBar can also display a selected range marked by triangular ticks at the starting and ending positions of the selection range. Set the selection range using the SelStart and SelEnd properties.


TTrackBar properties

TTrackBar	Alphabetically	Legend

In TTrackBar

Frequency

LineSize

Max

Min

Orientation

PageSize

Position

SelEnd

SelStart

TickMarks

TickStyle

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTrackBar properties

TTrackBar	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Frequency

Handle

Height

HelpContext

Hint

Left

LineSize

Max

Min

Name

Orientation

Owner

PageSize

ParentCtl3D

ParentShowHint

Parent

PopupMenu

Position

SelEnd

SelStart

ShowHint

Showing

TabOrder

TabStop

Tag

TickMarks

TickStyle

Top

Visible

Width


TTrackBar::Frequency

TTrackBar	Properties

Sets the internal frequency for tick marks on a track bar control

Syntax

__property System::Integer Frequency;

For example, a value of 2 sets a tick mark at every other increment.

To use this property you must set the TickStyle of the TickMarks property to tsAuto.


TTrackBar::LineSize

TTrackBar	Properties

Determines the number of ticks moved using the arrow keys.

Syntax

__property System::Integer LineSize;

The current Position is marked by a slider. The right and down arrow keys increment the value of Position, and the left and up arrow keys decrement the value of Position. Use the PageSize property to set the number of ticks moved using the PgUp and PgDn keys.


TTrackBar::Max

TTrackBar	Properties

Sets the maximum position of a TTrackBar.

Syntax

__property System::Integer Max;

A slider indicates the current Position and moves in increments marked by ticks in a range between Min and Max.


TTrackBar::Min

TTrackBar	Properties

Sets the minimum Position of a TTrackBar.

Syntax

__property System::Integer Min;

A slider indicates the current Position and moves in increments marked by ticks in a range between Min and Max.


TTrackBar::Orientation

TTrackBar	Properties

Determines if a TTrackBar is horizontal or vertical.

Syntax

__property TTrackBarOrientation Orientation;

These are the possible values:

Value	Meaning

tbHorizontal	TTrackBar is horizontal.

tbVertical	TTrackBar is vertical.


TTrackBar::PageSize

TTrackBar	Properties

Determines the number of ticks moved using the PgUp and PgDn keys, or by mouse clicks on the bar.

Syntax

__property System::Integer PageSize;

Use the LineSize property to set the number of ticks moved using the arrow keys.


TTrackBar::Position

TTrackBar	Properties

Indicates the current position of a TTrackBar.

Syntax

__property System::Integer Position;

The Position property is a value, in a range between Min and Max, that indicates the current position of a TTrackBar. Use the LineSize and PageSize properties to set the number of ticks the slider will move Position either on mouse clicks or by using the arrow and paging keys.


TTrackBar::SelEnd

TTrackBar	Properties

Indicates the end point of the selection range of a TTrackBar.

Syntax

__property System::Integer SelEnd;

A track bar can display a selection range specified by the SelStart and SelEnd properties. The SelEnd property indicates the end point of the selection range of a TTrackBar.


TTrackBar::TickMarks

TTrackBar	Properties

Sets the position of tick marks on a TTrackBar.

Syntax

__property TTickMark TickMarks;

Horizontal track bars can have tick marks on either the top or bottom. Vertical track bars can have tick marks on either the left or right. The tmBoth style displays tick marks on both sides of the track bar. These are the possible values:

Value	Meaning

tmBottomRight	Tick marks are on either the bottom or the right of the track bar.

tmTopLeft	Tick marks are on either the top or the left of the track bar.

tmBoth	Tick marks are on both sides of the track bar. The default setting is tmBottomRight.


TTrackBar::TickStyle

TTrackBar	Properties

Determines how tick marks appear on the track bar.

Syntax

__property TTickStyle TickStyle;

These are the possible values of TTickStyle:

Value	Meaning

tsAuto	Track bar displays tick marks automatically for each increment in its range. To use the Frequency property you must set this style.

tsManual	Track bar displays a tick mark at either end. You can also use this style with the SetTick method to set a tick at any position.

tsNone	Track bar displays no tick marks.


TTrackBar events

TTrackBar	Alphabetically	Legend

In TTrackBar

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TTrackBar events

TTrackBar	By object	Legend

OnChange

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TTrackBar::OnChange

TTrackBar	Events

Syntax

__property Classes::TNotifyEvent OnChange;


TTrackBar methods

TTrackBar	Alphabetically

In TTrackBar

~TTrackBar

SetTick

TTrackBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTrackBar methods

TTrackBar	By object

~TTrackBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

SetTick

Show

TTrackBar

UpdateControlState

Update


TTrackBar::SetTick

TTrackBar	Methods

Sets a tick at a specified position

Syntax

void __fastcall SetTick(System::Integer Value);

Specify the position of the tick you want to set as the value of the Value parameter. To use this method you must set the TickStyle of the TickMarks property to tsManual.


TTrackBar::TTrackBar

TTrackBar	Methods	See also

TTrackBar creates a new TTrackBar object.

Syntax

__fastcall virtual TTrackBar(Classes::TComponent *AOwner);

Description

Use TTrackBar to create a new TTrackBar object.


TTrackBar::~TTrackBar

TTrackBar	Methods	See also

~TTrackBar frees the memory associated with the TTrackBar object.

Syntax

__fastcall virtual ~TTrackBar(void);

Description

Do not call ~TTrackBar directly. Instead, use the delete keyword on the object, which causes ~TTrackBar to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTrackBar example

TTrackBar


TTreeNode

Hierarchy	Properties	Methods

Header

vcl/comctrls.hpp


TTreeNode properties

TTreeNode	Alphabetically	Legend

In TTreeNode

AbsoluteIndex

Count

Cut

Data

Deleting

DropTarget

Expanded

Focused

Handle

HasChildren

ImageIndex

Index

IsVisible

Item

ItemId

Level

OverlayIndex

Owner

Parent

Selected

SelectedIndex

StateIndex

Text

TreeView


TTreeNode properties

TTreeNode	By object	Legend

AbsoluteIndex

Count

Cut

Data

Deleting

DropTarget

Expanded

Focused

Handle

HasChildren

ImageIndex

Index

IsVisible

ItemId

Item

Level

OverlayIndex

Owner

Parent

SelectedIndex

Selected

StateIndex

Text

TreeView


TTreeNode::AbsoluteIndex

TTreeNode	Properties	See also

The AbsoluteIndex property is the index of the tree node relative to the first tree node in a tree node.

Syntax

__property System::Integer AbsoluteIndex;

Description

Use the AbsoluteIndex property to determine absolute position of a node in a tree nodes object. The first tree node in a tree nodes object has an index of 0 and subsequent nodes are numbered sequentially. If a node has any children, its AbsoluteIndex is one less than the index of its first child.


TTreeNode::Count

TTreeNode	Properties	See also

The Count property contains the number children a tree node contains.

Syntax

__property System::Integer Count;

Description

Use the Count property to determine how many child nodes belong to a tree node. This information can be useful when iterating through the children of a tree node.


TTreeNode::Cut

TTreeNode	Properties	See also

The Cut property indicates if the tree node object is currently selected as part of a cut and paste operation.

Syntax

__property System::Boolean Cut;

Description

Use Cut to determine if a node is currently involved in a cut and paste operation.


TTreeNode::Data

TTreeNode	Properties	See also

The Data property contains a pointer to some data associated with the tree node.

Syntax

System::Boolean __fastcall CustomSort(Commctrl::TTVCompare SortProc, System::Longint Data);

Description

Use the Data property to assoiciate some data with a tree node such as memo data or a bitmap.


TTreeNode::Deleting

TTreeNode	Properties	See also

The Deleting property indicates whether a node's Destroy method has been called and is in the process of being deleted.

Syntax

__property System::Boolean Deleting;

Description

Use the Deleting property to determine if a node is being deleted.


TTreeNode::DropTarget

TTreeNode	Properties	See also

The DropTarget property indicates whether a tree node has been selected as a drag and drop target.

Syntax

__property System::Boolean DropTarget;

Description

Use DropTarget to determine if a node has been selected as a drag and drop target. When DropTarget is true, the node is drawn in a style used to indicate a drag and drop target.


TTreeNode::Expanded

TTreeNode	Properties	See also

The Expanded property specifies whether the tree node is expanded.

Syntax

__property System::Boolean Expanded;

Description

When a tree node is expanded, the minus button is shown if the ShowButtons property of the tree view is true and child nodes are displayed.

Expanded is true if the node is expanded, false if it isn't expanded.


TTreeNode::Focused

TTreeNode	Properties	See also

The Focused property indicates whether the node has focus, that is, if it's surrounded by a standard focus rectangle. Only one node at a time can have the focus.

Syntax

__property System::Boolean Focused;

Description

Use the Focused property to determine if a particular node in a tree view has the focus.


TTreeNode::Handle

TTreeNode	Properties	See also

The Handle property returns the Handle property of the tree view control that owns the tree node.

Syntax

__property System::Integer Handle;

Description

Use the Handle property to obtain the handle of the tree view that owns the node.


TTreeNode::HasChildren

TTreeNode	Properties	See also

The HasChildren property indicates whether a node has any children.

Syntax

__property System::Boolean HasChildren;

Description

Child nodes appear below and indented from their parent node when the parent is expanded. HasChildren is true if the node has subnodes, or false if the node has no subnodes. If ShowButtons of the tree view is true, and HasChildren is true, a plus (+) button will appear to the left of the node. However, if a node has no children, setting HasChildren to true will show a (+) plus button, but will not add any child nodes and the node cannot be expanded.


TTreeNode::ImageIndex

TTreeNode	Properties	See also

The ImageIndex property specifies which image from the image list is displayed when a node is at its normal state and is not currently selected.

Syntax

__property System::Integer ImageIndex;

Description

Use the ImageIndex property with the the Images property of the tree view to obtain the image for the node at it’s normal state.


TTreeNode::Index

TTreeNode	Properties

The Index property uniquely identifies each node in a tree view.

Syntax

TTreeNode *__fastcall GetItem(System::Integer Index);

Description

The first node has an Index value of 1, and subsequent nodes are indexed sequentially. If a node has subnodes, the Index value of the parent node is one less than the Index value of its first subnode.


TTreeNode::IsVisible

TTreeNode	Properties

Indicates whether the tree node is visible within the TTreeView component.

Syntax

__property System::Boolean IsVisible;

Description


TTreeNode::Item

TTreeNode	Properties

Provides access to a child node (TTreeNode object) by its Index position in the list of child nodes.

Syntax

__property TTreeNode * Item[System::Integer Index];

Description

The first child node has an index of 0, the second an index of 1, and so on.

Example

The following example adds to a list box the text for all the immediate child nodes of the selected node.


TTreeNode::ItemId

TTreeNode	Properties

ItemID is a handle to a TTreeNode of type HTreeItem and uniquely identifies each node in a tree view.

Syntax

__property Commctrl::HTreeItem ItemId;

Description


TTreeNode::Level

TTreeNode	Properties

Indicates the level of indentation of an node within the tree view control.

Syntax

__property System::Integer Level;

Description


TTreeNode::OverlayIndex

TTreeNode	Properties

Determines which image from the image list is to be used as an overlay mask.

Syntax

__property System::Integer OverlayIndex;

Description


TTreeNode::Owner

TTreeNode	Properties

Indicates which tree nodes object owns the tree node.

Syntax

__property TTreeNodes * Owner;

Description


TTreeNode::Parent

TTreeNode	Properties

Identifies the parent node of this node. A parent node is one level higher and contains the child node as a subnode.

Syntax

__property TTreeNode * Parent;

Description


TTreeNode::Selected

TTreeNode	Properties

Determines whether the node is selected.

Syntax

__property System::Boolean Selected;

Description


TTreeNode::SelectedIndex

TTreeNode	Properties

Contains the index in the image list (TImageList) to be used when the node is selected.

Syntax

__property System::Integer SelectedIndex;

Description


TTreeNode::StateIndex

TTreeNode	Properties

Indicates which image from the StateImages image list to display for the node.

Syntax

__property System::Integer StateIndex;

Description


TTreeNode::Text

TTreeNode	Properties

The Text property contains the string that identifies a tree node.

Syntax

__property System::AnsiString Text;

Description


TTreeNode::TreeView

TTreeNode	Properties

Syntax

__property TCustomTreeView * TreeView;

Description


TTreeNode methods

TTreeNode	Alphabetically

In TTreeNode

~TTreeNode

AlphaSort

Assign

Collapse

CustomSort

Delete

DeleteChildren

DisplayRect

EditText

EndEdit

Expand

GetFirstChild

GetHandle

GetLastChild

GetNext

GetNextChild

GetNextSibling

GetNextVisible

GetPrev

GetPrevChild

GetPrevSibling

GetPrevVisible

HasAsParent

IndexOf

MakeVisible

MoveTo

TTreeNode

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeNode methods

TTreeNode	By object

~TTreeNode

AlphaSort

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Collapse

CustomSort

DefaultHandler

DeleteChildren

Delete

Dispatch

DisplayRect

EditText

EndEdit

Expand

FieldAddress

FreeInstance

Free

GetFirstChild

GetHandle

GetLastChild

GetNextChild

GetNextSibling

GetNext

GetNextVisible

GetPrevChild

GetPrevSibling

GetPrev

GetPrevVisible

HasAsParent

IndexOf

InheritsFrom

InitInstance

InstanceSize

MakeVisible

MethodAddress

MethodName

MoveTo

NewInstance

TTreeNode


TTreeNode::AlphaSort

TTreeNode	Methods

Sorts all root nodes and each node alphabetically by label in the tree view control.

Syntax

System::Boolean __fastcall AlphaSort(void);

Description


TTreeNode::Assign

TTreeNode	Methods

Discards any current property information and replaces it with the information from the Source.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description


TTreeNode::Collapse

TTreeNode	Methods

Collapses an node.

Syntax

void __fastcall Collapse(System::Boolean Recurse);

Description


TTreeNode::CustomSort

TTreeNode	Methods

Allows you to sort child nodes based on criteria that you define.

Syntax

System::Boolean __fastcall CustomSort(Commctrl::TTVCompare SortProc, System::Longint Data);

Description

When you use this method, you specify an application-defined callback function that the tree view and tree node can call whenever the relative order of two child nodes needs to be decided. The parameter SortProc is a pointer to the application defined callback function. The Data parameter is optional for passing a data value into the function.

The tree node's CustomSort will sort all child nodes of the node that called it. The tree view's CustomSort method will sort all nodes in the tree view.

The callback function receives two nodes for the nodes being compared and a third 32-bit value that you specify.

The callback function has the following form:

The callback function must return a negative value if the first node should precede the second, a positive value if the first node should follow the second, or zero if the two nodes are equivalent. The Node1 and Node2 parameters are the two nodes being compared.

If the parameter SortProc is NULL, the default AlphaSort method is called. This can be useful since CustomSort has the Data parameter which AlphaSort doesn't.

Example


TTreeNode::Delete

TTreeNode	Methods

Deletes the node (TTreeNode object) that calls it.

Syntax

void __fastcall Delete(void);

Description


TTreeNode::DeleteChildren

TTreeNode	Methods

Deletes all children of the node (TTreeNode object) that calls it.

Syntax

void __fastcall DeleteChildren(void);

Description


TTreeNode::DisplayRect

TTreeNode	Methods

Returns the bounding rectangle (TRect record) for a tree node.

Syntax

Windows::TRect __fastcall DisplayRect(System::Boolean TextOnly);

Description

If the TextOnly parameter is true, the bounding rectangle includes only the text of the node. Otherwise, it includes the entire line that the node occupies in the tree-view control.


TTreeNode::EditText

TTreeNode	Methods

Begins in-place editing of the specified node's text, replacing the text of the node with a single-line edit control containing the text.

Syntax

System::Boolean __fastcall EditText(void);

Description


TTreeNode::EndEdit

TTreeNode	Methods

Ends the editing of an node's (TTreeNode object) label in a tree view.

Syntax

void __fastcall EndEdit(System::Boolean Cancel);

Description


TTreeNode::Expand

TTreeNode	Methods

Expands an node's list of child nodes.

Syntax

void __fastcall ExpandItem(System::Boolean Expand, System::Boolean Recurse);

Description


TTreeNode::GetFirstChild

TTreeNode	Methods

Returns the first child node (TTreeNode object) of the calling node.

Syntax

TTreeNode *__fastcall GetFirstChild(void);

Description


TTreeNode::GetHandle

TTreeNode	Methods

This shouldn’t be doc’ed here because it should be a protected method that just is called for the Handle property above.

Syntax

System::Integer __fastcall GetHandle(void);

Description


TTreeNode::GetLastChild

TTreeNode	Methods

Returns the last immediate child node (TTreeNode object) of the calling node.

Syntax

TTreeNode *__fastcall GetLastChild(void);

Description


TTreeNode::GetNext

TTreeNode	Methods

Returns the next node (TTreeNode object) after the calling node in the tree view.

Syntax

TTreeNode *__fastcall GetNext(void);

Description


TTreeNode::GetNextChild

TTreeNode	Methods

Returns the next child node (TTreeNode object) after Value of the calling node.

Syntax

TTreeNode *__fastcall GetNextChild(TTreeNode *Value);

Description


TTreeNode::GetNextSibling

TTreeNode	Methods

Returns the next node (TTreeNode object) in the tree view at the same level as the calling node.

Syntax

TTreeNode *__fastcall GetNextSibling(void);

Description


TTreeNode::GetNextVisible

TTreeNode	Methods

Returns the next visible node(TTreeNode object) in the tree view after the calling node.

Syntax

TTreeNode *__fastcall GetNextVisible(void);

Description


TTreeNode::GetPrev

TTreeNode	Methods

Returns the previous node (TTreeNode object) in the tree view before the calling node.

Syntax

TTreeNode *__fastcall GetPrev(void);

Description


TTreeNode::GetPrevChild

TTreeNode	Methods

Returns the previous child node before the child node specified by the parameter Value of the calling node.

Syntax

TTreeNode *__fastcall GetPrevChild(TTreeNode *Value);

Description


TTreeNode::GetPrevSibling

TTreeNode	Methods

Returns the previous node (TTreeNode object) before the calling node and at the same level.

Syntax

TTreeNode *__fastcall GetPrevSibling(void);

Description


TTreeNode::GetPrevVisible

TTreeNode	Methods

Returns the previous visible node (TTreeNode object) before the calling node.

Syntax

TTreeNode *__fastcall GetPrevVisible(void);

Description


TTreeNode::HasAsParent

TTreeNode	Methods

Returns true if Value is a parent node (TTreeNode object) of the calling node.

Syntax

System::Boolean __fastcall HasAsParent(TTreeNode *Value);

Description


TTreeNode::IndexOf

TTreeNode	Methods

Returns the position of an immediate child node (Value parameter) of the calling node.

Syntax

System::Integer __fastcall IndexOf(TTreeNode *Value);

Description


TTreeNode::MakeVisible

TTreeNode	Methods

Makes an node visible in a tree view.

Syntax

void __fastcall MakeVisible(void);

Description


TTreeNode::MoveTo

TTreeNode	Methods

Moves the node to another location on the tree view.

Syntax

void __fastcall MoveTo(TTreeNode *Destination, TNodeAttachMode Mode);

Description

The Destination parameter determines where to move the node. The Mode parameter is of type TNodeAttachMode and specifies how the node is to be reattached. These are the possible values for the Mode parameter:

Table Part 0.1

Value	Meaning

naAdd	Adds the node to the end of the list.

naAddFirst	Adds the node at the beginning of the list.

naAddChild	Adds the node as a child of the destination at the end of the child list.

naAddChildFirst	Adds the node as a child at the beginning of the child list of the destination.

naInsert	Insert the node after the destination node.


TTreeNode::TTreeNode

TTreeNode	Methods	See also

TTreeNode creates a new TTreeNode object.

Syntax

__fastcall TTreeNode(TTreeNodes *AOwner);

Description

Use TTreeNode to create a new TTreeNode object.


TTreeNode::~TTreeNode

TTreeNode	Methods	See also

~TTreeNode frees the memory associated with the TTreeNode object.

Syntax

__fastcall virtual ~TTreeNode(void);

Description

Do not call ~TTreeNode directly. Instead, use the delete keyword on the object, which causes ~TTreeNode to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TTreeNode example

TTreeNode


TTreeNodes

Hierarchy	Properties	Methods

The TTreeNodes object maintains a list of items (TTreeNode objects). The Items property of the tree view control (TTreeView component) which is of type TTreeNodes maintains the items in the tree view.

Header

vcl/comctrls.hpp

The TTreeNodes object has methods to add items and child items to a tree view, such as Add, AddFirst, AddChild, AddChildFirst. Add will add the item to the end of a list, AddFirst will add the item at the beginning of the items list. AddChild adds an item at the end of the items child list, AddChildFirst will add the item to the beginning of the items child list. There are also methods to add items containing data, such as AddObject, AddObjectFirst, AddChildObject and AddChildObjectFirst. AddObject adds an item containing data to the end of the items list in the tree view, AddObjectFirst adds to the beginning of the list. AddChildObject adds an item containing data at the end of the items child list, AddChildObjectFirst adds to the beginning of the child list.

Clear removes all items from the tree view. Delete removes one item from the tree view. Insert inserts an item into the tree view, InsertObject inserts an item containing data. The BeginUpdate method prevents the display of the tree view until the EndUpdate method is called.

GetFirstNode returns the first item in the tree view. GetNode returns the item given the ItemId. Item[Index] returns the item at the given Index in the tree node. The first item has an index of 0, and subsequent items are numbered sequentially.

The Owner property specifies the tree view that owns the TTreeNodes object. Count returns the number of items in the TTreeNodes object.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects.


TTreeNodes properties

TTreeNodes	Alphabetically	Legend

In TTreeNodes

C3ount

Handle

Item

Owner


TTreeNodes properties

TTreeNodes	By object	Legend

C3ount

Handle

Item

Owner


Count

Contains the number of items in the treeview that owns the tree nodes object.

Description


TTreeNodes::Handle

TTreeNodes	Properties

Returns the Handle property of the tree view control that owns the tree nodes object.

Syntax

__property System::Integer Handle;

Description


TTreeNodes::Item

TTreeNodes	Properties

Provides access to an item (TTreeNode object) by its Index position in the tree view. The first item has an index of 0, the second an index of 1, and so on.

Syntax

Commctrl::TTVItemA &Item, TAddMode AddMode);

Description


TTreeNodes::Owner

TTreeNodes	Properties

Indicates which tree nodes object owns the tree node.

Syntax

__property TCustomTreeView * Owner;

Description


TTreeNodes methods

TTreeNodes	Alphabetically

In TTreeNodes

~TTreeNodes

Add

AddChild

AddChildFirst

AddChildObject

AddChildObjectFirst

AddFirst

AddObject

AddObjectFirst

Assign

BeginUpdate

Clear

Delete

EndUpdate

GetFirstNode

GetNode

Insert

InsertObject

TTreeNodes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeNodes methods

TTreeNodes	By object

~TTreeNodes

AddChildFirst

AddChildObjectFirst

AddChildObject

AddChild

AddFirst

AddObjectFirst

AddObject

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

GetFirstNode

GetNode

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

TTreeNodes


TTreeNodes::Add

TTreeNodes	Methods

Adds a new item (TTreeNode object) to a tree view.

Syntax

TTreeNode *__fastcall Add(TTreeNode *Node, const System::AnsiString S);

Description

The item is added last in the list to which the item specified by the Node parameter belongs. The S parameter specifies the Text property of the new node. Add returns the item that has been added.


TTreeNodes::AddChild

TTreeNodes	Methods

Adds a new item (TTreeNode object) to a tree view.

Syntax

TTreeNode *__fastcall AddChild(TTreeNode *Node, const System::AnsiString S);

Description

The item is added as a child of the item specified by the Node parameter. It is added to the end of Node's list of child items. The S parameter specifies the Text property of the new item. AddChild returns the item that has been added.

Example

The following example adds a child to the selected item's list of child items in the tree view control.


TTreeNodes::AddChildFirst

TTreeNodes	Methods

Adds a new item (TTreeNode object) to a tree view.

Syntax

TTreeNode *__fastcall AddChildFirst(TTreeNode *Node, const System::AnsiString S);

Description

The item is added as a child of the item specified by the Node parameter. It is added to the beginning of Node's list of child items. The S parameter specifies the Text property of the new item. Items that appear after the added item are moved down one row and reindexed with valid Index values. AddChildFirst returns the item that has been added.


TTreeNodes::AddChildObject

TTreeNodes	Methods

Adds a new item (TTreeNode object) containing data to a tree view.

Syntax

TTreeNode *__fastcall AddChildObject(TTreeNode *Node, const System::AnsiString S, System::Pointer Ptr

Description

The item is added as a child of the item specified by the Node parameter. It is added to the end of Node's list of child items. The S parameter specifies the Text property of the new item. The Ptr parameter specifies the Data property value of the new item. AddChildObject returns the item that has been added.


TTreeNodes::AddChildObjectFirst

TTreeNodes	Methods

Adds a new item (TTreeNode object) containing data to a tree view.

Syntax

TTreeNode *__fastcall AddChildObjectFirst(TTreeNode *Node, const System::AnsiString S, System::Pointer

Description

The item is added as a child of the item specified by the Node parameter. It is added to the beginning of Node's list of child items. Items that appear after the added item are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new item. The Ptr parameter specifies the Data property value of the new item. AddChildObjectFirst returns the item that has been added.


TTreeNodes::AddFirst

TTreeNodes	Methods

Adds a new item (TTreeNode object) to a tree view.

Syntax

TTreeNode *__fastcall AddFirst(TTreeNode *Node, const System::AnsiString S);

Description

The item is added first to the list to which the item specified by the Node parameter belongs. Items that appear after the added item are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. AddFirst returns the item that has been added.


TTreeNodes::AddObject

TTreeNodes	Methods

Adds a new item (TTreeNode object) containing data to a tree view.

Syntax

TTreeNode *__fastcall AddObject(TTreeNode *Node, const System::AnsiString S, System::Pointer Ptr);

Description

The item is added last in the list to which the item specified by the Node parameter belongs. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new item. AddObject returns the item that has been added. The memory referenced by Ptr is not freed when the tree nodes object is freed.


TTreeNodes::AddObjectFirst

TTreeNodes	Methods

Adds a new item (TTreeNode object) containing data to a tree view.

Syntax

TTreeNode *__fastcall AddObjectFirst(TTreeNode *Node, const System::AnsiString S, System::Pointer Ptr

Description

The item is added first to the list to which the item specified by the Node parameter belongs. Items that appear after the added item are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new item. AddObjectFirst returns the item that has been added.


TTreeNodes::Assign

TTreeNodes	Methods

If Source is another TTreeNodes object, Assign discards any current property information and replaces it with the information from the Source. If Source is any other type of object, Assign calls its inherited method. Use this method to copy information from one tree nodes object to another.

Syntax

virtual void __fastcall Assign(Classes::TPersistent *Source);

Description


TTreeNodes::BeginUpdate

TTreeNodes	Methods

*** Where’s the into sentence? ***

Syntax

void __fastcall BeginUpdate(void);

Description

The BeginUpdate method prevents the updating of the tree view object until the EndUpdate method is called. BeginUpdate prevents the screen from being repainted when new items are added, deleted, or inserted. Tree node items affected by the changes will have invalid Index values until EndUpdate is called.

Use BeginUpdate to prevent screen repaints and to speed processing time while you are rebuilding the tree view.


TTreeNodes::Clear

TTreeNodes	Methods

The Clear method deletes all tree nodes contained in the tree nodes object.

Syntax

void __fastcall Clear(void);

Description


TTreeNodes::EndUpdate

TTreeNodes	Methods

The EndUpdate method re-enables screen repainting and tree view item reindexing that was turned off with the BeginUpdate method.

Syntax

void __fastcall EndUpdate(void);

Description


TTreeNodes::GetFirstNode

TTreeNodes	Methods

Returns the first item (TTreeNode object) in the tree view.

Syntax

TTreeNode *__fastcall GetFirstNode(void);

Description


TTreeNodes::GetNode

TTreeNodes	Methods

Returns the item (TTreeNode object) given the ItemId of the tree node.

Syntax

TTreeNode *__fastcall GetNode(Commctrl::HTreeItem ItemId);

Description

ItemId is a handle to the item in the tree view.


TTreeNodes::Insert

TTreeNodes	Methods

Inserts an item(TTreeNode) into the tree view after the item specified by the Node parameter.

Syntax

TTreeNode *__fastcall Insert(TTreeNode *Node, const System::AnsiString S);

Description

The S parameter specifies the Text property of the new item. Insert returns the new item.


TTreeNodes::InsertObject

TTreeNodes	Methods

Inserts an item (TTreeNode) containing data into the tree view after the item specified by the Node parameter.

Syntax

TTreeNode *__fastcall InsertObject(TTreeNode *Node, const System::AnsiString S, System::Pointer Ptr

Description

The S parameter specifies the Text property of the new item. Insert returns the new item. The Ptr parameter specifies the Data property of the new item.


TTreeNodes::TTreeNodes

TTreeNodes	Methods	See also

TTreeNodes creates a new TTreeNodes object.

Syntax

__fastcall TTreeNodes(TCustomTreeView *AOwner);

Description

Use TTreeNodes to create a new TTreeNodes object.


TTreeNodes::~TTreeNodes

TTreeNodes	Methods	See also

~TTreeNodes frees the memory associated with the TTreeNodes object.

Syntax

__fastcall virtual ~TTreeNodes(void);

Description

Do not call ~TTreeNodes directly. Instead, use the delete keyword on the object, which causes ~TTreeNodes to be invoked automatically.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TTreeNodes example

TTreeNodes


TTreeView

Hierarchy	Properties	Methods	Events

TreeView components are indirect descendents of TWinControl. They are windows that display a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk. Each item consists of a label and a number of optional bitmapped images, and each item can have a list of subitems associated with it. By clicking on an item, the user can expand and collapse the associated list of subitems. This control can be seen as the left pane of the Database Explorer.

Header

vcl/comctrls.hpp

The Items property refers to a TTreeNodes object, a container class for TTreeNode objects, and contains the individual items that appear in the tree view control. Individual nodes are TTreeNode objects. Items can be added and inserted by using TTreeNodes methods AddChildFirst, AddChild, AddChildObjectFirst, AddChildObject, AddFirst, Add, AddObjectFirst, AddObject, Insert.and InsertObject.

The ShowLines property, when true, will draw lines to link child items to their corresponding parent item. The user can expand or collapse a parent item's list of child items by double-clicking the parent item. The ShowButtons property determines whether a button appears to the left side of each parent item. The user can click the button to expand or collapse the child items as an alternative to double-clicking the parent item. To show buttons at the root of the hierachy, set the ShowRoot property to true.

When a list of child items is expanded, it is indented relative to the parent item. You can set the amount of indentation with the Indent property. To keep each parent item's list of child items in alphabetical order set the SortType property to stText. To allow direct editing of the item labels, set the ReadOnly property to false.


TTreeView properties

TTreeView	Alphabetically	Legend

In TTreeView

ReadOnly

Derived from TCustomTreeView

BorderStyle

DragMode

DropTarget

HideSelection

Images

Indent

Items

Selected

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

TopItem

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTreeView properties

TTreeView	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DropTarget

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

Images

Indent

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

Selected

ShowButtons

ShowHint

Showing

ShowLines

ShowRoot

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

Visible

Width


TTreeView::ReadOnly

TTreeView	Properties

Determines if the user can change the contents of the control.

Syntax

__property ReadOnly;

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.


TTreeView events

TTreeView	Alphabetically	Legend

Derived from TCustomTreeView

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTreeView events

TTreeView	By object	Legend

OnChange

OnChanging

OnClick

OnCollapsed

OnCollapsing

OnCompare

OnDblClick

OnDeletion

OnDragDrop

OnDragOver

OnEdited

OnEditing

OnEndDrag

OnEnter

OnExit

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnChange


OnChanging


OnClick


OnCollapsed


OnCollapsing


OnCompare


OnDblClick


OnDeletion


OnDragDrop


OnDragOver


OnEdited


OnEditing


OnEndDrag


OnEnter


OnExit


OnExpanded


OnExpanding


OnGetImageIndex


OnGetSelectedIndex


OnKeyDown


OnKeyPress


OnKeyUp


OnMouseDown


OnMouseMove


OnMouseUp


OnStartDrag


TTreeView methods

TTreeView	Alphabetically

In TTreeView

~TTreeView

TTreeView

Derived from TCustomTreeView

AlphaSort

CustomSort

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

IsEditing

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeView methods

TTreeView	By object

~TTreeView

AlphaSort

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CustomSort

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTreeView

UpdateControlState

Update


TTreeView::TTreeView

TTreeView	Methods	See also

TTreeView creates a new TTreeView object.

Syntax

__fastcall virtual TTreeView(Classes::TComponent *AOwner);

Description

Use TTreeView to create a new TTreeView object.


TTreeView::~TTreeView

TTreeView	Methods	See also

~TTreeView frees the memory associated with the TTreeView object.

Syntax

__fastcall virtual ~TTreeView(void);

Description

Do not call ~TTreeView directly. Instead, use the delete keyword on the object, which causes ~TTreeView to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTreeView


TTreeView example

TTreeView


TUpdateSQL

Hierarchy	Properties	Methods

The TUpdateSQL component provides a way to use Delphi’s cached updates support with read-only datasets. For example, you could use a TUpdateSQL component with a “canned” query to provide a way of updating the underlying datasets, essentially giving you the ability to post updates to a read-only dataset. You associate a TUpdateSQL component with a dataset by setting the dataset’s UpdateObject property. The dataset automatically uses the TUpdateSQL component when cached updates are applied.

Header

vcl/dbtables.hpp

The ModifySQL property is an SQL statement that is executed when the cached update is a modification of an existing record. The InsertSQL property is an SQL statement that is executed when the cached update is the insertion of a new record. DeleteSQL is an SQL statement that is executed when the cached update is the deletion of a record. All three properties support an extension to normal parameter binding for cached updates: You can prefix any field name with ‘OLD_’ to retrieve the value of the field as it was before cached updates were enabled. This extension lets you access the old field values, generally for use in creating the WHERE clause of the SQL statement.

The Apply method is useful for manually executing the SQL statements (such as from an OnUpdateRecord event handler). It combines a call to SetParams to perform the special parameter binding discussed in the previous paragraph and a call to ExecSQL to execute the SQL statement.

The Query array property returns a TQuery object for the SQL statement corresponding to the TUpdateKind index. Likewise, the SQL array property returns the string list representing the SQL statement corresponding to the index. Note that SQL returns the same string lists used in the ModifySQL, InsertSQL, and DeleteSQL properties. For example, SQL[ukInsert] is the same as InsertSQL.

In addition to these properties and methods, this component also has the properties and methods that apply to all components.


TUpdateSQL properties

TUpdateSQL	Alphabetically	Legend

In TUpdateSQL

DataSet

DeleteSQL

InsertSQL

ModifySQL

Query

SQL

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TUpdateSQL properties

TUpdateSQL	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DeleteSQL

DesignInfo

InsertSQL

ModifySQL

Name

Owner

Query

SQL

Tag


TUpdateSQL::DataSet

TUpdateSQL	Properties

Identifies the dataset to which a TUpdateSQL component belongs.

Syntax

__property DataSet;

Only assign a value to this property if you are programmatically creating a TUpdateSQL component.


TUpdateSQL::DeleteSQL

TUpdateSQL	Properties

Returns the string list containing the SQL statement to be used when applying the cached deletion of a record.

Syntax

__property Classes::TStrings * DeleteSQL;

Generally, such an SQL statement would be an DELETE FROM statement. You can use the UpdateSQL Editor (by double-clicking the TUpdateSQL component) to generate an appropriate SQL statement, such as the following:


TUpdateSQL::InsertSQL

TUpdateSQL	Properties

Returns the string list containing the SQL statement to be used when applying the cached insertion of a record.

Syntax

__property Classes::TStrings * InsertSQL;

Generally, such an SQL statement would be an INSERT INTO statement. You can use the UpdateSQL Editor (by double-clicking the TUpdateSQL component) to generate an appropriate SQL statement, such as the following:


TUpdateSQL::ModifySQL

TUpdateSQL	Properties

Returns the string list containing the SQL statement to be used when applying the cached modification of a record.

Syntax

__property Classes::TStrings * ModifySQL;

Generally, such an SQL statement would be an UPDATE statement. You can use the UpdateSQL Editor (by double-clicking the TUpdateSQL component) to generate an appropriate SQL statement, such as the following:


TUpdateSQL::Query

TUpdateSQL	Properties

Returns a TQuery component for the SQL statement corresponding to the UpdateKind index.

Syntax

__property TQuery * Query[Db::TUpdateKind UpdateKind];

For example, Query[ukModify] has the ModifySQL SQL statement.


TUpdateSQL::SQL

TUpdateSQL	Properties

Returns the string list containing the SQL statement corresponding to the UpdateKind index.

Syntax

__property Classes::TStrings * SQL[Db::TUpdateKind UpdateKind];

For example, SQL[ukModify] is the same as ModifySQL.


TUpdateSQL methods

TUpdateSQL	Alphabetically

In TUpdateSQL

~TUpdateSQL

Apply

ExecSQL

SetParams

TUpdateSQL

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUpdateSQL methods

TUpdateSQL	By object

~TUpdateSQL

Apply

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecSQL

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SetParams

TUpdateSQL


TUpdateSQL::Apply

TUpdateSQL	Methods

Replaces parameters in and executes the SQL statement associated with the UpdateKind parameter (for example, calling Apply and passing ukModify would use the SQL statement held in the ModifySQL property).

Syntax

virtual void __fastcall Apply(Db::TUpdateKind UpdateKind);

Apply combines calls to SetParams and ExecSQL into one.


TUpdateSQL::ExecSQL

TUpdateSQL	Methods

Executes the SQL statement associated with the UpdateKind parameter (for example, calling ExecSQL and passing ukModify would execute the SQL statement held in the ModifySQL property).

Syntax

void __fastcall ExecSQL(Db::TUpdateKind UpdateKind);

Note that ExecSQL does not perform parameter binding; you can do so by calling SetParams before calling ExecSQL, or by calling Apply, which calls SetParams then ExecSQL.


TUpdateSQL::SetParams

TUpdateSQL	Methods

Replaces parameters (indicated by leading colons) in the SQL statement associated with the UpdateKind parameter with the value of the field with the same name as the parameter.

Syntax

void __fastcall SetParams(Db::TUpdateKind UpdateKind);

For example, a parameter named :Sequence would be replaced by the value of the field named Sequence. If the parameter name has OLD_ in front, it is replaced the "old" value of the corresponding field, before any updates were made. For example, :OLD_Name would be replaced by the previous value of the Name field.

SetParams is called automatically when you use the Apply method.


TUpdateSQL::TUpdateSQL

TUpdateSQL	Methods	See also

TUpdateSQL creates a new TUpdateSQL object.

Syntax

__fastcall virtual TUpdateSQL(Classes::TComponent *AOwner);

Description

Use TUpdateSQL to create a new TUpdateSQL object.


TUpdateSQL::~TUpdateSQL

TUpdateSQL	Methods	See also

~TUpdateSQL frees the memory associated with the TUpdateSQL object.

Syntax

__fastcall virtual ~TUpdateSQL(void);

Description

Do not call ~TUpdateSQL directly. Instead, use the delete keyword on the object, which causes ~TUpdateSQL to be invoked automatically.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSetUpdateObject


TUpdateSQL example

TUpdateSQL


TUpDown

Hierarchy	Properties	Methods	Events

The TUpDown component consists of a pair of Up and Down arrow buttons. Clicking on these buttons increments and decrements a numeric value held in the Position property. TUpDown is typically used with a companion control, called a buddy window. Use the Associate property to specify the buddy window.

Header

vcl/comctrls.hpp

When associated with an edit control, the value of Position sets the text of the edit as a formatted string.  This combination is similar to using a TSpinButton or spinner control and is convenient for prompting numeric user input. If Associate is not specified, Position can be used as an assigned numeric value.


TUpDown properties

TUpDown	Alphabetically	Legend

Derived from TCustomUpDown

AlignButton

ArrowKeys

Associate

Increment

Max

Min

Orientation

Position

Thousands

Wrap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TUpDown properties

TUpDown	By object	Legend

AlignButton

Align

ArrowKeys

Associate

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Increment

Left

Max

Min

Name

Orientation

Owner

ParentShowHint

Parent

PopupMenu

Position

ShowHint

Showing

TabOrder

TabStop

Tag

Thousands

Top

Visible

Width

Wrap


TUpDown events

TUpDown	Alphabetically	Legend

Derived from TCustomUpDown

OnChanging

OnClick

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnMouseDown

OnMouseMove

OnMouseUp


TUpDown events

TUpDown	By object	Legend

OnChanging

OnClick

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


OnChanging


OnClick


OnEnter


OnExit


OnMouseDown


OnMouseMove


OnMouseUp


TUpDown methods

TUpDown	Alphabetically

In TUpDown

~TUpDown

TUpDown

Derived from TCustomUpDown

Broadcast

Derived from TWinControl

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUpDown methods

TUpDown	By object

~TUpDown

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TUpDown

UpdateControlState

Update


TUpDown::TUpDown

TUpDown	Methods	See also

TUpDown creates a new TUpDown object.

Syntax

__fastcall virtual TUpDown(Classes::TComponent *AOwner);

Description

Use TUpDown to create a new TUpDown object.


TUpDown::~TUpDown

TUpDown	Methods	See also

~TUpDown frees the memory associated with the TUpDown object.

Syntax

__fastcall virtual ~TUpDown(void);

Description

Do not call ~TUpDown directly. Instead, use the delete keyword on the object, which causes ~TUpDown to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomUpDown


TUpDown example

TUpDown


TVarBytesField

Hierarchy	Properties	Methods	Events	See also

A TVarBytesField object represents a variable-length untyped binary field in a dataset.

Header

vcl/dbtables.hpp

Description

A variable bytes field value is a set of bytes of variable size, with the actual length of the value stored in the first two bytes.

TVarBytesField differs from its immediate ancestor TBinaryField only in its Create method, where it sets the data type to ftVarBytes. As a descendent of TBinaryField, it inherits many properties, events and methods useful to managing unformatted binary data fields in a dataset.


TVarBytesField properties

TVarBytesField	Alphabetically	Legend

Derived from TBinaryField

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TVarBytesField properties

TVarBytesField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TVarBytesField events

TVarBytesField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TVarBytesField events

TVarBytesField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TVarBytesField methods

TVarBytesField	Alphabetically

In TVarBytesField

~TVarBytesField

TVarBytesField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TVarBytesField methods

TVarBytesField	By object

~TVarBytesField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TVarBytesField


TVarBytesField::TVarBytesField

TVarBytesField	Methods	See also

TVarBytesField creates a new TVarBytesField object.

Syntax

__fastcall virtual TVarBytesField(Classes::TComponent *AOwner);

Description

Use TVarBytesField to create a new TVarBytesField object.


TVarBytesField::~TVarBytesField

TVarBytesField	Methods	See also

~TVarBytesField frees the memory associated with the TVarBytesField object.

Syntax

__fastcall virtual ~TVarBytesField(void);

Description

Do not call ~TVarBytesField directly. Instead, use the delete keyword on the object, which causes ~TVarBytesField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBinaryField

TBytesField


TVarBytesField example

TVarBytesField


TWinControl

Hierarchy	Properties	Methods	Events	See also

The TWinControl component is the component type for windowed controls. Windowed controls are controls that

Header

vcl/controls.hpp

•	Can receive focus while the application is running

Other controls may display data, but the user can use the keyboard to interact with a control only if the control is a windowed control.

•	Can contain other controls

A control that contains other controls is a parent. Only a windowed control can be a parent of one or more other child controls.

•	Have a window handle

Description

In addition to everything inherited from TControl, TWinControl provides many properties, methods, and events that are unique to windowed controls. There are also several protected properties and methods that are available to component writers.

Newly created components are seldom derived directly from TWinControl. Base most new controls on TCustomControl, which provides a canvas and handles paint messages, or on any of several more specialized controls, such as TButtonControl, TCustomComboBox, TCustomEdit, or TCustomListBox.


TWinControl properties

TWinControl	Alphabetically	Legend

In TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DefWndProc

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

WindowHandle

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Hint

Left

Name

Parent

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TWinControl properties

TWinControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefWndProc

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Hint

Left

Name

Owner

ParentCtl3D

Parent

Showing

TabOrder

TabStop

Tag

Top

Visible

Width

WindowHandle


TWinControl::Brush

TWinControl	Properties	See also

The Brush property determines what color and pattern is used for painting the background of the control.

Syntax

__property Graphics::TBrush * Brush;

Description

Read the Brush property to determine the style and color of the control’s background. Brush is a read-only property, because a windowed control owns a single Brush object to handle the painting of its background. The attributes of the brush can be changed, however, by using the Color and Style properties of the TBrush object. Further, all of the attributes of the brush can be changed to match those of another brush, by using the Assign method of the TBrush object.


TWinControl::ClientOrigin

TWinControl	Properties	See also

The ClientOrigin property determines the screen coordinates (in pixels) of the top left corner of a windowed control.

Syntax

Description

Read ClientOrigin to discover where the top-left corner of the control is on the screen. ClientOrigin returns X and Y coordinates in a record of type TPoint. The TPoint type defines a pixel location onscreen, with the origin in the top left corner of the control. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.


TWinControl::ClientRect

TWinControl	Properties	See also

The ClientRect property specifies the size (in pixels) of a windowed control’s client area.

Syntax

Description

Read ClientRect to learn the size of the client area of a windowed control. ClientRect returns a rectangle defining the client area of the control. It is equivalent to Rect(0, 0, ClientWidth, ClientHeight).


TWinControl::ControlCount

TWinControl	Properties	See also

The ControlCount property indicates the number of controls that are children of the windowed control.

Syntax

__property System::Integer ControlCount;

Description

Use ControlCount when iterating over all the children of this control. The children of the control are listed in the Controls property array.

ControlCount is a read-only property.

Note

The value of ControlCount is always 1 greater than the highest Controls index, because the first Controls index is 0.


TWinControl::Controls

TWinControl	Properties	See also

The Controls property is an array of all controls that are children of the windowed control.

Syntax

__property TControl * Controls[System::Integer Index];

Description

Controls is an array of all the child controls of the windowed control. All of the child controls of the windowed control list the windowed control as their Parent property. The Controls property is convenient for referring to the children of a control by number rather than name. For example, Controls may be used to iterate over all the children of the windowed control.

Don't confuse the Controls property with the Components property. The Controls property lists all the controls that are child windows of the control, while the Components property lists all components that are owned by the component. All components put on a form are owned by the form, and therefore, they appear in the form's Components property list, even when they are child windows of a control on the form.

Controls is a read-only property. To add or delete a child control, use the InsertControl or RemoveControl methods. To move a child control from one parent to another, set the Parent of the child control, as that will handle both the RemoveControl from the original parent and the InsertControl to the new parent.


TWinControl::Ctl3D

TWinControl	Properties	See also

The Ctl3D property determines whether a control has a three-dimensional (3-D) or two-dimensional look.

Syntax

__property System::Boolean Ctl3D;

Description

Use Ctl3D when to control the appearance of the control. If Ctl3D is true, the control has a 3-D appearance. If Ctl3D is false, the control appears flat. The default value of Ctl3D is true.

If a control's ParentCtl3D property is true, then changes in the Ctl3D property of the control's parent automatically changes the Ctl3D property of the control. When assigning a value directly to a control's Ctl3D property, the control's ParentCtl3D property is automatically set to false.

Note

For Ctl3D to work with radio buttons, check boxes, and any of the common dialog boxes on Windows NT 3.51, CTL3D32.DLL must be installed in the System32 directory. Neither Windows 95 nor NT 4.0 require CTL3D32.DLL.


TWinControl::DefWndProc

TWinControl	Properties	See also

The DefWndProc property specifies the default window procedure for the windowed control.

Syntax

__property System::Pointer DefWndProc;

Description

Calling DefWndProc to handle a message is equivalent to asking for the standard Windows handling of that message. DefWndProc fills the role for windowed controls that DefaultHandler fills for all Borland C++ Builder objects.

DefWndProc initially points to the default procedure defined in the window-creation parameters defined in the CreateParams method. Windowed controls call the default window procedure to handle all messages in their DefaultHandler method, as long as the windowed control has a valid window handle.


TWinControl::Handle

TWinControl	Properties	See also

The Handle property provides access to the window handle of the control.

Syntax

__property System::Integer Handle;

Description

Use the Handle in Windows API function calls that requires a window handle.

If a window handle for the control doesn’t exist, the Handle property creates one by calling the HandleNeeded method when your application reads the Handle property value. Therefore , do not use the Handle property during component creation or streaming.

Handle is a read-only property.


TWinControl::HelpContext

TWinControl	Properties	See also

The HelpContext provides a context number for use in calling context-sensitive online Help.

Syntax

__property Classes::THelpContext HelpContext;

Description

Assign a value to HelpContext to determine which help screen appears when the user presses F1 to request help.

Each screen in the Help system should have a unique context number. When a control is selected in the application, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.

If HelpContext is zero, then the control inherits the help context of its parent control. For example, if a button with a HelpContext of zero is contained in a form with a non-zero help context and F1 is pressed, the context screen for the form will be shown.


TWinControl::ParentCtl3D

TWinControl	Properties	See also

The ParentCtl3D property determines where a component looks to determine if it should appear three dimensional.

Syntax

__property System::Boolean ParentCtl3D;

Description

Use ParentCtl3D to ensure that all the components on a form have a uniform appearance. For example, to make all components on a form appear three dimensional, set the form's Ctl3D property to true and each control's ParentCtl3D property to true. Not only will all components have a three-dimensional appearance, but to change to a uniform two-dimensional appearance, you only have to change the Ctl3D property of the form and all the components will become two dimensional.

If ParentCtl3D is true, the component uses the value of its parent component's Ctl3D property. If ParentCtl3D is false, the control uses the value of its own Ctl3D property. The default value is true.

To specify either a 2D or 3D appearance for a particular component, set Ctl3D to true (for 3D) or false (for 2D). When setting the Ctl3D proprty of a control, ParentCtl3D automatically gets set to false.


TWinControl::Showing

TWinControl	Properties	See also

The Showing property specifies whether the control is currently showing on the screen.

Syntax

__property System::Boolean Showing;

Description

Use the Showing property to determine if the user can see the control on the screen, assuming that another control is not obstructing it from view.

If the Visible properties of a component and all the parents in its parent hierarchy are true, Showing is true. If one of the parents containing the component has a Visible property value of false, Showing is false.

Showing is a read-only property.


TWinControl::TabOrder

TWinControl	Properties	See also

The TabOrder property indicates the position of the control in its parent's tab order.

Syntax

__property TTabOrder TabOrder;

Description

Tab order is the order in which child windows are visited when the user presses the Tab key. The control with the TabOrder value of 0 is the control that has the focus when the form first appears.

Initially, the tab order is always the order in which the controls were added to the form. The first control added to the form has a TabOrder value of 0, the second is 1, the third is 2, and so on. Change this by changing the TabOrder property. A control with a TabOrder of -1 is outside the tab order, and cannot be reached by pressing the Tab key.

Each control has a unique tab-order value within its parent. If you change the TabOrder property value of one control to be the same as the value of a second control, the TabOrder value for all the other controls changes. For example, suppose a control is sixth in the tab order. If you change the control's TabOrder property value to 3 (making the control fourth in the tab order), the control that was originally fourth in the tab order now becomes fifth, and the control that was fifth becomes sixth.

Assigning TabOrder a value greater than the number of controls contained the parent control moves the control to the end of the tab order. The control does not take on the assigned value of TabOrder, but instead is given the number that assures the control is the last in the tab order.

Note

TabOrder is meaningful only if the TabStop property is true and if the control has a parent. The TabOrder property of a form is not used unless the form assigns another form to be its parent.


TWinControl::TabStop

TWinControl	Properties	See also

The TabStop property determines if the user can tab to a control.

Syntax

__property System::Boolean TabStop;

Description

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is true, the control is in the tab order. If TabStop is false, the control is not in the tab order and the user can't press the Tab key to move to the control.

Note

TabStop is not meaningful for a form unless the form assigns another form to be its parent.


TWinControl::WindowHandle

TWinControl	Properties	See also

The WindowHandle provides access to a window handle for the control.

Syntax

virtual System::Integer __fastcall GetDeviceContext(System::Integer &WindowHandle);

Description

The WindowHandle property provides access to the same window handle as the Handle property, but WindowHandle is protected, and therefore only accessible to code inside the control.

The advantage to using WindowHandle is that it can be read and written to, while the Handle property is read-only. WindowHandle is intended to be used when implementing methods that need to change the value of the controls window handle. Unlike the Handle property, reading the value of WindowHandle doesn’t automatically create a valid handle. Reading WindowHandle can return a zero value.


TWinControl events

TWinControl	Alphabetically	Legend

In TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp


TWinControl events

TWinControl	By object	Legend

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp


TWinControl::OnEnter

TWinControl	Events	See also

The OnEnter event occurs when a control becomes receives the input focus.

Syntax

__property Classes::TNotifyEvent OnEnter;

Description

Use the OnEnter event handler to cause any special processing to occur when a windowed component becomes active.

The OnEnter event does not occur when switching between forms or between another Windows application and the application that includes the windowed control.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnEnter event occurs for the container before the OnEnter event of the contained control.

Similarly, an OnExit event of the container occurs after the OnExit event of the control in a container when focus moves to another control outside the container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks on the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button’s OnEnter event occurs.


TWinControl::OnExit

TWinControl	Events	See also

The OnExit event occurs when the input focus shifts away from one control to another.

Syntax

__property Classes::TNotifyEvent OnExit;

Description

Use the OnExit event handler to provide special processing that occurs when the control ceases to be active.

The OnExit event does not occur when switching between forms or between another Windows application and your application.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnExit event occurs for the control inside the container before the OnExit event of the container.

Similarly, an OnEnter event of the container occurs before the OnEnter event of the control in a container when focus moves to a control inside a container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks on the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button’s OnEnter event occurs.

Note

The value of the ActiveControl property updates before the OnExit event occurs.


TWinControl::OnKeyDown

TWinControl	Events	See also

The OnKeyDown event occurs when a user presses any key while the control has focus.

Syntax

__property TKeyEvent OnKeyDown;

Description

Use the OnKeyDown event handler to specify special processing to occur when a key is pressed. The OnKeyDown handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys, and pressed mouse buttons.

The TKeyEvent type points to a method that handles keyboard events. The Key parameter is the key on the keyboard. For non-alphanumeric keys, use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

The Shift parameter includes zero or more of the following values:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl::OnKeyPress

TWinControl	Events	See also

The OnKeyPress event occurs when a user presses a single character key.

Syntax

__property TKeyPressEvent OnKeyPress;

Description

Use the OnKeyPress event handler to make something happen as a result of a single character key press.

The Key parameter in the OnKeyPress event handler is of type Char; therefore, the OnKeyPress event registers the ASCII character of the key pressed. Keys that don't correspond to an ASCII Char value (Shift or F1, for example) don't generate an OnKeyPress event. Key combinations (such as Shift+A), generate only one OnKeyPress event (for this example, Shift+A results in a Key value of "A" if Caps Lock is off). To respond to non-ASCII keys or key combinations, use the OnKeyDown or OnKeyUp event handlers.


TWinControl::OnKeyUp

TWinControl	Events	See also

The OnKeyUp event occurs when the user releases a key that has been pressed.

Syntax

__property TKeyEvent OnKeyUp;

Description

Use the OnKeyUp event handler to provide special processing that occurs when a key is released. The OnKeyUp handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys.

The TKeyEvent type points to a method that handles keyboard events. The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

The Shift parameter includes zero or more of the following values:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl methods

TWinControl	Alphabetically	Legend

In TWinControl

~TWinControl

AlignControls

Broadcast

CanFocus

ChangeScale

ContainsControl

ControlAtPos

CreateHandle

CreateParams

CreateSubClass

CreateWindowHandle

CreateWnd

DefaultHandler

DestroyHandle

DestroyWindowHandle

DestroyWnd

DisableAlign

DoEnter

DoExit

DoKeyDown

DoKeyPress

DoKeyUp

EnableAlign

FindNextControl

FixupTabList

Focused

GetChildren

GetClientOrigin

GetClientRect

GetDeviceContext

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

IsControlMouseMsg

KeyDown

KeyPress

KeyUp

MainWndProc

NotifyControls

PaintControls

PaintHandler

PaintTo

PaintWindow

PaletteChanged

ReadState

Realign

RecreateWnd

RemoveControl

Repaint

ScaleBy

ScaleControls

ScrollBy

SelectFirst

SelectNext

SetBounds

SetChildOrder

SetFocus

SetZOrder

ShowControl

TWinControl

Update

UpdateControlState

WndProc

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWinControl methods

TWinControl	By object	Legend

~TWinControl

AlignControls

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateHandle

CreateParams

CreateSubClass

CreateWindowHandle

CreateWnd

DefaultHandler

DestroyComponents

DestroyHandle

Destroying

DestroyWindowHandle

DestroyWnd

DisableAlign

Dispatch

DoEnter

DoExit

DoKeyDown

DoKeyPress

DoKeyUp

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindNextControl

FixupTabList

Focused

FreeInstance

FreeNotification

Free

GetChildren

GetClientOrigin

GetClientRect

GetDeviceContext

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsControlMouseMsg

KeyDown

KeyPress

KeyUp

MainWndProc

MethodAddress

MethodName

NewInstance

NotifyControls

PaintControls

PaintHandler

PaintTo

PaintWindow

PaletteChanged

Perform

ReadState

Realign

RecreateWnd

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScaleControls

ScreenToClient

ScrollBy

SelectFirst

SelectNext

SendToBack

SetBounds

SetChildOrder

SetFocus

SetTextBuf

SetZOrder

ShowControl

Show

TWinControl

UpdateControlState

Update

WndProc


TWinControl::AlignControls

TWinControl	Methods	See also

The AlignControls method aligns any controls for which the control is the parent within a specified area of the control.

Syntax

virtual void __fastcall AlignControls(TControl *AControl, Windows::TRect &Rect);

Description

Use AlignControls to align all controls within an area of a form, panel, group box, scroll box, or any windowed control that contains several other controls. Specify the area in which to align the controls as the value of the Rect parameter.

AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be NULL. If you specify a control in AControl, that control takes precedence in alignment over other, similarly-aligned controls.


TWinControl::Broadcast

TWinControl	Methods	See also

The Broadcast method sends a message to each of the child controls of the windowed control.

Syntax

void __fastcall Broadcast(void *Message);

Description

Use Broadcast when you want to send the same message to each of the child controls contained within the windowed control. Specify the message to be passed as the value of the Message parameter.


TWinControl::CanFocus

TWinControl	Methods	See also

The CanFocus method determines whether a control can receive focus.

Syntax

System::Boolean __fastcall CanFocus(void);

Description

Call CanFocus to find out if the control can receive input from the user.

CanFocus returns true if both the control and its parent(s) have their Visible and Enabled properties set to true. If any of the Visible and Enabled properties of the control and the controls from which the control descends are not true, then CanFocus returns false. Override the CanFocus method to provide further restrictions to when the control can receive focus in descendent objects.


TWinControl::ChangeScale

TWinControl	Methods	See also

The ChangeScale method resizes and repositions the control, rescaling the children of the control before the control itself is rescaled.

Syntax

virtual void __fastcall ChangeScale(System::Integer M, System::Integer D);

Description

ChangeScale can be used to change the scale of a form and all its controls for a different screen resolution. Because ChangeScale modifies the control’s Top, Left, Width, and Height properties, it changes the position of the control and its children as well as their size.

The M parameter is the multiplier and the D parameter is the divisor. For example, to change a control and its children to be 75% of their original sizes, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, specify the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the controls being scaled by the same amount, 75%.

To make the control and its children 33% larger than their previous sizes, specify the value of M as 133, and the value of D as 100 (133/100), or obtain the same results by specifying the value of M as 4, and the value of D as 3 (4/3).

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly can mean that at some point the control disappears (when the roundoff errors make the control smaller), or at some point it creeps off the form (when the roundoff errors move the location of control). If rescaling a form repeatedly, destroy and reload the form after several rescalings to eliminate the accumulating roundoff error.


TWinControl::ContainsControl

TWinControl	Methods	See also

The ContainsControl method indicates whether a specified control exists within the control.

Syntax

System::Boolean __fastcall ContainsControl(TControl *Control);

Description

Use ContainsControl to find out if the a particular control exists within this control. ContainsControl returns true if the specified value of the Control parameter is a child control of the windowed control. The Control parameter need not be an immediate child (in the Controls property), but may be contained in a child of the windowed control, or in a child of a child of the windowed control, for indefinitely many levels deep.

If the method returns false, the specified control is not within the control.


TWinControl::ControlAtPos

TWinControl	Methods	See also

The ControlAtPos method returns the child control located at a specified position within the control.

Syntax

TControl *__fastcall ControlAtPos(const Windows::TPoint &Pos, System::Boolean AllowDisabled);

Description

Use ControlAtPos when you want to know which child control is at the specified location within the control. ControlAtPos will return an immediate child of the windowed control; that is, one of the entries of the Controls property, that has the windowed control for its Parent property.

Specify the position in client coordinates as the value of the Pos parameter. Pos can be anywhere within the boundaries of the child control, not just the upper left corner.

If there is no control at the specified position, ControlAtPos returns NULL. The AllowDisabled parameter determines whether the search for controls includes disabled controls.


TWinControl::CreateHandle

TWinControl	Methods	See also

The CreateHandle method generates a handle for the Handle property of the control if it does not already have one.

Syntax

virtual void __fastcall CreateHandle(void);

Description

CreateHandle calls the CreateWnd method to create the window handle if the control has a parent. CreateHandle creates a handle in the parent control before it creates a handle for the control itself.


TWinControl::CreateParams

TWinControl	Methods	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

Syntax

virtual void __fastcall CreateParams(TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a control creates its Windows representation. When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.

Specify the parameter record as the value of the Params parameter. The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.

TWinControl implements CreateParams by setting all the fields of Params to generic base values. A number of the standard controls override CreateParams to change one or more of the default values in Params.


TWinControl::CreateSubClass

TWinControl	Methods	See also

The CreateSubClass method creates a Borland C++ Builder windowed control derived from an existing Windows window class.

Syntax

void __fastcall CreateSubClass(TCreateParams &Params, System::PChar ControlClassName);

Description

Use CreateSubClass when you want to create a TCreateParams record to pass to a call to the CreateWindowEx API function. The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle.

Call CreateSubClass in the CreateParams method of a subclassed control, after calling the inherited CreateParams. Specify the parameter record as the value of the Params parameter. CreateSubClass allows VCL controls to create standard Windows controls.


TWinControl::CreateWindowHandle

TWinControl	Methods	See also

The CreateWindowHandle method creates a window handle for the control.

Syntax

virtual void __fastcall CreateWindowHandle(const TCreateParams &Params);

Description

Call CreateWindowHandle to create a window handle for the control. CreateWindowHandle creates the window handle by calling the CreateWindowEx API function, passing parameters from the record passed in the Params parameter.

The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle.


TWinControl::CreateWnd

TWinControl	Methods	See also

The CreateWnd method creates a Windows control corresponding to the windowed-control component.

Syntax

virtual void __fastcall CreateWnd(void);

Description

CreateWnd first calls the CreateParams method to initialize the window-creation parameters, then calls CreateWindowHandle to create the window handle for the control. CreateWnd adjusts the size of the newly-created window and then sets the control's font by calling the Perform method, passing the WM_SETFONT message.


TWinControl::DefaultHandler

TWinControl	Methods	See also

The DefaultHandler method provides message handling for all messages that the control does not fully process itself.

Syntax

virtual void __fastcall DefaultHandler(void *Message);

Description

Override DefaultHandler when you want to change the default message handling for the control.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method if that ancestor does not specify a handler for the message being handled.

TWinControl overrides the TControl.DefaultHandler to handle messages for all its descendant types. DefaultHandler passes any otherwise-unhandled messages to the control's window procedure by calling the CallWindowProc API function.


TWinControl::DestroyHandle

TWinControl	Methods	See also

The DestroyHandle method destroys the windowed control's window handle without destroying the control.

Syntax

void __fastcall DestroyHandle(void);

Description

Call DestroyHandle to dispose of the handle, but leave the control intact. The control can later recreate the handle if needed. DestroyHandle is the converse operation to CreateHandle. Applications should call the high-level CreateHandle and DestroyHandle methods, rather than the lower-level methods of CreateWnd and DestroyWnd, whenever possible.

If the control has windowed controls as child controls, DestroyHandle calls each of their DestroyHandle methods before calling DestroyWnd to destroy its own handle.


TWinControl::DestroyWindowHandle

TWinControl	Methods	See also

The DestroyWindowHandle method calls the Windows API function DestroyWindow to destroy the window handle created in the CreateWindowHandle method.

Syntax

virtual void __fastcall DestroyWindowHandle(void);

Description

Call DestroyWindowHandle to dispose of the window handle for the control.

TWinControl's Destroy method calls DestroyWindowHandle to destroy any window handle associated with a windowed control before destroying the object. The DestroyWnd method also calls DestroyWindowHandle.


TWinControl::DestroyWnd

TWinControl	Methods	See also

The DestroyWnd method destroys the windowed control's window handle.

Syntax

virtual void __fastcall DestroyWnd(void);

Description

Before the window handle is destroyed, DestroyWnd saves a copy of the control's text in internal storage, frees any device contexts, and finally calls DestroyWindowHandle.


TWinControl::DisableAlign

TWinControl	Methods	See also

The DisableAlign method temporarily disables the realigning of controls within the windowed control.

Syntax

void __fastcall DisableAlign(void);

Description

Call DisableAlign to prevent child controls from realigning. You might want to disable aligning while performing multiple manipulations of controls, such as reading from a form file or scaling. Each call to DisableAlign must have a corresponding call to EnableAlign.

DisableAlign increments a reference count that EnableAlign later decrements. When the reference count reaches zero, EnableAlign performs any needed realignments.


TWinControl::DoEnter

TWinControl	Methods	See also

The DoEnter method is the protected implementation method for a windowed control's OnEnter event.

Syntax

virtual void __fastcall DoEnter(void);

Description

The DoEnter method does nothing except call any event handler attached to the OnEnter event. Override DoEnter to provide other responses in addition to the inherited event-handler call.


TWinControl::DoExit

TWinControl	Methods	See also

The DoExit method is the protected implementation method for a windowed control's OnExit event.

Syntax

virtual void __fastcall DoExit(void);

Description

The DoExit method does nothing except call any event handler attached to the OnExit event. Override DoExit to provide other responses in addition to the inherited event-handler call.


TWinControl::DoKeyDown

TWinControl	Methods	See also

The DoKeyDown method is a protected method that performs some preprocessing before calling the KeyDown method that implements the OnKeyDown event.

Syntax

System::Boolean __fastcall DoKeyDown(Messages::TWMKey &Message);

Description

Use DoKeyDown to determine if the application should continue processing key-down message passed in the Message parameter. A return value of true indicates that the key-down occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-down message through the inherited processing.

DoKeyDown allows parent forms with the KeyPreview property set to true to preemptively process the key-down message. If the form does not handle the message, DoKeyDown translates the message parameters into the appropriate types and calls KeyDown, which in turn calls the OnKeyDown event handler, if any.

The TWMKey type is the message record for all Windows keyboard messages.


TWinControl::DoKeyPress

TWinControl	Methods	See also

The DoKeyPress method is a protected method that performs some preprocessing before calling the KeyPress method that implements the OnKeyPress event.

Syntax

System::Boolean __fastcall DoKeyPress(Messages::TWMKey &Message);

Description

Use the return value from DoKeyPress to determine whether the application should continue processing the key-press message passed in the Message parameter. A return value of true indicates that the key-press occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-press message through the inherited processing.

DoKeyPress allows parent forms with the KeyPreview property set to true to preemptively process the key-down message. If the form does not handle the message, DoKeyPress translates the message parameters into the appropriate types and calls KeyPress, which in turn calls the OnKeyPress event handler, if any.

The TWMKey type is the message record for all Windows keyboard messages.


TWinControl::DoKeyUp

TWinControl	Methods	See also

The DoKeyUp method is a protected method that performs some preprocessing before calling the KeyUp method that implements the OnKeyUp event.

Syntax

System::Boolean __fastcall DoKeyUp(Messages::TWMKey &Message);

Description

Use the return value from DoKeyUp to determine whether the application should continue processing the key-up message passed in the Message parameter. A return value of true indicates that the key-up occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-up message through the inherited processing.

DoKeyUp allows parent forms with the KeyPreview property set to true to preemptively process the key-down message. If the form does not handle the message, DoKeyUp translates the message parameters into the appropriate types and calls KeyUp, which in turn calls the OnKeyUp event handler, if any.

The TWMKey type is the message record for all Windows keyboard messages.


TWinControl::EnableAlign

TWinControl	Methods	See also

The EnableAlign method decrements the reference count incremented by a call to the DisableAlign method, eventually realigning the child controls of the windowed control.

Syntax

void __fastcall EnableAlign(void);

Description

Call EnableAlign to allow child controls within the control to realign again after they were prevented from realigning by a call to DisableAlign.

Each time the DisableAlign method is called, it increments a reference count. Each time EnableAlign is called, it decrements the same reference count. When the reference count reaches zero, EnableAlign calls the Realign method to perform any pending realignments.

Be sure to pair each call to DisableAlign with a call to EnableAlign.


TWinControl::FindNextControl

TWinControl	Methods	See also

The FindNextControl method returns the windowed control's next child control in the tab order after the specified control.

Syntax

TWinControl *__fastcall FindNextControl(TWinControl *CurControl, System::Boolean GoForward, System::Boolean

Description

Call FindNextControl to find the next child control in the tab order after CurControl.If CurControl is not a child of the windowed control, FindNextControl returns the first child control in the tab order.

The GoForward parameter controls the direction of the search. If GoForward is true, FindNextControl searches forward through the child controls in tab order. If Go Forward is false, FindNextControl searches backward through the controls.

The CheckTabStop and CheckParent parameters control whether FindNextControl performs certain checks on the controls it finds. If CheckTabStop is true, the returned control must have its TabStop property set to true. If CheckParent is true, the returned control's Parent property must indicate the windowed control.

FindNextControl calls the GetTabOrderList method to build its list of possible "next" controls.


TWinControl::FixupTabList

TWinControl	Methods	See also

The FixupTabList method sorts the child controls of this control by their tab order.

Syntax

void __fastcall FixupTabList(void);

Description

Applications should not call FixupTabList directly. Borland C++ Builder uses this method in its implementation of the ReadState method to initalize the tab order list based on the TabOrder properties of the child controls being read from the stream.


TWinControl::Focused

TWinControl	Methods	See also

The Focused method determines whether a windowed control has the focus.

Syntax

System::Boolean __fastcall Focused(void);

Description

Use the Focused method to see if the control is the active control. When Focused is true, the control has the focus. If Focused is false, the user cannot interact with the control.


TWinControl::GetChildren

TWinControl	Methods	See also

The GetChildren method calls the specified method for each child of the windowed control.

Syntax

virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);

Description

GetChildren is called by the Component Library streaming system. Applications will probably never need to call this routine . Some specialized controls may need to override GetChildren to indicate which of its child controls should be written to the stream.

The TGetChildProc type defines a method-pointer type for the methods to be passed as parameters to the GetChildren method.


TWinControl::GetClientOrigin

TWinControl	Methods	See also

The GetClientOrigin method is a protected access method for the ClientOrigin property.

Syntax

virtual Windows::TPoint __fastcall GetClientOrigin(void);

Description

Call GetClientOrigin to find the origin of the client area of the control.

GetClientOrigin returns a point indicating the position of the top-left corner of the control in screen coordinates. GetClientOrigin calls the Windows API function ClientToScreen to return the position of top-left corner of the windowed control on the screen in screen coordinates.


TWinControl::GetClientRect

TWinControl	Methods	See also

The GetClientRect method is a protected access method for the ClientRect property.

Syntax

virtual Windows::TRect __fastcall GetClientRect(void);

Description

Call GetClientRect to return the rectangle that defines the client area of the control. GetClientRect returns a rectangle with the rectangle’s Top and Left fields set to zero, and its Bottom and Right fields set to the control's CleintHeight and ClientWidth, respectively. GetClientRect calls the Windows API function GetClientRect.


TWinControl::GetDeviceContext

TWinControl	Methods	See also

The GetDeviceContext method returns a device context for the control

Syntax

virtual System::Integer __fastcall GetDeviceContext(System::Integer &WindowHandle);

Description

Call GetDeviceContext to return a device context for the control.

GetDeviceContext calls the Windows API function GetDC, passing the windowed control's Handle property and setting the WindowHandle property to Handle. If the call is unsuccesful, the EOutOfResources exception is raised.


TWinControl::GetTabOrderList

TWinControl	Methods	See also

The GetTabOrderList builds a list of controls in tab order

Syntax

virtual void __fastcall GetTabOrderList(Classes::TList *List);

Description

Call GetTabOrder to construct a list of child controls in tab order.

GetTabOrder iterates through the windowed control's internal tab-order list, adding each of the controls to List, including any controls contained in those controls. The result is a list of all the controls and their owned controls, in tab order.

The FindNextControl method calls GetTabOrderList to build a complete list of the controls that FindNextControl uses to locate the next control in the tab order.


TWinControl::HandleAllocated

TWinControl	Methods	See also

The HandleAllocated reports whether a window handle exists for the control.

Syntax

System::Boolean __fastcall HandleAllocated(void);

Description

Query HandleAllocated to find out the control has a window handle.

If a window handle exists, HandleAllocated returns true. If no window handle exists, HandleAllocated returns false. Testing the Handle property of a control directly causes a handle to be allocated if it does not already exist. Call the HandleAllocated method to determine whether a handle exists without allocating a handle as a side effect.


TWinControl::HandleNeeded

TWinControl	Methods	See also

The HandleNeeded creates a window handle for the control if it doesn't already exist.

Syntax

void __fastcall HandleNeeded(void);

Description

Call HandleNeeded to create a window handle for the control.

If no window handle exists, HandleNeeded calls the HandleNeeded method for the parent of the control before it creates a window handle for this control.


TWinControl::InsertControl

TWinControl	Methods	See also

The InsertControl inserts a control into the Controls array property of the windowed control.

Syntax

void __fastcall InsertControl(TControl *AControl);

Description

Controls are automatically inserted and removed when you add them and delete them at design time. When you want to insert a control into the Controls property at run time, call the InsertControl method.

InsertControl makes the inserted control a child, and the containing control the parent. Specify the control to be inserted as the value of the AControl parameter. If the child control is already the child of another windowed control, set the Parent property of the child instead, as this ensures the child is removed from the Controls of the original parent.


TWinControl::Invalidate

TWinControl	Methods	See also

The Invalidate method repaints the control after other important Windows messages are handled.

Syntax

virtual void __fastcall Invalidate(void);

Description

Use Invalidate when the entire control needs to be repainted. When more than one region within the control needs repainting, Invalidate will cause the entire window to be repainted, avoiding flicker. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.

Invalidate calls the InvalidateRect function of the Windows API.


TWinControl::IsControlMouseMsg

TWinControl	Methods	See also

The IsControlMouseMsg returns true if a specified mouse message is directed to one of the child controls of the windowed control.

Syntax

System::Boolean __fastcall IsControlMouseMsg(Messages::TWMMouse &Message);

Description

Call IsControlMouseMsg to find out if a mouse message is directed to one of the control’s child controls. Specify the mouse message as the value of the Message parameter.

Windows takes care of sending messages to windowed child controls, but for nonwindowed child controls, Windows sends the messages to the parent control, which must then determine which, if any, of its child controls should receive the message.

The WndProc method of a windowed control calls IsControlMouseMsg to process all mouse message sent to the windowed control.


TWinControl::KeyDown

TWinControl	Methods	See also

The KeyDown method is the protected implementation method for a windowed control's OnKeyDown event.

Syntax

virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);

Description

The KeyDown method inherited from TWinControl does nothing except call any event handler attached to the OnKeyDown event. Override KeyDown to provide other responses in addition to the inherited event-handler call.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

A windowed control calls KeyDown in response to a key-down message (WM_KEYDOWN) from Windows. The actual sequence is that the message goes to a private message handler that calls the DoKeyDown method.  If DoKeyDown determines that the control should, in fact, process the character, it decodes the parameters of the key-down message and passes the key code and shift-key state to KeyDown in the Key and Shift parameters, respectively.

Either KeyDown  or the OnKeyDown event handler it calls can suppress further processing of a key by setting the Key parameter to zero.

The Shift parameter is a set of shift key and mouse combinations that includes these possible states:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl::KeyPress

TWinControl	Methods	See also

The KeyPress method is the protected implementation method for a windowed control's OnKeyPress event.

Syntax

virtual void __fastcall KeyPress(System::Char &Key);

Description

The KeyPress method inherited from TWinControl does nothing except call any event handler attached to the OnKeyPress event. Override KeyPress to provide other responses in addition to the inherited event-handler call.

A windowed control calls KeyPress in response to a key-press  message (WM_CHAR) from Windows. The actual sequence is that the message goes to a private message handler that calls the DoKeyPress method.  If DoKeyPress determines that the control should, in fact, process the character, it decodes the parameters of the key-down message and passes the key code to KeyPress in the Key parameters, respectively.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

Either KeyPress or the OnKeyPress event handler it calls can suppress further processing of a character by setting the Key parameter to zero.


TWinControl::KeyUp

TWinControl	Methods	See also

The KeyUp method is the protected implementation method for a windowed control's OnKeyUp event.

Syntax

virtual void __fastcall KeyUp(System::Word &Key,  Classes::TShiftState Shift);

Description

The KeyUp method simply calls the OnKeyUp event handler if it is assigned. Override KeyUp to provide other responses in addition to the inherited event-handler call.

A windowed control calls KeyUp in response to a key-up message (WM_KEYUP) from Windows. The actual sequence followed when a key is released is as follows:

1	The DoKeyUp method determines whether the control should, in fact, process the character.

2	If the character should be processed, DoKeyUp decodes the parameters of the key-up message and passes the key code and shift-key state to KeyUp in the Key and Shift parameters, respectively.

3	Either KeyUp  or the OnKeyUp event handler it calls can suppress further processing of a key by setting the Key parameter to zero.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

The TShiftState type is a set of shift key and mouse combinations that includes these possible states:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl::MainWndProc

TWinControl	Methods	See also

The MainWndProc method is the routine Windows calls when it has messages for the control.

Syntax

void __fastcall MainWndProc(Messages::TMessage &Message);

Description

Call MainWndProc to send a message to the control.

MainWndProc does not process or dispatch the messages itself, but rather calls the WndProc method to do that. MainWndProc provides an exception-handling block around WndProc, ensuring that if any unhandled exceptions occur in the application during the processing of a message, they go to the application’s HandleException method.


TWinControl::NotifyControls

TWinControl	Methods	See also

The NotifyControls method sends a message to all the child windows of the windowed control.

Syntax

void __fastcall NotifyControls(System::Word Msg);

Description

The NotifyControls method sends a message with the message ID passed in the Msg parameter to all the controls in the windowed control's Controls array property. Borland C++ Builder uses NotifyControls to update all the controls in a form of such occurrences as changes in the parent color or font.

NotifyControls constructs a generic message record, filling its message ID field with the value of Msg and setting its parameter and result fields to zeros, then calls the Broadcast method to send the message to all the child controls.


TWinControl::PaintControls

TWinControl	Methods	See also

The PaintControls method paints each of the child controls in a windowed control using the specified device context.

Syntax

void __fastcall PaintControls(System::Integer DC, TControl *First);

Description

Call PaintControls to paint all the child controls of this control. Pass the device context as the value of the DC parameter. The First parameter indicates the starting point in the windowed control's child-control list to paint. If First is NULL or does not indicate one of the child controls, PaintControls paints all the child controls.

The Repaint method calls PaintControls for the control's parent, passing the control in First to repaint the control and any controls it might intersect. PaintHandler also calls PaintControls after calling PaintWindow.


TWinControl::PaintHandler

TWinControl	Methods	See also

The PaintHandler method is a handler that responds to WM_PAINT messages.

Syntax

void __fastcall PaintHandler(Messages::TWMPaint &Message);

Description

PaintHandler calls the BeginPaint and EndPaint API functions, and between them paints the control's background by calling PaintWindow and any child controls by calling PaintControls.


TWinControl::PaintTo

TWinControl	Methods	See also

The PaintTo method draws the windowed control on a device context.

Syntax

void __fastcall PaintTo(System::Integer DC, System::Integer X, System::Integer Y);

Description

Call PaintTo to draw the control on a device context. Specify the device context as the value of the DC parameter and specify the X and Y coordinates on the device context where the top-left corner of the windowed control is to be drawn. PaintTo first erases the background of the device context and then paints the control.

PaintTo is useful for drawing an image of the conrol into a bitmap DC.


TWinControl::PaintWindow

TWinControl	Methods	See also

The PaintWindow method renders the image of a windowed control.

Syntax

virtual void __fastcall PaintWindow(System::Integer DC);

Description

Call PaintWindow to repaint the control. PaintWindow sends a WM_PAINT message to the windowed control's DefaultHandler message, setting the message record's WParam field to the value passed in DC and the other parameter and result fields to zeros.


TWinControl::PaletteChanged

TWinControl	Methods	See also

The PaletteChanged method responds to changes in the system's palette by realizing the control's palette and the palette for each child control.

Syntax

virtual System::Boolean __fastcall PaletteChanged(System::Boolean Foreground);

Description

Override PaletteChanged to change how the control responds to Windows notifications that the system palette is changing. TWinControl responds to these notifications by trying to realize the windowed control’s palette, if any, into the current device context, and then passing on the PaletteChanged notification to each of the child controls in turn. If the change in the system palette causes the actual value of the control’s palette to change, PaletteChanged will invalidate the control so that it can repaint with the new palette.

Windows paints the topmost window with a foreground palette, while other windows employ background palettes. Background palettes are approximate matches to the colors specified by the control’s logical palette, given the limitations imposed by implementing the foreground palette. Windows only allows a single foreground palette.

PaletteChanged allows the control to obtain a new realization of its palette when the system palette changes. When ForeGround is true, the form has been activated and controls is specifying the new foreground palette. When ForeGround is false, another application has changed the foreground palette, and controls that are sensitive to the available palette should realize new background palettes to best match their logical palettes.

If the control does not have a logical palette to be realized into the current device context, GetPalette will return false, and PaletteChanged will not try to realize a palette for the windowed control, but simply pass the notification on to the child controls. If the windowed control or any of its child controls realize a palette into the current device context in response to PaletteChanged, this method returns true.

Override PaletteChanged to change the way in which controls are given an opportunity to realize a new palette when the windows system palette changes. For example, override PaletteChanged to change the order in which child controls realize their palettes, giving a particular control the foreground palette when the form is activated, or to pass palette change notification to custom controls implemented outside of Borland C++ Builder, such as in DLLs. Override GetPalette instead to affect whether the windowed control actually has a palette to realize, or to change the value of the control’s logical palette.

Note

PaletteChanged is called only when the run-time video mode requires palette support, such as for 256 color mode, but not 16 million color mode.


TWinControl::ReadState

TWinControl	Methods	See also

The ReadState method prepares the control for having its properties assigned values read from a stream.

Syntax

virtual void __fastcall ReadState(Classes::TReader *Reader);

Description

Override ReadState to change the preparations the control makes as it readies itself to have its properties values assigned from a stream. For example, the windowed control might destroy temporary internal data structures or objects before new instances are loaded from the stream. Be sure to include a call to the inherited ReadState property of TControl when overriding ReadState.

ReadState disables control alignment until all the child controls have been read from the stream, calls the inherited ReadState method, and re-enables the alignment of all the controls. The method then builds the tab order list of controls and synchronizes its Ctl3D property and its visiblity with that of its parent control.


TWinControl::Realign

TWinControl	Methods	See also

The Realign method forces the windowed control to realign the controls within it.

Syntax

void __fastcall Realign(void);

Description

Call Realign to realign all the child controls within this control.

If all of the child controls of this control have their Align properties set to alNone, Realign has no effect.

The EnableAlign method calls Realign when its reference count reaches zero.


TWinControl::RecreateWnd

TWinControl	Methods	See also

The RecreateWnd method destroys the window handle associated with a windowed control and then creates another that reflects the control's current state.

Syntax

void __fastcall RecreateWnd(void);

Description

Call RecreateWnd to recreate the control.

Windows does not reflect certain kinds of changes to a control without destroying the window and recreating it. For example, to reflect a change in the border style of an edit box, the window for the control must be recreated.

RecreateWnd calls DestroyHandle to destroy the window handle, then regenerates the handle as part of redisplaying the control.


TWinControl::RemoveControl

TWinControl	Methods	See also

The RemoveControl method removes a specified control from the Controls array of this control.

Syntax

void __fastcall RemoveControl(TControl *AControl);

Description

Call RemoveControl to remove a child control from this control’s Controls property. The result is that this control is no longer the parent of the removed control. Specify the control to remove as the value of the AControl parameter.

Controls are automatically inserted and removed when you add them and delete them at design time. When you want to remove a control from the Controls property at run time, call the RemoveControl method.


TWinControl::Repaint

TWinControl	Methods	See also

The Repaint method repaints the windowed control’s image on the screen.

Syntax

virtual void __fastcall Repaint(void);

Description

Call Repaint to repaint the control.

The Repaint method calls the Invalidate method and then the Update method to repaint the control.


TWinControl::ScaleBy

TWinControl	Methods	See also

The ScaleBy method rescales a windowed control and any of its children to a percentage of their former size.

Syntax

void __fastcall ScaleBy(System::Integer M, System::Integer D);

Description

Call ScaleBy to rescale the control and all its children. ScaleBy modifies the Height and Width properties of the controls, but it does not change the Top and Left properties; therefore, the size of the controls changes, but not the coordinates of the top-left corners of the controls.

The M and D parameters determine the percentage by which the control and its children are scaled. The M parameter is the multiplier and the D parameter is the divisor. For example, to change a control to be 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, obtain the same results by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To make the control 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100), or specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ScaleBy repeatedly may mean that at some point the control disappears (when the roundoff errors make the control smaller). When rescaling controls repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TWinControl::ScaleControls

TWinControl	Methods	See also

The ScaleControls method rescales the child controls of a windowed control without rescaling the control itself.

Syntax

void __fastcall ScaleControls(System::Integer M, System::Integer D);

Description

Call ScaleControls to rescale only the children of the control, while leaving the control itself the same size.

ScaleControls calls the ChangeScale method of each child control, specifying the percentage to scale by through the M and D parameters. M is the multiplier and D is the divisor. For example, to change the child controls to be 75% of their original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, specify the value of M as 3, and the value D as 4 (3/4). Both fractions are equal and result in the controls being scaled by the same amount, 75%.

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ScaleBy repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling controls repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TWinControl::ScrollBy

TWinControl	Methods	See also

The ScrollBy method scrolls the contents of a windowed control.

Syntax

void __fastcall ScrollBy(System::Integer DeltaX, System::Integer DeltaY);

Description

Call ScrollBy to scroll the contents within the control. While ScrollBy can be used for any windowed control, it makes the most sense to use it for descendents of TScrollingWinControl.

Applications seldom need to call the ScrollBy method unless they implement their own scrolling interface rather than relying on a scroll bar.

The DeltaX parameter is the change in pixels along the X axis. A positive DeltaX value scrolls the contents to the right; a negative value scrolls the contents to the left. The DeltaY parameter is the change in pixels along the Y axis. A positive DeltaY value scrolls the contents down; a negative value scrolls the contents up.


TWinControl::SelectFirst

TWinControl	Methods	See also

The SelectFirst method locates the first child selectable control in the tab order within the windowed control.

Syntax

void __fastcall SelectFirst(void);

Description

Call SelectFirst to find the first child that can be selected within the control’s tab order. SelectFirst calls the FindNextControl method, passing NULL as the current control. Once the first selectable control is found, SelectFirst makes the control the active control on the form.


TWinControl::SelectNext

TWinControl	Methods	See also

The SelectNext method moves the input focus from the current child control to the next one in the tab order.

Syntax

void __fastcall SelectNext(TWinControl *CurControl, System::Boolean GoForward, System::Boolean CheckTabStop

Description

Call SelectNext to find the next child control in the control’s tab order. Specify the current control from which to begin the search as the value of the CurControl parameter. The GoForward parameter controls the direction of the search. If GoForward is true, FindNextControl searches forward through the child controls in tab order. If GoForward is false, FindNextControl searches backward through the controls.

The CheckTabStop parameter controls whether the control SelectNext finds must be a tab stop. If CheckTabStop is true, the returned control must have its TabStop property set to true, or the search for the next control continues.

If SelectNext doesn’t locate an appropriate control (as defined by the GoForward and the CheckTabStop parameters, the focus is restored to CurControl.


TWinControl::SetBounds

TWinControl	Methods	See also

The SetBounds method sets the windowed control's boundary properties all at once.

Syntax

virtual void __fastcall SetBounds(System::Integer ALeft, System::Integer ATop, System::Integer AWidth

Description

Use SetBounds to change all of the component's boundary properties at one time. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately, but SetBounds changes all four properties at once ensuring that the control will not repaint between changes.

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.


TWinControl::SetChildOrder

TWinControl	Methods	See also

The SetChildOrder method changes the order in which the child component appears in the list of child components returned by the GetChildren method.

Syntax

virtual void __fastcall SetChildOrder(Classes::TComponent *Child, System::Integer Order);

Description

Use SetChildOrder when you want to change the order in which child objects are streamed in. Specify the child component whose order you want to change as the value of the Child parameter. Indicate the position you want the component to be in as the value of the Order parameter.

When SetChildOrder is called, items previously below the child's old position move up, and those below the new position move down.


TWinControl::SetFocus

TWinControl	Methods	See also

The SetFocus method gives the input focus to the control.

Syntax

virtual void __fastcall SetFocus(void);

Description

Use SetFocus to change the focus to another control.


TWinControl::SetZOrder

TWinControl	Methods	See also

The SetZOrder method moves the control within the parent’s control list to either the top or bottom of the windowed controls, or, if the control has no parent, the control becomes either the top or bottom window on the screen.

Syntax

virtual void __fastcall SetZOrder(System::Boolean TopMost);

Description

Use SetZOrder to move rearrange overlapping controls within a parent control or overlapping windows on the screen. If the TopMost parameter is true, the control becomes the top control; otherwise, it becomes the bottom control.

Windowed controls always stack on top of non-windowed controls. Thus, if the Parent contains any non-windowed controls, calling SetZOrder with a TopMost value of false will still keep the windowed control above all the non-windowed controls.

After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.


TWinControl::ShowControl

TWinControl	Methods	See also

The ShowControl method ensures that a specified child control is visible.

Syntax

virtual void __fastcall ShowControl(TControl *AControl);

Description

Call ShowControl to display a child control. Specify the control you want to ensure will be visible as the value of the AControl parameter.

The TWinControl method ShowControl simply calls the ShowControl method of the windowed control’s parent. Derived objects should override the ShowControl method to perform whatever actions are necessary to allow the indicated child object to be visible. Possible actions include scrolling the particular child object into view, or changing to the appropriate notebook page.

ShowControl is a protected method used in the implementation of the Show method.


TWinControl::Update

TWinControl	Methods	See also

The Update method processes any pending paint messages immediately.

Syntax

virtual void __fastcall Update(void);

Description

Call Update to force the control to be repainted before any more, possibly time-consuming, processing takes place. Use Update to provide immediate feedback to the user that cannot wait for the Windows paint message to arrive. Update does not invalidate the control, but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead if you need to invalidate the control as well.

Update calls the Windows API UpdateWindow function, which processes any pending paint messages. For more information, see the Win32 Developer's Reference (WIN32.HLP).


TWinControl::UpdateControlState

TWinControl	Methods	See also

The UpdateControlState method shows a windowed control, causing all parent objects to make any necessary adjustments.

Syntax

void __fastcall UpdateControlState(void);

Description

UpdateControlState is used internally by Borland C++ Builder to show controls and create handles for controls at the time they are displayed. UpdateControlState calls the Show method to show the windowed control. To help ensure that the windowed control will be visible, it creates the window handle for the object or any parent objects that do not yet have one, and calls the ShowControl method of all parent controls to ensure that the control is in view.

UpdateControlState shows the control only if its parent is showing and the control’s Visible property is true.


TWinControl::WndProc

TWinControl	Methods	See also

The WndProc method provides specific message responses for the control.

Syntax

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

Override WndProc to change how the control responds to Windows messages. WndProc is the first method that receives messages for a Borland C++ Builder control.

WndProc for TWinControl overrides WndProc for TControl to define responses for focus, mouse, and keyboard messages, and sends all others to its inherited WndProc.

When overriding WndProc to provide specialized responses to messages, be sure to call the inherited WndProc at the end to dispatch any other messages.


TWinControl::TWinControl

TWinControl	Methods	See also

TWinControl creates a new TWinControl object.

Syntax

__fastcall virtual TWinControl(Classes::TComponent *AOwner);

Description

Use TWinControl to create a new TWinControl object.


TWinControl::~TWinControl

TWinControl	Methods	See also

~TWinControl frees the memory associated with the TWinControl object.

Syntax

__fastcall virtual ~TWinControl(void);

Description

Do not call ~TWinControl directly. Instead, use the delete keyword on the object, which causes ~TWinControl to be invoked automatically.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl


TWinControl example

TWinControl


TWordField

Hierarchy	Properties	Methods	Events	See also

A TWordField object represents an unsigned 16-bit integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Word fields can hold values in the range 0 to 65535, and are used to hold values that are unsigned 16-bit whole numbers.

TWordField differs from its immediate ancestor TIntegerField only in the data type it represents. Except for the constructor, all of the properties, methods, and events are the same as those of TIntegerField, and provide functionality that is useful for managing the value and properties of a integral numeric field in a database.


TWordField properties

TWordField	Alphabetically	Legend

Derived from TIntegerField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TWordField properties

TWordField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TWordField events

TWordField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TWordField events

TWordField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TWordField methods

TWordField	Alphabetically

In TWordField

~TWordField

TWordField

Derived from TIntegerField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWordField methods

TWordField	By object

~TWordField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TWordField


TWordField::TWordField

TWordField	Methods	See also

TWordField creates a new TWordField object.

Syntax

__fastcall virtual TWordField(Classes::TComponent *AOwner);

Description

Use TWordField to create a new TWordField object.


TWordField::~TWordField

TWordField	Methods	See also

~TWordField frees the memory associated with the TWordField object.

Syntax

__fastcall virtual ~TWordField(void);

Description

Do not call ~TWordField directly. Instead, use the delete keyword on the object, which causes ~TWordField to be invoked automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TWordField example

TWordField


TWriter

Hierarchy	Properties	Methods	See also

TWriter is a specialized filer object that writes data to its associated stream.

Header

vcl/classes.hpp

Decription

TWriter is used internally by the VCL streaming system to write different kinds of items associated with a component, such as published properties of components or custom property data, to a stream. TWriter is a helper object for streams that handles the mechanics of writing the data associated with a component to the stream. It is the writer object, rather than the stream object, that is responsible for handling the complexities of streaming components. These include methods for:

•	Writing different kinds of items to the associated stream.

•	Writing property deltas used for streaming inherited forms and properties with default values.

•	Writing nested groups of items or collections to the stream.

Other methods and properties of TWriter are used for interacting with stream and component objects.

Users do not directly create writer objects. The constructor for TWriter takes a stream as a parameter. Writers are automatically created in stream object methods or in global routines that initiate the streaming process. These include:

•	Calling the global routine ObjectBinaryToText procedure, which directly creates a writer object.

•	Calling thje global ReadComponentResFile function, which creates a file stream object that creates a writer object.

•	Calling TStream.WriteDescendent, which creates a writer object.

The stream passed as a parameter to the writer’s constructor represents the associated stream. Therefore once the streaming process is underway users do not need to directly manipulate reader objects. The interaction between the reader, component, and stream objects happens automatically in methods of these objects that make calls to each other.


TWriter properties

TWriter	Alphabetically

In TWriter

Position

RootAncestor

Derived from TFiler

Ancestor

IgnoreChildren

Root


TWriter properties

TWriter	By object

Ancestor

IgnoreChildren

Position

RootAncestor

Root


TWriter::Position

TWriter	Properties	See also

Position represents the current writing position in the associated stream.

Syntax

__property System::Longint Position;

Desription

Position is used internally by writer objects to indicate the current writing position in the stream.

The value of Position will be inside the most recent buffer block read or the next block to be written. Thus for writing Position will generally be less than the stream's Position. When Position is set to a location outside the current buffer, the writer’s buffer is flushed to the stream.


TWriter::RootAncestor

TWriter	Properties	See also

RootAncestor represents the ancestor of the component in the Root property.

Syntax

__property TComponent * RootAncestor;

Description

RootAncestor is used internally by writer objects for dealing with form inheritance. It is used to iterate through ancestor components when writing properties in inherited forms.

RootAncestor is always the ancestor form. For each component in Root, which is the inherited form, the Ancestor property tracks a corresponding component in RootAncestor.

The writer object iterates through each of the Root form's owned components, comparing each to the corresponding component in the RootAncestor form. It then writes only those properties in the current component that differ in some way from those in the Ancestor component.


TWriter methods

TWriter	Alphabetically

In TWriter

~TWriter

DefineBinaryProperty

DefineProperty

FlushBuffer

TWriter

Write

WriteBoolean

WriteChar

WriteCollection

WriteComponent

WriteDescendent

WriteFloat

WriteIdent

WriteInteger

WriteListBegin

WriteListEnd

WriteRootComponent

WriteSignature

WriteStr

WriteString

Derived from TFiler

ClassInfo

Derived from TObject

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWriter methods

TWriter	By object

~TWriter

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineBinaryProperty

DefineProperty

Dispatch

FieldAddress

FlushBuffer

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TWriter

WriteBoolean

WriteChar

WriteCollection

WriteComponent

WriteDescendent

WriteFloat

WriteIdent

WriteInteger

WriteListBegin

WriteListEnd

WriteRootComponent

WriteSignature

WriteString

WriteStr

Write


TWriter::DefineBinaryProperty

TWriter	Methods	See also

DefineBinaryProperty defines binary data, as if the data were a property, and writes it directly to a memory stream.

Syntax

virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, TStreamProc ReadData, TStreamProc

Description

DefineBinaryProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter.

For writing binary data DefineProperties takes a TWriter object and then it calls the DefineBinaryProperties method of the writer object. DefineBinaryProperty then writes the property’s name and it’s data, but only if the HasData parameter is true. Otherwise it does nothing.

The Name parameter specifies the name of the “fake” property to be written to the stream. A “fake” property is a property that is not published, and that exists only in the code for the DefineBinaryProperty method. The Top and Left properties of a non-visual component are examples of “fake” properties. These are also called “defined properties” or “custom defined properties.”

The TStreamProc type is the type of the ReadData and WriteData parameters. It is the method-pointer type that points to a procedure (defined in the storing object) that reads or writes a binary representation of the object's data directly to or from the stream passed to them in the Stream parameter. For TWriter the ReadData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write). Thus, HasData is used only by writer objects when writing data.

Defined binary properties are quite rare. VCL objects that store graphics as binary data are the most common use of filer objects to store and retrieve that data. More commonly objects use the DefineProperty method. The difference between DefineBinaryProperty and DefineProperty is that the component reads or writes the binary property directly to or from from a memory stream object, rather than going through a filer object.

Note

Streamable objects that are descended from TPersistent inherit a DefineProperties method, however DefineProperties does not do anything until TComponent. Therefore, it is component objects’ DefineProperties method that calls the writer’s DefineBinaryProperty when writing out binary data.


TWriter::DefineProperty

TWriter	Methods	See also

DefineProperty defines data the writer object writes as if the data were a property.

Syntax

virtual void __fastcall DefineProperty(const System::AnsiString Name, TReaderProc ReadData, TWriterProc

Description

DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For writing data DefineProperties takes a TWriter object and then it calls the DefineProperties method of the writer object. DefineProperty then writes the property’s name and it’s data, but only if the HasData parameter is true. Otherwise it does nothing.

The Name parameter specifies the name of the “fake” property to be written to the stream.

The TWriterProc type is the type of the WriteData parameter. It is the method-pointer type that points to a procedure (defined in the component object) that writes the object's data, that represents a property value, to the writer object. For TWriter the ReadData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write). Thus, HasData is used only by writer objects when writing data.

The difference between DefineBinaryProperty and DefineProperty is that the binary property is written directly to a stream object, rather than going through a filer object.

When writing a component that has special (large) data storage requirements, the component’s DefineProperties can be overriden. For each special or “fake” property item, call the Filer.DefineProperty method or Filer.DefineBinaryProperty. For the ReadData and WriteData parameters, pass in methods of the component that know how to handle that special data type. When reading, ReadData will be called. When writing, WriteData will be called.

Note

When defining properties, a component should be aware of the Ancestor property, which if non-NULL indicates that the component should only write the values of properties that differ from those inherited from Ancestor.


TWriter::FlushBuffer

TWriter	Methods

FlushBuffer synchronizes the writer's buffer with the associated stream by writing the current buffer.

Syntax

virtual void __fastcall FlushBuffer(void);

Description

FlushBuffer is not generally used except for internal implementation in Borland C++ Builder.

FlushBuffer writes the current buffer to the stream, then resets an internal pointer to the correct position.


TWriter::Write

TWriter	Methods	See also

Write writes Count bytes from Buf to the writer object's associated stream.

Syntax

void __fastcall Write(const void *Buf, System::Longint Count);

Descripiton

Do not call Write directly. It is used internally to write data to the stream. Many other writer methods call Write, usually after setting pertinent values or verifying data types.


TWriter::WriteBoolean

TWriter	Methods	See also

WriteBoolean writes the Boolean value passed in Value to the writer object's stream.

Syntax

void __fastcall WriteBoolean(System::Boolean Value);

Description

WriteBoolean is used internally by the Borland C++ Builder streaming system to write component properties to a stream. Use WriteBoolean for writing component boolean properties to streams.

WriteBoolean checks to ensure that Value is the correct type before calling Write to write the boolean value and its value type to the stream.


TWriter::WriteChar

TWriter	Methods	See also

WriteChar writes the character passed in Value to the writer object's stream.

Syntax

void __fastcall WriteChar(System::Char Value);

Description

WriteChar is used internally by the Borland C++ Builder streaming system to write component properties to a stream. Use WriteChar for writing component character properties to streams.

WriteChar calls WriteString which checks to ensure that Value is the correct type before calling Write to write the character and its value type to the stream.

Note

WriteChar calls StringChar to enable writing character properties that are upwardly compatable with string properties.


TWriter::WriteCollection

TWriter	Methods	See also

WriteCollectionwrites the collection of objects passed in Value to the writer object's stream.

Syntax

void __fastcall WriteCollection(TCollection *Value);

Description

WriteCollection is used internally by the Borland C++ Builder streaming system to write component properties to a stream. Use WriteCollection for writing component properties that are collections to streams.

WriteCollection checks to ensure that Value is the correct type before calling Write to write the collection and its value type to the stream. WriteCollection bounds the collection with start-of-list and end-of- list markers.


TWriter::WriteComponent

TWriter	Methods	See also

WriteComponent writes the component specified by Component to a stream.

Syntax

void __fastcall WriteComponent(TComponent *Component);

Description

Never call WriteComponent directly. WriteComponent is recursively called for each owned component in Root.

WriteComponent sets the csWriting state in Component's ComponentState property before calling the WriteState method of Component and clears the csWriting flag when WriteState returns.

Note

The sequence of events is as follows: the writer’s WriteComponent method calls the Component’s WriteState method, which calls the writer’s WriteData method. That method writes the properties for each child component, then calls WriteComponent.

SInce the Component’s WriteState is virtual, it is the Component’s only opportunity to prepare itself to be streamed (i.e. to consolidate its data.)


TWriter::WriteDescendent

TWriter	Methods	See also

WriteDescendent is called internally to trigger the writing of descendent components in inherited forms.

Syntax

void __fastcall WriteDescendent(TComponent *Root, TComponent *AAncestor);

Description

Never call WriteDescendent directly. It is part of a sequence of calls used for streaming descendent components in inherited forms.

WriteDescendent sets the writer object's Ancestor and RootAncestor properties to the value passed in AAncestor, sets the Root property to the value passed in Root, then calls WriteSignature and WriteComponent to write Root and any components it owns to the writer object's stream.

WriteDescendent differs from WriteComponent in that, by setting Ancestor, it uses Ancestor's property values as the defaults, rather than those defined by Root's type.


TWriter::WriteFloat

TWriter	Methods	See also

WriteFloat writes the floating-point value passed in Value to the writer object's stream.

Syntax

void __fastcall WriteFloat(System::Extended Value);

Description

WriteFloat is used internally by the Borland C++ Builder streaming system to write component properties to a stream. Use WriteFloat for writing floating point data to streams.

WriteFloat checks to ensure that Value is the correct type before calling Write to write the float value and its value type to the stream.


TWriter::WriteIdent

TWriter	Methods	See also

WriteIndent writes the identifier passed in Ident to the writer object's stream.

Syntax

void __fastcall WriteIdent(const System::AnsiString Ident);

Description

WriteIdent is used internally by the Borland C++ Builder streaming system to write component properties to a stream. Use WriteIdent for writing component identifier properties to streams. Component names and enumerated type elements are examples of strings which must be restricted to Pascal identifier syntax.

WriteFloat checks to ensure that Value is the correct type before calling Write to write the identifier and its value type to the stream.


TWriter::WriteInteger

TWriter	Methods	See also

WriteInteger writes the integer value passed in Value to the writer object's stream.

Syntax

void __fastcall WriteInteger(System::Longint Value);

Description

WriteInteger is used internally by the Borland C++ Builder streaming system to write component properties to a stream. Use WriteInteger for writing component integer properties to streams.

WriteInteger checks to ensure that Value is the correct type before calling Write to write the integer value and its value type to the stream. WriteInteger handles integers of different sizes.


TWriter::WriteListBegin

TWriter	Methods	See also

WriteListBegine writes a start-of-list marker to the writer object's associated stream.

Syntax

void __fastcall WriteListBegin(void);

Description

WriteListBegin is used by other methods that iterate through a group of items about to be written to the stream. WriteListBegin writes a start-of-list marker to the writer object's associated stream. Every call to WriteListBegin must have a corresponding call to WriteListEnd.


TWriter::WriteListEnd

TWriter	Methods	See also

WriteEndList writes an end-of-list marker to the writer object's associated stream.

Syntax

void __fastcall WriteListEnd(void);

Description

WriteListEnd is used by other methods that iterate through a group of items that are sequentially written to the stream during a single process.

A call to WriteListEnd is generally preceded by a writing loop. A call to WriteListEnd must correspond to a preceeding call to WriteListBegin.


TWriter::WriteRootComponent

TWriter	Methods	See also

WriteRootComponent is provided for backward compatability only..

Syntax

void __fastcall WriteRootComponent(TComponent *Root);

Description

WriteRootComponent calls WriteDescendent.


TWriter::WriteSignature

TWriter	Methods

WriteSignature writes a Borland C++ Builder filer signature to the writer object's associated stream.

Syntax

void __fastcall WriteSignature(void);

Description

WriteSignature is used internally by several methods that write the filer signature before processing some action. For example, the WriteRootComponent method calls WriteSignature before writing its component to the stream. By checking for the signature before loading objects, reader objects can guard against inadvertantly reading invalid or corrupted data.

The filer signature is a four-character sequence. For this version of Borland C++ Builder, the signature is 'TPF0'.


TWriter::WriteStr

TWriter	Methods	See also

WriteStr writes raw data to the writer object's stream.

Syntax

void __fastcall WriteStr(const System::AnsiString Value);

Description

Do not call WriteStr directly. WriteStr is for internal use by certain VCL components. WriteStr writes the string passed in Value to the writer object's stream.

Caution

Always use WriteString for writing component strings to streams. WriteStr can corrupt data if not used correctly.


TWriter::WriteString

TWriter	Methods	See also

WriteString writes tagged data to the writer object's stream.

Syntax

void __fastcall WriteString(const System::AnsiString Value);

Description

WriteString is used internally by the Borland C++ Builder streaming system to write component properties to a stream. WriteString is otherwise only used by component writers in the DefineProperties and WriteData procedures.

WriteString writes the string passed in Value to the writer object's stream. WriteString checks to ensure that Value is the correct type before calling Write to write the string and its value type to the stream.

Caution

Always use WriteString for writing component strings to streams. The similarly-named WriteStr method is for internal use by certain VCL components and can corrupt data if not used correctly.


TWriter::TWriter

TWriter	Methods	See also

TWriter creates a new TWriter object.

Syntax

__fastcall TWriter(TStream *Stream, System::Integer BufSize);

Description

Use TWriter to create a new TWriter object.


TWriter::~TWriter

TWriter	Methods	See also

~TWriter frees the memory associated with the TWriter object.

Syntax

__fastcall virtual ~TWriter(void);

Description

Do not call ~TWriter directly. Instead, use the delete keyword on the object, which causes ~TWriter to be invoked automatically.


Hierarchy

TObject

TFiler


TWriter example

TWriter