Jump to content

Recommended Posts

The term "Clad" refers to newer change, worth only it's face value  (as opposed to a "Coin", which may be worth more than its face value)

 

Screenshot

 

Demo

 

The following code could be refactored in many ways, but it is a good demo for on how to use the Layout extensively.

It also does not use any styling other than default

 

Code

Share this post


Link to post
Share on other sites

I agree! As I stated above, I did not use any styling.  The purpose of the Demo was to show some NESTED Layouts

 

I have updated the project to include a background style and bold for the header labels.

 

I also aligned the Grand Total to center

 

Demo

 

:)

Share this post


Link to post
Share on other sites

I was trying to add persistent storage but can't seem to get it to work. What am i doing wrong?

 

 

procedure TForm1.FormActivated;
begin
 inherited;  
 Storage := TW3LocalStorage.Create;
 Storage.Open('CladView');  
end;


procedure TForm1.FormDeactivated;
begin
 inherited;
  Storage.setKeyStr('PennyQty', fPennyEdit.Text);
  Storage.setKeyStr('NickelQty', fNickelEdit.Text);
  Storage.setKeyStr('DimeQty', fDimeEdit.Text);
  Storage.setKeyStr('QuarterQty', fQuarterEdit.Text);
  Storage.setKeyStr('HalfQty', fHalfEdit.Text);
  Storage.setKeyStr('DollarQty', fDollarEdit.Text);
end;


procedure TForm1.InitializeObject;
begin
  inherited;
  {$I 'Form1:impl'}


   //edit boxes created above
   ...
   //read in stored quantities
   try
    fPennyEdit.Text:= Storage.getKeyStr('PennyQty','0');
    fNickelEdit.Value:= Storage.getKeyStr('PennyQty','0');
    fDimeEdit.Value := Storage.getKeyStr('PennyQty','0');
    fQuarterEdit.Value:= Storage.getKeyStr('PennyQty','0');
    fHalfEdit.Value := Storage.getKeyStr('PennyQty','0');
    fDollarEdit.Value := Storage.getKeyStr('PennyQty','0');
   except
    on e: exception do;
   end;
...                  );
end;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×