virtual.gadget Reference¶
Comprehensive function reference for virtual.gadget, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/virtual).
This page documents 4 functions of virtual.gadget. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.
Function index¶
virtual.gadget()¶
**virtual.gadget -- a gadget for easy creation of GUI virtuals.
SUPERCLASS
gadgetclass
DESCRIPTION
virtual.gadget allows you to use groups that are much larger than
the screen. The gadget acts as a window through which a rectangle
area of its contents is visible.
METHODS
GM_DOMAIN
GM_RENDER
GM_LAYOUT
DTM_PROCLAYOUT
OM_SET
OM_UPDATE
OM_NEW
OM_DISPOSE
All other methods are passed to the layout.object passed in via
VIRTUALA_Contents.
ATTRIBUTES
VIRTUALA_Contents (Object *)
The gadget (probably a layout.gadget) to be displayed within
the virtual.gadget. OM_SETing this attribute disposes the
current contents of the gadget (if any).
See also VIRTUALA_NoDispose.
Applicability is (OM_NEW, OM_SET)
VIRTUALA_NoDispose (BOOL)
By setting this attribute, you inform the virtual object that
this child object should not be automatically disposed when
the virtual object itself is disposed. This attribute allows
sharing objects between layouts.
Default is FALSE.
Applicability is (OM_NEW, OM_SET)
VIRTUALA_Scroller (BOOL)
By clearing this attribute, you inform the virtual object that
you don't want the vertical and horizontal scrollbar to be
displayed.
Default is TRUE.
Applicability is (OM_NEW, OM_SET)
VIRTUALA_ScrollX (WORD)
VIRTUALA_ScrollY (WORD)
Scroll the contents of the gadget either horizontally or
vertically by the given amount of pixels. It's not possible
to scroll the contents out of the view. Setting the attribute
OM_NOTIFies the VIRTUALA_TopX, VIRTUALA_TopY tags.
Applicability is (OM_NEW, OM_SET, OM_UPDATE, [OM_NOTIFY])
VIRTUALA_TotalX (UWORD)
VIRTUALA_TotalY (UWORD)
The current/actual size of the object's contents.
Applicability is (OM_GET, OM_NOTIFY)
VIRTUALA_VisibleX (UWORD)
VIRTUALA_VisibleY (UWORD)
Get the visible portion of the contents.
Applicability is (OM_GET, OM_NOTIFY)
VIRTUALA_TopX (UWORD)
VIRTUALA_TopY (UWORD)
Set/Get the current top value of the contents.
Applicability is (OM_SET, OM_UDPATE, OM_GET, OM_NOTIFY)
VIRTUALA_ScrollerX (Object *)
VIRTUALA_ScrollerY (Object *)
Instead of letting the gadget to allocate the scrollers,
you can provide your own ones by using the tags above.
virtual.gadget doesn't change their size and position.
Applicability is (OM_NEW)
VIRTUALA_InputScroll (BOOL)
By clearing this attribute, you inform the virtual object that
you don't want the contents to be scrolled when the user moves
the pointer out of the gadget while holding down the left
mouse button.
Default is TRUE.
Applicability is (OM_NEW, OM_SET)**
See also
layout.gadget/--datasheet--
Bugs
virtual.gadget needs at least AmigaOS3.9 + BoingBag#1 (V45 classes).
RefreshVirtualGadget()¶
RefreshVirtualGadget -- Refresh gadget in a virtual layout
Synopsis
RefreshVirtualGadget(gad, virtual, win, req)
A0 A1 A2 A3
void RefreshVirtualGadget(struct Gadget *, Object *,
struct Window *, struct Requester *)
Function
Like DoGadgetMethodA( gad, win, req, gpRender ), but ensures
that proper clipping information is installed before invoking
GM_RENDER.
Inputs
gad = the gadget wanting refreshment.
virtual = the virtual.gadget object containing the gadget.
win = pointer to the window containing the gadget or its requester.
req = pointer to a requester (ignored if gadget is not attached
to a requester).
Results
NONE
RethinkVirtualSize()¶
RethinkVirtualSize -- Calculate the size of virtual group based on the screen resolution.
Synopsis
RethinkVirtualSize(virtual, rootlayout, font, screen, layoutlimits)
A0 A1 A2 A3 D0
BOOL RethinkVirtualSize(Object *, Object *, struct TextFont *,
struct Screen *, struct LayoutLimits *)
Function
This function is used to calculate the intial size of a layout
group that contains a virtual.gadget (and ONLY one!). Simply
call this function BEFORE you open the window:
RethinkVirtualSize(virtual, rootlayout, NULL, screen, &ll);
This ensures that the visible portion of the virtual group will
be as large as possible. Next open the window and set the window
limits to values that were returned by the function in the
LayoutLimits structure you've passed in:
WindowLimits( mywin, ll.MinWidth, ll.MinHeight,
ll.MaxWidth, ll.MaxHeight );
Last but not least, set the new minimum size for the virtual.gadget,
so that the user can resize the group:
SetAttrs( layoutgroup_containg_virtual,
LAYOUT_ModifyChild, virtual,
CHILD_MinWidth, 64,
CHILD_MinHeight, 48,
TAG_DONE );
Inputs
virtual = the virtual.gadget.
rootlayout = the root layout.gadget of the window.
font = optional pointer to the font used by the layout. May be NULL.
screen = pointer to the screen where the window will be opened.
layoutlimits = optional pointer holding the actual minimum and
maximum dimension of the window.
Results
If anything went wrong, this function returns FALSE (out of memory,
NULL screen pointer, ...).
Bugs
The function may become obsolete in a later release of ReAction.
VIRTUAL_GetClass()¶
VIRTUAL_GetClass -- Gets the pointer to the virtual class.
Synopsis
virtual_class = VIRTUAL_GetClass();
D0
Class * VIRTUAL_GetClass(VOID);
Function
Obtains the pointer to the virtual gadget class for use with
NewObject(). This function always returns a valid pointer so
you do not need to check it. The reason is that if the library
opens fine, then the pointer returned is already setup. (Of course
this implies that if opening the library fails, you shouldn't be
calling this.)
Note that this function does not create the class, that is done
when the class library is opened.
Inputs
Nothing.
RESULT
virtual_class - Pointer to the virtual gadget class.