IUP-Go Documentation 4.0

IupGauge

Creates a Gauge control. Shows a percent value that can be updated to simulate a progression. It inherits from IupCanvas.

Initialization and Usage

The IupControlsOpen function must be called after IupOpen. The "iupctrl.h" file must also be included in the source code. The program must be linked to the controls library (iupctrl).

Creation

Ihandle* IupGauge(void);

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

Attributes

BACKCOLOR (non-inheritable): color of the background inside the borders. Can be NULL. When NULL it follows the parent background color tinted towards FGCOLOR.

CANFOCUS: enables the focus traversal of the control. Default: NO. (different from IupCanvas)

INACTIVEOPACITY: when set to a value between 1 and 254, an inactive control is drawn with its active colors and that opacity (0-255) over the parent background, instead of the inactive colors. Default: NULL.

CIRCULAR (non-inheritable): when "YES", the gauge is drawn as a ring filled clockwise from the top, with the text at its center. ORIENTATION, FLAT and CORNERRADIUS are ignored. Default: "NO". When set before mapping to a control that is not square, RASTERSIZE is changed to "48x48".

RINGWIDTH (non-inheritable): line width of the ring when CIRCULAR=YES. Default: "0" (1/8 of the ring diameter).

CORNERRADIUS (non-inheritable): radius of the rounded corners for the border, background and filled area. Default: "0" (no rounding).

DASHED: Changes the style of the gauge for a dashed pattern. Default: "NO".

FGCOLOR: Controls the gauge and text color. Default: "0 120 220".

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".

MAX (non-inheritable): Contains the maximum value. Default: "1".

MIN (non-inheritable): Contains the minimum value. Default: "0".

ORIENTATION (creation-only): can be "VERTICAL" or "HORIZONTAL". Default: "HORIZONTAL". Horizontal goes from left to right, and vertical from bottom to top. Width and height are swapped when orientation is set.

PADDING: internal margin. Works just like the MARGIN attribute of the IupHbox and IupVbox containers, but uses a different name to avoid inheritance problems. Default value: "0x0".

CPADDING: same as PADDING but using the units of the SIZE attribute. It will actually set the PADDING attribute.

SHOWTEXT: Indicates if the text inside the Gauge is to be shown or not. If the gauge is dashed the text is never shown. Possible values: "YES" or "NO". Default: "YES".

SIZE (non-inheritable): The initial size is "120x14". Set to NULL to allow the automatic layout to use smaller values.

TEXT (non-inheritable): Contains a text to be shown inside the Gauge when SHOWTEXT=YES. If it is NULL, the percentage calculated from VALUE will be used. If the gauge is dashed the text is never shown. When ORIENTATION=VERTICAL text is drawn in 90ยบ.

VALUE (non-inheritable): Contains a number between "MIN" and "MAX", controlling the current position.


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

Callbacks

MAP_CB, UNMAP_CB, DESTROY_CB: common callbacks are supported.

Examples

Browse for Example Files

iupgauge.png
The Two Types of Gauge

See Also

IupCanvas, IupProgressBar