#include <stdbool.h>#include <mcp/syscalls.h>#include "a2560k.h"Go to the source code of this file.
Data Structures | |
| struct | Control |
| This structure describes an instantiated control on a window. More... | |
Enumerations | |
| enum | control_type { } |
Functions | |
| Control * | Control_New (ControlTemplate *the_template, Window *the_window, Rectangle *the_parent_rect, int16_t control_id, int16_t group_id) |
| Allocate a Control object. More... | |
| bool | Control_Destroy (Control **the_control) |
| Frees all allocated memory associated with the passed object, and the object itself. More... | |
| int16_t | Control_GetID (Control *the_control) |
| Get the ID of the control. More... | |
| control_type | Control_GetType (Control *the_control) |
| Get the control type. More... | |
| bool | Control_GetPressed (Control *the_control) |
| Get the pressed/not pressed state. More... | |
| Control * | Control_GetNextControl (Control *the_control) |
| Get the next control in the chain. More... | |
| bool | Control_SetNextControl (Control *the_control, Control *the_next_control) |
| Links the control to the next control passed. More... | |
| void | Control_SetActive (Control *the_control, bool is_active) |
| Set the control's active/inactive state. More... | |
| void | Control_SetPressed (Control *the_control, bool is_pressed) |
| Set the control's pressed/unpressed state. More... | |
| void | Control_MarkInvalidated (Control *the_control, bool invalidated) |
| Mark the specified control is invalidated or validated Note: Marking a control as invalidated causes it to be added to the parent window's list of rects to be reblitted to the screen in next render pass. More... | |
| void | Control_AlignToParentRect (Control *the_control) |
| Set or uppdate the control's position and/or size as appropriate to the control's parent rect Call when parent window size has changed, when control is first created, etc. More... | |
| bool | Control_IsRighter (Control *the_control, int16_t *x) |
| Compare the control's right-edge coordinate to the passed value If the control is more to the right than the passed value, the passed value is updated with the control's right edge. More... | |
| bool | Control_IsLefter (Control *the_control, int16_t *x) |
| Compare the control's left-edge coordinate to the passed value If the control is more to the left than the passed value, the passed value is updated with the control's left edge. More... | |
| bool | Control_UpdateFromTemplate (Control *the_control, ControlTemplate *the_template) |
| Updates the passed control with new theme info from the passed control template Call this when the theme has been changed It allows existing controls to be updated in place, without having to free them and create new theme controls. More... | |
| void | Control_Render (Control *the_control) |
| Blits the control to the control's parent window if the control is visible, and if it is listed as invalidated Controls that are visible but not invalidated do not need redrawing. More... | |
| enum control_type |
| void Control_AlignToParentRect | ( | Control * | the_control | ) |
Set or uppdate the control's position and/or size as appropriate to the control's parent rect Call when parent window size has changed, when control is first created, etc.
| the_control | – a valid Control object |
| bool Control_Destroy | ( | Control ** | the_control | ) |
Frees all allocated memory associated with the passed object, and the object itself.
| the_control | – pointer to the pointer for the Control object to be destroyed |
| int16_t Control_GetID | ( | Control * | the_control | ) |
Get the ID of the control.
| the_control | – a valid Control object |
Get the next control in the chain.
| the_control | – a valid Control object |
| bool Control_GetPressed | ( | Control * | the_control | ) |
Get the pressed/not pressed state.
| the_control | – a valid Control object |
| control_type Control_GetType | ( | Control * | the_control | ) |
Get the control type.
| the_control | – a valid Control object |
| bool Control_IsLefter | ( | Control * | the_control, |
| int16_t * | x | ||
| ) |
Compare the control's left-edge coordinate to the passed value If the control is more to the left than the passed value, the passed value is updated with the control's left edge.
| the_control | – a valid Control object |
| x | – a pointer to a bitmap horizontal position. May be changed by the function. |
| bool Control_IsRighter | ( | Control * | the_control, |
| int16_t * | x | ||
| ) |
Compare the control's right-edge coordinate to the passed value If the control is more to the right than the passed value, the passed value is updated with the control's right edge.
| the_control | – a valid Control object |
| x | – a pointer to a bitmap horizontal position. May be changed by the function. |
| void Control_MarkInvalidated | ( | Control * | the_control, |
| bool | invalidated | ||
| ) |
Mark the specified control is invalidated or validated Note: Marking a control as invalidated causes it to be added to the parent window's list of rects to be reblitted to the screen in next render pass.
| the_control | – a valid Control object |
| invalidated | – set to true to set control state to invalidated (will need redraw), false to set to not-invalidated |
| Control * Control_New | ( | ControlTemplate * | the_template, |
| Window * | the_window, | ||
| Rectangle * | the_parent_rect, | ||
| int16_t | control_id, | ||
| int16_t | group_id | ||
| ) |
Allocate a Control object.
| the_template | – reference to a valid, populated ControlTemplate object. The created control will take most of its properties from this template. |
| the_window | – reference to a valid Window object. The newly-created control will not be added to the window's list of controls, but the control will remember this window as its parent |
| the_parent_rect | – Reference to rect object that the control will position itself relative to. This rect must remain valid throughout the life of the control. |
| control_id | – the unique ID (within the specified window) to be assigned to the control. WARNING: assigning multiple controls the same ID will result in undefined behavior. |
| group_id | – group ID value to be assigned to the control. Pass CONTROL_NO_GROUP if the control is not to be part of a group. |
| void Control_Render | ( | Control * | the_control | ) |
Blits the control to the control's parent window if the control is visible, and if it is listed as invalidated Controls that are visible but not invalidated do not need redrawing.
Also draws the caption of the control, if it has one. Marks control as no longer invalidated.
| the_control | – a valid Control object |
| void Control_SetActive | ( | Control * | the_control, |
| bool | is_active | ||
| ) |
Set the control's active/inactive state.
| the_control | – a valid Control object |
| is_active | – set to true to set control to active, false to set to inactive |
| void Control_SetPressed | ( | Control * | the_control, |
| bool | is_pressed | ||
| ) |
Set the control's pressed/unpressed state.
| the_control | – a valid Control object |
| is_pressed | – set to true to set control state to pressed, false to set to not-pressed |
| bool Control_UpdateFromTemplate | ( | Control * | the_control, |
| ControlTemplate * | the_template | ||
| ) |
Updates the passed control with new theme info from the passed control template Call this when the theme has been changed It allows existing controls to be updated in place, without having to free them and create new theme controls.
| the_control | – a valid Control object |
| the_template | – a valid ControlTemplate object to update the Control object from. |