SCROLLBAR (creation only)

Associates a horizontal and/or vertical scrollbar to the element.

Value

"VERTICAL", "HORIZONTAL", "YES" (both) or "NO" (none).

Default: "NO"

Notes

The scrollbar allows you to create a virtual space associated to the element. In the image below, such space is marked in red, as well as the attributes that affect the composition of this space. In green you can see how these attributes are reflected on the scrollbar.

images/scrollbar.gif (2113 bytes)

Hence you can clearly deduce that POSX is limited to XMIN and XMAX-DX, or  XMIN<=POSX<=XMAX-DX. When the virtual space has the same size as the canvas, DX equals XMAX-XMIN, the scrollbar can be automatically hidden. See the attribute XAUTOHIDE.

The same is valid for YMIN, YMAX, DY and POSY. But remember that the Y axis is oriented from top to bottom in IUP. So if you want to consider YMIN and YMAX as bottom-up oriented, then the actual YPOS must be obtained using YMAX-DY-POSY.

Important: the LINE*, *MAX and *MIN are only updated in the scrollbar when the respective D* is updated.

If you have to change the properties of the scrollbar (XMIN, XMAX and DX) but you want to keep the thumb still (if possible) in the same relative position, then you have to also recalculate its position (POSX) using the old position as reference to the new one. For example, you can convert it to a 0-1 interval and then scale to the new limits:

old_posx_relative = (old_posx - old_xmin)/(old_xmax - old_xmin)
posx = (xmax - xmin)*old_posx_relative + xmin

IupList and IupMultiline scrollbars are automatically managed and do NOT have the POS, MIN, MAX and D attributes.

Affects

IupList, IupMultiline, IupCanvas, POSX, XMIN, XMAX, DX, XAUTOHIDE, POSY, YMIN, YMAX, DY, YAUTOHIDE.