Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 11, 2004, 3:33:05 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: banner Window is as it should be

Location:
orxonox/trunk/gui
Files:
4 edited

Legend:

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

    r3147 r3148  
    3131OrxonoxGuiBanner::OrxonoxGuiBanner ()
    3232{
     33  // Banner Itself //
    3334  bannerEventBox = new EventBox ("BannerEventBox");
    3435  bannerImage = new Image ("banner.xpm");
    3536  bannerEventBox->fill(bannerImage);
    3637  bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen);
    37   logoWindowIsOpen = -1;
     38
     39  // Banner Window //
     40  logoWindow = new Window("Logo");
     41  logoWindow->connectSignal("destroy", this, LogoWindowClose);
     42  logoWindow->connectSignal("delete_event", this, LogoWindowClose);
     43  logoEventBox = new EventBox();
     44  logoBox = new Box('v');
     45  logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION);
     46  logoImage = new Image("banner.xpm");
     47  logoEventBox->fill(logoImage);
     48 
     49  logoBox->fill(logoLabel);
     50  logoBox->fill(logoEventBox);
     51  logoEventBox->connectSignal("button_press_event",this,LogoWindowClose);
     52 
     53  logoWindow->fill (logoBox);
     54 
     55  Window::addWindow (logoWindow);
    3856}
    3957
     
    5068    it shows it if it has been created
    5169*/
    52 void OrxonoxGuiBanner::logoWindowNew()
     70void OrxonoxGuiBanner::logoWindowOpen()
    5371{
    54   if (logoWindowIsOpen <= 0)
    55     {
    56       if (logoWindowIsOpen < 0)
    57         {
    58           // creating new Logo Window //
    59           logoWindow = new Window("Logo");
    60           logoWindow->connectSignal("destroy", this, LogoWindowClose);
    61           logoWindow->connectSignal("delete_event", this, LogoWindowClose);
    62           logoEventBox = new EventBox();
    63           logoBox = new Box('v');
    64           logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION);
    65           logoImage = new Image("banner.xpm");
    66           logoEventBox->fill(logoImage);
    67 
    68           logoBox->fill(logoLabel);
    69           logoBox->fill(logoEventBox);
    70           logoEventBox->connectSignal("button_press_event",this,LogoWindowClose);
    71 
    72           logoWindow->fill (logoBox);
    73          
    74         }
    75       //  showing Window //
    76       logoWindowIsOpen = 1;
    77      
    78      
    79       logoWindow->showall();
    80     }
     72  logoWindow->open();
    8173}
    8274
     
    8678void OrxonoxGuiBanner::logoWindowClose()
    8779{
    88   logoWindowIsOpen = 0;
    89   logoWindow->hide();
     80  logoWindow->close();
    9081}
    9182
     
    10697   \param banner the Object that holds the banner-logo-window
    10798*/
    108 gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)
     99gint OrxonoxGuiBanner::LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)
    109100{
    110   static_cast<OrxonoxGuiBanner*>(banner)->logoWindowNew();
     101  static_cast<OrxonoxGuiBanner*>(banner)->logoWindowOpen();
    111102}
    112103
     
    118109   \param banner the Object that holds the banner-logo-window
    119110*/
    120 gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner)
     111gint OrxonoxGuiBanner::LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner)
    121112{
    122113  static_cast<OrxonoxGuiBanner*>(banner)->logoWindowClose();
  • orxonox/trunk/gui/orxonox_gui_banner.h

    r2595 r3148  
    2323  // the logo Window
    2424  Window* logoWindow;
    25   int logoWindowIsOpen;
    2625  EventBox* logoEventBox;
    2726  Box* logoBox;
     
    3332  ~OrxonoxGuiBanner ();
    3433
    35   void logoWindowNew();
     34  void logoWindowOpen();
    3635  void logoWindowClose();
    3736  Widget* getWidget ();
     37
     38  static gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner);
     39  static gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner);
    3840};
    3941
    40 gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner);
    41 gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner);
    4242
    4343#endif /* _ORXONOX_GUI_BANNER_H */
  • orxonox/trunk/gui/orxonox_gui_gtk.cc

    r3147 r3148  
    239239/* WINDOW */
    240240
     241Window* Window::mainWindow = NULL;
     242
     243void Window::addWindow(Window* windowToAdd)
     244{
     245  if (!mainWindow)
     246    {
     247      mainWindow = windowToAdd;
     248      return;
     249    }
     250
     251  Widget* tmpWindow = mainWindow;
     252  while (tmpWindow->next)
     253    tmpWindow = tmpWindow->next;
     254  tmpWindow->next = windowToAdd;
     255 
     256  return;
     257}
     258     
     259
     260
    241261/**
    242262   \brief Creating a new Window without a Name
     
    264284void Window::init()
    265285{
     286  if (!mainWindow)
     287    mainWindow = this;
     288
    266289  isOpen = false;
    267290
     
    318341void Window::open()
    319342{
    320   isOpen = true;
    321   gtk_grab_add(widget);
     343  if (this != mainWindow)
     344    {
     345      isOpen = true;
     346      gtk_widget_show_all(widget);
     347      gtk_grab_add(widget);
     348    }
    322349}
    323350
     
    327354void Window::close()
    328355{
    329   isOpen = false;
    330   gtk_grab_remove(widget);
     356  if (this != mainWindow)
     357    {
     358      isOpen = false;
     359      gtk_grab_remove(widget);
     360      gtk_widget_hide (widget);
     361    }
    331362}
    332363
  • orxonox/trunk/gui/orxonox_gui_gtk.h

    r3147 r3148  
    8989  bool isOpen;
    9090 public:
     91  static Window* mainWindow;
     92  static void addWindow(Window* windowToAdd);
     93
    9194  static Window* lastWindow;
    9295  Window (void);
Note: See TracChangeset for help on using the changeset viewer.