Changeset 1996 in orxonox.OLD for orxonox/branches
- Timestamp:
- Jun 21, 2004, 2:11:32 AM (21 years ago)
- Location:
- orxonox/branches/gui/guicc
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/guicc/Makefile.am
r1979 r1996 3 3 4 4 bin_PROGRAMS=gui 5 gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc 5 gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc 6 6 #orxonox_gui_file.cc 7 7 -
orxonox/branches/gui/guicc/Makefile.in
r1979 r1996 114 114 115 115 bin_PROGRAMS = gui 116 gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc 116 gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc 117 117 subdir = guicc 118 118 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 124 124 125 125 am_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) 127 128 gui_OBJECTS = $(am_gui_OBJECTS) 128 129 gui_LDADD = $(LDADD) … … 136 137 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox_gui_audio.Po \ 137 138 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox_gui_exec.Po \ 139 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox_gui_flags.Po \ 138 140 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox_gui_video.Po 139 141 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ … … 192 194 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_audio.Po@am__quote@ 193 195 @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@ 194 197 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@ 195 198 -
orxonox/branches/gui/guicc/orxonox_gui.cc
r1993 r1996 5 5 #include "orxonox_gui_audio.h" 6 6 #include "orxonox_gui_exec.h" 7 #include "orxonox_gui_flags.h" 7 8 8 9 … … 27 28 28 29 Box* windowBox = new Box ('v'); 29 {30 31 { 32 33 34 35 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 ()); 36 37 37 } 38 windowBox->fill (avBox); 38 windowBox->fill (avBox); 39 39 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 43 46 orxonoxGUI->fill (windowBox); 44 47 orxonoxGUI->listOptions(); 48 flags->setTextFromFlags (orxonoxGUI); 45 49 46 50 /* TEST ENVIRONMENT … … 298 302 /* OPTION */ 299 303 300 void Option::setFlagName (char *flagname) 304 void 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 311 void Option::setFlagName (char* flagname, char* flagnameshort, int defaultvalue) 301 312 { 302 313 /** … … 304 315 */ 305 316 flag_name = flagname; 317 flag_name_short = flagnameshort; 318 default_value = defaultvalue; 306 319 cout << "Set Flagname of " << option_name << " to " << flagname << endl; 307 320 } … … 319 332 option_name = buttonname; 320 333 flag_name = ""; 334 flag_name_short = ""; 335 default_value = 0; 321 336 widget = gtk_button_new_with_label (buttonname); 322 337 } … … 333 348 option_name = buttonname; 334 349 flag_name = ""; 350 flag_name_short = ""; 351 default_value = 0; 335 352 widget = gtk_check_button_new_with_label (buttonname); 336 353 337 354 this->connectSignal ("clicked", this->OptionChange); 338 355 } 356 339 357 gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton) 340 358 { … … 352 370 * Creates a new Slider with name slidername a beginning value of start and an end value of end. 353 371 */ 354 is_option = 1;372 is_option = 2; 355 373 value = 0; 356 374 next = NULL; 357 375 option_name = slidername; 358 376 flag_name = ""; 377 flag_name_short = ""; 378 default_value = 0; 359 379 widget = gtk_hscale_new_with_range (start, end, 5); 360 380 value = start; … … 372 392 } 373 393 374 375 394 Menu::Menu (char* menuname, ...) 376 395 { … … 378 397 * Creates an Menu-Item-list out of multiple input. Consider, that the last input argument has to be "lastItem" for this to work. 379 398 */ 380 is_option = 1;399 is_option = 2; 381 400 value = 0; 382 401 next = NULL; 383 402 option_name = menuname; 384 403 flag_name = ""; 404 flag_name_short = ""; 405 default_value = 0; 385 406 char *tmp; 386 407 va_list itemlist; … … 409 430 cout << static_cast<Menu*>(menu)->option_name << " changed to : " << static_cast<Menu*>(menu)->value << endl; 410 431 } 432 433 Label:: Label () 434 { 435 is_option = 0; 436 next = NULL; 437 widget = gtk_label_new (""); 438 } 439 Label::~Label () 440 {} 441 442 void Label::setText (char * text) 443 { 444 gtk_label_set_text (GTK_LABEL (this->widget), text); 445 } 446 447 char* Label::getText () 448 { 449 return ((char*)gtk_label_get_text (GTK_LABEL (this->widget))); 450 } -
orxonox/branches/gui/guicc/orxonox_gui.h
r1993 r1996 15 15 #include <gtk/gtkmenu.h> 16 16 #include <gtk/gtkmenuitem.h> 17 #include <gtk/gtklabel.h> 17 18 18 19 … … 101 102 int default_value; 102 103 103 void setFlagName (char* flagname); 104 void setFlagName (char* flagname, int defaultvalue); 105 void setFlagName (char* flagname, char* flagnameshort, int defaultvalue); 104 106 }; 105 107 … … 136 138 static gint OptionChange (GtkWidget* widget, Widget* menu); 137 139 }; 138 140 141 class Label : public Widget 142 { 143 public: 144 Label (); 145 ~Label (); 146 147 void setText (char * text); 148 char* getText (); 149 }; 150 139 151 //gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); 140 152 -
orxonox/branches/gui/guicc/orxonox_gui_audio.cc
r1983 r1996 6 6 audioBox = new Box ('v'); 7 7 8 enableSound = new CheckButton (" Enable Sound");9 enableSound->setFlagName (" enablesound");8 enableSound = new CheckButton ("Disable Sound"); 9 enableSound->setFlagName ("no-sound", 0); 10 10 audioBox->fill (enableSound); 11 11 musicVolume = new Slider ("Music Volume", 0, 100); 12 musicVolume->setFlagName ("music-volume" );12 musicVolume->setFlagName ("music-volume", "m", 80); 13 13 audioBox->fill (musicVolume); 14 14 effectsVolume = new Slider ("Effects Volume", 0, 100); 15 effectsVolume->setFlagName ("effects-volume" );15 effectsVolume->setFlagName ("effects-volume", "e", 80); 16 16 audioBox->fill (effectsVolume); 17 17 -
orxonox/branches/gui/guicc/orxonox_gui_exec.cc
r1983 r1996 11 11 execBox->fill (saveSettings); 12 12 verboseMode = new Menu ("verbose mode", "no output", "verbose", "debug", "lastItem"); 13 verboseMode->setFlagName ("verbose" );13 verboseMode->setFlagName ("verbose", "v", 0); 14 14 execBox->fill (verboseMode); 15 15 alwaysShow = new CheckButton ("Always Show this Menu"); 16 alwaysShow->setFlagName (" verbose");16 alwaysShow->setFlagName ("gui", "g", 0); 17 17 execBox->fill (alwaysShow); 18 18 quit = new Button ("Quit"); -
orxonox/branches/gui/guicc/orxonox_gui_video.cc
r1983 r1996 9 9 10 10 fullscreen = new CheckButton ("Fullscreen-mode"); 11 fullscreen->setFlagName ("fullscreen" );11 fullscreen->setFlagName ("fullscreen", "f", 1); 12 12 videoBox->fill (fullscreen); 13 13 wireframe = new CheckButton ("WireFrame-mode"); 14 wireframe->setFlagName ("wireframe" );14 wireframe->setFlagName ("wireframe", "w", 0); 15 15 videoBox->fill (wireframe); 16 16
Note: See TracChangeset
for help on using the changeset viewer.