From be54342486b8744e8834f70c024ed2cb6b7ab98f Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 21 Jul 2015 03:06:10 -0700 Subject: [PATCH] MGR: in Advanced Preferences dialog highlight textedit field with illegal value by setting its background to red. --- clientgui/DlgAdvPreferences.cpp | 11 +++++++++++ clientgui/DlgAdvPreferences.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 333af006ca..a81f41b4a8 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -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(); } diff --git a/clientgui/DlgAdvPreferences.h b/clientgui/DlgAdvPreferences.h index ffa6c87597..1bdc8f201c 100644 --- a/clientgui/DlgAdvPreferences.h +++ b/clientgui/DlgAdvPreferences.h @@ -74,6 +74,8 @@ private: wxTextCtrl* netDayStartTxts[7]; wxTextCtrl* netDayStopTxts[7]; bool m_bOKToShow; + wxColour stdTextBkgdColor; + wxTextCtrl* lastErrorCtrl; }; #endif // _DLGADVPREFERENCES_H_