API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
The IStatic Interface allows you to create a static text control that consists of a read-only text message and a title that appears at the top of the control's rectangle. Unlike the text controls created with the ITextCtl interface, the text in a static text control cannot be entered or modified by the device user. The text message is broken into lines within the control rectangle with each line containing an integral number of words (that is, words are not broken across lines), except when the word is longer than the width of the control rectangle, in which case the word is wrapped to the next line. If the text message is too long to completely fit on the device screen, the static text control automatically scrolls the message. When the end of the message is reached, the continuous scrolling starts again from the beginning. Instead of using a text message as the control's contents, you can choose to display an animated bitmap created with the IImage interface. If this option is selected, the bitmap is displayed centered inside the static text control's rectangle.
The following steps are typically followed to use a static text control. (Refer to the function descriptions in the following subsections and the IStatic Interface usage examples for details on the parameter lists and return values of each IStatic interface function.)
To use a static text control, follow these steps:
1. Create an instance of the IStatic interface using ISHELL_CreateInstance().
2. Set the dimensions of the control's rectangle using the ISTATIC_SetRect().
3. Obtain the text for the control's title and text message strings, either by reading them from a Brew MP resource file or from text strings in your code. If a bitmap is being used in place of the text message, read in the bitmap and use IIMAGE_SetParm() to set its animation properties (number of frames, animation rate, and so forth).
4. Call ISTATIC_SetText() to specify the control's title string, message string, or bitmap, and the fonts to be used for the title and text. You must call ISTATIC_SetRect() (see step 2) before calling ISTATIC_SetText(), because the latter uses information about the control rectangle to determine how to display the control.
5. Call ISTATIC_Redraw() to display the control's contents on the screen.
6. When the control is no longer needed, call ISTATIC_Release(). This function frees the memory for the control's message text and title, but it does NOT release an animated bitmap. You must explicitly release the IImage interface if you created an instance of one in step 3.