Every Graphics object has several state bits. The state bits are combined together into one word and stored in the object's data structure. State bits fall into one of two different categories:
The first category informs the drawing function, GFX_GOL_ObjectListDraw, to copy the entire object, or a portion of the object, to the frame buffer.
The second category of status bits informs GFX_GOL_ObjectListDraw HOW to draw the object. When an object is being copied to the frame-buffer some of the state bits inform GFX_GOL_ObjectListDraw which elements from the style scheme are to be applied to the object.
Examples of the GFX_GOL_ObjectListDraw applying a style scheme to an object based on the state bits is covered in the Drawing Graphics Objects Developer's help page.
State Bits used to Draw or Re-draw an Object
GOL_OBJ_xxxx_DRAW_STATE and GOL_OBJ_xxxx_DRAW_UPDATE_STATE are the state bits used to determine if an object is to be drawn or redrawn to the frame buffer.
The 'xxxx' in the state bit names above are representative of the type of object to be drawn. There are no state bits with an xxxx in their name.
All objects have a "DRAW" state bit. When this bit is set the entire object is written (or re-written) to the frame buffer. Typically the user program sets the DRAW bit when a situation occurs in which the entire object needs to be redrawn.Some objects have an "UPDATE" status bit in addition to the DRAW bit. When the update bit is set by the user application only the portion of the object which contain data (such as the value on the meter object) will be re-drawn to the frame buffer. Using the UPDATE bit will help reduce the visual "jitter" that some people notice when an entire object is redrawn.
|Object||'Daw' State bit||'Update' State bit|
|Static Text Box||GFX_GOL_STATICTEXT_DRAW_STATE||n/a|
open help_mlagfx.jar located in …microchip/mla/vYYYY_MM_DD/doc…
State Bits Used to Control an Object's Appearance
In addition to the draw and update state bits, Graphics objects each have the following bits:
- GFX_GOL_xxxx_DISABLED - Draws the object with ColorDisabled and TextColorDisabled
- GOLgfx_xxxx_HIDE - Draws the object with the CommonBkColor from the style scheme making the object non-visible
- GFX_GOL_xxxx_FOCUS - Applies a focus element to the object
The 'xxxx' in the update-state bit names above are representative of the type of object to be drawn. There are no state bits with an xxxx in their names. Examples include names such as: GFX_GOL_BUTTON_DISABLE, GFX_GOL_METER_HIDE, etc…
In addition to the draw and update state bits, each object type has some states unique to that object. These unique state bits reflect conditions applicable to those objects. Comparison of the state bits for a Button object and a Scroll-bar object reveals some of the differences:
|Button States||Scroll-bar States|
|Object Specific States in yellow:|
The function and effect of setting the object specific state bits varies from object to object. This tutorial will show you the procedures used to set and clear state bits. Refer to the help file to learn about the attributes of object specific state bits.
Examples of programming changes to the state bits of object is covered in the Changing an Object Appearance Developer's help page.