Focus vs. Activation

Ole Nielsby ole.nielsby at tekare-you-spamminglogisk.dk
Wed Aug 1 11:45:47 PDT 2007


crjjrc <crjjrc at gmail.com> wrote:

> What exactly is the difference between a focus event and an activation
> event?  I'm not getting a clear understanding from the event handle
> overview in the documentation.

As you can see from the methods

    wxWindow::SetFocus
    wxTopLevelWindow::IsActive,

being active is a wxTopLevelWindow thing while individual widgets on
the active top level window (or most of them) can have the focus.

In wxWidgets, when a top level window is activated, it automatically
gives the focus to the one of its controls that had it when the window
was last active, so you generally don't need to bother about these
events. You can override the SetFocus method if you need special
behaviour for your own custom widgets.








More information about the wx-users mailing list