Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/updater/src/gui/orxonox_gui_update.cc @ 3259

Last change on this file since 3259 was 3259, checked in by bensch, 19 years ago

orxonox/branches/updater: ProgressBar works, just a funny play-thing…

File size: 4.6 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_update.h"
27#include <iostream>
28#include <string>
29
30#include "orxonox_gui.h"
31#include <stdio.h>
32using namespace std;
33
34/**
35   \brief Creates an Audio-Frame
36*/
37OrxonoxGuiUpdate::OrxonoxGuiUpdate ()
38{
39  this->updateFrame = new Frame ("Update-Options:");
40  this->updateBox = new Box ('v');
41  this->updateWindowCreate ();
42
43  this->updateBox->fill(this->updateWindowGetButton());
44
45  this->updateFrame->fill(this->updateBox);
46}
47
48/**
49   \brief Return the Frame
50   \return Returns the Audio-frame
51*/
52Widget* OrxonoxGuiUpdate::getWidget ()
53{
54  return updateFrame;
55}
56
57void OrxonoxGuiUpdate::updateWindowCreate (void)
58{
59  updateWindow = new Window ("dampfen::update");   
60  Window::addWindow(updateWindow);
61  updateWindowBox = new Box ('v');
62
63  updateDataWindowCreate();
64  updateWindowBox->fill (updateDataWindowGetButton());
65  updateSourceWindowCreate();
66  updateWindowBox->fill (updateSourceWindowGetButton());
67 
68  // the close-Button of the Update Window.
69  updateWindowClose = new Button ("close");
70#ifdef HAVE_GTK2
71  updateWindowClose->connectSignal("button_press_event", updateWindow, Window::windowClose);
72#endif /* HAVE_GTK2 */
73  updateWindowBox->fill(updateWindowClose);
74  updateWindow->fill (updateWindowBox);
75
76
77  // crating the button that opens the Update Options
78#ifdef HAVE_GTK2
79  updateWindowButton = new Button ("update");
80  updateWindowButton->connectSignal("button_press_event", updateWindow, Window::windowOpen);
81  updateWindow->connectSignal("destroy", updateWindow, Window::windowClose);
82  updateWindow->connectSignal("delete_event", updateWindow, Window::windowClose);
83#endif /* HAVE_GTK2 */
84
85
86}
87
88/**
89   \returns A Pointer to the Button of the UpdaterWindow
90*/
91Button* OrxonoxGuiUpdate::updateWindowGetButton(void)
92{
93  return updateWindowButton;
94}
95
96void OrxonoxGuiUpdate::updateDataWindowCreate (void)
97{
98
99  updateData = new Button ("update orxonox::Data");
100
101#ifdef HAVE_GTK2
102  updateData->connectSignal("button_press_event", updateData, updateDataFunc);
103#endif /* HAVE_GTK2 */
104 
105
106}
107
108Button* OrxonoxGuiUpdate::updateDataWindowGetButton(void)
109{
110  return updateData;
111}
112
113void OrxonoxGuiUpdate::updateSourceWindowCreate (void)
114{
115  // the button, that opens this Window.
116  updateSource = new Button ("update orxonox::Source");
117
118  // the Window itself
119  updateSourceWindow = new Window ("update orxonox::Source");
120  updateSourceWindow->connectSignal("destroy", updateSourceWindow, Window::windowClose);
121  updateSourceWindow->connectSignal("delete_event", updateSourceWindow, Window::windowClose);
122
123  updateSourceWindowBox = new Box ();
124
125  updateSourceBar = new ProgressBar ();
126  updateSourceWindowBox->fill(updateSourceBar);
127  test = new Button ("increment");
128  test->connectSignal("button_press_event", updateSourceBar, updateSourceFunc);
129  updateSourceWindowBox->fill(test);
130  updateSourceWindow->fill(updateSourceWindowBox);
131#ifdef HAVE_GTK2
132  updateSource->connectSignal("button_press_event", updateSourceWindow, Window::windowOpen);
133#endif /* HAVE_GTK2 */
134
135}
136
137Button* OrxonoxGuiUpdate::updateSourceWindowGetButton(void)
138{
139  return updateSource;
140}
141
142
143#ifdef HAVE_GTK2
144/**
145   \brief updates the Data of orxonox.
146   \param w The widget, that executed this Function.
147   \param event The event that trigered this Function.
148   \param button The Button, that triggered this event.
149*/
150gint OrxonoxGuiUpdate::updateDataFunc(GtkWidget* w, GdkEventKey* event, void* button)
151{
152
153}
154
155/**
156   \brief updates the source of orxonox.
157   \param w The widget, that executed this Function.
158   \param event The event that trigered this Function.
159   \param button The Button, that triggered this event.
160*/
161gint OrxonoxGuiUpdate::updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* bar)
162{
163  ProgressBar* tmpBar = static_cast<ProgressBar*>(bar);
164  tmpBar->setTotalSize(20);
165  tmpBar->setProgress(tmpBar->getProgress()+1);
166}
167
168#endif /* HAVE_GTK2 */
Note: See TracBrowser for help on using the repository browser.