Branch: Tag:

2018-01-29

2018-01-29 12:48:36 by Karl Gustav Sterneberg <kg@roxen.com>

Archive / Edition Purger: Chainable functions in class Variable. [ARCH-263]

Made it possible to chain calls to functions
'set_invisibility_check_callback', 'set_changed_callback' and
'add_changed_callback' in class Variable.

323:    return 1;    }    -  void set_invisibility_check_callback( function(RequestID,Variable:int) cb ) +  this_program set_invisibility_check_callback( function(RequestID,Variable:int) cb )    //! If the function passed as argument returns 1, the variable    //! will not be visible in the configuration interface.    //!
333:    invisibility_callbacks[ _id ] = cb;    else    m_delete( invisibility_callbacks, _id ); +  return this;    }       function(Variable:void) get_changed_callback( )
341:    return changed_callbacks[ _id ];    }    -  void set_changed_callback( function(Variable:void) cb ) +  this_program set_changed_callback( function(Variable:void) cb )    //! The function passed as an argument will be called    //! when the variable value is changed.    //!
351:    changed_callbacks[ _id ] = cb;    else    m_delete( changed_callbacks, _id ); +  return this;    }    -  void add_changed_callback( function(Variable:void) cb ) +  this_program add_changed_callback( function(Variable:void) cb )    //! Add a new callback to be called when the variable is changed.    //! If set_changed_callback is called, callbacks added with this function    //! are overridden.
364:    else    oc = ({ oc, cb }) - ({ 0 });    changed_callbacks[ _id ] = oc; +  return this;    }       function(RequestID,Variable:int) get_invisibility_check_callback()