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_NOPAN_XDisable panning over X.
AG_SCROLLVIEW_NOPAN_YDisable panning over Y.
AG_SCROLLVIEW_NOPAN_XYAlias for AG_SCROLLVIEW_NOPAN_X and AG_SCROLLVIEW_NOPAN_Y.
AG_SCROLLVIEW_BY_MOUSEPanning with cursor is permitted (may interfere with the operation of child widgets).
AG_SCROLLVIEW_FRAMEDraw background and frame.
AG_SCROLLVIEW_HFILLExpand horizontally in parent (equivalent to invoking AG_ExpandHoriz(3)).
AG_SCROLLVIEW_VFILLExpand vertically in parent (equivalent to invoking AG_ExpandVert(3)).
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.com