aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-04-06 13:46:57 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-04-11 06:31:52 (GMT)
commit91958279d3571f045989f52ad447a0c86701f3a8 (patch)
tree036ad2ad8b333cfbdf43dc0616a289c982e97740 /src/FbTk
parentb1d70e2c92c15d79ff0128d932b4e245c706a634 (diff)
downloadfluxbox-91958279d3571f045989f52ad447a0c86701f3a8.zip
fluxbox-91958279d3571f045989f52ad447a0c86701f3a8.tar.bz2
Menu.cc: send debug output to cerr, make the output more sensible
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index a3b7793..48636ce 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -67,7 +67,7 @@
67 67
68#ifdef DEBUG 68#ifdef DEBUG
69#include <iostream> 69#include <iostream>
70using std::cout; 70using std::cerr;
71using std::endl; 71using std::endl;
72#endif // DEBUG 72#endif // DEBUG
73 73
@@ -254,9 +254,10 @@ void Menu::fixMenuItemIndices() {
254int Menu::remove(unsigned int index) { 254int Menu::remove(unsigned int index) {
255 if (index >= menuitems.size()) { 255 if (index >= menuitems.size()) {
256#ifdef DEBUG 256#ifdef DEBUG
257 cout << "Bad index (" << index << ") given to Menu::remove()" 257 cerr << __FILE__ << "(" << __LINE__ << ") Bad index (" << index
258 << " -- should be between 0 and " << menuitems.size()-1 258 << ") given to Menu::remove()"
259 << " inclusive." << endl; 259 << " -- should be between 0 and " << menuitems.size()-1
260 << " inclusive." << endl;
260#endif // DEBUG 261#endif // DEBUG
261 return -1; 262 return -1;
262 } 263 }
@@ -705,7 +706,8 @@ void Menu::drawSubmenu(unsigned int index) {
705 // ensure we do not divide by 0 and thus cause a SIGFPE 706 // ensure we do not divide by 0 and thus cause a SIGFPE
706 if (m_rows_per_column == 0) { 707 if (m_rows_per_column == 0) {
707#if DEBUG 708#if DEBUG
708 cout << "Error: m_rows_per_column == 0 in FbTk::Menu::clearItem()\n"; 709 cerr << __FILE__ << "(" << __LINE__
710 << ") Error: m_rows_per_column == 0 in FbTk::Menu::drawSubmenu()\n";
709#endif 711#endif
710 return; 712 return;
711 } 713 }
@@ -780,7 +782,8 @@ int Menu::drawItem(FbDrawable &drawable, unsigned int index,
780 // ensure we do not divide by 0 and thus cause a SIGFPE 782 // ensure we do not divide by 0 and thus cause a SIGFPE
781 if (m_rows_per_column == 0) { 783 if (m_rows_per_column == 0) {
782#if DEBUG 784#if DEBUG
783 cout << "Error: m_rows_per_column == 0 in FbTk::Menu::clearItem()\n"; 785 cerr << __FILE__ << "(" << __LINE__
786 << ") Error: m_rows_per_column == 0 in FbTk::Menu::drawItem()\n";
784#endif 787#endif
785 return 0; 788 return 0;
786 } 789 }
@@ -1269,7 +1272,8 @@ void Menu::clearItem(int index, bool clear, int search_index) {
1269 // ensure we do not divide by 0 and thus cause a SIGFPE 1272 // ensure we do not divide by 0 and thus cause a SIGFPE
1270 if (m_rows_per_column == 0) { 1273 if (m_rows_per_column == 0) {
1271#if DEBUG 1274#if DEBUG
1272 cout << "Error: m_rows_per_column == 0 in FbTk::Menu::clearItem()\n"; 1275 cerr << __FILE__ << "(" << __LINE__
1276 << ") Error: m_rows_per_column == 0 in FbTk::Menu::clearItem()\n";
1273#endif 1277#endif
1274 return; 1278 return;
1275 } 1279 }
@@ -1313,7 +1317,8 @@ void Menu::highlightItem(int index) {
1313 // ensure we do not divide by 0 and thus cause a SIGFPE 1317 // ensure we do not divide by 0 and thus cause a SIGFPE
1314 if (m_rows_per_column == 0) { 1318 if (m_rows_per_column == 0) {
1315#if DEBUG 1319#if DEBUG
1316 cout << "Error: m_rows_per_column == 0 in FbTk::Menu::clearItem()\n"; 1320 cerr << __FILE__ << "(" << __LINE__
1321 << ") Error: m_rows_per_column == 0 in FbTk::Menu::highlightItem()\n";
1317#endif 1322#endif
1318 return; 1323 return;
1319 } 1324 }
@@ -1378,7 +1383,8 @@ void Menu::drawLine(int index, int size){
1378 // ensure we do not divide by 0 and thus cause a SIGFPE 1383 // ensure we do not divide by 0 and thus cause a SIGFPE
1379 if (m_rows_per_column == 0) { 1384 if (m_rows_per_column == 0) {
1380#if DEBUG 1385#if DEBUG
1381 cout << "Error: m_rows_per_column == 0 in FbTk::Menu::clearItem()\n"; 1386 cerr << __FILE__ << "(" << __LINE__
1387 << ") Error: m_rows_per_column == 0 in FbTk::Menu::drawLine()\n";
1382#endif 1388#endif
1383 return; 1389 return;
1384 } 1390 }