CHeighlund
Programmer
I've been asked to look into a project with a TcxMaskEdit component that's throwing some problems. The main one is this:
The user is expected to hit tab to move between fields. The TcxMaskEdit in question is the last field, and it is suspected that the user will hit enter at this point to enter the record. It is possible for this field to be left blank, so in the OnExit event, if the field is empty a popup dialogue is given, asking whether or not this was intended. (Might have been done accidentally.) If the dialogue is answered with 'no', then the focus is supposed to be set back to the TcxMaskEdit field. Otherwise, focus is set to the submit button.
On leaving the TcxMaskEdit field with a Tab, the field remains enabled, and the SetFocus call works nicely. On leaving the field with an Enter, the field becomes disabled, causing the SetFocus call to throw an error. (Can't set focus to an invisible or disabled object.) Anyone have any clue why this difference occurs, or what needs to be done to stop it? I've cludged in an automatic component.enabled event right before the SetFocus call, but I'd prefer to find some way of not having to use that if possible.
Also, when the user leaves the TcxMaskEdit component by pressing tab, all information remains in the other fields on the screen. When the user presses Enter, all of the fields on screen are emptied. This is done the instant the key is pressed; if the user accidentally pressed the key, then as things stand now they would have to go back and fill in the necessary fields again. It would seem to me that this is most decidedly not an acceptable behavior. I would appreciate hearing if anyone know of any documentation which explains this behavior, or offers ways around it.
Any suggestions?
The user is expected to hit tab to move between fields. The TcxMaskEdit in question is the last field, and it is suspected that the user will hit enter at this point to enter the record. It is possible for this field to be left blank, so in the OnExit event, if the field is empty a popup dialogue is given, asking whether or not this was intended. (Might have been done accidentally.) If the dialogue is answered with 'no', then the focus is supposed to be set back to the TcxMaskEdit field. Otherwise, focus is set to the submit button.
On leaving the TcxMaskEdit field with a Tab, the field remains enabled, and the SetFocus call works nicely. On leaving the field with an Enter, the field becomes disabled, causing the SetFocus call to throw an error. (Can't set focus to an invisible or disabled object.) Anyone have any clue why this difference occurs, or what needs to be done to stop it? I've cludged in an automatic component.enabled event right before the SetFocus call, but I'd prefer to find some way of not having to use that if possible.
Also, when the user leaves the TcxMaskEdit component by pressing tab, all information remains in the other fields on the screen. When the user presses Enter, all of the fields on screen are emptied. This is done the instant the key is pressed; if the user accidentally pressed the key, then as things stand now they would have to go back and fill in the necessary fields again. It would seem to me that this is most decidedly not an acceptable behavior. I would appreciate hearing if anyone know of any documentation which explains this behavior, or offers ways around it.
Any suggestions?