home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / nduk-v37.lha / V37 / include / libraries / gadtools.i < prev    next >
Text File  |  1991-11-27  |  10KB  |  307 lines

  1.     IFND LIBRARIES_GADTOOLS_I
  2. LIBRARIES_GADTOOLS_I    SET    1
  3. **
  4. **    $Filename: libraries/gadtools.i $
  5. **    $Release: 2.04 Includes, V37.4 $
  6. **    $Revision: 36.13 $
  7. **    $Date: 91/10/09 $
  8. **
  9. **    gadtools.library definitions
  10. **
  11. **    (C) Copyright 1989-1991 Commodore-Amiga, Inc.
  12. **    All Rights Reserved.
  13. **
  14.  
  15. *------------------------------------------------------------------------*
  16.  
  17.     IFND EXEC_TYPES_I
  18.     INCLUDE 'exec/types.i'
  19.     ENDC
  20.  
  21.     IFND UTILITY_TAGITEM_I
  22.     INCLUDE 'utility/tagitem.i'
  23.     ENDC
  24.  
  25.     IFND INTUITION_INTUITION_I
  26.     INCLUDE 'intuition/intuition.i'
  27.     ENDC
  28.  
  29. *------------------------------------------------------------------------*
  30.  
  31. *    The kinds (almost classes) of gadgets in the toolkit.  Use these
  32. *    identifiers when calling CreateGadgetA()
  33.  
  34. GENERIC_KIND    EQU    0
  35. BUTTON_KIND    EQU    1
  36. CHECKBOX_KIND    EQU    2
  37. INTEGER_KIND    EQU    3
  38. LISTVIEW_KIND    EQU    4
  39. MX_KIND        EQU    5
  40. NUMBER_KIND    EQU    6
  41. CYCLE_KIND    EQU    7
  42. PALETTE_KIND    EQU    8
  43. SCROLLER_KIND    EQU    9
  44. * Kind number 10 is reserved
  45. SLIDER_KIND    EQU    11
  46. STRING_KIND    EQU    12
  47. TEXT_KIND    EQU    13
  48.  
  49. NUM_KINDS    EQU    14
  50.  
  51. *------------------------------------------------------------------------*
  52.  
  53. *  These two definitions are obsolete, but are here for backwards
  54. *  compatibility.  You never need to worry about these:
  55. GADTOOLBIT    EQU    $8000
  56.  
  57. *  Use this mask to isolate the user part: *
  58. GADTOOLMASK    EQU    ~GADTOOLBIT
  59.  
  60. *------------------------------------------------------------------------*
  61.  
  62. *  'Or' the appropriate set together for your Window IDCMPFlags: *
  63.  
  64. ARROWIDCMP    EQU    GADGETUP!GADGETDOWN!INTUITICKS!MOUSEBUTTONS
  65.  
  66. BUTTONIDCMP    EQU    GADGETUP
  67. CHECKBOXIDCMP    EQU    GADGETUP
  68. INTEGERIDCMP    EQU    GADGETUP
  69. LISTVIEWIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE!ARROWIDCMP
  70.  
  71. MXIDCMP        EQU    GADGETDOWN
  72. NUMBERIDCMP    EQU    0
  73. CYCLEIDCMP    EQU    GADGETUP
  74. PALETTEIDCMP    EQU    GADGETUP
  75.  
  76. *  Use ARROWIDCMP!SCROLLERIDCMP if your scrollers have arrows: *
  77. SCROLLERIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE
  78. SLIDERIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE
  79. STRINGIDCMP    EQU    GADGETUP
  80.  
  81. TEXTIDCMP    EQU    0
  82.  
  83. *------------------------------------------------------------------------*
  84.  
  85. *  Typical suggested spacing between "elements": *
  86. INTERWIDTH    EQU    8
  87. INTERHEIGHT    EQU    4
  88.  
  89. *------------------------------------------------------------------------*
  90.  
  91. *  Generic NewGadget used by several of the gadget classes: *
  92.  
  93.     STRUCTURE NewGadget,0
  94.  
  95.     WORD    gng_LeftEdge
  96.     WORD    gng_TopEdge    ; gadget position
  97.     WORD    gng_Width
  98.     WORD    gng_Height    ;  gadget size
  99.     APTR    gng_GadgetText    ; gadget label
  100.     APTR    gng_TextAttr    ; desired font for gadget label
  101.     UWORD    gng_GadgetID    ; gadget ID
  102.     ULONG    gng_Flags    ; see below
  103.     APTR    gng_VisualInfo    ; Set to retval of GetVisualInfo()
  104.     APTR    gng_UserData    ; gadget UserData
  105.  
  106.     LABEL    gng_SIZEOF
  107.  
  108. *   ng_Flags control certain aspects of the gadget.  The first five control
  109. *   the placement of the descriptive text.  All larger groups supply a
  110. *   default:
  111.  
  112. PLACETEXT_LEFT    EQU    $0001    * Right-align text on left side
  113. PLACETEXT_RIGHT    EQU    $0002    * Left-align text on right side
  114. PLACETEXT_ABOVE    EQU    $0004    * Center text above
  115. PLACETEXT_BELOW    EQU    $0008    * Center text below
  116. PLACETEXT_IN    EQU    $0010    * Center text on
  117.  
  118. NG_HIGHLABEL    EQU    $0020    * Highlight the label
  119.  
  120. *------------------------------------------------------------------------*
  121.  
  122. * Fill out an array of these and pass that to CreateMenus():
  123.  
  124.     STRUCTURE NewMenu,0
  125.  
  126.     UBYTE    gnm_Type        ; See below
  127.     UBYTE    gnm_Pad            ; alignment padding
  128.     APTR    gnm_Label        ; Menu's label
  129.     APTR    gnm_CommKey        ; MenuItem Command Key Equiv
  130.     UWORD    gnm_Flags        ; Menu or MenuItem flags (see note)
  131.     LONG    gnm_MutualExclude    ; MenuItem MutualExclude word
  132.     APTR    gnm_UserData        ; For your own use, see note
  133.  
  134.     LABEL    gnm_SIZEOF
  135.  
  136. *  Each nm_Type should be one of these:
  137. NM_TITLE    EQU    1
  138. NM_ITEM        EQU    2
  139. NM_SUB        EQU    3
  140. NM_END        EQU    0
  141.  
  142. MENU_IMAGE    EQU    128
  143.  
  144. * For an image menu-item or sub-item, use one of these.  Set
  145. * nm_Label to point at the Image structure you wish to use.
  146. * NOTE: At present, you may only use conventional images.
  147. * Custom images created from Intuition image-classes do not work.
  148.  
  149. IM_ITEM        EQU    NM_ITEM!MENU_IMAGE
  150. IM_SUB        EQU    NM_SUB!MENU_IMAGE
  151.  
  152. *  If you set your label to NM_BARLABEL, you'll get a separator bar.
  153. NM_BARLABEL    EQU    -1
  154.  
  155.  
  156. *   The nm_Flags field is used to fill out either the Menu->Flags or
  157. *   MenuItem->Flags field.  Note that the sense of the MENUENABLED or
  158. *   ITEMENABLED bit is inverted between this use and Intuition's use,
  159. *   in other words, NewMenus are enabled by default.  The following
  160. *   labels are provided to disable them:
  161.  
  162. NM_MENUDISABLED    EQU    MENUENABLED
  163. NM_ITEMDISABLED    EQU    ITEMENABLED
  164.  
  165. *   The following are pre-cleared (COMMSEQ, ITEMTEXT, and HIGHxxx are set
  166. *   later as appropriate):
  167.  
  168. NM_FLAGMASK    EQU    ~(COMMSEQ!ITEMTEXT!HIGHFLAGS)
  169.  
  170. *   You may choose among CHECKIT, MENUTOGGLE, and CHECKED.
  171. *   Toggle-select menuitems are of type CHECKIT!MENUTOGGLE, along
  172. *   with CHECKED if currently selected.  Mutually exclusive ones
  173. *   are of type CHECKIT, and possibly CHECKED too.  The nm_MutualExclude
  174. *   is a bit-wise representation of the items excluded by this one,
  175. *   so in the simplest case (choose 1 among n), these flags would be
  176. *   ~1, ~2, ~4, ~8, ~16, etc.  See the Intuition Menus chapter.
  177.  
  178. *   A UserData pointer can be associated with each Menu and MenuItem structure.
  179. *   The CreateMenus() call allocates space for a UserData after each
  180. *   Menu or MenuItem (header, item or sub-item).  You should use the
  181. *   GTMENU_USERDATA or GTMENUITEM_USERDATA macro to extract it. */
  182.  
  183. GTMENU_USERDATA    MACRO
  184.         move.l    mu_SIZEOF(\1),\2
  185.         ENDM
  186.  
  187. GTMENUITEM_USERDATA    MACRO
  188.         move.l    mi_SIZEOF(\1),\2
  189.         ENDM
  190.  
  191. *  Here is an old one for compatibility.  Do not use in new code!
  192. MENU_USERDATA    MACRO
  193.         move.l    mi_SIZEOF(\1),\2
  194.         ENDM
  195.  
  196.  
  197. *  These return codes can be obtained through the GTMN_SecondaryError tag:
  198. GTMENU_TRIMMED    EQU    $00000001    ; Too many menus, items, or subitems,
  199.                     ; menu has been trimmed down
  200. GTMENU_INVALID    EQU    $00000002    ; Invalid NewMenu array
  201. GTMENU_NOMEM    EQU    $00000003    ; Out of memory
  202.  
  203.  
  204. *------------------------------------------------------------------------*
  205.  
  206. *  Tags for toolkit functions:
  207.  
  208. GT_TagBase    EQU    TAG_USER+$80000 ; Begin counting tags
  209.  
  210. GTVI_NewWindow    EQU    GT_TagBase+$01    ; NewWindow struct for GetVisualInfo
  211. GTVI_NWTags    EQU    GT_TagBase+$02    ; NWTags for GetVisualInfo
  212.  
  213. GT_Private0    EQU    GT_TagBase+$03    ; (private)
  214.  
  215. GTCB_Checked    EQU    GT_TagBase+$04    ; State of checkbox
  216.  
  217. GTLV_Top    EQU    GT_TagBase+$05    ; Top visible one in listview
  218. GTLV_Labels    EQU    GT_TagBase+$06    ; List to display in listview
  219. GTLV_ReadOnly    EQU    GT_TagBase+$07    ; TRUE if listview is to be read-only
  220. GTLV_ScrollWidth    EQU    GT_TagBase+$08    ; Width of scrollbar
  221.  
  222. GTMX_Labels    EQU    GT_TagBase+$09    ; NULL-terminated array of labels
  223. GTMX_Active    EQU    GT_TagBase+$0A    ; Active one in mx gadget
  224.  
  225. GTTX_Text    EQU    GT_TagBase+$0B    ; Text to display
  226. GTTX_CopyText    EQU    GT_TagBase+$0C    ; Copy text label instead of referencing it
  227.  
  228. GTNM_Number    EQU    GT_TagBase+$0D    ; Number to display
  229.  
  230. GTCY_Labels    EQU    GT_TagBase+$0E    ; NULL-terminated array of labels
  231. GTCY_Active    EQU    GT_TagBase+$0F    ; The active one in the cycle gad
  232.  
  233. GTPA_Depth    EQU    GT_TagBase+$10    ; Number of bitplanes in palette
  234. GTPA_Color    EQU    GT_TagBase+$11    ; Palette color
  235. GTPA_ColorOffset    EQU    GT_TagBase+$12    ; First color to use in palette
  236. GTPA_IndicatorWidth    EQU    GT_TagBase+$13    ; Width of current-color indicator
  237. GTPA_IndicatorHeight    EQU    GT_TagBase+$14    ; Height of current-color indicator
  238.  
  239. GTSC_Top    EQU    GT_TagBase+$15    ; Top visible in scroller
  240. GTSC_Total    EQU    GT_TagBase+$16    ; Total in scroller area
  241. GTSC_Visible    EQU    GT_TagBase+$17    ; Number visible in scroller
  242. GTSC_Overlap    EQU    GT_TagBase+$18    ; Unused
  243.  
  244. * GT_TagBase+$19 through GT_TagBase+$25 are reserved
  245.  
  246. GTSL_Min    EQU    GT_TagBase+$26    ; Slider min value
  247. GTSL_Max    EQU    GT_TagBase+$27    ; Slider max value
  248. GTSL_Level    EQU    GT_TagBase+$28    ; Slider level
  249. GTSL_MaxLevelLen    EQU    GT_TagBase+$29    ; Max length of printed level
  250. GTSL_LevelFormat    EQU    GT_TagBase+$2A    ; Format string for level
  251. GTSL_LevelPlace    EQU    GT_TagBase+$2B    ; Where level should be placed
  252. GTSL_DispFunc    EQU    GT_TagBase+$2C    ; Callback for number calculation before display
  253.  
  254. GTST_String    EQU    GT_TagBase+$2D    ; String gadget's displayed string
  255. GTST_MaxChars    EQU    GT_TagBase+$2E    ; Max length of string
  256.  
  257. GTIN_Number    EQU    GT_TagBase+$2F    ; Number in integer gadget
  258. GTIN_MaxChars    EQU    GT_TagBase+$30    ; Max number of digits
  259.  
  260. GTMN_TextAttr    EQU    GT_TagBase+$31    ; MenuItem font TextAttr
  261. GTMN_FrontPen    EQU    GT_TagBase+$32    ; MenuItem text pen color
  262.  
  263. GTBB_Recessed    EQU    GT_TagBase+$33    ; Make BevelBox recessed
  264.  
  265. GT_VisualInfo    EQU    GT_TagBase+$34    ; result of VisualInfo call
  266.  
  267. GTLV_ShowSelected    EQU    GT_TagBase+$35    ; show selected entry beneath listview,
  268.             ; set tag data = NULL for display-only, or pointer
  269.             ; to a string gadget you've created
  270. GTLV_Selected    EQU    GT_TagBase+$36    ; Set ordinal number of selected entry in the list
  271. GT_Reserved1    EQU    GT_TagBase+$38    ; Reserved for future use
  272.  
  273. GTTX_Border    EQU    GT_TagBase+$39    ; Put a border around Text-display gadgets
  274. GTNM_Border    EQU    GT_TagBase+$3A    ; Put a border around Number-display gadgets
  275.  
  276. GTSC_Arrows    EQU    GT_TagBase+$3B    ; Specify size of arrows for scroller
  277. GTMN_Menu    EQU    GT_TagBase+$3C    ; Pointer to Menu for use by
  278.             ; LayoutMenuItems()
  279. GTMX_Spacing    EQU    GT_TagBase+$3D    ; Added to font height to
  280.             ; figure spacing between mx choices.  Use this
  281.             ; instead of LAYOUTA_SPACING for mx gadgets.
  282.  
  283. *  New to V37 GadTools.  Ignored by GadTools V36.
  284. GTMN_FullMenu    EQU    GT_TagBase+$3E  ; Asks CreateMenus() to
  285.         ; validate that this is a complete menu structure
  286. GTMN_SecondaryError    EQU    GT_TagBase+$3F  ; ti_Data is a pointer
  287.         ; to a ULONG to receive error reports from CreateMenus()
  288. GT_Underscore    EQU    GT_TagBase+$40    ; ti_Data points to the symbol
  289.         ; that preceeds the character you'd like to underline in a
  290.         ; gadget label
  291. GTST_EditHook    EQU    GT_TagBase+$37    ; String EditHook
  292.  
  293. *  Old definition, now obsolete:
  294. GT_Reserved0    EQU    GTST_EditHook
  295.  
  296. *------------------------------------------------------------------------*
  297.  
  298. * "NWay" is an old synonym for cycle gadgets
  299.  
  300. NWAY_KIND    EQU    CYCLE_KIND
  301. NWAYIDCMP    EQU    CYCLEIDCMP
  302.  
  303. GTNW_Labels    EQU    GTCY_Labels
  304. GTNW_Active    EQU    GTCY_Active
  305.  
  306.     ENDC
  307.