4D v13.4

Indicators

Home

 
4D v13.4
Indicators

Indicators  


 

 

Progress indicators (also called "thermometers"), rulers, and dials are objects that display a value graphically. The three objects work in the same way; they differ only in their appearance. We refer to these three objects as indicators.

You can use indicators either to display or set values. For example, if a thermometer is given a value by a method, it displays the value. If the user drags the indicator point, the value changes. The value can be used in another object such as a field or an enterable or non-enterable object.

Progress indicator / Dial / Ruler

4D provides several types of indicators which consist of three main types and their variants. To find out how to select a specific type of indicator, refer to the "Defining indicator types" section below.

Main type: Progress indicator (thermometer)

The progress bar is the default progress indicator. You can display horizontal or vertical progress bars. This is determined by the shape of the object that you draw.

Main type: Progress indicator (thermometer)

(MacOS)

(Windows)

This type of progress indicator displays a continuous animation. “Barber shop” thermometers are generally used to indicate to the user that the program is in the process of carrying out a long operation. When this variant is selected, the options of the "Scale" theme are hidden.

When the form is executed, the object is not animated. You manage the animation by passing a value to its associated variable:

  • 1 (or any value other than 0) = Start animation,
  • 0 = Stop animation.

Note: “Barber shop” thermometers only work when the appearance is set to System or Printing.

Main type: Progress indicator (thermometer)

This circular indicator also displays a continuous animation. You use this type of object to indicate that an operation such as establishing a network connection or a performing a calculation is underway. When this variant is selected, the options of the "Scale" theme are hidden.

When the form is executed, the object is not animated. You manage the animation by passing a value to its associated variable:

  • 1 (or any value other than 0) = Start animation,
  • 0 = Stop animation
Ruler  

Main type: Ruler

The ruler is a standard interface object used to set or get values using a cursor moved along its graduations. You can assign its associated variable to an enterable area (field or variable) to store or modify the current value of the object.

Main type: Ruler

Stepper associated with vStep variable.

This standard object lets the user scroll through numeric values, durations (times) or dates by predefined steps by clicking on the arrow buttons.

You can assign the variable associated with the object to an enterable area (field or variable) to store or modify the current value of the object.

A stepper can be associated directly with a number, time or date variable.

  • For values of the time type, the Minimum, Maximum and Step properties represent seconds. For example, to set a stepper from 8:00 to 18:00 with 10-minute steps:
    • Minimum = 28 800 (8*60*60)
    • Maximum = 64 800 (18*60*60)
    • Step = 600 (10*60)
  • For values of the date type, the value entered in the Step property represents days. The Minimum and Maximum properties are ignored.

Note: For the stepper to work with a time or date variable, it is imperative to set its type in the Property list AND to declare it explicitly via the C_TIME or C_DATE command.

Dial  

Main type: Dial

This type of indicator displays data in semi-circular form.

Dials, progress indicators and rulers are available using the button of the Form editor object bar. In addition, "Progress indicator" (Thermometer) and "Ruler" object types accept different variants.

  • For progress indicators, these variants are set using the Indicator type property in the "Display" theme of the Property list:
  • For rulers, these variants are set using the Display as property in the "Display" theme of the Property list:
Note: These variants can be specified using the OBJECT SET FORMAT command.

In addition to the standard positioning and appearance settings, you can set some other specific properties for indicators: minimum value, maximum value, units for the tick marks, the minimum steps permitted by the indicator as well as display options.
You can also set the display format of an indicator’s label (for more information on display formats, refer to GET LIST ITEM PARAMETER).

Several specific properties are set in the “Scale” theme of the Property List:

This property theme is displayed for Progress bar, Ruler, Numeric stepper and Dial type indicators. The properties that are available also depend on the indicator type. Here is a description of each property:

  • Minimum and Maximum: Minimum and maximum values of the indicator.
    For numeric steppers, these properties represent seconds when the object is associated with a time type value and are ignored when it is associated with a date type value.
  • Unit: Scale display unit.   
  • Step: Minimum interval accepted between values during use.
    For numeric steppers, this property represents seconds when the object is associated with a time type value and days when it is associated with a date type value.    
  • Label Location: Position of labels when they are displayed.
    • Bottom: Displays labels to the right of or below the indicator.
    • Top: Displays labels to the left of or above the indicator. 
  • Labels: Displays/Hides labels.
  • Graduation: Displays/Hides the graduations next to the labels.

When an indicator object is selected, there is an additional property in the “Action” theme of the Property List: Execute Object Method.

When this option is checked, the object method is executed with the On Data Change event at the same moment the user changes the value of the indicator. By default, the method is executed after the modification.

The variable associated with the indicator controls the display. You place values into, or use values from, the indicator using methods. For example, a method for a field or enterable object could be used to control a thermometer:

 vTherm:=[Employees]Salary

This method assigns the value of the Salary field to the vTherm variable. This method would be attached to the Salary field.

Conversely, you could use the indicator to control the value in a field. The user drags the indicator to set the value. In this case the method becomes:

 [Employees]Salary:=vTherm

The method assigns the value of the indicator to the Salary field. As the user drags the indicator, the value in the Salary field changes.

 
PROPERTIES 

Product: 4D
Theme: Working with active objects