Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7585 in orxonox.OLD


Ignore:
Timestamp:
May 11, 2006, 12:22:03 AM (18 years ago)
Author:
bensch
Message:

orxonox/qt_gui: more guo-elements

Location:
branches/qt_gui/src/lib/gui/qt_gui
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/qt_gui/Makefile.am

    r7542 r7585  
    2121                \
    2222                gui_video.cc \
    23                 gui_audio.cc
     23                gui_audio.cc \
     24                gui_general.cc
    2425
    2526noinst_HEADERS= \
     
    2829                \
    2930                gui_video.h \
    30                 gui_audio.h
     31                gui_audio.h \
     32                gui_general.cc
     33
    3134
    3235EXTRA_DIST =
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.cc

    r7582 r7585  
    2525
    2626
    27 #include "gui_audio.h"
     27#include "gui_general.h"
    2828
    2929#include <QtGui/QLayout>
     
    3535{
    3636  /**
    37    *  Creates the Audio-Option-Frame
     37   *  Creates the General-Option-Frame
    3838  */
    39   GuiAudio::GuiAudio(OrxGui::Gui* gui)
    40   : Element("Audio", gui), QGroupBox()
     39  GuiGeneral::GuiGeneral(OrxGui::Gui* gui)
     40  : Element("General", gui), QGroupBox()
    4141  {
    4242    QGridLayout* layout = new QGridLayout(this);
    4343
    4444    {
    45       QtGuiCheckBox* fullscreen = new QtGuiCheckBox("Enabled", this, true);
    46       layout->addWidget(fullscreen, 0, 1);
     45      QLabel* dataDirLabel = new QLabel("DataDirectory");
     46      layout->addWidget(dataDirLabel, 0,0);
     47      QtGuiInputLine* dataDir = new QtGuiInputLine("SoundCard", this);
     48      layout->addWidget(dataDir, 0, 1, 1, 2);
    4749
     50      QLabel* debugLabel = new QLabel("debug-mode");
     51      layout->addWidget(debugLabel, 1,0);
     52      QtGuiComboBox* debug = new QtGuiComboBox("debug", this);
     53      layout->addWidget(debug, 1, 1, 1, 2);
    4854
    49       QLabel* soundCardLabel = new QLabel("Soundcard");
    50       layout->addWidget(soundCardLabel, 1,1);
    51       QtGuiComboBox* soundCard = new QtGuiComboBox("SoundCard", this);
    52       layout->addWidget(soundCard, 2, 1);
    53 
    54       QtGuiSlider* channels = new QtGuiSlider("Channels", this, Qt::Vertical);
    55       layout->addWidget(channels, 0, 0, 3, 1);
    56       QLabel* channelsLabel = new QLabel("Channels");
    57       layout->addWidget(channelsLabel, 3,0);
    58 
    59 
    60       QLabel* musicLabel = new QLabel("Music Volume");
    61       layout->addWidget(musicLabel, 0, 2);
    62       QtGuiSlider* musicVolume = new QtGuiSlider("Music-Volume", this);
    63       layout->addWidget(musicVolume, 1, 2);
    64 
    65 
    66       QLabel* effectsLabel = new QLabel("Effects Volume");
    67       layout->addWidget(effectsLabel, 2,2);
    68       QtGuiSlider* effectVolume = new QtGuiSlider("Effects-Volume", this);
    69       layout->addWidget(effectVolume, 3, 2);
     55      debug->addItem("0 - minimal");
     56      debug->addItem("1 - errors");
     57      debug->addItem("2 - warnings");
     58      debug->addItem("3 - information");
     59      debug->addItem("4 - debug");
     60      debug->addItem("5 - extremely debug");
    7061    }
    7162
     
    7465
    7566  /**
    76    *  Destructs the Audio-stuff
     67   *  Destructs the General-stuff
    7768  */
    78   GuiAudio::~GuiAudio()
     69  GuiGeneral::~GuiGeneral()
    7970  {
    8071    // nothing to do here.
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.h

    r7582 r7585  
    11/*!
    2   \file gui_audio.h
    3   \brief File that holds the class that creates the Audio-Options.
     2  \file gui_general.h
     3  \brief File that holds the class that creates the General-Options.
    44*/
    5 #ifndef _GUI_AUDIO_H
    6 #define _GUI_AUDIO_H
     5#ifndef _GUI_GENERAL_H
     6#define _GUI_GENERAL_H
    77
    88#include "../gui_element.h"
     
    1414{
    1515  //! Class that creates the Audio-Options.
    16   class GuiAudio : public OrxGui::Element, public QGroupBox
     16  class GuiGeneral : public OrxGui::Element, public QGroupBox
    1717  {
    1818  public:
    19     GuiAudio(OrxGui::Gui* gui);
    20     virtual ~GuiAudio();
     19    GuiGeneral(OrxGui::Gui* gui);
     20    virtual ~GuiGeneral();
    2121
    2222  };
    2323}
    2424
    25 #endif /* _GUI_AUDIO_H */
     25#endif /* _GUI_GENERAL_H */
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc

    r7555 r7585  
    2525#include "gui_video.h"
    2626#include "gui_audio.h"
     27#include "gui_general.h"
    2728
    2829namespace OrxGui
     
    4344        toolBox->addItem(new GuiVideo(this), "Video");
    4445        toolBox->addItem(new GuiAudio(this), "Audio");
     46        toolBox->addItem(new GuiGeneral(this), "General");
    4547      }
    4648      mainLayout->addWidget(toolBox,1,1, 1, 3);
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc

    r7555 r7585  
    3333  {
    3434    this->setTristate(value.getBool());
    35         this->value() = value;
     35    this->value() = value;
    3636  }
    3737
     
    8181
    8282
     83  QtGuiInputLine::QtGuiInputLine(const std::string& name, SaveableGroup* group)
     84  : QLineEdit(), Saveable(name, group)
     85  {
     86
     87
     88  }
     89
     90
     91  void QtGuiInputLine::load(const MultiType& value)
     92  {
     93    this->setText(value.getString().c_str());
     94    this->value() = value;
     95  }
     96
     97
     98
     99  const MultiType& QtGuiInputLine::save()
     100  {
     101    return this->value();
     102  }
     103
     104
     105
     106
    83107}
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.h

    r7555 r7585  
    7070  };
    7171
     72  class QtGuiInputLine : public QLineEdit, public OrxGui::Saveable
     73  {
     74    Q_OBJECT
     75
     76  public:
     77    QtGuiInputLine(const std::string& name, SaveableGroup* group);
     78
     79    virtual void load(const MultiType& value);
     80    virtual const MultiType& save();
     81  };
     82
    7283}
    7384
Note: See TracChangeset for help on using the changeset viewer.