I think this has been covered elsewhere, but many years ago. Others seemed to have the same problem then.
When using validators in a dialog and you have an OK button with OnOkClick function using wxID_OK, the documentation says it is supposed to automatically call TransferDataFromWindow(). I have not been able to get this to work unless I add TransferDataFromWindow(); to my OnOkClick function.
Data Validation
Re: Data Validation
Do you call event.Skip() in the wxID_OK button event handler, so that the default behavior gets executed, too?
Use the source, Luke!
Re: Data Validation
No I did not call event.Skip(); Somehow I missed that requirement in my understanding of wxWidgets.
Now that I add that call, I can remove the manual call of TransferDataFromWindow() and it works as it should.Thank you so much.
Now that I add that call, I can remove the manual call of TransferDataFromWindow() and it works as it should.Thank you so much.
Re: Data Validation
That's not a general requirement, it depends on the case. The name of the method does not make very clear what it does. Think of it as "ContinueProcessing()". That means if you call event.Skip(), other event handlers for the same event will get executed. Otherwise they will not. Normally you do not call event.Skip() for command event handlers like button or menu events, but in this particular case you have to so that the dialog's event handler for that event gets executed.
Use the source, Luke!