User Tools

Site Tools


17.11 Dial - Rotary Knob

The class provides a rotary knob - similar to a potentiometer. With the rotary knob you can generate numerical values (type integer) in a certain definition range [ Zmin | Zmax ].


Figure 17.11.1: Gambas rotary knob

In contrast, a rotary knob by Daniel Fuchs looks much fancier. This one not only has a neat rotary knob, but also a scale that you can label freely:


Figure 17.11.2: Rotary knob with scale (potentiometer class)

17.11.1 Properties Dial

Properties of the Dial component are described in the following table:

DialData typeDefaultDescription
MinValueInteger1Sets or returns the minimum value generated in the Dial component.
MaxValueInteger100Sets the maximum value that is generated in the Dial component or returns this value.
StepInteger1Changes the value of the generated integer (→ Dial.Value) by the value of Step when you press a cursor key as long as the Dial component has the focus.
PageStepInteger10Changes the value of the generated integer (→ Dial.Value) by the value of PageStep when you press the Page_Up or Page_Down key as long as the Dial component has the focus. Use the Pos1 and End keys to reach the preset values for .MinValue and .MaxValue. A repeat function is built in.
ValueInteger-Sets the knob value or returns the generated integer.
MarkBooleanFalseThe value True specifies that a dash scale (without labels!) is displayed or returns the current scale mode.
WrapBooleanFalseThe value True specifies that the pointer wraps to the minimum value after reaching the maximum value or returns the current wrap mode.

Table Dial properties

17.11.2 Event Dial

The Dial component has only one specific event:

  • Change - The event is triggered every time the value of the dial changes.

In Chapter 17.10.2 a project is presented that converts the generated values of a rotary knob into real numbers (type Float) and displays them in the components LCDNumber as well as LCDLabel.




The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k17/k17.11/start.txt · Last modified: 01.10.2023 by emma

Page Tools