Simulator dialogs: Fix incorrect handling of Validate(), which was called for all widgets by the default wxID_OK button handler. It is now called only for the active page of these dialogs (as wanted in code), therefore only for used widgets.

Note: strangely, this issue was noticed only on Windows, not on Linux.
This commit is contained in:
jean-pierre charras 2016-09-17 14:38:34 +02:00
parent 48f916bd63
commit f3d4f7322b
2 changed files with 20 additions and 2 deletions

View File

@ -65,6 +65,15 @@ public:
bool TransferDataFromWindow() override;
bool TransferDataToWindow() override;
// The default dialog Validate() calls the validators of all widgets.
// This is not what we want; We want only validators of the selected page
// of the notbooks. So disable the wxDialog::Validate(), and let our
// TransferDataFromWindow doing the job.
virtual bool Validate() override
{
return true;
}
int ShowModal() override;
private:

View File

@ -76,8 +76,17 @@ private:
*/
bool addPwlValue( const wxString& aTime, const wxString& aValue );
bool TransferDataFromWindow() override;
bool TransferDataToWindow() override;
virtual bool TransferDataFromWindow() override;
virtual bool TransferDataToWindow() override;
// The default dialog Validate() calls the validators of all widgets.
// This is not what we want; We want only validators of the selected page
// of the notbooks. So disable the wxDialog::Validate(), and let our
// TransferDataFromWindow doing the job.
virtual bool Validate() override
{
return true;
}
virtual void onInitDlg( wxInitDialogEvent& event ) override
{