@database "virtual_gc" @master "AMIDEV:NDK/Autodocs/virtual_gc.doc" @Node Main "virtual_gc.doc" @toc "Autodocs/AG/INDEX/Main" @{" --datasheet--() " Link "--datasheet--()"} @{" RefreshVirtualGadget() " Link "RefreshVirtualGadget()"} @{" RethinkVirtualSize() " Link "RethinkVirtualSize()"} @{" VIRTUAL_GetClass() " Link "VIRTUAL_GetClass()"} @EndNode @Node "--datasheet--()" "virtual_gc/--datasheet--" @{b} NAME@{ub} virtual.gadget -- a gadget for easy creation of GUI virtuals. @{b} SUPERCLASS@{ub} gadgetclass @{b} DESCRIPTION@{ub} 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. @{b} METHODS@{ub} GM_DOMAIN @{"GM_RENDER" Link "tabs_gc/GM_RENDER"} @{"GM_LAYOUT" Link "tabs_gc/GM_LAYOUT"} DTM_PROCLAYOUT @{"OM_SET" Link "tabs_gc/OM_SET"} OM_UPDATE @{"OM_NEW" Link "tabs_gc/OM_NEW"} OM_DISPOSE All other methods are passed to the layout.object passed in via VIRTUALA_Contents. @{b} ATTRIBUTES@{ub} 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" Link "tabs_gc/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" Link "tabs_gc/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) @{b} BUGS@{ub} virtual.gadget needs at least AmigaOS3.9 + BoingBag#1 (V45 classes). @{b} SEE ALSO@{ub} layout.gadget/--datasheet-- @EndNode @Node "RefreshVirtualGadget()" "virtual_gc/RefreshVirtualGadget" @{b} NAME@{ub} RefreshVirtualGadget -- Refresh gadget in a virtual layout @{b} SYNOPSIS@{ub} RefreshVirtualGadget(gad, virtual, win, req) A0 A1 A2 A3 void RefreshVirtualGadget(struct @{"Gadget" Link "INCLUDE:intuition/intuition.h/Main" 212} *, @{"Object" Link "INCLUDE:intuition/classusr.h/Main" 18} *, struct @{"Window" Link "INCLUDE:intuition/intuition.h/Main" 942} *, struct @{"Requester" Link "INCLUDE:intuition/intuition.h/Main" 142} *) @{b} FUNCTION@{ub} Like DoGadgetMethodA( gad, win, req, @{"gpRender" Link "INCLUDE:intuition/gadgetclass.h/Main" 411} ), but ensures that proper clipping information is installed before invoking @{"GM_RENDER" Link "tabs_gc/GM_RENDER"}. @{b} INPUTS@{ub} 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). @{b} RESULTS@{ub} NONE @EndNode @Node "RethinkVirtualSize()" "virtual_gc/RethinkVirtualSize" @{b} NAME@{ub} RethinkVirtualSize -- Calculate the size of virtual group based on the screen resolution. @{b} SYNOPSIS@{ub} RethinkVirtualSize(virtual, rootlayout, font, screen, layoutlimits) A0 A1 A2 A3 D0 @{"BOOL" Link "INCLUDE:exec/types.h/Main" 168} RethinkVirtualSize(Object *, @{"Object" Link "INCLUDE:intuition/classusr.h/Main" 18} *, struct @{"TextFont" Link "INCLUDE:graphics/text.h/Main" 87} *, struct @{"Screen" Link "INCLUDE:intuition/screens.h/Main" 139} *, struct @{"LayoutLimits" Link "layout_gc/LayoutLimits()"} *) @{b} FUNCTION@{ub} 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" Link "rexxsupport/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" Link "layout_gc/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 ); @{b} INPUTS@{ub} 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" Link "rexxsupport/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. @{b} RESULTS@{ub} If anything went wrong, this function returns FALSE (out of memory, @{"NULL" Link "rexxsupport/NULL"} screen pointer, ...). @{b} BUGS@{ub} The function may become obsolete in a later release of ReAction. @EndNode @Node "VIRTUAL_GetClass()" "virtual_gc/VIRTUAL_GetClass" @{b} NAME@{ub} VIRTUAL_GetClass -- Gets the pointer to the virtual class. @{b} SYNOPSIS@{ub} virtual_class = VIRTUAL_GetClass(); D0 Class * VIRTUAL_GetClass(VOID); @{b} FUNCTION@{ub} Obtains the pointer to the virtual gadget class for use with @{"NewObject()" Link "intuition/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. @{b} INPUTS@{ub} Nothing. @{b} RESULT@{ub} virtual_class - Pointer to the virtual gadget class. @EndNode