home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
bbs
/
cbm
/
os-include.lha
/
os-include
/
libraries
/
gadtools.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-15
|
17KB
|
453 lines
#ifndef LIBRARIES_GADTOOLS_H
#define LIBRARIES_GADTOOLS_H
/*
** $VER: gadtools.h 39.9 (19.8.92)
** Includes Release 40.15
**
** gadtools.library definitions
**
** (C) Copyright 1989-1993 Commodore-Amiga, Inc.
** All Rights Reserved
*/
/*------------------------------------------------------------------------*/
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif
#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h>
#endif
/*------------------------------------------------------------------------*/
/* The kinds (almost classes) of gadgets that GadTools supports.
* Use these identifiers when calling CreateGadgetA()
*/
#define GENERIC_KIND 0
#define BUTTON_KIND 1
#define CHECKBOX_KIND 2
#define INTEGER_KIND 3
#define LISTVIEW_KIND 4
#define MX_KIND 5
#define NUMBER_KIND 6
#define CYCLE_KIND 7
#define PALETTE_KIND 8
#define SCROLLER_KIND 9
/* Kind number 10 is reserved */
#define SLIDER_KIND 11
#define STRING_KIND 12
#define TEXT_KIND 13
#define NUM_KINDS 14
/*------------------------------------------------------------------------*/
/* 'Or' the appropriate set together for your Window IDCMPFlags: */
#define ARROWIDCMP (IDCMP_GADGETUP | IDCMP_GADGETDOWN |\
IDCMP_INTUITICKS | IDCMP_MOUSEBUTTONS)
#define BUTTONIDCMP (IDCMP_GADGETUP)
#define CHECKBOXIDCMP (IDCMP_GADGETUP)
#define INTEGERIDCMP (IDCMP_GADGETUP)
#define LISTVIEWIDCMP (IDCMP_GADGETUP | IDCMP_GADGETDOWN |\
IDCMP_MOUSEMOVE | ARROWIDCMP)
#define MXIDCMP (IDCMP_GADGETDOWN)
#define NUMBERIDCMP (0L)
#define CYCLEIDCMP (IDCMP_GADGETUP)
#define PALETTEIDCMP (IDCMP_GADGETUP)
/* Use ARROWIDCMP|SCROLLERIDCMP if your scrollers have arrows: */
#define SCROLLERIDCMP (IDCMP_GADGETUP | IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE)
#define SLIDERIDCMP (IDCMP_GADGETUP | IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE)
#define STRINGIDCMP (IDCMP_GADGETUP)
#define TEXTIDCMP (0L)
/*------------------------------------------------------------------------*/
/* Generic NewGadget used by several of the gadget classes: */
struct NewGadget
{
WORD ng_LeftEdge, ng_TopEdge; /* gadget position */
WORD ng_Width, ng_Height; /* gadget size */
UBYTE *ng_GadgetText; /* gadget label */
struct TextAttr *ng_TextAttr; /* desired font for gadget label */
UWORD ng_GadgetID; /* gadget ID */
ULONG ng_Flags; /* see below */
APTR ng_VisualInfo; /* Set to retval of GetVisualInfo() */
APTR ng_UserData; /* gadget UserData */
};
/* 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.
*/
#define PLACETEXT_LEFT 0x0001 /* Right-align text on left side */
#define PLACETEXT_RIGHT 0x0002 /* Left-align text on right side */
#define PLACETEXT_ABOVE 0x0004 /* Center text above */
#define PLACETEXT_BELOW 0x0008 /* Center text below */
#define PLACETEXT_IN 0x0010 /* Center text on */
#define NG_HIGHLABEL 0x0020 /* Highlight the label */
/*------------------------------------------------------------------------*/
/* Fill out an array of these and pass that to CreateMenus(): */
struct NewMenu
{
UBYTE nm_Type; /* See below */
/* Compiler inserts a PAD byte here */
STRPTR nm_Label; /* Menu's label */
STRPTR nm_CommKey; /* MenuItem Command Key Equiv */
UWORD nm_Flags; /* Menu or MenuItem flags (see note) */
LONG nm_MutualExclude; /* MenuItem MutualExclude word */
APTR nm_UserData; /* For your own use, see note */
};
/* Needed only by inside IM_ definitions below */
#define MENU_IMAGE 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.
*/
#define NM_TITLE 1 /* Menu header */
#define NM_ITEM 2 /* Textual menu item */
#define NM_SUB 3 /* Textual menu sub-item */
#define IM_ITEM (NM_ITEM|MENU_IMAGE) /* Graphical menu item */
#define IM_SUB (NM_SUB|MENU_IMAGE) /* Graphical menu sub-item */
/* The NewMenu array should be terminated with a NewMenu whose
* nm_Type equals NM_END.
*/
#define NM_END 0 /* End of NewMenu array */
/* Starting with V39, GadTools will skip any NewMenu entries whose
* nm_Type field has the NM_IGNORE bit set.
*/
#define NM_IGNORE 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.
*/
#define NM_BARLABEL ((STRPTR)-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:
*/
#define NM_MENUDISABLED MENUENABLED
#define NM_ITEMDISABLED 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.
*/
#define NM_COMMANDSTRING 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.
*/
#define NM_FLAGMASK (~(COMMSEQ | ITEMTEXT | HIGHFLAGS))
#define NM_FLAGMASK_V39 (~(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.
*/
#define GTMENU_USERDATA(menu) (* ( (APTR *)(((struct Menu *)menu)+1) ) )
#define GTMENUITEM_USERDATA(menuitem) (* ( (APTR *)(((struct MenuItem *)menuitem)+1) ) )
/* Here is an old one for compatibility. Do not use in new code! */
#define MENU_USERDATA(menuitem) (* ( (APTR *)(menuitem+1) ) )
/* These return codes can be obtained through the GTMN_SecondaryError tag */
#define GTMENU_TRIMMED 0x00000001 /* Too many menus, items, or subitems,
* menu has been trimmed down
*/
#define GTMENU_INVALID 0x00000002 /* Invalid NewMenu array */
#define GTMENU_NOMEM 0x00000003 /* 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: */
#define MX_WIDTH 17
#define MX_HEIGHT 9
/* Checkbox default dimensions: */
#define CHECKBOX_WIDTH 26
#define CHECKBOX_HEIGHT 11
/*------------------------------------------------------------------------*/
/* Tags for GadTools functions: */
#define GT_TagBase TAG_USER + 0x80000
#define GTVI_NewWindow GT_TagBase+1 /* Unused */
#define GTVI_NWTags GT_TagBase+2 /* Unused */
#define GT_Private0 GT_TagBase+3 /* (private) */
#define GTCB_Checked GT_TagBase+4 /* State of checkbox */
#define GTLV_Top GT_TagBase+5 /* Top visible one in listview */
#define GTLV_Labels GT_TagBase+6 /* List to display in listview */
#define GTLV_ReadOnly GT_TagBase+7 /* TRUE if listview is to be
*