4D v16

Object properties

Home

 
4D v16
Object properties

Object properties    


 

 

In addition to the manipulations explained in the video, you should also note that:

Forms also have their own properties and methods.

You may be tempted to put your code in either of these methods (object or form), but how do you know which one is best?

What counts is that the code is run when it is needed, so either method could do the job. At first, don't spend too much time worrying about optimizing every detail.

However, it is important to remember the order in which methods are executed when an event occurs:

  1. Object methods are executed first (in the order of the object depth = layer level = entry order)
  2. After all object methods are run, then the form method takes back over and is run itself.

By default (for questions of optimization and ease of maintenance), we recommend that you deselect all the object and form events that don't have any programming associated with them and only check the ones that you actually need or that do have associated programming.

If you have structured your programming by testing the events that you use but also leaving other events checked as well, the method is loaded and run each time one of the checked events occurs even if it's an event that you haven't programmed, so you may be calling the method repeatedly for no reason.

Now we're going to learn how to manage object properties.

Each object has a certain number of properties. Some are specific to the object itself and other are shared for all objects in general.
When you select more than one object, only their shared properties appear:

  • the type
  • the name
  • the coordinates
  • resizing
  • and so on.

Changing any of these properties will affect all the selected objects.

When no particular object is selected, the form properties are displayed.

Properties are grouped by themes and can be displayed as a whole or theme by theme.

To open and close all the types, hold down the Ctrl key and click a type.

When the list of events is displayed, holding down Ctrl (or Command on Mac) when you click on a box in the list will select or deselect them all at once.

To get started right away:
When you create a form, let's take the Interventions Input form as an example, all the Field type objects, by default, have a certain number of events selected.

Since we know that we're not planning on programming these objects, we can start off by deselecting all of the events.

This simple operation is very useful when you are converting former databases (from earlier versions of 4D).

Now we're going to test a few object properties (for details about each object and their properties, refer to the 4D documentation).

Let's take an object where we set the vertical resizing property to "Grow" and duplicate it, with this one having only vertical movement and no horizontal movement.

Now let's execute the form. We see that both the objects move according to the constraints that were set:

  • No lateral movement for the small rectangle: vertical movement only.
  • And the bigger one grows larger.

As far as properties are concerned, we've also set certain properties on the navigation form. There we set up picture buttons where the picture changes whenever you move the mouse over it or click it.

 
 

 
PROPERTIES 

Product: 4D
Theme: Object properties

 
HISTORY 

 
ARTICLE USAGE

Self-training ( 4D v16)