Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3290 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
Dec 26, 2004, 3:58:55 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/updater: label → this→title (now setTitle makes at least some sense)

Location:
orxonox/branches/updater/src/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui_exec.cc

    r3288 r3290  
    154154    }
    155155  //  if (widget->isOption == 0)
    156   //    printf ("%s\n",widget->label);
     156  //    printf ("%s\n",widget->title);
    157157  if (widget->isOption >= 1)
    158158    if  (static_cast<Option*>(widget)->isSaveable())
     
    160160        char Buffer[256];
    161161        char* space2under;
    162         strcpy (Buffer, static_cast<Option*>(widget)->label);
     162        strcpy (Buffer, static_cast<Option*>(widget)->title);
    163163        if (strchr (Buffer, '_'))
    164164          cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;
     
    231231  if (widget->isOption >= 1 && widget->isOption <= 3)
    232232    {
    233       if (!strcmp (static_cast<Option*>(widget)->label, variableName))
     233      if (!strcmp (static_cast<Option*>(widget)->title, variableName))
    234234        static_cast<Option*>(widget)->value = atoi(variableValue);
    235235    }
    236236  else if (widget->isOption == 5)
    237237    {
    238        if (!strcmp (static_cast<Option*>(widget)->label, variableName))
     238       if (!strcmp (static_cast<Option*>(widget)->title, variableName))
    239239        static_cast<OptionLabel*>(widget)->setValue(variableValue);
    240240    }
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc

    r3289 r3290  
    9191{
    9292  next = NULL;
    93   label = NULL;
     93  this->title = NULL;
    9494  return;
    9595}
     
    100100void Widget::destroy(void)
    101101{
    102   if (label)
     102  if (this->title)
    103103    {
    104       delete []label;
     104      delete []this->title;
    105105    }
    106106 
     
    175175    cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";
    176176  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;
    178178  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;
    180180}
    181181
     
    425425void Window::destroy(void)
    426426{
    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);
    429429  else
    430430    PRINTF(3)("deleting the Window.\n");
     
    462462void Window::setTitle (char* title)
    463463{
    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);
    468468#ifdef HAVE_GTK2
    469469  gtk_window_set_title (GTK_WINDOW (widget), title);
     
    589589void Frame::destroy(void)
    590590{
    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);
    593593  else
    594594    PRINTF(3)("deleting the Frame.\n");
     
    603603void Frame::setTitle (char* title)
    604604{
    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);
    609609#ifdef HAVE_GTK2
    610610  gtk_frame_set_label (GTK_FRAME (widget), title);
     
    661661void EventBox::destroy(void)
    662662{
    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);
    665665  else
    666666    PRINTF(3)("deleting the EventBox.\n");
     
    675675void EventBox::setTitle (char* title)
    676676{
    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);
    681681}
    682682
     
    734734void Box::destroy(void)
    735735{
    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);
    738738  else
    739739    PRINTF(3)("deleting the Box.\n");
     
    773773void Box::setTitle(char* title)
    774774{
    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);
    779779}
    780780
     
    826826  defaultValue = defaultvalue;
    827827
    828   //  cout << "Set Flagname of " << label << " to " << flagname << endl;
     828  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
    829829}
    830830
     
    847847  strcpy(flagNameShort, flagnameshort);
    848848  defaultValue = defaultvalue;
    849   //  cout << "Set Flagname of " << label << " to " << flagname << endl;
     849  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
    850850}
    851851
     
    914914void Button::destroy(void)
    915915{
    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);
    918918  else
    919919    PRINTF(3)("deleting the Label.\n");
     
    928928void Button::setTitle (char *title)
    929929{
    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);
    934934#ifdef HAVE_GTK2
    935935  gtk_button_set_label (GTK_BUTTON(widget), title);
     
    988988void CheckButton::destroy(void)
    989989{
    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);
    992992  else
    993993    PRINTF(3)("deleting the CheckButton.\n");
     
    10021002void CheckButton::setTitle(char* title)
    10031003{
    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);
    10081008#ifdef HAVE_GTK2
    10091009  gtk_button_set_label(GTK_BUTTON(widget), title);
     
    10281028  static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget));
    10291029  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;
    10311031}
    10321032#endif /* HAVE_GTK2 */
     
    10891089void Slider::destroy(void)
    10901090{
    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);
    10931093  else
    10941094    PRINTF(3)("deleting the Slider.\n");
     
    11041104void Slider::setTitle(char* title)
    11051105{
    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);
    11101110}
    11111111
     
    11401140  static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget));
    11411141  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;
    11431143}
    11441144#endif /* HAVE_GTK2 */
     
    12041204void Menu::destroy(void)
    12051205{
    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);
    12081208  else
    12091209    PRINTF(3)("deleting the Menu.\n");
     
    12201220void Menu::setTitle(char* title)
    12211221{
    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);
    12261226}
    12271227
     
    12591259  static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget));
    12601260  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;
    12621262}
    12631263#endif /* HAVE_GTK2 */
     
    13041304void OptionLabel::destroy(void)
    13051305{
    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);
    13081308  else
    13091309    PRINTF(3)("deleting the OptionLabel.\n");
     
    13361336void OptionLabel::setTitle(char* title)
    13371337{
    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);
    13421342#ifdef HAVE_GTK2
    13431343  gtk_label_set_text (GTK_LABEL (widget), title);
     
    14001400void Label::destroy(void)
    14011401{
    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);
    14041404  else
    14051405    PRINTF(3)("deleting the Label.\n");
     
    14141414void Label::setTitle(char* text)
    14151415{
    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);
    14201420#ifdef HAVE_GTK2
    14211421  gtk_label_set_text (GTK_LABEL (this->widget), text);
     
    14291429char* Label::getText ()
    14301430{
    1431   return label;
     1431  return this->title;
    14321432}
    14331433
     
    14791479void ProgressBar::destroy(void)
    14801480{
    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);
    14831483  else
    14841484    PRINTF(3)("deleting the ProgressBar.\n");
     
    14931493void ProgressBar::setTitle(char* title)
    14941494{
    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);
    14991499}
    15001500
     
    15401540{
    15411541  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);
    15461546
    15471547#ifdef HAVE_GTK2
     
    15731573void Image::destroy(void)
    15741574{
    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);
    15771577  else
    15781578    PRINTF(3)("deleting the Image.\n");
     
    15871587void Image::setTitle(char* title)
    15881588{
    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  
    7878  //! defines isOption states
    7979  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;
    8181};
    8282
Note: See TracChangeset for help on using the changeset viewer.