Changeset 3290 in orxonox.OLD for orxonox/branches
- Timestamp:
- Dec 26, 2004, 3:58:55 PM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_exec.cc
r3288 r3290 154 154 } 155 155 // if (widget->isOption == 0) 156 // printf ("%s\n",widget-> label);156 // printf ("%s\n",widget->title); 157 157 if (widget->isOption >= 1) 158 158 if (static_cast<Option*>(widget)->isSaveable()) … … 160 160 char Buffer[256]; 161 161 char* space2under; 162 strcpy (Buffer, static_cast<Option*>(widget)-> label);162 strcpy (Buffer, static_cast<Option*>(widget)->title); 163 163 if (strchr (Buffer, '_')) 164 164 cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl; … … 231 231 if (widget->isOption >= 1 && widget->isOption <= 3) 232 232 { 233 if (!strcmp (static_cast<Option*>(widget)-> label, variableName))233 if (!strcmp (static_cast<Option*>(widget)->title, variableName)) 234 234 static_cast<Option*>(widget)->value = atoi(variableValue); 235 235 } 236 236 else if (widget->isOption == 5) 237 237 { 238 if (!strcmp (static_cast<Option*>(widget)-> label, variableName))238 if (!strcmp (static_cast<Option*>(widget)->title, variableName)) 239 239 static_cast<OptionLabel*>(widget)->setValue(variableValue); 240 240 } -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3289 r3290 91 91 { 92 92 next = NULL; 93 label= NULL;93 this->title = NULL; 94 94 return; 95 95 } … … 100 100 void Widget::destroy(void) 101 101 { 102 if ( label)102 if (this->title) 103 103 { 104 delete [] label;104 delete []this->title; 105 105 } 106 106 … … 175 175 cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n"; 176 176 if (widget->isOption >= 1 && widget->isOption <= 3) 177 cout << " " << static_cast<Option*>(widget)-> label<<" is : " << static_cast<Option*>(widget)->value <<endl;177 cout << " " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl; 178 178 else if (widget->isOption == 5) 179 cout << " " << static_cast<Option*>(widget)-> label<<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;179 cout << " " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl; 180 180 } 181 181 … … 425 425 void Window::destroy(void) 426 426 { 427 if ( label)428 PRINTF(3)("deleting the Window: %s\n", label);427 if (this->title) 428 PRINTF(3)("deleting the Window: %s\n", this->title); 429 429 else 430 430 PRINTF(3)("deleting the Window.\n"); … … 462 462 void Window::setTitle (char* title) 463 463 { 464 if ( label)465 delete [] label;466 label= new char[strlen(title)+1];467 strcpy( label, title);464 if (this->title) 465 delete []this->title; 466 this->title = new char[strlen(title)+1]; 467 strcpy(this->title, title); 468 468 #ifdef HAVE_GTK2 469 469 gtk_window_set_title (GTK_WINDOW (widget), title); … … 589 589 void Frame::destroy(void) 590 590 { 591 if ( label)592 PRINTF(3)("deleting the Frame: %s\n", label);591 if (this->title) 592 PRINTF(3)("deleting the Frame: %s\n", this->title); 593 593 else 594 594 PRINTF(3)("deleting the Frame.\n"); … … 603 603 void Frame::setTitle (char* title) 604 604 { 605 if ( label)606 delete [] label;607 label= new char[strlen(title)+1];608 strcpy( label, title);605 if (this->title) 606 delete []this->title; 607 this->title = new char[strlen(title)+1]; 608 strcpy(this->title, title); 609 609 #ifdef HAVE_GTK2 610 610 gtk_frame_set_label (GTK_FRAME (widget), title); … … 661 661 void EventBox::destroy(void) 662 662 { 663 if ( label)664 PRINTF(3)("deleting the EventBox: %s\n", label);663 if (this->title) 664 PRINTF(3)("deleting the EventBox: %s\n", this->title); 665 665 else 666 666 PRINTF(3)("deleting the EventBox.\n"); … … 675 675 void EventBox::setTitle (char* title) 676 676 { 677 if ( label)678 delete [] label;679 label= new char[strlen(title)+1];680 strcpy( label, title);677 if (this->title) 678 delete []this->title; 679 this->title = new char[strlen(title)+1]; 680 strcpy(this->title, title); 681 681 } 682 682 … … 734 734 void Box::destroy(void) 735 735 { 736 if ( label)737 PRINTF(3)("deleting the Box: %s\n", label);736 if (this->title) 737 PRINTF(3)("deleting the Box: %s\n", this->title); 738 738 else 739 739 PRINTF(3)("deleting the Box.\n"); … … 773 773 void Box::setTitle(char* title) 774 774 { 775 if ( label)776 delete [] label;777 label= new char[strlen(title)+1];778 strcpy( label, title);775 if (this->title) 776 delete []this->title; 777 this->title = new char[strlen(title)+1]; 778 strcpy(this->title, title); 779 779 } 780 780 … … 826 826 defaultValue = defaultvalue; 827 827 828 // cout << "Set Flagname of " << label<< " to " << flagname << endl;828 // cout << "Set Flagname of " << this->title << " to " << flagname << endl; 829 829 } 830 830 … … 847 847 strcpy(flagNameShort, flagnameshort); 848 848 defaultValue = defaultvalue; 849 // cout << "Set Flagname of " << label<< " to " << flagname << endl;849 // cout << "Set Flagname of " << this->title << " to " << flagname << endl; 850 850 } 851 851 … … 914 914 void Button::destroy(void) 915 915 { 916 if ( label)917 PRINTF(3)("deleting the Label: %s\n", label);916 if (this->title) 917 PRINTF(3)("deleting the Label: %s\n", this->title); 918 918 else 919 919 PRINTF(3)("deleting the Label.\n"); … … 928 928 void Button::setTitle (char *title) 929 929 { 930 if ( label)931 delete [] label;932 label= new char[strlen(title)+1];933 strcpy( label, title);930 if (this->title) 931 delete []this->title; 932 this->title = new char[strlen(title)+1]; 933 strcpy(this->title, title); 934 934 #ifdef HAVE_GTK2 935 935 gtk_button_set_label (GTK_BUTTON(widget), title); … … 988 988 void CheckButton::destroy(void) 989 989 { 990 if ( label)991 PRINTF(3)("deleting the CheckButton: %s\n", label);990 if (this->title) 991 PRINTF(3)("deleting the CheckButton: %s\n", this->title); 992 992 else 993 993 PRINTF(3)("deleting the CheckButton.\n"); … … 1002 1002 void CheckButton::setTitle(char* title) 1003 1003 { 1004 if ( label)1005 delete [] label;1006 label= new char[strlen(title)+1];1007 strcpy( label, title);1004 if (this->title) 1005 delete []this->title; 1006 this->title = new char[strlen(title)+1]; 1007 strcpy(this->title, title); 1008 1008 #ifdef HAVE_GTK2 1009 1009 gtk_button_set_label(GTK_BUTTON(widget), title); … … 1028 1028 static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget)); 1029 1029 flags->setTextFromFlags(orxonoxGUI); ////// must be different!!! 1030 cout << static_cast<CheckButton*>(checkbutton)-> label<< " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;1030 cout << static_cast<CheckButton*>(checkbutton)->title << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl; 1031 1031 } 1032 1032 #endif /* HAVE_GTK2 */ … … 1089 1089 void Slider::destroy(void) 1090 1090 { 1091 if ( label)1092 PRINTF(3)("deleting the Slider: %s\n", label);1091 if (this->title) 1092 PRINTF(3)("deleting the Slider: %s\n", this->title); 1093 1093 else 1094 1094 PRINTF(3)("deleting the Slider.\n"); … … 1104 1104 void Slider::setTitle(char* title) 1105 1105 { 1106 if ( label)1107 delete [] label;1108 label= new char[strlen(title)+1];1109 strcpy( label, title);1106 if (this->title) 1107 delete []this->title; 1108 this->title = new char[strlen(title)+1]; 1109 strcpy(this->title, title); 1110 1110 } 1111 1111 … … 1140 1140 static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget)); 1141 1141 flags->setTextFromFlags(orxonoxGUI); //// must be different !!! 1142 cout << static_cast<Slider*>(slider)-> label<< " set to: "<< static_cast<Slider*>(slider)->value << endl;1142 cout << static_cast<Slider*>(slider)->title << " set to: "<< static_cast<Slider*>(slider)->value << endl; 1143 1143 } 1144 1144 #endif /* HAVE_GTK2 */ … … 1204 1204 void Menu::destroy(void) 1205 1205 { 1206 if ( label)1207 PRINTF(3)("deleting the Menu: %s\n", label);1206 if (this->title) 1207 PRINTF(3)("deleting the Menu: %s\n", this->title); 1208 1208 else 1209 1209 PRINTF(3)("deleting the Menu.\n"); … … 1220 1220 void Menu::setTitle(char* title) 1221 1221 { 1222 if ( label)1223 delete [] label;1224 label= new char[strlen(title)+1];1225 strcpy( label, title);1222 if (this->title) 1223 delete []this->title; 1224 this->title = new char[strlen(title)+1]; 1225 strcpy(this->title, title); 1226 1226 } 1227 1227 … … 1259 1259 static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget)); 1260 1260 flags->setTextFromFlags(orxonoxGUI); //// must be different !!! 1261 cout << static_cast<Menu*>(menu)-> label<< " changed to : " << static_cast<Menu*>(menu)->value << endl;1261 cout << static_cast<Menu*>(menu)->title << " changed to : " << static_cast<Menu*>(menu)->value << endl; 1262 1262 } 1263 1263 #endif /* HAVE_GTK2 */ … … 1304 1304 void OptionLabel::destroy(void) 1305 1305 { 1306 if ( label)1307 PRINTF(3)("deleting the OptionLabel: %s\n", label);1306 if (this->title) 1307 PRINTF(3)("deleting the OptionLabel: %s\n", this->title); 1308 1308 else 1309 1309 PRINTF(3)("deleting the OptionLabel.\n"); … … 1336 1336 void OptionLabel::setTitle(char* title) 1337 1337 { 1338 if ( label)1339 delete [] label;1340 label= new char [strlen(title)+1];1341 strcpy( label, title);1338 if (this->title) 1339 delete []this->title; 1340 this->title = new char [strlen(title)+1]; 1341 strcpy(this->title, title); 1342 1342 #ifdef HAVE_GTK2 1343 1343 gtk_label_set_text (GTK_LABEL (widget), title); … … 1400 1400 void Label::destroy(void) 1401 1401 { 1402 if ( label)1403 PRINTF(3)("deleting the Label: %s\n", label);1402 if (this->title) 1403 PRINTF(3)("deleting the Label: %s\n", this->title); 1404 1404 else 1405 1405 PRINTF(3)("deleting the Label.\n"); … … 1414 1414 void Label::setTitle(char* text) 1415 1415 { 1416 if ( label)1417 delete [] label;1418 label= new char[strlen(text)+1];1419 strcpy( label, text);1416 if (this->title) 1417 delete []this->title; 1418 this->title = new char[strlen(text)+1]; 1419 strcpy(this->title, text); 1420 1420 #ifdef HAVE_GTK2 1421 1421 gtk_label_set_text (GTK_LABEL (this->widget), text); … … 1429 1429 char* Label::getText () 1430 1430 { 1431 return label;1431 return this->title; 1432 1432 } 1433 1433 … … 1479 1479 void ProgressBar::destroy(void) 1480 1480 { 1481 if ( label)1482 PRINTF(3)("deleting the ProgressBar: %s\n", label);1481 if (this->title) 1482 PRINTF(3)("deleting the ProgressBar: %s\n", this->title); 1483 1483 else 1484 1484 PRINTF(3)("deleting the ProgressBar.\n"); … … 1493 1493 void ProgressBar::setTitle(char* title) 1494 1494 { 1495 if ( label)1496 delete [] label;1497 label= new char [strlen(title)+1];1498 strcpy( label, title);1495 if (this->title) 1496 delete []this->title; 1497 this->title = new char [strlen(title)+1]; 1498 strcpy(this->title, title); 1499 1499 } 1500 1500 … … 1540 1540 { 1541 1541 this->init(); 1542 if ( label)1543 delete [] label;1544 label= new char[strlen(imagename)+1];1545 strcpy( label, imagename);1542 if (this->title) 1543 delete []this->title; 1544 this->title = new char[strlen(imagename)+1]; 1545 strcpy(this->title, imagename); 1546 1546 1547 1547 #ifdef HAVE_GTK2 … … 1573 1573 void Image::destroy(void) 1574 1574 { 1575 if ( label)1576 PRINTF(3)("deleting the Image: %s\n", label);1575 if (this->title) 1576 PRINTF(3)("deleting the Image: %s\n", this->title); 1577 1577 else 1578 1578 PRINTF(3)("deleting the Image.\n"); … … 1587 1587 void Image::setTitle(char* title) 1588 1588 { 1589 if ( label)1590 delete [] label;1591 label= new char [strlen(title)+1];1592 strcpy( label, title);1593 } 1589 if (this->title) 1590 delete []this->title; 1591 this->title = new char [strlen(title)+1]; 1592 strcpy(this->title, title); 1593 } -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.h
r3289 r3290 78 78 //! defines isOption states 79 79 enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2}; 80 char* label; //!< The name of the Widget. Some do display it, Options need it to save;80 char* title; //!< The name of the Widget. Some do display it, Options need it to save; 81 81 }; 82 82
Note: See TracChangeset
for help on using the changeset viewer.