[3250] | 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> |
---|
| 32 | using namespace std; |
---|
| 33 | |
---|
| 34 | /** |
---|
| 35 | \brief Creates an Audio-Frame |
---|
| 36 | */ |
---|
| 37 | OrxonoxGuiUpdate::OrxonoxGuiUpdate () |
---|
| 38 | { |
---|
[3253] | 39 | this->updateFrame = new Frame ("Update-Options:"); |
---|
| 40 | this->updateBox = new Box ('v'); |
---|
| 41 | this->updateWindowCreate (); |
---|
[3250] | 42 | |
---|
[3253] | 43 | this->updateBox->fill(this->updateWindowGetButton()); |
---|
| 44 | |
---|
| 45 | this->updateFrame->fill(this->updateBox); |
---|
[3250] | 46 | } |
---|
| 47 | |
---|
| 48 | /** |
---|
| 49 | \brief Return the Frame |
---|
| 50 | \return Returns the Audio-frame |
---|
| 51 | */ |
---|
| 52 | Widget* OrxonoxGuiUpdate::getWidget () |
---|
| 53 | { |
---|
| 54 | return updateFrame; |
---|
| 55 | } |
---|
[3253] | 56 | |
---|
| 57 | void OrxonoxGuiUpdate::updateWindowCreate (void) |
---|
| 58 | { |
---|
[3257] | 59 | updateWindow = new Window ("dampfen::update"); |
---|
| 60 | Window::addWindow(updateWindow); |
---|
[3253] | 61 | |
---|
| 62 | updateWindowBox = new Box ('v'); |
---|
| 63 | |
---|
[3255] | 64 | updateData = new Button ("update orxonox::Data"); |
---|
[3253] | 65 | |
---|
[3254] | 66 | #ifdef HAVE_GTK2 |
---|
| 67 | updateData->connectSignal("button_press_event", updateData, updateDataFunc); |
---|
| 68 | #endif /* HAVE_GTK2 */ |
---|
[3257] | 69 | updateWindowBox->fill (updateData); |
---|
[3254] | 70 | |
---|
[3255] | 71 | updateSource = new Button ("update orxonox::Source"); |
---|
[3254] | 72 | #ifdef HAVE_GTK2 |
---|
| 73 | updateSource->connectSignal("button_press_event", updateData, updateSourceFunc); |
---|
| 74 | #endif /* HAVE_GTK2 */ |
---|
[3253] | 75 | updateWindowBox->fill (updateSource); |
---|
[3257] | 76 | |
---|
| 77 | // the close-Button of the Update Window. |
---|
| 78 | updateWindowClose = new Button ("close"); |
---|
| 79 | #ifdef HAVE_GTK2 |
---|
| 80 | updateWindowClose->connectSignal("button_press_event", updateWindow, Window::windowClose); |
---|
| 81 | #endif /* HAVE_GTK2 */ |
---|
| 82 | updateWindowBox->fill(updateWindowClose); |
---|
[3253] | 83 | updateWindow->fill (updateWindowBox); |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | // crating the button that opens the Update Options |
---|
[3254] | 87 | #ifdef HAVE_GTK2 |
---|
[3253] | 88 | updateWindowButton = new Button ("update"); |
---|
| 89 | updateWindowButton->connectSignal("button_press_event", updateWindow, Window::windowOpen); |
---|
| 90 | updateWindow->connectSignal("destroy", updateWindow, Window::windowClose); |
---|
| 91 | updateWindow->connectSignal("delete_event", updateWindow, Window::windowClose); |
---|
| 92 | #endif /* HAVE_GTK2 */ |
---|
| 93 | |
---|
[3254] | 94 | |
---|
[3253] | 95 | } |
---|
| 96 | |
---|
[3258] | 97 | /** |
---|
| 98 | \returns A Pointer to the Button of the UpdaterWindow |
---|
| 99 | */ |
---|
[3253] | 100 | Button* OrxonoxGuiUpdate::updateWindowGetButton(void) |
---|
| 101 | { |
---|
| 102 | return updateWindowButton; |
---|
| 103 | } |
---|
[3254] | 104 | |
---|
| 105 | |
---|
| 106 | #ifdef HAVE_GTK2 |
---|
[3258] | 107 | /** |
---|
| 108 | \brief updates the Data of orxonox. |
---|
| 109 | \param w The widget, that executed this Function. |
---|
| 110 | \param event The event that trigered this Function. |
---|
| 111 | \param button The Button, that triggered this event. |
---|
| 112 | */ |
---|
[3254] | 113 | gint OrxonoxGuiUpdate::updateDataFunc(GtkWidget* w, GdkEventKey* event, void* button) |
---|
| 114 | { |
---|
| 115 | |
---|
| 116 | } |
---|
| 117 | |
---|
[3258] | 118 | /** |
---|
| 119 | \brief updates the source of orxonox. |
---|
| 120 | \param w The widget, that executed this Function. |
---|
| 121 | \param event The event that trigered this Function. |
---|
| 122 | \param button The Button, that triggered this event. |
---|
| 123 | */ |
---|
[3254] | 124 | gint OrxonoxGuiUpdate::updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* button) |
---|
| 125 | { |
---|
| 126 | |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | #endif /* HAVE_GTK2 */ |
---|