Changeset 3300 in orxonox.OLD for orxonox/branches/updater/src
- Timestamp:
- Dec 27, 2004, 4:14:47 PM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui.cc
r3298 r3300 63 63 64 64 orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION); 65 #ifdef HAVE_GTK266 orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);67 orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);68 #endif /* HAVE_GTK2 */69 65 70 66 Box* windowBox = new Box ('h'); … … 108 104 orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0); 109 105 106 110 107 orxonoxGUI->showall (); 111 108 -
orxonox/branches/updater/src/gui/orxonox_gui.h
r3299 r3300 28 28 ~OrxonoxGui (); 29 29 30 void copyOptionsToGameStruct();31 30 }; 32 31 33 34 32 #endif /* _ORXONOX_GUI_H */ -
orxonox/branches/updater/src/gui/orxonox_gui_exec.cc
r3297 r3300 27 27 #include <iostream> 28 28 #include <string> 29 30 HashTable* orxonoxFlagHash; 29 31 30 32 /** … … 42 44 start = new Button ("Start"); 43 45 #ifdef HAVE_GTK2 44 start->connectSignal ("clicked", startOrxonox);46 start->connectSignal ("clicked", this, startOrxonox); 45 47 #endif /* HAVE_GTK2 */ 46 48 execBox->fill (start); … … 59 61 quit = new Button ("Quit"); 60 62 #ifdef HAVE_GTK2 61 quit->connectSignal ("clicked", orxonoxGUI->orxonox_gui_quit); 63 quit->connectSignal ("clicked", this, OrxonoxGuiExec::quitOrxonox); 64 orxonoxGUI->connectSignal ("destroy", this, OrxonoxGuiExec::quitOrxonox); 65 //! orxonoxGUI->connectSignal ("delete_event", this, OrxonoxGuiExec::quitOrxonox); \todo fix this to work. 62 66 #endif /* HAVE_GTK2 */ 63 67 execBox->fill (quit); … … 294 298 /** 295 299 \brief Starts ORXONOX. (not really implemented yet, but the function is there.\n 296 This is a Signal and can be executed through Widget::signal_connect297 300 \param widget the widget that executed the start command 298 301 \param data additional data 299 */ 300 int OrxonoxGuiExec::startOrxonox (GtkWidget* widget, Widget* data) 301 { 302 303 This is a Signal and can be executed through Widget::signal_connect 304 */ 305 int OrxonoxGuiExec::startOrxonox (GtkWidget* widget, void* data) 306 { 307 OrxonoxGuiExec* exec = (OrxonoxGuiExec*)data; 308 if (exec->shouldsave()) 309 exec->writeToFile (Window::mainWindow); 302 310 cout << "Starting Orxonox" <<endl; 303 } 304 #else /* HAVE_GTK2 */ 311 gtk_main_quit(); 312 system("cd ..;./orxonox"); //!< \todo fix this. should execute orxonox for real (coded not over the shell) 313 } 314 305 315 /** 306 316 \brief Starts ORXONOX. (not really implemented yet, but the function is there.\n 307 This is a Signal and can be executed through Widget::signal_connect308 317 \param widget the widget that executed the start command 309 318 \param data additional data 310 */ 311 int OrxonoxGuiExec::startOrxonox (void* widget, Widget* data) 312 { 313 cout << "Starting Orxonox" <<endl; 319 320 This is a Signal and can be executed through Widget::signal_connect 321 */ 322 int OrxonoxGuiExec::quitOrxonox (GtkWidget* widget, void* data) 323 { 324 OrxonoxGuiExec* exec = (OrxonoxGuiExec*)data; 325 PRINT(3)( "Quitting Orxonox %p\n", exec); 326 if (exec->shouldsave()) 327 exec->writeToFile (Window::mainWindow); 328 gtk_main_quit(); 329 } 330 #else /* HAVE_GTK2 */ 331 /** 332 \brief Starts ORXONOX. (not really implemented yet, but the function is there.\n 333 \param widget the widget that executed the start command 334 \param data additional data 335 */ 336 int OrxonoxGuiExec::startOrxonox (void* widget, void* data) 337 { 338 OrxonoxGuiExec* exec = (OrxonoxGuiExec*)data; 339 COUT(3) << "Starting Orxonox" <<endl; 340 if (exec->shouldsave()) 341 exec->writeToFile (Window::mainWindow); 342 } 343 /** 344 \brief Quits ORXONOX. 345 \param widget the widget that executed the Quit command 346 \param data additional data 347 348 This is a Signal and can be executed through Widget::signal_connect 349 */ 350 int OrxonoxGuiExec::quitOrxonox (void* widget, void* data) 351 { 352 OrxonoxGuiExec* exec = (OrxonoxGuiExec*)data; 353 COUT(3) << "Quiting Orxonox" <<endl; 354 if (exec->shouldsave()) 355 exec->writeToFile (Window::mainWindow); 314 356 } 315 357 -
orxonox/branches/updater/src/gui/orxonox_gui_exec.h
r3297 r3300 48 48 49 49 #ifdef HAVE_GTK2 50 static int startOrxonox (GtkWidget *widget, Widget* data); 50 static int startOrxonox (GtkWidget *widget, void* data); 51 static int quitOrxonox (GtkWidget *widget, void* data); 51 52 #else /* HAVE_GTK2 */ 52 static int startOrxonox (void* widget, Widget* data); 53 static int startOrxonox (void* widget, void* data); 54 static int quitOrxonox (void* widget, void* data); 53 55 #endif /* HAVE_GTK2 */ 54 56 }; 57 58 59 struct HashTable 60 { 61 char* name; 62 char* value; 63 HashTable* next; 64 }; 65 66 55 67 #endif /* _ORXONOX_GUI_EXEC_H */ -
orxonox/branches/updater/src/gui/orxonox_gui_flags.cc
r3299 r3300 72 72 \brief this actually sets the flagtext, and appends it to flagText 73 73 \param widget like OrxonoxGuiFlags::setTextFromFlags(widget) 74 \param flagInfo Information aboout the Flag that should be updated. 74 75 */ 75 76 void OrxonoxGuiFlags::flagsText(Widget* widget, void* flagInfo) -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3299 r3300 34 34 // temporarily. 35 35 #include "orxonox_gui_flags.h" 36 #include "orxonox_gui_exec.h"37 36 extern Window* orxonoxGUI; 38 37 extern OrxonoxGuiFlags* flags; 39 extern OrxonoxGuiExec* exec;40 38 41 39 #ifdef HAVE_GTK2 … … 306 304 \brief Connect a signal with additionally passing a whole external Object 307 305 */ 306 gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, void *)) 307 { 308 return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj); 309 } 310 311 /** 312 \brief Connect a signal with additionally passing a whole external Object 313 */ 308 314 gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *)) 309 315 { … … 615 621 } 616 622 617 /**618 * Quits the orxonox_GUI.619 * This can be called as a Signal and is therefor static620 \param widget The widget that called this function621 \param event the event that happened to execute this function622 \param data some data passed with the Signal623 */624 gint Window::orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data)625 {626 if (exec->shouldsave())627 exec->writeToFile (Window::mainWindow);628 629 gtk_main_quit();630 return FALSE;631 }632 623 #endif /* HAVE_GTK2 */ 633 624 -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.h
r3299 r3300 66 66 gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget* )); 67 67 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void* )); 68 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, void* )); 68 69 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void* )); 69 70 void disconnectSignal (gulong signalID); … … 149 150 static gint windowOpen(GtkWidget* widget, GdkEvent* event, void* window); 150 151 static gint windowClose(GtkWidget* widget, GdkEvent* event, void* window); 151 static gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data);152 152 #endif /* HAVE_GTK2 */ 153 153 };
Note: See TracChangeset
for help on using the changeset viewer.