Daniel,
I've done this in a project, basically, I keep an array of ints the same
size as the number of items in the list, and have a function for
toggling the ints in the array whenever an item is tapped.
You need to pick up the list event to change the "tick status" on a
selected item with something like this;

ToggleTickStatus(LstGetSelection((ListType *)
GetObjectPtr(GeneralBigList)));

and register a function to draw the list item like this;

LstSetDrawFunction((ListType *) GetObjectPtr(GeneralBigList)
        ,(void *)GeneralListTickDrawFunction);  

You can pick the bones out of the code below to do what you need for the
draw function, hope it helps.

/**************************
Function to be called when general list items must be shown with ticks
***************************/
void GeneralListTickDrawFunction(UInt itemNum,RectanglePtr bounds,
CharPtr *itemsText)
{
        FontID oldFont;
        short osy=0;
        oldFont=FntSetFont(symbol11Font); 
        if(oldFont==largeBoldFont)      osy=1;
        WinEraseRectangle(bounds,0);
        if(GetTickStatus(itemNum))
        {
                WinDrawChars ("\001",1,
        
(short)(bounds->topLeft.x-3),(short)(bounds->topLeft.y+osy));
        }
        else
        {
                WinDrawChars ("\000",1,
        
(short)(bounds->topLeft.x-3),(short)(bounds->topLeft.y+osy));
        }
        oldFont=FntSetFont(oldFont); 
        WinDrawChars (itemsText[itemNum],StrLen(itemsText[itemNum]),
        
(short)(bounds->topLeft.x+10),(short)(bounds->topLeft.y));
} 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to