kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #34460
Re: A fix for our TEXT_CTRL_EVAL class.
Le 27/02/2018 à 11:56, Maciej Sumiński a écrit :
> Hi Jean-Pierre,
>
> Thank you for investigating the issue, I think you are correct about the
> changes. The attached patches follow Jeff's suggestion about resetting
> the previous expression value in NumericEvaluator, but only the modified
> expression is cleared. I realize that right now there is no difference
> whether all variables or a particular one is cleared, but I do not want
> to lose the possibility of defining custom variables or referencing
> other fields.
>
> Regards,
> Orson
Thanks.
I committed these 2 patches.
>
> On 02/25/2018 11:17 AM, jp charras wrote:
>> Hi Orson,
>>
>> Could you have a look into this small patch.
>> I am not sure I used the better way to fix an issue.
>>
>> It fixes an issue when using SetValue() to change the value shown by this widget.
>>
>> The issue was due to the fact TEXT_CTRL_EVAL stores internally the last entered value in a buffer.
>> So when calling SetValue() after a value was already entered, and if we try to modify
>> the displayed value by calling SetValue(), as soon as the widget has the focus, the previous value
>> replaces the new value.
>>
>> This is easy to see in Move Exactly dialog:
>> - enter a value
>> - reset the value by the Reset button
>> - move the cursor to the corresponding text control widgets and click on it to give it the focus.
--
Jean-Pierre CHARRAS
References