Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4026 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 3, 2005, 10:16:08 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: gui: minor cleanup

Location:
orxonox/trunk/src/lib/gui/gui
Files:
3 edited

Legend:

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

    r4024 r4026  
    2626#include "orxonox_gui_exec.h"
    2727
    28 #include <iostream>
    2928#include <string>
    3029
     
    230229        strcpy(Buffer, static_cast<Option*>(widget)->title);
    231230        if(strchr(Buffer, '_'))
    232           cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;
     231          PRINTF(2)("Optionname %s is not Valid for Saving, because it includes an underscore\n", Buffer);
    233232        while(space2under = strchr(Buffer, ' '))
    234233          {
     
    263262              if((groupWidget = locateGroup(widget, Buffer, 1))==NULL)
    264263                {
    265                   cout << "!!There is no group called " << Buffer << " in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n";
     264                  PRINTF(2)("!!There is no group called %s in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n", Buffer);
    266265                  groupWidget = widget;
    267266                }
    268267              else
    269                 PRINT(3)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
     268                PRINT(5)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
    270269            }
    271270          // option-setting //
     
    300299  if(widget->title && !strcmp(widget->title, info->variableName))
    301300    {
    302       PRINT(3)("Located Option %s.\n", widget->title);
     301      PRINT(5)("Located Option %s.\n", widget->title);
    303302      if(widget->isOption >= 1)
    304303          static_cast<Option*>(widget)->load(info->variableValue);
  • orxonox/trunk/src/lib/gui/gui/orxonox_gui_exec.h

    r4024 r4026  
    1010#include "orxonox_gui_element.h"
    1111
    12 #include <stdio.h>
    1312using namespace std;
    1413
  • orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc

    r3630 r4026  
    2828
    2929#include <stdarg.h>
    30 #include <iostream>
    31 
    3230
    3331using namespace std;
     
    4745#ifdef HAVE_GTK2
    4846#ifdef HAVE_GTHREAD
    49   PRINTF(3)("Initializing the ThreadSystem of the GUI\n");
     47  PRINTF(4)("Initializing the ThreadSystem of the GUI\n");
    5048  g_thread_init(NULL);
    5149  gdk_threads_init();
     
    159157      delete []this->title;
    160158    }
    161  
    162   PRINTF(4)("deleting the Widget part.\n");
    163 
    164   PRINTF(4)("deleting recursively\n");
     159   
     160    PRINTF(5)("deleting the Widget part.\n");
     161   
     162  PRINTF(5)("deleting recursively\n");
    165163
    166164  // deleting next item if existent
     
    168166    delete this->next;
    169167  this->next = NULL;
     168
    170169  //!  \todo not hiding widget, deleting.
    171170  //  this->hide();
     
    349348{
    350349  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
    351     cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";
     350    PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName);
    352351}
    353352
     
    360359{
    361360  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
    362     {
    363       int* count =(int*)data;
    364       *count = *count +1;
    365       cout << *count <<": [" << static_cast<Packer*>(widget)->groupName << "]\n";
    366     }
     361    PRINT(0)("%d: [%s]\n", *(int*)data, static_cast<Packer*>(widget)->groupName);
    367362}
    368363
     
    416411      bool found = false;
    417412      // check if long flag matches
    418       if ((option->flagName && strlen(name)>2 && !strncmp(name+2, option->flagName, strlen(option->flagName)) &&(name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
     413      if ((option->flagName && strlen(name)>2 &&
     414           !strncmp(name+2, option->flagName, strlen(option->flagName)) &&
     415           (name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
    419416        {
    420417          found = true;
     
    424421            }
    425422        }
    426       else if (option->flagNameShort && strlen(name)>1 && !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort))&&(name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) // check if short flag matches
     423      // check if short flag matches
     424      else if (option->flagNameShort && strlen(name)>1 &&
     425               !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort)) &&
     426               (name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '='))
    427427        {
    428428          found = true;
     
    435435      if (found)
    436436        {
    437           PRINT(3)("found matching Flag %s\n", name);
     437          PRINT(4)("found matching Flag %s\n", name);
    438438          if (value)
    439439            {
    440               PRINT(3)("with Value %s\n", value);
     440              PRINT(4)("with Value %s\n", value);
    441441              option->value = atoi(value);
    442442            }
     
    526526Packer::~Packer(void)
    527527{
    528   PRINTF(4)("deleting the Packer part.\n");
     528  PRINTF(5)("deleting the Packer part.\n");
    529529 
    530530  if (this->groupName)
     
    575575Container::~Container(void)
    576576{
    577   PRINTF(4)("deleting the Container part.\n");
     577  PRINTF(5)("deleting the Container part.\n");
    578578}
    579579
     
    650650{
    651651  if (this->title)
    652     PRINTF(3)("deleting the Window: %s\n", this->title);
     652    PRINTF(5)("deleting the Window: %s\n", this->title);
    653653  else
    654     PRINTF(3)("deleting the Window.\n");
     654    PRINTF(5)("deleting the Window.\n");
    655655  //  this->hide();
    656656}
     
    795795Frame::~Frame(void)
    796796{
    797   if (this->title)
    798     PRINTF(3)("deleting the Frame: %s\n", this->title);
    799   else
    800     PRINTF(3)("deleting the Frame.\n");
     797  PRINTF(5)("deleting the Frame: %s\n", this->title);
    801798}
    802799
     
    852849EventBox::~EventBox(void)
    853850{
    854   if (this->title)
    855     PRINTF(3)("deleting the EventBox: %s\n", this->title);
    856   else
    857     PRINTF(3)("deleting the EventBox.\n");
     851  PRINTF(5)("deleting the EventBox: %s\n", this->title);
    858852}
    859853
     
    895889Box::~Box(void)
    896890{
    897   if (this->title)
    898     PRINTF(3)("deleting the Box: %s\n", this->title);
    899   else
    900     PRINTF(3)("deleting the Box.\n");
    901 
     891  PRINTF(5)("deleting the Box: %s\n", this->title);
    902892}
    903893
     
    912902#ifdef HAVE_GTK2
    913903  if (boxtype == 'v')
    914     {
    915       this->widget = gtk_vbox_new(FALSE, 0);
    916     }
     904    this->widget = gtk_vbox_new(FALSE, 0);
    917905  else
    918     {
    919       this->widget = gtk_hbox_new(FALSE, 0);
    920     }
     906    this->widget = gtk_hbox_new(FALSE, 0);
    921907#endif /* HAVE_GTK2 */
    922908}
     
    967953Option::~Option(void)
    968954{
    969   PRINTF(4)("deleting the Option Part.\n");
     955  PRINTF(5)("deleting the Option Part.\n");
    970956  if (this->flagName)
    971957    delete []this->flagName;
     
    10491035{
    10501036  this->value = atoi(loadString);
    1051   PRINT(3)("Loading %s: %s %d\n", this->title, loadString, value);
     1037  PRINT(5)("Loading %s: %s %d\n", this->title, loadString, value);
    10521038  this->redraw();
    10531039}
     
    10921078Button::~Button(void)
    10931079{
    1094   if (this->title)
    1095     PRINTF(3)("deleting the Label: %s\n", this->title);
    1096   else
    1097     PRINTF(3)("deleting the Label.\n");
    1098 
     1080  PRINTF(5)("deleting the Label: %s\n", this->title);
    10991081}
    11001082
     
    11661148{
    11671149  if (this->title)
    1168     PRINTF(3)("deleting the CheckButton: %s\n", this->title);
     1150    PRINTF(5)("deleting the CheckButton: %s\n", this->title);
    11691151  else
    1170     PRINTF(3)("deleting the CheckButton.\n");
     1152    PRINTF(5)("deleting the CheckButton.\n");
    11711153}
    11721154
     
    12141196#else /* HAVE_GTK2 */
    12151197  char tmpChar[20];
    1216   cout << "\nPlease give me a new value for " << this->title << " [0,1](default:" << this->defaultValue << "): ";
     1198  PRINT(0)("\nPlease give me a new value for %s [0,1](default:%d): ",this->title, this->defaultValue);
    12171199  cin >> tmpChar;
    12181200
     
    12201202    this->value = 1;
    12211203#endif /* HAVE_GTK2 */
    1222   cout << this->title << " set to: " << this->value << endl;
     1204  PRINT(0)("%s set to: %d\n", this->title, this->value);
    12231205}
    12241206
     
    12581240Slider::~Slider(void)
    12591241{
    1260   if (this->title)
    1261     PRINTF(3)("deleting the Slider: %s\n", this->title);
    1262   else
    1263     PRINTF(3)("deleting the Slider.\n");
     1242  PRINTF(5)("deleting the Slider: %s\n", this->title);
    12641243}
    12651244
     
    13081287#else /* HAVE_GTK2 */
    13091288  char tmpChar[20];
    1310   cout << "\nPlease give me a new value for " << this->title << " [" <<this->start << "-" << this->end << "](default:" << this->defaultValue << "): ";
     1289  PRINT(0)("\nPlease give me a new value for %s [%d-%d] (default:%d): ", this->title, this->start, this->end, this->defaultValue);
    13111290  cin >> tmpChar;
    13121291
     
    13161295    this->value = this->start;
    13171296#endif /* HAVE_GTK2 */
    1318   cout << this->title << " set to: " << this->value << endl;
     1297  PRINT(0)("%s set to: %d\n",this->title, this->value);
    13191298}
    13201299
     
    13581337Menu::~Menu(void)
    13591338{
    1360   if (this->title)
    1361     PRINTF(3)("deleting the Menu: %s\n", this->title);
    1362   else
    1363     PRINTF(3)("deleting the Menu.\n");
    1364   //! \todo destroy menu
     1339  PRINTF(5)("deleting the Menu: %s\n", this->title);
    13651340  this->currItem = this->firstItem;
    13661341  while(this->currItem)
    13671342    {
    13681343      delete []this->currItem->name;
     1344      //! \todo destroy menu
    13691345      /*
    13701346        #ifdef HAVE_GTK2
     
    14271403      PRINTF(2)("Sorry, but %s has not been found in the Itemlist of %s\n", loadString, this->title);
    14281404    }
    1429   PRINTF(3)( "Loading %s: setting to %d\n", this->title, this->value);
     1405  PRINTF(4)( "Loading %s: setting to %d\n", this->title, this->value);
    14301406  this->redraw();
    14311407}
     
    14661442{
    14671443#ifdef HAVE_GTK2
    1468  gtk_option_menu_set_history(GTK_OPTION_MENU(this->widget), this->value);
     1444  gtk_option_menu_set_history(GTK_OPTION_MENU(this->widget), this->value);
    14691445#endif /* HAVE_GTK2 */
    14701446}
     
    14791455#else /* HAVE_GTK2 */
    14801456  char tmpChar[20];
    1481   cout << "\nPlease give me a new value for " << this->title << "(default:" << this->defaultValue << "): ";
     1457  PRINT(0)("\nPlease give me a new value for %s (default: %d): ", this->title, this->defaultValue);
    14821458  cin >> tmpChar;
    14831459  this->value = atoi(tmpChar);
    14841460
    14851461#endif /* HAVE_GTK2 */
    1486   cout << this->title << " set to: " << this->value << endl;
     1462  PRINT(4)("%s set to: %d\n", this->title, this->value);
    14871463}
    14881464
     
    15061482OptionLabel::~OptionLabel(void)
    15071483{
    1508   if (this->title)
    1509     PRINTF(3)("deleting the OptionLabel: %s\n", this->title);
    1510   else
    1511     PRINTF(3)("deleting the OptionLabel.\n");
     1484  PRINTF(5)("deleting the OptionLabel: %s\n", this->title);
    15121485  if (this->cValue)
    15131486    delete []this->cValue;
     
    15601533  this->cValue =(char*)gtk_label_get_text(GTK_LABEL(this->widget));
    15611534#else /* HAVE_GTK2 */
    1562   cout << "\nPlease give me a new input for " << this->title << ": ";
     1535  PRINT(0)("\nPlease give me a new input for %s: ", this->title);
    15631536  cin >> this->cValue;
    15641537#endif /* HAVE_GTK2 */
    1565   cout << this->title << " set to: " << this->cValue << endl;
     1538  PRINT(4)("%s set to: %s\n", this->title,  this->cValue);
    15661539}
    15671540
     
    15821555void OptionLabel::load(char* loadString)
    15831556{
    1584   PRINTF(3)( "Loading %s: setting to %s\n", this->title, loadString);
     1557  PRINTF(4)( "Loading %s: setting to %s\n", this->title, loadString);
    15851558  this->setValue(loadString);
    15861559}
     
    16101583Label::~Label(void)
    16111584{
    1612   if (this->title)
    1613     PRINTF(3)("deleting the Label: %s\n", this->title);
    1614   else
    1615     PRINTF(3)("deleting the Label.\n");
     1585  PRINTF(5)("deleting the Label: %s\n", this->title);
    16161586}
    16171587
     
    16671637    }
    16681638  else
    1669     {
    1670       this->title = new char[strlen(textToAppend)];
    1671     }
     1639    this->title = new char[strlen(textToAppend)];
    16721640 
    16731641#ifdef HAVE_GTK2
     
    17221690ProgressBar::~ProgressBar(void)
    17231691{
    1724   if (this->title)
    1725     PRINTF(3)("deleting the ProgressBar: %s\n", this->title);
    1726   else
    1727     PRINTF(3)("deleting the ProgressBar.\n");
     1692  PRINTF(5)("deleting the ProgressBar: %s\n", this->title);
    17281693}
    17291694
     
    17991764Image::~Image(void)
    18001765{
    1801   if (this->title)
    1802     PRINTF(3)("deleting the Image: %s\n", this->title);
    1803   else
    1804     PRINTF(3)("deleting the Image.\n");
     1766  PRINTF(5)("deleting the Image: %s\n", this->title);
    18051767}
    18061768
Note: See TracChangeset for help on using the changeset viewer.