Home » U++ Library support » LineEdit, EditFields, DocEdit » Custom check for EditIntXxxx controls
Re: Custom check for EditIntXxxx controls [message #37607 is a reply to message #37574] |
Thu, 25 October 2012 08:02  |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |

|
|
OK, finally a little report on results.
Sorry to say that ErrorValue doesn't work very well here. This happens due to the fact it doesn't convert too well into integer value. So you may return ErrorValue(FormatInt(...)) and it will work. But when user pressses (inc) or (dec) spin buttons, the value is immediately switched to -INT_MAX, and there is no way to change this behaviour from user code.
Concluding my experiments, the best way to make control customly checkable is this:
1) Derive MyCustomConvert from one of Convert classes (e.g. ConvertInt). Make any checks in there.
2) For MyCustomConvert provide reference to target EditField derived class. MyCustomConvert clears/sets error state with EditField::Error().
3) Use any Edit*** controls and set your MyCustomConvert with EditField::SetConvert function() providing reference to your Edit*** control.
[Updated on: Thu, 25 October 2012 08:03] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Jul 08 06:35:38 CEST 2025
Total time taken to generate the page: 0.02975 seconds
|