Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7549 in orxonox.OLD for branches/qt_gui


Ignore:
Timestamp:
May 6, 2006, 10:52:49 AM (19 years ago)
Author:
bensch
Message:

Saveable integration. Step 1

Location:
branches/qt_gui/src/lib/gui
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/gui.h

    r7548 r7549  
    88
    99#include "base_object.h"
     10#include <vector>
    1011
    1112// FORWARD DECLARATION
     
    1314namespace OrxGui
    1415{
     16  class SaveableGroup;
     17
    1518  //! A class for ...
    1619  class Gui : public BaseObject
    1720  {
    18     public:
    19       typedef enum {
    20         Null          = 0,
    21         Quitting      = 1,
    22         Starting      = 2,
    23         Saving        = 4,
    24       } State;
     21  public:
     22    typedef enum {
     23      Null          = 0,
     24      Quitting      = 1,
     25      Starting      = 2,
     26      Saving        = 4,
     27    } State;
    2528
    2629
     
    4043    unsigned int getState() const { return this->state; };
    4144
     45
     46    void addSaveableGroup(SaveableGroup* saveableGroup);
     47
    4248  protected:
    4349    void quitEvent();
    4450    void startEvent();
    4551
    46     private:
    47       unsigned int        state; //!< The State the Gui is in.
     52  private:
     53    unsigned int                  state; //!< The State the Gui is in.
     54    std::vector<SaveableGroup*>   groups;
    4855  };
    4956}
  • branches/qt_gui/src/lib/gui/gui_element.cc

    r7539 r7549  
    2727   *  standard constructor
    2828   */
    29   Element::Element (const std::string& name)
    30   : SaveableGroup(name)
     29  Element::Element (const std::string& name, OrxGui::Gui* gui)
     30  : SaveableGroup(name, gui)
    3131  {
    3232    //this->mainWidget = NULL;
  • branches/qt_gui/src/lib/gui/gui_element.h

    r7539 r7549  
    1313{
    1414  class Widget;
     15  class Gui;
    1516
    1617  //! A SuperClass for all the Different GuiElements
    1718  class Element : public SaveableGroup
    1819  {
    19 
    2020  public:
    21     Element(const std::string& name);
     21    Element(const std::string& name, OrxGui::Gui* gui);
    2222    virtual ~Element();
    2323  };
  • branches/qt_gui/src/lib/gui/gui_saveable.cc

    r7493 r7549  
    4848
    4949
    50   SaveableGroup::SaveableGroup(const std::string& groupName)
     50  SaveableGroup::SaveableGroup(const std::string& groupName, OrxGui::Gui* gui)
    5151      : Saveable(groupName)
    5252  {
     53
    5354  }
    5455
  • branches/qt_gui/src/lib/gui/gui_saveable.h

    r7539 r7549  
    1414namespace OrxGui
    1515{
     16  class Gui;
     17
    1618  //! A class for ...
    1719  class Saveable : public BaseObject
     
    5254
    5355  protected:
    54     SaveableGroup(const std::string& name);
     56    SaveableGroup(const std::string& name, OrxGui::Gui* gui);
    5557    virtual void makingElementSaveable();
    5658
  • branches/qt_gui/src/lib/gui/qt_gui/gui_audio.cc

    r7539 r7549  
    3737   *  Creates the Audio-Option-Frame
    3838  */
    39   GuiAudio::GuiAudio(QWidget* parent)
    40   : Element("Audio"), QGroupBox(parent)
     39  GuiAudio::GuiAudio(OrxGui::Gui* gui)
     40  : Element("Audio", gui), QGroupBox()
    4141  {
    4242    QGridLayout* layout = new QGridLayout(this);
     
    4444    {
    4545      QtGuiCheckBox* fullscreen = new QtGuiCheckBox("Enabled", true);
    46       //fullscreen->setName();
    4746      layout->addWidget(fullscreen, 0, 0);
    4847
     
    5049      layout->addWidget(wireframe, 1, 0);
    5150
    52       QtGuiComboBox* resolution = new QtGuiComboBox("SoundCard");
    53       layout->addWidget(resolution, 2, 0);
     51      QtGuiComboBox* soundCard = new QtGuiComboBox("SoundCard");
     52      layout->addWidget(soundCard, 2, 0);
    5453
     54      QtGuiSlider* channels = new QtGuiSlider("Channels");
     55      layout->addWidget(channels, 3, 0);
    5556
     57      QtGuiSlider* musicVolume = new QtGuiSlider("Music-Volume");
     58      layout->addWidget(musicVolume,0, 1);
     59      QtGuiSlider* effectVolume = new QtGuiSlider("Effects-Volume");
     60      layout->addWidget(effectVolume, 0, 2);
    5661    }
    5762
  • branches/qt_gui/src/lib/gui/qt_gui/gui_audio.h

    r7534 r7549  
    1717  {
    1818  public:
    19     GuiAudio(QWidget* parent = NULL);
     19    GuiAudio(OrxGui::Gui* gui);
    2020    virtual ~GuiAudio();
    2121
  • branches/qt_gui/src/lib/gui/qt_gui/gui_video.cc

    r7547 r7549  
    3838   *  Creates the Video-Option-Frame
    3939  */
    40   GuiVideo::GuiVideo(QWidget* parent)
    41       : Element("Video"), QGroupBox(parent)
     40  GuiVideo::GuiVideo(OrxGui::Gui* gui)
     41      : Element("Video", gui), QGroupBox()
    4242  {
    4343    QGridLayout* layout = new QGridLayout(this);
  • branches/qt_gui/src/lib/gui/qt_gui/gui_video.h

    r7534 r7549  
    1717  {
    1818  public:
    19     GuiVideo(QWidget* parent = NULL);
     19    GuiVideo(OrxGui::Gui* gui);
    2020    virtual ~GuiVideo();
    2121
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc

    r7548 r7549  
    4141      {
    4242
    43         toolBox->addItem(new GuiVideo(toolBox), "Video");
    44         toolBox->addItem(new GuiAudio(toolBox), "Audio");
     43        toolBox->addItem(new GuiVideo(this), "Video");
     44        toolBox->addItem(new GuiAudio(this), "Audio");
    4545      }
    4646      mainLayout->addWidget(toolBox,1,1, 1, 3);
     
    6161
    6262    this->exec();
    63 
    64 
    6563  }
    6664
     
    9189    this->quit();
    9290  }
     91
    9392  void QtGui::startApp()
    9493  {
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc

    r7539 r7549  
    4343  }
    4444
     45
     46
     47
     48
     49  QtGuiSlider::QtGuiSlider(const std::string& name)
     50  : QSlider(), Saveable(name)
     51  {
     52
     53  }
     54  QtGuiSlider::~QtGuiSlider()
     55  {}
     56
     57
     58
     59
     60
     61
     62
     63
    4564  QtGuiComboBox::QtGuiComboBox(const std::string& name)
    4665  : QComboBox(), Saveable(name)
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.h

    r7543 r7549  
    4848
    4949  public:
    50     QtGuiSlider();
    51     virtual ~QtGuiSlider() {};
     50    QtGuiSlider(const std::string& name);
     51    virtual ~QtGuiSlider();
    5252
    5353  public slots:
Note: See TracChangeset for help on using the changeset viewer.