hi every 1!
i have success fully add bitmaps to my list. the problem now is that, the popup
trigger does not have the bitmap. from my understanding, popup triggers can
only accept strings right?
i tried many ways but none seem to work. until i found the popSelectEvent, when
this happens i get the selection of the list and draw the particular bitmap on
screen. when i tap on the popup trigger again then the bitmap dissapears.
is there any other methods to do this? or any way to make the bitmap stay?
here is my coding:
Boolean CCategoryForm::OnOpen(EventPtr pEvent, Boolean & bHandled)
{
FormPtr frmP = FrmGetActiveForm ();
FrmDrawForm (frmP);
m_iSelectedIcon = g_cPrefs.SelectedIcon;
m_lblIcon.Attach(this,lblIcon);
m_lstIcon.Attach(this,lstIcon);
m_trgIcon.Attach(this,trgIcon);
m_fldIcon.Attach(this,fldIcon);
UInt16 numberOfIcons = 0;
DmOpenRef pdb = OpenIconSet(g_cPrefs.IconSet, true);
if (pdb)
{
numberOfIcons = DmNumResources(pdb);
}
CArray <const char*> IconChoices;
char strIcon[3];
for (int i = 0; i < numberOfIcons; i++)
{
StrIToA(strIcon,i);
IconChoices.Add(strIcon);
}
m_lstIcon.SetListChoices(IconChoices);
m_lstIcon.SetDrawFunction((ListDrawDataFuncPtr)MainListDraw);
if (m_iSelectedIcon)
{
m_lstIcon.SetSelection(m_iSelectedIcon);
Int16 trgX,trgY;
m_trgIcon.GetObjectPosition(trgX,trgY);
RectangleType rect;
rect.topLeft.x = trgX+12;
rect.topLeft.y = trgY+1;
rect.extent.x = 10;
rect.extent.y = 9;
WinPushDrawState();
WinSetForeColor(0);
WinDrawRectangle(&rect,0);
WinPopDrawState();
m_trgIcon.SetLabel(" ");
DrawIcon(m_lstIcon.GetSelection(),trgX+12,trgY+1);
}
bHandled = true;
return false;
}
CCategoryForm::CCategoryForm(): CModalForm(CategoryForm)
{
}
void CCategoryForm::MainListDraw(UInt16 itemNum, RectangleType *bounds, Char
**(itemsText))
{
DrawIcon(itemNum,bounds->topLeft.x,bounds->topLeft.y);
}
Boolean CCategoryForm::OnSelIcon(EventPtr pEvent, Boolean& bHandled)
{
Int16 trgX,trgY;
m_trgIcon.GetObjectPosition(trgX,trgY);
RectangleType rect;
rect.topLeft.x = trgX+12;
rect.topLeft.y = trgY+1;
rect.extent.x = 10;
rect.extent.y = 9;
WinPushDrawState();
WinSetForeColor(0);
WinDrawRectangle(&rect,0);
WinPopDrawState();
m_trgIcon.SetLabel(" ");
DrawIcon(m_lstIcon.GetSelection(),trgX+12,trgY+1);
m_iSelectedIcon = m_lstIcon.GetSelection();
bHandled = true;
return true;
}
To unsubscribe send an email to [EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/