User Interface Button Code.
More...
User Interface Button Code.
DEPRECATED!
- See Also
- http://www.amuletsandarmor.com/AALicense.txt
#define UI_BUTTON_STATE_FOCUSED 0x01 /* -------1 */ |
#define UI_BUTTON_STATE_PRESSED 0x02 /* ------1- */ |
#define UI_BUTTON_STATE_UNKNOWN 0xFC /* 111111-- */ |
UIButtonCreate does all the work to set up a button to be displayed on the screen. Just give it a group, 3 resource pictures, and a XY coordinate to place it on the screen. The button will then appear when the group is drawn.
NOTE: The passed button resources are for masked bitmaps, so you will want the graphics drawn accordingly. However, the button WILL be pressed if in the rectangular area (no checks are made to look into the bitmap).
NOTE: Make sure that the x & y coordinates leave enough room on the screen for the whole button. Otherwise, it will bomb when it is drawn. Also, make sure that all your resource bitmaps are the same size.
- Parameters
-
group | – Group to add button to. |
focusPic | – Picture to use when mouse is over button. |
notFocusPic | – Picture to use when mouse is elsewhere |
pressedPic | – Picture to use when mouse is pressing down on button. |
x | – X position of button |
y | – Y position of button |
- Returns
- Returned handle to button created or else will be UI_BUTTON_BAD
Every button has a slot available for storing one 32 bit word. This data slot can be used for anything that the calling module wishes. Most of the time, it is used to record a button ID. The ID allows the programmer to use the same button handler for multiple buttons. This routine is used to retrieve that data.
- Parameters
-
button | – Button to retrieve data from |
- Returns
- Data that was stored
Every button has a slot available for storing one 32 bit word. This data slot can be used for anything that the calling module wishes. Most of the time, it is used to record a button ID. The ID allows the programmer to use the same button handler for multiple buttons. This routine is used to store that data.
- Parameters
-
button | – Button to store data within |
data | – Data to store |
UIButtonSetHandler will declare the handler that will be used for this button. Basically, the handler will be called when the button is pressed.
- Parameters
-
button | – Button to set handler upon |
buttonHandler | – Function to call when button is pressed |