Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 22, 2005, 1:37:59 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the branches/updater back to the trunk.
merged with command
svn merge -r 3423:HEAD branches/updater/src/gui trunk/src/lib/graphics/gui/gui.

I do not wish to make such jokes again, because it is even worse than copy-pasting. All Files had to be eddited manually, and many diffs where a little bit strange (artifacts).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc

    r3624 r3625  
    10321032
    10331033/**
     1034   \brief saves an Option
     1035   \returns the String that should be saved.
     1036
     1037   this is a default Option save
     1038*/
     1039char* Option::save(void)
     1040{
     1041  char* value = new char [10];
     1042  sprintf (value, "%d", this->value);
     1043  return value;
     1044}
     1045
     1046/**
     1047   \brief loads an Option from of its loadString
     1048   \param loadString the string from which to load the data from
     1049*/
     1050void Option::load(char* loadString)
     1051{
     1052  this->value = atoi(loadString);
     1053  PRINT(3)("Loading %s: %s %d\n", this->title, loadString, value);
     1054  this->redraw();
     1055}
     1056
     1057/**
    10341058   \returns The saveable-state.
    10351059*/
     
    13191343  this->init();
    13201344  this->setTitle(menuname);
    1321    
     1345  va_list itemlist;                     //!< The list to readin multiple Options.
     1346
    13221347  char *itemName;
    13231348
     
    13711396
    13721397/**
     1398   \brief saves the Label of the Menu
     1399   \returns the name of the selected Menu-Item
     1400*/
     1401char* Menu::save(void)
     1402{
     1403  MenuItem* tmpItem = this->firstItem;
     1404  for (int i = 0; i<this->value; i++)
     1405    tmpItem = tmpItem->next;
     1406     
     1407  return tmpItem->name;
     1408}
     1409
     1410/**
     1411   \brief loads a Menu from of its loadString
     1412   \param loadString the string from which to load the data from
     1413*/
     1414void Menu::load(char* loadString)
     1415{
     1416  MenuItem* tmpItem = firstItem;
     1417  bool foundItem = false;
     1418  while (tmpItem)
     1419    {
     1420      if (!strcmp(loadString, tmpItem->name))
     1421        {foundItem = true; break;}
     1422      tmpItem = tmpItem->next;
     1423    }
     1424  if (foundItem)
     1425    this->value = tmpItem->itemNumber;
     1426  else
     1427    {
     1428      this->value = 0;
     1429      PRINTF(2)("Sorry, but %s has not been found in the Itemlist of %s\n", loadString, this->title);
     1430    }
     1431  PRINTF(3)( "Loading %s: setting to %d\n", this->title, this->value);
     1432  this->redraw();
     1433}
     1434
     1435/**
    13731436   \brief appends a new Item to the Menu-List.
    13741437   \param itemName the itemName to be appendet.
     
    13771440{
    13781441  if (!this->firstItem)
    1379     this->firstItem = this->currItem = new MenuItem;
     1442    {
     1443      this->firstItem = this->currItem = new MenuItem;
     1444      this->currItem->itemNumber = 0;
     1445    }
    13801446  else
    1381     this->currItem = this->currItem->next = new MenuItem;
     1447    {
     1448      int tmpI = this->currItem->itemNumber;
     1449      this->currItem = this->currItem->next = new MenuItem;
     1450      this->currItem->itemNumber = tmpI+1;
     1451    }
    13821452
    13831453  this->currItem->name = new char[strlen(itemName)+1];
    13841454  strcpy(this->currItem->name, itemName);
     1455
    13851456#ifdef HAVE_GTK2
    13861457  this->currItem->item = gtk_menu_item_new_with_label(itemName);
     
    14991570
    15001571/**
     1572   \brief creates the Optionlabel save-string
     1573   \returns the String to save.
     1574*/
     1575char* OptionLabel::save(void)
     1576{
     1577  return cValue;
     1578}
     1579
     1580/**
     1581   \brief loads an Option from of its loadString
     1582   \param loadString the string from which to load the data from
     1583*/
     1584void OptionLabel::load(char* loadString)
     1585{
     1586  PRINTF(3)( "Loading %s: setting to %s\n", this->title, loadString);
     1587  this->setValue(loadString);
     1588}
     1589
     1590/**
    15011591   \brief Creates a new default Label with no Text.
    15021592   You migth consider adding Label::setTitle with this.
Note: See TracChangeset for help on using the changeset viewer.