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

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