IupDial
Definition: |
include pGUI.e
Ihandle ih = IupDial(nullable_string orientation, string attributes="", dword_seq args={}) |
Description: |
Creates a dial for regulating a given angular variable.
(Migrated from the IupControls library since IUP 3.24, it does not depend on the CD library anymore.) It inherits from IupCanvas. orientation: optional dial orientation, can be NULL. See ORIENTATION attribute. For more information on the attributes and args parameters see IupSetAttributes. Returns: the identifier of the created element. |
pwa/p2js: | Not supported |
See Also: | IupCanvas |
Notes: |
When the keyboard arrows are pressed and released the mouse press and the mouse release callbacks are called in this order. If you hold the key down the mouse move callback is also called for every repetition. When the wheel is rotated only the mouse move callback is called, and it increments the last angle the dial was rotated. In all cases the value is incremented or decremented by PI/10 (18 degrees). If you press Shift while using the arrow keys the increment is reduced to PI/100 (1.8 degrees). Press the Home key in the circular dial to reset to 0. An example can be seen in demo\pGUI\IupFlatSample.exw |
Attributes: | |
DENSITY | number of lines per pixel in the handle of the dial. Default is "0.2". |
EXPAND | the default is "NO". |
FLAT | use a 1 pixel flat border instead of the default 3 pixels sunken border. Can be Yes or No. Default: No. (since 3.24) |
FLATCOLOR | color of the border when FLAT=Yes. Default: "160 160 160". (since 3.24) |
FGCOLOR | foreground color. The default value is "64 64 64". (appears in circular dial since 3.24) |
SIZE | (non inheritable) the initial size is "16x80", "80x16" or "40x35" according to the dial orientation. Set to NULL to allow the automatic layout use smaller values. |
ORIENTATION | (creation only, non inheritable) dial layout configuration "VERTICAL", "HORIZONTAL" or "CIRCULAR". Default: "HORIZONTAL". |
UNIT | unit of the angle. Can be "DEGREES" or "RADIANS". Default is "RADIANS". Used only in the callbacks. |
VALUE |
(non inheritable) The dial angular value 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 measure absolute angles, where the origin is at 3 O’clock. |
also | ACTIVE BGCOLOR FONT, NAME, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, RASTERSIZE, ZORDER, VISIBLE: also accepted. |
Callbacks: | |
BUTTON_PRESS_CB |
Called when the user presses the left mouse button over the dial. The angle here is always zero, except for the circular dial.
function button_press_cb(Ihandle ih) ih: identifier of the element that activated the event. (atom angle removed in 1.0.2, instead use IupGetDouble(ih,"VALUE"), converting to degrees if required) |
BUTTON_RELEASE_CB |
Called when the user releases the left mouse button after pressing it over the dial.
function button_release_cb(Ihandle ih) ih: identifier of the element that activated the event. (atom angle removed in 1.0.2, instead use IupGetDouble(ih,"VALUE"), converting to degrees if required) |
MOUSEMOVE_CB |
Called each time the user moves the dial with the mouse button pressed. The angle the dial rotated since it was initialized is passed as a parameter.
function mousemove_cb(Ihandle ih) ih: identifier of the element that activated the event. (atom angle removed in 1.0.2, instead use IupGetDouble(ih,"VALUE"), converting to degrees if required) |
VALUECHANGED_CB |
Called after the value was interactively changed by the user. It is called whenever a BUTTON_PRESS_CB, a BUTTON_RELEASE_CB or a MOUSEMOVE_CB would also be called, but if defined those callbacks will not be called. function value_changed_cb(Ihandle ih) ih: identifier of the element that activated the event. |
also | MAP_CB, UNMAP_CB, DESTROY_CB, GETFOCUS_CB, KILLFOCUS_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB, K_ANY, HELP_CB: common callbacks are supported. |
Example: |
![]() |