home *** CD-ROM | disk | FTP | other *** search
-
- File: popbuttonclass.doc
- Description: PopButtonClass documentation.
- Copyright: (C) Copyright 1995 Jaba Development.
- (C) Copyright 1995 Jan van den Baard.
- All Rights Reserved.
-
- ------------------------------------------------------------------------------
-
- TABLE OF CONTENTS
-
- popbuttonclass/--background--
- popbuttonclass/Methods
- popbuttonclass/Attributes
-
- popbuttonclass/--background-- popbuttonclass/--background--
-
- NAME
- Class: popbuttonclass
- Superclass: baseclass
- Include File: "PopButtonClass.h"
-
- FUNCTION
- To provide you with a class simular to the cycle class in pop-menu
- mode. This class however appears to be a button gadget which will snap
- down a menu for the user to select an entry without changing anything
- to the apperance of the object itself.
-
- Also a checkable (toggle) mode with or without mutual exclusion is
- supported.
-
- Sunmouse/Sunkey/AutoPopWindowToFront etc. tools may cause confusion
- in combination with this class. When another window is activated while
- the popmenu is up intuition will automatically deactivate the menu
- selection.
-
- Objects from this class send out the following attribute pairs in
- their notification messages:
-
- GA_ID - Gadget object ID.
- PMB_MenuNumber - Number of the selected menu.
-
- Also your program must open the following libraries:
-
- intuition.library - V37 or better.
- graphics.library - V37 or better.
- utility.library - V37 or better.
- bgui.library - V39 or better.
-
- Ofcourse these libraries must remain open until you are done using the
- class.
-
- popbuttonclass/Methods popbuttonclass/Methods
-
- NEW METHODS
- PMBM_CHECK_STATUS -- This method must be used to see if a menu is
- checked or not. The following custom message structure is
- used:
-
- struct pmbmCommand {
- ULONG MethodID;
- ULONG pmbm_MenuNumber;
- };
-
- pmbm_MenuNumber -- This must be the ordinal number of the menu
- on which the action is done. Please note that you must
- make sure that this value is in range otherwise you
- definitly will get enforcer hits.
-
- Returns TRUE when the menu is checked and FALSE if not.
-
- PMBM_CHECK_MENU -- Use this method to check a menu. It uses the same
- message structure as PMB_CHECK_STATUS.
-
- PMBM_UNCHECK_MENU -- Use this method to un-check a menu. It uses the
- same message structure as PMB_CHECK_STATUS.
-
- CHANGED METHODS
- None.
-
- popbuttonclass/Attributes popbuttonclass/Attributes
-
- NOTE
- All baseclass attributes are also valid for this class. Also the
- vectorclass attributes can be used with OM_SET on objects from this
- class.
-
- NAME
- PMB_Image -- ( struct Image * )
-
- FUNCTION
- To provide the object with a standard Intuition image or BOOPSI image.
- The image will be centered inside the object it's hitbox. This will
- override any vectorclass image.
-
- Default is NULL. Applicability is (IS).
-
- NAME
- PMB_MenuEntries -- ( UBYTE ** )
-
- FUNCTION
- To specify the actual menu entries. This must point to an
- array of PopMenu structures. The array must be terminated with a NULL
- pm_Label entry.
-
- struct PopMenu {
- UBYTE *pm_label;
- UWORD pm_Flags;
- ULONG pm_MutualExclude;
- };
-
- pm_Label -- This should be a pointer to a 0-terminated string which
- contains the text for this menu. You can specify PMB_BARLABEL
- here to get a seperator bar simular to the seperator bar used
- by gadtools. If you make this NULL the array is terminated.
-
- pm_Flags -- The following two flags are supported:
-
- PMF_CHECKIT -- When set, this flag tell's the class that this
- menu should toggle it's selected status. A checkmark
- image is shown when the menu is selected.
-
- PMF_CHECKED -- When set the menu is selected.
-
- pm_MutualExclude -- This 32 bit value can hold bits which represent
- menus which should be de-selected when this menu is checked.
-
- Each set bit means to exclude a menu. I.E. When bit four is
- set the fourth menu is de-selected if it is a checkable item.
-
- NOTE: Mutually-excluded items will *not* trigger any
- notification so you are responsible to keep track of this.
-
- Please take a look at the supplied demo for a working example.
-
- The class will make a private copy of the PopMenu array so the menus
- may be used on more than one object.
-
- Default is NULL. Applicability is (IS).
-
- NAME
- PMB_MenuNumber -- ( ULONG )
-
- FUNCTION
- This attribute holds the ordinal number of the last selected menu.
- When your application is notified by the gadget you should OM_GET
- this attribute to find out which menu was selected.
-
- Applicability is (GN).
-
- NAME
- PMB_PopPosition -- ( ULONG )
-
- FUNCTION
- To make the class pop the menu with a specific entry as the first
- one activated. When the object is activated by a mouse-click the menu
- will try to open with the specified item under the mouse pointer. Key-
- board activation will simple pop the menu with the item selected.
-
- Applicability is (I).
-