Re: [Kicad-developers] Dialog field validation on KillFocus

2018-11-29 Thread Jeff Young
> 
> You may want to tread carefully allowing users to accept invalid
> settings.  They may cause crashes or other unexpected behavior bugs.

Will do.  In most places where it really matters we weren’t trusting the 
on-exit-validation anyway, and already have code in TransferDataFromWindow.

Cheers,
Keff.___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Dialog field validation on KillFocus

2018-11-29 Thread Jeff Young
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  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() 
> 
>  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  > 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 
> > 
> > Post to : kicad-developers@lists.launchpad.net 
> > 
> > Unsubscribe : https://launchpad.net/~kicad-developers 
> > 
> > More help   : https://help.launchpad.net/ListHelp 
> > 
> > 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers 
> 
> Post to : kicad-developers@lists.launchpad.net 
> 
> Unsubscribe : https://launchpad.net/~kicad-developers 
> 
> More help   : https://help.launchpad.net/ListHelp 
> 
> 
> 
> -- 
> Mark
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Dialog field validation on KillFocus

2018-11-29 Thread Mark Roszko
> 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()

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 
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
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>


-- 
Mark
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Dialog field validation on KillFocus

2018-11-29 Thread Wayne Stambaugh
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
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Dialog field validation on KillFocus

2018-11-29 Thread Maciej Sumiński
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.
> 
> 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.

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.

Cheers,
Orson



signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] Dialog field validation on KillFocus

2018-11-29 Thread Jeff Young
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.

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?___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp