Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/gl/glgui_fixedposition_box.cc @ 9836

Last change on this file since 9836 was 9656, checked in by bensch, 18 years ago

orxonox/trunk: merged the proxy bache back with no conflicts

File size: 1.4 KB
Line 
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   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
17
18#include "glgui_fixedposition_box.h"
19#include "glgui_handler.h"
20
21#include <cassert>
22
23namespace OrxGui
24{
25  /**
26   * standard constructor
27  */
28  GLGuiFixedpositionBox::GLGuiFixedpositionBox (OrxGui::Position position, OrxGui::Orientation orientation)
29      : GLGuiBox(orientation)
30  {
31    this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE);
32    this->setPosition(position);
33  }
34
35
36  void GLGuiFixedpositionBox::setPosition(OrxGui::Position position)
37  {
38    this->_position = position;
39    this->resize();
40  }
41
42
43  void GLGuiFixedpositionBox::resize()
44  {
45    GLGuiBox::resize();
46
47    switch (this->_position)
48    {
49      case OrxGui::Center:
50        this->setAbsCoor2D((GLGuiHandler::getInstance()->resolution() - this->getSize2D()) / 2.0);
51        break;
52      default:
53        printf("not done mode yet!!\n");
54    }
55  }
56
57  void GLGuiFixedpositionBox::process(const Event& event)
58  {
59    switch(event.type)
60    {
61      case EV_VIDEO_RESIZE:
62        this->resize();
63        break;
64
65    }
66
67  }
68
69
70}
Note: See TracBrowser for help on using the repository browser.