kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #41575
Re: wxWidgets Event Tables or Bind and lambdas
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Mon, 15 Jul 2019 08:36:05 -0400
-
In-reply-to:
<CACp=VfZAoyYX1jFNHQVb7BEQXTPz_=XQOEeuQtM4SeSoAQE=3w@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
Ian,
I would prefer that we not mix event handling styles unless there is a
good reason such as dynamically binding/unbinding for adding temporary
event handling. For new code, I'm fine with either method with the
caveat that all of the Bind calls be defined in the same function rather
than spread all over the place. That's one thing I do like about the
event tables. All of the events are defined in one place.
Cheers,
Wayne
On 7/12/2019 5:11 AM, Ian McInerney wrote:
> This is mainly a code style/implementation question about what should be
> used going forward. I am in the process of going through CVPCB and
> converting it to actions, and also implementing the
> copy/paste/delete/undo/redo features. This necessitates changes to the
> event table (mainly removal of events), but I have also noticed some
> events with smaller handlers (e.g. 1/2 line handlers).
>
> Other windows seem to use the Bind method with lambda functions for
> these small functions, and I have used them as well for some new
> bindings for the actionization when needed. My main question is, is it
> acceptable to also transition existing events (unaffected by the action
> changes) to use this paradigm? My main thinking is for the 1/2 line
> event handlers such as
> CVPCB_MAINFRAME::OnSize
> CVPCB_MAINFRAME::OnOK
> CVPCB_MAINFRAME::OnCancel
> CVPCB_MAINFRAME::OnQuit
> (to name a few) to be transitioned to this paradigm.
>
> Thoughts?
>
> -Ian
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References