Aller au contenu principal
Version: v20 R4 BETA

Display


Alpha Format

Alpha formats control the way the alphanumeric fields and variables appear when displayed or printed. Voici une liste des formats proposés pour les champs alphanumériques :

You can choose a format from this list or use any custom format. The default list contains formats for some of the most common alpha fields that require formats: US telephone numbers (local and long distance), Social Security numbers, and zip codes. You can also enter a custom format name set in the Filters and formats editor of the tool box. In this case, the format cannot be modified in the object properties. Any custom formats or filters that you have created are automatically available, preceded by a vertical bar (|).

The number sign (#) is the placeholder for an alphanumeric display format. You can include the appropriate dashes, hyphens, spaces, and any other punctuation marks that you want to display. You use the actual punctuation marks you want and the number sign for each character you want to display.

For example, consider a part number with a format such as "RB-1762-1".

The alpha format would be:

##-####-#

When the user enters "RB17621," the field displays:

RB-1762-1

The field actually contains "RB17621".

If the user enters more characters than the format allows, 4D displays the last characters. For example, if the format is:

(#######)

and the user enters "proportion", the field displays:

(portion)

The field actually contains "proportion". 4D accepts and stores the entire entry no matter what the display format. No information is lost.

Grammaire JSON

NomType de donnéesValeurs possibles
textFormatstring"### ####", "(###) ### ####", "### ### ####", "### ## ####", "00000", custom formats

Objets pris en charge

Drop-down List - Combo Box - List Box Column - List Box Footer


Date Format

Date formats control the way dates appear when displayed or printed. For data entry, you enter dates in the MM/DD/YYYY format, regardless of the display format you have chosen.

Unlike Alpha and Number formats, display formats for dates must only be selected among the 4D built-in formats.

The table below shows choices available:

Nom du formatChaine JSONExemple (système US)
System date shortsystemShort (default)03/25/20
System date abbreviated (1)systemMediumWed, Mar 25, 2020
System date longsystemLongWednesday, March 25, 2020
RFC 822rfc822Tue, 25 Mar 2020 22:00:00 GMT
Short CenturyshortCentury03/25/20 but 04/25/2032 (2)
Internal date longlongMarch 25, 2020
Internal date abbreviated (1)abbreviatedMar 25, 2020
Internal date shortshort03/25/2020
ISO Date Time (3)iso86012020-03-25T00:00:00

(1) Pour éviter toute ambiguïté et conformément à la pratique actuelle, les formats de date abrégés affichent "jun" pour juin et "jul" pour juillet. Cette particularité ne s'applique qu'aux versions françaises de 4D.

(2) L'année est affichée avec deux chiffres lorsqu'elle appartient à l'intervalle (1930;2029), sinon elle est affichée avec quatre chiffres. Ce modèle est par défaut mais il peut être modifié à l'aide de la commande SET DEFAULT CENTURY.

(3) Le format ISO Date Time correspond à la norme XML de représentation de la date et de l'heure (ISO8601). Il est principalement destiné à être utilisé lors de l'import/export de données au format XML et dans les services Web.

Quel que soit le format d'affichage, si l'année est saisie avec deux chiffres, 4D considère que le siècle est le 21ème si l'année appartient à l'intervalle (00;29) et le 20e si elle appartient à l'intervalle (30;99). Il s'agit du paramètre par défaut, mais il peut être modifié à l'aide de la commande SET DEFAULT CENTURY.

Grammaire JSON

NomType de donnéesValeurs possibles
dateFormatstring"systemShort", "systemMedium", "systemLong", "iso8601", "rfc822", "short", "shortCentury", "abbreviated", "long", "blankIfNull" (peut être combiné avec les autres valeurs possibles)

Objets pris en charge

Combo Box - Drop-down List - Input - List Box Column - List Box Footer


Number Format

Number fields include the Integer, Long integer, Integer 64 bits, Real and Float types.

Number formats control the way numbers appear when displayed or printed. For data entry, you enter only the numbers (including a decimal point or minus sign if necessary), regardless of the display format you have chosen.

4D provides various default number formats.

Placeholders

In each of the number display formats, the number sign (#), zero (0), caret (^), and asterisk (*) are used as placeholders. You create your own number formats by using one placeholder for each digit you expect to display.

Le placeholderEffect for leading or trailing zero
#Displays nothing
0Displays 0
^Displays a space (1)
*Displays an asterisk

(1) The caret (^) generates a space character that occupies the same width as a digit in most fonts.

For example, if you want to display three-digit numbers, you could use the format ###. If the user enters more digits than the format allows, 4D displays <<< in the field to indicate that more digits were entered than the number of digits specified in the display format.

If the user enters a negative number, the leftmost character is displayed as a minus sign (unless a negative display format has been specified). If ##0 is the format, minus 26 is displayed as –26 and minus 260 is displayed as <<< because the minus sign occupies a placeholder and there are only three placeholders.

No matter what the display format, 4D accepts and stores the number entered in the field. No information is lost.

Each placeholder character has a different effect on the display of leading or trailing zeros. A leading zero is a zero that starts a number before the decimal point; a trailing zero is a zero that ends a number after the decimal point.

Suppose you use the format ##0 to display three digits. If the user enters nothing in the field, the field displays 0. If the user enters 26, the field displays 26.

Separator characters

The numeric display formats (except for scientific notations) are automatically based on regional system parameters. 4D replaces the “.” and “,” characters by, respectively, the decimal separator and the thousand separator defined in the operating system. The period and comma are thus considered as placeholder characters, following the example of 0 or #.

On Windows, when using the decimal separator key of the numeric keypad, 4D makes a distinction depending on the type of field where the cursor is located:

  • in a Real type field, using this key will insert the decimal separator defined in the system,
  • in any other type of field, this key inserts the character associated with the key, usually a period (.) or comma (,).

Decimal points and other display characters

You can use a decimal point in a number display format. If you want the decimal to display regardless of whether the user types it in, it must be placed between zeros.

You can use any other characters in the format. When used alone, or placed before or after placeholders, the characters always appear. For example, if you use the following format:

$##0

a dollar sign always appears because it is placed before the placeholders.

If characters are placed between placeholders, they appear only if digits are displayed on both sides. For example, if you define the format:

###.##0

the point appears only if the user enters at least four digits.

Spaces are treated as characters in number display formats.

Formats for positive, negative, and zero

A number display format can have up to three parts allowing you to specify display formats for positive, negative, and zero values. You specify the three parts by separating them with semicolons as shown below:

Positive;Negative;Zero

You do not have to specify all three parts of the format. If you use just one part, 4D uses it for all numbers, placing a minus sign in front of negative numbers.

If you use two parts, 4D uses the first part for positive numbers and zero and the second part for negative numbers. If you use three parts, the first is for positive numbers, the second for negative numbers, and the third for zero.

The third part (zero) is not interpreted and does not accept replacement characters. If you enter ###;###;#, the zero value will be displayed “#”. In other words, what you actually enter is what will be displayed for the zero value.

Here is an example of a number display format that shows dollar signs and commas, places negative values in parentheses, and does not display zeros:

$###,##0.00;($###,##0.00);

Notice that the presence of the second semicolon instructs 4D to use nothing to display zero. The following format is similar except that the absence of the second semicolon instructs 4D to use the positive number format for zero:

$###,##0.00;($###,##0.00)

In this case, the display for zero would be $0.00.

Scientific notation

If you want to display numbers in scientific notation, use the ampersand (&) followed by a number to specify the number of digits you want to display. For example, the format:

&3

would display 759.62 as:

7.60e+2

The scientific notation format is the only format that will automatically round the displayed number. Note in the example above that the number is rounded up to 7.60e+2 instead of truncating to 7.59e+2.

Hexadecimal formats

You can display a number in hexadecimal using the following display formats:

  • &x: This format displays hexadecimal numbers using the “0xFFFF” format.
  • &$: This format displays hexadecimal numbers using the “$FFFF” format.

XML notation

The &xml format will make a number compliant with XML standard rules. In particular, the decimal separator character will be a period "." in all cases, regardless of the system settings.

Displaying a number as a time

You can display a number as a time (with a time format) by using &/ followed by a digit. Time is determined by calculating the number of seconds since midnight that the value represents. The digit in the format corresponds to the order in which the time format appears in the Format drop-down menu.

For example, the format:

&/5

corresponds to the 5th time format in the pop-up menu, specifically the AM/PM time. A number field with this format would display 25000 as:

6:56 AM

Exemples

The following table shows how different formats affect the display of numbers. The three columns — Positive, Negative, and Zero — each show how 1,234.50, –1,234.50, and 0 would be displayed.

Format EnteredPositiveNegativeZero
###<<<<<<
####1234<<<<
#######1234-1234
#####.##1234.5-1234.5
####0.001234.50-1234.500.00
#####01234-12340
+#####0;–#####0;0+1234-12340
#####0DB;#####0CR;01234DB1234CR0
#####0;(#####0)1234(1234)0
###,##01,234-1,2340
##,##0.001,234.50-1,234.500.00
\^\^\^\^\^\^\^1234-1234
\^\^\^\^\^\^01234-12340
\^\^\^,\^\^01,234-1,2340
\^\^,\^\^0.001,234.50-1,234.500.00
**********1234**-1234*******
******0***1234**-1234******0
***,**0**1,234*-1,234******0
**,**0.00*1,234.50-1,234.50*****0.00
$*,**0.00;–$*,**0.00$1,234.50-$1,234.50$****0.00
$\^\^\^\^0$ 1234$–1234$ 0
$\^\^\^0;–$\^\^\^0$1234–$1234$ 0
$\^\^\^0 ;($\^\^\^0)$1234($1234)$ 0
$\^,\^\^0.00 ;($\^,\^\^0.00)$1,234.50($1,234.50)$ 0.00
&21.2e+3-1.2e+30.0e+0
&51.23450e+3-1.23450e+30.00000
&xml1234.5-1234.50

Grammaire JSON

NomType de donnéesValeurs possibles
numberFormatstringNumbers (including a decimal point or minus sign if necessary)

Objets pris en charge

Combo Box - Drop-down List - Input - List Box Column - List Box Footer - Progress Indicators


Picture Format

Picture formats control how pictures appear when displayed or printed. For data entry, the user always enters pictures by pasting them from the Clipboard or by drag and drop, regardless of the display format.

The truncation and scaling options do not affect the picture itself. The contents of a Picture field are always saved. Only the display on the particular form is affected by the picture display format.

Scaled to fit

JSON grammar: "scaled"

The Scaled to fit format causes 4D to resize the picture to fit the dimensions of the area.

Truncated (centered and non-centered)

Grammaire JSON : "truncatedCenter" / "truncatedTopLeft"

The Truncated (centered) format causes 4D to center the picture in the area and crop any portion that does not fit within the area. 4D crops equally from each edge and from the top and bottom.

The Truncated (non-centered) format causes 4D to place the upper-left corner of the picture in the upper-left corner of the area and crop any portion that does not fit within the area. 4D crops from the right and bottom.

When the picture format is Truncated (non-centered), it is possible to add scroll bars to the input area.

Scaled to fit (proportional) and Scaled to fit centered (proportional)

JSON grammar: "proportionalTopLeft" / "proportionalCenter"

When you use Scaled to fit (proportional), the picture is reduced proportionally on all sides to fit the area created for the picture. The Scaled to fit centered (proportional) option does the same, but centers the picture in the picture area.

If the picture is smaller than the area set in the form, it will not be modified. If the picture is bigger than the area set in the form, it is proportionally reduced. Since it is proportionally reduced, the picture will not appear distorted.

If you have applied the Scaled to fit centered (proportional) format, the picture is also centered in the area:

Replicated

JSON grammar: "tiled"

When the area that contains a picture with the Replicated format is enlarged, the picture is not deformed but is replicated as many times as necessary in order to fill the area entirely.

If the field is reduced to a size smaller than that of the original picture, the picture is truncated (non-centered).

Grammaire JSON

NomType de donnéesValeurs possibles
pictureFormatstring"truncatedTopLeft", "scaled", "truncatedCenter", "tiled", "proportionalTopLeft", "proportionalCenter"

Objets pris en charge

Input - List Box Column - List Box Footer


Time Format

Time formats control the way times appear when displayed or printed. For data entry, you enter times in the 24-hour HH:MM:SS format or the 12-hour HH:MM:SS AM/PM format, regardless of the display format you have chosen.

Unlike Alpha and Number formats, display formats for times must only be selected among the 4D built-in formats.

The table below shows the Time field display formats and gives examples:

Nom du formatChaine JSONCommentairesExemple pour 04:30:25
HH:MM:SShh_mm_ss04:30:25
HH:MMhh_mm04:30
Hour Min SecHH_MM_SS4 heures 30 minutes 25 secondes
Hour MinHH_MM4 heures 30 minutes
HH:MM AM/PMhh_mm_am4:30 a.m.
MM SSmm_ssHeure exprimée sous forme de durée à partir de 00:00:00270:25
Min SecMM_SSHeure exprimée sous forme de durée à partir de 00:00:00270 Minutes 25 Secondes
ISO Date Timeiso8601Corresponds to the XML standard for representing time-related data. It is mainly intended to be used when importing/exporting data in XML format0000-00-00T04:30:25
System time short- (default)Standard time format defined in the system04:30:25
System time long abbreviatedsystemMediummacOS only: Abbreviated time format defined in the system.
Windows: this format is the same as the System time short format
4•30•25 AM
System time longsystemLongmacOS only: Long time format defined in the system.
Windows: this format is the same as the System time short format
4:30:25 AM HNEC

Grammaire JSON

NomType de donnéesValeurs possibles
timeFormatstring"systemShort", "systemMedium", "systemLong", "iso8601", "hh_mm_ss", "hh_mm", "hh_mm_am", "mm_ss", "HH_MM_SS", "HH_MM", "MM_SS", "blankIfNull" (can be combined with the other possible values)

Objets pris en charge

Combo Box - Drop-down List - Input - List Box Column - List Box Footer


Text when False/Text when True

When a boolean expression is displayed as:

... you can select the text to display for each value:

  • Text when True - the text to be displayed when the value is "true"
  • Text when False - the text to be displayed when the value is "false"

Grammaire JSON

NomType de donnéesValeurs possibles
booleanFormatstring"\<textWhenTrue>;\<textWhenFalse>", e.g. "Assigned;Unassigned"

Objets pris en charge

List Box Column - Input


Type d'affichage

Used to associate a display format with the column data. The formats provided depends on the variable type (array type list box) or the data/field type (selection and collection type list boxes).

Boolean and number (numeric or integer) columns can be displayed as check boxes. In this case, the Title property can be defined.

Boolean columns can also be displayed as pop-up menus. In this case, the Text when False and Text when True properties must be defined.

Grammaire JSON

NomType de donnéesValeurs possibles
controlTypestring
  • number columns: "automatic" (default) or "checkbox"
  • boolean columns: "checkbox" (default) or "popup"
  • Objets pris en charge

    Colonne de list box


    Not rendered

    When this property is enabled, the object is not drawn on the form, however it can still be activated.

    In particular, this property allows implementing "invisible" buttons. Non-rendered buttons can be placed on top of graphic objects. They remain invisible and do not highlight when clicked, however their action is triggered when they are clicked.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    affichagebooleantrue, false

    Objets pris en charge

    Button - Drop-down List


    Three-States

    Allows a check box object to accept a third state. La variable associée à la case à cocher retourne la valeur 2 lorsque celle-ci se trouve dans le troisième état.

    Three-states check boxes in list box columns

    List box columns with a numeric data type can be displayed as three-states check boxes. If chosen, the following values are displayed:

    • 0 = unchecked box,
    • 1 = checked box,
    • 2 (or any value >0) = semi-checked box (third state). For data entry, this state returns the value 2.
    • -1 = invisible check box,
    • -2 = unchecked box, not enterable,
    • -3 = checked box, not enterable,
    • -4 = semi-checked box, not enterable

    In this case as well, the Title property is also available so that the title of the check box can be entered.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    threeStatebooleantrue, false

    Objets pris en charge

    Check box - List Box Column


    Titre de menu

    This property is available for a list box column if:

    In that cases, the title of the check box can be entered using this property.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    controlTitlestringAny custom label for the check box

    Objets pris en charge

    Colonne de list box


    Truncate with ellipsis

    Controls the display of values when list box columns are too narrow to show their full contents.

    This option is available for columns with any type of contents, except pictures and objects.

    • When the property is enabled (default), if the contents of a list box cell exceed the width of the column, they are truncated and an ellipsis is displayed:

      The position of the ellipsis depends on the OS. In the above example (Windows), it is added on the right side of the text. On macOS, the ellipsis is added in the middle of the text.

    • When the property is disabled, if the contents of a cell exceed the width of the column, they are simply clipped with no ellipsis added:

    The Truncate with ellipsis option is enabled by default and can be specified with list boxes of the Array, Selection, or Collection type.

    When applied to Text type columns, the Truncate with ellipsis option is available only if the Wordwrap option is not selected. When the Wordwrap property is selected, extra contents in cells are handled through the word-wrapping features so the Truncate with ellipsis property is not available.

    The Truncate with ellipsis property can be applied to Boolean type columns; however, the result differs depending on the cell format:

    • For Pop-up type Boolean formats, labels are truncated with an ellipsis,
    • For Check box type Boolean formats, labels are always clipped.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    truncateModestring"withEllipsis", "none"

    Objets pris en charge

    List Box Column - List Box Header


    Visibilité

    This property allows hiding the object in the Application environment.

    You can handle the Visibility property for most form objects. This property is mainly used to simplify dynamic interface development. In this context, it is often necessary to hide objects programatically during the On load event of the form then to display certain objects afterwards. In this context, it is often necessary to hide objects programatically during the On load event of the form then to display certain objects afterwards. The Visibility property allows inverting this logic by making certain objects invisible by default.

    Automatic visibility in list forms

    In the context of "list" forms, the Visibility property supports two specific values:

    • If record selected (JSON name: "selectedRows")
    • If record not selected (JSON name: "unselectedRows")

    This property is only used when drawing objects located in the body of a list form. It tells 4D whether or not to draw the object depending on whether the record being processed is selected/not selected. It allows you to represent a selection of records using visual attributes other than highlight colors:

    4D does not take this property into account if the object was hidden using the OBJECT SET VISIBLE command; in this case, the object remains invisible regardless of whether or not the record is selected.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    visibilitystring"visible", "hidden", "selectedRows" (list form only), "unselectedRows" (list form only)

    Objets pris en charge

    4D View Pro area - 4D Write Pro area - Button - Button Grid - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - List Box - List Box Column - List Box Footer - List Box Header - Picture Button - Picture Pop-up Menu - Plug-in Area - Progress indicator - Radio Button - Spinner - Splitter - Static Picture - Stepper - Subform - Tab control - Text Area - Web Area


    Wordwrap

    Pour les input, disponibles lorsque la propriété Multiligne est définie sur "oui".

    Manages the display of contents when it exceeds the width of the object.

    Checked for list box/Yes for input

    JSON grammar: "normal"

    When this option is selected, text automatically wraps to the next line whenever its width exceeds that of the column/area, if the column/area height permits it.

    • In single-line columns/areas, only the last word that can be displayed entirely is displayed. 4D inserts line returns; it is possible to scroll the contents of the area by pressing the down arrow key.

    • In multiline columns/areas, 4D carries out automatic line returns.

    Unchecked for list box/No for input

    JSON grammar: "none"

    When this option is selected, 4D does not do any automatic line returns and the last word that can be displayed may be truncated. In text type areas, carriage returns are supported:

    In list boxes, any text that is too long is truncated and displayed with an ellipse (...). In the following example, the Wordwrap option is checked for the left column and unchecked for the right column:

    Note that regardless of the Wordwrap option’s value, the row height is not changed. If the text with line breaks cannot be entirely displayed in the column, it is truncated (without an ellipse). In the case of list boxes displaying just a single row, only the first line of text is displayed:

    Automatic for input (default option)

    JSON grammar: "automatic"

    • In single-line areas, words located at the end of lines are truncated and there are no line returns.
    • In multiline areas, 4D carries out automatic line returns.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    wordwrapstring"automatic" (à l'exception de list box), "normal", "none"

    Objets pris en charge

    Input - List Box Column - List Box Footer