Skip to content

Instantly share code, notes, and snippets.

View Pasquina's full-sized avatar

Milan Vydareny Pasquina

  • Chicago, Illinois
View GitHub Profile
@Pasquina
Pasquina / TMDLBO.absCorpCreateAdapter.pas
Created March 25, 2018 19:59
LiveBindings Demo Creating the TObjectBindSourceAdapter<TCorp> (Alias CorpObjectBSWrapper)
{ 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 }
@Pasquina
Pasquina / TMDLBO.Create.pas
Created March 25, 2018 19:44
LiveBindings Demo Data Module Constructor
{ 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
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
@Pasquina
Pasquina / VertSBCalc.pas
Created August 10, 2016 17:15
A test item to undershat how this works.
{ 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