Forum > LCL

TMaskEdit - it's back

(1/1)

igoddard:
The old problem with TMaskEdit seems to have returned.  On entering characters it will often skip forward a space.  I was astonished to check the history & find that one of the first error reports was mine years ago and that I reported I'd worked round it by installing gtk2-qtcurve which is no longer an option.  I haven't used TMaskEdit in the intervening years - I haven't done much coding at all - but the history suggests that periodically it seems to have come back and then been fixed.

Two things suggest to me that this might be a race condition.  One is that the skipping of characters is erratic; sometimes it will skip after the first character, sometimes not until the second or third, sometimes on every character and sometimes not at all.  The other is that it keeps returning, maybe related to clock speeds getting faster and breaking every fix.  I get the impression that Bart's code (and let me say that I really do appreciate his work on this) is wrestling with the OS window manager code.  I suspect both are trying to set the caret in place for the next character, one by placing the caret directly to where it calculates it should be and one by advancing the place by a character and that if the former wins and puts it in the right place the other comes along and moves it forward.

Unfortunately the forum login no longer gives acess to the bug reporting.  In the meantime has anyone any ideas on how to enforce the entry of a simple 4-digit year number other than using a TEdit and validating each character as it's entered?

howardpc:

--- Quote from: igoddard on April 19, 2022, 02:27:51 pm ---has anyone any ideas on how to enforce the entry of a simple 4-digit year number other than using a TEdit and validating each character as it's entered?

--- End quote ---
One alternative would be to use a suitably sized spinedit with MinValue = 1000 and MaxValue=2022 (or values to suit your use case), possibly with an OnEditingDone event handler as well.

Navigation

[0] Message Index

Go to full version