"Ben Combee" <[EMAIL PROTECTED]> a �crit dans le message de news:[EMAIL PROTECTED] > > >Thank you for the answer, I had started with 2) but I ran in the following > >problem: > > > >the copy of the event loop I used is simplified and it looks like this: > >Boolean delayAndHandleEvents(Int32 iDelay) > >{ > > EventType lEvent; > > Err error; > > Boolean lStop = false; > > for(;;) > > { > > EvtGetEvent(&lEvent, 0); > > if (lEvent.eType == nilEvent) > > break; > > else > > if(! SysHandleEvent(&lEvent)) > > if (FrmDispatchEvent(&lEvent)) > > lStop = true; > > } > > if (!lStop) > > SysTaskDelay(iDelay); > > return lStop; > >} > > > >I rely on the handler for some buttons (only one button for now but several > >in the future) on the current > >form to set a static variable to false which will stop the animation. > > > >This works fine under the emulator and os 4.0 but under the simulator the > >events are not generated the same way: > > > >penDown and penUp are generated > >but not ctlEnter and ctlSelect. > > ctlEnterEvent is generated when the default form event handler sees a > penDown event that lies inside a control. If you don't have an active > form, you'll never get those events -- is this a possibility? Have you > done a FrmDrawForm first before going into your loop? > > Other than that, I'm not sure what's wrong. > > -- Ben Combee, DTS technical lead, PalmSource, Inc. > Read "Combee on Palm OS" at http://palmos.combee.net/
Yes I did (and the control are currently displaying correctly as a result). Also it only happens with the 5.0 simulator (maybe with real devices but I cannot test). Here is an extract of the event flow I removed a lot of not needed sysNil and 24579 56 2.164 sysNil 57 2.180 sysPenDown x=35, y=73 //first click in the button 58 2.188 sysNil 59 2.205 sysNil 66 2.298 sysPenUp x=35, y=73 67 2.309 sysNil 183 6.883 24579 184 6.890 sysPenDown x=29, y=111 //second click in the button after animation 185 6.896 ctlEnter controlID=9966, pControl=0x00AF3A10 186 6.970 ctlSelect controlID=9966, pControl=0x00AF3A10, on=0 187 6.985 sysWinExit enterWindow=0x00AF3860, exitWindow=0x00AF3998 188 6.998 sysWinEnter enterWindow=0x00AF3860, exitWindow=0x00AF3998 189 7.008 16641 190 7.028 sysPenUp x=29, y=149 191 7.350 sysNil 192 7.350 24579 What is strange is that the second click was done at almost the same place (more or less a few pixel) but the event shows it about 40 pixel down which is incorrect. It looks like the first click (during the animation is reporting the wrong y position). As this animation is happening on a popup form which is not full screen but aligned to the bottom I will try to align it to the top and see if it corrects the issue. If this is the case there may be some kind of API bug but I don't understand why the behavior is different within my animation and without. Best regards Benoit Cerrina -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
