MGR: in Advanced Preferences dialog highlight textedit field with illegal value by setting its background to red.

This commit is contained in:
Charlie Fenton 2015-07-21 03:06:10 -07:00
parent 588e001c17
commit be54342486
2 changed files with 13 additions and 0 deletions

View File

@ -127,6 +127,8 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas
m_Notebook->SetMinSize(sz);
}
#endif
lastErrorCtrl = NULL;
stdTextBkgdColor = *wxWHITE;
Layout();
Fit();
@ -943,6 +945,15 @@ void CDlgAdvPreferences::ShowErrorMessage(wxString& message,wxTextCtrl* errorCtr
if(message.IsEmpty()){
message = _("invalid input value detected");
}
if (lastErrorCtrl != errorCtrl) {
stdTextBkgdColor = m_txtProcIdleFor->GetBackgroundColour();
}
if (lastErrorCtrl) {
lastErrorCtrl->SetBackgroundColour(stdTextBkgdColor);
lastErrorCtrl->Refresh();
}
errorCtrl->SetBackgroundColour(*wxRED);
lastErrorCtrl = errorCtrl;
wxGetApp().SafeMessageBox(message,_("Validation Error"),wxOK | wxCENTRE | wxICON_ERROR,this);
errorCtrl->SetFocus();
}

View File

@ -74,6 +74,8 @@ private:
wxTextCtrl* netDayStartTxts[7];
wxTextCtrl* netDayStopTxts[7];
bool m_bOKToShow;
wxColour stdTextBkgdColor;
wxTextCtrl* lastErrorCtrl;
};
#endif // _DLGADVPREFERENCES_H_