Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3153 in orxonox.OLD


Ignore:
Timestamp:
Dec 11, 2004, 6:09:26 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: more modular.

Location:
orxonox/trunk/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/gui/orxonox_gui_banner.cc

    r3149 r3153  
    3535  bannerImage = new Image ("banner.xpm");
    3636  bannerEventBox->fill(bannerImage);
    37   bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen);
    3837
    3938  // Banner Window //
    4039  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);
    4345  logoEventBox = new EventBox();
    4446  logoBox = new Box('v');
     
    4951  logoBox->fill(logoLabel);
    5052  logoBox->fill(logoEventBox);
    51   logoEventBox->connectSignal("button_press_event",this,LogoWindowClose);
     53  logoEventBox->connectSignal("button_press_event",logoWindow, Window::windowClose);
    5254 
    5355  logoWindow->fill (logoBox);
     
    7274}
    7375
    74 /**
    75    \brief opens up the banner-window.\n
    76    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-window
    80 */
    81 gint OrxonoxGuiBanner::LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)
    82 {
    83   static_cast<OrxonoxGuiBanner*>(banner)->logoWindow->open();
    84 }
    8576
    86 /**
    87    \brief closes the banner-window.\n
    88    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-window
    92 */
    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  
    3434  Widget* getWidget ();
    3535
    36   static gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner);
    37   static gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner);
    3836};
    3937
  • orxonox/trunk/gui/orxonox_gui_gtk.cc

    r3152 r3153  
    352352}
    353353
     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*/
     361gint 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*/
     373gint Window::windowClose (GtkWidget *widget, GdkEvent* event, void* window)
     374{
     375  static_cast<Window*>(window)->close();
     376 
     377}
    354378/**
    355379 * Quits the orxonox_GUI.
  • orxonox/trunk/gui/orxonox_gui_gtk.h

    r3152 r3153  
    9797 
    9898  void setTitle (char* title);
    99   void showall (); 
     99  void showall ();
    100100  void open();
    101101  void close();
     102
     103  static gint windowOpen (GtkWidget *widget, GdkEvent* event, void* window);
     104  static gint windowClose (GtkWidget *widget, GdkEvent* event, void* window);
    102105  static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
    103106};
  • orxonox/trunk/gui/orxonox_gui_keys.cc

    r3152 r3153  
    5757Player::Player(char* player)
    5858{
    59   openButton = new Button (player);
    60   openButton->connectSignal("button_press_event", this, openWindowEvent);
    6159
    6260  pKeyWindow = new Window("keys of player");
     
    6967   
    7068    closeButton = new Button("close");
    71     closeButton->connectSignal("button_press_event", this, closeWindowEvent);
     69    closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
    7270    pKeysBox->fill(closeButton);
    7371   pKeyWindow->fill(pKeysBox);
    7472   //  Window::addWindow(pKeyWindow);
     73
     74  openButton = new Button (player);
     75  openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen);
     76
    7577}
    7678
     
    100102}
    101103
    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 
    112104/**
    113105   \brief Function which gets keystrokes
  • orxonox/trunk/gui/orxonox_gui_keys.h

    r3152 r3153  
    5454  Button* getOpenButton();
    5555
    56   static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);
    57   static gint closeWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);
    5856  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget);
    5957  void setkey(KEYS key);
Note: See TracChangeset for help on using the changeset viewer.