/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ### File Specific: main-programmer: Benjamin Grauer */ #include "orxonox_gui_update.h" #include #include #include "orxonox_gui.h" #include using namespace std; /** \brief Creates an Audio-Frame */ OrxonoxGuiUpdate::OrxonoxGuiUpdate () { this->updateFrame = new Frame ("Update-Options:"); this->updateFrame->setGroupName ("update"); this->updateBox = new Box ('v'); // the Button for autoUpdating this->autoUpdate = new CheckButton ("auto update"); this->updateBox->fill(this->autoUpdate); this->autoUpdate->setFlagName ("update", "u", 0); this->autoUpdate->saveable = true; this->updateSourceWindowCreate (); this->updateBox->fill(this->updateSourceWindowGetButton()); this->updateDataWindowCreate (); this->updateBox->fill(this->updateDataWindowGetButton()); this->updateFrame->fill(this->updateBox); } /** \brief Return the Frame \return Returns the Audio-frame */ Widget* OrxonoxGuiUpdate::getWidget () { return updateFrame; } void OrxonoxGuiUpdate::updateDataWindowCreate (void) { updateDataWindow = new Window ("update orxonox::Data"); updateDataBox = new Box ('v'); // the close-Button of the Update Window. // updateWindowClose = new Button ("close"); #ifdef HAVE_GTK2 // updateWindowClose->connectSignal("button_press_event", updateWindow, Window::windowClose); #endif /* HAVE_GTK2 */ // updateWindowBox->fill(updateWindowClose); updateDataBar = new ProgressBar (); updateDataBox->fill(updateDataBar); updateDataWindow->fill (updateDataBox); updateDataWindowButton = new Button ("update orxonox::Data"); #ifdef HAVE_GTK2 updateDataWindowButton->connectSignal("button_press_event", updateDataWindow, Window::windowOpen); updateDataWindow->connectSignal("destroy", updateDataWindow, Window::windowClose); updateDataWindow->connectSignal("delete_event", updateDataWindow, Window::windowClose); #endif /* HAVE_GTK2 */ } /** \returns A Pointer to the Button of the UpdaterWindow */ Button* OrxonoxGuiUpdate::updateDataWindowGetButton(void) { return updateDataWindowButton; } void OrxonoxGuiUpdate::updateSourceWindowCreate (void) { // the button, that opens this Window. updateSourceWindowButton = new Button ("update orxonox::Source"); // the Window itself updateSourceWindow = new Window ("update orxonox::Source"); updateSourceBox = new Box (); updateSourceBar = new ProgressBar (); updateSourceBox->fill(updateSourceBar); test = new Button ("increment"); #ifdef HAVE_GTK2 test->connectSignal("button_press_event", updateSourceBar, updateSourceFunc); #endif /* HAVE_GTK2 */ updateSourceBox->fill(test); updateSourceWindow->fill(updateSourceBox); #ifdef HAVE_GTK2 updateSourceWindowButton->connectSignal("button_press_event", updateSourceWindow, Window::windowOpen); updateSourceWindow->connectSignal("destroy", updateSourceWindow, Window::windowClose); updateSourceWindow->connectSignal("delete_event", updateSourceWindow, Window::windowClose); #endif /* HAVE_GTK2 */ } Button* OrxonoxGuiUpdate::updateSourceWindowGetButton(void) { return updateSourceWindowButton; } #ifdef HAVE_GTK2 /** \brief updates the Data of orxonox. \param w The widget, that executed this Function. \param event The event that trigered this Function. \param button The Button, that triggered this event. */ gint OrxonoxGuiUpdate::updateDataFunc(GtkWidget* w, GdkEventKey* event, void* button) { } /** \brief updates the source of orxonox. \param w The widget, that executed this Function. \param event The event that trigered this Function. \param button The Button, that triggered this event. */ gint OrxonoxGuiUpdate::updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* bar) { ProgressBar* tmpBar = static_cast(bar); tmpBar->setTotalSize(20); tmpBar->setProgress(tmpBar->getProgress()+1); } #endif /* HAVE_GTK2 */