lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Input-sequence editor testing


From: Greg Chicares
Subject: Re: [lmi] Input-sequence editor testing
Date: Fri, 24 Jun 2011 13:12:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 2010-09-01 18:09Z, Vaclav Slavik wrote:
> 
> As the first step, here's a patch [...]

Please help me understand: an 'eventSink' parameter is used here...

> @@ -613,6 +614,29 @@ void InputSequenceEditor::insert_row(int new_row)
>  
>      set_tab_order();
>  
> +    // connect event handlers
> +    ::Connect
> +        (value_ctrl
> +        ,wxEVT_COMMAND_TEXT_UPDATED
> +        ,&InputSequenceEditor::UponValueChange
> +        ,wxID_ANY
> +        ,this
> +        );

...and in two similar new calls to ::Connect(); and that parameter is
'this' in all cases, which is the default argument...

...so why is that last argument added in the following generic function?

> diff --git a/wx_utility.hpp b/wx_utility.hpp
> index f5877c1..c02b6b7 100644
> --- a/wx_utility.hpp
> +++ b/wx_utility.hpp
> @@ -79,6 +79,7 @@ void Connect
>      ,wxEventType     event
>      ,Return (Class::*handler)(Argument)
>      ,int             id = wxID_ANY
> +    ,wxEvtHandler*   eventSink = NULL
>      )
>  {
>      // Double parentheses: don't parse comma as a macro parameter separator.
> @@ -98,7 +99,13 @@ void Connect
>  
>      typedef void (wxEvtHandler::*t0)(Argument);
>      typedef wxObjectEventFunction t1;
> -    object->Connect(id, event, c_cast<t1>(static_cast<t0>(handler)));
> +    object->Connect
> +        (id
> +        ,event
> +        ,c_cast<t1>(static_cast<t0>(handler))
> +        ,NULL
> +        ,eventSink
> +        );

Was that necessary for some reason that I don't see? Or is it just
considered better on principle, e.g. for future flexibility?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]