home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
bbs
/
cbm
/
os-include.lha
/
os-include
/
libraries
/
gadtools.i
< prev
next >
Wrap
Text File
|
1993-10-15
|
15KB
|
423 lines
IFND LIBRARIES_GADTOOLS_I
LIBRARIES_GADTOOLS_I SET 1
**
** $VER: gadtools.i 39.12 (24.8.93)
** Includes Release 40.15
**
** gadtools.library definitions
**
** (C) Copyright 1989-1993 Commodore-Amiga, Inc.
** All Rights Reserved.
**
*------------------------------------------------------------------------*
IFND EXEC_TYPES_I
INCLUDE "exec/types.i"
ENDC
IFND UTILITY_TAGITEM_I
INCLUDE "utility/tagitem.i"
ENDC
IFND INTUITION_INTUITION_I
INCLUDE "intuition/intuition.i"
ENDC
*------------------------------------------------------------------------*
* The kinds (almost classes) of gadgets that GadTools supports.
* Use these identifiers when calling CreateGadgetA()
GENERIC_KIND EQU 0
BUTTON_KIND EQU 1
CHECKBOX_KIND EQU 2
INTEGER_KIND EQU 3
LISTVIEW_KIND EQU 4
MX_KIND EQU 5
NUMBER_KIND EQU 6
CYCLE_KIND EQU 7
PALETTE_KIND EQU 8
SCROLLER_KIND EQU 9
* Kind number 10 is reserved
SLIDER_KIND EQU 11
STRING_KIND EQU 12
TEXT_KIND EQU 13
NUM_KINDS EQU 14
*------------------------------------------------------------------------*
* 'Or' the appropriate set together for your Window IDCMPFlags: *
ARROWIDCMP EQU GADGETUP!GADGETDOWN!INTUITICKS!MOUSEBUTTONS
BUTTONIDCMP EQU GADGETUP
CHECKBOXIDCMP EQU GADGETUP
INTEGERIDCMP EQU GADGETUP
LISTVIEWIDCMP EQU GADGETUP!GADGETDOWN!MOUSEMOVE!ARROWIDCMP
MXIDCMP EQU GADGETDOWN
NUMBERIDCMP EQU 0
CYCLEIDCMP EQU GADGETUP
PALETTEIDCMP EQU GADGETUP
* Use ARROWIDCMP!SCROLLERIDCMP if your scrollers have arrows: *
SCROLLERIDCMP EQU GADGETUP!GADGETDOWN!MOUSEMOVE
SLIDERIDCMP EQU GADGETUP!GADGETDOWN!MOUSEMOVE
STRINGIDCMP EQU GADGETUP
TEXTIDCMP EQU 0
*------------------------------------------------------------------------*
* Generic NewGadget used by several of the gadget classes: *
STRUCTURE NewGadget,0
WORD gng_LeftEdge
WORD gng_TopEdge ; gadget position
WORD gng_Width
WORD gng_Height ; gadget size
APTR gng_GadgetText ; gadget label
APTR gng_TextAttr ; desired font for gadget label
UWORD gng_GadgetID ; gadget ID
ULONG gng_Flags ; see below
APTR gng_VisualInfo ; Set to retval of GetVisualInfo()
APTR gng_UserData ; gadget UserData
LABEL gng_SIZEOF
* ng_Flags control certain aspects of the gadget. The first five control
* the placement of the descriptive text. Each gadget kind has its default,
* which is usually PLACETEXT_LEFT. Consult the autodocs for details.
PLACETEXT_LEFT EQU $0001 * Right-align text on left side
PLACETEXT_RIGHT EQU $0002 * Left-align text on right side
PLACETEXT_ABOVE EQU $0004 * Center text above
PLACETEXT_BELOW EQU $0008 * Center text below
PLACETEXT_IN EQU $0010 * Center text on
NG_HIGHLABEL EQU $0020 * Highlight the label
*------------------------------------------------------------------------*
* Fill out an array of these and pass that to CreateMenus():
STRUCTURE NewMenu,0
UBYTE gnm_Type ; See below
UBYTE gnm_Pad ; alignment padding
APTR gnm_Label ; Menu's label
APTR gnm_CommKey ; MenuItem Command Key Equiv
UWORD gnm_Flags ; Menu or MenuItem flags (see note)
LONG gnm_MutualExclude ; MenuItem MutualExclude word
APTR gnm_UserData ; For your own use, see note
LABEL gnm_SIZEOF
* Needed only by inside IM_ definitions below */
MENU_IMAGE EQU 128
* nm_Type determines what each NewMenu structure corresponds to.
* for the NM_TITLE, NM_ITEM, and NM_SUB values, nm_Label should
* be a text string to use for that menu title, item, or sub-item.
* For IM_ITEM or IM_SUB, set nm_Label to point at the Image structure
* you wish to use for this item or sub-item.
* NOTE: At present, you may only use conventional images.
* Custom images created from Intuition image-classes do not work.
NM_TITLE EQU 1 * Menu header
NM_ITEM EQU 2 * Textual menu item
NM_SUB EQU 3 * Textual menu sub-item
IM_ITEM EQU NM_ITEM!MENU_IMAGE * Graphical menu item
IM_SUB EQU NM_SUB!MENU_IMAGE * Graphical menu sub-item
* The NewMenu array should be terminated with a NewMenu whose
* nm_Type equals NM_END.
NM_END EQU 0 * End of NewMenu array
* Starting with V39, GadTools will skip any NewMenu entries whose
* nm_Type field has the NM_IGNORE bit set.
NM_IGNORE EQU 64
* nm_Label should be a text string for textual items, a pointer
* to an Image structure for graphical menu items, or the special
* constant NM_BARLABEL, to get a separator bar.
NM_BARLABEL EQU -1
* The nm_Flags field is used to fill out either the Menu->Flags or
* MenuItem->Flags field. Note that the sense of the MENUENABLED or
* ITEMENABLED bit is inverted between this use and Intuition's use,
* in other words, NewMenus are enabled by default. The following
* labels are provided to disable them:
NM_MENUDISABLED EQU MENUENABLED
NM_ITEMDISABLED EQU ITEMENABLED
* New for V39: NM_COMMANDSTRING. For a textual MenuItem or SubItem,
* point nm_CommKey at an arbitrary string, and set the NM_COMMANDSTRING
* flag.
NM_COMMANDSTRING EQU COMMSEQ
* The following are pre-cleared (COMMSEQ, ITEMTEXT, and HIGHxxx are set
* later as appropriate):
* Under V39, the COMMSEQ flag bit is not cleared, since it now has
* meaning.
NM_FLAGMASK EQU ~(COMMSEQ!ITEMTEXT!HIGHFLAGS)
NM_FLAGMASK_V39 EQU ~(ITEMTEXT!HIGHFLAGS)
* You may choose among CHECKIT, MENUTOGGLE, and CHECKED.
* Toggle-select menuitems are of type CHECKIT!MENUTOGGLE, along
* with CHECKED if currently selected. Mutually exclusive ones
* are of type CHECKIT, and possibly CHECKED too. The nm_MutualExclude
* is a bit-wise representation of the items excluded by this one,
* so in the simplest case (choose 1 among n), these flags would be
* ~1, ~2, ~4, ~8, ~16, etc. See the Intuition Menus chapter.
* A UserData pointer can be associated with each Menu and MenuItem structure.
* The CreateMenus() call allocates space for a UserData after each
* Menu or MenuItem (header, item or sub-item). You should use the
* GTMENU_USERDATA or GTMENUITEM_USERDATA macro to extract it. */
GTMENU_USERDATA MACRO
move.l mu_SIZEOF(\1),\2
ENDM
GTMENUITEM_USERDATA MACRO
move.l mi_SIZEOF(\1),\2
ENDM
* Here is an old one for compatibility. Do not use in new code!
MENU_USERDATA MACRO
move.l mi_SIZEOF(\1),\2
ENDM
* These return codes can be obtained through the GTMN_SecondaryError tag:
GTMENU_TRIMMED EQU $00000001 ; Too many menus, items, or subitems,
; menu has been trimmed down
GTMENU_INVALID EQU $00000002 ; Invalid NewMenu array
GTMENU_NOMEM EQU $00000003 ; Out of memory
*------------------------------------------------------------------------*
* Starting with V39, checkboxes and mx gadgets can be scaled to your
* specified gadget width/height. Use the new GTCB_Scaled or GTMX_Scaled
* tags, respectively. Under V37, and by default in V39, the imagery
* is of the following fixed size:
* MX gadget default dimensions:
MX_WIDTH EQU 17
MX_HEIGHT EQU 9
* Checkbox default dimensions:
CHECKBOX_WIDTH EQU 26
CHECKBOX_HEIGHT EQU 11
*------------------------------------------------------------------------*
* Tags for GadTools functions:
GT_TagBase EQU TAG_USER+$80000 ; Begin counting tags
GTVI_NewWindow EQU GT_TagBase+1 ; NewWindow struct for GetVisualInfo
GTVI_NWTags EQU GT_TagBase+2 ; NWTags for GetVisualInfo
GT_Private0 EQU GT_TagBase+3 ; (private)
GTCB_Checked EQU GT_TagBase+4 ; State of checkbox
GTLV_Top EQU GT_TagBase+5 ; Top visible one in listview
GTLV_Labels EQU GT_TagBase+6 ; List to display in listview
GTLV_ReadOnly EQU GT_TagBase+7 ; TRUE if listview is to be read-only
GTLV_ScrollWidth EQU GT_TagBase+8 ; Width of scrollbar
GTMX_Labels EQU GT_TagBase+9 ; NULL-terminated array of labels
GTMX_Active EQU GT_TagBase+10 ; Active one in mx gadget
GTTX_Text EQU GT_TagBase+11 ; Text to display
GTTX_CopyText EQU GT_TagBase+12 ; Copy text label instead of referencing it
GTNM_Number EQU GT_TagBase+13 ; Number to display
GTCY_Labels EQU GT_TagBase+14 ; NULL-terminated array of labels
GTCY_Active EQU GT_TagBase+15 ; The active one in the cycle gad
GTPA_Depth EQU GT_TagBase+16 ; Number of bitplanes in palette
GTPA_Color EQU GT_TagBase+17 ; Palette color
GTPA_ColorOffset EQU GT_TagBase+18 ; First color to use in palette
GTPA_IndicatorWidth EQU GT_TagBase+19 ; Width of current-color indicator
GTPA_IndicatorHeight EQU GT_TagBase+20 ; Height of current-color indicator
GT