From 17c6f8ef28565f7524736763cf74087ec11dd4e8 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 30 Jan 2013 21:23:30 +0000 Subject: [PATCH] refine --- Fltk/FlGui.cpp | 10 ++++++++-- Fltk/graphicWindow.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index 39e4f8d45d..98ce08a6f3 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -796,8 +796,14 @@ void FlGui::setStatus(const std::string &msg, bool opengl) _lastStatus = msg; static char buff[1024]; std::string tmp = std::string(" ") + msg; - if(Msg::GetFirstError().size() && graph[0]->getMessageHeight() < FL_NORMAL_SIZE) - tmp += " - Click to show messages [ ... " + Msg::GetFirstError() + " ... ]"; + if(Msg::GetErrorCount() && graph[0]->getMessageHeight() < FL_NORMAL_SIZE){ + tmp += " - "; + char nerr[128]; sprintf(nerr, "%d", Msg::GetErrorCount()); + tmp += nerr; + tmp += (Msg::GetErrorCount() > 1) ? " Errors" : " Error"; + if(Msg::GetFirstError().size()) + tmp += " : Click to show messages [ ... " + Msg::GetFirstError() + " ... ]"; + } strncpy(buff, tmp.c_str(), sizeof(buff) - 1); buff[sizeof(buff) - 1] = '\0'; for(unsigned int i = 0; i < graph.size(); i++){ diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 6a7f967e21..a4ac6c70d8 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -2452,7 +2452,6 @@ public: if(FlGui::available()){ for(unsigned int i = 0; i < FlGui::instance()->graph.size(); i++) FlGui::instance()->graph[i]->showHideMessages(); - Msg::ResetErrorCounter(); } return 1; } @@ -3012,6 +3011,7 @@ void graphicWindow::setMessageHeight(int h) void graphicWindow::showMessages() { if(!_browser || !_win->shown()) return; + Msg::ResetErrorCounter(); if(_browser->h() < FL_NORMAL_SIZE){ int height = CTX::instance()->msgSize; if(height < FL_NORMAL_SIZE) height = 10 * FL_NORMAL_SIZE; -- GitLab