Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/widget_ref/pt/ptgenlistdrawstring.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/widget_ref/pt/ptgenlistdrawstring.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/widget_ref/pt/ptgenlistdrawstring.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/widget_ref/pt/ptgenlistdrawstring.html on line 8
Draw a string
void PtGenListDrawString( PtWidget_t *list,
PtGenListItem_t const *item,
const char *string,
PhRect_t const *where,
int lmarg,
int rmarg );
- list
- A pointer to the list widget. This should
be the same as that used in the list argument of the List
Draw method.
- item
- A pointer to a PtGenListItem_t structure, which describes the item in the
list widget you want to draw the string for.
- string
- The string to display. Any
Tab characters in the string are interpreted as column separators.
- where
- A pointer to a
PhRect_t
structure (see the Photon Library Reference) that
defines the rectangle in which the text is positioned.
The x values for the rectangle should
be the same as those used in the where argument of the List
Draw method. The y values define the vertical
position of the string to be drawn between the given values.
- lmarg, rmarg
- Define additional
margins. The value of lmarg is added to the from
value of the first column, and rmarg is subtracted from the
to value of the last column. If the widget doesn't
have columns, the width of the widget's canvas is used as a column.
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 |
PtGenList,
PtGenListItem_t
PhRect_t
in the Photon Library Reference
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/widget_ref/pt/ptgenlistdrawstring.html on line 176
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/widget_ref/pt/ptgenlistdrawstring.html on line 176