This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ This event does 2 things: 1) it obtains the initial value of the Bottom Bound | |
by checking for a current saved value of zero, and 2) it sets the Bottom Bound | |
value if the current saved value is non-zero. The current saved value has been | |
set to zero when the form was created, or to some integer value when the user | |
has clicked the SBB button. } | |
procedure TfVertScrollDemo.VertScrollBox1CalcContentBounds( | |
Sender: TObject; | |
var ContentBounds: TRectF); | |
begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TfVKLogger.FormKeyDown( | |
Sender: TObject; | |
var Key: Word; | |
var KeyChar: Char; | |
Shift: TShiftState); | |
begin | |
if Key = vkReturn then // if Return pressed | |
begin | |
Key := vkTab; // change the key to a Tab (causes navigation) | |
KeyDown(Key, KeyChar, Shift); // execute the form's keydown to effect navigation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ The overridden constructor for the data module first creates the data objects that are | |
displayed by the view. This is done by creating the TCorp object which will cascade | |
through the TBranch and TEmployee objects to create the entire data tree. It is important | |
that the data objects be created BEFORE the data module (this form's) objects because the | |
OnCreate event for the TAdapterBindSource objects will need the data objects to function | |
properly. This is accomplished by creating TCorp FIRST, and then calling the inherited Create. | |
The inherited Create will actually create the objects in this TDataModule. } | |
constructor TMDLBO.Create(AOwner: TComponent); | |
begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ When the Adapter Bind Source for the Corp is created, this event handler creates the | |
necessary CorpBSWrapper and passes it back to the Bind Source Adapter } | |
procedure TMDLBO.absCorpCreateAdapter( | |
Sender: TObject; | |
var ABindSourceAdapter: TBindSourceAdapter); | |
begin | |
{ Begin by creating the CorpWrapper and saving it in the current form } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ These Type Aliases accomplish two things: | |
1. They eliminate the need to key the cumbersome generic notation every time the type is used | |
2. They provide meaningful names in place of confusing names used by Live Bindings } | |
CorpObjectBSWrapper = TObjectBindSourceAdapter<TCorp>; // the corporate object wrapper | |
BranchListBSWrapper = TListBindSourceAdapter<TBranch>; // the branch object list wrapper | |
EmployeeListBSWrapper = TListBindSourceAdapter<TEmployee>; // the employee object list wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ When the Branch list changes, either because of a scroll, or add or delete, this routine adjusts the | |
Employee list to display the appropriate employees } | |
procedure TMDLBO.AfterBranchScroll(ABindSourceAdapter: TBindSourceAdapter); | |
var | |
LBranch: TBranch; // currently displayed Branch | |
begin | |
{ A series of casts extracts the current TBranch object being displayed } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ When the Adapter Bind Source for Branches is created, this event handler creates the | |
necessry BranchListBSWrapper and passes it back to the Bind Source Adapter. } | |
procedure TMDLBO.absBranchesCreateAdapter( | |
Sender: TObject; | |
var ABindSourceAdapter: TBindSourceAdapter); | |
begin | |
{ Begin by creating the BranchWrapper and saving it in the current form } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TVLBO.FormCreate(Sender: TObject); | |
begin | |
MDLBO := TMDLBO.MDLBOGet; | |
end; | |
procedure TVLBO.FormDestroy(Sender: TObject); | |
begin | |
MDLBO.Free; | |
end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program AutoFreeTest; | |
{$APPTYPE CONSOLE} | |
{$R *.res} | |
uses | |
System.SysUtils, | |
System.Classes; | |
type | |
IAutoFree = interface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PGUID = ^TGUID; | |
TGUID = record | |
D1: Cardinal; | |
D2: Word; | |
D3: Word; | |
D4: array[0..7] of Byte; | |
end; |
OlderNewer