4D v16.3

Object Properties

Home

 
4D v16.3
Object Properties

Object Properties  


 

 

The Object Properties commands act on the properties of objects present in forms. They enable you to change the appearance and behavior of the objects while using the forms to display records and in the Application environment.

Important: The scope of these commands is the form currently being used; changes disappear when you exit the form.

The object property commands share the same generic syntax described here:

COMMAND NAME({*;} object { ; additional parameters specific to each command )

If you specify the optional * parameter, you indicate an object name (a string) in object.

You can use the @ character within that name if you want to address several objects of the form in one call. The following table shows examples of object names you can specify to this command.

Object NamesObjects affected by the call
mainGroupBoxOnly the object mainGroupBox.
main@The objects whose name starts with “main”.
@GroupBoxThe objects whose name ends with “GroupBox”.
@Group@The objects whose name contains “Group”.
main@BtnThe objects whose name starts with “main” and ends with “Btn”.
@All the objects present in the form.

Form object names can contain up 255 bytes, allowing you to define and apply custom naming rules, such as "xxxx_Button" or "xxx_Mac".

Note: You can configure the way the @ character is interpreted when it is included in a character string. This option affects the functioning of the commands in the "Objects (Forms)" theme. For more information, refer to the 4D Design Reference manual.

If you omit the optional * parameter, you indicate a field or a variable in object. In this case, you specify a field or variable reference (field or variable objects only) instead of a string.

Starting with 4D v14, a new way of interacting has been defined between generic commands such as OBJECT SET RGB COLORS or OBJECT SET FONT STYLE and multi-style text areas.

In previous versions of 4D, executing one of these commands modified the contents of any custom style tags inserted in the area. From now on, only default properties are affected by these commands (as well as any properties saved by means of default tags). Custom style tags remain as they are. 

For example, given a multi-style area where default tags were saved:

The plain text of the area is as follows:

<span style="text-align:left;font-family:'Segoe UI';font-size:9pt;color:#009900">This is the word <span style="color:#D81E05">red</span></span>

If you execute the following code:

 OBJECT SET COLOR(*;"myArea";-(Blue+(256*Yellow)))

With 4D v14, the red color remains:

4D v14 and higherprior versions
<span style="text-align:left;font-family:'Segoe UI';font-size:9pt;color:#0000FF">This is the word <span style="color:#D81E05">red</span></span>
<span style="font-family:'Segoe UI';font-size:9pt;text-align:left;font-weight:normal;font-style:normal;text-decoration:none;color:#0000FF;"><span style="background-color:#FFFFFF">This is the word red</span></span>

The following generic commands are concerned:

OBJECT SET RGB COLORS
OBJECT SET COLOR
OBJECT SET FONT
OBJECT SET FONT STYLE
OBJECT SET FONT SIZE

In the context of multi-style areas, generic commands should be used to set default styles only. To manage styles during database execution, we recommend using the commands of the "Styled Text" theme.



See also 

Focus object
Managing List Box Objects
OBJECT SET SCROLL POSITION

 
PROPERTIES 

Product: 4D
Theme: Objects (Forms)

 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)