main logo
Subject: Re: [dabo-users] Backgroundcolor of a form
Author: "Nate Lowrie"
Posted: 2008/01/31 12:38:09
 
View Entire Thread
New Search


On Jan 31, 2008 10:33 AM, Ed Leafe <ed .at. leafe DO.T com> wrote:
> On Jan 31, 2008, at 11:22 AM, Paul McNett wrote:
>
> > This function will be
> > evaluated at the proper time by Dabo to dynamically determine the
> > value
> > of the property.
>
> "At the proper time" == update()
>
> Let's say you have a form displaying your Customers. It would be cool
> if the form's Caption reflected the currently-selected customer, so to
> do this you would write:
>
> def afterInit(self):
> self.DynamicCaption = self.getCurrentCustomer
>
> def getCurrentCustomer(self):
> return "Editing: %s" % self.PrimaryBizobj.Record.cust_name
>
> Now as you navigate or requery, selecting a record fires the update()
> method, causing all controls to display the current record's values,
> and will also update the form's Caption property with the value
> returned by getCurrentCustomer().
>
> Other common uses are DynamicEnabled/DynamicVisible that are tied to
> permissions; DynamicBack/ForeColor to highlight items that need
> attention or to display a visual status cue; DynamicHeight/Width/Left/
> Right to control sizing/positioning of an object to reflect some other
> status/condition; ...

The dLed widget is nothing more than a dPanel with drawfunctions that
have dynamic properties set. It is a good example of using Dynamic
properties. You can find it in dLed.py

Nate L.



 
©2008 Nate Lowrie
<-- Prior Message New Search Next Message -->