Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Mindtraveller is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: BUG?: EditString Text rendering not stable with some Strings
Next Topic: need some expert advice to extend the LineEdit
Goto Forum:
  


Current Time: Tue Jul 08 12:41:56 CEST 2025

Total time taken to generate the page: 0.03646 seconds