[2581] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | This program is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with this program; if not, write to the Free Software Foundation, |
---|
| 18 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | ### File Specific: |
---|
| 22 | main-programmer: Benjamin Grauer |
---|
| 23 | |
---|
| 24 | */ |
---|
| 25 | |
---|
[2580] | 26 | #include "orxonox_gui_banner.h" |
---|
| 27 | |
---|
[2588] | 28 | /** |
---|
| 29 | \brief Creates a new BannerEventBox and its content. |
---|
| 30 | */ |
---|
[2580] | 31 | OrxonoxGuiBanner::OrxonoxGuiBanner () |
---|
| 32 | { |
---|
[3148] | 33 | // Banner Itself // |
---|
[2581] | 34 | bannerEventBox = new EventBox ("BannerEventBox"); |
---|
[2580] | 35 | bannerImage = new Image ("banner.xpm"); |
---|
| 36 | bannerEventBox->fill(bannerImage); |
---|
[2581] | 37 | bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen); |
---|
[3148] | 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); |
---|
[2581] | 56 | } |
---|
[2580] | 57 | |
---|
[2588] | 58 | /** |
---|
| 59 | \brief Destructs it. |
---|
| 60 | */ |
---|
[2581] | 61 | OrxonoxGuiBanner::~OrxonoxGuiBanner () |
---|
| 62 | { |
---|
| 63 | } |
---|
[2580] | 64 | |
---|
[2588] | 65 | /** |
---|
| 66 | \brief Opens up our LOGO-Window.\n |
---|
| 67 | it creates a new one if it has not yet been opened.\n |
---|
| 68 | it shows it if it has been created |
---|
| 69 | */ |
---|
[3148] | 70 | void OrxonoxGuiBanner::logoWindowOpen() |
---|
[2581] | 71 | { |
---|
[3148] | 72 | logoWindow->open(); |
---|
[2580] | 73 | } |
---|
[2588] | 74 | |
---|
| 75 | /** |
---|
| 76 | \brief Hides Window through ~Window(); |
---|
| 77 | */ |
---|
[2581] | 78 | void OrxonoxGuiBanner::logoWindowClose() |
---|
[2580] | 79 | { |
---|
[3148] | 80 | logoWindow->close(); |
---|
[2580] | 81 | } |
---|
| 82 | |
---|
[2588] | 83 | /** |
---|
| 84 | \brief Returns an EventBox |
---|
| 85 | \return The EventBox, that holds the Banner. |
---|
| 86 | */ |
---|
[2595] | 87 | Widget* OrxonoxGuiBanner::getWidget () |
---|
[2580] | 88 | { |
---|
| 89 | return bannerEventBox; |
---|
| 90 | } |
---|
| 91 | |
---|
[2588] | 92 | /** |
---|
| 93 | \brief opens up the banner-window.\n |
---|
| 94 | this is the Signal that does it. !!SIGNALS ARE STATIC!! |
---|
| 95 | \param widget the widget that did it! |
---|
| 96 | \param event the event that did it! |
---|
| 97 | \param banner the Object that holds the banner-logo-window |
---|
| 98 | */ |
---|
[3148] | 99 | gint OrxonoxGuiBanner::LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner) |
---|
[2580] | 100 | { |
---|
[3148] | 101 | static_cast<OrxonoxGuiBanner*>(banner)->logoWindowOpen(); |
---|
[2580] | 102 | } |
---|
| 103 | |
---|
[2588] | 104 | /** |
---|
| 105 | \brief closes the banner-window.\n |
---|
| 106 | this is the Signal that does it. !!SIGNALS ARE STATIC!! |
---|
| 107 | \param widget the widget that did it! |
---|
| 108 | \param event the event that did it! |
---|
| 109 | \param banner the Object that holds the banner-logo-window |
---|
| 110 | */ |
---|
[3148] | 111 | gint OrxonoxGuiBanner::LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner) |
---|
[2581] | 112 | { |
---|
| 113 | static_cast<OrxonoxGuiBanner*>(banner)->logoWindowClose(); |
---|
| 114 | |
---|
| 115 | } |
---|