Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1996 in orxonox.OLD for orxonox/branches/gui/guicc/orxonox_gui.cc


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.