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 | OrxonoxGuiBanner::OrxonoxGuiBanner () |
---|
30 | { |
---|
31 | bannerEventBox = new EventBox ("BannerEventBox"); |
---|
32 | bannerImage = new Image ("banner.xpm"); |
---|
33 | bannerEventBox->fill(bannerImage); |
---|
34 | bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen); |
---|
35 | logoWindowIsOpen = -1; |
---|
36 | } |
---|
37 | |
---|
38 | OrxonoxGuiBanner::~OrxonoxGuiBanner () |
---|
39 | { |
---|
40 | } |
---|
41 | |
---|
42 | void OrxonoxGuiBanner::logoWindowNew() |
---|
43 | { |
---|
44 | if (logoWindowIsOpen <= 0) |
---|
45 | { |
---|
46 | if (logoWindowIsOpen < 0) |
---|
47 | { |
---|
48 | // creating new Logo Window // |
---|
49 | logoWindow = new Window("Logo"); |
---|
50 | logoWindow->connectSignal("destroy", this, LogoWindowClose); |
---|
51 | logoWindow->connectSignal("delete_event", this, LogoWindowClose); |
---|
52 | logoEventBox = new EventBox(); |
---|
53 | logoImage = new Image("banner.xpm"); |
---|
54 | logoEventBox->fill(logoImage); |
---|
55 | logoEventBox->connectSignal("button_press_event",this,LogoWindowClose); |
---|
56 | |
---|
57 | logoWindow->fill (logoEventBox); |
---|
58 | |
---|
59 | } |
---|
60 | // showing Window // |
---|
61 | logoWindowIsOpen = 1; |
---|
62 | |
---|
63 | |
---|
64 | logoWindow->showall(); |
---|
65 | } |
---|
66 | } |
---|
67 | void OrxonoxGuiBanner::logoWindowClose() |
---|
68 | { |
---|
69 | logoWindowIsOpen = 0; |
---|
70 | logoWindow->~Window(); |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | EventBox* OrxonoxGuiBanner::getEventBox () |
---|
76 | { |
---|
77 | return bannerEventBox; |
---|
78 | } |
---|
79 | |
---|
80 | gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner) |
---|
81 | { |
---|
82 | //cout << data->is_option<<"\n"; |
---|
83 | static_cast<OrxonoxGuiBanner*>(banner)->logoWindowNew(); |
---|
84 | } |
---|
85 | |
---|
86 | gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner) |
---|
87 | { |
---|
88 | static_cast<OrxonoxGuiBanner*>(banner)->logoWindowClose(); |
---|
89 | |
---|
90 | } |
---|