Changeset 4026 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 3, 2005, 10:16:08 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/gui/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/gui/orxonox_gui_exec.cc
r4024 r4026 26 26 #include "orxonox_gui_exec.h" 27 27 28 #include <iostream>29 28 #include <string> 30 29 … … 230 229 strcpy(Buffer, static_cast<Option*>(widget)->title); 231 230 if(strchr(Buffer, '_')) 232 cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;231 PRINTF(2)("Optionname %s is not Valid for Saving, because it includes an underscore\n", Buffer); 233 232 while(space2under = strchr(Buffer, ' ')) 234 233 { … … 263 262 if((groupWidget = locateGroup(widget, Buffer, 1))==NULL) 264 263 { 265 cout << "!!There is no group called " << Buffer << " in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n";264 PRINTF(2)("!!There is no group called %s in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n", Buffer); 266 265 groupWidget = widget; 267 266 } 268 267 else 269 PRINT( 3)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);268 PRINT(5)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName); 270 269 } 271 270 // option-setting // … … 300 299 if(widget->title && !strcmp(widget->title, info->variableName)) 301 300 { 302 PRINT( 3)("Located Option %s.\n", widget->title);301 PRINT(5)("Located Option %s.\n", widget->title); 303 302 if(widget->isOption >= 1) 304 303 static_cast<Option*>(widget)->load(info->variableValue); -
orxonox/trunk/src/lib/gui/gui/orxonox_gui_exec.h
r4024 r4026 10 10 #include "orxonox_gui_element.h" 11 11 12 #include <stdio.h>13 12 using namespace std; 14 13 -
orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc
r3630 r4026 28 28 29 29 #include <stdarg.h> 30 #include <iostream>31 32 30 33 31 using namespace std; … … 47 45 #ifdef HAVE_GTK2 48 46 #ifdef HAVE_GTHREAD 49 PRINTF( 3)("Initializing the ThreadSystem of the GUI\n");47 PRINTF(4)("Initializing the ThreadSystem of the GUI\n"); 50 48 g_thread_init(NULL); 51 49 gdk_threads_init(); … … 159 157 delete []this->title; 160 158 } 161 162 PRINTF(4)("deleting the Widget part.\n");163 164 PRINTF( 4)("deleting recursively\n");159 160 PRINTF(5)("deleting the Widget part.\n"); 161 162 PRINTF(5)("deleting recursively\n"); 165 163 166 164 // deleting next item if existent … … 168 166 delete this->next; 169 167 this->next = NULL; 168 170 169 //! \todo not hiding widget, deleting. 171 170 // this->hide(); … … 349 348 { 350 349 if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName) 351 cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";350 PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName); 352 351 } 353 352 … … 360 359 { 361 360 if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName) 362 { 363 int* count =(int*)data; 364 *count = *count +1; 365 cout << *count <<": [" << static_cast<Packer*>(widget)->groupName << "]\n"; 366 } 361 PRINT(0)("%d: [%s]\n", *(int*)data, static_cast<Packer*>(widget)->groupName); 367 362 } 368 363 … … 416 411 bool found = false; 417 412 // check if long flag matches 418 if ((option->flagName && strlen(name)>2 && !strncmp(name+2, option->flagName, strlen(option->flagName)) &&(name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') )) 413 if ((option->flagName && strlen(name)>2 && 414 !strncmp(name+2, option->flagName, strlen(option->flagName)) && 415 (name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') )) 419 416 { 420 417 found = true; … … 424 421 } 425 422 } 426 else if (option->flagNameShort && strlen(name)>1 && !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort))&&(name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) // check if short flag matches 423 // check if short flag matches 424 else if (option->flagNameShort && strlen(name)>1 && 425 !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort)) && 426 (name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) 427 427 { 428 428 found = true; … … 435 435 if (found) 436 436 { 437 PRINT( 3)("found matching Flag %s\n", name);437 PRINT(4)("found matching Flag %s\n", name); 438 438 if (value) 439 439 { 440 PRINT( 3)("with Value %s\n", value);440 PRINT(4)("with Value %s\n", value); 441 441 option->value = atoi(value); 442 442 } … … 526 526 Packer::~Packer(void) 527 527 { 528 PRINTF( 4)("deleting the Packer part.\n");528 PRINTF(5)("deleting the Packer part.\n"); 529 529 530 530 if (this->groupName) … … 575 575 Container::~Container(void) 576 576 { 577 PRINTF( 4)("deleting the Container part.\n");577 PRINTF(5)("deleting the Container part.\n"); 578 578 } 579 579 … … 650 650 { 651 651 if (this->title) 652 PRINTF( 3)("deleting the Window: %s\n", this->title);652 PRINTF(5)("deleting the Window: %s\n", this->title); 653 653 else 654 PRINTF( 3)("deleting the Window.\n");654 PRINTF(5)("deleting the Window.\n"); 655 655 // this->hide(); 656 656 } … … 795 795 Frame::~Frame(void) 796 796 { 797 if (this->title) 798 PRINTF(3)("deleting the Frame: %s\n", this->title); 799 else 800 PRINTF(3)("deleting the Frame.\n"); 797 PRINTF(5)("deleting the Frame: %s\n", this->title); 801 798 } 802 799 … … 852 849 EventBox::~EventBox(void) 853 850 { 854 if (this->title) 855 PRINTF(3)("deleting the EventBox: %s\n", this->title); 856 else 857 PRINTF(3)("deleting the EventBox.\n"); 851 PRINTF(5)("deleting the EventBox: %s\n", this->title); 858 852 } 859 853 … … 895 889 Box::~Box(void) 896 890 { 897 if (this->title) 898 PRINTF(3)("deleting the Box: %s\n", this->title); 899 else 900 PRINTF(3)("deleting the Box.\n"); 901 891 PRINTF(5)("deleting the Box: %s\n", this->title); 902 892 } 903 893 … … 912 902 #ifdef HAVE_GTK2 913 903 if (boxtype == 'v') 914 { 915 this->widget = gtk_vbox_new(FALSE, 0); 916 } 904 this->widget = gtk_vbox_new(FALSE, 0); 917 905 else 918 { 919 this->widget = gtk_hbox_new(FALSE, 0); 920 } 906 this->widget = gtk_hbox_new(FALSE, 0); 921 907 #endif /* HAVE_GTK2 */ 922 908 } … … 967 953 Option::~Option(void) 968 954 { 969 PRINTF( 4)("deleting the Option Part.\n");955 PRINTF(5)("deleting the Option Part.\n"); 970 956 if (this->flagName) 971 957 delete []this->flagName; … … 1049 1035 { 1050 1036 this->value = atoi(loadString); 1051 PRINT( 3)("Loading %s: %s %d\n", this->title, loadString, value);1037 PRINT(5)("Loading %s: %s %d\n", this->title, loadString, value); 1052 1038 this->redraw(); 1053 1039 } … … 1092 1078 Button::~Button(void) 1093 1079 { 1094 if (this->title) 1095 PRINTF(3)("deleting the Label: %s\n", this->title); 1096 else 1097 PRINTF(3)("deleting the Label.\n"); 1098 1080 PRINTF(5)("deleting the Label: %s\n", this->title); 1099 1081 } 1100 1082 … … 1166 1148 { 1167 1149 if (this->title) 1168 PRINTF( 3)("deleting the CheckButton: %s\n", this->title);1150 PRINTF(5)("deleting the CheckButton: %s\n", this->title); 1169 1151 else 1170 PRINTF( 3)("deleting the CheckButton.\n");1152 PRINTF(5)("deleting the CheckButton.\n"); 1171 1153 } 1172 1154 … … 1214 1196 #else /* HAVE_GTK2 */ 1215 1197 char tmpChar[20]; 1216 cout << "\nPlease give me a new value for " << this->title << " [0,1](default:" << this->defaultValue << "): ";1198 PRINT(0)("\nPlease give me a new value for %s [0,1](default:%d): ",this->title, this->defaultValue); 1217 1199 cin >> tmpChar; 1218 1200 … … 1220 1202 this->value = 1; 1221 1203 #endif /* HAVE_GTK2 */ 1222 cout << this->title << " set to: " << this->value << endl;1204 PRINT(0)("%s set to: %d\n", this->title, this->value); 1223 1205 } 1224 1206 … … 1258 1240 Slider::~Slider(void) 1259 1241 { 1260 if (this->title) 1261 PRINTF(3)("deleting the Slider: %s\n", this->title); 1262 else 1263 PRINTF(3)("deleting the Slider.\n"); 1242 PRINTF(5)("deleting the Slider: %s\n", this->title); 1264 1243 } 1265 1244 … … 1308 1287 #else /* HAVE_GTK2 */ 1309 1288 char tmpChar[20]; 1310 cout << "\nPlease give me a new value for " << this->title << " [" <<this->start << "-" << this->end << "](default:" << this->defaultValue << "): ";1289 PRINT(0)("\nPlease give me a new value for %s [%d-%d] (default:%d): ", this->title, this->start, this->end, this->defaultValue); 1311 1290 cin >> tmpChar; 1312 1291 … … 1316 1295 this->value = this->start; 1317 1296 #endif /* HAVE_GTK2 */ 1318 cout << this->title << " set to: " << this->value << endl;1297 PRINT(0)("%s set to: %d\n",this->title, this->value); 1319 1298 } 1320 1299 … … 1358 1337 Menu::~Menu(void) 1359 1338 { 1360 if (this->title) 1361 PRINTF(3)("deleting the Menu: %s\n", this->title); 1362 else 1363 PRINTF(3)("deleting the Menu.\n"); 1364 //! \todo destroy menu 1339 PRINTF(5)("deleting the Menu: %s\n", this->title); 1365 1340 this->currItem = this->firstItem; 1366 1341 while(this->currItem) 1367 1342 { 1368 1343 delete []this->currItem->name; 1344 //! \todo destroy menu 1369 1345 /* 1370 1346 #ifdef HAVE_GTK2 … … 1427 1403 PRINTF(2)("Sorry, but %s has not been found in the Itemlist of %s\n", loadString, this->title); 1428 1404 } 1429 PRINTF( 3)( "Loading %s: setting to %d\n", this->title, this->value);1405 PRINTF(4)( "Loading %s: setting to %d\n", this->title, this->value); 1430 1406 this->redraw(); 1431 1407 } … … 1466 1442 { 1467 1443 #ifdef HAVE_GTK2 1468 gtk_option_menu_set_history(GTK_OPTION_MENU(this->widget), this->value);1444 gtk_option_menu_set_history(GTK_OPTION_MENU(this->widget), this->value); 1469 1445 #endif /* HAVE_GTK2 */ 1470 1446 } … … 1479 1455 #else /* HAVE_GTK2 */ 1480 1456 char tmpChar[20]; 1481 cout << "\nPlease give me a new value for " << this->title << "(default:" << this->defaultValue << "): ";1457 PRINT(0)("\nPlease give me a new value for %s (default: %d): ", this->title, this->defaultValue); 1482 1458 cin >> tmpChar; 1483 1459 this->value = atoi(tmpChar); 1484 1460 1485 1461 #endif /* HAVE_GTK2 */ 1486 cout << this->title << " set to: " << this->value << endl;1462 PRINT(4)("%s set to: %d\n", this->title, this->value); 1487 1463 } 1488 1464 … … 1506 1482 OptionLabel::~OptionLabel(void) 1507 1483 { 1508 if (this->title) 1509 PRINTF(3)("deleting the OptionLabel: %s\n", this->title); 1510 else 1511 PRINTF(3)("deleting the OptionLabel.\n"); 1484 PRINTF(5)("deleting the OptionLabel: %s\n", this->title); 1512 1485 if (this->cValue) 1513 1486 delete []this->cValue; … … 1560 1533 this->cValue =(char*)gtk_label_get_text(GTK_LABEL(this->widget)); 1561 1534 #else /* HAVE_GTK2 */ 1562 cout << "\nPlease give me a new input for " << this->title << ": ";1535 PRINT(0)("\nPlease give me a new input for %s: ", this->title); 1563 1536 cin >> this->cValue; 1564 1537 #endif /* HAVE_GTK2 */ 1565 cout << this->title << " set to: " << this->cValue << endl;1538 PRINT(4)("%s set to: %s\n", this->title, this->cValue); 1566 1539 } 1567 1540 … … 1582 1555 void OptionLabel::load(char* loadString) 1583 1556 { 1584 PRINTF( 3)( "Loading %s: setting to %s\n", this->title, loadString);1557 PRINTF(4)( "Loading %s: setting to %s\n", this->title, loadString); 1585 1558 this->setValue(loadString); 1586 1559 } … … 1610 1583 Label::~Label(void) 1611 1584 { 1612 if (this->title) 1613 PRINTF(3)("deleting the Label: %s\n", this->title); 1614 else 1615 PRINTF(3)("deleting the Label.\n"); 1585 PRINTF(5)("deleting the Label: %s\n", this->title); 1616 1586 } 1617 1587 … … 1667 1637 } 1668 1638 else 1669 { 1670 this->title = new char[strlen(textToAppend)]; 1671 } 1639 this->title = new char[strlen(textToAppend)]; 1672 1640 1673 1641 #ifdef HAVE_GTK2 … … 1722 1690 ProgressBar::~ProgressBar(void) 1723 1691 { 1724 if (this->title) 1725 PRINTF(3)("deleting the ProgressBar: %s\n", this->title); 1726 else 1727 PRINTF(3)("deleting the ProgressBar.\n"); 1692 PRINTF(5)("deleting the ProgressBar: %s\n", this->title); 1728 1693 } 1729 1694 … … 1799 1764 Image::~Image(void) 1800 1765 { 1801 if (this->title) 1802 PRINTF(3)("deleting the Image: %s\n", this->title); 1803 else 1804 PRINTF(3)("deleting the Image.\n"); 1766 PRINTF(5)("deleting the Image: %s\n", this->title); 1805 1767 } 1806 1768
Note: See TracChangeset
for help on using the changeset viewer.