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);
|
m_Notebook->SetMinSize(sz);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
lastErrorCtrl = NULL;
|
||||||
|
stdTextBkgdColor = *wxWHITE;
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
|
@ -943,6 +945,15 @@ void CDlgAdvPreferences::ShowErrorMessage(wxString& message,wxTextCtrl* errorCtr
|
||||||
if(message.IsEmpty()){
|
if(message.IsEmpty()){
|
||||||
message = _("invalid input value detected");
|
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);
|
wxGetApp().SafeMessageBox(message,_("Validation Error"),wxOK | wxCENTRE | wxICON_ERROR,this);
|
||||||
errorCtrl->SetFocus();
|
errorCtrl->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,8 @@ private:
|
||||||
wxTextCtrl* netDayStartTxts[7];
|
wxTextCtrl* netDayStartTxts[7];
|
||||||
wxTextCtrl* netDayStopTxts[7];
|
wxTextCtrl* netDayStopTxts[7];
|
||||||
bool m_bOKToShow;
|
bool m_bOKToShow;
|
||||||
|
wxColour stdTextBkgdColor;
|
||||||
|
wxTextCtrl* lastErrorCtrl;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _DLGADVPREFERENCES_H_
|
#endif // _DLGADVPREFERENCES_H_
|
||||||
|
|
Loading…
Reference in New Issue