mirror of https://github.com/BOINC/boinc.git
MGR: in Advanced Preferences dialog highlight textedit field with illegal value by setting its background to red.
This commit is contained in:
parent
588e001c17
commit
be54342486
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -74,6 +74,8 @@ private:
|
|||
wxTextCtrl* netDayStartTxts[7];
|
||||
wxTextCtrl* netDayStopTxts[7];
|
||||
bool m_bOKToShow;
|
||||
wxColour stdTextBkgdColor;
|
||||
wxTextCtrl* lastErrorCtrl;
|
||||
};
|
||||
|
||||
#endif // _DLGADVPREFERENCES_H_
|
||||
|
|
Loading…
Reference in New Issue