Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/gui/gl/glgui_fixedposition_box.cc @ 9556

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

positioning works (almost)

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