home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD2.1 / Text_Autodocs / gadtools.doc < prev    next >
Encoding:
Text File  |  1992-09-11  |  34.2 KB  |  1,080 lines

  1. TABLE OF CONTENTS
  2.  
  3. gadtools.library/CreateContext
  4. gadtools.library/CreateGadgetA
  5. gadtools.library/CreateMenusA
  6. gadtools.library/DrawBevelBoxA
  7. gadtools.library/FreeGadgets
  8. gadtools.library/FreeMenus
  9. gadtools.library/FreeVisualInfo
  10. gadtools.library/GetVisualInfoA
  11. gadtools.library/GT_BeginRefresh
  12. gadtools.library/GT_EndRefresh
  13. gadtools.library/GT_FilterIMsg
  14. gadtools.library/GT_GetIMsg
  15. gadtools.library/GT_PostFilterIMsg
  16. gadtools.library/GT_RefreshWindow
  17. gadtools.library/GT_ReplyIMsg
  18. gadtools.library/GT_SetGadgetAttrsA
  19. gadtools.library/LayoutMenuItemsA
  20. gadtools.library/LayoutMenusA
  21. gadtools.library/CreateContext                 gadtools.library/CreateContext
  22.  
  23.    NAME
  24.     CreateContext -- Create a place for GadTools context data. (V36)
  25.  
  26.    SYNOPSIS
  27.     gad = CreateContext(glistpointer);
  28.     D0                  A0
  29.  
  30.     struct Gadget *CreateContext(struct Gadget **);
  31.  
  32.    FUNCTION
  33.     Creates a place for GadTools to store any context data it might
  34.     need for your window.  In reality, an unselectable invisible
  35.     gadget is created, with room for the context data.
  36.     This function also establishes the linkage from a glist type
  37.     pointer to the individual gadget pointers.  Call this function
  38.     before any of the other gadget creation calls.
  39.  
  40.    INPUTS
  41.     glistptr - Address of a pointer to a Gadget, which was previously
  42.         set to NULL.  When all the gadget creation is done, you may
  43.         use that pointer as your NewWindow.FirstGadget, or
  44.         in intuition.library/AddGList(), intuition.library/RefreshGList(),
  45.         FreeGadgets(), etc.
  46.  
  47.    RESULT
  48.     gad - Pointer to context gadget, or NULL if failure.
  49.  
  50.    EXAMPLE
  51.  
  52.     struct Gadget *gad;
  53.     struct Gadget *glist = NULL;
  54.     gad = CreateContext(&glist);
  55.     /*  Other creation calls go here */
  56.     if (gad)
  57.     {
  58.         myNewWindow.FirstGadget = glist;
  59.         if ( myWindow = OpenWindow(&myNewWindow) )
  60.         {
  61.         GT_RefreshWindow(win);
  62.         /* other stuff */
  63.         CloseWindow(myWindow);
  64.         }
  65.     }
  66.     FreeGadgets(glist);
  67.  
  68.    NOTES
  69.  
  70.    BUGS
  71.  
  72.    SEE ALSO
  73.  
  74. gadtools.library/CreateGadgetA                 gadtools.library/CreateGadgetA
  75.  
  76.    NAME
  77.     CreateGadgetA -- Allocate and initialize a gadtools gadget. (V36)
  78.     CreateGadget -- Varargs stub for CreateGadgetA(). (V36)
  79.  
  80.    SYNOPSIS
  81.     gad = CreateGadgetA(kind, previous, newgad, taglist)
  82.     D0                  D0    A0        A1      A2
  83.     
  84.     struct Gadget *CreateGadgetA(ULONG, struct Gadget *,
  85.         struct NewGadget *, struct TagItem *);
  86.  
  87.     gad = CreateGadget(kind, previous, newgad, firsttag, ...)
  88.     
  89.     struct Gadget *CreateGadget(ULONG, struct Gadget *,
  90.         struct NewGadget *, Tag, ...);
  91.  
  92.    FUNCTION
  93.     CreateGadgetA() allocates and initializes a new gadget of the
  94.     specified kind, and attaches it to the previous gadget.  The
  95.     gadget is created based on the supplied kind, NewGadget structure,
  96.     and tags.
  97.  
  98.    INPUTS
  99.     kind - to indicate what kind of gadget is to be created.
  100.     previous - pointer to the previous gadget that this new gadget
  101.         is to be attached to.
  102.     newgad - a filled in NewGadget structure describing the desired
  103.         gadget's size, position, label, etc.
  104.     taglist - pointer to a TagItem list.
  105.  
  106.    TAGS
  107.     All kinds:
  108.     GT_Underscore (GadTools V37 and higher only).
  109.         Indicates the symbol that precedes the character in the gadget
  110.         label to be underscored.  This would be to indicate keyboard
  111.         equivalents for gadgets (note that GadTools does not process
  112.         the keys - it just displays the underscore).
  113.         Example: To underscore the "M" in "Mode"...
  114.         ng.ng_GadgetText = "_Mode:";
  115.         gad = CreateGadget(..._KIND, &ng, prev,
  116.             GT_Underscore, '_',
  117.             ...
  118.             );
  119.  
  120.     BUTTON_KIND (action buttons):
  121.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  122.         (defaults to FALSE).
  123.  
  124.     CHECKBOX_KIND (on/off items):
  125.     GTCB_Checked (BOOL) - Initial state of checkbox, defaults to FALSE.
  126.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  127.         (defaults to FALSE).
  128.  
  129.     CYCLE_KIND (multiple state selections):
  130.     GTCY_Labels (STRPTR *) - Pointer to NULL-terminated array of strings
  131.         that are the choices offered by the cycle gadget (required).
  132.     GTCY_Active (UWORD) - The ordinal number (counting from zero) of
  133.         the initially active choice of a cycle gadget (defaults to zero).
  134.     GA_Disabled (BOOL) - (GadTools V37 and higher only)
  135.         Set to TRUE to disable gadget, FALSE otherwise
  136.         (defaults to FALSE).
  137.  
  138.     INTEGER_KIND (numeric entry):
  139.     GTIN_Number (ULONG) - The initial contents of the integer gadget
  140.         (default zero).
  141.     GTIN_MaxChars (UWORD) - The maximum number of digits that the
  142.         integer gadget is to hold (defaults to 10).
  143.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  144.         (defaults to FALSE).
  145.     STRINGA_ExitHelp (BOOL) - (New for V37) Set to TRUE to have the
  146.         help-key cause an exit from the integer gadget.  You will
  147.         then receive a GADGETUP with code = 0x5F (rawkey for help).
  148.     GA_TabCycle (BOOL) - (New for V37) Set to TRUE so that pressing
  149.         <TAB> or <Shift-TAB> will activate the next or previous
  150.         such gadget. (defaults to TRUE, unlike regular Intuition string
  151.         gadgets, which default to FALSE).
  152.  
  153.     LISTVIEW_KIND (scrolling list):
  154.     GTLV_Top (UWORD) - Top item visible in the listview (defaults to zero).
  155.     GTLV_Labels (struct List *) - List of labels whose ln_Name fields
  156.         are to be displayed in the listview.
  157.     GTLV_ReadOnly (BOOL) - If TRUE, then listview is read-only.
  158.     GTLV_ScrollWidth (UWORD) - Width of scroll bar for listview.
  159.         Must be greater than zero (defaults to 16).
  160.     GTLV_ShowSelected (struct Gadget *) - NULL to have the currently
  161.         selected item displayed beneath the listview, or pointer to
  162.         an already-created GadTools STRING_KIND gadget to have an
  163.         editable display of the currently selected item.
  164.     GTLV_Selected (UWORD) - Ordinal number of currently selected
  165.         item, or ~0 to have no current selection (defaults to ~0).
  166.     LAYOUTA_Spacing - Extra space to place between lines of listview
  167.         (defaults to zero).
  168.  
  169.     MX_KIND (mutually exclusive, radio buttons):
  170.     GTMX_Labels (STRPTR *) - Pointer to a NULL-terminated array of
  171.         strings which are to be the labels beside each choice in a
  172.         set of mutually exclusive gadgets.
  173.     GTMX_Active (UWORD) - The ordinal number (counting from zero) of
  174.         the initially active choice of an mx gadget (Defaults to zero).
  175.     GTMX_Spacing (UWORD) - The amount of space between each choice
  176.         of a set of mutually exclusive gadgets.  This amount is added
  177.         to the font height to produce the vertical shift between
  178.         choices. (defaults to one).
  179.     LAYOUTA_Spacing - FOR COMPATIBILITY ONLY.  Use GTMX_Spacing instead.
  180.         The number of extra pixels to insert between
  181.         each choice of a mutually exclusive gadget.  This is added
  182.         to the present gadget image height (9) to produce the
  183.         true spacing between choices.  (defaults to 
  184.         FontHeight-8, which is zero for 8-point font users).
  185.  
  186.     NUMBER_KIND (read-only numeric):
  187.     GTNM_Number - A signed long integer to be displayed as a read-only
  188.          number (default 0).
  189.     GTNM_Border (BOOL) - If TRUE, this flag asks for a recessed
  190.         border to be placed around the gadget.
  191.  
  192.     PALETTE_KIND (color selection):
  193.     GTPA_Depth (UWORD) - Number of bitplanes in the palette
  194.         (defaults to 1).
  195.     GTPA_Color (UBYTE) - Initially selected color of the palette
  196.         (defaults to 1).
  197.     GTPA_ColorOffset (UBYTE) - First color to use in palette
  198.         (defaults to zero).
  199.     GTPA_IndicatorWidth (UWORD) - The desired width of the current-color
  200.         indicator, if you want one to the left of the palette.
  201.     GTPA_IndicatorHeight (UWORD) - The desired height of the current-color
  202.         indicator, if you want one above the palette.
  203.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  204.         (defaults to FALSE).
  205.  
  206.     SCROLLER_KIND (for scrolling through areas or lists):
  207.     GTSC_Top (WORD) - Top visible in area scroller represents
  208.         (defaults to zero).
  209.     GTSC_Total (WORD) - Total in area scroller represents
  210.         (defaults to zero).
  211.     GTSC_Visible (WORD) - Number visible in scroller (defaults to 2).
  212.     GTSC_Arrows (UWORD) - Asks for arrows to be attached to the scroller.
  213.         The value supplied will be taken as the width of each arrow button
  214.         for a horizontal scroller, or the height of each button for a
  215.         vertical scroller (the other dimension will match the whole
  216.         scroller).
  217.     PGA_Freedom - Whether scroller is horizontal or vertical.
  218.         Choose LORIENT_VERT or LORIENT_HORIZ (defaults to horiz).
  219.     GA_Immediate (BOOL) - Hear every IDCMP_GADGETDOWN event from scroller
  220.         (defaults to FALSE).
  221.     GA_RelVerify (BOOL) - Hear every IDCMP_GADGETUP event from scroller
  222.         (defaults to FALSE).
  223.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  224.         (defaults to FALSE).
  225.  
  226.     SLIDER_KIND (to indicate level or intensity):
  227.     GTSL_Min (WORD) - Minimum level for slider (default 0).
  228.     GTSL_Max (WORD) - Maximum level for slider (default 15).
  229.     GTSL_Level (WORD) - Current level of slider (default 0).
  230.     GTSL_MaxLevelLen (UWORD) - Max. length in characters of level string
  231.         when rendered beside slider.
  232.     GTSL_LevelFormat (STRPTR) - C-Style formatting string for slider
  233.         level.  Be sure to use the 'l' (long) modifier.  This string
  234.         is processed using exec/RawDoFmt(), so refer to that function
  235.         for details.
  236.     GTSL_LevelPlace - One of PLACETEXT_LEFT, PLACETEXT_RIGHT,
  237.         PLACETEXT_ABOVE, or PLACETEXT_BELOW, indicating where the level
  238.         indicator is to go relative to slider (default to PLACETEXT_LEFT).
  239.     GTSL_DispFunc ( LONG (*function)(struct Gadget *, WORD) ) - Function
  240.         to calculate level to be displayed.  A number-of-colors slider
  241.         might want to set the slider up to think depth, and have a
  242.         (1 << n) function here.  Defaults to none.  Your function must
  243.         take a pointer to gadget as the first parameter, the level
  244.         (a WORD) as the second, and return the result as a LONG.
  245.     GA_Immediate (BOOL) - If you want to hear each slider IDCMP_GADGETDOWN
  246.         event.
  247.     GA_RelVerify (BOOL) - If you want to hear each slider IDCMP_GADGETUP
  248.         event.
  249.     PGA_Freedom - Set to LORIENT_VERT or LORIENT_HORIZ to have a
  250.         vertical or horizontal slider.
  251.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  252.         (defaults to FALSE).
  253.  
  254.     STRING_KIND (text-entry):
  255.     GTST_String (STRPTR) - The initial contents of the string gadget,
  256.          or NULL (default) if string is to start empty.
  257.     GTST_MaxChars (UWORD) - The maximum number of characters that the
  258.         string gadget is to hold.
  259.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  260.         (defaults to FALSE).
  261.     STRINGA_ExitHelp (BOOL) - (New for V37) Set to TRUE to have the
  262.         help-key cause an exit from the string gadget.  You will
  263.         then receive a GADGETUP with code = 0x5F (rawkey for help).
  264.     GA_TabCycle (BOOL) - (New for V37) Set to TRUE so that pressing
  265.         <TAB> or <Shift-TAB> will activate the next or previous
  266.         such gadget. (defaults to TRUE, unlike regular Intuition string
  267.         gadgets, which default to FALSE).
  268.  
  269.     TEXT_KIND (read-only text):
  270.     GTTX_Text - Pointer to a NULL terminated string to be displayed,
  271.         as a read-only text-display gadget, or NULL. defaults to NULL.
  272.     GTTX_CopyText (BOOL) -    This flag instructs the text-display gadget
  273.         to copy the supplied text string, instead of using only 
  274.         pointer to the string.  This only works for the initial value
  275.         of GTTX_Text set at CreateGadget() time.  If you subsequently
  276.         change GTTX_Text, the new text will be referenced by pointer,
  277.         not copied.  Do not use this tag with a NULL GTTX_Text.
  278.     GTTX_Border (BOOL) - If TRUE, this flag asks for a recessed
  279.         border to be placed around the gadget.
  280.  
  281.  
  282.    RESULT
  283.     gad - pointer to the new gadget, or NULL if the allocation failed
  284.         or if previous was NULL.
  285.  
  286.    EXAMPLE
  287.  
  288.    NOTES
  289.     Note that the ng_VisualInfo and ng_TextAttr fields of the
  290.     NewGadget structure must be set to valid VisualInfo and
  291.     TextAttr pointers, or this function will fail.
  292.  
  293.     Starting with V37, string and integer gadgets have the GFLG_TABCYCLE
  294.     feature automatically.  If the user presses Tab or Shift-Tab while
  295.     in a string or integer gadget, the next or previous one in
  296.     sequence will be activated.  You will hear a GADGETUP with a code
  297.     of 0x09.  Use {GA_TabCycle, FALSE} to supress this.
  298.     
  299.  
  300.    BUGS
  301.  
  302.    SEE ALSO
  303.     FreeGadgets(), GT_SetGadgetAttrs(), GetVisualInfo().
  304.  
  305. gadtools.library/CreateMenusA                   gadtools.library/CreateMenusA
  306.  
  307.    NAME
  308.     CreateMenusA -- Allocate and fill out a menu structure. (V36)
  309.     CreateMenus -- Varargs stub for CreateMenus(). (V36)
  310.  
  311.    SYNOPSIS
  312.     menu = CreateMenusA(newmenu, taglist)
  313.     D0                  A0       A1
  314.  
  315.     struct Menu *CreateMenusA(struct NewMenu *, struct TagItem *);
  316.  
  317.     menu = CreateMenus(newmenu, firsttag, ...)
  318.  
  319.     struct Menu *CreateMenus(struct NewMenu *, Tag, ...);
  320.  
  321.    FUNCTION
  322.     CreateMenusA() allocates and initializes a complete menu
  323.     structure based on the supplied array of NewMenu structures.
  324.     Optionally, CreateMenusA() can allocate and initialize a complete
  325.     set of menu items and sub-items for a single menu title.  This
  326.     is dictated by the contents of the array of NewMenus.
  327.  
  328.    INPUTS
  329.     newmenu - Pointer to an array of initialized struct NewMenus.
  330.     taglist - Pointer to a TagItem list.
  331.  
  332.    TAGS
  333.     GTMN_FrontPen (UBYTE) - Pen number to be used for menu text.
  334.         (defaults to zero).
  335.     GTMN_FullMenu (BOOL) - (GadTools V37 and higher only)
  336.         Requires that the NewMenu specification describes a complete
  337.         menu strip, not a fragment.  If a fragment is found,
  338.         CreateMenusA() will fail with a secondary error of
  339.         GTMENU_INVALID.  (defaults to FALSE).
  340.     GTMN_SecondaryError (ULONG *) - (GadTools V37 and higher only)
  341.         Supply a pointer to a NULL-initialized ULONG to receive a
  342.         descriptive error code.  Possible values:
  343.         GTMENU_INVALID - NewMenu structure describes an illegal
  344.             menu.  (CreateMenusA() will fail with a NULL result).
  345.         GTMENU_TRIMMED - NewMenu structure has too many menus, items,
  346.             or subitems (CreateMenusA() will succeed, returning a
  347.             trimmed-down menu structure).
  348.         GTMENU_NOMEM - CreateMenusA() ran out of memory.
  349.  
  350.    RESULT
  351.     menu - Pointer to the resulting initialized menu structure (or
  352.         the resulting FirstItem), with all the links for menu items
  353.         and subitems in place.
  354.         The result will be NULL if CreateMenusA() could not allocate
  355.         memory for the menus, or if the NewMenu array had an
  356.         illegal arrangement (eg. NM_SUB following NM_TITLE).
  357.         (see also the GTMN_SecondaryError tag above).
  358.  
  359.    EXAMPLE
  360.  
  361.    NOTES
  362.     The strings you supply for menu text are not copied, and must
  363.     be preserved for the life of the menu.
  364.     The resulting menus have no positional information.  You will
  365.     want to call LayoutMenusA() (or LayoutMenuItemsA()) to supply that.
  366.     CreateMenusA() automatically provides you with a UserData field
  367.     for each menu, menu-item or sub-item.  Use the GTMENU_USERDATA(menu)
  368.     or GTMENUITEM_USERDATA(menuitem) macro to access it.
  369.  
  370.    BUGS
  371.     At present, if you put images into menus using IM_ITEM
  372.     or IM_SUB for a NewMenu->Type, the image you supply must
  373.     be an ordinary struct Image.  You may not use a 'custom
  374.     image' (eg. one obtained from a boopsi image-class).
  375.  
  376.    SEE ALSO
  377.     LayoutMenusA(), FreeMenus(), gadtools.h/GTMENU_USERDATA(),
  378.     gadtools.h/GTMENUITEM_USERDATA()
  379.  
  380. gadtools.library/DrawBevelBoxA                 gadtools.library/DrawBevelBoxA
  381.  
  382.    NAME
  383.     DrawBevelBoxA -- Draws a bevelled box. (V36)
  384.     DrawBevelBox -- Varargs stub for DrawBevelBox(). (V36)
  385.  
  386.    SYNOPSIS
  387.     DrawBevelBoxA(rport, left, top, width, height, taglist)
  388.                   A0     D0    D1   D2     D3      A1
  389.  
  390.     VOID DrawBevelBoxA(struct RastPort *, WORD, WORD, WORD, WORD,
  391.         struct TagItem *taglist);
  392.  
  393.     DrawBevelBox(rport, left, top, width, height, firsttag, ...)
  394.  
  395.     VOID DrawBevelBox(struct RastPort *, WORD, WORD, WORD, WORD,
  396.         Tag, ...);
  397.  
  398.    FUNCTION
  399.     DrawBevelBoxA() renders a bevelled box of specified dimensions
  400.     into the supplied RastPort.
  401.  
  402.    INPUTS
  403.     rport - The RastPort into which the box is to be drawn.
  404.     left - The left edge of the box.
  405.     top - The top edge of the box.
  406.     width - The width of the box.
  407.     height - The height of the box.
  408.     taglist - Pointer to a TagItem list.
  409.  
  410.    TAGS
  411.     GTBB_Recessed (BOOL):  Set to anything for a recessed-looking box.
  412.         If absent, the box defaults, it would be raised.
  413.     GT_VisualInfo (APTR):  You MUST supply the value you obtained
  414.         from an earlier call to GetVisualInfoA().
  415.  
  416.    RESULT
  417.     None.
  418.  
  419.    EXAMPLE
  420.  
  421.    NOTES
  422.     DrawBevelBox() is a rendering operation, not a gadget.  That
  423.     means you must refresh it at the appropriate time, like any
  424.     other rendering operation.
  425.  
  426.    BUGS
  427.  
  428.    SEE ALSO
  429.     GetVisualInfoA()
  430.  
  431. gadtools.library/FreeGadgets                     gadtools.library/FreeGadgets
  432.  
  433.    NAME
  434.     FreeGadgets -- Free a linked list of gadgets. (V36)
  435.  
  436.    SYNOPSIS
  437.     FreeGadgets(glist)
  438.                 A0
  439.  
  440.     VOID FreeGadgets(struct Gadget *glist);
  441.                      A0
  442.  
  443.    FUNCTION
  444.     Frees any GadTools gadgets found on the linked list of gadgets
  445.     beginning with the specified one.  Frees all the memory that was
  446.     allocated by CreateGadgetA().  This function will return safely
  447.     with no action if it receives a NULL parameter.
  448.  
  449.    INPUTS
  450.     glist - pointer to first gadget in list to be freed.
  451.  
  452.    RESULT
  453.     none
  454.  
  455.    EXAMPLE
  456.  
  457.    NOTES
  458.  
  459.    BUGS
  460.  
  461.    SEE ALSO
  462.     CreateGadgetA()
  463.  
  464. gadtools.library/FreeMenus                         gadtools.library/FreeMenus
  465.  
  466.    NAME
  467.     FreeMenus -- Frees memory allocated by CreateMenusA(). (V36)
  468.  
  469.    SYNOPSIS
  470.     FreeMenus(menu)
  471.               A0
  472.  
  473.     VOID FreeMenus(struct Menu *);
  474.  
  475.    FUNCTION
  476.     Frees the menus allocated by CreateMenusA().  It is safe to
  477.     call this function with a NULL parameter.
  478.  
  479.    INPUTS
  480.     menu - Pointer to menu structure (or first MenuItem) obtained
  481.     from CreateMenusA().
  482.  
  483.    RESULT
  484.     None.
  485.  
  486.    EXAMPLE
  487.  
  488.    NOTES
  489.  
  490.    BUGS
  491.  
  492.    SEE ALSO
  493.     CreateMenusA()
  494.  
  495. gadtools.library/FreeVisualInfo               gadtools.library/FreeVisualInfo
  496.  
  497.    NAME
  498.     FreeVisualInfo -- Return any resources taken by GetVisualInfo. (V36)
  499.  
  500.    SYNOPSIS
  501.     FreeVisualInfo(vi)
  502.                    A0
  503.  
  504.     VOID FreeVisualInfo(APTR);
  505.  
  506.    FUNCTION
  507.     FreeVisualInfo() returns any memory or other resources that
  508.     were allocated by GetVisualInfoA().  You should only call this function
  509.     once you are done with using the gadgets (i.e. after CloseWindow()),
  510.     but while the screen is still valid (i.e. before CloseScreen() or
  511.     UnlockPubScreen()).
  512.  
  513.    INPUTS
  514.     vi - Pointer that was obtained by calling GetVisualInfoA().
  515.  
  516.    RESULT
  517.     None.
  518.  
  519.    EXAMPLE
  520.  
  521.    NOTES
  522.  
  523.    BUGS
  524.  
  525.    SEE ALSO
  526.     GetVisualInfoA()
  527.  
  528. gadtools.library/GetVisualInfoA               gadtools.library/GetVisualInfoA
  529.  
  530.    NAME
  531.     GetVisualInfoA -- Get information GadTools needs for visuals. (V36)
  532.     GetVisualInfo -- Varargs stub for GetVisualInfoA(). (V36)
  533.  
  534.    SYNOPSIS
  535.     vi = GetVisualInfoA(screen, taglist)
  536.     D0                  A0      A1
  537.  
  538.     APTR vi = GetVisualInfoA(struct Screen *, struct TagItem *);
  539.  
  540.     vi = GetVisualInfo(screen, firsttag, ...)
  541.  
  542.     APTR vi = GetVisualInfo(struct Screen *, Tag, ...);
  543.  
  544.    FUNCTION
  545.     Get a pointer to a (private) block of data containing various bits
  546.     of information that GadTools needs to ensure the best quality
  547.     visuals.  Use the result in the NewGadget structure of any gadget
  548.     you create, or as a parameter to the various menu calls.  Once the
  549.     gadgets/menus are no longer needed (after the last CloseWindow),
  550.     call FreeVisualInfo().
  551.  
  552.    INPUTS
  553.     screen - Pointer to the screen you will be opening on.
  554.     taglist - Pointer to list of TagItems.  
  555.  
  556.    RESULT
  557.     vi - Pointer to private data.
  558.  
  559.    EXAMPLE
  560.  
  561.    NOTES
  562.  
  563.    BUGS
  564.  
  565.    SEE ALSO
  566.     FreeVisualInfo(), intuition/LockPubScreen(),
  567.     intuition/UnlockPubScreen()
  568.  
  569. gadtools.library/GT_BeginRefresh             gadtools.library/GT_BeginRefresh
  570.  
  571.    NAME
  572.     GT_BeginRefresh -- Begin refreshing friendly to GadTools. (V36)
  573.  
  574.    SYNOPSIS
  575.     GT_BeginRefresh(win)
  576.                     A0
  577.  
  578.     VOID GT_BeginRefresh(struct Window *);
  579.  
  580.    FUNCTION
  581.     Invokes the intuition.library/BeginRefresh() function in a manner
  582.     friendly to the Gadget Toolkit.  This function call permits the
  583.     GadTools gadgets to refresh themselves at the correct time.
  584.     Call GT_EndRefresh() function when done.
  585.  
  586.    INPUTS
  587.     win - Pointer to Window structure for which a IDCMP_REFRESHWINDOW
  588.         IDCMP event was received.
  589.  
  590.    RESULT
  591.     None.
  592.  
  593.    EXAMPLE
  594.  
  595.    NOTES
  596.     The nature of GadTools precludes the use of the IDCMP flag
  597.     WFLG_NOCAREREFRESH.  You must handle IDCMP_REFRESHWINDOW events
  598.     in at least the minimal way, namely:
  599.  
  600.         case IDCMP_REFRESHWINDOW:
  601.             GT_BeginRefresh(win);
  602.             GT_EndRefresh(win, TRUE);
  603.             break;
  604.  
  605.    BUGS
  606.  
  607.    SEE ALSO
  608.     intuition.library/BeginRefresh()
  609.  
  610. gadtools.library/GT_EndRefresh                 gadtools.library/GT_EndRefresh
  611.  
  612.    NAME
  613.     GT_EndRefresh -- End refreshing friendly to GadTools. (V36)
  614.  
  615.    SYNOPSIS
  616.     GT_EndRefresh(win, complete)
  617.                   A0   D0
  618.  
  619.     VOID GT_EndRefresh(struct Window *, BOOL complete);
  620.  
  621.    FUNCTION
  622.     Invokes the intuition.library/EndRefresh() function in a manner
  623.     friendly to the Gadget Toolkit.  This function call permits
  624.     GadTools gadgets to refresh themselves at the correct time.
  625.     Call this function to EndRefresh() when you have used
  626.     GT_BeginRefresh().
  627.  
  628.    INPUTS
  629.     win - Pointer to Window structure for which a IDCMP_REFRESHWINDOW
  630.         IDCMP event was received.
  631.     complete - TRUE when done with refreshing.
  632.  
  633.    RESULT
  634.     None.
  635.  
  636.    EXAMPLE
  637.  
  638.    NOTES
  639.  
  640.    BUGS
  641.  
  642.    SEE ALSO
  643.     intuition.library/EndRefresh()
  644.  
  645. gadtools.library/GT_FilterIMsg                 gadtools.library/GT_FilterIMsg
  646.  
  647.    NAME
  648.     GT_FilterIMsg -- Filter an IntuiMessage through GadTools. (V36)
  649.  
  650.    SYNOPSIS
  651.     modimsg = GT_FilterIMsg(imsg)
  652.     D0                      A1
  653.  
  654.     struct IntuiMessage *GT_FilterIMsg(struct IntuiMessage *);
  655.  
  656.    FUNCTION
  657.     NOTE WELL:  Extremely few programs will actually need this function.
  658.     You almost certainly should be using GT_GetIMsg() and GT_ReplyIMsg()
  659.     only, and not GT_FilterIMsg() and GT_PostFilterIMsg().
  660.  
  661.     GT_FilterIMsg() takes the supplied IntuiMessage and asks the
  662.     Gadget Toolkit to consider and possibly act on it.  Returns
  663.     NULL if the message was only of significance to a GadTools gadget
  664.     (i.e. not to you), else returns a pointer to a modified IDCMP
  665.     message, which may contain additional information.
  666.     You should examine the Class, Code, and IAddress fields of
  667.     the returned message to learn what happened.  Do not make
  668.     interpretations based on the original imsg.
  669.     You should use GT_PostFilterIMsg() to revert to the original
  670.     IntuiMessage once you are done with the modified one.
  671.  
  672.    INPUTS
  673.     imsg - An IntuiMessage you obtained from a Window's UserPort.
  674.  
  675.    RESULT
  676.     modimsg - A modified IntuiMessage, possibly with extra information
  677.         from GadTools, or NULL.
  678.  
  679.    EXAMPLE
  680.  
  681.    NOTES
  682.  
  683.    BUGS
  684.  
  685.    SEE ALSO
  686.     GT_GetIMsg(), GT_PostFilterIMsg()
  687.  
  688. gadtools.library/GT_GetIMsg                       gadtools.library/GT_GetIMsg
  689.  
  690.    NAME
  691.     GT_GetIMsg -- Get an IntuiMessage, with GadTools processing. (V36)
  692.  
  693.    SYNOPSIS
  694.     imsg = GT_GetIMsg(intuiport)
  695.     D0                A0
  696.  
  697.     struct IntuiMessage *GT_GetIMsg(struct MsgPort *);
  698.  
  699.    FUNCTION
  700.     Use GT_GetIMsg() in place of the usual exec.library/GetMsg() when
  701.     reading IntuiMessages from your window's UserPort.  If needed,
  702.     the GadTools dispatcher will be invoked, and suitable processing
  703.     will be done for gadget actions.  This function returns a pointer
  704.     to a modified IntuiMessage (which is a copy of the original,
  705.     possibly with some supplementary information from GadTools).
  706.     If there are no messages (or if the only messages are meaningful
  707.     only to GadTools, NULL will be returned.
  708.  
  709.    INPUTS
  710.     intuiport - The Window->UserPort of a window that is using the
  711.         Gadget Toolkit.
  712.  
  713.    RESULT
  714.     imsg - Pointer to modified IntuiMessage, or NULL if there are
  715.         no applicable messages.
  716.  
  717.    EXAMPLE
  718.  
  719.    NOTES
  720.     Be sure to use GT_ReplyIMsg() and not exec.library/ReplyMsg() on
  721.     messages obtained with GT_GetIMsg().
  722.     If you intend to do more with the resulting message than read
  723.     its fields, act on it, and reply it, you may find GT_FilterIMsg()
  724.     more appropriate.
  725.  
  726.    BUGS
  727.  
  728.    SEE ALSO
  729.     GT_ReplyIMsg(), GT_FilterIMsg()
  730.  
  731. gadtools.library/GT_PostFilterIMsg         gadtools.library/GT_PostFilterIMsg
  732.  
  733.    NAME
  734.     GT_PostFilterIMsg -- Return the unfiltered message after
  735.         GT_FilterIMsg() was called, and clean up. (V36)
  736.  
  737.    SYNOPSIS
  738.     imsg = GT_PostFilterIMsg(modimsg)
  739.     D0                       A1
  740.  
  741.     struct IntuiMessage *GT_PostFilterIMsg(struct IntuiMessage *);
  742.  
  743.    FUNCTION
  744.     NOTE WELL:  Extremely few programs will actually need this function.
  745.     You almost certainly should be using GT_GetIMsg() and GT_ReplyIMsg()
  746.     only, and not GT_FilterIMsg() and GT_PostFilterIMsg().
  747.  
  748.     Performs any clean-up necessitated by a previous call to
  749.     GT_FilterIMsg().  The original IntuiMessage is now yours to handle.
  750.     Do not interpret the fields of the original IntuiMessage, but
  751.     rather use only the one you got from GT_FilterIMsg().  You
  752.     may only do message related things at this point, such as queueing
  753.     it up or replying it.  Since you got the message with
  754.     exec.library/GetMsg(), your responsibilities do include replying
  755.     it with exec.library/ReplyMsg(). This function may be safely
  756.     called with a NULL parameter.
  757.  
  758.    INPUTS
  759.     modimsg - A modified IntuiMessage obtained with GT_FilterIMsg().
  760.  
  761.    RESULT
  762.     imsg - A pointer to the original IntuiMessage, if GT_FilterIMsg()
  763.         returned non-NULL.
  764.  
  765.    EXAMPLE
  766.  
  767.    NOTES
  768.     Be sure to use exec.library/ReplyMsg() on the original IntuiMessage
  769.     you obtained with GetMsg(), (which is the what you passed to
  770.     GT_FilterIMsg()), and not on the parameter of this function.
  771.  
  772.    BUGS
  773.  
  774.    SEE ALSO
  775.     GT_FilterIMsg()
  776.  
  777. gadtools.library/GT_RefreshWindow           gadtools.library/GT_RefreshWindow
  778.  
  779.    NAME
  780.     GT_RefreshWindow -- Refresh all the GadTools gadgets. (V36)
  781.  
  782.    SYNOPSIS
  783.     GT_RefreshWindow(win, req)
  784.                      A0   A1
  785.  
  786.     VOID GT_RefreshWindow(struct Window *, struct Requester *);
  787.  
  788.    FUNCTION
  789.     Perform the initial refresh of all the GadTools gadgets you have
  790.     created.  After you have opened your window, you must call this
  791.     function.  Or, if you have opened your window without gadgets,
  792.     you add the gadgets with intuition.library/AddGList(),
  793.     refresh them using intuition.library/RefreshGList(), then call
  794.     this function.
  795.     You should not need this function at other times.
  796.  
  797.    INPUTS
  798.     win - Pointer to the Window containing GadTools gadgets.
  799.     req - Pointer to requester, or NULL if not a requester (currently
  800.         ignored - use NULL).
  801.  
  802.    RESULT
  803.     None.
  804.  
  805.    EXAMPLE
  806.  
  807.    NOTES
  808.     req must currently be NULL.  GadTools gadgets are not supported
  809.     in requesters.  This field may allow such support at a future date.
  810.  
  811.    BUGS
  812.  
  813.    SEE ALSO
  814.     GT_BeginRefresh()
  815.  
  816. gadtools.library/GT_ReplyIMsg                   gadtools.library/GT_ReplyIMsg
  817.  
  818.    NAME
  819.     GT_ReplyIMsg -- Reply a message obtained with GT_GetIMsg(). (V36)
  820.  
  821.    SYNOPSIS
  822.     GT_ReplyIMsg(imsg)
  823.                  A1
  824.  
  825.     VOID GT_ReplyIMsg(struct IntuiMessage *);
  826.  
  827.    FUNCTION
  828.     Reply a modified IntuiMessage obtained with GT_GetIMsg().
  829.     If you use GT_GetIMsg(), use this function where you would normally
  830.     have used exec.library/ReplyMsg().
  831.     You may safely call this routine with a NULL pointer (nothing
  832.     will be done).
  833.  
  834.    INPUTS
  835.     imsg - A modified IntuiMessage obtained with GT_GetIMsg().
  836.  
  837.    RESULT
  838.     None.
  839.  
  840.    EXAMPLE
  841.  
  842.    NOTES
  843.     When using GadTools, you MUST explicitly GT_ReplyIMsg()
  844.     all messages you receive.  You cannot depend on CloseWindow()
  845.     to handle messages you have not replied.
  846.  
  847.    BUGS
  848.  
  849.    SEE ALSO
  850.     GT_GetIMsg()
  851.  
  852. gadtools.library/GT_SetGadgetAttrsA       gadtools.library/GT_SetGadgetAttrsA
  853.  
  854.    NAME
  855.     GT_SetGadgetAttrsA -- Change the attributes of a GadTools gadget. (V36)
  856.     GT_SetGadgetAttrs -- Varargs stub for GT_SetGadgetAttrsA(). (V36)
  857.  
  858.    SYNOPSIS
  859.     GT_SetGadgetAttrsA(gad, win, req, taglist)
  860.                        A0   A1   A2   A3
  861.  
  862.     VOID GT_SetGadgetAttrsA(struct Gadget *, struct Window *,
  863.         struct Requester *, struct TagItem *);
  864.  
  865.     GT_SetGadgetAttrs(gad, win, req, firsttag, ...)
  866.  
  867.     VOID GT_SetGadgetAttrs(struct Gadget *, struct Window *,
  868.         struct Requester *, Tag, ...);
  869.  
  870.    FUNCTION
  871.     Change the attributes of the specified gadget, according to the
  872.     attributes chosen in the tag list.
  873.  
  874.    INPUTS
  875.     gad - Pointer to the gadget in question.
  876.     win - Pointer to the window containing the gadget.
  877.     req - Pointer to the requester containing the gadget, or NULL if
  878.         not in a requester.  (Not yet implemented, use NULL).
  879.     taglist - Pointer to TagItem list.
  880.  
  881.    TAGS
  882.     BUTTON_KIND:
  883.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  884.         (defaults to FALSE).
  885.  
  886.     CHECKBOX_KIND:
  887.     GTCB_Checked (BOOL) - Initial state of checkbox, defaults to FALSE.
  888.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  889.         (defaults to FALSE).
  890.  
  891.     CYCLE_KIND:
  892.     GTCY_Active (UWORD) - The ordinal number (counting from zero) of
  893.         the active choice of a cycle gadget (defaults to zero).
  894.     GTCY_Labels (STRPTR *) - (GadTools V37 and higher only)
  895.         Pointer to NULL-terminated array of strings
  896.         that are the choices offered by the cycle gadget.
  897.     GA_Disabled (BOOL) - (GadTools V37 and higher only)
  898.         Set to TRUE to disable gadget, FALSE otherwise
  899.         (defaults to FALSE).
  900.  
  901.     INTEGER_KIND:
  902.     GTIN_Number (ULONG) - The initial contents of the integer gadget
  903.         (default zero).
  904.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  905.         (defaults to FALSE).
  906.  
  907.     LISTVIEW_KIND:
  908.     GTLV_Top (UWORD) - Top item visible in the listview (defaults to zero).
  909.     GTLV_Labels (struct List *) - List of labels whose ln_Name fields
  910.         are to be displayed in the listview.  Use a value of ~0 to
  911.         "detach" your List from the display.  You must detach your list
  912.         before modifying the List structure, since GadTools reserves
  913.         the right to traverse it on another task's schedule.  When you
  914.         are done, attach the list by using the tag pair
  915.         {GTLV_Labels, list}.
  916.     GTLV_Selected (UWORD) - Ordinal number of currently selected
  917.         item (defaults to zero if GTLV_ShowSelected is set).
  918.  
  919.     MX_KIND:
  920.     GTMX_Active (UWORD) - The ordinal number (counting from zero) of
  921.         the active choice of an mx gadget (Defaults to zero).
  922.  
  923.     NUMBER_KIND:
  924.     GTNM_Number - A signed long integer to be displayed as a read-only
  925.          number (default 0).
  926.  
  927.     PALETTE_KIND:
  928.     GTPA_Color (UBYTE) - Initially selected color of the palette
  929.         (defaults to 1).
  930.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  931.         (defaults to FALSE).
  932.  
  933.     SCROLLER_KIND:
  934.     GTSC_Top (WORD) - Top visible in scroller (defaults to zero).
  935.     GTSC_Total (WORD) - Total in scroller area (defaults to zero).
  936.     GTSC_Visible (WORD) - Number visible in scroller (defaults to 2).
  937.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  938.         (defaults to FALSE).
  939.  
  940.     SLIDER_KIND:
  941.     GTSL_Min (WORD) - Minimum level for slider (default 0).
  942.     GTSL_Max (WORD) - Maximum level for slider (default 15).
  943.     GTSL_Level (WORD) - Current level of slider (default 0).
  944.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  945.         (defaults to FALSE).
  946.  
  947.     STRING_KIND:
  948.     GTST_String (STRPTR) - The initial contents of the string gadget,
  949.          or NULL (default) if string is to start empty.
  950.     GA_Disabled (BOOL) - Set to TRUE to disable gadget, FALSE otherwise
  951.         (defaults to FALSE).
  952.  
  953.     TEXT_KIND:
  954.     GTTX_Text - Pointer to a NULL terminated string to be displayed,
  955.         as a read-only text-display gadget, or NULL. defaults to NULL.
  956.  
  957.    RESULT
  958.     None.
  959.  
  960.    EXAMPLE
  961.  
  962.    NOTES
  963.     req must currently be NULL.  GadTools gadgets are not supported
  964.     in requesters.  This field may allow such support at a future date.
  965.  
  966.     This function may not be called inside of a GT_BeginRefresh() /
  967.     GT_EndRefresh() session.  (As always, restrict yourself to simple
  968.     rendering functions).
  969.  
  970.    BUGS
  971.  
  972.    SEE ALSO
  973.  
  974. gadtools.library/LayoutMenuItemsA           gadtools.library/LayoutMenuItemsA
  975.  
  976.    NAME
  977.     LayoutMenuItemsA -- Position all the menu items. (V36)
  978.     LayoutMenuItems -- Varargs stub for LayoutMenuItemsA(). (V36)
  979.  
  980.    SYNOPSIS
  981.     success = LayoutMenuItemsA(menuitem, vi, taglist)
  982.     D0                         A0        A1  A2
  983.  
  984.     BOOL LayoutMenuItemsA(struct MenuItem *, APTR, struct TagItem *);
  985.  
  986.     success = LayoutMenuItems(menuitem, vi, firsttag, ...)
  987.  
  988.     BOOL LayoutMenuItemsA(struct MenuItem *, APTR, Tag, ...);
  989.  
  990.    FUNCTION
  991.     Lays out all the menu items and sub-items according to
  992.     the supplied visual information and tag parameters.  You would use this
  993.     if you used CreateMenusA() to make a single menu-pane (with sub-items,
  994.     if any), instead of a whole menu strip.
  995.     This routine attempts to columnize and/or shift the MenuItems in
  996.     the event that a menu would be too tall or too wide.
  997.  
  998.    INPUTS
  999.     menuitem - Pointer to first MenuItem in a linked list of
  1000.         items.
  1001.     vi - Pointer returned by GetVisualInfoA().
  1002.     taglist - Pointer to a TagItem list.
  1003.  
  1004.    TAGS
  1005.     GTMN_TextAttr (struct TextAttr *) - Text Attribute to use for
  1006.         menu-items and sub-items.  If not supplied, the screen's
  1007.         font will be used.  This font must be openable via OpenFont()
  1008.         when this function is called.
  1009.     GTMN_Menu (struct Menu *) - Pointer to the Menu structure whose
  1010.         FirstItem is the MenuItem supplied above.  If the menu items are
  1011.         such that they need to be columnized or shifted, the Menu
  1012.         structure is needed to perform the complete calculation.
  1013.         It is suggested you always provide this information.
  1014.  
  1015.    RESULT
  1016.     success - TRUE if successful, false otherwise (signifies that
  1017.         the TextAttr wasn't openable).
  1018.  
  1019.    EXAMPLE
  1020.  
  1021.    NOTES
  1022.  
  1023.    BUGS
  1024.     If a menu ends up being wider than the whole screen, it will
  1025.     run off the right-hand side.
  1026.  
  1027.    SEE ALSO
  1028.     CreateMenusA(), GetVisualInfoA()
  1029.  
  1030. gadtools.library/LayoutMenusA                   gadtools.library/LayoutMenusA
  1031.  
  1032.    NAME
  1033.     LayoutMenusA -- Position all the menus and menu items. (V36)
  1034.     LayoutMenus -- Varargs stub for LayoutMenusA(). (V36)
  1035.  
  1036.    SYNOPSIS
  1037.     success = LayoutMenusA(menu, vi, taglist)
  1038.     D0                     A0    A1  A2
  1039.  
  1040.     BOOL LayoutMenusA(struct Menu *, APTR, struct TagItem *);
  1041.  
  1042.     success = LayoutMenus(menu, vi, firsttag, ...)
  1043.  
  1044.     BOOL LayoutMenus(struct Menu *, APTR, Tag, ...);
  1045.  
  1046.    FUNCTION
  1047.     Lays out all the menus, menu items and sub-items in the supplied
  1048.     menu according to the supplied visual information and tag parameters.
  1049.     This routine attempts to columnize and/or shift the MenuItems in
  1050.     the event that a menu would be too tall or too wide.
  1051.  
  1052.    INPUTS
  1053.     menu - Pointer to menu obtained from CreateMenusA().
  1054.     vi - Pointer returned by GetVisualInfoA().
  1055.     taglist - Pointer to a TagItem list.
  1056.  
  1057.    TAGS
  1058.     GTMN_TextAttr (struct TextAttr *) - Text Attribute to use for
  1059.         menu-items and sub-items.  If not supplied, the screen's
  1060.         font will be used.  This font must be openable via OpenFont()
  1061.         when this function is called.
  1062.  
  1063.    RESULT
  1064.     success - TRUE if successful, false otherwise (signifies that
  1065.         the TextAttr wasn't openable).
  1066.  
  1067.    EXAMPLE
  1068.  
  1069.    NOTES
  1070.     When using this function, there is no need to also call
  1071.     LayoutMenuItemsA().
  1072.  
  1073.    BUGS
  1074.     If a menu ends up being wider than the whole screen, it will
  1075.     run off the right-hand side.
  1076.  
  1077.    SEE ALSO
  1078.     CreateMenusA(), GetVisualInfoA()
  1079.  
  1080.