I have a StringGrid for which I test input with OnEditingDone and, if there is a potential problem, a MessageDlg asks if the user wishes to continue with the input or revert to original cell contents. There is also a Save button on the Form.
My problem is this. If the user enters a suspect string then presses Save while the focus is still on the last grid cell, the flow passes through the EditingDone procedure and triggers the MessageDlg but the Save procedure doesn't subsequently fire. Non-flagged input with the focus on the last cell works fine despite all inputs being checked by the EditingDone procedure. It seems that the opening and responding to the MessageDlg prevents the Save from being called.
My program is large so I have written the attached files (.txt is th .lfm file) to demonstrate. The grid will take any input and the button changes the colour of the square at any time. If the input is an 'a' and the focus is left on the grid cell and the colour change button is pressed, the messagedlg fires but the square doesn't change colour. But if the input does not contain an 'a' then the colour button fires despite the flow going through the editingdone procedure.
The problem seems to be the calling of the messagedlg
Am I ding something wrong (probably) or is it a bug? Any solution?