Le 19 mai 04, à 12:53, Robert Purves a écrit : > > Alain Wrobel wrote: > >> Bonjour, >> >> Why in the following example in the case of a mouse clic >> >> 1) over a button USR HANDLE2BTN returns the number of the button >> (normal behaviour) >> 2) over nothing or over a static edit field USR HANDLE2BTN returns >> the number of the first non static edit field (7 in the example) > > This anomaly is due to FindControl. Apple says > "The FindControl function is not recommended when the Appearance > Manager is available. When the Appearance Manager is available, you > should call FindControlUnderMouse to determine the location of a > mouse-down event in a control." > > Instead of > evenement=fn findcontrol(ou,window(_wndPointer),hndleBouton) > use > hndleBouton = fn FindControlUnderMouse( ou, window( _wndPointer ), > @evenement ) > > By the way, where you have used the variable name evenement I would > write partCode (or a suitable translation thereof). That makes it > easier to see that the value 10 shown on clicking a push button is > _kControlButtonPart. > >> 3) over a non static edit field USR HANDLE2BTN returns the number of >> the edit field (i.e. risk of confusion with the first case) >> (are non static edit fields something like pseudo-buttons in the >> Appearance runtime ?) > > In the Appearance Runtime all edit fields, static and editable, are > controls ("buttons"). > >> subsidiary question : why the _statFramed edit fields are they not >> framed ? > > The frames are drawn at HandleEvents time. Add 5 or 6 HandleEvents > statements before you enter the loop. > > Robert P. > Merci Robert all is OK (pleonasm ?) now. Alain _________________________________________________________________ A. Wrobel * GREGUM-UMR ESO, Université du Maine/CNRS *Tel:02-43-83-35-44 _________________________________________________________________