On Monday 29 October 2001 10:07 am, Herbert Voss wrote: > Angus Leeming wrote: > > > > On Monday 29 October 2001 8:38 am, Herbert Voss wrote: > > > testing valid float placement is something cruel, > > > > > > [htbp] in any combination and with an additional > > > ! in front and [H], but any char should appear > > > only once. > > > > > > this test of a valid placement makes only sense > > > when the user defines this as a string and not > > > from a gui with buttons. I don't know if I'm right, > > > but the user hasn't the possibility to set > > > wrong placements ???? > > > > > > Herbert > > > > So, you're assuming that the user knows that [htbp], ! and H are the only > > valid input. Quite a lot to assume, I feel. Much better to do this with > > buttons. > > > > IFF you disagree with me violently, then why not write a filter that prevents > > invalid input. See the code in input_validators.C > > my question was: why to check, when the user cannot enter > (at this time) wrong placements? > > it's not my problem to do a check, but why? > > Herbert
Ok, understood. We should check EVERYTHING in all dialogs. Why? Because the GUIs are effectively external to LyX. They could pass any old rubbish back, so we really should check that they haven't before the changes are applied. Lars would like this done by the LyX core and I agree. This has traditionally meant somewhere after LyXFunc::dispatch(), but we might consider that the controllers have become sufficiently well-established that they can now be considered a core part of LyX. In which case, the right place to do the check IS in the controllers (encapsulation, blah, blah). Remember that the controller-view was a suggested way of doing things, not the only way. Until now, we have't insisted that GUIs use it. Perhaps we should? Angus
