IUP-Go Documentation 4.0

IupDial

Creates a dial for regulating a given angular variable. It inherits from IupCanvas.

Creation

Ihandle* IupDial(const char *orientation);

orientation: optional dial orientation, can be NULL. See ORIENTATION attribute.

Returns: the identifier of the created element, or NULL if an error occurs.

Attributes

DENSITY: number of lines per pixel in the handle of the dial. Default: "0.2".

EXPAND: Default: "NO".

FLAT: use a 1 pixel flat border instead of a 3-pixel sunken border. Can be YES or NO. Default: "YES".

FLATCOLOR: color of the border when FLAT=YES. Default: "160 160 160".

FGCOLOR: foreground color. Default: "64 64 64".

SIZE (non-inheritable): the initial size is "16x80", "80x16" or "40x36" according to the dial orientation. Set to NULL to allow the automatic layout to use smaller values.

ORIENTATION (creation-only) (non-inheritable): dial layout configuration "VERTICAL", "HORIZONTAL" or "CIRCULAR". Default: "HORIZONTAL". Vertical increments when moved up, and decrements when moved down. Horizontal increments when moved right, and decrements when moved left. Circular increments when moved counterclockwise, and decrements when moved clockwise.

VALUE (non-inheritable): The dial angular value always in radians. The value is reset to zero when the interaction is started, except for ORIENTATION=CIRCULAR. When orientation is vertical or horizontal, the dial measures relative angles. When orientation is circular, the dial measures absolute angles, where the origin is at 3 O'clock.


ACTIVE, BGCOLOR, FONT, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, RASTERSIZE, ZORDER, VISIBLE, THEME: also accepted.

Callbacks

VALUECHANGED_CB: Called after the value was interactively changed by the user.

int function(Ihandle *ih);

ih: identifier of the element that activated the event.


MAP_CB, UNMAP_CB, DESTROY_CB, GETFOCUS_CB, KILLFOCUS_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB, K_ANY, HELP_CB: All common callbacks are supported.

Notes

When the keyboard arrows are pressed and released, VALUECHANGED_CB is called for the press and for the release. While the key is held down, VALUECHANGED_CB is also called for every repetition.

When the wheel is rotated, VALUECHANGED_CB is called, and the wheel increments the last angle the dial was rotated.

In all cases, the value is incremented or decremented by PI/10 (18 degrees).

With Shift pressed while using the arrow keys, the increment is reduced to PI/100 (1.8 degrees). The Home key resets the circular dial to 0.

Examples

Browse for Example Files

See Also

IupCanvas