Class TRkAddress (unit RkAddr)

Inherits from

TWinControl

Constructors


constructor Create( AOwner : TComponent );

========================} {== TRkAddress Methods ==} {========================


Functions

destructor Destroy;

= TRkAddress.

procedure Change( Field : TEditField; Text : string );


procedure CreateWnd;


procedure PositionControls;


procedure Resize;


procedure CMFontChanged( var Msg : TMessage );


function CreateCombo : TDBComboBox;

Assign OnChange event of each Edit field to point to TRkAddress.

function CreateEdit : TDBEdit;


function CreateLabel( ACaption : TCaption ) : TLabel;

No need to destroy the embedded components, because the inherited destructor will destroy all components on the Components list.

procedure CreateStateList;

When CreateWnd is called, the Items list of FCbxState is cleared.

procedure DoChange( Sender : TObject );

========================================================================= TRkAddress.

function GetCaption( Index : Integer ) : TCaption;


function GetCharCase : TEditCharCase;

Change event for all edit fields

function GetDataSource : TDataSource;


function GetField( Index : Integer ) : string;

Assign All Internal Controls to Same DataSource

function GetFieldColor : TColor;


function GetFontHeight( Font : TFont ) : Integer;


procedure SetCaption( Index : Integer; Value : TCaption );


procedure SetCharCase( Value : TEditCharCase );


procedure SetDataSource( Value : TDataSource );

Use FEdtFirstName to get current DataSource

procedure SetField( Index : Integer; Value : string );


procedure SetFieldColor( Value : TColor );


procedure SetLabelPosition( Value : TLabelPosition );

= TRkAddress.

procedure SetStateList( Value : TStrings );

= TRkAddress.

procedure WMSize( var Msg : TWMSize );


Properties

property About : TRkAboutInfo


property CharCase : TEditCharCase


property CityCaption : TCaption


property CityField : string


property DataSource : TDataSource


property FieldColor : TColor


property FirstNameCaption : TCaption


property FirstNameField : string


property Font :


property LabelPosition : TLabelPosition


property LastNameCaption : TCaption


property LastNameField : string


property ParentFont :


property StateCaption : TCaption


property StateField : string


property StateList : TStrings


property StreetCaption : TCaption


property StreetField : string


property ZIPCaption : TCaption


property ZIPField : string


property EdtFirstName : TDBEdit


Events

event OnChange : TEditChangeEvent


Variables

FAboutInfo : TRkAboutInfo;


FCbxState : TDBComboBox;


FEdtCity : TDBEdit;


FEdtFirstName : TDBEdit;


FEdtLastName : TDBEdit;


FEdtStreet : TDBEdit;


FEdtZIP : TDBEdit;


FLabelPosition : TLabelPosition;

Defaults to a list of state abbreviations

FLblCity : TLabel;


FLblFirstName : TLabel;


FLblLastName : TLabel;


FLblState : TLabel;


FLblStreet : TLabel;


FLblZIP : TLabel;


FOnChange : TEditChangeEvent;


FStateList : TStrings;



Constructors


constructor Create( AOwner : TComponent );

========================} {== TRkAddress Methods ==} {========================


Functions


destructor Destroy;

= TRkAddress.Create =


procedure Change( Field : TEditField; Text : string );


procedure CreateWnd;


procedure PositionControls;


procedure Resize;


procedure CMFontChanged( var Msg : TMessage );


function CreateCombo : TDBComboBox;

Assign OnChange event of each Edit field to point to TRkAddress.DoChange method


function CreateEdit : TDBEdit;


function CreateLabel( ACaption : TCaption ) : TLabel;

No need to destroy the embedded components, because the inherited destructor will destroy all components on the Components list. FStateList is not on that list, so we need to destroy it here.


procedure CreateStateList;

When CreateWnd is called, the Items list of FCbxState is cleared. Therefore, the contents of the FStateList are copied back into FCbxState. Plus, you cannot add items to a ComboBox until its Parent's window handle has been allocated. Therefore, this code also serves to initially populate the ComboBox with state names.


procedure DoChange( Sender : TObject );

========================================================================= TRkAddress.DoChange This method gets called if the OnChange event occurs for any of the edit fields contained in this component. The Change event dispatch method is called to surface those events to the user. =========================================================================


function GetCaption( Index : Integer ) : TCaption;


function GetCharCase : TEditCharCase;

Change event for all edit fields


function GetDataSource : TDataSource;


function GetField( Index : Integer ) : string;

Assign All Internal Controls to Same DataSource


function GetFieldColor : TColor;


function GetFontHeight( Font : TFont ) : Integer;


procedure SetCaption( Index : Integer; Value : TCaption );


procedure SetCharCase( Value : TEditCharCase );


procedure SetDataSource( Value : TDataSource );

Use FEdtFirstName to get current DataSource


procedure SetField( Index : Integer; Value : string );


procedure SetFieldColor( Value : TColor );


procedure SetLabelPosition( Value : TLabelPosition );

= TRkAddress.PositionControls =


procedure SetStateList( Value : TStrings );

= TRkAddress.CreateStateList =


procedure WMSize( var Msg : TWMSize );


Properties


property About : TRkAboutInfo


property CharCase : TEditCharCase


property CityCaption : TCaption


property CityField : string


property DataSource : TDataSource


property FieldColor : TColor


property FirstNameCaption : TCaption


property FirstNameField : string


property Font :


property LabelPosition : TLabelPosition


property LastNameCaption : TCaption


property LastNameField : string


property ParentFont :


property StateCaption : TCaption


property StateField : string


property StateList : TStrings


property StreetCaption : TCaption


property StreetField : string


property ZIPCaption : TCaption


property ZIPField : string


property EdtFirstName : TDBEdit


Events


event OnChange : TEditChangeEvent


Variables


FAboutInfo : TRkAboutInfo;


FCbxState : TDBComboBox;


FEdtCity : TDBEdit;


FEdtFirstName : TDBEdit;


FEdtLastName : TDBEdit;


FEdtStreet : TDBEdit;


FEdtZIP : TDBEdit;


FLabelPosition : TLabelPosition;

Defaults to a list of state abbreviations


FLblCity : TLabel;


FLblFirstName : TLabel;


FLblLastName : TLabel;


FLblState : TLabel;


FLblStreet : TLabel;


FLblZIP : TLabel;


FOnChange : TEditChangeEvent;


FStateList : TStrings;