← Back to team overview

kicad-developers team mailing list archive

Re: Dialog field validation on KillFocus

 

The red boarder, red text (and a hover error message) would be my preferred solution as far as the user is concerned.  But this is straying into toolkit land.  That would be one thing if we had our own wxWidgets branches on MSW and GTK, or even if we used the latest so I could push some stuff to the official wxWidgets.  But since neither of those are true I’m not sure about this direction.

Cheers,
Jeff.

> On 29 Nov 2018, at 15:58, Mark Roszko <mark.roszko@xxxxxxxxx> wrote:
> 
> > This would be more tolerable than a dialog but a red frame may not work well with all WM themes.
> 
> Make it display an exclaimination mark symbol adjacent to the field as well?
> 
> I'm not sure how well it works but wxWidgets has  wxSystemSettings::GetColour() <https://docs.wxwidgets.org/3.0/classwx_system_settings.html#ab252414b60f16a233bc17df2a19bd804> which could be a way to determine the optimal color. i.e. check on a simple threshold either using one of two colors for contrast.
> 
> 
> 
> On Thu, Nov 29, 2018 at 9:32 AM Wayne Stambaugh <stambaughw@xxxxxxxxx <mailto:stambaughw@xxxxxxxxx>> wrote:
> On 11/29/2018 8:47 AM, Maciej Sumiński wrote:
> > On 11/29/18 2:36 PM, Jeff Young wrote:
> >> While most UI guidelines suggest validating on field exit, it’s not without cost.  In particular, on GTK we can’t tell the difference between a KillFocus from clicking the OK button (when validation should be run) and a KillFocus from clicking Cancel (when it should not).  
> >>
> >> Needless to say, KillFocus-validation also plays very poorly when GTK’s focus-follows-mouse is turned on.
> >>
> >> So I plan to do two things:
> >>
> >> 1) Remove automatic validation on KillFocus from UNIT_BINDER.  Clients which need validation will be modified to call Validate() themselves from their TransferDataFromWindow() methods.
> 
> This way is known to work well across platforms.  Anything else and your
> at the mercy of platform specific event ordering and other UI toolkit
> quirks.
> 
> >>
> >> 2) Remove UNIT_BINDER validation which isn’t needed.  We have a lot of validation which just checks for “reasonable” values.  However, our definition of “reasonable” doesn’t always match our users’ definitions.  “Needed” validation (which will remain) is that which prevents un-supported situations, or that which makes recovery hard (for instance, PCB text with a zero width is hard to select).
> >>
> >> Any comments before I go ahead?
> > 
> > Hi Jeff,
> > 
> > John Beard had a good idea of replacing an error pop-up dialog with an
> > error indicator (red frame around text or red background for text input
> > widget). It will notify the user about potential problems without being
> > too disruptive, and such check might be done by KillFocus event handler.
> 
> This would be more tolerable than a dialog but a red frame may not work
> well with all WM themes.
> 
> > 
> > I would still keep a pop-up dialog showing up if the user wants to
> > accept invalid settings (call Validate() in TransferDataFromWindow()).
> > If we want to provide ammo to shoot their feet, then 'Ignore' button
> > sounds like an appropriate caliber.
> 
> You may want to tread carefully allowing users to accept invalid
> settings.  They may cause crashes or other unexpected behavior bugs.
> 
> > 
> > Cheers,
> > Orson
> > 
> > 
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> > Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> > More help   : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
> > 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> More help   : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
> 
> 
> -- 
> Mark
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


References