← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Add mils as user unit

 

On 9/4/2017 4:14 PM, Mathias Grimmberger wrote:
> 
> Hi Lorenzo,
> 
> Lorenzo Marcantonio <lomarcan@xxxxxx> writes:
>> On Mon, Sep 04, 2017 at 02:58:45PM +0200, Tomasz Wlostowski wrote:
>>> below is a patch to add "mils" as a user unit to pcbnew, the gerber
>>> viewer and the module editor. I left out eeschema because I do not think
>>> it's useful there, but if required adding it would be easy.
>>
>> The input box parser actually interpret 'mi' for mils since its
>> creations, by the way!
> 
> I noticed that this should already work.
> 
> Unfortunately in the dialogs using the WX_UNIT_BINDER it doesn't because
> the unit binder flags input with an appended unit as invalid. And to add
> insult to injury no error is shown, the input is just ignored (also
> for stuff like "zz").
> 
> Input validation is implemented quite unevenly in any case, some inputs
> do not even allow to input invalid characters (IMHO desirable), others
> allow anything and complain later.
> 
> Is there a plan how this should work, is WX_UNIT_BINDER the standard way
> envisioned? Because in that case it needs some work.

wxValidator is the standard way to customize control input and output.
This is well documented in the wxWidgets documentation.  Please do not
create a custom design unless there is no way to do this as validator
which I highly doubt.  There are even source files for creating custom
validators aptly named include/validators.h and common/validators.cpp.

> 
> 
> MGri
> 
> _______________________________________________
> 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
> 



Follow ups

References