On Tue, 3 Apr 2001, Allan Rae wrote:

> On Mon, 2 Apr 2001, Angus Leeming wrote:
> > > 7) I find it a bit weird that I call a method "valid(bool)" whenever
> > > e.g. a user types another character in a line edit widget. Can we
> > > add another method mutated(bool) or changed(bool) possibly ?
> > > This would make at least the KDE frontend code a lot clearer IMHO
>
> There's more than simply "changed/unchanged".  valid() should only be
> called when a change has happened.  So it represents "valid
> changed/invalid changed".   You are also free to call bc.input(SMInput)
> directly.

BTW, what happens if after the user presses a key they then try to press
Okay?  If the last key press in the edit box gave an invalid entry then
they shouldn't have an Okay button available.  Sure it's possible to
register input filter functions for edit boxes or other inputs with xforms
and I imagine most toolkits allow this also.  So it should be possible to
ensure any input field always contains valid characters but what about
what that input represents in combination with other widgets?  It's
possible to enter an input using all the valid characters for an input and
still not have a valid entry: does the directory really exist and is
writeable (in Preferences) or the font sizes aren't in ascending sizes
(again in Preferences).

That's what the input checking routine is for.

The fact that an input has changed isn't significant.  The problem is
whether or not that change has resulted in a valid contents of the dialog
or not.  If the contents are valid then Okay and Apply should be
enable-able (if the state machine is in an appropriate state).

Allan. (ARRae)

Reply via email to