|
Hi, To some a few days ago I looked information on
as to cancel a process without having that to use the dialog of progress of the
PalmOS. I did not find a skill to make, but finally I imagined another
skill using the EvtGetPen and functioned, now not use more dialog of progress in
my application. I place a button in the screen where I want to cancel and
I am catching the PewDown events and if the user to press in the region of the
button "To cancel" I stop the process. He is ai, if somebody to want to
take off the dialog and still does not have a skill.
void Main(void)
{ Char sCount[5]; UInt16 uiCount; for (uiCount=0; uiCount < 1000; uiCount++) { StrIToA(sAux, uiCount); SetTextField(MainStatusField, sAux); if (UserCancel()) break; } } Boolean UserCancel(void) { Boolean bPenDown; Int16 iScreenX; Int16 iScreenY; RectangleType rP; FormType * frmP; UInt16 uiObjIndex; frmP = FrmGetActiveForm(); uiObjIndex = FrmGetObjectIndex (frmP, MainCancelButton); FrmGetObjectBounds (frmP, uiObjIndex, &rP); EvtGetPen (&iScreenX, &iScreenY,
&bPenDown);
if (bPenDown && (iScreenX >= rP.topLeft.x) && (iScreenX <= (rP.topLeft.x + rP.extent.x)) && (iScreenY >= rP.topLeft.y) && (iScreenY <= (rP.topLeft.y + rP.extent.y))) return true; else return false; } Renato
-- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ |
