Changeset 3147 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Dec 11, 2004, 3:08:34 PM (20 years ago)
- Location:
- orxonox/trunk/gui
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui.cc
r3144 r3147 22 22 main-programmer: Benjamin Grauer 23 23 24 ToDO: 25 way to start gui without GTK (textmode) 26 curl interface to Download cool stuff 27 28 make Windows grab Focus if it is open and release it when closed (only child-windows) 29 chain all the windows when starting the GUI (DANGER: performance!!) 30 31 widgets save themselve 32 good way to step through all the Widgets 33 ... many more ... 24 34 */ 25 35 26 #include < iostream.h>36 #include <gtk/gtkmain.h> 27 37 28 38 #include "orxonox_gui.h" … … 56 66 OrxonoxGui::OrxonoxGui (int argc, char *argv[]) 57 67 { 68 58 69 gtk_init (&argc, &argv); 59 70 gtk_rc_parse( "rc" ); -
orxonox/trunk/gui/orxonox_gui.h
r3144 r3147 11 11 #endif 12 12 13 #include <iostream> 14 using namespace std; 15 13 16 #include "orxonox_gui_gtk.h" 14 17 15 18 #include <stdlib.h> 16 #include <gtk/gtkmain.h>17 #include <gtk/gtkwindow.h>18 #include <gtk/gtkframe.h>19 #include <gtk/gtkhbox.h>20 #include <gtk/gtkvbox.h>21 #include <gtk/gtkbutton.h>22 #include <gtk/gtkcheckbutton.h>23 #include <gtk/gtkhscale.h>24 #include <gtk/gtkoptionmenu.h>25 #include <gtk/gtkmenu.h>26 #include <gtk/gtkmenuitem.h>27 #include <gtk/gtklabel.h>28 #include <gtk/gtkimage.h>29 #include <gtk/gtkeventbox.h>30 19 31 20 //! Class that creates the OrxonoxGui -
orxonox/trunk/gui/orxonox_gui_banner.cc
r2622 r3147 25 25 26 26 #include "orxonox_gui_banner.h" 27 #include <iostream.h>28 27 29 28 /** -
orxonox/trunk/gui/orxonox_gui_exec.cc
r2740 r3147 125 125 { 126 126 int counter = 0; 127 while (counter < depth && ((widget->is _option>0127 while (counter < depth && ((widget->isOption>0 128 128 && (static_cast<Option*>(widget)->saveable) ) 129 || (widget->is _option<0129 || (widget->isOption<0 130 130 && strcmp (static_cast<Packer*>(widget)->getGroupName(), "")))) 131 131 { … … 135 135 136 136 // check if it is a Packer, and if it is, check if it has a name and if there is something in it. 137 if (widget->is _option <0)137 if (widget->isOption <0) 138 138 { 139 139 if (strcmp (static_cast<Packer*>(widget)->getGroupName(), "")) … … 148 148 } 149 149 } 150 // if (widget->is _option == 0)150 // if (widget->isOption == 0) 151 151 // printf ("%s\n",widget->label); 152 if (widget->is _option >= 1)152 if (widget->isOption >= 1) 153 153 if (static_cast<Option*>(widget)->saveable) 154 154 { … … 219 219 void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue, int depth) 220 220 { 221 if (widget->is _option >= 1)221 if (widget->isOption >= 1) 222 222 if (!strcmp (static_cast<Option*>(widget)->label, variableName)) 223 223 static_cast<Option*>(widget)->value = variableValue; 224 224 225 if (widget->is _option < 0)225 if (widget->isOption < 0) 226 226 { 227 227 readFileText (static_cast<Packer*>(widget)->down, variableName, variableValue, depth+1); … … 246 246 } 247 247 248 if (widget->is _option < 0)248 if (widget->isOption < 0) 249 249 { 250 250 if (!strcmp(groupName, static_cast<Packer*>(widget)->getGroupName())) -
orxonox/trunk/gui/orxonox_gui_flags.cc
r3146 r3147 25 25 26 26 #include "orxonox_gui_flags.h" 27 #include <iostream.h>28 27 29 28 /** … … 74 73 void OrxonoxGuiFlags::FlagsText(Widget* widget) 75 74 { 76 if (widget->is _option >= 1)75 if (widget->isOption >= 1) 77 76 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->default_value && (strcmp (static_cast<Option*>(widget)->flag_name, "") || strcmp (static_cast<Option*>(widget)->flag_name_short, ""))) 78 77 { … … 87 86 strcat (flagText, static_cast<Option*>(widget)->flag_name); 88 87 } 89 if (static_cast<Option*>(widget)->is _option == 2)88 if (static_cast<Option*>(widget)->isOption == 2) 90 89 { 91 90 sprintf (flagText, "%s=%i", flagText, static_cast<Option*>(widget)->value); 92 91 } 93 92 } 94 switch (widget->is _option)93 switch (widget->isOption) 95 94 { 96 95 case -1: -
orxonox/trunk/gui/orxonox_gui_gtk.cc
r3146 r3147 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 1 27 #include <iostream> 2 28 3 29 #include "orxonox_gui_gtk.h" 30 31 4 32 using namespace std; 33 5 34 // temporarily. 6 35 #include "orxonox_gui_flags.h" … … 21 50 this->hide(); 22 51 // cout << "check if Packer: "<<this->label <<"\n"; 23 if (this->is _option < 0)52 if (this->isOption < 0) 24 53 { 25 54 // cout << "get Down "<<this->label <<"\n"; … … 109 138 { 110 139 function(this); 111 if (this->is _option < 0)140 if (this->isOption < 0) 112 141 { 113 142 static_cast<Packer*>(this)->down->walkThrough (function); … … 124 153 void Widget::listOptions (Widget* widget) 125 154 { 126 if (widget->is _option >= 1)155 if (widget->isOption >= 1) 127 156 cout << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl; 128 157 } … … 134 163 void Widget::setOptions (Widget* widget) 135 164 { 136 if (widget->is _option >= 1)165 if (widget->isOption >= 1) 137 166 static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl; 138 167 } … … 183 212 void Container::init (void) 184 213 { 185 is _option = -1;214 isOption = -1; 186 215 187 216 static_cast<Packer*>(this)->init(); … … 282 311 label=title; 283 312 gtk_window_set_title (GTK_WINDOW (widget), title); 313 } 314 315 /** 316 \brief opens up a Window and fixes the Focus to it 317 */ 318 void Window::open() 319 { 320 isOpen = true; 321 gtk_grab_add(widget); 322 } 323 324 /** 325 \brief closes up a Window and removes the Focus from it 326 */ 327 void Window::close() 328 { 329 isOpen = false; 330 gtk_grab_remove(widget); 284 331 } 285 332 … … 365 412 void EventBox::init(void) 366 413 { 367 is _option = -1;414 isOption = -1; 368 415 369 416 static_cast<Container*>(this)->init(); … … 408 455 void Box::init(char boxtype) 409 456 { 410 is _option = -2;457 isOption = -2; 411 458 412 459 static_cast<Packer*>(this)->init(); … … 461 508 void Image::init() 462 509 { 463 is _option = 0;510 isOption = 0; 464 511 465 512 static_cast<Widget*>(this)->init(); … … 531 578 void Button::init(void) 532 579 { 533 is _option = 0;580 isOption = 0; 534 581 535 582 static_cast<Option*>(this)->init(); … … 575 622 void CheckButton::init(void) 576 623 { 577 is _option = 1;624 isOption = 1; 578 625 579 626 static_cast<Option*>(this)->init(); … … 640 687 void Slider::init(int start, int end) 641 688 { 642 is _option = 2;689 isOption = 2; 643 690 644 691 static_cast<Option*>(this)->init(); … … 717 764 void Menu::init(void) 718 765 { 719 is _option = 2;766 isOption = 2; 720 767 721 768 static_cast<Option*>(this)->init(); … … 790 837 void Label::init(void) 791 838 { 792 is _option = 0;839 isOption = 0; 793 840 794 841 static_cast<Widget*>(this)->init(); -
orxonox/trunk/gui/orxonox_gui_gtk.h
r3146 r3147 2 2 #ifndef _ORXONOX_GUI_GTK_H 3 3 #define _ORXONOX_GUI_GTK_H 4 4 5 #include <gtk/gtkmain.h> 5 6 #include <gtk/gtkwindow.h> … … 17 18 #include <gtk/gtkeventbox.h> 18 19 19 20 20 //! This is the topmost object that can be displayed all others are derived from it. 21 21 class Widget … … 28 28 GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains. 29 29 void init(void); 30 int is _option; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3:float option, 4:char option, 5: char* option30 int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3:float option, 4:char option, 5: char* option 31 31 /** 32 \briefdefines is _option states32 \briefdefines isOption states 33 33 */ 34 34 enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2}; … … 96 96 void setTitle (char* title); 97 97 void showall (); 98 void open(); 99 void close(); 98 100 static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); 99 101 }; -
orxonox/trunk/gui/orxonox_gui_keys.cc
r2819 r3147 25 25 26 26 #include "orxonox_gui_keys.h" 27 #include <iostream.h>28 27 29 28 /**
Note: See TracChangeset
for help on using the changeset viewer.