Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk/gui: typo, toDo and so on

File size: 3.2 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
28/**
29   \brief Creates a new BannerEventBox and its content.
30*/
31OrxonoxGuiBanner::OrxonoxGuiBanner ()
32{
33  bannerEventBox = new EventBox ("BannerEventBox");
34  bannerImage = new Image ("banner.xpm");
35  bannerEventBox->fill(bannerImage);
36  bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen);
37  logoWindowIsOpen = -1;
38}
39
40/**
41   \brief Destructs it.
42*/
43OrxonoxGuiBanner::~OrxonoxGuiBanner ()
44{
45}
46
47/**
48    \brief Opens up our LOGO-Window.\n
49    it creates a new one if it has not yet been opened.\n
50    it shows it if it has been created
51*/
52void OrxonoxGuiBanner::logoWindowNew()
53{
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    }
81}
82
83/**
84   \brief Hides Window through ~Window();
85*/
86void OrxonoxGuiBanner::logoWindowClose()
87{
88  logoWindowIsOpen = 0;
89  logoWindow->hide();
90}
91
92/**
93   \brief Returns an EventBox
94   \return The EventBox, that holds the Banner.
95*/
96Widget* OrxonoxGuiBanner::getWidget ()
97{
98  return bannerEventBox;
99}
100
101/**
102   \brief opens up the banner-window.\n
103   this is the Signal that does it. !!SIGNALS ARE STATIC!!
104   \param widget the widget that did it!
105   \param event the event that did it!
106   \param banner the Object that holds the banner-logo-window
107*/
108gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)
109{
110  static_cast<OrxonoxGuiBanner*>(banner)->logoWindowNew();
111}
112
113/**
114   \brief closes the banner-window.\n
115   this is the Signal that does it. !!SIGNALS ARE STATIC!!
116   \param widget the widget that did it!
117   \param event the event that did it!
118   \param banner the Object that holds the banner-logo-window
119*/
120gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner)
121{
122  static_cast<OrxonoxGuiBanner*>(banner)->logoWindowClose();
123 
124}
Note: See TracBrowser for help on using the repository browser.