home *** CD-ROM | disk | FTP | other *** search
- /*
- * PushButtonClass
- *
- * A class of buttons built on the "frbuttonclass". Looks like a button
- * with text centered, and an optional key to underline (for gadget key
- * equivalences). Use summarized below.
- *
- * Class information
- *
- * Needs: GA_DrawInfo - Used in frame and text
- *
- * Uses: PUSHB_Text (IS) - optional text to use in push button,
- * I - text to use at creation
- * S - set to new text (setting new text
- * without setting new PUSHB_UPos
- * will get rid of underline
- *
- * PUSHB_UPos (IS) - character position in PUSHB_Text to underline
- * I - set underline character at creation
- * S - set new character to underline in text
- *
- * PUSHB_Default (IS) - set to TRUE to make this button have the
- * default key look (key that RETURN is
- * equivalent to) *not supported yet*
- *
- * GA_Left (IS) - sets LeftEdge of gadget
- * GA_Top (IS) - sets TopEdge of gadget
- * GA_Width (S) - sets button width after object is made
- * GA_Height (S) - sets button height after object is made
- *
- * Do Not Use: GA_Text, GA_IntuiText, or GA_LabelImage
- * (I don't check, either, for speed.)
- */
-
- #include <exec/types.h>
- #include <exec/memory.h>
- #include <exec/nodes.h>
- #include <exec/ports.h>
- #include <intuition/intuition.h>
- #include <intuition/classes.h>
- #include <intuition/gadgetclass.h>
- #include <intuition/imageclass.h>
- #include <graphics/text.h>
- #include <utility/tagitem.h>
-
- #define PUSHB_Text (TAG_USER + 1) /* Text in button */
- #define PUSHB_UPos (TAG_USER + 2) /* character pos to underline */
- #define PUSHB_Default (TAG_USER + 3) /* Is this the RETURN button? */
-
- #define STDPBWIDTH 80
- #define STDPBHEIGHT 20
-
- /*
- * All of these guys shoud have been in .c
- */
-
- struct PushBData { /* private structure for class */
- struct DrawInfo *PBDrawInfo;
- struct IntuiText PBIText1;
- struct IntuiText PBIText2;
- char PBKey[2];
- };
-
- struct PushBTA { /* private structure for class */
- struct TextAttr PBTextAttr1;
- struct TextAttr PBTextAttr2;
- };
-
- struct PushBInst { /* private structure for class */
- struct PushBData *PBData;
- };
-
- /*
- * Prototypes
- */
-
- Class *MakePushBClass(void);
- BOOL FreePushBClass(Class *);
- struct Gadget *MakePushButton(struct Window *, struct Requester *,
- struct DrawInfo *, struct Gadget *,
- WORD, WORD, char *, BYTE);
- void ChangePushButton(struct Gadget *, struct Window *,
- struct Requester *, char *, BYTE);
-