Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2009 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 22, 2004, 12:05:57 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: now sets options at startup

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

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/guicc/orxonox_gui.cc

    r2008 r2009  
    109109  if (this->next != NULL)
    110110    this->next->listOptions ();
    111 
    112 
     111}
     112
     113void Widget::setOptions ()
     114{
     115  /**
     116   * This is For listing all the Options witch are located beneath this Widget.
     117   */
     118  if (this->is_option >= 1)
     119    static_cast<Option*>(this)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
     120
     121  switch (this->is_option)
     122    {
     123    case -1:
     124      static_cast<Container*>(this)->down->setOptions ();
     125      break;
     126    case -2:
     127      static_cast<Box*>(this)->down->setOptions ();
     128      break;
     129    }
     130
     131  if (this->next != NULL)
     132    this->next->setOptions ();
    113133}
    114134
     
    332352}
    333353
     354void Button::redraw ()
     355{
     356}
     357
    334358/* CHECKBUTTON */
    335359CheckButton::CheckButton (char* buttonname)
     
    358382  flags->setTextFromFlags(orxonoxGUI);
    359383  cout << static_cast<CheckButton*>(checkbutton)->option_name << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;
     384}
     385
     386void CheckButton::redraw ()
     387{
     388  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
    360389}
    361390
     
    387416  flags->setTextFromFlags(orxonoxGUI);
    388417  cout << static_cast<Slider*>(slider)->option_name << " set to: "<< static_cast<Slider*>(slider)->value << endl;
     418}
     419
     420void Slider::redraw ()
     421{
     422  gtk_range_set_value (GTK_RANGE (widget), value);
    389423}
    390424
     
    429463}
    430464
     465void Menu::redraw ()
     466{
     467  gtk_option_menu_set_history (GTK_OPTION_MENU (widget), value);
     468}
     469
    431470Label:: Label ()
    432471{
  • orxonox/branches/gui/guicc/orxonox_gui.h

    r1998 r2009  
    3838  void show ();
    3939  void listOptions ();
     40  void setOptions ();
    4041
    4142};
     
    104105  void setFlagName (char* flagname, int defaultvalue);
    105106  void setFlagName (char* flagname, char* flagnameshort, int defaultvalue);
     107  virtual void redraw () = 0;
    106108};
    107109
     
    111113  Button (char* buttonname);
    112114  ~Button (void);
     115 
     116  void redraw();
    113117};
    114118
     
    119123  ~CheckButton (void);
    120124  static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
     125  void redraw ();
    121126};
    122127
     
    127132  ~Slider ();
    128133  static gint OptionChange (GtkWidget* widget, Widget* slider);
     134  void redraw();
    129135};
    130136
     
    136142
    137143  static gint OptionChange (GtkWidget* widget, Widget* menu);
     144  void redraw();
    138145};
    139146
  • orxonox/branches/gui/guicc/orxonox_gui_exec.cc

    r2008 r2009  
    114114          sprintf (Variable, "%s", Buffer);
    115115        }
    116 
     116      widget->setOptions();
    117117    }
    118    
    119118}
    120119
Note: See TracChangeset for help on using the changeset viewer.