Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3161 in orxonox.OLD for orxonox/trunk/gui/orxonox_gui_exec.cc


Ignore:
Timestamp:
Dec 13, 2004, 2:10:38 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: OptionLabel now has a member cValue for saving its state beside its name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/gui/orxonox_gui_exec.cc

    r3147 r3161  
    128128                              && (static_cast<Option*>(widget)->saveable) )
    129129                             || (widget->isOption<0
    130                                  && strcmp (static_cast<Packer*>(widget)->getGroupName(), ""))))
     130                                 && static_cast<Packer*>(widget)->getGroupName())))
    131131    {
    132132      fprintf (CONFIG_FILE, "  ", depth);
     
    137137  if (widget->isOption <0)
    138138    {
    139       if (strcmp (static_cast<Packer*>(widget)->getGroupName(), ""))
     139      if (static_cast<Packer*>(widget)->getGroupName())
    140140        {
    141141          fprintf (CONFIG_FILE, "[%s]\n", static_cast<Packer*>(widget)->getGroupName());
     
    155155        char Buffer[256];
    156156        char* space2under;
    157         sprintf (Buffer, "%s", static_cast<Option*>(widget)->label);
     157        strcpy (Buffer, static_cast<Option*>(widget)->label);
    158158        if (strchr (Buffer, '_'))
    159159          cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;
    160160        while (space2under = strchr(Buffer, ' '))
    161161          {
    162             sprintf (space2under, "_%s", space2under+1);
     162            space2under[0] = '_';
    163163          }
    164         fprintf (CONFIG_FILE, "%s = %i\n", Buffer, static_cast<Option*>(widget)->value);
     164        if (widget->isOption <=3)
     165          fprintf (CONFIG_FILE, "%s = %d\n", Buffer, static_cast<Option*>(widget)->value);
     166        else if (widget->isOption == 5)
     167          fprintf (CONFIG_FILE, "%s = %s\n", Buffer, static_cast<OptionLabel*>(widget)->cValue);
    165168      }
    166169
     
    184187      while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF)
    185188        {
     189          // group-search //
    186190          if (!strncmp (Buffer, "[", 1))
    187191            {
     
    192196                }
    193197            }
     198          // option-setting //
    194199          if (!strcmp (Buffer, "="))
    195200            {
     
    248253  if (widget->isOption < 0)
    249254    {
    250       if (!strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
     255      if (static_cast<Packer*>(widget)->getGroupName() && !strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
    251256        {
    252257          return widget;
Note: See TracChangeset for help on using the changeset viewer.