Changeset 3158 in orxonox.OLD for orxonox/trunk/gui
- Timestamp:
- Dec 11, 2004, 11:55:08 PM (20 years ago)
- Location:
- orxonox/trunk/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui_flags.cc
r3147 r3158 74 74 { 75 75 if (widget->isOption >= 1) 76 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->default _value && (strcmp (static_cast<Option*>(widget)->flag_name, "") || strcmp (static_cast<Option*>(widget)->flag_name_short, "")))76 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue && (static_cast<Option*>(widget)->flagName || static_cast<Option*>(widget)->flagNameShort )) 77 77 { 78 78 if (shortFlags->isActive()) 79 79 { 80 80 strcat (flagText, " -"); 81 strcat (flagText, static_cast<Option*>(widget)->flag _name_short);81 strcat (flagText, static_cast<Option*>(widget)->flagNameShort); 82 82 } 83 83 else 84 84 { 85 85 strcat (flagText, " --"); 86 strcat (flagText, static_cast<Option*>(widget)->flag _name);86 strcat (flagText, static_cast<Option*>(widget)->flagName); 87 87 } 88 88 if (static_cast<Option*>(widget)->isOption == 2) -
orxonox/trunk/gui/orxonox_gui_gtk.cc
r3157 r3158 69 69 { 70 70 next = NULL; 71 label = "";71 label = NULL; 72 72 return; 73 73 } … … 331 331 void Window::setTitle (char* title) 332 332 { 333 label=title; 333 if (label) 334 delete label; 335 label = new char[strlen(title)+1]; 336 strcpy(label, title); 334 337 gtk_window_set_title (GTK_WINDOW (widget), title); 335 338 } … … 438 441 void Frame::setTitle (char* title) 439 442 { 440 label = title; 443 if (label) 444 delete label; 445 label = new char[strlen(title)+1]; 446 strcpy(label, title); 441 447 gtk_frame_set_label (GTK_FRAME (widget), title); 442 448 } … … 481 487 void EventBox::setTitle (char* title) 482 488 { 483 label = title; 489 if (label) 490 delete label; 491 label = new char[strlen(title)+1]; 492 strcpy(label, title); 484 493 } 485 494 … … 552 561 Image::Image (char* imagename) 553 562 { 563 if (label) 564 delete label; 565 label = new char[strlen(imagename)+1]; 566 strcpy(label, imagename); 567 554 568 this->init(); 555 569 widget = gtk_image_new_from_file (imagename); 556 label = imagename;557 570 } 558 571 … … 577 590 { 578 591 value = 0; 579 flag _name = "";580 flag _name_short = "";592 flagName = NULL; 593 flagNameShort = NULL; 581 594 saveable = false; 582 default _value = 0;595 defaultValue = 0; 583 596 584 597 static_cast<Widget*>(this)->init(); … … 595 608 void Option::setFlagName (char* flagname, int defaultvalue) 596 609 { 597 flag_name = flagname; 598 default_value = defaultvalue; 610 if (flagName) 611 delete flagName; 612 flagName = new char [strlen(flagname)+1]; 613 strcpy(flagName, flagname); 614 defaultValue = defaultvalue; 599 615 cout << "Set Flagname of " << label << " to " << flagname << endl; 600 616 } … … 608 624 void Option::setFlagName (char* flagname, char* flagnameshort, int defaultvalue) 609 625 { 610 flag_name = flagname; 611 flag_name_short = flagnameshort; 612 default_value = defaultvalue; 626 if (flagName) 627 delete flagName; 628 flagName = new char [strlen(flagname)+1]; 629 strcpy(flagName, flagname); 630 631 if (flagNameShort) 632 delete flagNameShort; 633 flagNameShort = new char [strlen(flagnameshort)+1]; 634 strcpy(flagName, flagnameshort); 635 defaultValue = defaultvalue; 613 636 cout << "Set Flagname of " << label << " to " << flagname << endl; 614 637 } … … 689 712 void CheckButton::setTitle(char* title) 690 713 { 691 label = title; 714 if (label) 715 delete label; 716 label = new char[strlen(title)+1]; 717 strcpy(label, title); 692 718 gtk_button_set_label(GTK_BUTTON(widget), title); 693 719 } … … 754 780 void Slider::setTitle(char* title) 755 781 { 756 label = title; 782 if (label) 783 delete label; 784 label = new char[strlen(title)+1]; 785 strcpy(label, title); 757 786 } 758 787 … … 833 862 void Menu::setTitle(char* title) 834 863 { 835 label = title; 864 if (label) 865 delete label; 866 label = new char[strlen(title)+1]; 867 strcpy(label, title); 836 868 } 837 869 … … 930 962 void Label::setText (char* text) 931 963 { 932 label = text; 964 if (label) 965 delete label; 966 label = new char[strlen(text)+1]; 967 strcpy(label, text); 933 968 gtk_label_set_text (GTK_LABEL (this->widget), text); 934 969 } -
orxonox/trunk/gui/orxonox_gui_gtk.h
r3157 r3158 181 181 182 182 int value; //!< every option has a value either true or false (0,1) or something else like 25 for 25% of the volume 183 char* flag _name; //!< options have a flag name that will be appendet if you start the Program from the GUI.184 char* flag _name_short; //!< like flag_name but shorter185 int default _value; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value)183 char* flagName; //!< options have a flag name that will be appendet if you start the Program from the GUI. 184 char* flagNameShort; //!< like flag_name but shorter 185 int defaultValue; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value) 186 186 bool saveable; //! Options can be Saved. 187 187 -
orxonox/trunk/gui/orxonox_gui_keys.cc
r3157 r3158 84 84 inputButton = new Button ("test"); 85 85 inputWindow->fill (inputButton); 86 inputWindow->connectSignal("destroy", inputWindow,Widget::doNothingSignal);87 inputWindow->connectSignal("delete_event", inputWindow,Widget::doNothingSignal);86 inputWindow->connectSignal("destroy", Widget::doNothingSignal); 87 inputWindow->connectSignal("delete_event", Widget::doNothingSignal); 88 88 89 89 } … … 255 255 break; 256 256 } 257 257 258 inputkey->pKeyOLabel->setTitle (title); 258 259 inputButton->disconnectSignal(keySignal);
Note: See TracChangeset
for help on using the changeset viewer.