WidgetScroll Class
This class creates a scrollbar: horizontal or vertical one.
WidgetScroll Class
This class inherits from WidgetMembers
WidgetScroll (Gui gui, int object_size = 100, int frame_size = 10, int step = 1, int value = 0)
Constructor. Creates a scroller with the given parameters.Arguments
- Gui gui - GUI, to which the scroll bar will belong.
- int object_size - Width of the object to scroll in pixels. This is an optional argument.
- int frame_size - Width of the visible area in pixels. This is an optional argument.
- int step - Step of the scroller in pixels. This is an optional argument.
- int value - Initial position of the scroller. This is an optional argument.
int getFrameSize ()
Returns the size of the currently visible area.Return value
Size of the visible area in pixels.int getObjectSize ()
Returns the size of the whole area that is scrolled through.Return value
Size of the object being scrolled in pixels.int getOrientation ()
Returns the current orientation of the scroller: horizontal or vertical one.Return value
1 if the orientation is vertical; 0 if it is horizontal.int getStepSize ()
Returns the step of the scroller. This step is used to increment the scroll position.Return value
Step of the scroller in pixels.int getValue ()
Returns the value of the scroller, i.e. its position.Return value
Position of the scroller.void setFrameSize (int size)
Sets the size of the currently visible area.Arguments
- int size - Size of the visible area in pixels. The minimum is 1 pixel.
void setObjectSize (int size)
Sets the size of the whole area to be scrolled through.Arguments
- int size - Size of the object being scrolled in pixels. The minimum is 1 pixel.
void setOrientation (int orientation)
Sets orientation of the scroller: horizontal (by default) or vertical one.Arguments
- int orientation - 1 to set horizontal orientation; 0 to set vertical one.
void setStepSize (int step)
Sets the step of the scroller. This step is used to increment the scroll position.Arguments
- int step - Step of the scroller in pixels. The minimum is 1 pixel.
void setValue (int value)
Sets a value of the scroller, i.e. its position.Arguments
- int value - Position of the scroller. The minimum value is 0, the maximum value is the difference between the object width and the frame width.
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)