MGR: in Simple View Preferences dialog, highlight textedit field with illegal value by setting its background to light red.

This commit is contained in:
Charlie Fenton 2015-08-27 01:30:19 -07:00
parent cb5160cb8a
commit de7eb0f0ec
2 changed files with 15 additions and 0 deletions

View File

@ -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();
}

View File

@ -174,6 +174,9 @@ private:
wxBitmap* m_backgroundBitmap;
bool m_bOKToShow;
wxColour stdTextBkgdColor;
wxTextCtrl* lastErrorCtrl;
////@end CPanelPreferences member variables
GLOBAL_PREFS global_preferences_working;