Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1996 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
Jun 21, 2004, 2:11:32 AM (21 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: added flags-frame, and an Option to rewrite it.

Location:
orxonox/branches/gui/guicc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/guicc/Makefile.am

    r1979 r1996  
    33
    44bin_PROGRAMS=gui
    5 gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc
     5gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc
    66#orxonox_gui_file.cc
    77
  • orxonox/branches/gui/guicc/Makefile.in

    r1979 r1996  
    114114
    115115bin_PROGRAMS = gui
    116 gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc
     116gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc
    117117subdir = guicc
    118118ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    124124
    125125am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_video.$(OBJEXT) \
    126         orxonox_gui_audio.$(OBJEXT) orxonox_gui_exec.$(OBJEXT)
     126        orxonox_gui_audio.$(OBJEXT) orxonox_gui_exec.$(OBJEXT) \
     127        orxonox_gui_flags.$(OBJEXT)
    127128gui_OBJECTS = $(am_gui_OBJECTS)
    128129gui_LDADD = $(LDADD)
     
    136137@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_audio.Po \
    137138@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_exec.Po \
     139@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_flags.Po \
    138140@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_video.Po
    139141CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     
    192194@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_audio.Po@am__quote@
    193195@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_exec.Po@am__quote@
     196@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_flags.Po@am__quote@
    194197@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
    195198
  • orxonox/branches/gui/guicc/orxonox_gui.cc

    r1993 r1996  
    55#include "orxonox_gui_audio.h"
    66#include "orxonox_gui_exec.h"
     7#include "orxonox_gui_flags.h"
    78
    89
     
    2728 
    2829  Box* windowBox = new Box ('v');
    29   {
    30     Box* avBox = new Box ('h');
    31     {
    32       OrxonoxGuiVideo* video = new OrxonoxGuiVideo ();
    33       avBox->fill (video->getFrame ());
    34       OrxonoxGuiAudio* audio = new OrxonoxGuiAudio ();
    35       avBox->fill (audio->getFrame ());
     30 
     31  Box* avBox = new Box ('h');
     32
     33  OrxonoxGuiVideo* video = new OrxonoxGuiVideo ();
     34  avBox->fill (video->getFrame ());
     35  OrxonoxGuiAudio* audio = new OrxonoxGuiAudio ();
     36  avBox->fill (audio->getFrame ());
    3637     
    37     }
    38     windowBox->fill (avBox);
     38  windowBox->fill (avBox);
    3939   
    40     OrxonoxGuiExec* exec = new OrxonoxGuiExec (orxonoxGUI);
    41     windowBox->fill (exec->getFrame ());
    42   }
     40  OrxonoxGuiExec* exec = new OrxonoxGuiExec (orxonoxGUI);
     41  windowBox->fill (exec->getFrame ());
     42
     43  OrxonoxGuiFlags* flags = new OrxonoxGuiFlags (orxonoxGUI);
     44  windowBox->fill (flags->getFrame ());
     45 
    4346  orxonoxGUI->fill (windowBox);
    4447  orxonoxGUI->listOptions();
     48  flags->setTextFromFlags (orxonoxGUI);
    4549
    4650  /* TEST ENVIRONMENT
     
    298302/* OPTION */
    299303
    300 void Option::setFlagName (char *flagname)
     304void Option::setFlagName (char* flagname, int defaultvalue)
     305{
     306  flag_name = flagname;
     307  default_value = defaultvalue;
     308  cout << "Set Flagname of " << option_name << " to " << flagname << endl;
     309}
     310
     311void Option::setFlagName (char* flagname, char* flagnameshort,  int defaultvalue)
    301312{
    302313  /**
     
    304315   */
    305316  flag_name = flagname;
     317  flag_name_short = flagnameshort;
     318  default_value = defaultvalue;
    306319  cout << "Set Flagname of " << option_name << " to " << flagname << endl;
    307320}
     
    319332  option_name = buttonname;
    320333  flag_name = "";
     334  flag_name_short = "";
     335  default_value = 0;
    321336  widget = gtk_button_new_with_label (buttonname);
    322337}
     
    333348  option_name = buttonname;
    334349  flag_name = "";
     350  flag_name_short = "";
     351  default_value = 0;
    335352  widget = gtk_check_button_new_with_label (buttonname);
    336353
    337354  this->connectSignal ("clicked", this->OptionChange);
    338355}
     356
    339357gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton)
    340358{
     
    352370   * Creates a new Slider with name slidername a beginning value of start and an end value of end.
    353371   */
    354   is_option = 1;
     372  is_option = 2;
    355373  value = 0;
    356374  next = NULL;
    357375  option_name = slidername;
    358376  flag_name = "";
     377  flag_name_short = "";
     378  default_value = 0;
    359379  widget = gtk_hscale_new_with_range (start, end, 5);
    360380  value = start;
     
    372392}
    373393
    374 
    375394Menu::Menu (char* menuname, ...)
    376395{
     
    378397   * Creates an Menu-Item-list out of multiple input. Consider, that the last input argument has to be "lastItem" for this to work.
    379398   */
    380   is_option = 1;
     399  is_option = 2;
    381400  value = 0;
    382401  next = NULL;
    383402  option_name = menuname;
    384403  flag_name = "";
     404  flag_name_short = "";
     405  default_value = 0;
    385406  char *tmp;
    386407  va_list itemlist;
     
    409430  cout << static_cast<Menu*>(menu)->option_name << " changed to : " << static_cast<Menu*>(menu)->value << endl;
    410431}
     432
     433Label:: Label ()
     434{
     435  is_option = 0;
     436  next = NULL;
     437  widget = gtk_label_new ("");
     438}
     439Label::~Label ()
     440{}
     441 
     442void Label::setText (char * text)
     443{
     444  gtk_label_set_text (GTK_LABEL (this->widget), text);
     445}
     446
     447char* Label::getText ()
     448{
     449  return ((char*)gtk_label_get_text (GTK_LABEL (this->widget)));
     450}
  • orxonox/branches/gui/guicc/orxonox_gui.h

    r1993 r1996  
    1515#include <gtk/gtkmenu.h>
    1616#include <gtk/gtkmenuitem.h>
     17#include <gtk/gtklabel.h>
    1718
    1819
     
    101102  int default_value;
    102103
    103   void setFlagName (char* flagname);
     104  void setFlagName (char* flagname, int defaultvalue);
     105  void setFlagName (char* flagname, char* flagnameshort, int defaultvalue);
    104106};
    105107
     
    136138  static gint OptionChange (GtkWidget* widget, Widget* menu);
    137139};
    138    
     140
     141class Label : public Widget
     142{
     143 public:
     144  Label ();
     145  ~Label ();
     146 
     147  void setText (char * text);
     148  char* getText ();
     149};
     150
    139151//gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
    140152
  • orxonox/branches/gui/guicc/orxonox_gui_audio.cc

    r1983 r1996  
    66  audioBox = new Box ('v');
    77 
    8   enableSound = new CheckButton ("Enable Sound");
    9   enableSound->setFlagName ("enablesound");
     8  enableSound = new CheckButton ("Disable Sound");
     9  enableSound->setFlagName ("no-sound", 0);
    1010  audioBox->fill (enableSound);
    1111  musicVolume = new Slider ("Music Volume", 0, 100);
    12   musicVolume->setFlagName ("music-volume");
     12  musicVolume->setFlagName ("music-volume", "m", 80);
    1313  audioBox->fill (musicVolume);
    1414  effectsVolume = new Slider ("Effects Volume", 0, 100);
    15   effectsVolume->setFlagName ("effects-volume");
     15  effectsVolume->setFlagName ("effects-volume", "e", 80);
    1616  audioBox->fill (effectsVolume);
    1717
  • orxonox/branches/gui/guicc/orxonox_gui_exec.cc

    r1983 r1996  
    1111  execBox->fill (saveSettings);
    1212  verboseMode = new Menu ("verbose mode", "no output", "verbose", "debug", "lastItem");
    13   verboseMode->setFlagName ("verbose");
     13  verboseMode->setFlagName ("verbose", "v", 0);
    1414  execBox->fill (verboseMode);
    1515  alwaysShow = new CheckButton ("Always Show this Menu");
    16   alwaysShow->setFlagName ("verbose");
     16  alwaysShow->setFlagName ("gui", "g", 0);
    1717  execBox->fill (alwaysShow);
    1818  quit = new Button ("Quit");
  • orxonox/branches/gui/guicc/orxonox_gui_video.cc

    r1983 r1996  
    99 
    1010  fullscreen = new CheckButton ("Fullscreen-mode");
    11   fullscreen->setFlagName ("fullscreen");
     11  fullscreen->setFlagName ("fullscreen", "f", 1);
    1212  videoBox->fill (fullscreen);
    1313  wireframe = new CheckButton ("WireFrame-mode");
    14   wireframe->setFlagName ("wireframe");
     14  wireframe->setFlagName ("wireframe", "w", 0);
    1515  videoBox->fill (wireframe);
    1616
Note: See TracChangeset for help on using the changeset viewer.