Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7221 in orxonox.OLD for trunk/src/lib/gui


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

Location:
trunk/src/lib/gui
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui_button.cc

    r6287 r7221  
    5454}
    5555
    56 void GLGuiButton::setLabel(const char* label)
     56void GLGuiButton::setLabel(const std::string& label)
    5757{
    5858  this->label->setText(label);
  • trunk/src/lib/gui/gl_gui/glgui_button.h

    r5427 r7221  
    3535
    3636   void init();
    37    void setLabel(const char* label);
     37   void setLabel(const std::string& label);
    3838
    3939   virtual void draw() const;
  • trunk/src/lib/gui/gl_gui/glgui_menu.h

    r5391 r7221  
    2424  void init();
    2525
    26   void addItem(const char* itemName);
    27   void removeItem(const char* itemName);
     26  void addItem(const std::string& itemName);
     27  void removeItem(const std::string& itemName);
    2828  void removeItem(unsigned int itemNumber);
    29   void selectItem(const char* itemName);
     29  void selectItem(const std::string& itemName);
    3030  void selectItem(unsigned int itemNumber);
    3131
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r7062 r7221  
    4747    virtual char* save() {};
    4848    /** loads options of the Widget. @param loadString a string containing the Options */
    49     virtual void load(const char* loadString) {};
     49    virtual void load(const std::string& loadString) {};
    5050
    5151    void show();
  • trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc

    r7193 r7221  
    1313   ### File Specific:
    1414   main-programmer: Patrick Boenzli
    15    co-programmer:
     15   co-programmer: Benjamin GRauer
    1616*/
    1717
     
    8484
    8585/**
    86   * sets the background image name
     86  * @brief sets the background image name
    8787  * @param backImageName name of the backgroun-image
    8888 */
    89 void GLMenuImageScreen::setBackgroundImage (const char* backImageName)
     89void GLMenuImageScreen::setBackgroundImage (const std::string& backImageName)
    9090{
    9191  this->backMat->setDiffuseMap(backImageName);
     
    9393
    9494/**
    95  * sets position of the ImageScreen
     95 * @brief sets position of the ImageScreen
    9696 * @param offsetX offset from the top left corner in percent(0-1) of the screensize
    9797 * @param offsetY offset from the top left corner in percent(0-1) of the screensize
     
    104104
    105105/**
    106   \brief sets size of the ImageScreen
     106 * @brief sets size of the ImageScreen
    107107 * @param scaleX the scaleing of the image into the x-direction (in percent (0-1))
    108108 * @param scaleY the scaleing of the image into the y-direction (in percent (0-1))
     
    115115
    116116/**
    117   \brief sets position and size of the ImageScreen
    118 * @param offsetX offset from the top left corner in percent(0-1) of the screensize
    119 * @param offsetY offset from the top left corner in percent(0-1) of the screensize
    120 * @param scaleX the scaleing of the image into the x-direction (in percent (0-1))
    121 * @param scaleY the scaleing of the image into the y-direction (in percent (0-1))
     117 * @brief sets position and size of the ImageScreen
     118 * @param offsetX offset from the top left corner in percent(0-1) of the screensize
     119 * @param offsetY offset from the top left corner in percent(0-1) of the screensize
     120 * @param scaleX the scaleing of the image into the x-direction (in percent (0-1))
     121 * @param scaleY the scaleing of the image into the y-direction (in percent (0-1))
    122122*/
    123123void GLMenuImageScreen::setPosScale(float offsetX, float offsetY, float scaleX, float scaleY)
     
    130130 * @param barImage An image for the Bar
    131131*/
    132 void GLMenuImageScreen::setBarImage(const char* barImage)
     132void GLMenuImageScreen::setBarImage(const std::string& barImage)
    133133{
    134134  this->barMat->setDiffuseMap(barImage);
     
    136136
    137137/**
    138  * sets the Position and the Size of the bar
     138 * @brief sets the Position and the Size of the bar
    139139 * @param barX The Position in the x-direction in percent of the screen (0-1)
    140140 * @param barY The Position in the y-direction in percent of the screen (0-1)
     
    152152
    153153/**
    154  * set the maximum of countable steps
     154 * @brief set the maximum of countable steps
    155155 * @param maxValue of steps
    156156*/
     
    161161
    162162/**
    163  * set current value
     163 * @brief set current value
    164164 * @param currentValue value to set
    165165*/
     
    172172
    173173/**
    174  * get the current value
     174 * @brief get the current value
    175175 */
    176176int GLMenuImageScreen::getValue()
     
    181181
    182182/**
    183   * call this to trigger a progress event
    184 
    185    this has to redraw the progress bar and the whole image
     183 * @brief call this to trigger a progress event
     184 *
     185 * this has to redraw the progress bar and the whole image
    186186 */
    187187void GLMenuImageScreen::step ()
     
    199199
    200200/**
    201  * draws the ImageScreen to the screenbuffer
     201 * @brief draws the ImageScreen to the screenbuffer
    202202*/
    203203void GLMenuImageScreen::draw ()
  • trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.h

    r6512 r7221  
    1313
    1414//! A class to display a loadScreen
    15 class GLMenuImageScreen : public BaseObject {
     15class GLMenuImageScreen : public BaseObject
     16{
    1617
    17  public:
     18public:
    1819  GLMenuImageScreen (const TiXmlElement* root = NULL);
    1920  virtual void loadParams(const TiXmlElement* root);
     
    2223  void draw();
    2324
    24   void setBackgroundImage(const char* backImageName);
     25  void setBackgroundImage(const std::string& backImageName);
    2526  void setPosition(float offsetX, float offsetY);
    2627  void setScale (float scaleX, float scaleY);
    2728  void setPosScale(float offsetX, float offsetY, float scaleX, float scaleY);
    2829
    29   void setBarImage(const char* barImage);
     30  void setBarImage(const std::string& barImage);
    3031  void setBarPosScale(float barX, float barY, float barW, float barH);
    3132
     
    3940
    4041
    41  private:
     42private:
    4243  // background image
    43   char*         backImageName;       //!< the name of the file of the background image
     44  std::string         backImageName;       //!< the name of the file of the background image
    4445  float         offsetX;             //!< X-offset of the the image from the left
    4546  float         offsetY;             //!< Y-offset of the image from the top
  • trunk/src/lib/gui/gtk_gui/gui_exec.cc

    r7193 r7221  
    4747  Frame* execFrame;            //!< The Frame that holds the ExecutionOptions.
    4848
    49   this->confFile = NULL;
    50   this->confDir = NULL;
     49  this->confFile = "";
     50  this->confDir = "";
    5151
    5252  execFrame = new Frame("Execute-Tags:");
     
    137137GuiExec::~GuiExec()
    138138{
    139   if(this->confFile)
    140     delete []this->confFile;
    141   if(this->confDir)
    142     delete []this->confDir;
    143139}
    144140
     
    156152  //! @todo F** Windows-support
    157153#ifndef __WIN32__
    158   mkdir(this->confDir, 0755);
     154  mkdir(this->confDir.c_str(), 0755);
    159155#else /* __WiN32__ */
    160   mkdir(this->confDir);
     156  mkdir(this->confDir.c_str());
    161157#endif /* __WIN32__ */
    162158}
     
    170166void GuiExec::setConfFile(const char* fileName)
    171167{
    172   if (!this->confDir)
     168  if (this->confDir.empty())
    173169    this->setConfDir("~/");
    174   this->confFile = new char[strlen(this->confDir)+strlen(fileName)+2];
    175   sprintf(this->confFile, "%s/%s", this->confDir, fileName);
     170  this->confFile = this->confDir + "/" + fileName;
    176171  PRINTF(5)("ConfigurationFile is %s.\n", this->confFile);
    177172}
     
    182177const char* GuiExec::getConfigFile() const
    183178{
    184   return this->confFile;
     179  return this->confFile.c_str();
    185180}
    186181
     
    204199  IniParser iniParser;
    205200  this->writeFileText(widget, &iniParser, 0);
    206   char* fileName = ResourceManager::homeDirCheck(confFile);
     201  std::string fileName = ResourceManager::homeDirCheck(confFile);
    207202  iniParser.writeFile(fileName);
    208   delete[] fileName;
    209203}
    210204
     
    259253void GuiExec::readFromFile(Widget* widget)
    260254{
    261   char* fileName = ResourceManager::homeDirCheck(confFile);
     255  std::string fileName = ResourceManager::homeDirCheck(confFile);
    262256  IniParser iniParser(fileName);
    263   delete[] fileName;
    264257  if (!iniParser.isOpen())
    265258    return;
     
    267260  iniParser.firstSection();
    268261  Widget* groupWidget = widget;
    269   const char* groupName;
    270   const char* widgetName;
     262  std::string groupName;
     263  std::string widgetName;
    271264  VarInfo varInfo;
    272   while (groupName = iniParser.getCurrentSection())
     265  while ((groupName = iniParser.getCurrentSection()) != "")
    273266  {
    274     printf("GROUP:::%s\n", groupName);
    275     if((groupWidget = locateGroup(widget, groupName, 1))==NULL)
     267    PRINTF(4)("GROUP:::%s\n", groupName.c_str());
     268    if((groupWidget = locateGroup(widget, groupName.c_str(), 1))==NULL)
    276269      {
    277         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", groupName);
     270        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", groupName.c_str());
    278271        groupWidget = widget;
    279272        continue;
     
    282275      PRINT(4)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
    283276
    284     const char* entryName;
     277    std::string entryName;
    285278    iniParser.firstVar();
    286     while(entryName = iniParser.getCurrentName())
    287     {
    288       PRINTF(4)("ENTRY:::%s = %s\n", entryName, iniParser.getCurrentValue());
    289       varInfo.variableName = entryName;
    290       varInfo.variableValue = iniParser.getCurrentValue();
     279    while((entryName = iniParser.getCurrentName()) != "")
     280    {
     281      PRINTF(4)("ENTRY:::%s = %s\n", entryName.c_str(), iniParser.getCurrentValue().c_str());
     282      varInfo.variableName = entryName.c_str();
     283      varInfo.variableValue = iniParser.getCurrentValue().c_str();
    291284      groupWidget->walkThrough(this->readFileText, &varInfo, 0);
    292285      iniParser.nextVar();
  • trunk/src/lib/gui/gtk_gui/gui_exec.h

    r6981 r7221  
    1111#include "gui_gtk.h"
    1212
     13#include <string>
     14
    1315class Widget;
    1416class CheckButton;
     
    2224  CheckButton* saveSettings;   //!< A CheckBox for if the Options should be saved.
    2325
    24   char* confDir;               //!< The directory of the orxonox-configuration-files.
    25   char* confFile;              //!< The name of the .orxonox.conf(ig)-file.
     26  std::string confDir;         //!< The directory of the orxonox-configuration-files.
     27  std::string confFile;        //!< The name of the .orxonox.conf(ig)-file.
    2628
    2729  //! A struct that holds informations about variables.
     
    5860struct HashTable
    5961{
    60   char* name;           //!< name of the entry
    61   char* value;          //!< value of the entry
     62  std::string name;           //!< name of the entry
     63  std::string value;          //!< value of the entry
    6264  HashTable* next;      //!< pointer to the next entry
    6365};
Note: See TracChangeset for help on using the changeset viewer.