Agar

<-- Back to AG_Intro.3

SYNOPSIS

#include <agar/core.h>
#include <agar/gui.h>

DESCRIPTION

The AG_Scrollview widget is a simple container which allows its child widgets to exceed its own size. It provides the user with AG_Scrollbar(3) controls to pan the view.

INHERITANCE HIERARCHY

AG_Object(3)-> AG_Widget(3)-> AG_Scrollview.

INITIALIZATION


AG_Scrollview * AG_ScrollviewNew (AG_Widget *parent, Uint flags)

void AG_ScrollviewSizeHint (AG_Scrollview *sv, Uint width, Uint height)

void AG_ScrollviewSetIncrement (AG_Scrollview *sv, int increment)


The AG_ScrollviewNew() function allocates, initializes, and attaches a new AG_Scrollview widget. Acceptable flags include:
AG_SCROLLVIEW_PAN_LEFTPannable with left mouse button.
AG_SCROLLVIEW_PAN_RIGHTPannable with right mouse button.
AG_SCROLLVIEW_NOPAN_XDisable horizontal pan.
AG_SCROLLVIEW_NOPAN_YDisable vertical pan.
AG_SCROLLVIEW_NOPAN_XYSame as AG_SCROLLVIEW_NOPAN_X and AG_SCROLLVIEW_NOPAN_Y.
AG_SCROLLVIEW_BY_MOUSEPanning with cursor is permitted (may interfere with child widgets).
AG_SCROLLVIEW_FRAMEDecorative background and frame.
AG_SCROLLVIEW_HFILLExpand horizontally in parent container.
AG_SCROLLVIEW_VFILLExpand vertically in parent container.
AG_SCROLLVIEW_EXPANDShorthand for AG_SCROLLVIEW_HFILL AG_SCROLLVIEW_VFILL|.

The AG_ScrollviewSizeHint() function requests an initial widget size for the AG_Scrollview in pixels.

AG_ScrollviewSetIncrement() sets the increment for scrolling the view, in pixels.

EVENTS

The AG_Scrollview widget does not generate any event.

STRUCTURE DATA

For the AG_Scrollview object:
int xOffs, yOffs Display offset in pixels (controlled by scrollbars).
int xMin, yMin Upper left display boundary (read-only).
int xMax, yMax Lower right display boundary (read-only).
AG_Scrollbar *hbar Pointer to horizontal scrollbar (or NULL).
AG_Scrollbar *vbar Pointer to vertical scrollbar (or NULL).

SEE ALSO

AG_Intro(3), AG_Scrollbar(3), AG_Widget(3), AG_Window(3)

HISTORY

The AG_Scrollview widget first appeared in Agar 1.3.3.
Csoft.net ElectronTubeStore