Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/gui/orxonox_gui_banner.cc @ 2588

Last change on this file since 2588 was 2588, checked in by bensch, 20 years ago

orxonox/trunk/gui: doxygen orxodox created for all h-files, classes and functions.

File size: 3.1 KB
Line 
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
26#include "orxonox_gui_banner.h"
27#include <iostream.h>
28
29/**
30   \brief Creates a new BannerEventBox and its content.
31*/
32OrxonoxGuiBanner::OrxonoxGuiBanner ()
33{
34  bannerEventBox = new EventBox ("BannerEventBox");
35  bannerImage = new Image ("banner.xpm");
36  bannerEventBox->fill(bannerImage);
37  bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen);
38  logoWindowIsOpen = -1;
39}
40
41/**
42   \brief Destructs it.
43*/
44OrxonoxGuiBanner::~OrxonoxGuiBanner ()
45{
46}
47
48/**
49    \brief Opens up our LOGO-Window.\n
50    it creates a new one if it has not yet been opened.\n
51    it shows it if it has been created
52*/
53void OrxonoxGuiBanner::logoWindowNew()
54{
55  if (logoWindowIsOpen <= 0)
56    {
57      if (logoWindowIsOpen < 0)
58        {
59          // creating new Logo Window //
60          logoWindow = new Window("Logo");
61          logoWindow->connectSignal("destroy", this, LogoWindowClose);
62          logoWindow->connectSignal("delete_event", this, LogoWindowClose);
63          logoEventBox = new EventBox();
64          logoImage = new Image("banner.xpm");
65          logoEventBox->fill(logoImage);
66          logoEventBox->connectSignal("button_press_event",this,LogoWindowClose);
67
68          logoWindow->fill (logoEventBox);
69         
70        }
71      //  showing Window //
72      logoWindowIsOpen = 1;
73     
74     
75      logoWindow->showall();
76    }
77}
78
79/**
80   \brief Hides Window through ~Window();
81*/
82void OrxonoxGuiBanner::logoWindowClose()
83{
84  logoWindowIsOpen = 0;
85  logoWindow->~Window();
86}
87
88/**
89   \brief Returns an EventBox
90   \return The EventBox, that holds the Banner.
91*/
92EventBox* OrxonoxGuiBanner::getEventBox ()
93{
94  return bannerEventBox;
95}
96
97/**
98   \brief opens up the banner-window.\n
99   this is the Signal that does it. !!SIGNALS ARE STATIC!!
100   \param widget the widget that did it!
101   \param event the event that did it!
102   \param banner the Object that holds the banner-logo-window
103*/
104gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)
105{
106  static_cast<OrxonoxGuiBanner*>(banner)->logoWindowNew();
107}
108
109/**
110   \brief closes the banner-window.\n
111   this is the Signal that does it. !!SIGNALS ARE STATIC!!
112   \param widget the widget that did it!
113   \param event the event that did it!
114   \param banner the Object that holds the banner-logo-window
115*/
116gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner)
117{
118  static_cast<OrxonoxGuiBanner*>(banner)->logoWindowClose();
119 
120}
Note: See TracBrowser for help on using the repository browser.