main logo
Subject: Re: [dabo-dev] how to set a property for all controls
Author: johnf
Posted: 2007/01/31 12:10:49
 
View Entire Thread
New Search


On Wednesday 31 January 2007 03:46, Ed Leafe wrote:
> On Jan 31, 2007, at 3:48 AM, johnf wrote:
> > I'd like to be able to set a property (enabled) to true or false
> > for all the
> > data controls on my form. Is there an easy way to do so?
>
> Aw, c'mon - that should have been obvious to a VFP developer!! ;-)
>
> This is defined in dPemMixin, so all controls have it available.
> This means you can use it with pages, panels, grids, or any other
> container:
>
> def setAll(self, prop, val, recurse=True, filt=None):
> """Set all child object properties to the passed value.
>
> No bad effects will happen if the property doesn't apply to a child
> - only
> children with the property will have their property updated.
>
> If 'recurse' is True, setAll() will be called on each child as well.
>
> If 'filt' is not empty, only children that match the expression in
> 'filt'
> will be affected. The expression will be evaluated assuming the child
> object is prefixed to the expression. For example, if you want to only
> affect objects that are instances of dButton, you'd call:
>
> form.setAll("FontBold", True, filt="BaseClass == dabo.ui.dButton")
> """
>
>
> -- Ed Leafe
> -- http://leafe.com
> -- http://dabodev.com
I guess at 12:45AM I'm not very sharp. But I did try to use setAll could not
get it to work properly - all I want is for the pages to disable and
associated data entry controls. At moment I think I see my error. But
thanks.

--
John Fabiani


 
©2007 johnf
<-- Prior Message New Search Next Message -->