/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ### File Specific: main-programmer: Benjamin Grauer */ #include "orxonox_gui_banner.h" #include /** \brief Creates a new BannerEventBox and its content. */ OrxonoxGuiBanner::OrxonoxGuiBanner () { bannerEventBox = new EventBox ("BannerEventBox"); bannerImage = new Image ("banner.xpm"); bannerEventBox->fill(bannerImage); bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen); logoWindowIsOpen = -1; } /** \brief Destructs it. */ OrxonoxGuiBanner::~OrxonoxGuiBanner () { } /** \brief Opens up our LOGO-Window.\n it creates a new one if it has not yet been opened.\n it shows it if it has been created */ void OrxonoxGuiBanner::logoWindowNew() { if (logoWindowIsOpen <= 0) { if (logoWindowIsOpen < 0) { // creating new Logo Window // logoWindow = new Window("Logo"); logoWindow->connectSignal("destroy", this, LogoWindowClose); logoWindow->connectSignal("delete_event", this, LogoWindowClose); logoEventBox = new EventBox(); logoBox = new Box('v'); logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION); logoImage = new Image("banner.xpm"); logoEventBox->fill(logoImage); logoBox->fill(logoLabel); logoBox->fill(logoEventBox); logoEventBox->connectSignal("button_press_event",this,LogoWindowClose); logoWindow->fill (logoBox); } // showing Window // logoWindowIsOpen = 1; logoWindow->showall(); } } /** \brief Hides Window through ~Window(); */ void OrxonoxGuiBanner::logoWindowClose() { logoWindowIsOpen = 0; logoWindow->hide(); } /** \brief Returns an EventBox \return The EventBox, that holds the Banner. */ Widget* OrxonoxGuiBanner::getWidget () { return bannerEventBox; } /** \brief opens up the banner-window.\n this is the Signal that does it. !!SIGNALS ARE STATIC!! \param widget the widget that did it! \param event the event that did it! \param banner the Object that holds the banner-logo-window */ gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner) { static_cast(banner)->logoWindowNew(); } /** \brief closes the banner-window.\n this is the Signal that does it. !!SIGNALS ARE STATIC!! \param widget the widget that did it! \param event the event that did it! \param banner the Object that holds the banner-logo-window */ gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner) { static_cast(banner)->logoWindowClose(); }