Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3162 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Dec 13, 2004, 2:12:42 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: nicer Print of OptionLabel

Location:
orxonox/trunk/gui
Files:
2 edited

Legend:

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

    r3161 r3162  
    184184      char Buffer[256] = "";
    185185      char Variable[256]= "";
    186       int Value;
     186      char* Value;
    187187      while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF)
    188188        {
     
    206206             
    207207              fscanf (CONFIG_FILE, "%s", Buffer);
    208               Value = atoi(Buffer);
     208              Value = Buffer;
    209209              readFileText (groupWidget, Variable, Value, 0);
    210210              sprintf (Variable, "");
     
    222222   \param depth the depth of the local Widget
    223223*/
    224 void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue, int depth)
    225 {
    226   if (widget->isOption >= 1)
    227     if (!strcmp (static_cast<Option*>(widget)->label, variableName))
    228         static_cast<Option*>(widget)->value = variableValue;
    229 
     224void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, char* variableValue, int depth)
     225{
     226  if (widget->isOption >= 1 && widget->isOption <= 3)
     227    {
     228      if (!strcmp (static_cast<Option*>(widget)->label, variableName))
     229        static_cast<Option*>(widget)->value = atoi(variableValue);
     230    }
     231  else if (widget->isOption == 5)
     232    {
     233       if (!strcmp (static_cast<Option*>(widget)->label, variableName))
     234        static_cast<OptionLabel*>(widget)->setValue(variableValue);
     235    }
    230236  if (widget->isOption < 0)
    231237    {
  • orxonox/trunk/gui/orxonox_gui_exec.h

    r2634 r3162  
    3535  void writeFileText (Widget* widget, int depth);
    3636  void readFromFile (Widget* widget);
    37   void readFileText (Widget* widget, char* variableName, int variableValue, int depth);
     37  void readFileText (Widget* widget, char* variableName, char* variableValue, int depth);
    3838  Widget* locateGroup(Widget* widget, char* groupName, int depth);
    3939
Note: See TracChangeset for help on using the changeset viewer.