kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #34287
Re: validators
I looked in to wxWidget’s validators, and they’re definitely challenged. (Brain-dead might be more accurate.)
As part of the units overhaul I’m going to propose making widespread use of the UNIT_BINDER, which is a wrapper for a wxTextEntry/wxStaticText-tuple.
As a wrapper it’ll be easy to add evaluation and validation to it, and allow most all other clients to wash their hands of unit display, unit conversion, evaluation, and validation.
(We’ll probably want to rename UNIT_BINDER something more generic at that point.)
Cheers,
Jeff.
> On 23 Feb 2018, at 20:10, Wayne Stambaugh <1751315@xxxxxxxxxxxxxxxxxx> wrote:
>
> @JP,
>
> Understood but we can always create our own validator derive from the
> base wxNumValidator or wxValidator object if wxFloatingPointValidator is
> to restrictive. As for the numeric limiting, if you set the limit's to
> 0.5 than 0.6 is illegal both as an initial value and as user entered
> value so that is just the behavior of the validator which we could also
> override in a derived object.
>
> On 02/23/2018 02:39 PM, jean-pierre charras wrote:
>> @Wayne,
>>
>> I was never impressed by the wxFloatingPointValidator.
>>
>> AFAIK, for instance, if a minimal value is fixed to 0.5, you cannot enter a value starting by 0 like 0.6 (just because starting a value by 0 is too small)
>> You need to enter 1.6 and after change 1.6 to 0.6
>>
>> But the issue here is different:
>> In countries using a comma as separator, we use both the . or the , to enter a floating point value.
>> In a dialog, these 2 separators *must be* equivalent when the separator is the comma.
>>
>> But wxFloatingPointValidator does not accept both separators, only the
>> comma.
>>
>> This is very annoying.
>>
>> If we want to use a FloatingPointValidator, we need to create our own validator.
>> For me wxFloatingPointValidator just does not work in Kicad.
>>
>
> --
> You received this bug notification because you are a member of KiCad Bug
> Squad, which is subscribed to KiCad.
> https://bugs.launchpad.net/bugs/1751315
>
> Title:
> pcbnew: float point separator '.' truncate fractional part (default
> separator is ',')
>
> Status in KiCad:
> New
>
> Bug description:
> For example: if set in dialog 'Move exactly' `Move vector X` to 2.5 then number truncated up to 2.
> If set 2,5 then number not truncated (OK).
> I use the RU locale.
>
> Application: kicad
> Version: 5.0-dev-unknown-997d4de~62~ubuntu17.10.1, release build
> Libraries:
> wxWidgets 3.0.3
> libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
> Platform: Linux 4.13.0-32-generic x86_64, 64 bit, Little endian, wxGTK
> Build Info:
> wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
> Boost: 1.62.0
> Curl: 7.55.1
> Compiler: GCC 7.2.0 with C++ ABI 1011
>
> Build settings:
> USE_WX_GRAPHICS_CONTEXT=OFF
> USE_WX_OVERLAY=OFF
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_SPICE=ON
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1751315/+subscriptions
Follow ups