On Saturday 17 February 2001 05:15, Allan Rae wrote:
[...]
> The button controller is supposed to be exactly that: the controller.
> Remember the MVC discussions. Either way we have two choices as I see it:
> 1. use input() only for input processing. This is the same as
> your introduce a selection() option.
> 2. tri-state output for input():
> -- SMI_VALID
> -- SMI_INVALID
> -- SMI_NOOP -- don't change whatever state we're in
>
> Then input() should change to:
> SMInput const input(...);
>
> so it returns something appropriate above.
>
> Then FormBase::InputCB should use:
> pre->bc.input(pre->input(...));
>
> We can still leave valid() and invalid() in the interface but they
> probably won't be used unless called directly within some dialog-specific
> callback.
>
> This generalization of the input() methods outputs could be useful for
> feeding back multiple state machine inputs triggered by some change in the
> dialog. That'd require some mods to either ButtonController or the
> ButtonPolicys and I'm not sure we'd really need that capability anyway.
>
> Anyway, IMO this is cleaner than building lists of stuff the controller
> should ignore. Especially if someone decides something should be ignored
> only sometimes.
>
> Yes, it will mean extending all the state machine definitions slightly --
> add a line that says:
> if (SMI_NOOP == in) return;
>
> to the top of nextState() in ButtonPolicies.C.
>
> Too easy?
I knew I'd be able to trick you into active development! This is a super
idea. Do you want to code this up, or shall I?
Angus