Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/branches/updater: better update presentation. only one sub-window

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->updateFrame->setGroupName ("update");
41  this->updateBox = new Box ('v');
42
43  // the Button for autoUpdating
44  this->autoUpdate = new CheckButton ("auto update");
45  this->updateBox->fill(this->autoUpdate);
46  this->autoUpdate->setFlagName ("update", "u", 0);
47  this->autoUpdate->saveable = true;
48
49  this->updateSourceWindowCreate ();
50  this->updateBox->fill(this->updateSourceWindowGetButton());
51
52  this->updateDataWindowCreate ();
53  this->updateBox->fill(this->updateDataWindowGetButton());
54
55  this->updateFrame->fill(this->updateBox);
56}
57
58/**
59   \brief Return the Frame
60   \return Returns the Audio-frame
61*/
62Widget* OrxonoxGuiUpdate::getWidget ()
63{
64  return updateFrame;
65}
66
67void OrxonoxGuiUpdate::updateDataWindowCreate (void)
68{
69  updateDataWindow = new Window ("update orxonox::Data");   
70  updateDataBox = new Box ('v');
71
72  // the close-Button of the Update Window.
73  //  updateWindowClose = new Button ("close");
74#ifdef HAVE_GTK2
75  //  updateWindowClose->connectSignal("button_press_event", updateWindow, Window::windowClose);
76#endif /* HAVE_GTK2 */
77  //  updateWindowBox->fill(updateWindowClose);
78
79  updateDataBar = new ProgressBar ();
80  updateDataBox->fill(updateDataBar);
81  updateDataWindow->fill (updateDataBox);
82
83  updateDataWindowButton = new Button ("update orxonox::Data");
84#ifdef HAVE_GTK2
85  updateDataWindowButton->connectSignal("button_press_event", updateDataWindow, Window::windowOpen);
86  updateDataWindow->connectSignal("destroy", updateDataWindow, Window::windowClose);
87  updateDataWindow->connectSignal("delete_event", updateDataWindow, Window::windowClose);
88#endif /* HAVE_GTK2 */
89
90}
91
92/**
93   \returns A Pointer to the Button of the UpdaterWindow
94*/
95Button* OrxonoxGuiUpdate::updateDataWindowGetButton(void)
96{
97  return updateDataWindowButton;
98}
99
100void OrxonoxGuiUpdate::updateSourceWindowCreate (void)
101{
102  // the button, that opens this Window.
103  updateSourceWindowButton = new Button ("update orxonox::Source");
104
105  // the Window itself
106  updateSourceWindow = new Window ("update orxonox::Source");
107
108  updateSourceBox = new Box ();
109
110  updateSourceBar = new ProgressBar ();
111  updateSourceBox->fill(updateSourceBar);
112  test = new Button ("increment");
113
114#ifdef HAVE_GTK2
115  test->connectSignal("button_press_event", updateSourceBar, updateSourceFunc);
116#endif /* HAVE_GTK2 */
117
118  updateSourceBox->fill(test);
119  updateSourceWindow->fill(updateSourceBox); 
120#ifdef HAVE_GTK2
121  updateSourceWindowButton->connectSignal("button_press_event", updateSourceWindow, Window::windowOpen);
122  updateSourceWindow->connectSignal("destroy", updateSourceWindow, Window::windowClose);
123  updateSourceWindow->connectSignal("delete_event", updateSourceWindow, Window::windowClose);
124#endif /* HAVE_GTK2 */
125
126}
127
128Button* OrxonoxGuiUpdate::updateSourceWindowGetButton(void)
129{
130  return updateSourceWindowButton;
131}
132
133
134#ifdef HAVE_GTK2
135/**
136   \brief updates the Data of orxonox.
137   \param w The widget, that executed this Function.
138   \param event The event that trigered this Function.
139   \param button The Button, that triggered this event.
140*/
141gint OrxonoxGuiUpdate::updateDataFunc(GtkWidget* w, GdkEventKey* event, void* button)
142{
143
144}
145
146/**
147   \brief updates the source of orxonox.
148   \param w The widget, that executed this Function.
149   \param event The event that trigered this Function.
150   \param button The Button, that triggered this event.
151*/
152gint OrxonoxGuiUpdate::updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* bar)
153{
154  ProgressBar* tmpBar = static_cast<ProgressBar*>(bar);
155  tmpBar->setTotalSize(20);
156  tmpBar->setProgress(tmpBar->getProgress()+1);
157}
158
159#endif /* HAVE_GTK2 */
Note: See TracBrowser for help on using the repository browser.