TABLE OF CONTENTS virtual.gadget/--datasheet-- virtual.gadget/RefreshVirtualGadget virtual.gadget/RethinkVirtualSize virtual.gadget/VIRTUAL_GetClass virtual.gadget/--datasheet-- virtual.gadget/--datasheet-- NAME virtual.gadget -- Gadget for easy creation of GUI virtuals. SUPERCLASS gadgetclass REQUIRES sysiclass, icclass, bevel.image, scroller.gadget DESCRIPTION virtual.gadget allows you to use groups that are much larger than the visible screen. The gadget acts as a window through which a rectangle area of its contents is visible. METHODS OM_NEW -- Passed to superclass, defaults set then OM_SET. OM_DISPOSE -- Frees resources and passed to superclass. OM_SET -- Passed to superclass then sets attributes. OM_UPDATE -- Passed to superclass then updates attributes. OM_GET -- Gets attribute then passed to superclass. GM_GOACTIVE -- Activates gadget then sets VIRTUALA_Contents object flags. GM_HANDLEINPUT -- Handles gadget and VIRTUALA_Contents events. GM_GOINACTIVE -- Deactivates gadget. GM_RENDER -- Renders gadget and passed to VIRTUALA_Contents object. GM_DOMAIN -- Returns GDOMAIN_MINIMUM, GDOMAIN_NOMINAL and GDOMAIN_MAXIMUM dimensions. GM_LAYOUT -- Calculate relative gadget coordinates and determine limits of VIRTUALA_Contents object. GM_HITTEST -- Always returns GMR_GADGETHIT. GM_HELPTEST -- Determines if gadget help was hit and passed on to VIRTUALA_Contents object. GM_CLIPRECT -- Installs ClipRect for virtual group support. GM_EXTENT -- Reports gadget rendering extent. DTM_PROCLAYOUT -- Like GM_LAYOUT but passes DTM_PROCLAYOUT forward. All other methods are passed to the VIRTUALA_Contents object. ATTRIBUTES ICA_TARGET (uint32) Setting this attribute will also cause an OM_NOTIFY to be generated by the gadget. See icclass autodoc. Applicability is (OM_NEW, OM_SET, OM_GET) GA_ID (uint16) Unique ID number for the gadget. Defaults to 0. Applicability is (OM_NEW, OM_SET, OM_GET, OM_UPDATE, OM_NOTIFY) GA_BackFill (struct Hook *) Gets the current layer backfill hook. Applicability is (OM_GET) GA_Disabled (BOOL) Used to disable the gadget and render a disabled image. Passed on to the VIRTUALA_Contents object. Applicability is (OM_NEW, OM_SET, OM_UPDATE) GA_ReadOnly (BOOL) Sets the gadget to read-only or not. Passed on to the VIRTUALA_Contents object. Defaults to FALSE. Applicability is (OM_NEW, OM_SET, OM_UPDATE) GA_TextAttr (struct TextAttr *) Used to set the gadget's text font. Passed on to the VIRTUALA_Contents object. Defaults to RPort->Font, which is often the screen or window font. Applicability is (OM_NEW, OM_SET, OM_GET) LAYOUT_Parent (Object *) Sets and gets the LAYOUT_Parent attribute of the VIRTUALA_Contents object. See layout.gadget autodoc. Applicability is (OM_SET, OM_GET) LAYOUT_DeferLayout (BOOL) Handles the LAYOUT_DeferLayout of the VIRTUALA_Contents object. See layout.gadget autodoc. Applicability is (OM_NEW, OM_SET, OM_GET) LAYOUT_BackFill (struct Hook *) A layer backfill hook to use in the group to provide a more complex background pattern. Passed on to the VIRTUALA_Contents object. See layout.gadget autodoc. Applicability is (OM_NEW, OM_SET) VIRTUALA_Contents (Object *) The gadget (usually a layout.gadget) to be displayed within the virtual.gadget. Setting (OM_SET) 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 scrollbars to be displayed. Default is TRUE. Applicability is (OM_NEW, OM_SET) VIRTUALA_ScrollX (int16) VIRTUALA_ScrollY (int16) 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 notifies (OM_NOTIFY) the VIRTUALA_TopX and VIRTUALA_TopY tags. Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_NOTIFY) VIRTUALA_TotalX (uint16) VIRTUALA_TotalY (uint16) The current/actual size of the object's contents. Applicability is (OM_GET, OM_NOTIFY) VIRTUALA_VisibleX (uint16) VIRTUALA_VisibleY (uint16) Get the visible portion of the contents. Applicability is (OM_GET, OM_NOTIFY) VIRTUALA_TopX (uint16) VIRTUALA_TopY (uint16) Set or 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 by using the tags above. Note that 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) VIRTUALA_TargetX (Object *) (V51) VIRTUALA_TargetY (Object *) (V51) These two attributes allow you to pass distinct notification targets for horizontal and vertical movements, which would otherwise require your application to build a framework of icclass/modelclass objects. An example of suitable targets would be the border scrollers of a window.class object. These attributes and their mappings (see below) may be used alongside the traditional ICA_TARGET/ICA_MAP mechanism. Default is NULL (no targets). Applicability is (OM_NEW, OM_SET) VIRTUALA_MapX (struct TagItem *) (V51) VIRTUALA_MapY (struct TagItem *) (V51) You can use these two attributes to specify the appropriate attribute mappings to be used when sending notifications to the targets set with VIRTUALA_TargetX and VIRTUALA_TargetY. These mappings are not used for the ICA_TARGET object, use ICA_MAP for that. Default is NULL (no mapping). Applicability is (OM_NEW, OM_SET) SEE ALSO layout.gadget virtual.gadget/RefreshVirtualGadget virtual.gadget/RefreshVirtualGadget NAME RefreshVirtualGadget -- Refresh gadget in a virtual layout. SYNOPSIS void RefreshVirtualGadget(struct Gadget *gad, Object *virtual, struct Window *win, struct Requester *req); FUNCTION Like DoGadgetMethodA(gad, win, req, gpRender) but ensures that proper clipping information is installed before invoking GM_RENDER. INPUTS gad - the gadget wanting refreshing virtual - virtual.gadget object containing the gadget win - pointer to the Window containing the Gadget req - pointer to a requester SEE ALSO intuition.library/DoGadgetMethodA() virtual.gadget/RethinkVirtualSize virtual.gadget/RethinkVirtualSize NAME RethinkVirtualSize -- Calculate size of virtual group. SYNOPSIS BOOL RethinkVirtualSize(Object *virtual, Object *rootlayout, struct TextFont *font, struct Screen *screen, struct LayoutLimits *limits); FUNCTION This function is used to calculate the initial size of a layout group that contains a single virtual.gadget. Only one virtual.gadget can be present. 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(win, ll.MinWidth, ll.MinHeight, ll.MaxWidth, ll.MaxHeight); Finally, set the new minimum size for the virtual.gadget so that the user can resize the group: SetAttrs(layoutgroup_containing_virtual, LAYOUT_ModifyChild, virtual, CHILD_MinWidth, 64, CHILD_MinHeight, 48, TAG_DONE); INPUTS virtual - the virtual.gadget rootlayout - 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 limits - optional pointer holding the actual minimum and maximum dimension of the window RESULTS Returns TRUE if successful or FALSE on error. virtual.gadget/VIRTUAL_GetClass virtual.gadget/VIRTUAL_GetClass NAME VIRTUAL_GetClass -- Gets pointer to the virtual class. SYNOPSIS Class * class = VIRTUAL_GetClass(); FUNCTION This function is deprecated as of V52. Use the "virtual.gadget" public class ID instead. RESULT class - Pointer to the virtual class.