Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2622 in orxonox.OLD for orxonox/trunk/gui


Ignore:
Timestamp:
Oct 22, 2004, 11:12:28 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: modularity improved. Now init() of Subclasses execute the init() of their superclass to set the default values for specific Widgets

Location:
orxonox/trunk/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/gui/orxonox_gui.cc

    r2618 r2622  
    132132void Widget::init()
    133133{
     134  next = NULL;
     135  label = "";
    134136  return;
    135137}
     
    233235void Packer::init (void)
    234236{
     237  down = NULL;
     238  this->setGroupName ("");
     239
     240
     241  static_cast<Widget*>(this)->init();
    235242  return;
    236243}
     
    262269void Container::init (void)
    263270{
     271  is_option = -1;
     272
     273  static_cast<Packer*>(this)->init();
    264274  return;
    265275}
     
    309319{
    310320  isOpen = true;
    311   is_option = -1;
    312   label = "";
    313   this->setGroupName ("");
    314   next = NULL;
    315   down = NULL;
     321
     322  static_cast<Container*>(this)->init();
     323
    316324  widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    317325  gtk_window_set_policy (GTK_WINDOW(widget), TRUE, TRUE, TRUE);
     
    382390void Frame::init()
    383391{
    384   is_option = -1;
    385   label = "";
    386   this->setGroupName("");
    387   next = NULL;
    388   down = NULL;
     392  static_cast<Container*>(this)->init();
     393 
    389394  widget = gtk_frame_new ("");
    390395  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
     
    427432{
    428433  is_option = -1;
    429   label = "eventBox";
    430   this->setGroupName("");
    431   next = NULL;
    432   down = NULL;
     434
     435  static_cast<Container*>(this)->init();
     436
    433437  widget = gtk_event_box_new ();
    434438  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
     
    471475{
    472476  is_option = -2;
    473   label = "box";
    474   this->setGroupName("");
    475   next = NULL;
    476   down = NULL;
     477
     478  static_cast<Packer*>(this)->init();
    477479  if (boxtype == 'v')
    478480    {
     
    529531{
    530532  is_option = 0;
    531   label = "";
    532   next = NULL;
     533
     534  static_cast<Widget*>(this)->init();
    533535}
    534536
     
    541543void Option::init()
    542544{
     545  value = 0;
     546  flag_name = "";
     547  flag_name_short = "";
     548  default_value = 0;
     549
     550  static_cast<Widget*>(this)->init();
     551
    543552  return;
    544553}
     
    590599{
    591600  is_option = 0;
    592   value = 0;
    593   next = NULL;
    594   label ="";
    595   flag_name = "";
    596   flag_name_short = "";
    597   default_value = 0;
     601
     602  static_cast<Option*>(this)->init();
     603
    598604  widget = gtk_button_new_with_label ("");
    599605}
     
    637643{
    638644  is_option = 1;
    639   value = 0;
    640   next = NULL;
    641   label = "";
    642   flag_name = "";
    643   flag_name_short = "";
    644   default_value = 0;
     645
     646  static_cast<Option*>(this)->init();
     647
    645648  widget = gtk_check_button_new_with_label ("");
    646649}
     
    701704{
    702705  is_option = 2;
    703   value = 0;
    704   next = NULL;
    705   label = "";
    706   flag_name = "";
    707   flag_name_short = "";
    708   default_value = 0;
     706
     707  static_cast<Option*>(this)->init();
     708
    709709  widget = gtk_hscale_new_with_range (start, end, 5);
    710710}
     
    781781{
    782782  is_option = 2;
    783   value = 0;
    784   next = NULL;
    785   flag_name = "";
    786   flag_name_short = "";
    787   default_value = 0;
     783
     784  static_cast<Option*>(this)->init();
     785
    788786  widget = gtk_option_menu_new ();
    789787  menu = gtk_menu_new ();
     
    855853{
    856854  is_option = 0;
    857   label = "";
    858   next = NULL;
     855
     856  static_cast<Widget*>(this)->init();
     857
    859858  widget = gtk_label_new ("");
    860859  gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
  • orxonox/trunk/gui/orxonox_gui.h

    r2618 r2622  
    3838
    3939//! This is the topmost object that can be displayed all others are derived from it.
    40 
    4140class Widget
    4241{
     
    4746  Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
    4847  GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
    49   virtual void init(void);
     48  void init(void);
    5049  int is_option; //!< with this Paramenter one can set the IsOption type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option
    5150  /**
  • orxonox/trunk/gui/orxonox_gui_banner.cc

    r2605 r2622  
    6363          logoEventBox = new EventBox();
    6464          logoBox = new Box('v');
    65           logoLabel = new Label("OrxOnoX");
     65          logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION);
    6666          logoImage = new Image("banner.xpm");
    6767          logoEventBox->fill(logoImage);
Note: See TracChangeset for help on using the changeset viewer.