[lazarus] OnExit event...

Tony Maro tonym at nlisc.com
Sun Sep 29 21:00:28 EDT 2002

On Sun, 2002-09-29 at 18:25, Andrew Johnson wrote:
> hrmm.. hope you realize the problems this can introduce with auto 
> Size/scroll'ing, on smaller screen resolutions, edge of screen , beyond 
> screen etc..

Yes.  But it's meant to be a workaround on modal forms where certain
things just weren't working right.  A modal form doesn't like when it
launches another form on top of the modal one apparently ;-D 

> >If I create and show the panel and calender, then call setfocus on the 
> >calendar, it instantly fires the onexit event.
> the event on the panel, or on the Calendar?

Well, the calendar will fire off as soon as you setfocus on it (or maybe
it's before setfocus, I'll have to check that... the Panel just never
gets the event at all, either way.

I just tested and learned that the doubleclick event that I'm using to
launch the calendar pop-up is triggering a setfocus on the text box
AFTER the double-click code is run.  I'm assuming that it's firing a
onclick event after the ondblclick event and then setting the focus back
to the control.  This immediately makes the pop-up disappear, of course,
because the calendar looses focus.  Launching the calendar from a
TButton using the activate method works just fine...  This is probably
by design and would probably function the same way in Delphi but I
haven't tested it.
> Well.. not to beat this issue to the ground, but AFAIK none the 
> focus/non-focus events, tabbing or losefocus/gain focus work quite right, 

Well, there you have it then!  I'm beating a dead horse with a wet
noodle expecting to accomplish something!  Sorry to bother all... lol
> want to rehash all the problems inherent in doing things the Win32 way in a 
> GTK evironment, but suffice it to say while on enter/exit events do exist in 
> GTK, they do not work exactly the same way as you would expect from a Win32, 
> or even a QT design.. aka Delphi/Kylix. I will see what I can dredge up but 

Mmm... I can understand that.  So the next question becomes - and I
think you know what I'm trying to accomplish with this control - do you
have a better suggestion for detecting lost focus when someone clicks
out of the pop-up?  I can always go back to the close button approach...
but was trying to keep from doing that.  I know absolutely nothing about
GTK programming, so hooking in at GTK level is out of the question for
me (at least for another 6 months.)

Do you think it's possible for me to hook a message that would allow my
control to spy on the onenter event application wide, and hide itself
when any form other than itself gets an onenter event?


More information about the Lazarus mailing list