Hi,

I commit new Accelerator event handling.
    - GUI.h :
        + Add FindChildWindowsProc prototype and search typedef struct.
    - GUI_Events.cpp :
        + Rewrite DoEvent_Accelerator.
    -  GUI_Helpers.cpp :
        + Add FindChildWindowsProc for search a child with specific name.

> >
> > 1) if accelerator define like  : "key" => sub { } or "key" => \&mysub
> >   - Call this function with Window Self + accelerator name.
>
> This one will clearly wind up being the fastest to locate and invoke,
> under NEM.

Yes, it's faster way.

> > 2) if accelerator define like : "Key" => "Name"
> >   - Find a window called "Name" in current window hierarchy and
> > call -onClick event if exist with Window Self .
> >   - Call Window -onClick event if exist with Self + Name (-acc is
availlable
> > only for Window and Dialog so Click event isn't use for specific stuff).
>
> Yes, -accel is only available for those two, but I could imagine other
> uses for Click event on the "white space" of a parent window.  So that
> is why I suggested making a new "Accel" event, so one could specify
> -onAccel => sub {...}

Actually, i keep Click because :
    - I win an NEM event flag ;o)
    - For Click event on the "white space", it's not standard window event.
      And, i think it's more application implementation to use KeyDown event
and check white space.
    - We can reuse Click event for menu (like Jez suggest) (so accelerator
and menu call same method).
        When your menu is "text" => "name" like in OEM.
        We can call Window -click event if we can't found a OEM event
handler.

But of course it's easy to change.

> >   - Check for OEM Name_Click and call it if exist.
>
> This last would only be done for OEM mode, and BOTH mode, I presume.

Actually, i call it, only if haven't find a named child window or named
child window is OEM/BOTH.
I can call Unknow_Click method like in OEM (for compatibility).

Laurent


Reply via email to