home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / programmieren / gui / gadutil / docs / gadutil.doc < prev    next >
Encoding:
Text File  |  1997-10-05  |  92.7 KB  |  2,803 lines

  1. TABLE OF CONTENTS
  2.  
  3. gadutil.library/GU_AddTail
  4. gadutil.library/GU_AttachList
  5. gadutil.library/GU_BeginRefresh
  6. gadutil.library/GU_BlockInput
  7. gadutil.library/GU_ChangeStr
  8. gadutil.library/GU_CheckVersion
  9. gadutil.library/GU_ClearList
  10. gadutil.library/GU_ClearWindow
  11. gadutil.library/GU_CloseCatalog
  12. gadutil.library/GU_CloseFont
  13. gadutil.library/GU_CoordsInGadBox
  14. gadutil.library/GU_CountNodes
  15. gadutil.library/GU_CreateContext
  16. gadutil.library/GU_CreateGadgetA
  17. gadutil.library/GU_CreateLocMenuA
  18. gadutil.library/GU_CreateMenusA
  19. gadutil.library/GU_DetachList
  20. gadutil.library/GU_DisableGadget
  21. gadutil.library/GU_DrawBevelBoxA
  22. gadutil.library/GU_EndRefresh
  23. gadutil.library/GU_FilterIMsg
  24. gadutil.library/GU_FindNode
  25. gadutil.library/GU_FreeGadgets
  26. gadutil.library/GU_FreeInput
  27. gadutil.library/GU_FreeLayoutGadgets
  28. gadutil.library/GU_FreeMenus
  29. gadutil.library/GU_FreeVisualInfo
  30. gadutil.library/GU_GadgetArrayIndex
  31. gadutil.library/GU_GetGadgetAttrsA
  32. gadutil.library/GU_GetGadgetPtr
  33. gadutil.library/GU_GetIMsg
  34. gadutil.library/GU_GetLocaleStr
  35. gadutil.library/GU_GetVisualInfoA
  36. gadutil.library/GU_LayoutGadgetsA
  37. gadutil.library/GU_LayoutMenuItemsA
  38. gadutil.library/GU_LayoutMenusA
  39. gadutil.library/GU_NewList
  40. gadutil.library/GU_NodeDown
  41. gadutil.library/GU_NodeUp
  42. gadutil.library/GU_OpenCatalog
  43. gadutil.library/GU_OpenFont
  44. gadutil.library/GU_PostFilterIMsg
  45. gadutil.library/GU_RefreshBoxes
  46. gadutil.library/GU_RefreshWindow
  47. gadutil.library/GU_ReplyIMsg
  48. gadutil.library/GU_SetGadgetAttrsA
  49. gadutil.library/GU_SetGUGadAttrsA
  50. gadutil.library/GU_SetToggle
  51. gadutil.library/GU_SizeWindow
  52. gadutil.library/GU_SortList
  53. gadutil.library/GU_TextWidth
  54. gadutil.library/GU_UpdateProgress
  55. Œ gadutil.library/GU_AddTail                         gadutil.library/GU_AddTail
  56.  
  57.    NAME
  58.     GU_AddTail -- Add a node to the end of a listview's list.
  59.  
  60.    SYNOPSIS
  61.     node = GU_AddTail(gad, string, list)
  62.     D0, SR (Z)        D0   A0      A1
  63.  
  64.     struct Node *GU_AddTail(struct Gadget *, STRPTR, struct List *);
  65.  
  66.    FUNCTION
  67.     Add a node to the end of a list linked to a gadget (eg. a ListView).
  68.  
  69.     Normally this is used to add a node to a listview list, but it can
  70.     also be used if you eg have another list that that contains
  71.     information about the items in the listview. This list will then
  72.     also be deallocated at the same time as the listview's own list.
  73.     If you do this, be sure to clear the list header of this other list
  74.     when you want to deallocate the list (you can use the GU_NewList
  75.     function).
  76.  
  77.    INPUTS
  78.     gad    - Gadget to keep the nodes in (ie the ListView gadget).
  79.  
  80.     string - String to put in the nodes' LN_NAME field (visible entry).
  81.  
  82.     list   - List to add the node to.
  83.  
  84.    RESULT
  85.     node - Struct Node for success, FALSE for error.
  86.     SR(Z)- 0 for success, 1 for error.
  87.  
  88.    NOTES
  89.     The SR(Z) is probably most usable for assembly programmers.
  90.  
  91.    BUGS
  92.     none known
  93.  
  94.    SEE ALSO
  95.     GU_CountNodes(), GU_NewList(), GU_ClearList(), GU_DetachList(),
  96.     GU_AttachList(), GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_SortList()
  97. gadutil.library/GU_AttachList                   gadutil.library/GU_AttachList
  98.  
  99.    NAME
  100.     GU_AttachList -- Change a listview's current list.
  101.  
  102.    SYNOPSIS
  103.     GU_AttachList(gad, win, list)
  104.                   D0   A0   A1
  105.  
  106.     VOID GU_AttachList(struct Gadget *, struct Window *, struct List *);
  107.  
  108.    FUNCTION
  109.     Attach a new (or changed) list to a listview. The new list will be
  110.     shown immediately.
  111.  
  112.    INPUTS
  113.     gad  - Gadget to change.
  114.     win  - Window that the gadget is located in.
  115.     list - List to connect to the listview gadget.
  116.  
  117.    RESULT
  118.     none
  119.  
  120.    BUGS
  121.     none known
  122.  
  123.    SEE ALSO
  124.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_NewList()
  125.     GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_CountNodes(), GU_SortList()
  126. gadutil.library/GU_BeginRefresh               gadutil.library/GU_BeginRefresh
  127.  
  128.    NAME
  129.     GU_BeginRefresh -- Begin refreshing friendly to GadTools.
  130.  
  131.    SYNOPSIS
  132.     GU_BeginRefresh(win)
  133.                     A0
  134.  
  135.     VOID GU_BeginRefresh(struct Window *);
  136.  
  137.    FUNCTION
  138.  
  139.     Invokes the intuition.library/BeginRefresh() function in a manner
  140.     friendly to the Gadget Toolkit. This function call permits the
  141.     GadTools gadgets to refresh themselves at the correct time.
  142.     Call GU_EndRefresh() function when done.
  143.  
  144.    INPUTS
  145.     win - pointer to Window structure for which a IDCMP_REFRESHWINDOW
  146.           IDCMP event was received.
  147.  
  148.    NOTES
  149.     See gadtools/GT_BeginRefresh() for more information.
  150.  
  151.    SEE ALSO
  152.     GU_EndRefresh(), gadtools/GT_BeginRefresh(), intuition/BeginRefresh()
  153. gadutil.library/GU_BlockInput                   gadutil.library/GU_BlockInput
  154.  
  155.    NAME
  156.     GU_BlockInput -- Block all input to a window.
  157.  
  158.    SYNOPSIS
  159.     GU_BlockInput(window)
  160.                   A0
  161.  
  162.     VOID GU_BlockInput(struct Window *);
  163.  
  164.    FUNCTION
  165.     Changes the window's pointer to the standard wait pointer (OS 2.0)
  166.     or the preferred wait pointer (OS 3.0+) and opens a requester to
  167.     block the user input of the given window. The requester that is
  168.     opened is not visible.
  169.  
  170.    INPUTS
  171.     window - the parent window for the requester. This is the window
  172.          that will be blocked for user input.
  173.  
  174.    EXAMPLE
  175.  
  176.     BlockInput(myWin);
  177.     About();
  178.     FreeInput();
  179.  
  180.     Will block the parent window for user input while displaying the
  181.     About requester of a program.
  182.  
  183.    SEE ALSO
  184.     GU_FreeInput()
  185. gadutil.library/GU_ChangeStr                     gadutil.library/GU_ChangeStr
  186.  
  187.    NAME
  188.     GU_ChangeStr -- Change the contents of string gadget.
  189.  
  190.    SYNOPSIS
  191.     GU_ChangeStr(gad, string, win)
  192.                  D0   A0      A1
  193.  
  194.     VOID GU_ChangeStr(struct Gadget *, STRPTR, struct Window *);
  195.  
  196.    FUNCTION
  197.     Change the string in a string gadget.
  198.  
  199.    INPUTS
  200.     gad    - Gadget to change
  201.     string - New string
  202.     win    - Window that the gadget is located in.
  203.  
  204.    RESULT
  205.     none
  206.  
  207.    BUGS
  208.     none known
  209.  
  210.    SEE ALSO
  211. gadutil.library/GU_CheckVersion               gadutil.library/GU_CheckVersion
  212.  
  213.    NAME
  214.     GU_CheckVersion -- Check the version.revision of a library
  215.  
  216.    SYNOPSIS
  217.     success = GU_CheckVersion(library, version, revision)
  218.     D0, SR(Z)                 A0       D0       D1
  219.  
  220.     BOOL GU_CheckVersion(struct Library *, UWORD, UWORD);
  221.  
  222.    FUNCTION
  223.     Compares a library's version and revision with a required one.
  224.     
  225.    INPUTS
  226.     library  - a pointer to an opened library/device
  227.     version  - the version of the library that is required
  228.     revision - the revision of the library that is required
  229.  
  230.    RESULT
  231.     success - TRUE if the required version is older or equal to the
  232.           opened one. FALSE otherwise.
  233.     SR(Z)   - 0 if function returns TRUE, 1 otherwise
  234.  
  235.    BUGS
  236.     none known
  237.  
  238.    SEE ALSO
  239. gadutil.library/GU_ClearList                     gadutil.library/GU_ClearList
  240.  
  241.    NAME
  242.     GU_ClearList -- Clear a listview gadget and deallocate all its nodes.
  243.  
  244.    SYNOPSIS
  245.     GU_ClearList(gad, win, list)
  246.                  D0   A0   A1
  247.  
  248.     VOID GU_ClearList(struct Gadget *, struct Window *, struct List *);
  249.  
  250.    FUNCTION
  251.     Clear a listview gadget and deallocate all nodes.
  252.  
  253.    INPUTS
  254.     gad  - Gadget To Change
  255.     win  - Window that the gadget is located in.
  256.     list - List structure to deallocate nodes from.
  257.  
  258.    RESULT
  259.     none
  260.  
  261.    BUGS
  262.     none known
  263.  
  264.    SEE ALSO
  265.     GU_AddTail(), GU_NewList(), GU_DetachList(), GU_AttachList()
  266.     GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_CountNodes(), GU_SortList()
  267. gadutil.library/GU_ClearWindow                 gadutil.library/GU_ClearWindow
  268.  
  269.    NAME
  270.     GU_ClearWindow -- Fill the inside of a window with selected color.
  271.  
  272.    SYNOPSIS
  273.     GU_ClearWindow(window, color)
  274.                    A0      D0
  275.  
  276.     VOID GU_ClearWindow(struct Window *, UWORD);
  277.  
  278.    FUNCTION
  279.     Fills the inner area of a window with given color.
  280.  
  281.    INPUTS
  282.     window - pointer to the window to be filled
  283.  
  284.     color - the color to use. Use color 0 to clear the window.
  285.  
  286.    BUGS
  287.     none known
  288.  
  289.    SEE ALSO
  290. gadutil.library/GU_CloseCatalog               gadutil.library/GU_CloseCatalog
  291.  
  292.    NAME
  293.     GU_CloseCatalog -- Close a message catalog.
  294.  
  295.    SYNOPSIS
  296.     GU_CloseCatalog(catalog)
  297.                     A0
  298.  
  299.     VOID GU_CloseCatalog(struct Catalog *);
  300.  
  301.    FUNCTION
  302.     Concludes access to a message catalog. The usage count of the
  303.     catalog is decremented. When this count reaches 0, the catalog
  304.     can be expunged from system memory whenever a memory panic occurs.
  305.  
  306.    INPUTS
  307.     catalog - the message catalog to close. A NULL catalog is a valid
  308.           parameter and is simply ignored.
  309.  
  310.    NOTES
  311.     This function is a shortcut to the locale/CloseCatalog() function.
  312.  
  313.    SEE ALSO
  314.     GU_OpenCatalog(), GU_GetLocaleStr()
  315. gadutil.library/GU_CloseFont                     gadutil.library/GU_CloseFont
  316.  
  317.    NAME
  318.     GU_CloseFont -- Release a pointer to a system font.
  319.  
  320.    SYNOPSIS
  321.     GU_CloseFont(font)
  322.                  A0
  323.  
  324.     VOID GU_CloseFont(struct TextFont *);
  325.  
  326.    FUNCTION
  327.     This function indicates that the font specified is no longer
  328.     in use. It is used to close a font opened by GU_OpenFont, so
  329.     that fonts that are no longer in use do not consume system
  330.     resources.
  331.  
  332.    INPUTS
  333.     font - a font pointer as returned by GU_OpenFont()
  334.  
  335.    RESULT
  336.  
  337.    BUGS
  338.     none known
  339.  
  340.    SEE ALSO
  341.     GU_OpenFont()
  342. gadutil.library/GU_CoordsInGadBox           gadutil.library/GU_CoordsInGadBox
  343.  
  344.    NAME
  345.     GU_CoordsInGadBox -- Check if a coordinate pair is within a gadget.
  346.  
  347.    SYNOPSIS
  348.     IsInBox = GU_CoordsInGadBox(coords, gad)
  349.     D0,SR(Z)                    D0      A0
  350.  
  351.     BOOL GU_CoordsInGadBox(ULONG, struct Gadget *);
  352.  
  353.    FUNCTION
  354.     Check if a coordinate pair is within a gadget's border. This
  355.     function may be used to make coordinate sensitive AppWindows
  356.     (allows the user to drop a file on a string gadget etc.).
  357.     To use this function, you must save the coordinates from the
  358.     recieved message (AppMessage, IntuiMessage) to have something
  359.     to compare against.
  360.  
  361.    INPUTS
  362.     coords - a combined LONG of both the X and Y coordinates to
  363.          compare against. The X coordinate should be in the
  364.          upper word of the parameter.
  365.  
  366.     gad - the gadget to check the coordinates against.
  367.  
  368.    RESULT
  369.     IsInBox - TRUE if both given coordinates was within the gadget's
  370.           outer box (X coord is between gadx and gadx+gadw,
  371.           Y coord is between gady and gady+gadh). Otherwise this
  372.           function will return FALSE.
  373.  
  374.    EXAMPLES
  375.     Assembly language:
  376.         move.l    im_MouseX(a0),d0    ; Get X and Y coordinates
  377.         move.l    mystrgad(pc),a0
  378.         move.l    GadUtilBase(pc),a6
  379.         jsr    _LVOGU_CoordsInGadBox(a6)
  380.         beq.b    .notinbox        ; Not in gadget box
  381.     
  382.         ; Do what you want to do if the coordinates are
  383.         ; within the gadget box
  384.     .notinbox:
  385.         ; Here, you may want to check for some other gadgets
  386.  
  387.  
  388.     C:
  389.         long coords;
  390.         coords = (LONG)appmsg->MouseX << 16 | appmsg->MouseY;
  391.         if (CoordsInGadBox(coords,mystrgad) = TRUE)
  392.         {
  393.             /* Do what you want to do if the coordinates
  394.                are within the gadget box */
  395.         }
  396.         else
  397.         {
  398.             /* Here, you may want to check for some other
  399.                gadgets */
  400.         }
  401. gadutil.library/GU_CountNodes                   gadutil.library/GU_CountNodes
  402.  
  403.    NAME
  404.     GU_CountNodes -- Count number of nodes in a list.
  405.  
  406.    SYNOPSIS
  407.     numnodes = GU_CountNodes(list)
  408.     D0                       A0
  409.  
  410.     ULONG GU_CountNodes(struct List *);
  411.  
  412.    FUNCTION
  413.     This function will count the number of nodes attached to a list.
  414.  
  415.    INPUTS
  416.     list - a pointer to the list to get the number of nodes in
  417.  
  418.    RESULT
  419.     numnodes - Number of nodes that was in the list for the moment.
  420.                Note that count starts from one and not from zero!
  421.  
  422.    NOTES
  423.     Use Forbid() and Permit() around a call to this function if you
  424.     are using it on a list that can change at any time (e.g. a list
  425.     that wasn't created by yourself). This function may not be accurate
  426.     when you are using it on a system list.
  427.  
  428.    SEE ALSO
  429.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_AttachList()
  430.     GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_NewList(), GU_SortList()
  431. gadutil.library/GU_CreateContext             gadutil.library/GU_CreateContext
  432.  
  433.    NAME
  434.     GU_CreateContext -- Create a space for GadTools context data.
  435.  
  436.    SYNOPSIS
  437.     gad = GU_CreateContext(glistptr)
  438.     D0                     A0
  439.  
  440.     struct Gadget *GU_CreateContext(struct Gadget **);
  441.  
  442.    FUNCTION
  443.     This function is a replacement for the GadTools version. Use this
  444.     instead. This will make your program to take advantage of future
  445.     enhancements of gadutil.
  446.  
  447.     Creates a place for GadTools to store any context data it might
  448.     need for your window.  In reality, an unselectable invisible
  449.     gadget is created, with room for the context data.
  450.     This function also establishes the linkage from a glist type
  451.     pointer to the individual gadget pointers.  Call this function
  452.     before any of the other gadget creation calls.
  453.  
  454.    INPUTS
  455.  
  456.     glistptr - Address of a pointer to a Gadget, which was previously
  457.                set to NULL.  When all the gadget creation is done, you may
  458.                use that pointer as your NewWindow.FirstGadget, or
  459.                in intuition.library/AddGList(),
  460.                intuition.library/RefreshGList(), FreeGadgets(), etc.
  461.  
  462.    RESULT
  463.     gad - pointer to context gadget, or NULL if failure.
  464.  
  465.    NOTES
  466.     Look in gadtools/CreateContext() for more information.
  467.  
  468.    SEE ALSO
  469.     gadtools/CreateContext()
  470. gadutil.library/GU_CreateGadgetA             gadutil.library/GU_CreateGadgetA
  471.  
  472.    NAME
  473.     GU_CreateGadgetA -- Create a gadget with built-in hotkey support.
  474.  
  475.    SYNOPSIS
  476.     gad = CreateGadgetA(kind, prevgad, newgad, taglist)
  477.     D0,A0               D0    A0       A1      A2
  478.  
  479.     struct Gadget *GU_CreateGadgetA(ULONG, struct Gadget *,
  480.                     struct NewGadget *, struct TagItem *);
  481.  
  482.    FUNCTION
  483.     GU_CreateGadgetA() allocates and initializes a new gadget of the
  484.     specified kind, and attaches it to the previous gadget. The gadget
  485.     is created based on the supplied kind, NewGadget structure, and
  486.     tags.
  487.  
  488.     This function differs from the GadTools equivalent by supporting
  489.     some extra tags to allow the gadget to be selected using the
  490.     keyboard.
  491.  
  492.    INPUTS
  493.     kind - kind of gadget to create. One of the XXX_KIND values
  494.            defined in <libraries/gadtools.h>.
  495.  
  496.     prevgad - pointer to the previous gadget that this new gadget
  497.           should be attached to. This function will fail if
  498.           this value is NULL.
  499.  
  500.     newgad - a filled in NewGadget structure describing the desired
  501.          gadget's size, position, label, etc.
  502.  
  503.     taglist - pointer to an array of tags providing optional extra
  504.           parameters, or NULL.
  505.  
  506.    TAGS
  507.     All kinds:
  508.  
  509.     GT_Underscore - Indicates the symbol that precedes the character
  510.         in the gadget label to be underscored. This can be to
  511.         indicate keyboard equivalents for gadgets. GadUtil has
  512.         the ability to process the keyboard equivalents if some
  513.         other tags are used.
  514.  
  515.     GU_Hotkey - This tag selects the hotkey to be used as an automatic
  516.         keyboard command for the gadget. The ti_Data field should
  517.         contain the ASCII or RAWKEY code for the hotkey.
  518.         This tag may be used together with the GU_HotkeyCase and
  519.         GU_LabelHotkey. The GU_RawKey tag requires this tag.
  520.  
  521.     GU_HotkeyCase - This tag makes the keyboard command case-sensitive.
  522.         This tag may not be used with GU_RawKey.
  523.  
  524.     GU_LabelHotkey - This tag picks the hotkey from the gadget text
  525.         field in the NewGadget structure when the gadget is created.
  526.         If no key is marked with the underscore, the GU_HotKey code
  527.         will be used.
  528.  
  529.         This tag supports and requires the GT_Underscore tag. The
  530.         character that was given in the GT_Underscore tag will be
  531.         used to find the code for the hotkey.
  532.  
  533.     GU_RawKey - This tag makes the hotkey code to a RAWKEY code. All
  534.         keys on the keyboard has one rawkey code that matches the
  535.         key.
  536.  
  537.         If your program also gets VANILLAKEY events, you must be
  538.         careful when selecting the rawkey code to be used as a
  539.         keyboard shortcut for this gadget. RAWKEY events will only
  540.         be sent for special keys (such as the HELP, Control, Alt
  541.         and function keys) that don't map to a single character. 
  542.         All keys that maps to a single character will be processed
  543.         as a VANILLAKEY event.
  544.  
  545.         This tag may not be used with (and will also disable) the
  546.         GU_HotkeyCase and GU_LabelHotkey tags.
  547.  
  548.     Kind specific tags:
  549.         See the GadTools function CreateGadgetA for all other tags.
  550.  
  551.    RESULT
  552.     gad - pointer to the new gadget, or NULL if the allocation failed
  553.           or if prevgad was NULL.
  554.  
  555.    NOTES
  556.     Note that the ng_VisualInfo and ng_TextAttr fields of the NewGadget
  557.     structure must be set to valid VisualInfo and TextAttr pointers, or
  558.     this function will fail.
  559.  
  560.    SEE ALSO
  561.     GU_FreeGadgets(), GU_SetGadgetAttrsA(), GU_GetVisualInfoA(),
  562.     GU_GetIMsg(), gadtools/CreateGadgetA, <libraries/gadtools.h>
  563. gadutil.library/GU_CreateLocMenuA           gadutil.library/GU_CreateLocMenuA
  564.  
  565.    NAME
  566.     GU_CreateLocMenuA -- Create a menu with localized items.
  567.  
  568.    SYNOPSIS
  569.     menu = GU_CreateLocMenuA(newmenu, gad_info, createtags, layouttags)
  570.     D0                       A0       A1        A2             A3
  571.  
  572.     struct Menu *GU_GetLocaleStr(struct NewMenu *, APTR,
  573.                 struct TagItem *, struct TagItem *);
  574.  
  575.    FUNCTION
  576.     Create and layout a localized menu. This function replaces both
  577.     the gadtools/CreateMenusA and gadtools/LayoutMenusA functions. See
  578.     those functions for a more in-depth description of this function.
  579.  
  580.    INPUTS
  581.     newmenu - pointer to an array of initialized struct NewMenus. This
  582.           differs from the GadTools function in that, instead of
  583.           giving pointers to strings in the nm_Label and nm_CommKey
  584.           fields of the structure, you should put a string ID in the
  585.           nm_Label field of the structure. The string must be in the
  586.           format "A\x00About...". The nm_CommKey field should be left
  587.           empty.  ^^^^^^
  588.               |    |
  589.               |    |- nm_Label field for the NewMenu structure
  590.               |
  591.               |- nm_CommKey replacement. If no keyboard shortcut,
  592.                     this field MUST CONTAIN A SPACE CHAR.
  593.                     The \x00 is a NULL character.
  594.  
  595.     gad_info - the value returned from GU_LayoutGadgetsA()
  596.  
  597.     createtags - tags for the "CreateMenusA" part of this routine. All
  598.              gadtools tags are supported (directly passed to GT).
  599.  
  600.     layouttags - tags for the "LayoutMenusA" part of this routine. All
  601.              gadtools tags are supported (directly passed to GT).
  602.  
  603.    TAGS
  604.     See the gadtools functions CreateMenusA() and LayoutMenusA().
  605.  
  606.    RESULT
  607.     menu - pointer to the resulting initialized and laid out menu structure,
  608.            ready to pass to the intuition function SetMenuStrip(), or NULL for
  609.            failure.
  610.  
  611.    SEE ALSO
  612.     GU_FreeMenus(), gadtools/CreateMenusA(), gadtools/LayoutMenusA(),
  613.     gadtools/FreeMenus()
  614. gadutil.library/GU_CreateMenusA               gadutil.library/GU_CreateMenusA
  615.  
  616.    NAME
  617.     GU_CreateMenusA -- Allocate and fill out a menu structure.
  618.  
  619.    SYNOPSIS
  620.     menu = GU_CreateMenusA(newmenu, taglist)
  621.     D0                     A0       A1
  622.  
  623.     struct Menu *GU_CreateMenusA(struct NewMenu *, struct TagItem *);
  624.  
  625.    FUNCTION
  626.     CreateMenusA() allocates and initializes a complete menu
  627.     structure based on the supplied array of NewMenu structures.
  628.     Optionally, CreateMenusA() can allocate and initialize a complete
  629.     set of menu items and sub-items for a single menu title.  This
  630.     is dictated by the contents of the array of NewMenus.
  631.  
  632.     These GadTools routines are only here to make it simpler for someone
  633.     who wants to use them. This for example, is of no use if you use the
  634.     GadUtil function GU_CreateLocMenuA() to define localized (optional)
  635.     menus with automatic hotkey handlimg etc.
  636.  
  637.    INPUTS
  638.     newmenu - pointer to an array of initialized struct NewMenus.
  639.     tagList - pointer to an array of tags providing optional extra
  640.           parameters, or NULL.
  641.  
  642.    TAGS
  643.     See gadtools/CreateMenusA() for available tags.
  644.  
  645.    RESULT
  646.     menu - pointer to the resulting initialized menu structure (or
  647.               the resulting FirstItem), with all the links for menu items
  648.               and subitems in place.
  649.               The result will be NULL if CreateMenusA() could not allocate
  650.               memory for the menus, or if the NewMenu array had an
  651.               illegal arrangement (eg. NM_SUB following NM_TITLE).
  652.               (see also the GTMN_SecondaryError tag above).
  653.  
  654.    NOTES
  655.     See gadtools/CreateMenusA() for more information.
  656.  
  657.    SEE ALSO
  658.     GU_LayoutMenusA(), GU_FreeMenus(), gadtools/CreateMenusA()
  659. gadutil.library/GU_DetachList                   gadutil.library/GU_DetachList
  660.  
  661.    NAME
  662.     GU_DetachList -- Disconnect the list from a listview gadget.
  663.  
  664.    SYNOPSIS
  665.     GU_DetachList(gad, win)
  666.                   D0   A0
  667.  
  668.     VOID GU_DetachList(struct Gadget *, struct Window *);
  669.  
  670.    FUNCTION
  671.     Detach a listview's list (without visual effect).
  672.     This has to be done before you can change anything in the list,
  673.     eg add a node, delete a node etc.
  674.  
  675.     Use GU_AttachList() to put the list back to the gadget.
  676.  
  677.    INPUTS
  678.     gad - Gadget to detach list from.
  679.     win - Window that the gadget is located in.
  680.  
  681.    RESULT
  682.     none
  683.  
  684.    BUGS
  685.     none known
  686.  
  687.    SEE ALSO
  688.     GU_AddTail(), GU_ClearList(), GU_NewList(), GU_AttachList()
  689.     GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_CountNodes(), GU_SortList()
  690. gadutil.library/GU_DisableGadget             gadutil.library/GU_DisableGadget
  691.  
  692.    NAME
  693.     GU_DisableGadget -- Disable / Enable a gadget.
  694.  
  695.    SYNOPSIS
  696.     GU_DisableGadget(status, gadget, window)
  697.                      D0,     A0,     A1
  698.  
  699.     VOID GU_DisableGadget(BOOL, struct Gadget *, struct Window *);
  700.  
  701.    FUNCTION
  702.     Disables or enables a gadget (that supports this).
  703.  
  704.    INPUTS
  705.     status - The new status for the gadget, TRUE for disabled, FALSE for
  706.              enabled.
  707.     gadget - A pointer to the gadget to change.
  708.     window - Pointer to the window that the gadget is placed in.
  709.  
  710.    RESULT
  711.     none
  712.  
  713.    BUGS
  714.     none known
  715.  
  716.    SEE ALSO
  717. gadutil.library/GU_DrawBevelBoxA             gadutil.library/GU_DrawBevelBoxA
  718.  
  719.    NAME
  720.     GU_DrawBevelBoxA -- Draw a bevelled box.
  721.  
  722.    SYNOPSIS
  723.     GU_DrawBevelBoxA(rport, left, top, width, height, taglist)
  724.                      A0     D0    D1   D2     D3      A1
  725.  
  726.     VOID GU_DrawBevelBoxA(struct RastPort *, WORD, WORD, WORD, WORD,
  727.                   struct TagItem *);
  728.  
  729.    FUNCTION
  730.     This function renders a bevelled box of specified dimensions
  731.     and type into the supplied RastPort.
  732.  
  733.    INPUTS
  734.     rport - RastPort into which the box is to be drawn.
  735.     left - left edge of the box.
  736.     top - top edge of the box.
  737.     width - width of the box.
  738.     height - height of the box.
  739.     tagList - pointer to an array of tags providing extra parameters
  740.  
  741.    RESULT
  742.     none
  743.  
  744.    NOTES
  745.     See gadtools/DrawBevelBoxA() for more information.
  746.  
  747.    SEE ALSO
  748.     GU_GetVisualInfoA(), gadtools/DrawBevelBoxA()
  749. gadutil.library/GU_EndRefresh                   gadutil.library/GU_EndRefresh
  750.  
  751.    NAME
  752.     GU_EndRefresh -- End refreshing friendly to GadTools.
  753.  
  754.    SYNOPSIS
  755.     GU_EndRefresh(win, complete)
  756.                   A0   D0
  757.  
  758.     VOID GU_EndRefresh(struct Window *, BOOL);
  759.  
  760.    FUNCTION
  761.  
  762.     Invokes the intuition.library/EndRefresh() function in a manner
  763.     friendly to the Gadget Toolkit.  This function call permits
  764.     GadTools gadgets to refresh themselves at the correct time.
  765.     Call this function to EndRefresh() when you have used
  766.     GU_BeginRefresh().
  767.  
  768.    INPUTS
  769.     win - pointer to Window structure for which a IDCMP_REFRESHWINDOW
  770.           IDCMP event was received.
  771.     complete - TRUE when done with refreshing.
  772.  
  773.    NOTES
  774.     See gadtools/GT_EndRefresh for more information.
  775.  
  776.    SEE ALSO
  777.     GU_BeginRefresh(), gadtools/GT_EndRefresh(), intuition/EndRefresh()
  778. gadutil.library/GU_FilterIMsg                   gadutil.library/GU_FilterIMsg
  779.  
  780.    NAME
  781.     GU_FilterIMsg -- Filter an IntuiMessage through GadTools.
  782.  
  783.    SYNOPSIS
  784.     modimsg = GU_FilterIMsg(imsg)
  785.     D0                      A1
  786.  
  787.     struct IntuiMessage *GU_FilterIMsg(struct IntuiMessage *);
  788.  
  789.    FUNCTION
  790.     NOTE WELL:  Extremely few programs will actually need this function.
  791.     You almost certainly should be using GT_GetIMsg() and GT_ReplyIMsg()
  792.     only, and not GT_FilterIMsg() and GT_PostFilterIMsg().
  793.  
  794.     GT_FilterIMsg() takes the supplied IntuiMessage and asks the
  795.     Gadget Toolkit to consider and possibly act on it.  Returns
  796.     NULL if the message was only of significance to a GadTools gadget
  797.     (i.e. not to you), else returns a pointer to a modified IDCMP
  798.     message, which may contain additional information.
  799.  
  800.     You should examine the Class, Code, and IAddress fields of
  801.     the returned message to learn what happened.  Do not make
  802.     interpretations based on the original imsg.
  803.  
  804.     You should use GT_PostFilterIMsg() to revert to the original
  805.     IntuiMessage once you are done with the modified one.
  806.  
  807.    INPUTS
  808.     imsg - an IntuiMessage you obtained from a Window's UserPort.
  809.  
  810.    RESULT
  811.     modimsg - a modified IntuiMessage, possibly with extra information
  812.               from GadTools, or NULL. When NULL, the message passed in to
  813.           the function should be sent back to Intuition via ReplyMsg().
  814.  
  815.    NOTES
  816.     See gadtools/GT_FilterIMsg() for more information.
  817.  
  818.    SEE ALSO
  819.     GU_GetIMsg(), GU_PostFilterIMsg(), gadtools/GT_FilterIMsg()
  820. gadutil.library/GU_FindNode                       gadutil.library/GU_FindNode
  821.  
  822.    NAME
  823.     GU_FindNode -- Find the node structure of a given node number
  824.  
  825.    SYNOPSIS
  826.     node = GU_FindNode(list, number)
  827.     D0,A0,SR(Z)        A0    D0
  828.  
  829.     struct Node *GU_FindNode(struct List *, WORD);
  830.  
  831.    FUNCTION
  832.     Finds a specified node in a list.
  833.  
  834.    INPUTS
  835.     list   - Struct List. The list in where to search.
  836.     number - Number of the node to find (counting from 0).
  837.  
  838.    RESULT
  839.     node  - Address to the node structure or NULL if the node wasn't
  840.             existing.
  841.  
  842.     SR(Z) - 0 for success, 1 for failure.
  843.  
  844.    BUGS
  845.     none known
  846.  
  847.    SEE ALSO
  848.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_AttachList()
  849.     GU_NodeUp(), GU_NodeDown(), GU_CountNodes(), GU_NewList(), GU_SortList()
  850. gadutil.library/GU_FreeGadgets                 gadutil.library/GU_FreeGadgets
  851.  
  852.    NAME
  853.     GU_FreeGadgets -- Free a linked list of gadgets.
  854.  
  855.    SYNOPSIS
  856.     GU_FreeGadgets(glist)
  857.                    A0
  858.  
  859.     VOID GU_FreeGadgets(struct Gadget *);
  860.  
  861.    FUNCTION
  862.     Frees all gadgets found on the linked list of gadgets beginning
  863.     with the specified one. Frees all the memory that was allocated
  864.     by GU_CreateGadgetA(). This function will return safely with no
  865.     action if it recieves a NULL parameter.
  866.  
  867.     Use this function in place of gadtools/FreeGadgets().
  868.  
  869.    INPUTS
  870.     glist - pointer to the first gadget in list to be freed
  871.  
  872.    SEE ALSO
  873.     GU_CreateGadgetA() , gadtools/FreeGadgets().
  874. gadutil.library/GU_FreeInput                     gadutil.library/GU_FreeInput
  875.  
  876.    NAME
  877.     GU_FreeInput -- Unblock input to a blocked window.
  878.  
  879.    SYNOPSIS
  880.     GU_FreeInput(window)
  881.                  A0
  882.  
  883.     VOID GU_FreeInput(struct Window *);
  884.  
  885.    FUNCTION
  886.     Unblock a window's user input. Call this function after blocking
  887.     the input with GU_BlockInput().
  888.  
  889.    INPUTS
  890.     window - the window that was blocked with GU_BlockInput().
  891.  
  892.    EXAMPLE
  893.  
  894.     BlockInput(myWin);
  895.     About();
  896.     FreeInput();
  897.  
  898.     Will block the parent window for user input while displaying the
  899.     About requester of a program.
  900.  
  901.    SEE ALSO
  902.     GU_BlockInput()
  903. gadutil.library/GU_FreeLayoutGadgets     gadutil.library/GU_FreeLayoutGadgets
  904.  
  905.    NAME
  906.     GU_FreeLayoutGadgets -- Frees gadgets laid out with GU_LayoutGadgetsA().
  907.  
  908.    SYNOPSIS
  909.     GU_FreeLayoutGadgets(gad_info)
  910.                              A0
  911.  
  912.     VOID GU_FreeLayoutGadgets(APTR);
  913.  
  914.    FUNCTION
  915.     Frees gadgets laid out with LayoutGadgetsA().
  916.  
  917.    INPUTS
  918.     gad_info - The pointer returned by LayoutGadgetsA().
  919.  
  920.    RESULT
  921.     none
  922.  
  923.    SEE ALSO
  924. gadutil.library/GU_FreeMenus                     gadutil.library/GU_FreeMenus
  925.  
  926.    NAME
  927.     GU_FreeMenus -- Frees memory allocated by GU_CreateMenusA().
  928.  
  929.    SYNOPSIS
  930.     GU_FreeMenus(menu)
  931.                  A0
  932.  
  933.     VOID GU_FreeMenus(struct Menu *);
  934.  
  935.    FUNCTION
  936.     Frees the menus allocated by GU_CreateMenusA().  It is safe to
  937.     call this function with a NULL parameter.
  938.  
  939.    INPUTS
  940.     menu - pointer to menu structure (or first MenuItem) obtained
  941.            from GU_CreateMenusA().
  942.  
  943.    NOTES
  944.     See gadtools/FreeMenus() for more information.
  945.  
  946.    SEE ALSO
  947.     GU_CreateMenusA(), gadtools/FreeMenus()
  948. gadutil.library/GU_FreeVisualInfo           gadutil.library/GU_FreeVisualInfo
  949.  
  950.    NAME
  951.     GU_FreeVisualInfo -- Return any resources taken by GU_GetVisualInfoA
  952.  
  953.    SYNOPSIS
  954.     GU_FreeVisualInfo(vi)
  955.                       A0
  956.  
  957.     VOID GU_FreeVisualInfo(APTR);
  958.  
  959.    FUNCTION
  960.     FreeVisualInfo() returns any memory or other resources that
  961.     were allocated by GetVisualInfoA(). You should only call this
  962.     function once you are done with using the gadgets (i.e. after
  963.         CloseWindow()), but while the screen is still valid (i.e. before
  964.         CloseScreen() or UnlockPubScreen()).
  965.  
  966.    INPUTS
  967.     vi - pointer that was obtained by calling GetVisualInfoA(). This
  968.          value may be NULL.
  969.  
  970.    NOTES
  971.     See gadtools/FreeVisualInfo() for more information.
  972.  
  973.    SEE ALSO
  974.     GU_GetVisualInfoA(), gadtools/FreeVisualInfo()
  975. gadutil.library/GU_GadgetArrayIndex       gadutil.library/GU_GadgetArrayIndex
  976.  
  977.    NAME
  978.     GU_GadgetArrayIndex -- Get a gadget's index in the LayoutGadget array.
  979.  
  980.    SYNOPSIS
  981.     index = GU_GadgetArrayIndex(id, gadgets)
  982.     D0,D1,SR(Z)                 D0  A0
  983.  
  984.     WORD GU_GadgetArrayIndex(WORD, struct LayoutGadget *);
  985.  
  986.    FUNCTION
  987.     Get a gadget's index in the Layoutgadget structure.
  988.    INPUTS
  989.     id      - The ID of the gadget you want to find.
  990.     gadgets - The LayoutGadget array that this gadget is defined in.
  991.  
  992.    RESULT
  993.     index - The index into the LayoutGadget array of the entry with the
  994.             gadget ID you asked for. Returns -1 for failure.
  995.  
  996.     SR(Z) - Set for failure. Cleared otherwise. Probably only usable for
  997.             assembly language programmers.
  998.  
  999.    SEE ALSO
  1000. gadutil.library/GU_GetGadgetAttrsA         gadutil.library/GU_GetGadgetAttrsA
  1001.  
  1002.    NAME
  1003.     GU_GetGadgetAttrsA -- Request the attributes of a GadTools gadget.
  1004.  
  1005.    SYNOPSIS
  1006.     numProcessed = GU_GetGadgetAttrsA(gad, win, req, taglist)
  1007.     D0                                A0   A1   A2   A3
  1008.  
  1009.     LONG *GU_GetGadgetAttrsA(struct Gadget *, struct Window *,
  1010.                  struct Requester *, struct TagItem *);
  1011.  
  1012.    FUNCTION
  1013.     Retrieve the attributes of the specified gadget, according to the
  1014.     attributes chosen in the tag list.  For each entry in the tag list,
  1015.     ti_Tag identifies the attribute, and ti_Data is a pointer to
  1016.     the long variable where you wish the result to be stored.
  1017.  
  1018.    INPUTS
  1019.     gad     - Pointer to the gadget in question, may be NULL.
  1020.     win     - Pointer to the window containing the gadget
  1021.     req     - Reserved for future use, should always be NULL
  1022.     taglist - Pointer to a TagItem list
  1023.  
  1024.    RESULT
  1025.     numProcessed - The number of attributes successfully filled in.
  1026.  
  1027.    NOTES
  1028.     See gadtools/GT_GetGadgetAttrsA() for tags and examples.
  1029.  
  1030.     Requires kickstart 3.0 (V39).
  1031.  
  1032.    SEE ALSO
  1033.     GU_SetGadgetAttrsA(), gadtools/GT_GetGadgetAttrsA()
  1034. gadutil.library/GU_GetGadgetPtr               gadutil.library/GU_GetGadgetPtr
  1035.  
  1036.    NAME
  1037.     GU_GetGadgetPtr -- Get a pointer to a gadget's gadget structure.
  1038.  
  1039.    SYNOPSIS
  1040.     gad = GU_GetGadgetPtr(id, gadgets)
  1041.     D0,SR(Z)              D0  A0
  1042.  
  1043.     APTR GU_GetGadgetPtr(UWORD, struct LayoutGadget *);
  1044.  
  1045.    FUNCTION
  1046.     Find a gadget's gadget structure by giving its ID. The gadget
  1047.     pointer is always found last in the LayoutGadget structure. You
  1048.     can use this function to get that pointer.
  1049.     It is also possible to get the gadget structure by taking it
  1050.     directly from the LayoutGadget structure array, but then you
  1051.     must know exactly in which structure it is located. Assembly
  1052.     language programmers can use a PC relative pointer to get the
  1053.     gadget pointer.
  1054.     
  1055.    INPUTS
  1056.     id - the ID of the gadget to search for
  1057.  
  1058.     gadgets - a pointer to the array of LayoutGadget structures.
  1059.  
  1060.    RESULT
  1061.     gad - pointer to the requested gadget. For bevelboxes, this
  1062.           function will return a BBoxData structure. A ProgressGad
  1063.           structure is returned for a progress display gadget.
  1064.  
  1065.    EXAMPLE
  1066.  
  1067.      Some of the LayoutGadget structures from BetterTest.c:
  1068.  
  1069.      struct LayoutGadget gadgets[] = {
  1070.     { MSG_NEXTDRIVE, NextDriveGad, StdGTTags,   NULL },
  1071.     { MSG_PREVDRIVE, PrevDriveGad, StdGTTags,   NULL },
  1072.     { MSG_DRIVE,     DriveGad,     DriveGTTags, NULL },
  1073.     { MSG_REQUESTER, ReqGad,       StdGTTags,   NULL },
  1074.     { MSG_CHECKME,   CheckBoxGad,  StdGTTags,   NULL },
  1075.     { MSG_FILENAME,  FileNameGad,  StdGTTags,   NULL },
  1076.     { -1,            NULL,         NULL,        NULL }
  1077.      };
  1078.  
  1079.     The examples should get the gadget structure of the Requester
  1080.     gadget (not assuming that ID's begin with 0).
  1081.     There is two methods you can use to get a gadgets structure:
  1082.  
  1083.     1. Use the pointer in the array directly:
  1084.  
  1085.     thegadget = gadgets[3].lg_Gadget
  1086.  
  1087.     This will only work if you know in which LayoutGadget structure
  1088.     the gadget is in.
  1089.  
  1090.     2. Use this library function:
  1091.  
  1092.     thegadget = GU_GetGadgetPtr(MSG_REQUESTER, gadgets);
  1093.  
  1094.     This will always work if all gadgets have a unique ID.
  1095.  
  1096.  
  1097.      Some of the LayoutGadget structures from BetterTest.s:
  1098.  
  1099.     gadgets:
  1100.      GADGET  MSG_NEXTDRIVE,  NextDriveGad,   StdGTTags
  1101.      GADGET  MSG_PREVDRIVE,  PrevDriveGad,   StdGTTags
  1102.      GADGET  MSG_DRIVE,      DriveGad,       DriveGTTags
  1103.      GADGET  MSG_REQUESTER,  ReqGad,         StdGTTags
  1104.      GADGET  MSG_CHECKME,    CheckBoxGad,    StdGTTags
  1105.      GADGET  MSG_FILENAME,   FileNameGad,    StdGTTags
  1106.      GADGET  -1,NULL,NULL
  1107.  
  1108.      Assembly language programmers can use three methods to get the
  1109.      pointer:
  1110.  
  1111.     1. Use the pointer in the array directly:
  1112.  
  1113.         lea.l    gadgets(pc),a0    ; Get array
  1114.         moveq.l    #lg_SIZEOF,d0    ; Get the size of the LayoutGadget
  1115.         mulu    #3,d0        ;  struct and calculate offset to
  1116.                     ;  the right structure in the array
  1117.         move.l    lg_Gadget(a0,d0.l),d0    ; Get the gadget pointer
  1118.  
  1119.     This will only work if you know in which LayoutGadget structure
  1120.     the gadget is in.
  1121.  
  1122.     2. Use this library function:
  1123.  
  1124.         lea.l    gadgets(pc),a0    ; Get array
  1125.         moveq.l    #MSG_REQUESTER,d0    ; Gadget to search for
  1126.         jsr    _LVOGU_GetGadgetPtr(a6)    ; Get gadget, result in D0
  1127.  
  1128.     This will always work if all gadgets have a unique ID.
  1129.  
  1130.     3. Use an extra label for each gadget that should be easy to
  1131.        access:
  1132.  
  1133.     gadgets:
  1134.      GADGET  MSG_NEXTDRIVE,  NextDriveGad,   StdGTTags
  1135.      GADGET  MSG_PREVDRIVE,  PrevDriveGad,   StdGTTags
  1136.      GADGET  MSG_DRIVE,      DriveGad,       DriveGTTags
  1137.      GADGET  MSG_REQUESTER,  ReqGad,         StdGTTags
  1138.     reqgad:        equ    *-4
  1139.      GADGET  MSG_CHECKME,    CheckBoxGad,    StdGTTags
  1140.      GADGET  MSG_FILENAME,   FileNameGad,    StdGTTags
  1141.     filenamegad:    equ    *-4
  1142.      GADGET  -1,NULL,NULL
  1143.  
  1144.         move.l    reqgad(pc),d0        ; Get the gadget
  1145.  
  1146.     This will always work.
  1147. gadutil.library/GU_GetIMsg                         gadutil.library/GU_GetIMsg
  1148.  
  1149.    NAME
  1150.     GU_GetIMsg -- Get an IntuiMessage, process GadTools & Hotkey events.
  1151.  
  1152.    SYNOPSIS
  1153.     imsg = GU_GetIMsg(intuiport)
  1154.     D0,A0,SR(Z)       A0
  1155.  
  1156.     struct IntuiMessage *GU_GetIMsg(struct MsgPort *);
  1157.  
  1158.    FUNCTION
  1159.     Use GU_GetIMsg() in place of the usual exec.library/GetMsg() when
  1160.     reading IntuiMessages from your window's UserPort. If needed, the
  1161.     GadTools dispatcher will be invoked, and suitable processing will
  1162.     be done for gadget actions.
  1163.     If the message is an IDCMP_VANILLAKEY or an IDCMP_RAWKEY, this
  1164.     routine will search through all gadgets    for that key, and if it is
  1165.     found, the message will change to the type of message that gadget
  1166.     is supposed to send. If the key is not used as a hotkey, the
  1167.     message will not change. 
  1168.     If there are no messages (or if the only messages are meaningful
  1169.     only to GadTools/GadUtil), NULL will be returned.
  1170.  
  1171.    INPUTS
  1172.     intuiport - the Window->UserPort of a window that is using the
  1173.         GadUtil library.
  1174.  
  1175.    RESULT
  1176.     imsg - pointer to modified IntuiMessage, or NULL if there are
  1177.            no applicable messages.
  1178.  
  1179.     SR (Z) - the zero flag will be set if there was no message. This
  1180.            is probably only useful for assembly language programmers.
  1181.  
  1182.    NOTES
  1183.     Be sure to use GU_ReplyIMsg() and not exec.library/ReplyMsg() on
  1184.     messages obtained with GU_GetIMsg().
  1185.     If you intend to do more with the resulting message than read its
  1186.     fields, act on it, and reply it, you may find GU_FilterIMsg()
  1187.     more appropriate.
  1188.  
  1189.     Starting with V39 (of the OS), this function actually returns a
  1190.     pointer to an ExtIntuiMessage structure, but the prototype was
  1191.     not changed for source code compatibility with older software.
  1192.  
  1193.    SEE ALSO
  1194.     GU_ReplyIMsg(), GU_FilterIMsg()
  1195. gadutil.library/GU_GetLocaleStr               gadutil.library/GU_GetLocaleStr
  1196.  
  1197.    NAME
  1198.     GU_GetLocaleStr -- Get a localized string from a catalog.
  1199.  
  1200.    SYNOPSIS
  1201.     string = GU_GetLocaleStr(stringID, catalog, defstrings)
  1202.     D0,A0                    D0        A0       A1
  1203.  
  1204.     STRPTR GU_GetLocaleStr(ULONG, struct Catalog *, struct AppString *);
  1205.  
  1206.    FUNCTION
  1207.     Get a localized string, or the default string, from a catalog or from
  1208.     the programs built-in strings.
  1209.  
  1210.    INPUTS
  1211.     stringID - the ID of the string to get
  1212.  
  1213.     catalog - the opened catalog for the program
  1214.  
  1215.     defstrings - an array of AppString structures, the programs built-in
  1216.              strings and ID's.
  1217.  
  1218.    RESULT
  1219.     string - the address of the localized string, or if the catalog was not
  1220.          available (or if the selected language was the programs built-
  1221.          ins), a pointer to the default string with the given ID.
  1222.  
  1223.    SEE ALSO
  1224.     GU_OpenCatalog(), GU_CloseCatalog()
  1225. gadutil.library/GU_GetVisualInfoA           gadutil.library/GU_GetVisualInfoA
  1226.  
  1227.    NAME
  1228.     GU_GetVisualInfoA -- Get information GadTools needs for visuals.
  1229.  
  1230.    SYNOPSIS
  1231.     vi = GU_GetVisualInfoA(screen, taglist)
  1232.     D0                     A0      A1
  1233.  
  1234.     APTR GU_GetVisualInfoA(struct Screen *, struct TagItem *);
  1235.  
  1236.    FUNCTION
  1237.  
  1238.     Get a pointer to a (private) block of data containing various bits
  1239.     of information that GadTools needs to ensure the best quality
  1240.     visuals.  Use the result in the NewGadget structure of any gadget
  1241.     you create, or as a parameter to the various menu calls.  Once the
  1242.     gadgets/menus are no longer needed (after the last CloseWindow()),
  1243.     call FreeVisualInfo().
  1244.  
  1245.    INPUTS
  1246.     screen - pointer to the screen you will be opening on. This parameter
  1247.          may be NULL, in which case this function fails.
  1248.     tagList - pointer to an array of tags providing optional extra
  1249.           parameters, or NULL.
  1250.  
  1251.    RESULT
  1252.     vi - pointer to private data, or NULL for failure
  1253.  
  1254.    NOTES
  1255.     See gadtools/GetVisualInfoA() for more information.
  1256.  
  1257.    SEE ALSO
  1258.     GU_FreeVisualInfo(), gadtools/FreeVisualInfo(), intuition/LockPubScreen(),
  1259.     intuition/UnlockPubScreen()
  1260. gadutil.library/GU_LayoutGadgetsA           gadutil.library/GU_LayoutGadgetsA
  1261.  
  1262.    NAME
  1263.     GU_LayoutGadgetsA -- Formats an array of GadTools gadgets.
  1264.  
  1265.    SYNOPSIS
  1266.     gad_info = GU_LayoutGadgetsA(gad_list, gadgets, screen, taglist)
  1267.     D0,A0                        A0        A1       A2      A3
  1268.  
  1269.     APTR GU_LayoutGadgetsA(struct Gadget **, struct LayoutGadget *,
  1270.         struct Screen *, struct TagItem *);
  1271.  
  1272.    FUNCTION
  1273.     Creates a laid-out gadget list from a LayoutGadget array, which
  1274.     describes each gadget you want to create. Gadgets you create can
  1275.     be any of the gadget kinds supported by GadTools, as well as any
  1276.     of the extended gadget kinds provided by GadUtil.
  1277.     The gadgets created by this routine, can easily be defined so that
  1278.     they adjust their sizes and positions to accomodate fonts of any
  1279.     size, and also adapt to different locale strings.
  1280.     
  1281.    INPUTS
  1282.     gad_list - a pointer to the gadget list pointer. This will be
  1283.            ready to pass to OpenWindowTagList() or AddGList().
  1284.  
  1285.     gadgets - an array of LayoutGadget structures. Each element in
  1286.           the array describes one of the gadgets that you will
  1287.           be creating. Each LayoutGadget structure in the array
  1288.           should be initialized as follows:
  1289.  
  1290.           lg_GadgetID - the ID for this gadget. An ID of -1
  1291.                 terminates the array. Don't use gadget ID's
  1292.                 in the range 65000(-536) to 65535 (-1). These
  1293.                 may be used internally in later versions of
  1294.                 GadUtil.
  1295.  
  1296.           lg_LayoutTags - tags that describes each gadget to
  1297.                   create. These tags is used to calculate
  1298.                   positions, sizes and other attributes
  1299.                   of the created gadgets.
  1300.  
  1301.           lg_GadToolsTags - additional tags for GadTools gadgets.
  1302.                     This would be the same set of tags that
  1303.                     you might pass to CreateGadgetA() if
  1304.                     you were using GadTools directly.
  1305.  
  1306.           lg_Gadget - the pointer to the Gadget structure created
  1307.                   for this gadget will be placed here. You
  1308.                   should initialize this field to NULL. The
  1309.                   gadget structure created should be considered
  1310.                   READ ONLY! This field will contain a pointer
  1311.                   to a struct BBoxData, if the created gadget
  1312.                   kind is a BEVELBOX_KIND or a LABEL_KIND.
  1313.                   PROGRESS_KIND gadgets will store a pointer to
  1314.                   a ProgressGad structure here.
  1315.  
  1316.           Assembly language programmers can use the macro GADGET:
  1317.  
  1318.             GADGET GadgetID, Gad_LayoutTags, Gad_GadToolsTags
  1319.  
  1320.     screen - a pointer to the screen that the gadgets will be created
  1321.          for. This is required, so that the layuot routines can
  1322.          get display info about the screen where the rendering
  1323.          will be done. Use LockPubScreen() to use a public screen,
  1324.          or OpenScreenTagList(), if you want to use your own screen.
  1325.  
  1326.     taglist - pointer to an array of tags providing optional extra
  1327.           parameters, or NULL.
  1328.  
  1329.                   These tags can be used here:
  1330.  
  1331.                     GU_RightExtreme (ULONG *)
  1332.                       A pointer to a longword that is used to store the
  1333.                       rightmost point that a gadget will exist in.
  1334.  
  1335.                     GU_LowerExtreme (ULONG *)
  1336.                       A pointer to a longword that is used to store the
  1337.                       lowermost point that a gadget woll exist in.
  1338.  
  1339.                     GU_Catalog (struct Catalog *)
  1340.                       A pointer to the programs translation catalog. NULL
  1341.                       indicates that the program should use the internal
  1342.                       strings. You must open the catalog by yourself (use
  1343.                       GU_OpenCatalog() or locale/OpenCatalog). The
  1344.                       GU_AppStrings tag MUST be used together with this tag.
  1345.  
  1346.                     GU_DefTextAttr (struct TextAttr *)
  1347.                       Specifies the default font to use with all gadgets. Can
  1348.                       be overridden with GU_TextAttr tag for each gadget.
  1349.  
  1350.                     GU_AppStrings (struct AppString *)
  1351.                       A pointer to an array of AppString structures. These
  1352.                       strutures contains the programs internal strings. This
  1353.                       tag must be used together with the GU_Catalog tag.
  1354.  
  1355.                     GU_BorderLeft (ULONG)
  1356.                       Size of the window's left border.
  1357.  
  1358.                     GU_BorderTop (ULONG)
  1359.                       Size of the window's top border.
  1360.  
  1361.                     GU_NoCreate (BOOL)
  1362.                       Don't create any gadgets. Useful to determine if the
  1363.                       window will fit on the screen etc. As of version 37.10 this
  1364.                       tag is also available in the gadget tags, making only one
  1365.                       gadget invisible at the time.
  1366.  
  1367.                     GU_MinimumIDCMP (ULONG *)
  1368.                       A pointer to a longword that is used to store the
  1369.                       minimum required IDCMP flags, so that all gadgets will
  1370.                       work. The longword can already be initialized, and any
  1371.                       new needed IDCMP flags will be appended to that
  1372.                       longword.
  1373.  
  1374.                     GU_DefWTitle (UBYTE *)
  1375.                       The text to show in the window title when the mouse pointer
  1376.                       is outside all objects (gadgets, strings, bevelboxes etc.)
  1377.                       that have a help string.
  1378.  
  1379.                     GU_DefLocWTitle (ULONG stringid)
  1380.                       Localized version of GU_DefWTitle. The ti_Data is a string ID
  1381.                       to be read from the locale catalog.
  1382.  
  1383.                     GU_DefSTitle (UBYTE *)
  1384.                       The text to show in the window's active screen title when the
  1385.                       mouse pointer is outside all objects that have a help string.
  1386.  
  1387.                     GU_DefLocSTitle (ULONG stringid)
  1388.                       Localized version of GU_DefSTitle. The ti_Data is a string ID
  1389.                       to be read from the locale catalog.
  1390.  
  1391.                     GU_DefHelpText (UBYTE *)
  1392.                       The text to show in the rest of the help display objects when
  1393.                       the mouse pointer is outside all objects that have a help
  1394.                       string.
  1395.  
  1396.                     GU_DefLocHelpText (ULONG stringid)
  1397.                       Localized version of GU_DefHelpText. The ti_Data is a string
  1398.                       ID to be read from the locale catalog.
  1399.  
  1400.    TAGS
  1401.  
  1402.    Tags for the gadgets lg_LayoutTags taglist. The other tags can be found in
  1403.    the autodoc to gadtools.library/CreateGadgetA().
  1404.  
  1405.    GU_GadgetKind (ULONG)
  1406.       Can be any of the standard GadTools gadget kinds, or one of the
  1407.       extensions provided by GadUtil. Currently extended types are:
  1408.  
  1409.          IMAGE_KIND
  1410.            A gadget that uses an Intuition Image structure for its
  1411.            contents. Selected and unselected states can use different
  1412.            images. The images are centered automatically.
  1413.  
  1414.            The value in the LayoutGadget's lg_Gadget field is a pointer to
  1415.            a Gadget structure.
  1416.  
  1417.            Extra tags for IMAGE_KIND:
  1418.  
  1419.               GUIM_Image (struct Image *)
  1420.                  Image for the gadget in its unselected state. This is
  1421.                  the only required (extra) tag for IMAGE_KIND gadgets.
  1422.  
  1423.               GUIM_SelectImg (struct Image *)
  1424.                  Image for the gadget in its selected state. If this tag
  1425.                  is omitted, the selected image will be the same as the
  1426.                  unselected, and only the border and the background color
  1427.                  will change (depending on the GUIM_BOOPSILook tag).
  1428.  
  1429.               GUIM_ReadOnly (BOOL)
  1430.                  TRUE to create a read-only image gadget.
  1431.  
  1432.               GUIM_BOOPSILook (BOOL)
  1433.                  This tag will allow the programmer to select how the
  1434.                  secondary image should be shown, if only one image is
  1435.                  used for the gadget. Defaults to TRUE, which means that
  1436.                  the background color will change when the user selects
  1437.                  the gadget.
  1438.  
  1439.          DRAWER_KIND
  1440.            A "select drawer" image button. This can be used to select
  1441.            a path, but is often used to select files.
  1442.  
  1443.            The value in the LayoutGadget's lg_Gadget field is a pointer to
  1444.            a Gadget structure.
  1445.  
  1446.          FILE_KIND
  1447.            A "select file" image button. This can be used to allow the
  1448.            user to select a file. Most programs uses the DRAWER_KIND
  1449.            for both file and path selection.
  1450.  
  1451.            The value in the LayoutGadget's lg_Gadget field is a pointer to
  1452.            a Gadget structure.
  1453.  
  1454.          BEVELBOX_KIND
  1455.            A GadTools bevelbox. Use this to avoid the use of absolute
  1456.            sizing of bevelboxes. All bevel box kinds from OS3.0 is
  1457.            supported, even if the computer only has OS2.0.
  1458.  
  1459.            The function GU_RefreshBoxes() can be used to redraw all
  1460.            bevelboxes.
  1461.  
  1462.            The value in the LayoutGadget's lg_Gadget field is a pointer to
  1463.            a BBoxData structure.
  1464.  
  1465.            Extra tags for BEVELBOX_KIND:
  1466.  
  1467.               GUBB_Recessed (BOOL)
  1468.                  Create a recessed ("pushed in") bevel box. Differs from
  1469.                  the GadTools tag GTBB_Recessed, in that it works with
  1470.                  both TRUE and FALSE as parameter. GadTools creates a
  1471.                  recessed box independent from the given value.
  1472.  
  1473.                  Defaults to FALSE.
  1474.  
  1475.               GUBB_FrameType (ULONG)
  1476.                  Determines what kind of box this function renders. The
  1477.                  current available alternatives are:
  1478.  
  1479.                     BFT_BUTTON - Generates a box like what is used around
  1480.                                  a GadTools BUTTON_KIND gadget.
  1481.  
  1482.                     BFT_RIDGE - Generates a box like what is used around
  1483.                                 a GadTools STRING_KIND gadget.
  1484.  
  1485.                     BFT_DROPBOX - Generates a box suitable for a standard
  1486.                                   icon drop box imagery.
  1487.  
  1488.                     BFT_HORIZBAR - Generates a horizontal shadowed line.
  1489.                                    Can also be used to draw a normal line,
  1490.                                    using 1 for the line's height.
  1491.  
  1492.                     BFT_VERTBAR - Generates a vertical shadowed line. Can
  1493.                                   also be used to draw a normal line, using
  1494.                                   1 for the line's width.
  1495.  
  1496.                  Defaults to BFT_BUTTON.
  1497.  
  1498.               GUBB_TextColor (ULONG)
  1499.                  Selects which color to print the title text in. Only useful
  1500.                  for a bevelbox with a title. Defaults to the color of the
  1501.                  TEXTPEN.
  1502.  
  1503.               GUBB_TextPen (ULONG)
  1504.                  Selects which pen to print the title text in. Only
  1505.                  useful for a bevelbox with a title. Defaults to TEXTPEN.
  1506.                  This tag overrides the GUBB_TextColor tag.
  1507.  
  1508.               GUBB_Flags (ULONG)
  1509.                  Flags for text placement, text shadowing and 3D text:
  1510.  
  1511.                  Y-pos flags
  1512.                  ~~~~~~~~~~~
  1513.                     BB_TEXT_ABOVE - Places the bevel box text above the upper
  1514.                                     border of the box           ___Example___
  1515.  
  1516.                     BB_TEXT_IN    - Places the bevel box text at the upper
  1517.                                     border of the box           ---Example---
  1518.  
  1519.                     BB_TEXT_BELOW - Places the bevel box text below the upper
  1520.                                     border of the box           ___       ___
  1521.                                                                    Example
  1522.                  X-pos flags
  1523.                  ~~~~~~~~~~~
  1524.                     BB_TEXT_CENTER - Places the bevel box text in the middle
  1525.                                      of the upper border        ---Example---
  1526.  
  1527.                     BB_TEXT_LEFT   - Places the bevel box text 8 pixels from
  1528.                                      the left edge of the box   -Example-----
  1529.  
  1530.                     BB_TEXT_RIGHT  - Places the bevel box text 8 pixels from
  1531.                                      the right edge of the box  -----Example-
  1532.  
  1533.                  Combined flags
  1534.                  ~~~~~~~~~~~~~~
  1535.                     BB_TEXT_ABOVE_CENTER - BB_TEXT_ABOVE + BB_TEXT_CENTER
  1536.                     BB_TEXT_ABOVE_LEFT   - BB_TEXT_ABOVE + BB_TEXT_LEFT
  1537.                     BB_TEXT_ABOVE_RIGHT  - BB_TEXT_ABOVE + BB_TEXT_RIGHT
  1538.  
  1539.                     BB_TEXT_IN_CENTER    - BB_TEXT_IN + BB_TEXT_CENTER
  1540.                     BB_TEXT_IN_LEFT      - BB_TEXT_IN + BB_TEXT_LEFT
  1541.                     BB_TEXT_IN_RIGHT     - BB_TEXT_IN + BB_TEXT_RIGHT
  1542.  
  1543.                     BB_TEXT_BELOW_CENTER - BB_TEXT_BELOW + BB_TEXT_CENTER
  1544.                     BB_TEXT_BELOW_LEFT   - BB_TEXT_BELOW + BB_TEXT_LEFT
  1545.                     BB_TEXT_BELOW_RIGHT  - BB_TEXT_BELOW + BB_TEXT_RIGHT
  1546.  
  1547.                  Default is BB_TEXT_ABOVE|BB_TEXT_CENTER. Combine the x and y
  1548.                  position flags by OR:ing them together. Don't combine two X
  1549.                  or two Y flags together.
  1550.                 
  1551.                  Shadow placement flags
  1552.                  ~~~~~~~~~~~~~~~~~~~~~~
  1553.                     BB_SHADOW_DR - Places the bevel box text shadow one pixel
  1554.                                    below and to the right of the text. 
  1555.  
  1556.                     BB_SHADOW_UR - Places the bevel box text shadow one pixel
  1557.                                    above and to the right of the text. 
  1558.  
  1559.                     BB_SHADOW_DL - Places the bevel box text shadow one pixel
  1560.                                    below and to the left of the text. 
  1561.  
  1562.                     BB_SHADOW_UL - Places the bevel box text shadow one pixel
  1563.                                    above and to the left of the text. 
  1564.  
  1565.                     BB_SUNAT_UL  - Another name for BB_SHADOW_DR
  1566.                     BB_SUNAT_DL  - Another name for BB_SHADOW_UR
  1567.                     BB_SUNAT_UR  - Another name for BB_SHADOW_DL
  1568.                     BB_SUNAT_DR  - Another name for BB_SHADOW_UL
  1569.  
  1570.                  Default is BB_SHADOW_DR (BB_SUNAT_UL).
  1571.  
  1572.                     BB_3DTEXT    - This flag can be used in place of the tag
  1573.                                    GUBB_3DText, TRUE
  1574.  
  1575.               GUBB_3DText (BOOL)
  1576.                  Enables the shadow on the bevel box text. This tag must be
  1577.                  used if GUBB_ShadowColor or GUBB_ShadowPen isn't used.
  1578.                  Another way to enable 3D text is to set the flag BB_3DTEXT
  1579.                  in the GUBB_Flags tag.
  1580.  
  1581.               GUBB_ShadowColor (ULONG)
  1582.                  Selects which color to print the shadow text in. Only useful
  1583.                  for a bevelbox with a title. Defaults to the color of the
  1584.                  SHADOWPEN.
  1585.  
  1586.               GUBB_ShadowPen (ULONG)
  1587.                  Selects which pen to print the shadow text in. Only useful
  1588.                  for a bevelbox with a title. Defaults to SHADOWPEN.
  1589.                  This tag overrides the GUBB_ShadowColor tag.
  1590.  
  1591.          PROGRESS_KIND
  1592.            Gadget used to display a value out of a total. Can be used to
  1593.            display the progress of a search, a diskcopy or anything else.
  1594.  
  1595.            The value in the LayoutGadget's lg_Gadget field is a pointer to
  1596.            a ProgressGad structure.
  1597.  
  1598.            Extra tags for PROGRESS_KIND:
  1599.  
  1600.               GUPR_FillColor (ULONG)
  1601.                  Selects which color to use to paint the current value of
  1602.                  the progress requester with. Defaults to the color of the
  1603.                  FILLPEN.
  1604.  
  1605.               GUPR_FillPen (ULONG)
  1606.                  Selects which pen to use to paint the current value of
  1607.                  the progress requester with. Defaults to the FILLPEN.
  1608.                  This tag overrides the GUPR_FillColor tag.
  1609.  
  1610.               GUPR_BackColor (ULONG)
  1611.                  Selects which color to fill the background of the progress
  1612.                  requester with. Defaults to the color of the BACKGROUNDPEN.
  1613.  
  1614.               GUPR_BackPen (ULONG)
  1615.                  Selects which pen to fill the background of the progress
  1616.                  requester with. Defaults to the BACKGROUNDPEN.
  1617.                  This tag overrides the GUPR_BackColor tag.
  1618.  
  1619.               GUPR_Current (ULONG)
  1620.                  The initial current value of the progress requester. The
  1621.                  gadget's current value may be changed later by directly
  1622.                  modifying the pg_Current field of the ProgressGad structure.
  1623.                  Use GU_UpdateProgress to redraw the progress requester with
  1624.                  the new value. The pg_Current field must not be larger than
  1625.                  4.294.967.295 / the width of the progress gadget. A "normal"
  1626.                  width of 410 pixels allows a current value of 10.737.418.
  1627.          Defaults to 0.
  1628.  
  1629.               GUPR_Total (ULONG)
  1630.                  The initial total value of the progress requester. The
  1631.                  gadget's total value may be changed later by directly
  1632.                  modifying the pg_Total field of the ProgressGad structure.
  1633.                  Use GU_UpdateProgress() to redraw the progress requester with
  1634.                  the new value. The total value can be as large as a longword
  1635.                  allows (4.294.967.295), but you can't display a current value
  1636.                  larger than 4.294.967.295 / the width of the progress gadget.
  1637.          Defaults to 100.
  1638.  
  1639.          LABEL_KIND
  1640.            A text label. Use this to avoid the use of absolute placement
  1641.            of text that you print into the window. Supports the most of
  1642.            the text placement and shadow flags for the BEVELBOX_KIND.
  1643.  
  1644.            The function GU_RefreshBoxes() can be used to redraw all
  1645.            text created by LABEL_KIND gadgets.
  1646.  
  1647.            The value in the LayoutGadget's lg_Gadget field is a pointer to
  1648.            a BBoxData structure.
  1649.  
  1650.            Extra tags for LABEL_KIND:
  1651.  
  1652.               GULB_TextColor (ULONG)
  1653.                  Selects which color to print the text in. Defaults to the
  1654.                  color of the TEXTPEN.
  1655.  
  1656.               GULB_TextPen (ULONG)
  1657.                  Selects which pen to print the text in. Defaults to TEXTPEN.
  1658.                  This tag overrides the GULB_TextColor tag.
  1659.  
  1660.               GULB_Flags (ULONG)
  1661.                  Flags for text placement, text shadowing and 3D text:
  1662.  
  1663.                  ___1_____2_____3___
  1664.                  |_____|_____|_____| A
  1665.                  |_____|_____|_____| B 
  1666.                  |_____|_____|_____| C
  1667.                  
  1668.                  Y-pos flags
  1669.                  ~~~~~~~~~~~
  1670.                     LB_TEXT_TOP    - Places the topmost point of the text below
  1671.                                      the upper border of the box (row A)
  1672.  
  1673.                     LB_TEXT_MIDDLE - Places the text centered in the box, not
  1674.                                      counting in the part of the text that is
  1675.                                      below the font's baseline (row B)
  1676.  
  1677.                     LB_TEXT_BOTTOM - Places the text at the bottom of the box.
  1678.                                      Any part of the text that is below the
  1679.                                      baseline will be below the box (row C)
  1680.  
  1681.                  X-pos flags
  1682.                  ~~~~~~~~~~~
  1683.                     LB_TEXT_CENTER - Places the text centered on the width of
  1684.                                      the box (column 2).
  1685.  
  1686.                     LB_TEXT_LEFT   - Places the text left adjusted in the box
  1687.                                      (column 1)
  1688.  
  1689.                     LB_TEXT_RIGHT  - Places the text right adjusted in the box
  1690.                                      (column 3)
  1691.  
  1692.                  Combined flags
  1693.                  ~~~~~~~~~~~~~~
  1694.                     LB_TEXT_TOP_CENTER    - LB_TEXT_TOP + LB_TEXT_CENTER
  1695.                     LB_TEXT_TOP_LEFT      - LB_TEXT_TOP + LB_TEXT_LEFT
  1696.                     LB_TEXT_TOP_RIGHT     - LB_TEXT_TOP + LB_TEXT_RIGHT
  1697.  
  1698.                     LB_TEXT_MIDDLE_CENTER - LB_TEXT_MIDDLE + LB_TEXT_CENTER
  1699.                     LB_TEXT_MIDDLE_LEFT   - LB_TEXT_MIDDLE + LB_TEXT_LEFT
  1700.                     LB_TEXT_MIDDLE_RIGHT  - LB_TEXT_MIDDLE + LB_TEXT_RIGHT
  1701.  
  1702.                     LB_TEXT_BOTTOM_CENTER - LB_TEXT_BOTTOM + LB_TEXT_CENTER
  1703.                     LB_TEXT_BOTTOM_LEFT   - LB_TEXT_BOTTOM + LB_TEXT_LEFT
  1704.                     LB_TEXT_BOTTOM_RIGHT  - LB_TEXT_BOTTOM + LB_TEXT_RIGHT
  1705.  
  1706.                  Default is LB_TEXT_TOP|LB_TEXT_CENTER. Combine the x and y
  1707.                  position flags by OR:ing them together. Don't combine two X
  1708.                  or two Y flags together.
  1709.                 
  1710.                  Shadow placement flags
  1711.                  ~~~~~~~~~~~~~~~~~~~~~~
  1712.                     LB_SHADOW_DR - Places the bevel box text shadow one pixel
  1713.                                    below and to the right of the text. 
  1714.  
  1715.                     LB_SHADOW_UR - Places the bevel box text shadow one pixel
  1716.                                    above and to the right of the text. 
  1717.  
  1718.                     LB_SHADOW_DL - Places the bevel box text shadow one pixel
  1719.                                    below and to the left of the text. 
  1720.  
  1721.                     LB_SHADOW_UL - Places the bevel box text shadow one pixel
  1722.                                    above and to the left of the text. 
  1723.  
  1724.                     LB_SUNAT_UL  - Another name for LB_SHADOW_DR
  1725.                     LB_SUNAT_DL  - Another name for LB_SHADOW_UR
  1726.                     LB_SUNAT_UR  - Another name for LB_SHADOW_DL
  1727.                     LB_SUNAT_DR  - Another name for LB_SHADOW_UL
  1728.  
  1729.                  Default is LB_SHADOW_DR (LB_SUNAT_UL).
  1730.  
  1731.                     LB_3DTEXT    - This flag can be used in place of the tag
  1732.                                    GULB_3DText, TRUE
  1733.  
  1734.               GULB_3DText (BOOL)
  1735.                  Enables the shadow on the text. This tag must be used if
  1736.                  GULB_ShadowColor or GULB_ShadowPen isn't used. Another
  1737.                  way to enable 3D text is to set the flag LB_3DTEXT in the
  1738.                  GULB_Flags tag.
  1739.  
  1740.               GULB_ShadowColor (ULONG)
  1741.                  Selects which color to print the shadow text in. Defaults to
  1742.                  the color of the SHADOWPEN.
  1743.  
  1744.               GULB_ShadowPen (ULONG)
  1745.                  Selects which pen to print the shadow text in. Defaults to
  1746.                  SHADOWPEN. This tag overrides the GULB_ShadowColor tag.
  1747.  
  1748.          Changed tags, and additions to GadTools:
  1749.  
  1750.          LISTVIEW_KIND
  1751.  
  1752.            GTLV_ShowSelected (UWORD id)
  1753.  
  1754.               This tag was changed, so that you don't have to create the
  1755.               string gadget before all other gadgets. The difference from
  1756.               this tag in GadTools, is that we now have to give the ID of
  1757.               the string gadget to use to show the selected item.
  1758.  
  1759.               An example of a valid (and probably most useful) gadget to
  1760.               use for GTLV_ShowSelected:
  1761.  
  1762.               ShowSelGad:
  1763.                   dc.l    GU_GadgetKind,  STRING_KIND,    GU_AutoHeight,  4
  1764.                   dc.l    GU_DupeWidth,   GAD_LISTVIEW,   GU_GadgetText,  NULL
  1765.                   dc.l    TAG_DONE
  1766.  
  1767.               This gadget MUST be before the LISTVIEW gadget in the LayoutGadget
  1768.               array.
  1769.  
  1770.               Special:
  1771.  
  1772.               ti_Data = -1    Creates a read-only gadget below the listview,
  1773.                               same as for GTLV_ShowSelected, 0  for GadTools.
  1774.  
  1775.               ti_Data =  x    Gadget ID for the gadget that the selected item
  1776.                               should be displayed in. Same as GadTools reaction
  1777.                               on a gadget pointer in ti_Data.
  1778.  
  1779.               This gadget's ti_Data field will be changed during the creation
  1780.               of the gadget, but will be changed back before GU_LayoutGadgets
  1781.               returns.
  1782.  
  1783.          MX_KIND
  1784.           The gng_GadgetText field in the NewGadget structure can be used
  1785.           even with MX_KIND gadgets. This should have been included in
  1786.           GadTools. The gadget text will always be placed ABOVE the gadget,
  1787.           on the same side as the other texts for the gadget. Positions are
  1788.           checked against WBPattern & SerialPrefs to get them "right". The
  1789.           GU_GadgetText and GU_LocaleText tags are used to access this field.
  1790.  
  1791.  
  1792.    Tags for all gadget kinds:
  1793.  
  1794.    Gadget width control:
  1795.  
  1796.       GU_Width (UWORD wid)
  1797.          Absolute width of the gadget. Not recommended to use for other
  1798.          gadgets than IMAGE_KIND, DRAWER_KIND and FILE_KIND.
  1799.  
  1800.       GU_DupeWidth (UWORD id)
  1801.          Duplicate the width of another gadget.
  1802.  
  1803.       GU_AutoWidth (WORD add)
  1804.          Width = length of text label + ti_Data. For CYCLE_KIND gadgets,
  1805.      the gadget width will be calculated by checking the length of
  1806.      all alternatives and using the one that is widest + 26 as width.
  1807.  
  1808.       GU_Columns (UWORD numcols)
  1809.          Set the gadget width so that approximately ti_Data columns of
  1810.          text will fit.
  1811.  
  1812.       GU_AddWidth (WORD add)
  1813.          Add ti_Data to the total width calculation.
  1814.  
  1815.       GU_MinWidth (UWORD wid)
  1816.          Make the gadget at least ti_Data pixels wide.
  1817.  
  1818.       GU_MaxWidth (UWORD wid)
  1819.          Make the gadget at most ti_Data pixels wide.
  1820.  
  1821.       GU_AddWidChar (WORD chars)
  1822.          Add the length of ti_Data characters to the total width calculation.
  1823.  
  1824.       GU_FractWidth (LONG parts)
  1825.      Divide or multiply the gadget's width with ti_Data. A positive
  1826.      value divides the gadget's width by the ti_Data, a negative ti_Data
  1827.      multiplies the gadget's width with ti_Data.
  1828.  
  1829.     Gadget height control:
  1830.  
  1831.       GU_Height (UWORD hei)
  1832.          Absolute height of the gadget. Not recommended to use for other
  1833.          gadgets than IMAGE_KIND, DRAWER_KIND and FILE_KIND.
  1834.         
  1835.       GU_DupeHeight (UWORD id)
  1836.          Duplicate the height of another gadget.
  1837.  
  1838.       GU_AutoHeight (WORD add)
  1839.          Height = height of the gadget's font + ti_Data. This tag doesn't
  1840.          work as it should with MX_KIND gadgets. Will be fixed later.
  1841.          Use GU_HeightFactor or GU_Height for MX_KIND until this is fixed.
  1842.  
  1843.       GU_HeightFactor (UWORD numlines)
  1844.          Set the gadget height to approximately ti_Data lines.
  1845.  
  1846.       GU_AddHeight (WORD add)
  1847.          Add ti_Data to the total height calculation.
  1848.  
  1849.       GU_MinHeight (UWORD wid)
  1850.          Make the gadget at least ti_Data pixels high.
  1851.  
  1852.       GU_MaxHeight (UWORD wid)
  1853.          Make the gadget at most ti_Data pixels high.
  1854.  
  1855.       GU_AddHeiLines (WORD numlines)
  1856.          Add the height of ti_Data/2 lines to the final height calculation.
  1857.          The numlines argument is given in units of 1/2 lines to get
  1858.          better resolution (ti_Data of 4 means that the height of 2
  1859.          lines should be added).
  1860.  
  1861.       GU_FractHeight (LONG parts)
  1862.      Divide or multiply the gadget's height with ti_Data. A positive
  1863.      value divides the gadget's height by the ti_Data, a negative ti_Data
  1864.      multiplies the gadget's height with ti_Data.
  1865.  
  1866.    Gadget top edge control:
  1867.  
  1868.       GU_Top, GU_TopRel and GU_AlignTop locks the top edge of the gadget, and
  1869.       allows any bottom edge control tag to adjust the height, so that both
  1870.       top and bottom edges will be correct.
  1871.  
  1872.       GU_Top (UWORD ypos)
  1873.          Absolute top edge of the gadget. Not recommended to use for other
  1874.          gadgets than the top-most gadgets.
  1875.  
  1876.       GU_TopRel (UWORD id)
  1877.          Make the top edge relative to another gadgets bottom edge. This
  1878.          gadget will be placed BELOW the given gadget.
  1879.  
  1880.       GU_AddTop (WORD add)
  1881.          Add ti_Data to the final top edge calculation.
  1882.  
  1883.       GU_AlignTop (UWORD id)
  1884.          Align the top edge of the gadget with another gadgets top edge.
  1885.  
  1886.       GU_AdjustTop (WORD add)
  1887.          Add the height of the text font + ti_Data to the top edge.
  1888.  
  1889.       GU_AddTopLines (WORD numlines)
  1890.          Add the height of ti_Data/2 lines to the final top edge. The
  1891.          numlines argument is given in units of 1/2 lines to get better
  1892.          resolution (ti_Data of 4 means that the height of 2 lines
  1893.          should be added).
  1894.  
  1895.    Gadget bottom edge control:
  1896.  
  1897.       GU_Bottom, GU_BottomRel and GU_AlignBottom locks the bottom edge of the
  1898.       gadget, and allows any top edge control tag to adjust the height, so that
  1899.       both top and bottom edges will be correct.
  1900.  
  1901.       GU_Bottom (UWORD ypos)
  1902.          Absolute bottom edge of the gadget. Not recommended to use for other
  1903.          gadgets than the bottom-most gadgets. Should not be necessary to use
  1904.          at all.
  1905.  
  1906.       GU_BottomRel (UWORD id)
  1907.          Make the bottom edge relative to another gadgets top edge. This
  1908.          gadget will be placed ABOVE the given gadget.
  1909.  
  1910.       GU_AddBottom (WORD add)
  1911.          Add ti_Data to the final bottom edge calculation.
  1912.  
  1913.       GU_AlignBottom (UWORD id)
  1914.          Align the bottom edge of the gadget with another gadgets bottom edge.
  1915.  
  1916.       GU_AdjustBottom (WORD add)
  1917.          Subtract the height of the gadget's font + ti_Data from the top edge.
  1918.          This will move the gadget UPWARDS (ti_Data + font height) pixels.
  1919.  
  1920.    Gadget left edge control:
  1921.  
  1922.       GU_Left, GU_LeftRel and GU_AlignLeft locks the left edge of the gadget,
  1923.       and allows any right edge control tag to adjust the width, so that both
  1924.       left and right edges will be correct.
  1925.  
  1926.       GU_Left (UWORD xpos)
  1927.          Absoulute left edge of the gadget. Not recommended to use for other
  1928.          gadgets than the left-most gadgets.
  1929.  
  1930.       GU_LeftRel (UWORD id)
  1931.          Make the left edge relative to another gadgets right edge. This
  1932.          gadget will be placed TO THE RIGHT of the given gadget.
  1933.  
  1934.       GU_AddLeft (WORD add)
  1935.          Add ti_Data to the final left edge calculation.
  1936.  
  1937.       GU_AlignLeft (UWORD id)
  1938.          Align the left edge of the gadget with another gadgets left edge.
  1939.  
  1940.       GU_AdjustLeft (WORD add)
  1941.          Add the width of the gadget label + ti_Data to the left edge.
  1942.  
  1943.       GU_AddLeftChar (WORD chars)
  1944.          Add the length of ti_Data characters to the left edge.
  1945.  
  1946.    Gadget right edge control:
  1947.  
  1948.       GU_Right, GU_RightRel and GU_AlignRight locks the right edge of the
  1949.       gadget, and allows any left edge control tag to adjust the width, so
  1950.       that both left and right edges will be correct.
  1951.  
  1952.       GU_Right (UWORD xpos)
  1953.          Absoulute right edge of the gadget. Not recommended to use for other
  1954.          gadgets than the right-most gadgets. Should not be necessary to use
  1955.          at all.
  1956.  
  1957.       GU_RightRel (UWORD id)
  1958.          Make the right edge relative to another gadgets left edge. This
  1959.          gadget will be placed TO THE LEFT of the given gadget.
  1960.  
  1961.       GU_AddRight (WORD add)
  1962.          Add ti_Data to the final right edge calculation.
  1963.  
  1964.       GU_AlignRight (UWORD id)
  1965.          Align the right edge of the gadget with another gadgets right edge.
  1966.  
  1967.       GU_AdjustRight (WORD add)
  1968.          Add the width of the gadget label + ti_Data to the left edge.
  1969.  
  1970.     Other tags:
  1971.  
  1972.       GU_ToggleSelect (BOOL)
  1973.          Create a toggle select gadget. Works with BUTTON_KIND and IMAGE_KIND
  1974.          gadgets.
  1975.  
  1976.       GU_Selected (BOOL)
  1977.          Set the initial value of a toggle select gadget.
  1978.  
  1979.       GU_Hotkey (CHAR)
  1980.          Hotkey that should simulate a press (release) of a gadget.
  1981.  
  1982.       GU_HotkeyCase (BOOL)
  1983.          Make the hotkey case-sensitive. Default is not case sensitive.
  1984.  
  1985.       GU_LabelHotkey (BOOL)
  1986.          Get the hotkey directly from the gadget's label. The hotkey can
  1987.          be case-sensitive, but not for CYCLE, LISTVIEW and MX gadgets.
  1988.  
  1989.       GU_RawKey (BOOL)
  1990.          Use a rawkey as a gadget hotkey. May not be case-sensitive.
  1991.         
  1992.       GU_HelpGadget (ULONG)
  1993.          GadgetID of the TEXT_KIND or the STRING_KIND to show the gadget's
  1994.          help text in. There exists two "special" GadgetID's that can be
  1995.      used with this tag:
  1996.  
  1997.      WINTITLE_HELP - shows the help text in the windows's titlebar.
  1998.  
  1999.      SCRTITLE_HELP - shows the help text in the screen's titlebar.
  2000.  
  2001.      These tags won't work if your window doesn't use the WFLG_REPORTMOUSE
  2002.      (or the tag WA_ReportMouse, TRUE). The IDCMP is handled automatically
  2003.      if you use the layout tag GU_MinimumIDCMP, otherwise you'll have to
  2004.      use IDCMP_MOUSEMOVE in your IDCMP mask.
  2005.  
  2006.      Beginning with v37.9 of GadUtil, it is possible to set default strings
  2007.      for the help display objects. See the explanation of the tags passed to
  2008.      this function (the taglist parameter) for more info about the default
  2009.      strings.
  2010.  
  2011.       GU_HelpText (UBYTE *)
  2012.          The text that is shown in the help gadget (GU_HelpGadget) when the
  2013.          mouse pointer is placed on the gadget.
  2014.  
  2015.       GU_LocaleHelp (ULONG stringid)
  2016.          Get gadget help text from a catalog. This makes it easy to create
  2017.          localized help strings in the program.
  2018.  
  2019.       GU_NoCreate (BOOL)
  2020.          Don't create this gadget. Useful if you need invisible objects in
  2021.          the window for layout purposes.
  2022.  
  2023.       GU_StoreLeft (UWORD *)
  2024.          Store the gadget's calculated left edge in the word that ti_Data
  2025.          points to.
  2026.  
  2027.       GU_StoreTop (UWORD *)
  2028.          Store the gadget's calculated top edge in the word that ti_Data
  2029.          points to.
  2030.  
  2031.       GU_StoreWidth (UWORD *)
  2032.          Store the gadget's calculated width in the word that ti_Data
  2033.          points to.
  2034.  
  2035.       GU_StoreHeight (UWORD *)
  2036.          Store the gadget's calculated height in the word that ti_Data
  2037.          points to.
  2038.  
  2039.       GU_StoreRight (UWORD *)
  2040.          Store the gadget's calculated right edge in the word that ti_Data
  2041.          points to.
  2042.  
  2043.       GU_StoreBottom (UWORD *)
  2044.          Store the gadget's calculated bottom edge in the word that ti_Data
  2045.          points to.
  2046.  
  2047.    Tags that gives access to other fields in the NewGadget structure:
  2048.  
  2049.       GU_GadgetText (UBYTE *)
  2050.          A pointer to the gadget's label. Will be copied directly into the
  2051.          gng_GadgetText field of the NewGadget structure.
  2052.  
  2053.       GU_TextAttr (struct TextAttr *)
  2054.          A pointer to an initialized TextAttr structure (to select the font).
  2055.          Will be copied directly into the gng_TextAttr field of the NewGadget
  2056.          structure.
  2057.  
  2058.       GU_Flags (ULONG)
  2059.          Gadget flags. Currently available flags are as for GadTools, but
  2060.          here is a short list of them:
  2061.  
  2062.          PLACETEXT_LEFT - Place the gadget label right aligned on the left
  2063.                           side of the gadget.
  2064.  
  2065.          PLACETEXT_RIGHT - Place the gadget label left aligned on the right
  2066.                            side of the gadget.
  2067.  
  2068.          PLACETEXT_ABOVE - Place the gadget label centered above the gadget.
  2069.  
  2070.          PLACETEXT_BELOW - Place the gadget label centered below the gadget.
  2071.  
  2072.          PLACETEXT_IN - Place the gadget label centered inside the gadget.
  2073.  
  2074.          NG_HIGHLABEL - Highlight the label (render it using SHINEPEN).
  2075.  
  2076.       *** GU_UserData (APTR) *** REMOVED in v37.7 ***
  2077.  
  2078.       GU_LocaleText (ULONG stringid)
  2079.          Get gadget label from a catalog. This allows easy localization of
  2080.          all new programs.
  2081.  
  2082.  
  2083.    RESULT
  2084.     gad_info - a pointer to a private structure. You must keep this
  2085.            value and pass it to GU_FreeLayoutGadgets() later on
  2086.            in order to free up all resources used by your gadgets.
  2087.            This pointer is also used in a lot of other functions
  2088.            in this library.
  2089.  
  2090.     The UserData pointer of all created gadgets will contain a pointer
  2091.     to a GU_Public structure. You can use this structure to obtain some
  2092.     info about the gadget, such as current, max and minimum values.
  2093.     The gu_MaxVal, gu_MinVal, and gu_Active fields are kind specific:
  2094.  
  2095.     MX_KIND:    gu_Active = the selected entry (GTMX_Active)
  2096.             gu_MaxVal = number of choices - 1
  2097.             gu_MinVal = 0
  2098.  
  2099.     SLIDER_KIND:    gu_Active = the selected value (GTSL_Level)
  2100.             gu_MaxVal = maximum allowed value (GTSL_Max)
  2101.             gu_MinVal = minimum allowed value (GTSL_Min)
  2102.  
  2103.     CYCLE_KIND:    gu_Active = the selected entry (GTCY_Active)
  2104.             gu_MaxVal = number of choices - 1
  2105.             gu_MinVal = 0
  2106.     
  2107.     SCROLLER_KIND:    gu_Active = the top value (GTSC_Top)
  2108.             gu_MaxVal = the total value (GTSC_Total)
  2109.             gu_MinVal = number visible in scroller (GTSC_Visible)
  2110.  
  2111.     LISTVIEW_KIND:    gu_Active = the selected entry (GTLV_Selected)
  2112.             gu_MaxVal = number of nodes in list - 1
  2113.             gu_MinVal = number of visible entries
  2114.  
  2115.     PALETTE_KIND:    gu_Active = the selected color (GTPA_Color)
  2116.             gu_MaxVal = the maximum color number that can be
  2117.                         selected (GTPA_NumColors, GTPA_Depth^2-1)
  2118.             gu_MinVal = 0
  2119.  
  2120.     STRING_KIND:    gu_Active = pointer to the string buffer
  2121.  
  2122.     TEXT_KIND:    gu_Active = pointer to the displayed string
  2123.  
  2124.     INTEGER_KIND:    gu_Active = the current displayed/editable number. This
  2125.                         value is _not_ updated if the gadget is
  2126.                         deactivated by clicking outside it.
  2127.  
  2128.     NUMBER_KIND:    gu_Active = the current displayed number
  2129.  
  2130.     These values are initialized upon creation of the gadget, and updated
  2131.     automatically when using GU_GetIMsg and    GU_SetGadgetAttrsA.
  2132.  
  2133.    NOTES
  2134.     You must be careful with the taglist in the lg_LayoutTags field.
  2135.     Tags are processed sequentally in the order you give them in, and
  2136.     if a tag references another gadget (eg. the GU_TopRel tag), then
  2137.     processing of the current gadget halts while the referenced gadget
  2138.     is processed (if it has not already been processed). Problems can
  2139.     occur if this gadget refers back to the original gadget that
  2140.     referenced if, if it is referring to a field that has not yet been
  2141.     processed in that gadget.
  2142.  
  2143.         Also note that you do not have to specify any tags that do not
  2144.         change from gadget to gadget. Just be sure that you know in which
  2145.     order the gadgets are processed (eg. relatives etc).
  2146.  
  2147.     Another thing to note, is that we have tried to make the processing
  2148.     of position and width / height tags as usable as possible, what I
  2149.     mean with this, is that if you eg first define the left edge and
  2150.     then define the right edge, the width will change. BUT, there are
  2151.     special cases when this isn't true. This is because we have tried
  2152.     out this and decided that this was the best way to do it.
  2153.  
  2154.     Here comes some examples of the special cases;
  2155.  
  2156.     dc.l    GU_AlignLeft, GAD_1    ; Left edge aligned with GAD_1's left.
  2157.     dc.l    GU_AlignRight, GAD_2    ; This stretches the gadget, so that
  2158.                     ; both the left and right edges are
  2159.                     ; positioned as defined.
  2160.     ; Then, if we want to move the right edge 2 pixels right, and the left
  2161.     ; edge two pixels right, we might try this:
  2162.  
  2163.     dc.l    GU_AddLeft, -2        ; This works as we want, it moves the
  2164.                     ; left edge to the right place, but it
  2165.                     ; also moves the whole gadget two
  2166.                     ; pixels left..
  2167.  
  2168.     dc.l    GU_AddRight, 2        ; <- This is a common mistake. This
  2169.                     ; moves the whole gadget to the right.
  2170.                     ; Ie. it is moved back to the old
  2171.                     ; position, not as we wanted...
  2172.  
  2173.     ; But if we replace the previous line with the following;
  2174.  
  2175.     dc.l    GU_AddWith,4        ; This works just as we wanted it to.
  2176.                     ; Now the gadget should be 4 pixels
  2177.                     ; wider, two to the left and two to
  2178.                     ; the right.
  2179.  
  2180.     The same goes for GU_AddHeight and GU_AddBottom etc.
  2181.  
  2182.     This is actually a feature. Sometimes you might want to move the whole
  2183.     button, so we made it work this way.
  2184.  
  2185.  
  2186.    SEE ALSO
  2187.     GU_FreeLayoutGadgets(), GU_CreateGadgetA(), gadtools/CreateGadgetA()
  2188.     GU_RefreshWindow(), GU_RefreshBoxes(), GU_UpdateProgress()
  2189. gadutil.library/GU_LayoutMenuItemsA       gadutil.library/GU_LayoutMenuItemsA
  2190.  
  2191.    NAME
  2192.     GU_LayoutMenuItemsA -- Position all the menu items.
  2193.  
  2194.    SYNOPSIS
  2195.     success = GU_LayoutMenuItemsA(menuitem, vi, tags)
  2196.     D0                            A0        A1  A2
  2197.  
  2198.     BOOL GU_LayoutMenuItemsA(struct MenuItem *, APTR, struct TagItem *);
  2199.  
  2200.    FUNCTION
  2201.     Lays out all the menu items and sub-items according to
  2202.     the supplied visual information and tag parameters. You would use this
  2203.     if you used CreateMenusA() to make a single menu-pane (with sub-items,
  2204.     if any), instead of a whole menu strip.
  2205.     This routine attempts to columnize and/or shift the MenuItems in
  2206.     the event that a menu would be too tall or too wide.
  2207.  
  2208.    INPUTS
  2209.     menuitem - Pointer to the first MenuItem in a linked list of items.
  2210.     vi       - Pointer returned by GU_GetVisualInfoA().
  2211.     tags     - Pointer to an array of tags providing optional extra
  2212.                information.
  2213.  
  2214.    TAGS
  2215.     See gadtools/LayoutMenuItemsA() for tags.
  2216.  
  2217.    RESULT
  2218.     success  - TRUE if successfull, FALSE otherwise.
  2219.  
  2220.    SEE ALSO
  2221.     GU_CreateMenusA(), GU_GetVisualInfoA(), gadtools/LayoutMenuItemsA()
  2222. gadutil.library/GU_LayoutMenusA       gadutil.library/GU_LayoutMenusA
  2223.  
  2224.    NAME
  2225.     GU_LayoutMenusA -- Position all the menus and menu items.
  2226.  
  2227.    SYNOPSIS
  2228.     success = GU_LayoutMenusA(menu, vi, taglist)
  2229.     D0                        A0    A1  A2
  2230.  
  2231.     BOOL GU_LayoutMenusA(struct Menu *, APTR, struct TagItem *);
  2232.  
  2233.    FUNCTION
  2234.     Lays out all the menus, menu items and sub-items in the supplied
  2235.     menu according to the supplied visual information and tag parameters.
  2236.     This routine attempts to columnize and/or shift the MenuItems in
  2237.     the event that a menu would be too tall or too wide.
  2238.  
  2239.     These GadTools routines are only here to make it simpler for someone
  2240.     who wants to use them. This for example, is of no use if you use the
  2241.     GadUtil function GU_CreateLocMenuA() to define localized (optional)
  2242.     menus with automatic hotkey handlimg etc.
  2243.  
  2244.    INPUTS
  2245.     menu    - Pointer to menu obtained from GU_CreateMenusA() or
  2246.               GU_CreateLocMenuA().
  2247.     vi      - Pointer returned by GU_GetVisualInfoA.
  2248.     taglist - Pointer to an array of tags providing optional extra
  2249.               parameters.
  2250.  
  2251.    TAGS
  2252.     See gadtools/LayoutMenusA() for tags.
  2253.  
  2254.    RESULT
  2255.     success - TRUE if successfull, FALSE otherwise.
  2256.  
  2257.    NOTES
  2258.     See gadtools/LayoutMenusA() for more information.
  2259.  
  2260.    SEE ALSO
  2261.     GU_CreateMenusA(), GU_GetVisualInfoA(), gadtools/LayoutMenusA()
  2262. gadutil.library/GU_NewList                         gadutil.library/GU_NewList
  2263.  
  2264.    NAME
  2265.     GU_NewList -- Initialize a list header for use.
  2266.  
  2267.    SYNOPSIS
  2268.     GU_NewList(list)
  2269.                A0
  2270.  
  2271.     VOID GU_NewList(struct List *);
  2272.  
  2273.    FUNCTION
  2274.     This initializes a list header for use. Much easier than to do it
  2275.     by hand.
  2276.  
  2277.    INPUTS
  2278.     list - Struct List.
  2279.  
  2280.    RESULT
  2281.     none
  2282.  
  2283.    BUGS
  2284.     none known
  2285.  
  2286.    SEE ALSO
  2287.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_AttachList()
  2288.     GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_CountNodes(), GU_SortList()
  2289. gadutil.library/GU_NodeDown                       gadutil.library/GU_NodeDown
  2290.  
  2291.    NAME
  2292.     GU_NodeDown -- Move a node one step towards the end of the list
  2293.  
  2294.    SYNOPSIS
  2295.     success = GU_NodeDown(node, list)
  2296.     D0,SR(Z)              A0    A1
  2297.  
  2298.     BOOL GU_NodeDown(struct Node *, struct List *);
  2299.  
  2300.    FUNCTION
  2301.     Move a node one step downwards in a list. To do the opposite, see
  2302.     GU_NodeUp().
  2303.  
  2304.    INPUTS
  2305.     node - The node to move.
  2306.     list - The list that the node is a part of.
  2307.  
  2308.    RESULT
  2309.     success - TRUE if the node could be moved, else FALSE.
  2310.     SR (Z)  - 0 if node could be moved, else 1.
  2311.  
  2312.    BUGS
  2313.     none known
  2314.  
  2315.    SEE ALSO
  2316.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_AttachList()
  2317.     GU_FindNode(), GU_NodeUp(), GU_CountNodes(), GU_NewList(), GU_SortList()
  2318. gadutil.library/GU_NodeUp                           gadutil.library/GU_NodeUp
  2319.  
  2320.    NAME
  2321.     GU_NodeUp -- Move a node one step towards the top of the list
  2322.  
  2323.    SYNOPSIS
  2324.     success = GU_NodeUp(node, list)
  2325.     D0,SR(Z)            A0    A1
  2326.  
  2327.     BOOL GU_NodeUp(struct Node *, struct List *);
  2328.  
  2329.    FUNCTION
  2330.     Move a node one step up. You can also use the function GU_NodeDown()
  2331.     for moving downwards.
  2332.  
  2333.    INPUTS
  2334.     node - The node to move.
  2335.     list - The list that the node is a part of.
  2336.  
  2337.    RESULT
  2338.     success - TRUE if the node could be moved, else FALSE
  2339.     SR(Z)   - 0 if the node could be moved, else 1.
  2340.  
  2341.    BUGS
  2342.     none known
  2343.  
  2344.    SEE ALSO
  2345.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_AttachList(),
  2346.     GU_FindNode(), GU_NodeDown(), GU_CountNodes(), GU_NewList(), GU_SortList()
  2347. gadutil.library/GU_OpenCatalog                 gadutil.library/GU_OpenCatalog
  2348.  
  2349.    NAME
  2350.     GU_OpenCatalog -- Open a message catalog.
  2351.  
  2352.    SYNOPSIS
  2353.     catalog = GU_OpenCatalog(name, version)
  2354.     D0                       A0    D0
  2355.  
  2356.     struct Catalog *GU_OpenCatalog(STRPTR, ULONG);
  2357.  
  2358.    FUNCTION
  2359.     This function opens a message catalog. Catalogs contain all the
  2360.     text strings that an application uses. These strings can easily
  2361.     be replaced by strings in a different language, which causes the
  2362.     application to magically start operation in that new language.
  2363.  
  2364.     Catalogs originally come from disk files. This function searches
  2365.     for them in the following places:
  2366.  
  2367.         PROGDIR:Catalogs/languageName/name
  2368.         LOCALE:Catalogs/languageName/name
  2369.  
  2370.     where languageName is the name of the language associated with the
  2371.     locale parameter.
  2372.  
  2373.    INPUTS
  2374.     catalogname - the NULL terminated name of the catalog to open (just
  2375.               the name, not the complete path to it).
  2376.  
  2377.     version - required version of the catalog to open. Passign 0 as version
  2378.           number means that the program will accept any found version of
  2379.           the catalog. Other values than 0 means exactly that version.
  2380.  
  2381.    RESULT
  2382.     catalog - A message catalog to use with GU_GetLocaleStr or any of the
  2383.           Locale library functions or NULL. NULL is returned on error
  2384.           or if the application can use its built-in strings instead
  2385.           of loading a catalog from disk.
  2386.  
  2387.    EXAMPLE
  2388.     GU_OpenCatalog("myprogram.catalog",0);
  2389.  
  2390.     will open any version of the catalog file "myprogram.catalog" found
  2391.     in either PROGDIR:Catalogs/languageName/ (where the program was started
  2392.     from), or LOCALE:Catalogs/languageName/.
  2393.  
  2394.     GU_OpenCatalog("myprogram.catalog",5);
  2395.  
  2396.     will open version 5 of the catalog file. If v5 is not available, the
  2397.     program will use its internal strings.
  2398.  
  2399.    NOTES
  2400.     If you want to specify other tags than the version tag, you must
  2401.     use the Locale library OpenCatalog(). This function is generally a
  2402.     shortcut to that function. By using this routine, you may not need
  2403.     to open Locale library at all.
  2404.  
  2405.     This routine assumes that the built-in language of the program is
  2406.     english. If you write your programs in another language, you must
  2407.     open the catalog by yourself.
  2408.  
  2409.    SEE ALSO
  2410.     GU_CloseCatalog(), locale/OpenCatalog()
  2411. gadutil.library/GU_OpenFont                       gadutil.library/GU_OpenFont
  2412.  
  2413.    NAME
  2414.     GU_OpenFont -- Load and get a pointer to a disk or system font.
  2415.  
  2416.    SYNOPSIS
  2417.     font = GU_OpenFont(textAttr)
  2418.     D0                 A0
  2419.  
  2420.     struct TextFont *GU_OpenFont(struct TextAttr *);
  2421.  
  2422.    FUNCTION
  2423.     Open a disk or ROM based font. Uses diskfont library if available.
  2424.     Much easier to use than the standard OpenFont functions.
  2425.  
  2426.    INPUTS
  2427.     textAttr - This is a pointer to a TextAttr structure.
  2428.  
  2429.    RESULT
  2430.     font - Struct TextFont ot NULL for failure.
  2431.  
  2432.    BUGS
  2433.     none known
  2434.  
  2435.    SEE ALSO
  2436.     GU_CloseFont()
  2437. gadutil.library/GU_PostFilterIMsg           gadutil.library/GU_PostFilterIMsg
  2438.  
  2439.    NAME
  2440.     GU_PostFilterIMsg -- Return the unfiltered message after
  2441.                  GU_FilterIMsg() was called, and clean up.
  2442.  
  2443.    SYNOPSIS
  2444.     imsg = GU_PostFilterIMsg(modimsg)
  2445.     D0                       A1
  2446.  
  2447.     struct IntuiMessage *GU_PostFilterIMsg(struct IntuiMessage *);
  2448.  
  2449.    FUNCTION
  2450.     NOTE WELL:  Extremely few programs will actually need this function.
  2451.     You almost certainly should be using GT_GetIMsg() and GT_ReplyIMsg()
  2452.     only, and not GT_FilterIMsg() and GT_PostFilterIMsg().
  2453.  
  2454.     Performs any clean-up necessitated by a previous call to
  2455.     GT_FilterIMsg().  The original IntuiMessage is now yours to handle.
  2456.     Do not interpret the fields of the original IntuiMessage, but
  2457.     rather use only the one you got from GT_FilterIMsg().  You
  2458.     may only do message related things at this point, such as queueing
  2459.     it up or replying it.  Since you got the message with
  2460.     exec.library/GetMsg(), your responsibilities do include replying
  2461.     it with exec.library/ReplyMsg(). This function may be safely
  2462.     called with a NULL parameter.
  2463.  
  2464.    INPUTS
  2465.     modimsg - A modified IntuiMessage obtained with GU_FilterIMsg(),
  2466.               or NULL.
  2467.  
  2468.    RESULT
  2469.     imsg - a pointer to the original IntuiMessage, if GT_FilterIMsg()
  2470.            returned non-NULL.
  2471.  
  2472.    NOTES
  2473.     See gadtools/GT_PostFilterIMsg for more information.
  2474.  
  2475.    SEE ALSO
  2476.     GU_FilterIMsg(), gadtools/GT_PostFilterIMsg()
  2477. gadutil.library/GU_RefreshBoxes               gadutil.library/GU_RefreshBoxes
  2478.  
  2479.    NAME
  2480.     GU_RefreshBoxes -- Redraw all bevel boxes in a window.
  2481.  
  2482.    SYNOPSIS
  2483.     GU_RefreshBoxes(window, gad_info)
  2484.                     A0      A1
  2485.  
  2486.     VOID GU_RefreshBoxes(struct Window *, APTR);
  2487.  
  2488.    FUNCTION
  2489.     Redraw all bevel boxes and PROGRESS_KIND gadgets in a window.
  2490.     Also refreshes all text in the window that is created by the
  2491.     LABEL_KIND gadget. This function is basically the same as
  2492.     GU_RefreshWindow, without a call to the GT_RefreshWindow
  2493.     function.
  2494.  
  2495.    INPUTS
  2496.     window - Window to be refreshed.
  2497.  
  2498.     gad_info - The value returned by GU_LayoutGadgetsA()
  2499.  
  2500.    RESULT
  2501.     none
  2502.  
  2503.    BUGS
  2504.     no known
  2505.  
  2506.    SEE ALSO
  2507.     GU_UpdateProgress(), GU_RefreshWindow()
  2508. gadutil.library/GU_RefreshWindow             gadutil.library/GU_RefreshWindow
  2509.  
  2510.    NAME
  2511.     GU_RefreshWindow -- Redraw bevel boxes and gadgets in a window.
  2512.  
  2513.    SYNOPSIS
  2514.     GU_RefreshWindow(window, gad_info)
  2515.                      A0      A1
  2516.  
  2517.     VOID GU_RefreshWindow(struct Window *, APTR);
  2518.  
  2519.    FUNCTION
  2520.     Perform the initial refresh of all the GadTools gadgets you have
  2521.     created. After you have opened your window, you must call this
  2522.     function. Or, if you have opened your window without gadgets,
  2523.     you add the gadgets with intuition/AddGList(), refresh them using
  2524.     intuition/RefreshGList(), then call this function. You should not
  2525.     need this function at other times.
  2526.  
  2527.     This function differs from the gadtools/GT_RefreshWindow(), in that
  2528.     is also renders all bevelbox kind gadgets. If NULL is given in
  2529.     gad_info, no boxes will be rendered, and this function will work
  2530.     exactly as the GT_RefreshWindow().
  2531.  
  2532.    INPUTS
  2533.     window - pointer to the window containing GadTools gadgets.
  2534.  
  2535.     gad_info - the value returned from GU_LayoutGadgetsA(), or NULL.
  2536.  
  2537.    SEE ALSO
  2538.     GU_RefreshBoxes(), GU_UpdateProgress()
  2539. gadutil.library/GU_ReplyIMsg                     gadutil.library/GU_ReplyIMsg
  2540.  
  2541.    NAME
  2542.     GU_ReplyIMsg -- Reply a message obtained with GU_GetIMsg().
  2543.  
  2544.    SYNOPSIS
  2545.     GU_ReplyIMsg(imsg)
  2546.                  A1
  2547.  
  2548.     VOID GU_ReplyIMsg(struct IntuiMessage *);
  2549.  
  2550.    FUNCTION
  2551.     Return a modified IntuiMessage obtained with GU_GetIMsg(). If you
  2552.     use GU_GetIMsg(), use this function where you would normally have
  2553.     used exec/ReplyIMsg() or gadtools/GT_ReplyIMsg(). You may safely
  2554.     call this function with a NULL pointer (nothing will be done).
  2555.  
  2556.    INPUTS
  2557.     imsg - a modified IntuiMessage obtained with GT_GetIMsg(), or NULL
  2558.            in which case this function does nothing.
  2559.  
  2560.    NOTES
  2561.     When using GadUtil, you MUST explicitly GU_ReplyIMsg() all messages
  2562.     you receive. You cannot depend on CloseWindow() to handle messages
  2563.     you have not replied.
  2564.  
  2565.     Starting with V39, this function actually expects a pointer to an
  2566.     ExtIntuiMessage structure, but the prototype was not changed for
  2567.     source code compatibility with older software.
  2568.  
  2569.    SEE ALSO
  2570.     GU_GetIMsg()
  2571. gadutil.library/GU_SetGadgetAttrsA         gadutil.library/GU_SetGadgetAttrsA
  2572.  
  2573.    NAME
  2574.     GU_SetGadgetAttrsA -- Change the attributes of a GadTools gadget.
  2575.  
  2576.    SYNOPSIS
  2577.     GU_SetGadgetAttrsA(gad, win, req, taglist)
  2578.                        A0    A1  A2   A3
  2579.  
  2580.     VOID GU_SetGadgetAttrsA(struct Gadget *, struct Window *,
  2581.                 struct Requester *, struct TagItem *);
  2582.  
  2583.    FUNCTION
  2584.     Change the attributes of the specified gadget, according to the
  2585.     attributes chosen in the tag list. If an attribute is not provided
  2586.     in the tag list, its value remains the unchanged. This function
  2587.     also stores some information for the hotkey part of the library.
  2588.  
  2589.     Use this in place of the gadtools function GT_SetGadgetAttrsA().
  2590.  
  2591.    INPUTS
  2592.     gad - pointer to the gadget in question. This address may be NULL,
  2593.           in which case this function does nothing.
  2594.  
  2595.     win - pointer to the window containing the gadget. Starting with
  2596.           V39 (of the OS), this value may be NULL, in which case the
  2597.           internal attributes of the gadgets are altered but no
  2598.           rendering occurs.
  2599.  
  2600.     req - reserved for future use, should always be NULL.
  2601.  
  2602.     taglist - pointer to an array of tags providing optional extra
  2603.           parameters, or NULL.
  2604.  
  2605.    TAGS
  2606.     See the GadTools function GT_SetGadgetAttrsA() for all tags, since
  2607.     this is an extended version of that routine.
  2608.  
  2609.    NOTES
  2610.     This function may not be called inside of a GU_BeginRefesh() /
  2611.     GU_EndRefresh() session. (as always, restrict yourself to simple
  2612.     rendering functions).
  2613.  
  2614.    SEE ALSO
  2615.     gadtools/GT_SetGadgetAttrsA(), GU_GetGadgetAttrsA()
  2616. gadutil.library/GU_SetGUGadAttrsA           gadutil.library/GU_SetGUGadAttrsA
  2617.  
  2618.    NAME
  2619.     GU_SetGUGadAttrsA -- Change the attributes of a GadUtil gadget.
  2620.  
  2621.    SYNOPSIS
  2622.     GU_SetGUGadAttrsA(gad_info, gad, win, taglist)
  2623.                           A0        A1   A2   A3
  2624.  
  2625.     VOID GU_SetGadAttrsA(APTR, struct Gadget *, struct Window *,
  2626.                 struct TagItem *);
  2627.  
  2628.    FUNCTION
  2629.     Change attributes of a GadUtil gadget.
  2630.  
  2631.    INPUTS
  2632.     gad_info - The value returned by LayoutGadgetsA().
  2633.     gad      - Pointer to the gadget in question.
  2634.     win      - Pointer to the window containing the gadget.
  2635.     taglist  - Pointer to a TagItem list.
  2636.    TAGS
  2637.     See GU_LayoutGadgetsA() for tags.
  2638.  
  2639.    RESULT
  2640.     none
  2641.  
  2642.    SEE ALSO
  2643. gadutil.library/GU_SetToggle                     gadutil.library/GU_SetToggle
  2644.  
  2645.    NAME
  2646.     GU_SetToggle -- Change status of a toggle-select gadget.
  2647.  
  2648.    SYNOPSIS
  2649.     GU_SetToggle(status, gadget, window)
  2650.                  D0,     A0,     A1
  2651.  
  2652.     VOID GU_SetToggle(BOOL, struct Gadget *, struct Window *);
  2653.  
  2654.    FUNCTION
  2655.     This function selects or unselects a toggle gadget, that means a
  2656.     gadget with the tag GU_ToggleSelect set to TRUE.
  2657.  
  2658.     For some more information about the tags, look in <libraries/gadutil.h>
  2659.     or in the autodoc for the GU_LayoutGadgetsA() function.
  2660.  
  2661.    INPUTS
  2662.     status - New status for the gadget. TRUE for selected, FALSE for
  2663.              unselected.
  2664.     gadget - The gadget to change.
  2665.     window - Window that the gadget is located in.
  2666.  
  2667.    RESULT
  2668.     none
  2669.  
  2670.    BUGS
  2671.     none known
  2672.  
  2673.    SEE ALSO
  2674.     GU_LayoutGadgetsA(), <libraries/gatutil.h>, <libraries/gadutil.i>
  2675. gadutil.library/GU_SizeWindow                   gadutil.library/GU_SizeWindow
  2676.  
  2677.    NAME
  2678.     GU_SizeWindow -- Resize a window, and moves it if necessary
  2679.  
  2680.    SYNOPSIS
  2681.     success = GU_SizeWindow(window, deltax, deltay)
  2682.     D0,SR(Z)                A0      D0      D1
  2683.  
  2684.     BOOL GU_SizeWindow(struct Window *, WORD, WORD);
  2685.  
  2686.    FUNCTION
  2687.     This function sends a reuqest to Intuition asking to size the window
  2688.     the specified amounts. The delta arguments describes how much to
  2689.     size the window along the respective axes.
  2690.  
  2691.     This function works like the Intuition function SizeWindow(), and the
  2692.     parameters are also the same. This function also moves the window
  2693.     automatically if it could not be sized at the current position.
  2694.  
  2695.     Remember that this function does not change the window immediately.
  2696.     Just like the Intuition functions SizeWindow(), MoveWindow() and
  2697.     ChangeWindowBox(), you have to wait for a IDCMP_CHANGEWINDOW IDCMP
  2698.     message to arrive.
  2699.  
  2700.     An extra feature of GU_SizeWindow is that it sends back a result,
  2701.     telling you if the window could be resized or not.
  2702.  
  2703.    INPUTS
  2704.     window - pointer to the structure of the window to be sized
  2705.  
  2706.     deltax - signed value describing how much to size the window
  2707.              on the x-axis
  2708.  
  2709.     deltay - signed value describing how much to size the window
  2710.              on the y-axis
  2711.  
  2712.    RESULT
  2713.     success - TRUE if the window could be sized the specified amount
  2714.  
  2715.     SR(Z)   - 0 if function returns TRUE, 1 otherwise
  2716.  
  2717.    BUGS
  2718.     none known
  2719.  
  2720.    SEE ALSO
  2721.     intuition/ChangeWindowBox(), intuition/SizeWindow()
  2722.     intuition/MoveWindow()
  2723. gadutil.library/GU_SortList                       gadutil.library/GU_SortList
  2724.  
  2725.    NAME
  2726.     GU_SortList -- Sorts all nodes in a list.
  2727.  
  2728.    SYNOPSIS
  2729.     GU_SortList(list,slavelist)
  2730.                 A0   A1
  2731.  
  2732.     VOID GU_SortList(struct List *, struct List *);
  2733.  
  2734.    FUNCTION
  2735.     Sorts all items an a list and optionally in a slave list.
  2736.  
  2737.     The slave list option can be used eg. if you have a ListView
  2738.     gadget that shows a number of filenames and another list
  2739.     with the path-names to the files in the other list.
  2740.  
  2741.     Note that the slavelist pointer must be NULL if not used.
  2742.  
  2743.    INPUTS
  2744.     list      - A pointer to the list to sort
  2745.     slavelist - A pointer to an optional slave list (or NULL).
  2746.  
  2747.    NOTES
  2748.     Written in assembler using Shell-sort, so it is quite fast..
  2749.  
  2750.    SEE ALSO
  2751.     GU_AddTail(), GU_ClearList(), GU_DetachList(), GU_AttachList()
  2752.     GU_FindNode(), GU_NodeUp(), GU_NodeDown(), GU_NewList(), GU_CountNodes()
  2753. gadutil.library/GU_TextWidth                     gadutil.library/GU_TextWidth
  2754.  
  2755.    NAME
  2756.     GU_TextWidth -- Calculate the pixel length of a text string.
  2757.  
  2758.    SYNOPSIS
  2759.     textwidth = GU_TextWidth(string, textattr)
  2760.     D0                       A0      A1
  2761.  
  2762.     ULONG GU_TextWidth(STRPTR, struct TextAttr *);
  2763.  
  2764.    FUNCTION
  2765.     Calculate the length of the text, using the specified font. This
  2766.     function will open the required font, if it isn't opened before.
  2767.  
  2768.    INPUTS
  2769.     string - NULL terminated text to calculate width of.
  2770.  
  2771.     textattr - a filled in TextAttr structure.
  2772.  
  2773.    RESULT
  2774.     textwidth - pixel length of the text
  2775. gadutil.library/GU_UpdateProgress           gadutil.library/GU_UpdateProgress
  2776.  
  2777.    NAME
  2778.     GU_UpdateProgress -- Redraw all or specified progress gadget(s).
  2779.  
  2780.    SYNOPSIS
  2781.     GU_UpdateProgress(window, gad_info, gadget)
  2782.                       A0      A1        A2
  2783.  
  2784.     VOID GU_UpdateProgress(struct Window *, APTR, struct ProgressGad *);
  2785.  
  2786.    FUNCTION
  2787.         Redraws all or one specified PROGRESS_KIND gadget in a window.
  2788.  
  2789.    INPUTS
  2790.         window - the window that the progress gadget is in.
  2791.  
  2792.         gad_info - the value returned from GU_LayoutGadgetsA()
  2793.  
  2794.         gadget - NULL, or a pointer to a specified progress gadget to
  2795.                  redraw. If NULL is given, all progress gadgets will be
  2796.                  redrawn. Use this function to redraw the progress gad
  2797.                  after changing the total or current value.
  2798.                  This function is called automatically from GU_Refresh-
  2799.                  Boxes.
  2800.  
  2801.    SEE ALSO
  2802.         GU_RefreshBoxes(), GU_RefreshWindow()
  2803.