TechTricks
Technical answers from the trenches 
 
 
 
 

     
   
Trick: Changing Properties for Multiple Objects
 
   
 Posted: 7 February 2003
 
   
 
 Applies to: Paradox 5.0 and later
 
   
 
Audience: Everyone
 
       
   

Question: Changing individual properties for multiple objects can be so tedious. Is there any way to speed this up?

Yes! Paradox provides two shortcuts that let you set properties for more than one object at a time:

  1. You can select more than one object at a time.

  2. You can use a little documented feature we call "Cascading Properties" to apply property changes to the selected object and any objects it contains.

The following sections discuss these in detail

Selecting more than one object

When you change properties in Design mode, Paradox applies your changes to all selected objects. Thus, you can select multiple objects and then change one property to affect multiple objects.

Paradox provides several shortcuts for selecting multiple objects, including

  • Holding the Shift key while dragging the mouse to "lasso" the objects you want to select. (This is sometimes called marquee selection) Remember that the lasso must completely enclose the objects you want to select.

    (Note that this is different from many visual environments, such as Delphi, when the lasso only needs to touch the target objects.)

  • Holding the Shift key and then clicking on the objects you want to select.

  • Selecting a container object, such as the page, and then choosing Edit | Select All to select the top-level objects inside the selected object.

Be aware that this technique only changes the top-level (first layer) of selected objects. For example, multiple selection will not change the font of field objects embedded in text objects unless you select those as well. The next section shows a convenient way of handling this.

Note: Older versions of Paradox display only the properties valid for the selected objects (e.g. the properties they have in common). This feature appears to have been dropped from later versions of Paradox.

Cascading property changes

Paradox supports a little documented feature we call cascading properties. When you select a container object and then press Shift+F6, Paradox displays a property sheet showing the properties of the container and all objects inside it. Property changes are only applied to appropriate objects, e.g. only the objects that support the changed property.

Trivia: This feature was originally called penetrating properties. Perhaps this explains why we prefer a different term?

To demonstrate this feature in action:

  1. Open (or quickly create) a form in Design mode. Make sure this form has multiple text and field objects.

  2. Select the page by clicking it.

  3. Press Shift+F6 and notice that Paradox displays a property sheet called "Objects in Selection Properties."

  4. Select the Font tab and make a simple change, perhaps changing the Font Style from Regular to Bold.

  5. Choose the Apply button and notice that every object with a font property on your page has been updated.

  6. If you like, experiment with additional changes. When finished, choose OK to close the property sheet.

  7. Remember to save your form to keep your changes.

Cascading property changes also work on reports, as well as multiple objects. For example, you can select a combo box and a list box, press Shift+F6, and then choose Wide Scrollbars in a single property change. Once you get used to combining multiple selection and cascading properties, you'll wonder how you could have wasted so much time changing properties for individual objects.

 

       

Top

Feedback About Paradox Delphi Assorted Web Stuff
 
 
Copyright © 2000-2004, techtricks.com; All Rights Reserved.
Acknowledgements, Disclaimers, Terms and Conditions.
Article last updated on 31 May 2003

 

Other Sites: Paradox, Delphi, Perl, Web Stuff, and More


 

[- End -]