mirror of https://github.com/BOINC/boinc.git
MGR: in Simple View Preferences dialog, highlight textedit field with illegal value by setting its background to light red.
This commit is contained in:
parent
cb5160cb8a
commit
de7eb0f0ec
|
@ -96,6 +96,8 @@ CPanelPreferences::~CPanelPreferences( )
|
|||
bool CPanelPreferences::Create()
|
||||
{
|
||||
m_backgroundBitmap = NULL;
|
||||
lastErrorCtrl = NULL;
|
||||
stdTextBkgdColor = *wxWHITE;
|
||||
|
||||
CreateControls();
|
||||
|
||||
|
@ -846,6 +848,16 @@ void CPanelPreferences::ShowErrorMessage(wxString& message,wxTextCtrl* errorCtrl
|
|||
if(message.IsEmpty()){
|
||||
message = _("invalid input value detected");
|
||||
}
|
||||
if (lastErrorCtrl) {
|
||||
lastErrorCtrl->SetBackgroundColour(stdTextBkgdColor);
|
||||
lastErrorCtrl->Refresh();
|
||||
}
|
||||
if (lastErrorCtrl != errorCtrl) {
|
||||
stdTextBkgdColor = errorCtrl->GetBackgroundColour();
|
||||
}
|
||||
errorCtrl->SetBackgroundColour(wxColour(255, 192, 192));
|
||||
errorCtrl->Refresh();
|
||||
lastErrorCtrl = errorCtrl;
|
||||
wxGetApp().SafeMessageBox(message,_("Validation Error"),wxOK | wxCENTRE | wxICON_ERROR,this);
|
||||
errorCtrl->SetFocus();
|
||||
}
|
||||
|
|
|
@ -174,6 +174,9 @@ private:
|
|||
wxBitmap* m_backgroundBitmap;
|
||||
|
||||
bool m_bOKToShow;
|
||||
|
||||
wxColour stdTextBkgdColor;
|
||||
wxTextCtrl* lastErrorCtrl;
|
||||
|
||||
////@end CPanelPreferences member variables
|
||||
GLOBAL_PREFS global_preferences_working;
|
||||
|
|
Loading…
Reference in New Issue