- Timestamp:
- Dec 11, 2004, 6:09:26 PM (20 years ago)
- Location:
- orxonox/trunk/gui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui_banner.cc
r3149 r3153 35 35 bannerImage = new Image ("banner.xpm"); 36 36 bannerEventBox->fill(bannerImage); 37 bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen);38 37 39 38 // Banner Window // 40 39 logoWindow = new Window("Logo"); 41 logoWindow->connectSignal("destroy", this, LogoWindowClose); 42 logoWindow->connectSignal("delete_event", this, LogoWindowClose); 40 bannerEventBox->connectSignal ("button_press_event", logoWindow, Window::windowOpen); 41 42 43 logoWindow->connectSignal("destroy", logoWindow, Window::windowClose); 44 logoWindow->connectSignal("delete_event", logoWindow, Window::windowClose); 43 45 logoEventBox = new EventBox(); 44 46 logoBox = new Box('v'); … … 49 51 logoBox->fill(logoLabel); 50 52 logoBox->fill(logoEventBox); 51 logoEventBox->connectSignal("button_press_event", this,LogoWindowClose);53 logoEventBox->connectSignal("button_press_event",logoWindow, Window::windowClose); 52 54 53 55 logoWindow->fill (logoBox); … … 72 74 } 73 75 74 /**75 \brief opens up the banner-window.\n76 this is the Signal that does it. !!SIGNALS ARE STATIC!!77 \param widget the widget that did it!78 \param event the event that did it!79 \param banner the Object that holds the banner-logo-window80 */81 gint OrxonoxGuiBanner::LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)82 {83 static_cast<OrxonoxGuiBanner*>(banner)->logoWindow->open();84 }85 76 86 /**87 \brief closes the banner-window.\n88 this is the Signal that does it. !!SIGNALS ARE STATIC!!89 \param widget the widget that did it!90 \param event the event that did it!91 \param banner the Object that holds the banner-logo-window92 */93 gint OrxonoxGuiBanner::LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner)94 {95 static_cast<OrxonoxGuiBanner*>(banner)->logoWindow->close();96 97 } -
orxonox/trunk/gui/orxonox_gui_banner.h
r3150 r3153 34 34 Widget* getWidget (); 35 35 36 static gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner);37 static gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner);38 36 }; 39 37 -
orxonox/trunk/gui/orxonox_gui_gtk.cc
r3152 r3153 352 352 } 353 353 354 /** 355 \brief opens up a window (not topmost Window). 356 this is the Signal that does it. !!SIGNALS ARE STATIC!! 357 \param widget the widget that did it! 358 \param event the event that did it! 359 \param window the Window that should be opened 360 */ 361 gint Window::windowOpen (GtkWidget *widget, GdkEvent* event, void* window) 362 { 363 static_cast<Window*>(window)->open(); 364 } 365 366 /** 367 \brief closes a window (not topmost Window). 368 this is the Signal that does it. !!SIGNALS ARE STATIC!! 369 \param widget the widget that did it! 370 \param event the event that did it! 371 \param window the Window that should be closed 372 */ 373 gint Window::windowClose (GtkWidget *widget, GdkEvent* event, void* window) 374 { 375 static_cast<Window*>(window)->close(); 376 377 } 354 378 /** 355 379 * Quits the orxonox_GUI. -
orxonox/trunk/gui/orxonox_gui_gtk.h
r3152 r3153 97 97 98 98 void setTitle (char* title); 99 void showall (); 99 void showall (); 100 100 void open(); 101 101 void close(); 102 103 static gint windowOpen (GtkWidget *widget, GdkEvent* event, void* window); 104 static gint windowClose (GtkWidget *widget, GdkEvent* event, void* window); 102 105 static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); 103 106 }; -
orxonox/trunk/gui/orxonox_gui_keys.cc
r3152 r3153 57 57 Player::Player(char* player) 58 58 { 59 openButton = new Button (player);60 openButton->connectSignal("button_press_event", this, openWindowEvent);61 59 62 60 pKeyWindow = new Window("keys of player"); … … 69 67 70 68 closeButton = new Button("close"); 71 closeButton->connectSignal("button_press_event", this, closeWindowEvent);69 closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose); 72 70 pKeysBox->fill(closeButton); 73 71 pKeyWindow->fill(pKeysBox); 74 72 // Window::addWindow(pKeyWindow); 73 74 openButton = new Button (player); 75 openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen); 76 75 77 } 76 78 … … 100 102 } 101 103 102 gint Player::openWindowEvent (GtkWidget* widget, GdkEvent* event, void* player)103 {104 static_cast<Player*>(player)->pKeyWindow->open();105 }106 107 gint Player::closeWindowEvent (GtkWidget* widget, GdkEvent* event, void* player)108 {109 static_cast<Player*>(player)->pKeyWindow->close();110 }111 112 104 /** 113 105 \brief Function which gets keystrokes -
orxonox/trunk/gui/orxonox_gui_keys.h
r3152 r3153 54 54 Button* getOpenButton(); 55 55 56 static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);57 static gint closeWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);58 56 static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget); 59 57 void setkey(KEYS key);
Note: See TracChangeset
for help on using the changeset viewer.