kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #24098
Re: 0.1 degrees
-
To:
Wayne Stambaugh <stambaughw@xxxxxxxxx>, <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Tomasz Wlostowski <tomasz.wlostowski@xxxxxxx>
-
Date:
Mon, 11 Apr 2016 17:01:59 +0200
-
Authentication-results:
spf=pass (sender IP is 188.184.36.50) smtp.mailfrom=cern.ch; lists.launchpad.net; dkim=none (message not signed) header.d=none;lists.launchpad.net; dmarc=bestguesspass action=none header.from=cern.ch;
-
In-reply-to:
<570BBB47.5070601@gmail.com>
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:23
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
On 11.04.2016 16:57, Wayne Stambaugh wrote:
> On 4/11/2016 10:39 AM, jp charras wrote:
>> Le 11/04/2016 16:07, Wayne Stambaugh a écrit :
>>> On 4/11/2016 9:43 AM, jp charras wrote:
>>>> Le 11/04/2016 15:12, Nick Østergaard a écrit :
>>>>> In addition I would vote for a proper validator that accepts units. We
>>>>> already have the feature to enter 42.34 mm even if you are in inch
>>>>> mode globally. With the wxvalidator you can not enter letters at all,
>>>>> and hence not the unit.
>>>>
>>>> For this feature, see:
>>>> double DoubleValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue );
>>>> It accepts units and both separators in the text value (for angles, degrees or radians).
>>>
>>> This isn't a validator. DoubleValueFromString() has to be called after
>>> the data is entered into the text control. Properly designed validators
>>> will filter illegal characters and display error messages if the
>>> validation fails. It's a much cleaner design. Eventually I would like
>>> to see most if not all of our dialogs use validators. We just need to
>>> create a decent set of stock validators that handle the data entry we
>>> use. Once we have a decent set of stock validators, it should be fairly
>>> trivial to fix our dialogs.
>>>
>>
>> Of course, it is not a validator, but shows what a good validator should accept.
>>
>> Just when creating validators for values (coordinates, angles) keep in mind the presence of units,
>> taking in account the I18n constraints.
>> A validator for coordinates and angles is more complicated than the wxValidators from wxWidgets, if
>> we want to specify units in values (I have to say I do not use this feature, but it currently exists)
Hi Wayne,
Just my 5 cents - I once wrote a class called WX_UNIT_BINDER (used in
the P&S dialogs) which manages a text input field along with its unit
label (according to current units settings). Maybe it could be extended
with proper validation and used for all coordinate/dimension inputs?
Tom
Follow ups
References