Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1978 in orxonox.OLD


Ignore:
Timestamp:
Jun 18, 2004, 11:07:53 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: added video and audio frames. made default signal connection to slider and checkbutton

Location:
orxonox/branches/gui/guicc
Files:
4 added
4 edited

Legend:

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

    r1977 r1978  
    33
    44bin_PROGRAMS=gui
    5 gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc
    6 #orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_file.cc
     5gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc
     6#orxonox_gui_exec.cc orxonox_gui_file.cc
    77
    88#  uncomment the following if bencoder requires the math library
  • orxonox/branches/gui/guicc/Makefile.in

    r1977 r1978  
    114114
    115115bin_PROGRAMS = gui
    116 gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc
     116gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc
    117117subdir = guicc
    118118ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    123123PROGRAMS = $(bin_PROGRAMS)
    124124
    125 am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_video.$(OBJEXT)
     125am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_video.$(OBJEXT) \
     126        orxonox_gui_audio.$(OBJEXT)
    126127gui_OBJECTS = $(am_gui_OBJECTS)
    127128gui_LDADD = $(LDADD)
     
    133134am__depfiles_maybe = depfiles
    134135@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/orxonox_gui.Po \
     136@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_audio.Po \
    135137@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_video.Po
    136138CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     
    187189
    188190@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui.Po@am__quote@
     191@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_audio.Po@am__quote@
    189192@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
    190193
     
    385388        uninstall-am uninstall-binPROGRAMS uninstall-info-am
    386389
    387 #orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_file.cc
     390#orxonox_gui_exec.cc orxonox_gui_file.cc
    388391
    389392#  uncomment the following if bencoder requires the math library
  • orxonox/branches/gui/guicc/orxonox_gui.cc

    r1977 r1978  
     1#include <iostream.h>
     2
    13#include "orxonox_gui.h"
    2 #include <iostream.h>
     4#include "orxonox_gui_video.h"
     5#include "orxonox_gui_audio.h"
    36
    47
     
    2225  orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
    2326 
     27  Box* windowBox = new Box ('v');
     28  {
     29    Box* avBox = new Box ('h');
     30    {
     31      OrxonoxGuiVideo * video = new OrxonoxGuiVideo ();
     32      avBox->fill (video->getFrame());
     33      OrxonoxGuiAudio * audio = new OrxonoxGuiAudio ();
     34      avBox->fill (audio->getFrame());
     35     
     36    }
     37    windowBox->fill (avBox);
     38  }
     39  orxonoxGUI->fill (windowBox);
     40  orxonoxGUI->listOptions();
     41
     42  /* TEST ENVIRONMENT
    2443  Frame* Frametest = new Frame ("Test");
    2544  orxonoxGUI->fill((Frame*) Frametest);
     
    4059  box->fill(menu2);
    4160  orxonoxGUI->listOptions();
     61  */
    4262  orxonoxGUI->showall ();
    43  
     63
    4464 
    4565  gtk_main();
     
    277297   */
    278298  is_option = 0;
     299  value = 0;
    279300  next = NULL;
    280301  option_name = buttonname;
     
    289310   */
    290311  is_option = 1;
     312  value = 0;
    291313  next = NULL;
    292314  option_name = buttonname;
    293315  widget = gtk_check_button_new_with_label (buttonname);
     316
     317  this->connectSignal ("clicked", this->OptionChange);
     318}
     319gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton)
     320{
     321  /**
     322   * Writes value, if changed on the checkbutton, to the object.
     323   */
     324  static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget));
     325  cout << static_cast<CheckButton*>(checkbutton)->option_name << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;
    294326}
    295327
     
    301333   */
    302334  is_option = 1;
     335  value = 0;
    303336  next = NULL;
    304337  option_name = slidername;
    305338  widget = gtk_hscale_new_with_range (start, end, 5);
    306339  value = start;
     340
     341  this->connectSignal ("value_changed", this->OptionChange);
    307342}
    308343
     
    313348   */
    314349  static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget));
    315   cout << static_cast<Slider*>(slider)->value << endl;
     350  cout << static_cast<Slider*>(slider)->option_name << " set to: "<< static_cast<Slider*>(slider)->value << endl;
    316351}
    317352
     
    323358   */
    324359  is_option = 1;
     360  value = 0;
    325361  next = NULL;
    326362  option_name = menuname;
  • orxonox/branches/gui/guicc/orxonox_gui.h

    r1977 r1978  
    1515#include <gtk/gtkmenu.h>
    1616#include <gtk/gtkmenuitem.h>
     17
    1718
    1819class OrxonoxGui
     
    110111  CheckButton (char* buttonname);
    111112  ~CheckButton (void);
     113  static gint OptionChange (GtkWidget *widget, Widget* checkbutton);
    112114};
    113115
Note: See TracChangeset for help on using the changeset viewer.