diff --git a/clientgui/sg_DlgPreferences.cpp b/clientgui/sg_DlgPreferences.cpp index 21353cc1b23..1f935b21a19 100644 --- a/clientgui/sg_DlgPreferences.cpp +++ b/clientgui/sg_DlgPreferences.cpp @@ -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(); } diff --git a/clientgui/sg_DlgPreferences.h b/clientgui/sg_DlgPreferences.h index 97805de0db8..5027d624649 100644 --- a/clientgui/sg_DlgPreferences.h +++ b/clientgui/sg_DlgPreferences.h @@ -174,6 +174,9 @@ class CPanelPreferences: public wxPanel wxBitmap* m_backgroundBitmap; bool m_bOKToShow; + + wxColour stdTextBkgdColor; + wxTextCtrl* lastErrorCtrl; ////@end CPanelPreferences member variables GLOBAL_PREFS global_preferences_working;