The GOL objects follow two types of states, the Property States and the Drawing States. Property States defines action and appearance of objects. Drawing States on the other hand indicate if the object needs to be hidden, partially redrawn, or fully redrawn in the display. To store the states, the field state defined in OBJ_HEADER structure is used. Six most significant bits are allocated for Drawing States and the rest is allocated for the Property States. Some common Property States and Drawing States are shown in the following table.
State |
Type |
Bit Location |
Description |
OBJ_FOCUSED |
P |
0x0001 |
Object is in the focused state. This is usually used to show selection of the object. Not all objects have this feature. |
OBJ_DISABLED |
P |
0x0002 |
Object is disabled and will ignore all messages. |
OBJ_DRAW_FOCUS |
D |
0x2000 |
Focus for the object should be redrawn. |
OBJ_DRAW |
D |
0x4000 |
Object should be redrawn completely. |
OBJ_HIDE |
D |
0x8000 |
Object will be hidden by filling the area occupied by the object with the common background color. This has the highest priority over all Drawing States. When an object is set to be hidden, all other drawing states are overridden. |
Where:
- OBJ – represent the prefix assigned to a GOL object.
- P – Property states, D – Drawing states
Macros
Name |
Description |
This macro retrieves the current value of the state bits of an object. It is possible to get several state bits. | |
This macro clear the state bits of an object. Object must be redrawn to display the changes. It is possible to clear several state bits with this macro. | |
This macro sets the state bits of an object. Object must be redrawn to display the changes. It is possible to set several state bits with this macro. |
Topics
Name |
Description |
List of common Object bit states. |
Links