← Back to team overview

kicad-developers team mailing list archive

Re: wxWidgets Event Tables or Bind and lambdas

 

On 2019-07-12 08:29, Jeff Young wrote:
These are currently reasonably common in the code:

1)

m_footprintListBox->Bind( wxEVT_RIGHT_DOWN, [this]( wxMouseEvent& ) {
     this->PopupMenu( this->m_footprintContextMenu ); } );

2)
m_footprintListBox->Bind( wxEVT_RIGHT_DOWN, [this]( wxMouseEvent& ) {
         this->PopupMenu( this->m_footprintContextMenu );
                                            } );

3)
m_footprintListBox->Bind( wxEVT_RIGHT_DOWN, [this]( wxMouseEvent& )
                                            {
         this->PopupMenu( this->m_footprintContextMenu );
                                            } );

4)
m_footprintListBox->Bind( wxEVT_RIGHT_DOWN, [this]( wxMouseEvent& ) {
    this->PopupMenu( this->m_footprintContextMenu );
} );



5)
m_footprintListBox->Bind( wxEVT_RIGHT_DOWN, [this]( wxMouseEvent& )
{
    this->PopupMenu( this->m_footprintContextMenu );
} );



6)
m_footprintListBox->Bind( wxEVT_RIGHT_DOWN, [this]( wxMouseEvent& )
    {
        this->PopupMenu( this->m_footprintContextMenu );
    } );

Personally I’ve been using either (1) or (6), depending on length.
(I’ve gone back and forth between 5 and 6: do we want them to look
different from a normal block, or not?)

I’ve got no strong feelings.  But I think we should pick one or two
to “bless”….

+1 to a standard format for lambdas. I generally use (6) but am happy with whichever standard we pick.

-S


References