Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9554 in orxonox.OLD for branches/proxy/src/lib/gui


Ignore:
Timestamp:
Jul 28, 2006, 12:07:51 PM (18 years ago)
Author:
bensch
Message:

event-listening

Location:
branches/proxy/src/lib/gui/gl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/gui/gl/glgui_fixedposition_box.cc

    r9549 r9554  
    2828  GLGuiFixedpositionBox::GLGuiFixedpositionBox (OrxGui::Position position, OrxGui::Orientation orientation)
    2929      : GLGuiBox(orientation)
    30   {}
     30  {
     31    this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE);
     32  }
    3133
    3234
     
    4547    {
    4648      case OrxGui::Center:
    47         this->setAbsCoor2D(GLGuiHandler::getInstance()->resolution() - this->getSize2D() / 2.0);
     49        this->setAbsCoor2D(GLGuiHandler::getInstance()->resolution()/2.0 - this->getSize2D() / 2.0);
    4850        break;
    4951      default:
     
    5658  }
    5759
     60  void GLGuiFixedpositionBox::process(const Event& event)
     61  {
     62    switch(event.type)
     63    {
     64      case EV_VIDEO_RESIZE:
     65        this->resize();
     66        break;
     67
     68    }
     69
     70  }
     71
     72
    5873}
  • branches/proxy/src/lib/gui/gl/glgui_fixedposition_box.h

    r9549 r9554  
    88
    99#include "glgui_box.h"
     10#include "event_listener.h"
    1011
    1112namespace OrxGui
     
    1516   *
    1617   */
    17   class GLGuiFixedpositionBox : public OrxGui::GLGuiBox
     18  class GLGuiFixedpositionBox : public OrxGui::GLGuiBox, EventListener
    1819  {
    1920
     
    2627    protected:
    2728      virtual void resize();
     29      virtual void process(const Event& event); //!< from eventListener
    2830
    2931    private:
  • branches/proxy/src/lib/gui/gl/glgui_handler.cc

    r9546 r9554  
    4444    this->setName("GLGuiHandler");
    4545
     46    this->_resolution = Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY());
    4647
    4748    EventHandler::getInstance()->withUNICODE(ES_MENU, true );
     
    9192  void GLGuiHandler::activate()
    9293  {
    93     this->_resolution = Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY());
    9494    //EventHandler::getInstance()->pushState(ES_MENU);
    9595
Note: See TracChangeset for help on using the changeset viewer.