Draw a string
void PtGenListDrawString( PtWidget_t *list, PtGenListItem_t const *item, const char *string, PhRect_t const *where, int lmarg, int rmarg );
This function can be used by a child class of PtGenList for drawing strings.
To determine the font and colors it uses to draw a string, PtGenListDrawString() calls the List Attributes method for the list widget.
Here's an excerpt showing the List Draw method of a widget (taken from PtList):
static PtGenListDrawF_t list_draw; static void list_draw( PtWidget_t *const widget, PtGenListItem_t *items, unsigned index, unsigned nitems, PhRect_t *where ) { const int item_height = items->size.h; PtGenListDrawBackground( widget, items, nitems, where, 0, 0, 0, 0 ); do { short bot; bot = where->ul.y + item_height; if ( items->flags & Pt_LIST_ITEM_DAMAGED ) { where->lr.y = bot - 1; PtGenListDrawString( widget, items, STRING(items), where, 0, 0 ); } where->ul.y = bot; items = items->next; } while ( --nitems ); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PhRect_t in the Photon Library Reference