home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / basic / BlitzGUIGen17a.lha / RIGTMenusLib.doc < prev    next >
Text File  |  1995-05-25  |  7KB  |  174 lines

  1. -----------------------------------------------------------------------------
  2. ====                    RI GadTools Menu Library v1.0ß                    ====
  3. -----------------------------------------------------------------------------
  4.  
  5.                         Written By Stephen McNamara
  6.                         ©1995 Leading Edge Software
  7.  
  8.  
  9.   This library provides access to the GadTools library functions for
  10. setting up and layouting out menustrips.  Because of its use of Gadtools,
  11. this library is for us with OS2 and above.
  12.  
  13.   Users of the current Acid library should have no problems converting to
  14. this library, since it has been designed so that the only major differences
  15. between them are the slight command name changes.  The benefit of using
  16. this library is that GadTools takes over all positioning of menuitems, and
  17. will automatically take account of things like font sensitivity and items
  18. going off screen.  You'll also get that nice OS2 feeling to your menuitems,
  19. including those luvly bar items.
  20.  
  21.   If you wish to have proper GadTools menus you need to open your windows
  22. with the NewLookMenus flag set.  Do this by either specifying NewLookMenus
  23. in your taglist for WindowTags, or by adding the value $200000 to your
  24. window flags when you call the Window command.
  25.  
  26.   The library has its own Blitz2 object associated with it: GTMenuList,
  27. which looks like:
  28.  
  29.         Newtype.GTMenuList
  30.             *MenuList
  31.             *MenuLookup
  32.             numitems.w
  33.         End Newtype
  34.  
  35. The latest version of the LES Debugger has this object built in for
  36. convience.
  37.  
  38.  
  39. Command List:
  40.  
  41.     GTMenuTitle GTMenuList#,menu,title$
  42.     GTMenuItem GTMenuList#,flags,menu,item[,itemtext$[,shortcut$]]
  43.     GTSubItem GTMenuList#,flags,menu,item,subitem[,itemtext$[,shortcut$]]
  44.     CreateMenuStrip GTMenuList#
  45.     GTSetMenu GTMenuList#
  46.     GTUnSetMenu
  47.     status=GTMenuChecked (GTMenuList#,menu,item[,subitem])
  48.     GTSetMenuChecked GTMenuList#,menu,item[,subitem],Off|On
  49.     GTFreeMenu GTMenuList#,menu[,item[,subitem]]
  50.  
  51.  
  52. Statement: GTMenuTitle
  53. ------------------------------------------------------------------------
  54. Modes : Amiga/Blitz
  55. Syntax: GTMenuTitle GTMenuList#,menu,title$
  56.  
  57.   This creates the specified menutitle in the GTMenuList given.  The text
  58. to display for the title is given in title$
  59.  
  60. This command fails if 'menu' is greater than 0 but menu title menu-1 hasn't
  61. been defined
  62.  
  63.  
  64. Statement: GTMenuItem
  65. ------------------------------------------------------------------------
  66. Modes : Amiga/Blitz
  67. Syntax: GTMenuItem GTMenuList#,flags,menu,item[,itemtext$[,shortcut$]]
  68.  
  69.   This creates the specified menuitem in the GTMenuList.  This command
  70. works the same as the Acid command MenuItem *except* that the flags
  71. parameter is different.  The flags in this library refer to the flag
  72. definitions found in the Amiga Include files.  Note also that you cannot
  73. do mutual exclude menuitems using this library (yet).
  74.  
  75.   You'll notice that the itemtext$ parameter is optional - if you leave
  76. this out you'll get a bar item.  This bar item will automatically fit
  77. perfectly across the menu width and will be unselectable by the user.
  78.  
  79. This command fails in the specifed menu hasn't been defined, or the
  80. item is greater than 0 and item-1 is undefined.
  81.  
  82.  
  83. Statement: GTSubItem
  84. ------------------------------------------------------------------------
  85. Modes : Amiga/Blitz
  86. Syntax: GTSubItem GTMenuList#,flags,menu,item,subitem[,itemtext$[,shortcut$]]
  87.  
  88.   Creates the specified subitem in the GTMenuList.  Need I say more?  The
  89. flags are given as defined in the Amiga Include files.
  90.  
  91.   You'll notice that the itemtext$ parameter is optional - if you leave
  92. this out you'll get a bar item.  This bar item will automatically fit
  93. perfectly across the menu width and will be unselectable by the user.
  94.  
  95.  
  96. Statement: CreateMenuStrip
  97. ------------------------------------------------------------------------
  98. Modes : Amiga/Blitz
  99. Syntax: CreateMenuStrip GTMenuList#
  100.  
  101.   Creates the actual GadTools menustrip from a GTMenuList object.  When you
  102. call commands like GTMenuTitle the work is performed on an internal list to
  103. the library - not an actual menulist.  Thus this command translates the
  104. internal list into a menulist and performs all GadTools formatting etc.
  105.  
  106.   This command is invoked automatically if it has not been called before
  107. you call GTSetMenu.
  108.  
  109.   Note also that you must have a currently used screen object to call this
  110. command since GadTools needs to know what screen to format your menus for
  111. (font sensitivity).  Also note that you can call this command over and over
  112. again for a given object - thus after adding new items you can call it
  113. again to make this items appear in the menulist.  WARNING before calling
  114. this command make sure that the GTMenuList given is not attached to a
  115. window - problems will occur (corrupt menu items) if you call this item
  116. whilst the menulist is attached.  Use GTUnSetMenu to remove this menulist
  117. from a window.
  118.  
  119.  
  120. Statement: GTSetMenu
  121. ------------------------------------------------------------------------
  122. Modes : Amiga/Blitz
  123. Syntax: GTSetMenu GTMenuList#,Window#
  124.  
  125.   Attached the specified GTMenuList to the specified windows.  If the given
  126. GTMenuList object has not had CreateMenuStrip called on it, CreateMenuStrip
  127. is automatically invoked to calculate the menulist.
  128.  
  129.  
  130. Statement: GTUnSetMenu
  131. ------------------------------------------------------------------------
  132. Modes : Amiga/Blitz
  133. Syntax: GTUnSetMenu
  134.  
  135.   This command removes the menulist from the current window.  You must call
  136. this function before you call CreateMenuStrip IF you have already set the
  137. menulist to a window (come again? :) ).
  138.  
  139.  
  140. Statement: GTMenuChecked
  141. ------------------------------------------------------------------------
  142. Modes : Amiga/Blitz
  143. Syntax: status=GTMenuChecked (GTMenuList#,menu,item[,subitem])
  144.  
  145.   This commamd is used in conjunction with menuitems that have a check
  146. mark.  If the item (or subitem) is currently checked (e.g. a tick appears
  147. in front of its text in the menu) then this command returns -1, else it
  148. returns 0.  Note that you must have called either CreateMenuStrip or
  149. GTSetMenu before you use this command.
  150.  
  151.  
  152. Statement: GTSetMenuChecked
  153. ------------------------------------------------------------------------
  154. Modes : Amiga/Blitz
  155. Syntax: GTSetMenuChecked GTMenuList#,menu,item[,subitem],Off|On
  156.  
  157.   This sets the tick mark on the selected item (or subitem) to the status
  158. supplied (on or off).  The same rules apply to this command as
  159. GTMenuChecked.
  160.  
  161.  
  162. Statement: GTFreeMenu
  163. ------------------------------------------------------------------------
  164. Modes : Amiga/Blitz
  165. Syntax: GTFreeMenu GTMenuList#,menu[,item[,subitem]]
  166.  
  167.   This frees the selected menu title/item/subitem from the libraries
  168. internal menu list.  This change will not be reflected in the actual
  169. menulist created by CreateMenuStrip until you recall CreateMenuStrip.
  170.  
  171.   Deleting an item automatically causes its decendants to be deleted.  Eg.
  172. deleting a menu title will cause all items that belong to it to be deleted,
  173. deleting a menu item will cause all subitems that belong to it be deleted.
  174.